diff --git a/Mathlib/RingTheory/Ideal/AssociatedPrime/Localization.lean b/Mathlib/RingTheory/Ideal/AssociatedPrime/Localization.lean index 37909f3465e6de..2d07b507186198 100644 --- a/Mathlib/RingTheory/Ideal/AssociatedPrime/Localization.lean +++ b/Mathlib/RingTheory/Ideal/AssociatedPrime/Localization.lean @@ -131,10 +131,11 @@ variable (R M) in lemma minimalPrimes_annihilator_subset_associatedPrimes [IsNoetherianRing R] [Module.Finite R M] : (Module.annihilator R M).minimalPrimes ⊆ associatedPrimes R M := by intro p hp - have prime := hp.1.1 + have prime := Ideal.minimalPrimes_isPrime hp let Rₚ := Localization.AtPrime p have : Nontrivial (LocalizedModule p.primeCompl M) := by - simpa [← Module.mem_support_iff (p := ⟨p, prime⟩), Module.support_eq_zeroLocus] using hp.1.2 + simpa [← Module.mem_support_iff (p := ⟨p, prime⟩), Module.support_eq_zeroLocus] using + Ideal.le_minimalPrimes hp rcases associatedPrimes.nonempty Rₚ (LocalizedModule p.primeCompl M) with ⟨q, hq⟩ have q_prime : q.IsPrime := IsAssociatedPrime.isPrime hq simp only [← preimage_comap_associatedPrimes_eq_associatedPrimes_of_isLocalizedModule p.primeCompl diff --git a/Mathlib/RingTheory/Ideal/Height.lean b/Mathlib/RingTheory/Ideal/Height.lean index 5fdceffbe8f0a6..dd5ca9b542be75 100644 --- a/Mathlib/RingTheory/Ideal/Height.lean +++ b/Mathlib/RingTheory/Ideal/Height.lean @@ -117,7 +117,7 @@ theorem Ideal.height_mono {I J : Ideal R} (h : I ≤ J) : I.height ≤ J.height simp only [height] refine le_iInf₂ (fun p hp ↦ ?_) have := Ideal.minimalPrimes_isPrime hp - obtain ⟨q, hq, e⟩ := Ideal.exists_minimalPrimes_le (h.trans hp.1.2) + obtain ⟨q, hq, e⟩ := Ideal.exists_minimalPrimes_le (h.trans (Ideal.le_minimalPrimes hp)) haveI := Ideal.minimalPrimes_isPrime hq exact (iInf₂_le q hq).trans (Ideal.primeHeight_mono e) @@ -130,8 +130,8 @@ lemma Ideal.height_strict_mono_of_is_prime {I J : Ideal R} [I.IsPrime] exact I.primeHeight_lt_top · rw [← ENat.add_one_le_iff I.primeHeight_ne_top, Ideal.height] refine le_iInf₂ (fun K hK ↦ ?_) - haveI := Ideal.minimalPrimes_isPrime hK - have : I < K := lt_of_lt_of_le h hK.1.2 + have := Ideal.minimalPrimes_isPrime hK + have : I < K := lt_of_lt_of_le h (Ideal.le_minimalPrimes hK) exact Ideal.primeHeight_add_one_le_of_lt this /-- A prime ideal of finite height is equal to any ideal that contains it with no greater height. -/ @@ -184,10 +184,10 @@ lemma Ideal.mem_minimalPrimes_of_height_eq {I J : Ideal R} (e : I ≤ J) [J.IsPr obtain ⟨p, h₁, h₂⟩ := Ideal.exists_minimalPrimes_le e convert h₁ refine (eq_of_le_of_not_lt h₂ fun h₃ ↦ ?_).symm - have := h₁.1.1 + have := Ideal.minimalPrimes_isPrime h₁ have := finiteHeight_of_le h₂ IsPrime.ne_top' - exact lt_irrefl _ - ((height_strict_mono_of_is_prime h₃).trans_le (e'.trans <| height_mono h₁.1.2)) + exact lt_irrefl _ ((height_strict_mono_of_is_prime h₃).trans_le + (e'.trans <| height_mono (Ideal.le_minimalPrimes h₁))) /-- A prime ideal has height zero if and only if it is minimal -/ lemma Ideal.primeHeight_eq_zero_iff {I : Ideal R} [I.IsPrime] : @@ -206,7 +206,9 @@ lemma Ideal.primeHeight_eq_zero_iff {I : Ideal R} [I.IsPrime] : lemma Ideal.height_bot [Nontrivial R] : (⊥ : Ideal R).height = 0 := by obtain ⟨p, hp⟩ := Ideal.nonempty_minimalPrimes (R := R) (I := ⊥) top_ne_bot.symm simp only [Ideal.height, ENat.iInf_eq_zero] - exact ⟨p, hp, haveI := hp.1.1; primeHeight_eq_zero_iff.mpr hp⟩ + refine ⟨p, hp, ?_⟩ + have := Ideal.minimalPrimes_isPrime hp + rw [primeHeight_eq_zero_iff.mpr hp] /-- In a trivial commutative ring, the height of any ideal is `∞`. -/ @[simp, nontriviality] @@ -286,7 +288,7 @@ lemma RingEquiv.height_comap {S : Type*} [CommRing S] (e : R ≃+* S) (I : Ideal rw [← Ideal.comap_coe, Ideal.comap_minimalPrimes_eq_of_surjective (f := (↑e : R →+* S)) e.surjective] exact e.idealComapOrderIso.injective.mem_set_image.symm - · have : J.IsPrime := h.1.1 + · have : J.IsPrime := Ideal.minimalPrimes_isPrime h simp only [EquivLike.coe_coe, RingEquiv.idealComapOrderIso_apply, ← Ideal.height_eq_primeHeight, RingEquiv.height_comap_of_isPrime] @@ -380,7 +382,7 @@ lemma exists_spanRank_le_and_le_height_of_le_height [IsNoetherianRing R] (I : Id refine (Ideal.subset_union_prime ⊥ ⊥ ?_).not.mpr ?_ · rintro K hK - - rw [Set.Finite.mem_toFinset] at hK - exact hK.1.1.1 + exact Ideal.minimalPrimes_isPrime hK.1 · push Not intro K hK e have := hr.trans (Ideal.height_mono e) @@ -396,7 +398,7 @@ lemma exists_spanRank_le_and_le_height_of_le_height [IsNoetherianRing R] (I : Id push_cast exact add_le_add h₂ ((Submodule.spanRank_span_le_card _).trans (by simp)) · refine le_iInf₂ (fun p hp ↦ ?_) - have := hp.1.1 + have := Ideal.minimalPrimes_isPrime hp by_cases h : p.height = ⊤ · rw [← p.height_eq_primeHeight, h] exact le_top @@ -413,9 +415,10 @@ lemma exists_spanRank_le_and_le_height_of_le_height [IsNoetherianRing R] (I : Id apply le_antisymm · rwa [← p.height_eq_primeHeight] · rwa [← e] - refine ⟨mem_minimalPrimes_of_primeHeight_eq_height (le_sup_left.trans hp.1.2) this.symm, ?_⟩ + refine ⟨mem_minimalPrimes_of_primeHeight_eq_height + (le_sup_left.trans (Ideal.le_minimalPrimes hp)) this.symm, ?_⟩ rwa [p.height_eq_primeHeight, eq_comm] - · exact hp.1.2 <| Ideal.mem_sup_right <| Ideal.subset_span <| Set.mem_singleton x + · exact (Ideal.le_minimalPrimes hp) <| Ideal.mem_sup_right <| mem_span_singleton_self x /-- In a nontrivial commutative ring `R`, the supremum of heights of all ideals is equal to the Krull dimension of `R`. -/ diff --git a/Mathlib/RingTheory/Ideal/KrullsHeightTheorem.lean b/Mathlib/RingTheory/Ideal/KrullsHeightTheorem.lean index 0d273c352d3b7b..f34d9276bde91f 100644 --- a/Mathlib/RingTheory/Ideal/KrullsHeightTheorem.lean +++ b/Mathlib/RingTheory/Ideal/KrullsHeightTheorem.lean @@ -83,7 +83,7 @@ lemma Ideal.height_le_one_of_isPrincipal_of_mem_minimalPrimes_of_isLocalRing ← (IsLocalization.orderEmbedding q.primeCompl (Localization.AtPrime q)).map_rel_iff] refine Submodule.le_of_le_smul_of_le_jacobson_bot (I := I) (IsNoetherian.noetherian _) ?_ ?_ · rw [IsLocalRing.jacobson_eq_maximalIdeal] - exacts [hp.1.2, bot_ne_top] + exacts [Ideal.le_minimalPrimes hp, bot_ne_top] · replace hn := congr(Ideal.comap (Ideal.Quotient.mk I) $(hn _ n.le_succ)) simp only [qs, OrderHom.coe_mk, ← RingHom.ker_eq_comap_bot, Ideal.mk_ker, Ideal.comap_map_of_surjective _ Ideal.Quotient.mk_surjective] at hn @@ -106,7 +106,7 @@ lemma Ideal.height_le_one_of_isPrincipal_of_mem_minimalPrimes_of_isLocalRing has height at most 1. -/ lemma Ideal.height_le_one_of_isPrincipal_of_mem_minimalPrimes (I : Ideal R) [I.IsPrincipal] (p : Ideal R) (hp : p ∈ I.minimalPrimes) : p.height ≤ 1 := by - have := hp.1.1 + have := Ideal.minimalPrimes_isPrime hp let f := algebraMap R (Localization.AtPrime p) have := Ideal.height_le_one_of_isPrincipal_of_mem_minimalPrimes_of_isLocalRing (I.map f) ?_ · rwa [← IsLocalization.height_comap p.primeCompl, @@ -117,14 +117,15 @@ lemma Ideal.height_le_one_of_isPrincipal_of_mem_minimalPrimes theorem Ideal.map_height_le_one_of_mem_minimalPrimes {I p : Ideal R} {x : R} (hp : p ∈ (I ⊔ span {x}).minimalPrimes) : (p.map (Ideal.Quotient.mk I)).height ≤ 1 := let f := Ideal.Quotient.mk I - have : p.IsPrime := hp.1.1 - have hfp : RingHom.ker f ≤ p := I.mk_ker.trans_le (le_sup_left.trans hp.1.2) + have : p.IsPrime := Ideal.minimalPrimes_isPrime hp + have hfp : RingHom.ker f ≤ p := I.mk_ker.trans_le (le_sup_left.trans (Ideal.le_minimalPrimes hp)) height_le_one_of_isPrincipal_of_mem_minimalPrimes ((span {x}).map f) (p.map f) - ⟨⟨map_isPrime_of_surjective Quotient.mk_surjective hfp, map_mono (le_sup_right.trans hp.1.2)⟩, - fun _ ⟨hr, hxr⟩ hrp ↦ map_le_iff_le_comap.mpr <| hp.2 ⟨hr.comap f, sup_le_iff.mpr - ⟨I.mk_ker.symm.trans_le <| ker_le_comap (Ideal.Quotient.mk I), le_comap_of_map_le hxr⟩⟩ <| - (comap_mono hrp).trans <| Eq.le <| - (p.comap_map_of_surjective _ Quotient.mk_surjective).trans <| sup_eq_left.mpr hfp⟩ + ⟨⟨map_isPrime_of_surjective Quotient.mk_surjective hfp, + map_mono (le_sup_right.trans (Ideal.le_minimalPrimes hp))⟩, + fun _ ⟨hr, hxr⟩ hrp ↦ map_le_iff_le_comap.mpr <| hp.2 ⟨hr.comap f, sup_le_iff.mpr + ⟨I.mk_ker.symm.trans_le <| ker_le_comap (Ideal.Quotient.mk I), le_comap_of_map_le hxr⟩⟩ <| + (comap_mono hrp).trans <| Eq.le <| + (p.comap_map_of_surjective _ Quotient.mk_surjective).trans <| sup_eq_left.mpr hfp⟩ /-- If `q < p` are prime ideals such that `p` is minimal over `span (s ∪ {x})` and `t` is a set contained in `q` such that `s ⊆ √span (t ∪ {x})`, then `q` is minimal over `span t`. @@ -152,7 +153,8 @@ theorem Ideal.mem_minimalPrimes_span_of_mem_minimalPrimes_span_insert {q p : Ide rwa [comap_map_of_surjective f hf, ← RingHom.ker_eq_comap_bot, mk_ker, sup_eq_left.mpr hI'q] at this refine height_le_one_of_isPrincipal_of_mem_minimalPrimes ((span {x}).map f) (p.map f) ⟨⟨this, - map_mono <| span_le.mpr <| Set.singleton_subset_iff.mpr <| hp.1.2 <| subset_span <| .inl rfl⟩, + map_mono <| span_le.mpr <| Set.singleton_subset_iff.mpr <| (Ideal.le_minimalPrimes hp) <| + subset_span <| .inl rfl⟩, fun r ⟨hr, hxr⟩ hrp ↦ map_le_iff_le_comap.mpr (hp.2 ⟨hr.comap f, ?_⟩ ?_)⟩ · rw [span_le, Set.insert_subset_iff] have := map_le_iff_le_comap.mp hxr (subset_span rfl) @@ -176,7 +178,7 @@ nonrec lemma Ideal.height_le_spanRank_toENat_of_mem_minimal_primes induction hn : s.card using Nat.strong_induction_on generalizing R with | h n H => replace hn : s.card ≤ n := hn.le - have := hp.1.1 + have := Ideal.minimalPrimes_isPrime hp cases n with | zero => rw [ENat.coe_zero, nonpos_iff_eq_zero, height_eq_primeHeight p, @@ -204,7 +206,7 @@ nonrec lemma Ideal.height_le_spanRank_toENat_of_mem_minimal_primes ⟨le_sup_left, x, mem_sup_right (mem_span_singleton_self _), hxq⟩).trans_le hJ) ((le_maximalIdeal hJ'.ne_top).lt_of_not_ge h) have h : (s' : Set R) ⊆ (q ⊔ span {x}).radical := by - have := hp.1.2.trans this + have := (Ideal.le_minimalPrimes hp).trans this rw [span_le, Finset.coe_insert, Set.insert_subset_iff] at this exact this.2 obtain ⟨t, ht, hspan⟩ := exists_subset_radical_span_sup_of_subset_radical_sup _ _ _ h @@ -239,7 +241,7 @@ lemma Ideal.height_le_spanRank_toENat (I : Ideal R) (hI : I ≠ ⊤) : obtain ⟨J, hJ⟩ := nonempty_minimalPrimes hI refine (iInf₂_le J hJ).trans ?_ convert (I.height_le_spanRank_toENat_of_mem_minimal_primes J hJ) - exact Eq.symm (@height_eq_primeHeight _ _ J hJ.1.1) + exact (@height_eq_primeHeight _ _ J (Ideal.minimalPrimes_isPrime hJ)).symm lemma Ideal.height_le_spanFinrank (I : Ideal R) (hI : I ≠ ⊤) : I.height ≤ I.spanFinrank := by @@ -318,7 +320,8 @@ lemma Ideal.height_le_height_add_spanFinrank_of_le {I p : Ideal R} [p.IsPrime] ( let p' := p.map (algebraMap R (R ⧸ I)) have : p'.IsPrime := isPrime_map_quotientMk_of_isPrime hrp obtain ⟨s, hps, hs⟩ := exists_finset_card_eq_height_of_isNoetherianRing p' - have hsp' : (s : Set (R ⧸ I)) ⊆ (p' : Set _) := fun _ hx ↦ hps.1.2 (subset_span hx) + have hsp' : (s : Set (R ⧸ I)) ⊆ (p' : Set _) := + fun _ hx ↦ (Ideal.le_minimalPrimes hps) (subset_span hx) have : Set.SurjOn (Ideal.Quotient.mk I) p s := by refine Set.SurjOn.mono subset_rfl hsp' fun x hx ↦ ?_ obtain ⟨x, rfl⟩ := Ideal.Quotient.mk_surjective x @@ -415,7 +418,7 @@ lemma Ideal.height_le_height_add_of_liesOver [IsNoetherianRing S] (p : Ideal R) let P' := P.map (Ideal.Quotient.mk <| p.map (algebraMap R S)) obtain ⟨s', hP', heq'⟩ := P'.exists_finset_card_eq_height_of_isNoetherianRing have hsP'sub : (s' : Set <| S ⧸ (Ideal.map (algebraMap R S) p)) ⊆ (P' : Set <| S ⧸ _) := - fun x hx ↦ hP'.1.2 (Ideal.subset_span hx) + fun x hx ↦ (Ideal.le_minimalPrimes hP') (Ideal.subset_span hx) have : Set.SurjOn (Ideal.Quotient.mk (p.map (algebraMap R S))) P s' := by refine Set.SurjOn.mono subset_rfl hsP'sub fun x hx ↦ ?_ obtain ⟨y, rfl⟩ := Ideal.Quotient.mk_surjective x diff --git a/Mathlib/RingTheory/Ideal/MinimalPrime/Basic.lean b/Mathlib/RingTheory/Ideal/MinimalPrime/Basic.lean index 6338b28d7d2623..689fddcfb9f092 100644 --- a/Mathlib/RingTheory/Ideal/MinimalPrime/Basic.lean +++ b/Mathlib/RingTheory/Ideal/MinimalPrime/Basic.lean @@ -54,6 +54,12 @@ variable {I J} theorem Ideal.minimalPrimes_isPrime {p : Ideal R} (h : p ∈ I.minimalPrimes) : p.IsPrime := h.1.1 +theorem Ideal.le_minimalPrimes {p : Ideal R} (h : p ∈ I.minimalPrimes) : I ≤ p := + h.1.2 + +theorem minimalPrimes_isPrime {p : Ideal R} (h : p ∈ minimalPrimes R) : p.IsPrime := + h.1.1 + theorem Ideal.exists_minimalPrimes_le [J.IsPrime] (e : I ≤ J) : ∃ p ∈ I.minimalPrimes, p ≤ J := by set S := { p : (Ideal R)ᵒᵈ | Ideal.IsPrime p ∧ I ≤ OrderDual.ofDual p } suffices h : ∃ m, OrderDual.toDual J ≤ m ∧ Maximal (· ∈ S) m by @@ -117,17 +123,17 @@ theorem Ideal.minimalPrimes_eq_subsingleton (hI : I.IsPrimary) : I.minimalPrimes ext J constructor · exact fun H => - let e := H.1.1.radical_le_iff.mpr H.1.2 + let e := (Ideal.minimalPrimes_isPrime H).radical_le_iff.mpr (Ideal.le_minimalPrimes H) (H.2 ⟨Ideal.isPrime_radical hI, Ideal.le_radical⟩ e).antisymm e · rintro (rfl : J = I.radical) exact ⟨⟨Ideal.isPrime_radical hI, Ideal.le_radical⟩, fun _ H _ => H.1.radical_le_iff.mpr H.2⟩ theorem Ideal.minimalPrimes_eq_subsingleton_self [I.IsPrime] : I.minimalPrimes = {I} := by ext J - constructor - · exact fun H => (H.2 ⟨inferInstance, rfl.le⟩ H.1.2).antisymm H.1.2 - · rintro (rfl : J = I) - exact ⟨⟨inferInstance, rfl.le⟩, fun _ h _ => h.2⟩ + refine ⟨fun H => (H.2 ⟨inferInstance, rfl.le⟩ (Ideal.le_minimalPrimes H)).antisymm + (Ideal.le_minimalPrimes H), ?_⟩ + rintro (rfl : J = I) + exact ⟨⟨inferInstance, rfl.le⟩, fun _ h _ => h.2⟩ variable (R) in theorem IsDomain.minimalPrimes_eq_singleton_bot [IsDomain R] : @@ -144,7 +150,7 @@ theorem Ideal.minimalPrimes_top : (⊤ : Ideal R).minimalPrimes = ∅ := by ext p simp only [Set.notMem_empty, iff_false] intro h - exact h.1.1.ne_top (top_le_iff.mp h.1.2) + exact (Ideal.minimalPrimes_isPrime h).ne_top (top_le_iff.mp (Ideal.le_minimalPrimes h)) theorem Ideal.minimalPrimes_eq_empty_iff (I : Ideal R) : I.minimalPrimes = ∅ ↔ I = ⊤ := by @@ -163,7 +169,8 @@ lemma Ideal.mem_minimalPrimes_sup {R : Type*} [CommRing R] {p I J : Ideal R} [p. p ∈ (I ⊔ J).minimalPrimes := by refine ⟨⟨‹_›, ?_⟩, fun q ⟨_, hq⟩ hqp ↦ ?_⟩ · rw [sup_le_iff] - exact ⟨hle, by simpa [hle] using Ideal.comap_mono (f := Ideal.Quotient.mk I) h.1.2⟩ + refine ⟨hle, ?_⟩ + simpa [hle] using Ideal.comap_mono (f := Ideal.Quotient.mk I) (Ideal.le_minimalPrimes h) · rw [sup_le_iff] at hq have h2 : p.map (Quotient.mk I) ≤ q.map (Quotient.mk I) := h.2 ⟨isPrime_map_quotientMk_of_isPrime hq.1, map_mono hq.2⟩ (map_mono hqp) @@ -183,7 +190,7 @@ lemma Ideal.map_sup_mem_minimalPrimes_of_map_quotientMk_mem_minimalPrimes refine ⟨⟨inferInstance, sup_le_iff.mpr ?_⟩, fun q ⟨_, hleq⟩ hqle ↦ ?_⟩ · refine ⟨?_, hJP⟩ rw [Ideal.map_le_iff_le_comap, ← Ideal.under_def, ← Ideal.over_def P p] - exact hI.1.2 + exact Ideal.le_minimalPrimes hI · simp only [sup_le_iff] at hleq have h1 : p.map (algebraMap R S) ≤ q := by rw [Ideal.map_le_iff_le_comap] diff --git a/Mathlib/RingTheory/Ideal/MinimalPrime/Colon.lean b/Mathlib/RingTheory/Ideal/MinimalPrime/Colon.lean index 96c9fc3a99afe8..4b76a27a9235e3 100644 --- a/Mathlib/RingTheory/Ideal/MinimalPrime/Colon.lean +++ b/Mathlib/RingTheory/Ideal/MinimalPrime/Colon.lean @@ -48,7 +48,8 @@ theorem exists_eq_colon_of_mem_minimalPrimes [IsNoetherianRing R] refine ⟨n, hn0, ((h.toFinset.erase I).inf id) ^ n, hn, ?_⟩ have (K : Ideal R) (hKI : K ≤ I) (hK : K ∈ ann.minimalPrimes) : K = I := le_antisymm hKI (hI.2 hK.1 hKI) - simpa [hI.1.1.pow_le_iff hn0, hI.1.1.inf_le', imp_not_comm, not_imp_not] + simpa [(Ideal.minimalPrimes_isPrime hI).pow_le_iff hn0, + (Ideal.minimalPrimes_isPrime hI).inf_le', imp_not_comm, not_imp_not] obtain ⟨hn0, J, hJ, hJI⟩ := Nat.find_spec key -- let `n` be minimal such that there exists an ideal `J` with `I ^ n * J ≤ ann` and `¬ J ≠ I` set n := Nat.find key @@ -74,9 +75,7 @@ theorem exists_eq_colon_of_mem_minimalPrimes [IsNoetherianRing R] -- let `z` be the product of these finitely many `f y`'s let z := ∏ y ∈ s, f y -- then `z ∉ I` - have hz : z ∉ I := by - simp only [z, hI.1.1.prod_mem_iff, not_exists, not_and_or] - exact fun i ↦ Or.inr (h i) + have hz : z ∉ I := by simp [z, (Ideal.minimalPrimes_isPrime hI).prod_mem_iff, h] -- and `K ≤ colon N {z • x}` have hz' : K ≤ colon N {z • x} := by rw [← (map_injective_of_injective K.subtype_injective).eq_iff, map_subtype_top] at hs @@ -92,11 +91,12 @@ theorem exists_eq_colon_of_mem_minimalPrimes [IsNoetherianRing R] simpa only [ann, mem_colon_singleton, mul_comm, mul_smul] using hz' hi -- but now `K = I ^ (n - 1) * J` contradicts the minimality of `n` have hK : I ^ (n - 1) * (J * Ideal.span {z}) ≤ ann ∧ ¬ J * Ideal.span {z} ≤ I := by - rw [← mul_assoc, hI.1.1.mul_le, not_or, Ideal.span_singleton_le_iff_mem] + rw [← mul_assoc, (Ideal.minimalPrimes_isPrime hI).mul_le, not_or, + Ideal.span_singleton_le_iff_mem] exact ⟨hz', hJI, hz⟩ by_cases hn' : n - 1 = 0 · simp [K, show n = 1 by grind] at hz' - exact (hK.2 (hz'.trans hI.1.2)).elim + exact (hK.2 (hz'.trans (Ideal.le_minimalPrimes hI))).elim · grind [Nat.find_min' key ⟨hn', J * Ideal.span {z}, hK⟩] end Submodule diff --git a/Mathlib/RingTheory/Ideal/MinimalPrime/Localization.lean b/Mathlib/RingTheory/Ideal/MinimalPrime/Localization.lean index 7d76dbf783fb02..5b07cd7cc83ae0 100644 --- a/Mathlib/RingTheory/Ideal/MinimalPrime/Localization.lean +++ b/Mathlib/RingTheory/Ideal/MinimalPrime/Localization.lean @@ -65,8 +65,8 @@ theorem Ideal.iUnion_minimalPrimes : · rintro ⟨y, hy, hx⟩ obtain ⟨p, hp, hyp⟩ : ∃ p ∈ I.minimalPrimes, y ∉ p := by simpa [← Ideal.sInf_minimalPrimes] using hy - refine ⟨p, hp, (hp.1.1.mem_or_mem ?_).resolve_right hyp⟩ - exact hp.1.1.radical_le_iff.mpr hp.1.2 hx + refine ⟨p, hp, ((Ideal.minimalPrimes_isPrime hp).mem_or_mem ?_).resolve_right hyp⟩ + exact (Ideal.minimalPrimes_isPrime hp).radical_le_iff.mpr (Ideal.le_minimalPrimes hp) hx theorem Ideal.exists_mul_mem_of_mem_minimalPrimes {p : Ideal R} (hp : p ∈ I.minimalPrimes) {x : R} (hx : x ∈ p) : @@ -97,8 +97,8 @@ lemma Ideal.disjoint_nonZeroDivisors_of_mem_minimalPrimes {p : Ideal R} (hp : p theorem Ideal.exists_comap_eq_of_mem_minimalPrimes {I : Ideal S} (f : R →+* S) (p) (H : p ∈ (I.comap f).minimalPrimes) : ∃ p' : Ideal S, p'.IsPrime ∧ I ≤ p' ∧ p'.comap f = p := - have := H.1.1 - have ⟨p', hIp', hp', le⟩ := exists_ideal_comap_le_prime p I H.1.2 + have := Ideal.minimalPrimes_isPrime H + have ⟨p', hIp', hp', le⟩ := exists_ideal_comap_le_prime p I (Ideal.le_minimalPrimes H) ⟨p', hp', hIp', le.antisymm (H.2 ⟨inferInstance, comap_mono hIp'⟩ le)⟩ @[stacks 00FK] theorem Ideal.exists_comap_eq_of_mem_minimalPrimes_of_injective {f : R →+* S} @@ -113,9 +113,9 @@ theorem Ideal.exists_minimalPrimes_comap_eq {I : Ideal S} (f : R →+* S) (p) obtain ⟨p', h₁, h₂, h₃⟩ := Ideal.exists_comap_eq_of_mem_minimalPrimes f p H obtain ⟨q, hq, hq'⟩ := Ideal.exists_minimalPrimes_le h₂ refine ⟨q, hq, Eq.symm ?_⟩ - have := hq.1.1 + have := Ideal.minimalPrimes_isPrime hq have := (Ideal.comap_mono hq').trans_eq h₃ - exact (H.2 ⟨inferInstance, Ideal.comap_mono hq.1.2⟩ this).antisymm this + exact (H.2 ⟨inferInstance, Ideal.comap_mono (Ideal.le_minimalPrimes hq)⟩ this).antisymm this theorem Ideal.minimalPrimes_comap_subset (f : R →+* S) (J : Ideal S) : (J.comap f).minimalPrimes ⊆ Ideal.comap f '' J.minimalPrimes := @@ -129,8 +129,8 @@ variable {R S : Type*} [CommRing R] [CommRing S] {I J : Ideal R} theorem Ideal.minimal_primes_comap_of_surjective {f : R →+* S} (hf : Function.Surjective f) {I J : Ideal S} (h : J ∈ I.minimalPrimes) : J.comap f ∈ (I.comap f).minimalPrimes := by - have := h.1.1 - refine ⟨⟨inferInstance, Ideal.comap_mono h.1.2⟩, ?_⟩ + have := Ideal.minimalPrimes_isPrime h + refine ⟨⟨inferInstance, Ideal.comap_mono (Ideal.le_minimalPrimes h)⟩, ?_⟩ rintro K ⟨hK, e₁⟩ e₂ have : RingHom.ker f ≤ K := (Ideal.comap_mono bot_le).trans e₁ rw [← sup_eq_left.mpr this, RingHom.ker_eq_comap_bot, ← Ideal.comap_map_of_surjective f hf] @@ -156,7 +156,8 @@ lemma Ideal.minimalPrimes_map_of_surjective {S : Type*} [CommRing S] {f : R →+ rw [← Ideal.comap_minimalPrimes_eq_of_surjective hf, ← Set.image_comp, Ideal.comap_map_of_surjective f hf, Set.image_congr, Set.image_id, RingHom.ker] intro x hx - exact (Ideal.comap_map_of_surjective f hf _).trans (sup_eq_left.mpr <| le_sup_right.trans hx.1.2) + exact (Ideal.comap_map_of_surjective f hf _).trans + (sup_eq_left.mpr <| le_sup_right.trans (Ideal.le_minimalPrimes hx)) theorem Ideal.minimalPrimes_eq_comap : I.minimalPrimes = Ideal.comap (Ideal.Quotient.mk I) '' minimalPrimes (R ⧸ I) := by @@ -174,21 +175,21 @@ theorem IsLocalization.minimalPrimes_map [IsLocalization S A] (J : Ideal R) : ext p constructor · intro hp - haveI := hp.1.1 - refine ⟨⟨Ideal.IsPrime.comap _, Ideal.map_le_iff_le_comap.mp hp.1.2⟩, ?_⟩ + haveI := Ideal.minimalPrimes_isPrime hp + refine ⟨⟨Ideal.IsPrime.comap _, Ideal.map_le_iff_le_comap.mp (Ideal.le_minimalPrimes hp)⟩, ?_⟩ rintro I hI e have hI' : Disjoint (S : Set R) I := Set.disjoint_of_subset_right e - ((IsLocalization.isPrime_iff_isPrime_disjoint S A _).mp hp.1.1).2 + ((IsLocalization.isPrime_iff_isPrime_disjoint S A _).mp (Ideal.minimalPrimes_isPrime hp)).2 refine (Ideal.comap_mono <| hp.2 ⟨?_, Ideal.map_mono hI.2⟩ (Ideal.map_le_iff_le_comap.mpr e)).trans_eq ?_ · exact IsLocalization.isPrime_of_isPrime_disjoint S A I hI.1 hI' · exact IsLocalization.comap_map_of_isPrime_disjoint S A hI.1 hI' · intro hp - refine ⟨⟨?_, Ideal.map_le_iff_le_comap.mpr hp.1.2⟩, ?_⟩ + refine ⟨⟨?_, Ideal.map_le_iff_le_comap.mpr (Ideal.le_minimalPrimes hp)⟩, ?_⟩ · rw [IsLocalization.isPrime_iff_isPrime_disjoint S A, IsLocalization.disjoint_comap_iff S] - refine ⟨hp.1.1, ?_⟩ + refine ⟨Ideal.minimalPrimes_isPrime hp, ?_⟩ rintro rfl - exact hp.1.1.ne_top rfl + exact (Ideal.minimalPrimes_isPrime hp).ne_top rfl · intro I hI e rw [← IsLocalization.map_comap S A I, ← IsLocalization.map_comap S A p] haveI := hI.1 @@ -212,7 +213,7 @@ theorem IsLocalization.AtPrime.radical_map_of_mem_minimalPrimes · rw [← IsLocalization.comap_le_comap_iff q.primeCompl A, AtPrime.map_eq_maximalIdeal q A, AtPrime.comap_maximalIdeal A q] apply hIq.2 hJ.1 - have := hJ.1.1.ne_top + have := (Ideal.minimalPrimes_isPrime hJ).ne_top rw [ne_eq, Ideal.comap_eq_top_iff, ← ne_eq, ← disjoint_comap_iff q.primeCompl A J] at this exact Set.disjoint_compl_left_iff_subset.mp this