Skip to content

feat: Define the localization of a fractional ideal at a prime ideal#14237

Open
js2357 wants to merge 18 commits intomasterfrom
js2357/LocalizationAtPrime
Open

feat: Define the localization of a fractional ideal at a prime ideal#14237
js2357 wants to merge 18 commits intomasterfrom
js2357/LocalizationAtPrime

Conversation

@js2357
Copy link
Copy Markdown
Collaborator

@js2357 js2357 commented Jun 28, 2024

Define the localization of a fractional ideal at a prime ideal, and prove some basic properties.


This PR is part 3 out of 4 of a proof of isDedekindDomain_iff_isDedekindDomainDvr.
Part 4 is available here: #14242

Open in Gitpod

@github-actions github-actions bot added the new-contributor This PR was made by a contributor with at most 5 merged PRs. Welcome to the community! label Jun 28, 2024
@github-actions
Copy link
Copy Markdown

github-actions bot commented Jun 28, 2024

PR summary f5dca2297e

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference
Mathlib.RingTheory.FractionalIdeal.LocalizedAtPrime (new file) 1361

Declarations diff

+ Field.isLocalization_self
+ coe_localizedAtPrime
+ exists_smul_mem_of_mem_localizedAtPrime
+ instance : IsFractionRing Aₚ K
+ instance : IsLocalizedModule P.primeCompl (I.localizedAtPrimeInclusion P)
+ instance : IsScalarTower A Aₚ K
+ localizedAtPrime
+ localizedAtPrimeInclusion
+ localizedAtPrimeInclusion_mk
+ localizedAtPrime_add
+ localizedAtPrime_div
+ localizedAtPrime_div_le
+ localizedAtPrime_eq_zero_iff
+ localizedAtPrime_inv
+ localizedAtPrime_mul
+ localizedAtPrime_ne_zero
+ localizedAtPrime_one
+ localizedAtPrime_zero
+ mem_localizedAtPrime
+ mem_localizedAtPrime_iff
+ not_le_of_localizedAtPrime_eq_one
+ self_subset_localizedAtPrime

You can run this locally as follows
## summary with just the declaration names:
./scripts/declarations_diff.sh <optional_commit>

## more verbose report:
./scripts/declarations_diff.sh long <optional_commit>

The doc-module for script/declarations_diff.sh contains some details about this script.


No changes to technical debt.

You can run this locally as

./scripts/technical-debt-metrics.sh pr_summary
  • The relative value is the weighted sum of the differences with weight given by the inverse of the current value of the statistic.
  • The absolute value is the relative value divided by the total sum of the inverses of the current values (i.e. the weighted average of the differences).

@ghost ghost added the blocked-by-other-PR This PR depends on another PR (this label is automatically managed by a bot) label Jun 28, 2024
@js2357 js2357 changed the title (feat): Define the localization of a fractional ideal at a prime ideal feat: Define the localization of a fractional ideal at a prime ideal Jun 28, 2024
@js2357 js2357 added awaiting-review t-algebra Algebra (groups, rings, fields, etc) labels Jun 28, 2024
mathlib-bors bot pushed a commit that referenced this pull request Jun 30, 2024
Prove five lemmas about fractional ideals (zero_mem, fg_of_isNoetherianRing, den_mem_inv, num_le_mul_inv, bot_lt_mul_inv). 

This is part 1/4 of a proof of `isDedekindDomain_iff_isDedekindDomainDvr`. 
Part 2: #14216
Part 3: #14237
Part 4: #14242
@ghost ghost added the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Jun 30, 2024
dagurtomas pushed a commit that referenced this pull request Jul 2, 2024
Prove five lemmas about fractional ideals (zero_mem, fg_of_isNoetherianRing, den_mem_inv, num_le_mul_inv, bot_lt_mul_inv). 

