@@ -3,63 +3,49 @@ Copyright (c) 2018 Chris Hughes. All rights reserved.
33Released under Apache 2.0 license as described in the file LICENSE.
44Authors: Anne Baanen
55-/
6- import Mathlib.RingTheory.Ideal.Colon
6+ import Mathlib.RingTheory.Ideal.Oka
77import Mathlib.RingTheory.PrincipalIdealDomain
88
99/-!
1010# Principal ideal domains and prime ideals
1111
12- # Main results
12+ ## Main results
1313
14- - `IsPrincipalIdeal.of_prime`: a ring where all prime ideals are principal is a principal ideal ring
14+ - `IsPrincipalIdealRing.of_prime`: a ring where all prime ideals are principal is a principal ideal
15+ ring.
1516 -/
1617
17- open Ideal
18+ variable {R : Type *} [CommSemiring R]
19+
20+ namespace Ideal
21+
22+ /-- `Submodule.IsPrincipal` is an Oka predicate. -/
23+ theorem isOka_isPrincipal : IsOka (Submodule.IsPrincipal (R := R)) where
24+ top := top_isPrincipal
25+ oka {I a} := by
26+ intro ⟨x, hx⟩ ⟨y, hy⟩
27+ refine ⟨x * y, le_antisymm ?_ ?_⟩ <;> rw [submodule_span_eq] at *
28+ · intro i hi
29+ have hisup : i ∈ I ⊔ span {a} := mem_sup_left hi
30+ have hasup : a ∈ I ⊔ span {a} := mem_sup_right (mem_span_singleton_self a)
31+ rw [hx, mem_span_singleton'] at hisup hasup
32+ obtain ⟨u, rfl⟩ := hisup
33+ obtain ⟨v, rfl⟩ := hasup
34+ obtain ⟨z, rfl⟩ : ∃ z, z * y = u := by
35+ rw [← mem_span_singleton', ← hy, mem_colon_singleton, mul_comm v, ← mul_assoc]
36+ exact mul_mem_right _ _ hi
37+ exact mem_span_singleton'.2 ⟨z, by rw [mul_assoc, mul_comm y]⟩
38+ · rw [← span_singleton_mul_span_singleton, ← hx, Ideal.sup_mul, sup_le_iff,
39+ span_singleton_mul_span_singleton, mul_comm a, span_singleton_le_iff_mem]
40+ exact ⟨mul_le_right, mem_colon_singleton.1 <| hy ▸ mem_span_singleton_self y⟩
1841
19- variable {R : Type *} [CommRing R]
42+ end Ideal
43+
44+ open Ideal
2045
2146/-- If all prime ideals in a commutative ring are principal, so are all other ideals. -/
2247theorem IsPrincipalIdealRing.of_prime (H : ∀ P : Ideal R, P.IsPrime → P.IsPrincipal) :
2348 IsPrincipalIdealRing R := by
24- -- Suppose the set of `nonPrincipals` is not empty.
25- rw [← nonPrincipals_eq_empty_iff, Set.eq_empty_iff_forall_notMem]
26- intro J hJ
27- -- We will show a maximal element `I ∈ nonPrincipals R` (which exists by Zorn) is prime.
28- obtain ⟨I, hJI, hI⟩ := zorn_le_nonempty₀ (nonPrincipals R) nonPrincipals_zorn _ hJ
29- have Imax' : ∀ {J}, I < J → J.IsPrincipal := by
30- intro K hK
31- simpa [nonPrincipals] using hI.not_prop_of_gt hK
32- by_cases hI1 : I = ⊤
33- · subst hI1
34- exact hI.prop top_isPrincipal
35- -- Let `x y : R` with `x * y ∈ I` and suppose WLOG `y ∉ I`.
36- refine hI.prop (H I ⟨hI1, fun {x y} hxy => or_iff_not_imp_right.mpr fun hy => ?_⟩)
37- obtain ⟨a, ha⟩ : (I ⊔ span {y}).IsPrincipal :=
38- Imax' (left_lt_sup.mpr (mt I.span_singleton_le_iff_mem.mp hy))
39- -- Then `x ∈ I.colon (span {y})`, which is equal to `I` if it's not principal.
40- suffices He : ¬(I.colon (span {y})).IsPrincipal by
41- rw [hI.eq_of_le ((nonPrincipals_def R).2 He) fun a ha ↦
42- Ideal.mem_colon_singleton.2 (mul_mem_right _ _ ha)]
43- exact Ideal.mem_colon_singleton.2 hxy
44- -- So suppose for the sake of contradiction that both `I ⊔ span {y}` and `I.colon (span {y})`
45- -- are principal.
46- rintro ⟨b, hb⟩
47- -- We will show `I` is generated by `a * b`.
48- refine (nonPrincipals_def _).1 hI.prop ⟨a * b, ?_⟩
49- refine
50- le_antisymm (α := Ideal R) (fun i hi => ?_) <|
51- (span_singleton_mul_span_singleton a b).ge.trans ?_
52- · have hisup : i ∈ I ⊔ span {y} := Ideal.mem_sup_left hi
53- have : y ∈ I ⊔ span {y} := Ideal.mem_sup_right (Ideal.mem_span_singleton_self y)
54- rw [ha, Ideal.submodule_span_eq, mem_span_singleton'] at hisup this
55- obtain ⟨v, rfl⟩ := this
56- obtain ⟨u, rfl⟩ := hisup
57- have hucolon : u ∈ I.colon (span {v * a}) := by
58- rw [Ideal.mem_colon_singleton, mul_comm v, ← mul_assoc]
59- exact mul_mem_right _ _ hi
60- rw [hb, Ideal.submodule_span_eq, mem_span_singleton'] at hucolon
61- obtain ⟨z, rfl⟩ := hucolon
62- exact mem_span_singleton'.2 ⟨z, by ring⟩
63- · rw [← Ideal.submodule_span_eq, ← ha, Ideal.sup_mul, sup_le_iff,
64- span_singleton_mul_span_singleton, mul_comm y, Ideal.span_singleton_le_iff_mem]
65- exact ⟨mul_le_right, Ideal.mem_colon_singleton.1 <| hb.symm ▸ Ideal.mem_span_singleton_self b⟩
49+ refine ⟨isOka_isPrincipal.forall_of_forall_prime (fun I hI ↦ exists_maximal_not_isPrincipal ?_) H⟩
50+ rw [isPrincipalIdealRing_iff, not_forall]
51+ exact ⟨I, hI⟩
0 commit comments