Appearance
Table of Contents
Note that all rings considered here are commutative and have a multiplicative identity.
Each written proof or proof sketch is followed by a separate folded Lean 4 proof. The snippets are collected and compiled in mathlib-in-lean/commutative-algebra/Ring.lean. They assume that file's imports, namespace CommAlg, and variable {A : Type*} [CommRing A]; later snippets may use earlier declarations.
Rings and Ideals
Special Elements of Ring
A set of units,
A set of zero divisors,
A set of nilpotent elements,
is idempotent if
Facts on Special Elements of Ring
If
, then , i.e., every nilpotent element is a zero divisor. Proof
It is suffice to show that
. By definition (3), choose the least
such that . Since , we have , so . By minimality of , . By definition (2), use , we have with , hence . Lean 4 proof
lean/-- `a` is a zero divisor if `a * b = 0` for some nonzero `b`. -/ def IsZeroDivisor (a : A) : Prop := ∃ b : A, b ≠ 0 ∧ a * b = 0 /- Fact 1: in a nonzero ring, every nilpotent element is a zero divisor. -/ theorem isZeroDivisor_of_isNilpotent [Nontrivial A] {y : A} (hy : IsNilpotent y) : IsZeroDivisor y := by classical -- choose the least `n` with `y ^ n = 0` set n := Nat.find hy with hn_def have hn : y ^ n = 0 := Nat.find_spec hy -- `n ≠ 0`, since `y ^ 0 = 1 ≠ 0` have hn0 : n ≠ 0 := by intro h rw [h, pow_zero] at hn exact one_ne_zero hn obtain ⟨m, hm⟩ := Nat.exists_eq_succ_of_ne_zero hn0 -- take `b = y ^ (n - 1)`, which is nonzero by minimality of `n` refine ⟨y ^ m, fun h => ?_, ?_⟩ · have : n ≤ m := Nat.find_min' hy h omega · calc y * y ^ m = y ^ (m + 1) := (pow_succ' y m).symm _ = y ^ n := by rw [hm] _ = 0 := hnIf
, then , i.e., no unit is a zero divisor. Proof
By contradiction, assume
, let . By definition (1), there exists
such that . By definition (2), there exists an non-zero such that . So, we have :
By the associativity and commutativity of
(as we mentioned earlier that is commutative ring with identity), the left-hand side . This is a contradiction since the right-hand side is
. Hence no unit can be a zero divisor. Lean 4 proof
lean/- Fact 2: no unit is a zero divisor. -/ theorem not_isZeroDivisor_of_isUnit {x : A} (hx : IsUnit x) : ¬ IsZeroDivisor x := by rintro ⟨z, hz, hxz⟩ obtain ⟨y, hy⟩ := hx.exists_right_inv -- `z = (x * y) * z = y * (x * z) = y * 0 = 0`, contradicting `z ≠ 0` apply hz calc z = (x * y) * z := by rw [hy, one_mul] _ = y * (x * z) := by ring _ = 0 := by rw [hxz, mul_zero] example {x z : A} (hx : IsUnit x) : x * z = 0 ↔ z = 0 := hx.mul_right_eq_zeroLet
be a finite ring. Then, , i.e., every element of a finite ring is either a unit or a zero divisor. Proof
Firstly, considering
, then , so and . Hence, in this case. Secondly, if
. By (b), we have . Since and , we have . So it is suffice to show that , which implies that Assume
. Consider the function defined by . Since is finite, is either injective or not. If
is not injective, then there exist distinct such that , which implies . Let , then , hence . If
is injective, since is finite, by the pigeonhole principle, is also surjective, then there exists such that , hence .
Therefore, every element
is either a unit or a zero divisor, i.e., . Lean 4 proof
lean/- Fact 3: every element of a finite ring is a unit or a zero divisor. -/ theorem isUnit_or_isZeroDivisor [Finite A] (x : A) : IsUnit x ∨ IsZeroDivisor x := by -- consider `f : A → A`, `f y = x * y` by_cases hinj : Function.Injective (fun y : A => x * y) · -- injective ⇒ surjective (pigeonhole), so `x * y = 1` for some `y` left obtain ⟨y, hy⟩ := Finite.injective_iff_surjective.mp hinj 1 exact IsUnit.of_mul_eq_one y hy · -- not injective ⇒ `x * (y₁ - y₂) = 0` with `y₁ ≠ y₂` right simp only [Function.Injective, not_forall] at hinj obtain ⟨y₁, y₂, h, hne⟩ := hinj exact ⟨y₁ - y₂, sub_ne_zero.mpr hne, by rw [mul_sub, h, sub_self]⟩
Domain VS Field
Commutative ring + (multiplicative) identity +
is an integeral domain (or domain) Commutative ring + (multiplicative) identity +
is a field. A finite (integral) domain is a field.
Proof
By the proof of fact (3),
implies function is injective for every non-zero . By pigeonhole principle, finite implies that every injective function from the domain to itself is also surjective, which ensures that every non-zero element has a multiplicative inverse, hence the domain is a field.
Lean 4 proof
lean/- Fact 3: a finite integral domain is a field. -/ theorem isField_of_finite_domain [IsDomain A] [Finite A] : IsField A := by refine ⟨exists_pair_ne A, mul_comm, ?_⟩ intro x hx -- no zero divisors ⇒ `y ↦ x * y` is injective, hence surjective have hinj : Function.Injective (fun y : A => x * y) := fun y₁ y₂ h => mul_left_cancel₀ hx h exact Finite.injective_iff_surjective.mp hinj 1 example [IsDomain A] [Finite A] : IsField A := Finite.isField_of_domain A
Ideal
Ideal is a subset of a ring such that
- It is an additive subgroup of the ring. i.e. for any
, we have - It is closed under multiplication by any element of the ring, i.e., for all
and , we have .
Definitions of Some Ideals
If an ideal
is proper, then . If a proper ideal
is maximal if it is not strictly contained in any other proper ideal of the ring. Ideal generated by a strict subset
is the elements of
are generators of ideal . Since cardinality is a finite number, the ideal is finitely generated. Let , then . If the cardinality of
is 1, i.e., , then the ideal generated by is principal, i.e., . A ring
always contains two special ideals, one is the bottom ideal (denoted as lean), and the other is the top ideal (denoted as lean).
Special Ring
- A ring
is called Principal Ideal Ring (PIR) if every ideal of is principal, i.e., can be generated by a single element. Moreover, if is also an integral domain, it is called a Principal Ideal Domain (PID).
Facts on Ideals
, i.e. No unit exists in a proper ideal of a ring. Proof
(a) Regarding the forward direction, in a contrapositive way, we assume
. Since
, there exists such that . Since
, we have .
Putting these two hypotheses together. we obtain
, which contradicts the assumption that is proper. (b) Regarding the backward direction, assume
, which implies that: By definition of ideal,
, therefore, . Lean 4 proof
lean/- Fact 1: an ideal is proper iff it contains no unit. -/ theorem one_not_mem_iff (I : Ideal A) : (1 : A) ∉ I ↔ ∀ a ∈ I, ¬ IsUnit a := by constructor · -- if a unit `a` with `a * b = 1` lies in `I`, then `1 = a * b ∈ I` intro h1 a ha hu obtain ⟨b, hb⟩ := hu.exists_right_inv apply h1 rw [← hb] exact I.mul_mem_right b ha · -- `1` is itself a unit intro h h1 exact h 1 h1 isUnit_one example (I : Ideal A) {a : A} (ha : a ∈ I) (hu : IsUnit a) : I = ⊤ := Ideal.eq_top_of_isUnit_mem I ha hu
If
is a field, then it has only has two ideals: the zero ideal and the field itself . Proof
(a) Firstly, considering the special case of
, then the only ideal is . (b) Secondly, consider the case when
is a non-zero field. Let be a non-zero ideal of . By the definition of field : Take any non-zero element
, by definition of ideal, we have : Putting these two hypotheses together, we obtain
. Since , thus . Completing the proof.
Lean 4 proof
lean/- Fact 2: a field has only the ideals `⟨0⟩` and `⟨1⟩`. -/ theorem eq_bot_or_top_of_field {K : Type*} [Field K] (I : Ideal K) : I = ⊥ ∨ I = ⊤ := by by_cases h : I = ⊥ · exact Or.inl h · -- take a nonzero `a ∈ I`; then `1 = a⁻¹ * a ∈ I` right obtain ⟨a, ha, ha0⟩ := Submodule.exists_mem_ne_zero_of_ne_bot h rw [Ideal.eq_top_iff_one, ← inv_mul_cancel₀ ha0] exact I.mul_mem_left a⁻¹ ha example {K : Type*} [Field K] (I : Ideal K) : I = ⊥ ∨ I = ⊤ := Ideal.eq_bot_or_top I
Ideal Operations
- Intersection. For any family of ideals
of , their intersection is also an ideal of .
- Sum. For any family of ideals
of , the ideal generated by their union is also an ideal of . It is denoted by . That is exists a function : which is inclusion map. is smallest ideal containing .
Product. For any finite family of ideals
of , their product ideal is generated by Observations
Fact :
for all . Two cases considered, (a) if
, then . (b) if , then we must have . For example, for , it is possible that .
Quotient and Annihilator. For any two ideals
of , we define the quotient of by as the set In particular, when
, then the quotient is called the annihilator of and is denoted by . When is principal , we simply denote it by . Observations
As
is an ideal, so . So if
, then . if
, then . if
, then .
- Radical. For any ideal
of , the radical of is defined as the set
Facts on Ideal Operations
Intersection of a family of ideals is also an ideal.
Proof
Since
for all , then : - for any
, we have for all . That implies that . - for any
and , we have for all . Since each is an ideal, for all . That implies that .
Lean 4 proof
lean/- Fact 1: the intersection of a family of ideals is an ideal. -/ def iInter {ι : Type*} (I : ι → Ideal A) : Ideal A where carrier := {x | ∀ h, x ∈ I h} zero_mem' := by intro h exact (I h).zero_mem add_mem' := by intro a b ha hb h exact (I h).add_mem (ha h) (hb h) smul_mem' := by intro a x hx h exact (I h).mul_mem_left a (hx h) example {ι : Type*} (I : ι → Ideal A) : iInter I = ⨅ h, I h := by ext x exact (Submodule.mem_iInf I).symm- for any
Quotient is also an ideal.
Proof that quotient is also an ideal
For addition closure, let
, we need to show that . Since By addition closure property of ideal, we have
, which implies that . For multiplicity closure, let
and for any , we need to show that . if
, it trivially holds that . if
. Since , then always holds, which implies that .
Lean 4 proof
lean/- Fact 2: the quotient `I : J = {a | a * J ⊆ I}` is an ideal. -/ def colon (I J : Ideal A) : Ideal A where carrier := {a | ∀ x ∈ J, a * x ∈ I} zero_mem' := by intro x _ rw [zero_mul] exact I.zero_mem add_mem' := by intro a b ha hb x hx rw [add_mul] exact I.add_mem (ha x hx) (hb x hx) smul_mem' := by -- `(r * a) * x = r * (a * x) ∈ I` intro r a ha x hx rw [smul_eq_mul, mul_assoc] exact I.mul_mem_left r (ha x hx) example (I J : Ideal A) (a : A) : a ∈ colon I J ↔ a ∈ I.colon J := by rw [Submodule.mem_colon] rflRadical is also an ideal.
Proof that radical is also an ideal
For the addition closure, let
, we need to show that . Consider
. By the binomial theorem, Each term in this sum is in
because either or , so or : Since
is an ideal and closed under addition, , which implies that . For the multiplicity closure, let
and , we need to show that . Consider . Since and is an ideal, , which implies that . Therefore, .
Lean 4 proof
lean/- Fact 3: the radical `√I = {a | ∃ n, a ^ n ∈ I}` is an ideal. -/ def radical (I : Ideal A) : Ideal A where carrier := {a | ∃ n : ℕ, a ^ n ∈ I} zero_mem' := by refine ⟨1, ?_⟩ rw [pow_one] exact I.zero_mem add_mem' := by -- binomial theorem: each term of `(a + b) ^ (m + n)` has `a ^ k` with `k ≥ m` -- or `b ^ (m + n - k)` with `m + n - k ≥ n` rintro a b ⟨m, hm⟩ ⟨n, hn⟩ refine ⟨m + n, ?_⟩ rw [add_pow] refine I.sum_mem fun k _ => ?_ by_cases h : m ≤ k · have e : a ^ k = a ^ m * a ^ (k - m) := by rw [← pow_add, Nat.add_sub_cancel' h] rw [e] exact I.mul_mem_right _ (I.mul_mem_right _ (I.mul_mem_right _ hm)) · have hk : n ≤ m + n - k := by omega have e : b ^ (m + n - k) = b ^ n * b ^ (m + n - k - n) := by rw [← pow_add, Nat.add_sub_cancel' hk] rw [e] exact I.mul_mem_right _ (I.mul_mem_left _ (I.mul_mem_right _ hn)) smul_mem' := by -- `(r * a) ^ n = r ^ n * a ^ n ∈ I` rintro r a ⟨n, hn⟩ refine ⟨n, ?_⟩ rw [smul_eq_mul, mul_pow] exact I.mul_mem_left _ hn example (I : Ideal A) (a : A) : a ∈ radical I ↔ a ∈ I.radical := Iff.rflThe set of nipotent elements
is also an ideal. Proof
In particular, the set of nilpotent elements is a special case of the radical:
. Indeed, if and only if . Since the radical is an ideal, the nilpotent elements form an ideal too. Lean 4 proof
lean/- Fact 4: the nilpotent elements form the ideal `√⟨0⟩`. -/ theorem isNilpotent_iff_mem_radical_bot (a : A) : IsNilpotent a ↔ a ∈ radical ⊥ := by show (∃ n : ℕ, a ^ n = 0) ↔ ∃ n : ℕ, a ^ n ∈ (⊥ : Ideal A) simp only [Ideal.mem_bot] example (a : A) : a ∈ nilradical A ↔ IsNilpotent a := mem_nilradicalThe set of zero-divisors
is not an ideal in general. Proof
Not an ideal means either addition or multiplicity closure fails, we choose the former one. That is
Take
, and . Since with and , both and are zero-divisors. However,
and , so is a unit. By fact (2) on special elements, no unit is a zero divisor, so . Lean 4 proof
lean/- Fact 5: the zero divisors need not form an ideal. In `ℤ/6ℤ`, `2` and `3` are zero divisors (`2 * 3 = 0`), but `2 + 3 = 5` is a unit. -/ theorem zeroDivisors_not_ideal : ¬ ∃ I : Ideal (ZMod 6), ∀ a, a ∈ I ↔ IsZeroDivisor a := by rintro ⟨I, hI⟩ have h2 : (2 : ZMod 6) ∈ I := (hI 2).mpr ⟨3, by decide, by decide⟩ have h3 : (3 : ZMod 6) ∈ I := (hI 3).mpr ⟨2, by decide, by decide⟩ have h5 : IsUnit (2 + 3 : ZMod 6) := IsUnit.of_mul_eq_one 5 (by decide) exact not_isZeroDivisor_of_isUnit h5 ((hI _).mp (I.add_mem h2 h3))If
are two ideals of a ring , then . Proof
Firstly we decompose the argument :
Since
, so we have . Similarly, since , we have . Therefore, . Completing the proof. Lean 4 proof
lean/- Fact 6: `I J ⊆ I ∩ J`. -/ theorem mul_le_inf' (I J : Ideal A) : I * J ≤ I ⊓ J := by -- it suffices to check the generators `a * b` with `a ∈ I`, `b ∈ J` rw [Ideal.mul_le] intro a ha b hb exact Submodule.mem_inf.mpr ⟨I.mul_mem_right b ha, J.mul_mem_left a hb⟩ example (I J : Ideal A) : I * J ≤ I ⊓ J := Ideal.mul_le_infIf
are two ideals of a ring , and , then . and are comaximal. Proof
By (6), we only need to show the converse inclusion:
when . By
, thus for any , we can write with existence of and . So for any
, we can write it as with the existence of and . After some expanding, and and , we have : which proves
. Therefore, . Completing the proof. Lean 4 proof
lean/- Fact 7: if `I + J = ⟨1⟩`, then `I ∩ J = I J`. -/ theorem inf_eq_mul_of_sup_eq_top (I J : Ideal A) (h : I ⊔ J = ⊤) : I ⊓ J = I * J := by refine le_antisymm ?_ (mul_le_inf' I J) intro x hx obtain ⟨hxI, hxJ⟩ := Submodule.mem_inf.mp hx -- write `1 = y + z` with `y ∈ I`, `z ∈ J` have h1 : (1 : A) ∈ I ⊔ J := by rw [h] exact Submodule.mem_top obtain ⟨y, hy, z, hz, hyz⟩ := Submodule.mem_sup.mp h1 -- `x = x * (y + z) = y * x + x * z ∈ I J` have e : x = y * x + x * z := by calc x = x * (y + z) := by rw [hyz, mul_one] _ = y * x + x * z := by ring rw [e] exact Ideal.add_mem _ (Ideal.mul_mem_mul hy hxJ) (Ideal.mul_mem_mul hxI hz) example (I J : Ideal A) (h : I ⊔ J = ⊤) : I * J = I ⊓ J := Ideal.mul_eq_inf_of_coprime hLet
are pairwise comaximal ideals of a ring . Then This is a general form of the result in (7) for two comaximal ideals. We omit the proof here.
- Let
be ideals of a ring . Then
Properties of the Radical
Let
if
, then . Proof
In order to show
, it is suffices to show : Since
, use , we have . Completing the proof. Lean 4 proof
leantheorem radical_mono' (I J : Ideal A) (h : I ≤ J) : I.radical ≤ J.radical := by rintro x ⟨n, hn⟩ exact ⟨n, h hn⟩and Proof
For any
, we have , hence . This shows . In order to show
, since follows from the fact that , it suffices to show the forward inclusion is true, i.e., . That is, Since
for some , by definition of , there exists such that . So use , we have . Completing the proof. Lean 4 proof
leantheorem le_radical_and_idem (I : Ideal A) : I ≤ I.radical ∧ I.radical.radical = I.radical := by have hle : I ≤ I.radical := fun x hx => ⟨1, by simpa using hx⟩ refine ⟨hle, le_antisymm ?_ Ideal.le_radical⟩ rintro x ⟨n, m, h⟩ exact ⟨n * m, by simpa only [pow_mul] using h⟩Proof
(a) First, we show
. Since , by property (1) above, we have . So it suffices to show the backward direction inclusion . That is, for some implies and , hence by definition we have . So use , we have . Completing the proof of (a). (b) Next, in order to show the equality
, we first show the forward inclusion direction . That is, for some implies and , hence use , we have and . Completing the proof of the forward inclusion. Then we show the backward inclusion direction
. That is, Since
, by definition, we have . Hence, using , we have . Again by , we have . Completing the proof of the backward inclusion. Lean 4 proof
leantheorem radical_mul_inf (I J : Ideal A) : (I * J).radical = (I ⊓ J).radical ∧ (I ⊓ J).radical = I.radical ⊓ J.radical := by have hi : (I ⊓ J).radical = I.radical ⊓ J.radical := by apply le_antisymm · exact le_inf (radical_mono' _ _ inf_le_left) (radical_mono' _ _ inf_le_right) · rintro x ⟨⟨m, hm⟩, ⟨n, hn⟩⟩ refine ⟨m + n, ?_⟩ rw [pow_add] exact ⟨I.mul_mem_right _ hm, J.mul_mem_left _ hn⟩ refine ⟨le_antisymm (radical_mono' _ _ Ideal.mul_le_inf) ?_, hi⟩ rintro x ⟨n, hn⟩ refine ⟨n + n, ?_⟩ rw [pow_add] exact Ideal.mul_mem_mul hn.1 hn.2
for any integer . Proof
Induct on
. The case is immediate. For the induction step, property (3) gives . The restriction is necessary: , whose radical is . Lean 4 proof
leantheorem radical_pow_positive (I : Ideal A) (n : ℕ) (hn : n ≠ 0) : (I ^ n).radical = I.radical := by obtain ⟨k, rfl⟩ := Nat.exists_eq_succ_of_ne_zero hn induction k with | zero => simp | succ k ih => rw [pow_succ, (radical_mul_inf _ _).1, (radical_mul_inf _ _).2, ih (Nat.succ_ne_zero k), inf_idem]if and only if . Proof
In order to show the equality
, we first show the forward inclusion directions. That is, As
implies such that . We use , then by the property (2) above, we have , thus . Completing the proof of the forward inclusion. Next, we show the backward inclusion direction
. That is, Since
, write with and . In the binomial expansion of , every term has either at least factors of or at least factors of , so every term belongs to . Thus , completing the backward inclusion. Lean 4 proof
leantheorem radical_sup' (I J : Ideal A) : (I ⊔ J).radical = (I.radical ⊔ J.radical).radical := by apply le_antisymm · exact radical_mono' _ _ (sup_le_sup Ideal.le_radical Ideal.le_radical) · have h : I.radical ⊔ J.radical ≤ (I ⊔ J).radical := sup_le (radical_mono' _ _ le_sup_left) (radical_mono' _ _ le_sup_right) exact (radical_mono' _ _ h).trans_eq (le_radical_and_idem _).2Proof
In order to prove the equality
, we need to show both inclusions. Forward inclusion:
, that is, As
implies such that . We use , as thus we have , then , similarly we have . Completing the proof of the forward inclusion. Backward inclusion:
, that is, Since
and , thus we have . Let , then . Completing the proof of the backward inclusion. Lean 4 proof
leantheorem radical_sup_mul (I J H : Ideal A) : (I ⊔ J * H).radical = (I ⊔ J).radical ⊓ (I ⊔ H).radical := by apply le_antisymm · exact le_inf (radical_mono' _ _ (sup_le_sup_left ((mul_le_inf' J H).trans inf_le_left) I)) (radical_mono' _ _ (sup_le_sup_left ((mul_le_inf' J H).trans inf_le_right) I)) · rintro x ⟨⟨m, hm⟩, ⟨n, hn⟩⟩ refine ⟨m + n, ?_⟩ rw [pow_add] obtain ⟨a, ha, b, hb, hab⟩ := Submodule.mem_sup.mp hm obtain ⟨c, hc, d, hd, hcd⟩ := Submodule.mem_sup.mp hn rw [← hab, ← hcd] have hi : a * c + a * d + b * c ∈ I := I.add_mem (I.add_mem (I.mul_mem_right _ ha) (I.mul_mem_right _ ha)) (I.mul_mem_left _ hc) have hj : b * d ∈ J * H := Ideal.mul_mem_mul hb hd have he : (a + b) * (c + d) = (a * c + a * d + b * c) + b * d := by ring rw [he] exact (I ⊔ J * H).add_mem ((show I ≤ I ⊔ J * H from le_sup_left) hi) ((show J * H ≤ I ⊔ J * H from le_sup_right) hj)
Maximal Ideal
As we know, maximal ideal is derived from the concept of proper ideal. A few important facts upon maximal ideal are derived from Zorn's Lemma.
Zorn's Lemma
Poset Definition : A poset
Zorn's Lemma : Let
Facts on Maximal Ideal
Let
has at least one maximal ideal . For any proper ideal
of , there exists a maximal ideal such that . Every non-invertible element of
is contained in some maximal ideal of .
Proof
Regarding (1), we can treat
For example,
By Zorn's Lemma, in order to show
For any chain of proper ideals
Then we need to show that :
is an ideal of . - Addition closure, i.e. for any
, we have . - Multiplication closure, i.e. for any
and , we have .
- Addition closure, i.e. for any
is a proper ideal of , i.e. . proof details are ignored here.
Regarding (2), it is trivially holds for any chain of proper ideals in
Regarding (3), if
Then the principal ideal
Lean 4 proof
lean
/- Fact 2: every proper ideal is contained in a maximal ideal (Zorn's lemma). -/
theorem exists_le_maximal' (I : Ideal A) (hI : I ≠ ⊤) :
∃ M : Ideal A, M.IsMaximal ∧ I ≤ M := by
-- every nonempty chain of proper ideals has a proper upper bound: its union
have ih : ∀ c ⊆ {J : Ideal A | J ≠ ⊤}, IsChain (· ≤ ·) c →
∀ J ∈ c, ∃ ub ∈ {J : Ideal A | J ≠ ⊤}, ∀ K ∈ c, K ≤ ub := by
intro c hcs hchain J hJ
refine ⟨sSup c, ?_, fun K hK => le_sSup hK⟩
-- `1 ∉ ⋃ c`, since `1` would lie in some proper ideal of the chain
show sSup c ≠ ⊤
rw [Ne, Ideal.eq_top_iff_one]
intro h1
obtain ⟨K, hKc, h1K⟩ := (Submodule.mem_sSup_of_directed ⟨J, hJ⟩ hchain.directedOn).mp h1
exact hcs hKc ((Ideal.eq_top_iff_one K).mpr h1K)
obtain ⟨M, hIM, hM⟩ := zorn_le_nonempty₀ {J : Ideal A | J ≠ ⊤} ih I hI
-- a maximal element of the proper ideals is a maximal ideal
refine ⟨M, ⟨⟨hM.prop, fun J hMJ => ?_⟩⟩, hIM⟩
by_contra hJ
exact hMJ.ne' (le_antisymm (hM.2 hJ hMJ.le) hMJ.le)
example (I : Ideal A) (hI : I ≠ ⊤) : ∃ M : Ideal A, M.IsMaximal ∧ I ≤ M :=
Ideal.exists_le_maximal I hI
/- Fact 1: a nonzero ring has at least one maximal ideal. -/
theorem exists_maximal' [Nontrivial A] : ∃ M : Ideal A, M.IsMaximal := by
obtain ⟨M, hM, -⟩ := exists_le_maximal' (⊥ : Ideal A) bot_ne_top
exact ⟨M, hM⟩
example [Nontrivial A] : ∃ M : Ideal A, M.IsMaximal := Ideal.exists_maximal A
/- Fact 3: every non-invertible element lies in some maximal ideal. -/
theorem exists_maximal_of_not_isUnit {a : A} (ha : ¬ IsUnit a) :
∃ M : Ideal A, M.IsMaximal ∧ a ∈ M := by
-- `⟨a⟩` is proper, so apply Fact 2
have hprop : Ideal.span {a} ≠ ⊤ := fun h => ha (Ideal.span_singleton_eq_top.mp h)
obtain ⟨M, hM, haM⟩ := exists_le_maximal' _ hprop
exact ⟨M, hM, haM (Ideal.mem_span_singleton_self a)⟩
example {a : A} (ha : a ∈ nonunits A) : ∃ M : Ideal A, M.IsMaximal ∧ a ∈ M :=
exists_max_ideal_of_mem_nonunits haOther Special Ideals
Let
prime, if
implies or for all ; Prime ideal means any element of the ideal can be decomposed into a product of elements, at least one of which lies in the ideal. We give out an couter-example, suppose
and , then : where
radical, if
; Note the difference between radical of an ideal and radical ideal, by the property (2) of radical,
, we see that radical ideal is a special case where the ideal coincides with its radical. primary, if
implies or ; Note the difference between primary ideal and prime ideal, a prime ideal is always primary, but a primary ideal need not be prime. This is reflected by the fact that
, and the inclusion can be strict. irreducible, if
implies or . Irreducible ideal only exists when
or .
Facts on Special Ideals
Let
If
is primary, then is prime. Proof
Since
is proper, is proper: would imply . If , choose with . Primaryness gives either , hence , or . In the latter case choose with , so . This proves that is prime. Lean 4 proof
leantheorem primary_radical_prime (I : Ideal A) (hI : I.IsPrimary) : I.radical.IsPrime := by refine ⟨?_, ?_⟩ · exact fun h => (Ideal.isPrimary_iff.mp hI).1 (Ideal.radical_eq_top.mp h) · intro a b hab obtain ⟨n, hn⟩ := hab rw [mul_pow] at hn rcases (Ideal.isPrimary_iff.mp hI).2 hn with ha | hb · exact Or.inl ⟨n, ha⟩ · exact Or.inr (Ideal.mem_radical_of_pow_mem hb)If
is a maximal ideal, then is a field. Proof
By the definition of field, it is suffices to show :
If
, is maximal, then we must have : because
strictly contains , and maximality forces it to equal . So any element
can be represented as for , we take . Then modulo on both sides, we get Completing the proof.
Lean 4 proof
leantheorem maximal_quotient_field (I : Ideal A) (hI : I.IsMaximal) : IsField (A ⧸ I) := by letI := hI letI := Ideal.Quotient.field I exact Field.toIsField _If
is a maximal ideal, then is primary. Proof
By the definition of primary ideal, it is suffices to show that for any
when , we must have . By contradiction, we assume . Since
is maximal, by fact (2) above, we know that the quotient ring is a field, which implies every nonzero element in is invertible. More specially, Thus we have :
After expanding :
We have assumed that
, thus as well, which implies , and hence . Contradiction happens, which completes the proof. Lean 4 proof
leantheorem primary_of_maximal_radical (I : Ideal A) (h : I.radical.IsMaximal) : I.IsPrimary := by -- Mathlib packages the maximal-ideal argument, avoiding a binomial expansion. exact Ideal.isPrimary_of_isMaximal_radical h
Krull Dimension
Let
in
For example,
if
is a field, there are only two ideals and , but only is prime, forms the longest chain of prime ideals, so the Krull dimension is
. if
, there are two prime ideals and for any prime number , and a strict inclusion exists between them so the Krull dimension is
for the longest chain of prime ideals. if
, similar with , there are two prime ideals and for any irreducible polynomial , and a strict inclusion exists between them so the Krull dimension is
for the longest chain of prime ideals.
Homomorphisms and Quotient Rings
Definition of Quotient Ring
Let
Every ideal
of is a normal subgroup of , thus forms a quotient group. The reasons behind this are as follows: itself is a commutative additive group. - Additive closure of ideal ensures
is a subgroup of . - Commutative property ensure this subgroup is normal.
- That
is normal ensure that is a quotient group.
The element of
is denoted as where is a representative of the coset . The addition and multiplication in the quotient ring
are defined as follows:
We need to show that the addition and multiplication in the quotient ring
Proof
For addition, by definition, we have :
So, we need to show that
which proves that addition is well-defined.
For multiplication,
Lean 4 proof
lean
theorem quotient_operations_well_defined (I : Ideal A) (x x' y y' : A)
(hx : Ideal.Quotient.mk I x = Ideal.Quotient.mk I x')
(hy : Ideal.Quotient.mk I y = Ideal.Quotient.mk I y') :
Ideal.Quotient.mk I (x + y) = Ideal.Quotient.mk I (x' + y') ∧
Ideal.Quotient.mk I (x * y) = Ideal.Quotient.mk I (x' * y') := by
have hxi := Ideal.Quotient.eq.mp hx
have hyi := Ideal.Quotient.eq.mp hy
constructor
· apply Ideal.Quotient.eq.mpr
have he : (x + y) - (x' + y') = (x - x') + (y - y') := by ring
rw [he]
exact I.add_mem hxi hyi
· apply Ideal.Quotient.eq.mpr
have he : x * y - x' * y' = (x - x') * y + x' * (y - y') := by ring
rw [he]
exact I.add_mem (I.mul_mem_right _ hxi) (I.mul_mem_left _ hyi)Ring Homomorphism
Let
(if and have multiplicative identities)
which implies :
is an ideal of . is injective iff . is a subring of .
If
Ring Homomorphism Theorems
If
Explanation
Why the commutative diagram holds? Because by definition, the equivalence of two functions
This defines
Lean 4 proof
lean
def inducedHom {B : Type*} [CommRing B] (I : Ideal A) (f : A →+* B)
(h : I ≤ RingHom.ker f) : A ⧸ I →+* B :=
Ideal.Quotient.lift I f (fun _ ha => h ha)
theorem inducedHom_factorization {B : Type*} [CommRing B] (I : Ideal A)
(f : A →+* B) (h : I ≤ RingHom.ker f) :
(inducedHom I f h).comp (Ideal.Quotient.mk I) = f := by
ext a
exact Ideal.Quotient.lift_mk I f (fun _ ha => h ha)Three theorems are particularly important in the study of ring homomorphisms:
First Isomorphism Theorem: If
is a ring homomorphism, then . Second Isomorphism Theorem: If
is a ring, and are ideals of with , then . Third Isomorphism Theorem: If
be an ideal, and let be a subring. Then : (a)
is a subring containing . (b) is an ideal of . (c) is an ideal of . Moreover,
Proof
For the first isomorphism theorem, let
- (a)
is well-defined. - (b)
is a ring homomorphism. - (c)
is injective. - (d)
is surjective.
The factorization argument verifies (a) and (b). For (c), equality of the images of
For the second isomorphism theorem, let
is well-defined since , and it is surjective because for every . if and only if , so .
Therefore, by the first isomorphism theorem, we have
For the third isomorphism theorem, consider a composition map :
Here
The map is composed of the inclusion and the natural projection. It is surjective because each
Lean 4 proof
The numbering follows these notes; Mathlib calls the double-quotient result the third isomorphism theorem. Ideal.map represents Ideal.comap restricts subringAddIdeal defines mem_subringAddIdeal verifies its usual description.
lean
noncomputable def firstIsomorphism {B : Type*} [CommRing B] (f : A →+* B) :
A ⧸ RingHom.ker f ≃+* f.range :=
RingHom.quotientKerEquivRange f
def secondIsomorphism (I J : Ideal A) (h : I ≤ J) :
(A ⧸ I) ⧸ J.map (Ideal.Quotient.mk I) ≃+* A ⧸ J :=
DoubleQuot.quotQuotEquivQuotOfLE h
noncomputable def subringQuotientImage (I : Ideal A) (B : Subring A) :
B ⧸ I.comap B.subtype ≃+* ((Ideal.Quotient.mk I).comp B.subtype).range := by
let f := (Ideal.Quotient.mk I).comp B.subtype
have hk : RingHom.ker f = I.comap B.subtype := by
ext b
exact Ideal.Quotient.eq_zero_iff_mem
exact (Ideal.quotEquivOfEq hk.symm).trans (RingHom.quotientKerEquivRange f)
-- The preimage of the image of B under A → A/I is precisely B + I.
def subringAddIdeal (I : Ideal A) (B : Subring A) : Subring A :=
((Ideal.Quotient.mk I).comp B.subtype).range.comap (Ideal.Quotient.mk I)
theorem mem_subringAddIdeal (I : Ideal A) (B : Subring A) (a : A) :
a ∈ subringAddIdeal I B ↔ ∃ b ∈ B, ∃ i ∈ I, a = b + i := by
change (∃ b : B, Ideal.Quotient.mk I (b : A) = Ideal.Quotient.mk I a) ↔ _
constructor
· rintro ⟨b, hb⟩
refine ⟨b, b.property, a - b, Ideal.Quotient.eq.mp hb.symm, ?_⟩
ring
· rintro ⟨b, hb, i, hi, rfl⟩
refine ⟨⟨b, hb⟩, ?_⟩
rw [map_add, Ideal.Quotient.eq_zero_iff_mem.mpr hi, add_zero]
def subringAddIdealProjection (I : Ideal A) (B : Subring A) :
subringAddIdeal I B →+* ((Ideal.Quotient.mk I).comp B.subtype).range where
toFun a := ⟨Ideal.Quotient.mk I a, a.property⟩
map_zero' := Subtype.ext (map_zero _)
map_one' := Subtype.ext (map_one _)
map_add' a b := Subtype.ext (map_add (Ideal.Quotient.mk I) (a : A) (b : A))
map_mul' a b := Subtype.ext (map_mul (Ideal.Quotient.mk I) (a : A) (b : A))
noncomputable def thirdIsomorphism (I : Ideal A) (B : Subring A) :
B ⧸ I.comap B.subtype ≃+*
(subringAddIdeal I B) ⧸ I.comap (subringAddIdeal I B).subtype := by
let g := subringAddIdealProjection I B
have hg : Function.Surjective g := by
rintro ⟨x, b, rfl⟩
refine ⟨⟨b, ?_⟩, rfl⟩
exact ⟨b, rfl⟩
have hk : RingHom.ker g = I.comap (subringAddIdeal I B).subtype := by
ext a
change (⟨Ideal.Quotient.mk I a, a.property⟩ :
((Ideal.Quotient.mk I).comp B.subtype).range) = 0 ↔ (a : A) ∈ I
rw [Subtype.ext_iff]
exact Ideal.Quotient.eq_zero_iff_mem
let e := (Ideal.quotEquivOfEq hk.symm).trans
(RingHom.quotientKerEquivOfSurjective hg)
exact (subringQuotientImage I B).trans e.symmSpecial Ideals
Let
is proper iff ; is maximal iff is a field. is prime iff is an (integral) domain. is radical iff is reduced. - If
is proper, then is primary iff . - If
is maximal, then is prime. - If
is prime, then is radical. - If
is prime, then is primary.
Proof
For (1),
For (2), if
For (3), by definition,
For (4), by definition,
In previous sections, we have already concluded that
For (5), by definition of primary ideal :
, the definition of
and the definition of
Since
For the backward direction, we need to show :
Expanding the left-hand side, we have :
that is, for any
case
, our goal always holds when we choose the left argument . case
, then proposition implies that , since , we have , i.e., . The right arugment always holds.
Proof complete for
For the forward direction, if
For (6), by (2), if
For (7), by (3),
For (8), by definition of prime ideal:
, by definition of primary ideal :
So, we need to show that :
Two cases involved :
For case (a), it trivially holds when we choose the left argument
For case (b), it trivially holds when we choose the right argument
Lean 4 proof
lean
theorem proper_iff_nontrivial_quotient (I : Ideal A) :
I ≠ ⊤ ↔ Nontrivial (A ⧸ I) :=
Ideal.Quotient.nontrivial_iff.symm
theorem maximal_iff_field_quotient (I : Ideal A) :
I.IsMaximal ↔ IsField (A ⧸ I) :=
Ideal.Quotient.maximal_ideal_iff_isField_quotient I
theorem prime_iff_domain_quotient (I : Ideal A) :
I.IsPrime ↔ IsDomain (A ⧸ I) :=
(Ideal.Quotient.isDomain_iff_prime I).symm
theorem radical_iff_reduced_quotient (I : Ideal A) :
I.IsRadical ↔ IsReduced (A ⧸ I) :=
Ideal.isRadical_iff_quotient_reduced I
theorem nilpotent_mk_iff (I : Ideal A) (a : A) :
IsNilpotent (Ideal.Quotient.mk I a) ↔ a ∈ I.radical := by
simp only [IsNilpotent, Ideal.mem_radical_iff, ← map_pow,
Ideal.Quotient.eq_zero_iff_mem]
theorem primary_iff_quotient_zeroDivisors (I : Ideal A) (hI : I ≠ ⊤) :
I.IsPrimary ↔ ∀ x : A ⧸ I, IsNilpotent x ↔ IsZeroDivisor x := by
letI : Nontrivial (A ⧸ I) := Ideal.Quotient.nontrivial_iff.mpr hI
constructor
· intro hp x
constructor
· exact isZeroDivisor_of_isNilpotent
· rintro ⟨y, hy, hxy⟩
obtain ⟨a, rfl⟩ := Ideal.Quotient.mk_surjective x
obtain ⟨b, rfl⟩ := Ideal.Quotient.mk_surjective y
have hba : b * a ∈ I := Ideal.Quotient.eq_zero_iff_mem.mp (by
rw [map_mul, mul_comm]
exact hxy)
rcases (Ideal.isPrimary_iff.mp hp).2 hba with hb | ha
· exact False.elim (hy (Ideal.Quotient.eq_zero_iff_mem.mpr hb))
· exact (nilpotent_mk_iff I a).mpr ha
· intro h
refine Ideal.isPrimary_iff.mpr ⟨hI, ?_⟩
intro a b hab
by_cases ha : a ∈ I
· exact Or.inl ha
· right
apply (nilpotent_mk_iff I b).mp
apply (h _).mpr
refine ⟨Ideal.Quotient.mk I a, ?_, ?_⟩
· exact fun hz => ha (Ideal.Quotient.eq_zero_iff_mem.mp hz)
· rw [← map_mul, mul_comm]
exact Ideal.Quotient.eq_zero_iff_mem.mpr hab
theorem maximal_prime (I : Ideal A) (h : I.IsMaximal) : I.IsPrime :=
h.isPrime
theorem prime_radical (I : Ideal A) (h : I.IsPrime) : I.IsRadical := by
rintro x ⟨n, hn⟩
exact h.mem_of_pow_mem n hn
theorem prime_primary (I : Ideal A) (h : I.IsPrime) : I.IsPrimary := by
refine Ideal.isPrimary_iff.mpr ⟨h.ne_top, ?_⟩
intro a b hab
exact (h.mem_or_mem hab).imp id (fun hb => Ideal.le_radical hb)Prime Avoidance Lemma
- Let
be prime ideals of a commutative ring . If an ideal of is contained in the union of these prime ideals, then is contained in one of them. This is known as the Prime Avoidance Lemma. That is,

- Let
be ideals, and let be a prime such that Then for some . Furthermore, if , then for some .

- Every prime ideal is irreducible.
Explanation
We use contrapositive way to prove these theorems, i,e.
Regarding (1), let's first consider a more simpler case when
The argument (1) holds for any general ideals
Now, let's consider the general case when
Let
it does not belong to
As shown in the above figure, the
Regarding (2), let
We use
As shown in the above figure,
For (3), we wan to show :
Since