This is part 1/4 of a proof of `isDedekindDomain_iff_isDedekindDomainDvr`. 
Part 2: #14216
Part 3: #14237
Part 4: #14242
@ghost ghost removed the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Jul 28, 2024
mathlib-bors bot pushed a commit that referenced this pull request Aug 21, 2024
…of fractional ideals (#14216)

Define the extension of a fractional ideal along a ring homomorphism, and prove some basic facts about extensions.

This PR is part 2/4 of a proof of `isDedekindDomain_iff_isDedekindDomainDvr`.
Part 1: #14099
Part 3: #14237
Part 4: #14242

- [x] depends on: #14099
@ghost ghost removed the blocked-by-other-PR This PR depends on another PR (this label is automatically managed by a bot) label Aug 21, 2024
@ghost
Copy link
Copy Markdown

ghost commented Aug 21, 2024

@ghost ghost added the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Aug 21, 2024
@ghost ghost removed the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Aug 21, 2024
@YaelDillies YaelDillies added the awaiting-author A reviewer has asked the author a question or requested changes. label Aug 27, 2024
Copy link
Copy Markdown
Contributor

@Vierkantor Vierkantor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! The results look good, nicely stated and a good coverage of the requirements. I'm still thinking a bit about the proofs, some of them feel like a lot of manual work, but perhaps that's unavoidable with the current state of the library.

Comment on lines +36 to +42
variable {A : Type*} [CommRing A] [IsDomain A] (P : Ideal A) [P.IsPrime]
variable (I : FractionalIdeal A⁰ (FractionRing A)) (J : FractionalIdeal A⁰ (FractionRing A))

local notation "Aₚ" => Localization.AtPrime P
local notation "K" => FractionRing A
local notation "hf" => nonZeroDivisors_le_comap_nonZeroDivisors_of_injective _ <|
IsLocalization.injective Aₚ P.primeCompl_le_nonZeroDivisors
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One thing to remark on here is that the library tends to prefer IsLocalization.AtPrime over Localization.AtPrime and IsFractionRing over FractionRing. It does make everything more verbose, but it helps in cases where we know a specific value for the localization. For example, FractionRing ℤ is not the same thing as . So you would end up inserting a lot of coercions and isomorphisms to identify the different localizations.

I expect in this case it's okay since we're treating localizedAtPrime as a new construction operating on a pair (Ideal, FractionalIdeal), so we don't need to insert so many explicit isomorphisms. What is your experience with using these results in your follow-up work?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wanted to define it in greater generality, but I couldn't find an easy way to get it to work. If I recall correctly, the problem was that K needs to be an Aₚ-algebra, which can't (currently) be inferred when they're defined using IsFractionRing and IsLocalization.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To answer the other question, the only follow-up work I did with this was the proof of isDedekindDomain ↔ isDedekindDomainDvr linked above. In that specific case, being stuck with FractionRing rather than IsFractionRing didn't cause any problems.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wanted to define it in greater generality, but I couldn't find an easy way to get it to work. If I recall correctly, the problem was that K needs to be an Aₚ-algebra, which can't (currently) be inferred when they're defined using IsFractionRing and IsLocalization.

Is the issue that we are missing some instances? Can you switch to the Is point of view and add them, or give some idea about problems which you can't solve using the Is approach?

Comment on lines +80 to +91
use s₂ • i₁ + s₁ • i₂, s₁ * s₂
simp only [AddSubmonoid.coe_add, coe_toAddSubmonoid, coe_smul_of_tower, smul_add]
congr 1
· rw [Submonoid.mk_smul, algebra_compatible_smul Aₚ (s₂ : A) (i₁ : K), ← mk_one_eq_algebraMap,
← smul_assoc, smul_eq_mul, mk_mul, mul_one, ← mk_mul, mk_self, mul_one]
· rw [Submonoid.mk_smul, algebra_compatible_smul Aₚ (s₁ : A) (i₂ : K), ← mk_one_eq_algebraMap,
← smul_assoc, smul_eq_mul, mk_mul, mul_comm, mul_assoc, ← mk_mul, mk_self, one_mul, mul_one]
· rintro y _ ⟨i, s, rfl⟩
refine Localization.induction_on y (fun ⟨a, s₁⟩ ↦ ⟨a • i, s₁ * s, ?_⟩)
rw [coe_smul_of_tower, ← smul_assoc, smul_comm, ← smul_assoc]
nth_rewrite 1 [← mul_one a, ← smul_eq_mul, ← smul_mk]
rw [smul_assoc a, smul_eq_mul, mk_mul, one_mul]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

More like a note to self: It feels like all these rewriting steps should be doable in a simpler way. Can we figure out a normal form for these expressions that simp can produce reliably?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I couldn't figure out a good way to do it. Writing the theorem using mk 1 s • i was already my attempt at using something that could be considered a normal form, but it doesn't want to play nice with the simplifier.

It's possible to extract the first six rewrites (which the two congr subgoals have in common) into a separate lemma. I'm not sure whether the lemma is interesting enough to be worthwhile. That might partly depend on whether we decide to redo this whole file in greater generality with IsLocalization and IsFractionRing.

As an aside, the congr 1 doesn't do anything important -- the proof still works without it. I think it's nice to have it in there for now while we're discussing how to simplify the code, but we could remove it later.

@js2357 js2357 removed the awaiting-author A reviewer has asked the author a question or requested changes. label Sep 4, 2024
bjoernkjoshanssen pushed a commit that referenced this pull request Sep 9, 2024
…of fractional ideals (#14216)

Define the extension of a fractional ideal along a ring homomorphism, and prove some basic facts about extensions.

This PR is part 2/4 of a proof of `isDedekindDomain_iff_isDedekindDomainDvr`.
Part 1: #14099
Part 3: #14237
Part 4: #14242

- [x] depends on: #14099
bjoernkjoshanssen pushed a commit that referenced this pull request Sep 9, 2024
…of fractional ideals (#14216)

Define the extension of a fractional ideal along a ring homomorphism, and prove some basic facts about extensions.

This PR is part 2/4 of a proof of `isDedekindDomain_iff_isDedekindDomainDvr`.
Part 1: #14099
Part 3: #14237
Part 4: #14242

- [x] depends on: #14099
bjoernkjoshanssen pushed a commit that referenced this pull request Sep 12, 2024
…of fractional ideals (#14216)

Define the extension of a fractional ideal along a ring homomorphism, and prove some basic facts about extensions.

This PR is part 2/4 of a proof of `isDedekindDomain_iff_isDedekindDomainDvr`.
Part 1: #14099
Part 3: #14237
Part 4: #14242

- [x] depends on: #14099
extended_add K hf I J

theorem localizedAtPrime_mul :
(I * J).localizedAtPrime P = (I.localizedAtPrime P) * (J.localizedAtPrime P) :=
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
(I * J).localizedAtPrime P = (I.localizedAtPrime P) * (J.localizedAtPrime P) :=
(I * J).localizedAtPrime P = I.localizedAtPrime P * J.localizedAtPrime P :=

and everywhere else

@YaelDillies YaelDillies added the awaiting-author A reviewer has asked the author a question or requested changes. label Sep 24, 2024
@leanprover-community-bot-assistant
Copy link
Copy Markdown
Collaborator

This pull request has conflicts, please merge master and resolve them.

@leanprover-community-bot-assistant leanprover-community-bot-assistant added the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Jul 31, 2025
@github-actions github-actions bot removed the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Jul 31, 2025
@mathlib4-merge-conflict-bot mathlib4-merge-conflict-bot added the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Nov 19, 2025
@mathlib4-merge-conflict-bot
Copy link
Copy Markdown
Collaborator

This pull request has conflicts, please merge master and resolve them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting-author A reviewer has asked the author a question or requested changes. merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) new-contributor This PR was made by a contributor with at most 5 merged PRs. Welcome to the community! t-algebra Algebra (groups, rings, fields, etc)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants