Skip to content
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions Mathlib/RingTheory/Ideal/AssociatedPrime/Localization.lean
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
27 changes: 15 additions & 12 deletions Mathlib/RingTheory/Ideal/Height.lean
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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

lemma Ideal.primeHeight_le_ringKrullDim {I : Ideal R} [I.IsPrime] :
Expand Down Expand Up @@ -179,10 +179,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] :
Expand All @@ -201,7 +201,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]
Expand Down Expand Up @@ -281,7 +283,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]

Expand Down Expand Up @@ -375,7 +377,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)
Expand All @@ -391,7 +393,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
Expand All @@ -408,9 +410,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`. -/
Expand Down
33 changes: 18 additions & 15 deletions Mathlib/RingTheory/Ideal/KrullsHeightTheorem.lean
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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,
Expand All @@ -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`.
Expand Down Expand Up @@ -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)
Expand All @@ -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,
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
23 changes: 15 additions & 8 deletions Mathlib/RingTheory/Ideal/MinimalPrime/Basic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -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
Comment thread
themathqueen marked this conversation as resolved.

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
Expand Down Expand Up @@ -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] :
Expand All @@ -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
Expand All @@ -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)
Expand All @@ -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]
Expand Down
12 changes: 6 additions & 6 deletions Mathlib/RingTheory/Ideal/MinimalPrime/Colon.lean
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Loading
Loading