Skip to content

Commit 52e99ad

Browse files
committed
chore(RingTheory/Localization/AtPrime/Basic): use under instead of comap (algebraMap R S) (#37840)
This PR switches over from `comap (algebraMap R S)` to `under`. Co-authored-by: tb65536 <thomas.l.browning@gmail.com>
1 parent 7a589c5 commit 52e99ad

20 files changed

Lines changed: 171 additions & 149 deletions

File tree

Mathlib/AlgebraicGeometry/Noetherian.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,8 @@ theorem isNoetherianRing_of_away : IsNoetherianRing R := by
8585
use N
8686
have hN : ∀ s : S, minN s ≤ N := fun s => Finset.le_sup s.prop
8787
intro n hn
88-
rw [IsLocalization.ideal_eq_iInf_comap_map_away hS (I N),
89-
IsLocalization.ideal_eq_iInf_comap_map_away hS (I n),
88+
rw [IsLocalization.ideal_eq_iInf_under_map_away hS (I N),
89+
IsLocalization.ideal_eq_iInf_under_map_away hS (I n),
9090
iInf_subtype', iInf_subtype']
9191
apply iInf_congr
9292
intro s

Mathlib/AlgebraicGeometry/ProjectiveSpectrum/Scheme.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,8 +179,8 @@ theorem mk_mem_carrier (z : HomogeneousLocalization.NumDenSameDeg 𝒜 (.powers
179179
HomogeneousLocalization.mk z ∈ carrier x ↔ z.num.1 ∈ x.1.asHomogeneousIdeal := by
180180
rw [carrier, Ideal.mem_comap, HomogeneousLocalization.algebraMap_apply,
181181
HomogeneousLocalization.val_mk, Localization.mk_eq_mk', IsLocalization.mk'_eq_mul_mk'_one,
182-
mul_comm, Ideal.unit_mul_mem_iff_mem, ← Ideal.mem_comap,
183-
IsLocalization.comap_map_of_isPrime_disjoint (.powers f)]
182+
mul_comm, Ideal.unit_mul_mem_iff_mem, ← Ideal.mem_under,
183+
IsLocalization.under_map_of_isPrime_disjoint (.powers f)]
184184
· rfl
185185
· infer_instance
186186
· exact (disjoint_powers_iff_notMem_of_isPrime _).mpr x.2

Mathlib/RingTheory/DedekindDomain/Dvr.lean

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -72,13 +72,8 @@ theorem Ring.DimensionLEOne.localization {R : Type*} (Rₘ : Type*) [CommRing R]
7272
refine Ideal.isMaximal_def.mpr ⟨hpp.ne_top, Ideal.maximal_of_no_maximal fun P hpP hPm => ?_⟩
7373
have hpP' : (⟨p, hpp⟩ : { p : Ideal Rₘ // p.IsPrime }) < ⟨P, hPm.isPrime⟩ := hpP
7474
rw [← (IsLocalization.orderIsoOfPrime M Rₘ).lt_iff_lt] at hpP'
75-
haveI : Ideal.IsPrime (Ideal.comap (algebraMap R Rₘ) p) :=
76-
((IsLocalization.orderIsoOfPrime M Rₘ) ⟨p, hpp⟩).2.1
77-
haveI : Ideal.IsPrime (Ideal.comap (algebraMap R Rₘ) P) :=
78-
((IsLocalization.orderIsoOfPrime M Rₘ) ⟨P, hPm.isPrime⟩).2.1
79-
have hlt : Ideal.comap (algebraMap R Rₘ) p < Ideal.comap (algebraMap R Rₘ) P := hpP'
80-
refine h.not_lt_lt ⊥ (Ideal.comap _ _) (Ideal.comap _ _) ⟨?_, hlt⟩
81-
exact IsLocalization.bot_lt_comap_prime _ _ hM _ hp0⟩
75+
refine h.not_lt_lt ⊥ (p.under R) (P.under R) ⟨?_, hpP'⟩
76+
exact IsLocalization.bot_lt_under_prime _ _ hM _ hp0⟩
8277

8378
/-- The localization of a Dedekind domain is a Dedekind domain. -/
8479
theorem IsLocalization.isDedekindDomain [IsDedekindDomain A] {M : Submonoid A} (hM : M ≤ A⁰)

Mathlib/RingTheory/Etale/QuasiFinite.lean

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ lemma Algebra.exists_notMem_and_isIntegral_forall_mem_of_ne_of_liesOver
175175
rw [Ideal.disjoint_powers_iff_notMem_of_isPrime]
176176
contrapose H; exact Ideal.mul_mem_right s₃ _ (Ideal.pow_mem_of_mem _ H m hm0)
177177
have : q's.IsPrime := IsLocalization.isPrime_of_isPrime_disjoint (.powers s₂) _ _ ‹_› hq's
178-
have : q's.LiesOver q' := ⟨(IsLocalization.comap_map_of_isPrime_disjoint _ _ ‹_› hq's).symm⟩
178+
have : q's.LiesOver q' := ⟨(IsLocalization.under_map_of_isPrime_disjoint _ _ ‹_› hq's).symm⟩
179179
have : q's.LiesOver p := .trans _ q' _
180180
have := hs₁ (q's.comap (e.symm.toAlgHom.comp (IsScalarTower.toAlgHom _ _ _)).toRingHom)
181181
inferInstance (by
@@ -393,8 +393,8 @@ lemma Algebra.exists_etale_isIdempotentElem_forall_liesOver_eq
393393
let Pf := P.map (algebraMap _ (Localization.Away f))
394394
have : Pf.IsPrime := IsLocalization.isPrime_of_isPrime_disjoint (.powers f) _ _ ‹_› (by
395395
rwa [Ideal.disjoint_powers_iff_notMem_of_isPrime])
396-
have : Pf.LiesOver P := ⟨(IsLocalization.comap_map_of_isPrime_disjoint (.powers f) _ ‹_› (by
397-
rwa [Ideal.disjoint_powers_iff_notMem_of_isPrime])).symm⟩
396+
have : Pf.LiesOver P := ⟨(IsLocalization.under_map_of_isPrime_disjoint (.powers f) _ ‹_› (by
397+
rwa [Ideal.disjoint_powers_iff_notMem _ (Ideal.IsPrime.isRadical ‹_›)])).symm⟩
398398
let φ : R' ⊗[R] S →ₐ[R'] Localization.Away f ⊗[R] S :=
399399
Algebra.TensorProduct.map (Algebra.ofId _ _) (.id _ _)
400400
let := φ.toAlgebra
@@ -410,7 +410,7 @@ lemma Algebra.exists_etale_isIdempotentElem_forall_liesOver_eq
410410
change f ∉ P'.under _
411411
rwa [← P'.over_def P]
412412
have : P'f.IsPrime := IsLocalization.isPrime_of_isPrime_disjoint _ _ _ ‹_› hP'f
413-
have : P'f.LiesOver P' := ⟨(IsLocalization.comap_map_of_isPrime_disjoint _ _ ‹_› hP'f).symm⟩
413+
have : P'f.LiesOver P' := ⟨(IsLocalization.under_map_of_isPrime_disjoint _ _ ‹_› hP'f).symm⟩
414414
have : P'f.LiesOver P := .trans _ P' _
415415
have : P'f.LiesOver Pf := ⟨congr($(PrimeSpectrum.localization_comap_injective
416416
(Localization.Away f) (.powers f) (a₁ := ⟨Pf, ‹_›⟩)

Mathlib/RingTheory/Frobenius.lean

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,7 @@ lemma isArithFrobAt_localize [Q.IsPrime] : H.localize.IsArithFrobAt (maximalIdea
147147
have h : Nat.card (R ⧸ (maximalIdeal _).comap (algebraMap R (Localization.AtPrime Q))) =
148148
Nat.card (R ⧸ Q.under R) := by
149149
congr 2
150-
rw [IsScalarTower.algebraMap_eq R S (Localization.AtPrime Q), ← Ideal.comap_comap,
151-
Localization.AtPrime.comap_maximalIdeal]
150+
rw [← Ideal.under_def, ← Ideal.under_under (B := S), Localization.AtPrime.under_maximalIdeal]
152151
intro x
153152
obtain ⟨x, s, rfl⟩ := IsLocalization.exists_mk'_eq Q.primeCompl x
154153
simp only [localize, coe_mk, Localization.localRingHom_mk', RingHom.coe_coe, h,

Mathlib/RingTheory/Ideal/AssociatedPrime/Localization.lean

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ lemma mem_associatedPrimes_of_comap_mem_associatedPrimes_of_isLocalizedModule
4343
rcases ass with ⟨hp, x, hx⟩
4444
constructor
4545
· refine (IsLocalization.isPrime_iff_isPrime_disjoint S _ _).mpr
46-
⟨hp, (IsLocalization.disjoint_comap_iff S R' p).mpr ?_⟩
46+
⟨hp, (IsLocalization.disjoint_under_iff S R' p).mpr ?_⟩
4747
by_contra eqtop
4848
simp [eqtop, Ideal.comap_top, Ideal.isPrime_iff] at hp
4949
· use f x
@@ -73,7 +73,7 @@ lemma mem_associatedPrimes_atPrime_of_mem_associatedPrimes
7373
associatedPrimes (Localization.AtPrime p) (LocalizedModule.AtPrime p M) := by
7474
apply mem_associatedPrimes_of_comap_mem_associatedPrimes_of_isLocalizedModule
7575
p.primeCompl (LocalizedModule.mkLinearMap p.primeCompl M)
76-
simpa [Localization.AtPrime.comap_maximalIdeal] using ass
76+
simpa [Localization.AtPrime.under_maximalIdeal] using ass
7777

7878
@[deprecated (since := "2025-11-27")]
7979
alias mem_associatePrimes_localizedModule_atPrime_of_mem_associated_primes :=
@@ -112,7 +112,7 @@ lemma comap_mem_associatedPrimes_of_mem_associatedPrimes_of_isLocalizedModule_of
112112
apply hp.mem_of_pow_mem k
113113
rw [← map_pow]
114114
exact ((hp.under R).mul_mem_iff_mem_or_mem.mp mem).resolve_right
115-
(Set.disjoint_left.mp ((IsLocalization.disjoint_comap_iff S R' p).mpr hp.1) (∏ a, g a).2)
115+
(Set.disjoint_left.mp ((IsLocalization.disjoint_under_iff S R' p).mpr hp.1) (∏ a, g a).2)
116116

117117
variable (R')
118118

@@ -142,7 +142,7 @@ lemma minimalPrimes_annihilator_subset_associatedPrimes [IsNoetherianRing R] [Mo
142142
have ann_le : Module.annihilator R M ≤ Ideal.comap (algebraMap R Rₚ) q :=
143143
le_of_eq_of_le Submodule.annihilator_top.symm (IsAssociatedPrime.annihilator_le hq)
144144
have le : Ideal.comap (algebraMap R Rₚ) q ≤ p := by
145-
have := (IsLocalization.disjoint_comap_iff p.primeCompl Rₚ q).mpr q_prime.ne_top
145+
have := (IsLocalization.disjoint_under_iff p.primeCompl Rₚ q).mpr q_prime.ne_top
146146
simpa only [Ideal.primeCompl, Submonoid.coe_set_mk, Subsemigroup.coe_set_mk,
147147
Set.disjoint_compl_left_iff_subset] using this
148148
simpa [Minimal.eq_of_le hp.out ⟨IsAssociatedPrime.isPrime hq, ann_le⟩ le] using hq

Mathlib/RingTheory/Ideal/GoingUp.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ theorem exists_ideal_over_prime_of_isIntegral_of_isDomain [Algebra.IsIntegral R
288288
have Qₚ_max : IsMaximal (comap _ Qₚ) :=
289289
isMaximal_comap_of_isIntegral_of_isMaximal (R := Rₚ) (S := Sₚ) Qₚ
290290
refine ⟨comap (algebraMap S Sₚ) Qₚ, ⟨comap_isPrime _ Qₚ, ?_⟩⟩
291-
convert Localization.AtPrime.comap_maximalIdeal (I := P)
291+
convert Localization.AtPrime.under_maximalIdeal (I := P)
292292
rw [comap_comap, ← IsLocalRing.eq_maximalIdeal Qₚ_max,
293293
← IsLocalization.map_comp (P := S) (Q := Sₚ) (g := algebraMap R S)
294294
(M := P.primeCompl) (T := Algebra.algebraMapSubmonoid S P.primeCompl) (S := Rₚ)

Mathlib/RingTheory/Ideal/Height.lean

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -326,9 +326,9 @@ lemma ringKrullDim_le_iff_isMaximal_height_le {R : Type*} [CommRing R] (n : With
326326
norm_cast
327327
exact Ideal.height_mono hle
328328

329-
theorem IsLocalization.primeHeight_comap (S : Submonoid R) {A : Type*} [CommRing A] [Algebra R A]
329+
theorem IsLocalization.primeHeight_under (S : Submonoid R) {A : Type*} [CommRing A] [Algebra R A]
330330
[IsLocalization S A] (J : Ideal A) [J.IsPrime] :
331-
(J.comap (algebraMap R A)).primeHeight = J.primeHeight := by
331+
(J.under R).primeHeight = J.primeHeight := by
332332
rw [eq_comm, Ideal.primeHeight, Ideal.primeHeight, ← WithBot.coe_inj,
333333
Order.height_eq_krullDim_Iic, Order.height_eq_krullDim_Iic]
334334
let e := IsLocalization.orderIsoOfPrime S A
@@ -343,19 +343,25 @@ theorem IsLocalization.primeHeight_comap (S : Submonoid R) {A : Type*} [CommRing
343343
congrArg (fun I ↦ I.1) (e.right_inv ⟨_, I.1.2, H _ I.2⟩)
344344
map_rel_iff' {I₁ I₂} := @RelIso.map_rel_iff _ _ _ _ e ⟨_, I₁.1.2⟩ ⟨_, I₂.1.2⟩ }
345345

346-
theorem IsLocalization.height_comap (S : Submonoid R) {A : Type*} [CommRing A] [Algebra R A]
347-
[IsLocalization S A] (J : Ideal A) : (J.comap (algebraMap R A)).height = J.height := by
346+
@[deprecated (since := "2026-04-09")] alias IsLocalization.primeHeight_comap :=
347+
IsLocalization.primeHeight_under
348+
349+
theorem IsLocalization.height_under (S : Submonoid R) {A : Type*} [CommRing A] [Algebra R A]
350+
[IsLocalization S A] (J : Ideal A) : (J.under R).height = J.height := by
348351
rw [Ideal.height, Ideal.height]
349-
simp_rw [← IsLocalization.primeHeight_comap S, IsLocalization.minimalPrimes_comap S A,
352+
simp_rw [← IsLocalization.primeHeight_under S, IsLocalization.minimalPrimes_comap S A,
350353
← Ideal.height_eq_primeHeight, iInf_image]
351354

355+
@[deprecated (since := "2026-04-09")] alias IsLocalization.height_comap :=
356+
IsLocalization.height_under
357+
352358
theorem IsLocalization.AtPrime.ringKrullDim_eq_height (I : Ideal R) [I.IsPrime] (A : Type*)
353359
[CommRing A] [Algebra R A] [IsLocalization.AtPrime A I] :
354360
ringKrullDim A = I.height := by
355361
have := IsLocalization.AtPrime.isLocalRing A I
356362
rw [← IsLocalRing.maximalIdeal_primeHeight_eq_ringKrullDim,
357-
← IsLocalization.primeHeight_comap I.primeCompl,
358-
← IsLocalization.AtPrime.comap_maximalIdeal A I,
363+
← IsLocalization.primeHeight_under I.primeCompl,
364+
← IsLocalization.AtPrime.under_maximalIdeal A I,
359365
Ideal.height_eq_primeHeight]
360366

361367
lemma IsLocalization.height_map_of_disjoint {S : Type*} [CommRing S] [Algebra R S] (M : Submonoid R)
@@ -364,7 +370,7 @@ lemma IsLocalization.height_map_of_disjoint {S : Type*} [CommRing S] [Algebra R
364370
let P := p.map (algebraMap R S)
365371
have : P.IsPrime := isPrime_of_isPrime_disjoint M S p ‹_› h
366372
have := isLocalization_isLocalization_atPrime_isLocalization (M := M) (Localization.AtPrime P) P
367-
simp_rw [P, comap_map_of_isPrime_disjoint M S _ h] at this
373+
simp_rw [P, under_map_of_isPrime_disjoint M S _ h] at this
368374
have := ringKrullDim_eq_of_ringEquiv (IsLocalization.algEquiv p.primeCompl
369375
(Localization.AtPrime P) (Localization.AtPrime p)).toRingEquiv
370376
rw [AtPrime.ringKrullDim_eq_height P, AtPrime.ringKrullDim_eq_height p] at this

Mathlib/RingTheory/Ideal/KrullsHeightTheorem.lean

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -109,10 +109,10 @@ lemma Ideal.height_le_one_of_isPrincipal_of_mem_minimalPrimes
109109
have := hp.1.1
110110
let f := algebraMap R (Localization.AtPrime p)
111111
have := Ideal.height_le_one_of_isPrincipal_of_mem_minimalPrimes_of_isLocalRing (I.map f) ?_
112-
· rwa [← IsLocalization.height_comap p.primeCompl,
113-
Localization.AtPrime.comap_maximalIdeal] at this
112+
· rwa [← IsLocalization.height_under p.primeCompl,
113+
Localization.AtPrime.under_maximalIdeal] at this
114114
· rwa [IsLocalization.minimalPrimes_map p.primeCompl (Localization.AtPrime p) I,
115-
Set.mem_preimage, Localization.AtPrime.comap_maximalIdeal]
115+
Set.mem_preimage, Localization.AtPrime.under_maximalIdeal]
116116

117117
theorem Ideal.map_height_le_one_of_mem_minimalPrimes {I p : Ideal R} {x : R}
118118
(hp : p ∈ (I ⊔ span {x}).minimalPrimes) : (p.map (Ideal.Quotient.mk I)).height ≤ 1 :=
@@ -198,8 +198,8 @@ nonrec lemma Ideal.height_le_spanRank_toENat_of_mem_minimalPrimes
198198
simp_all
199199
| succ n =>
200200
wlog hR : ∃ (_ : IsLocalRing R), p = maximalIdeal R
201-
· rw [← Localization.AtPrime.comap_maximalIdeal (I := p)] at hp ⊢
202-
rw [IsLocalization.height_comap p.primeCompl]
201+
· rw [← Localization.AtPrime.under_maximalIdeal (I := p)] at hp ⊢
202+
rw [IsLocalization.height_under p.primeCompl]
203203
rw [← Set.mem_preimage, ← IsLocalization.minimalPrimes_map p.primeCompl, map_span] at hp
204204
exact this _ (s.image (algebraMap R (Localization p.primeCompl))) (by simpa using hp)
205205
inferInstance _ H (Finset.card_image_le.trans hn) ⟨inferInstance, rfl⟩

Mathlib/RingTheory/Ideal/MinimalPrime/Localization.lean

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ section
179179
variable {R : Type*} [CommSemiring R] (S : Submonoid R) (A : Type*) [CommSemiring A] [Algebra R A]
180180

181181
theorem IsLocalization.minimalPrimes_map [IsLocalization S A] (J : Ideal R) :
182-
(J.map (algebraMap R A)).minimalPrimes = Ideal.comap (algebraMap R A) ⁻¹' J.minimalPrimes := by
182+
(J.map (algebraMap R A)).minimalPrimes = Ideal.under R ⁻¹' J.minimalPrimes := by
183183
ext p
184184
constructor
185185
· intro hp
@@ -191,22 +191,22 @@ theorem IsLocalization.minimalPrimes_map [IsLocalization S A] (J : Ideal R) :
191191
refine (Ideal.comap_mono <|
192192
hp.2 ⟨?_, Ideal.map_mono hI.2⟩ (Ideal.map_le_iff_le_comap.mpr e)).trans_eq ?_
193193
· exact IsLocalization.isPrime_of_isPrime_disjoint S A I hI.1 hI'
194-
· exact IsLocalization.comap_map_of_isPrime_disjoint S A hI.1 hI'
194+
· exact IsLocalization.under_map_of_isPrime_disjoint S A hI.1 hI'
195195
· intro hp
196196
refine ⟨⟨?_, Ideal.map_le_iff_le_comap.mpr hp.1.2⟩, ?_⟩
197-
· rw [IsLocalization.isPrime_iff_isPrime_disjoint S A, IsLocalization.disjoint_comap_iff S]
197+
· rw [IsLocalization.isPrime_iff_isPrime_disjoint S A, IsLocalization.disjoint_under_iff S]
198198
refine ⟨hp.1.1, ?_⟩
199199
rintro rfl
200200
exact hp.1.1.ne_top rfl
201201
· intro I hI e
202-
rw [← IsLocalization.map_comap S A I, ← IsLocalization.map_comap S A p]
202+
rw [← IsLocalization.map_under S A I, ← IsLocalization.map_under S A p]
203203
haveI := hI.1
204204
exact Ideal.map_mono (hp.2 ⟨Ideal.IsPrime.comap _, Ideal.map_le_iff_le_comap.mp hI.2
205205
(Ideal.comap_mono e))
206206

207207
theorem IsLocalization.minimalPrimes_comap [IsLocalization S A] (J : Ideal A) :
208208
(J.comap (algebraMap R A)).minimalPrimes = Ideal.comap (algebraMap R A) '' J.minimalPrimes := by
209-
conv_rhs => rw [← map_comap S A J, minimalPrimes_map S]
209+
conv_rhs => rw [← map_under S A J, minimalPrimes_map S]
210210
refine (Set.image_preimage_eq_iff.mpr ?_).symm
211211
exact subset_trans (Ideal.minimalPrimes_comap_subset (algebraMap R A) J) (by simp)
212212

@@ -217,12 +217,12 @@ theorem IsLocalization.AtPrime.radical_map_of_mem_minimalPrimes
217217
have : IsLocalRing A := AtPrime.isLocalRing A q
218218
rw [← Ideal.sInf_minimalPrimes, IsLocalization.minimalPrimes_map q.primeCompl A I]
219219
refine le_antisymm (sInf_le ?_) (le_sInf fun J hJ ↦ ?_)
220-
· rwa [Set.mem_preimage, AtPrime.map_eq_maximalIdeal q A, AtPrime.comap_maximalIdeal A q]
221-
· rw [← IsLocalization.comap_le_comap_iff q.primeCompl A,
222-
AtPrime.map_eq_maximalIdeal q A, AtPrime.comap_maximalIdeal A q]
220+
· rwa [Set.mem_preimage, map_eq_maximalIdeal q A, under_maximalIdeal A q]
221+
· rw [← IsLocalization.under_le_under_iff q.primeCompl A,
222+
AtPrime.map_eq_maximalIdeal q A, AtPrime.under_maximalIdeal A q]
223223
apply hIq.2 hJ.1
224224
have := hJ.1.1.ne_top
225-
rw [ne_eq, Ideal.comap_eq_top_iff, ← ne_eq, ← disjoint_comap_iff q.primeCompl A J] at this
225+
rw [ne_eq, Ideal.comap_eq_top_iff, ← ne_eq, ← disjoint_under_iff q.primeCompl A J] at this
226226
exact Set.disjoint_compl_left_iff_subset.mp this
227227

228228
end

0 commit comments

Comments
 (0)