Equations, ideals and points
A system of polynomial equations in unknowns has the same solutions as every equation obtained from it, so what really matters is the ideal . Three questions arise at once.
- Finiteness. Is every system of polynomial equations — possibly infinitely many — equivalent to a finite one? Hilbert's basis theorem (1890) says yes: every ideal of is finitely generated.
- Geometry. When does an ideal have solutions, and which polynomials vanish on all of them? Hilbert's Nullstellensatz (1893) answers both over an algebraically closed field: solutions exist unless , and vanishes on all solutions exactly when some power lies in . So radical ideals and algebraic sets determine each other.
- Local behaviour. How do we study a curve near one point — say the crossing point of the nodal cubic — ignoring the rest? By localising: allowing division by functions that do not vanish at the point.
Commutative algebra is the theory of commutative rings and their modules that answers such questions. It is the algebraic foundation of algebraic geometry and of algebraic number theory, where and the rings of integers of number fields play the role of rings of functions on "arithmetic curves". This lesson assumes modules and quotient rings; all rings are commutative with .
Elements are functions; prime ideals are points
The guiding picture, due in this generality to Grothendieck, treats every commutative ring as a ring of functions on a space, , whose points are the prime ideals.
- The value of at the point is the image of in the field . For : the integer has value at the points and , value at (in ), and value at the "generic point" . So vanishes at exactly when .
- An ideal cuts out the closed set of points where all of vanishes.
- A nilpotent () vanishes at every point but need not be : it records infinitesimal information. In the class of is a non-zero function with value at the only point — it remembers the direction of a tangent (see the widget below).
- Localising at allows denominators that do not vanish at , like passing from polynomials to rational functions defined near a point. Everything that happens away from is forgotten.
For with , the Nullstellensatz will show that the maximal ideals are exactly the points of , while the other primes correspond to irreducible subvarieties (curves, surfaces, …), each a "generic point" of its variety.
Definitions
Definition— prime and maximal ideals; the spectrum
An ideal is prime if implies or ; equivalently is an integral domain. An ideal is maximal if no ideal lies strictly between and ; equivalently is a field. The spectrum is the set of prime ideals, with the Zariski topology whose closed sets are the . A ring homomorphism induces a continuous map , .
Definition— radicals
The radical of is , and is radical if . The nilradical is the set of nilpotent elements; it equals the intersection of all prime ideals. The Jacobson radical is the intersection of all maximal ideals; if and only if is a unit for every .
Definition— localisation
A subset is multiplicative if and is closed under products. The localisation consists of fractions (, ) with if and only if for some , added and multiplied as fractions. The map , , sends to units and is universal with this property: every ring homomorphism sending to units factors uniquely through . For a module , is defined in the same way, and . Important cases: for , and for with prime.
Definition— local ring
A ring is local if it has exactly one maximal ideal ; then is the set of units, and is its residue field.
Definition— Noetherian ring and module
A module is Noetherian if every ascending chain of submodules is eventually constant, and a ring is Noetherian if it is Noetherian as a module over itself (ascending chains of ideals stabilise).
Definition— integral extension; Krull dimension
If are rings, is integral over if it satisfies a monic polynomial with ; is integral over if every element is. The Krull dimension is the supremum of the lengths of chains of prime ideals .
Definition— algebraic sets
For a field and , the algebraic set ; for , the ideal . Always is radical, and .
Examples and non-examples
Example— Spec ℤ and Spec k[x]
The primes of are and for primes ; the are maximal and is not, since . So . The closed sets are and the finite sets of non-zero primes; the point is dense — a generic point. Likewise for algebraically closed, : the affine line plus a generic point. In any PID, every non-zero prime is maximal.
Example— Spec k[x, y]
For algebraically closed the primes of are: the maximal ideals (points of the plane, by the Nullstellensatz); the principal ideals with irreducible (irreducible curves, such as ); and . The chain shows that is prime but not maximal: is a domain, not a field. So , with equality by the dimension theorem.
Example— Localisations
- is local with maximal ideal ; its primes are and — all other primes of became units.
- for , , has the primes and for odd : the point has been removed from , an open subset.
- exactly when : inverting a nilpotent kills the ring, since .
- For with , : by the Chinese remainder theorem , the element lies outside and kills the second factor, and every with is already a unit modulo . The second experiment checks this from the definition for all .
Example— Rings that are not Noetherian
- : the chain never stabilises (formalised below), and the ideal is not finitely generated. It is a subring of the Noetherian field , so subrings of Noetherian rings need not be Noetherian.
- The ring of continuous functions : the ideals increase strictly.
- The ring of all algebraic integers: .
Example— Integral extensions
is integral over (, and sums and products of integral elements are integral). is not integral over : a rational root of a monic integer polynomial is an integer (rational root theorem). The subring , the coordinate ring of the cusp (with , ), has integral over it ( is a root of ), and lies in the fraction field of but not in : the cusp is not normal, and is its normalisation.
The main theorems
Theorem— Proposition 1 (primes, maximals, radicals)
- is maximal iff is a field; is prime iff is a domain. Hence every maximal ideal is prime.
- Every proper ideal is contained in a maximal ideal (using Zorn's lemma).
- The nilradical is the intersection of all prime ideals.
Proof
(1) Ideals of correspond to ideals of containing ; a non-zero ring is a field iff its only ideals are and itself. The statement for primes is the definition read in . A field is a domain.
(2) The proper ideals containing , ordered by inclusion, form a non-empty set in which every chain has an upper bound (its union, which is proper because it does not contain ); Zorn's lemma gives a maximal element.
(3) A nilpotent satisfies , so for every prime. Conversely, if is not nilpotent then does not contain , so has a maximal ideal by (2), and its preimage in is a prime not containing .
∎
Theorem— Proposition 2 (primes of a localisation; local properties)
Let be multiplicative and .
- is an inclusion-preserving bijection from the primes of to the primes of disjoint from , with inverse . In particular is local with maximal ideal , and its primes correspond to the primes of contained in .
- Localisation is exact: if is exact, so is .
- For a module , if and only if for every maximal ideal .
Proof
(1) The preimage of a prime is a prime, and it misses because consists of units. Conversely, let be prime with . Then is a proper ideal: if then for some , so , impossible as . It is prime: if with then , so and, since , or . The same computation shows , and every ideal of satisfies (if then ). For , the primes of correspond to primes contained in , and the largest, , is the unique maximal ideal.
(2) If then the localised composite is . Let map to : then for some , so , and .
(3) Suppose and pick . Its annihilator is a proper ideal, contained in some maximal . Then in , because would put .
∎
Part (3), with exactness, is the local–global principle: injectivity, surjectivity and exactness of maps of modules can all be checked after localising at every maximal ideal. This is how problems are reduced to local rings, where Nakayama's lemma is available.
Theorem— Proposition 3 (Noetherian rings)
For a ring the following are equivalent: (a) is Noetherian; (b) every ideal of is finitely generated; (c) every non-empty set of ideals has a maximal element. Quotients and localisations of Noetherian rings are Noetherian, and finitely generated modules over a Noetherian ring are Noetherian.
Proof
(a ⇒ c) If a non-empty set had no maximal element, we could choose in (dependent choice). (c ⇒ b) Among the finitely generated ideals contained in choose a maximal one, ; if then is larger and finitely generated, so . (b ⇒ a) Given a chain , the union is an ideal, generated by finitely many elements, which all lie in some ; then . Ideals of are ideals of containing , and ideals of are by Proposition 2, so (b) passes to both. For modules: is Noetherian by induction using (a chain in stabilises if its intersections with and its images in do), and quotients of Noetherian modules are Noetherian.
∎
Theorem— Theorem 4 (Hilbert's basis theorem)
If is Noetherian, then so is . Hence — in particular and — and every finitely generated -algebra are Noetherian.
Proof
Let be an ideal; we show it is finitely generated. For let be the set of leading coefficients of polynomials in of degree , together with . Each is an ideal (sums and multiples of leading coefficients of degree- elements are leading coefficients of degree- elements, or ), and (multiply by ). Since is Noetherian, the chain stabilises at some , and each of is finitely generated. For each and each generator of , choose a polynomial in of degree with that leading coefficient; let be the ideal generated by these finitely many polynomials.
We show by induction on degree that every lies in . If there is nothing to do. Let with leading coefficient . If , write with the chosen generators of and the chosen polynomials of degree ; then has degree less than . If , then , so with the generators of , and has degree less than . By induction this difference lies in , so . The statements about several variables follow by induction, since , and finitely generated algebras are quotients of polynomial rings.
∎
The proof is non-constructive — it does not say how to find generators — which famously troubled Paul Gordan. Gröbner bases (see the computation lens below) make it effective for polynomial rings over a field.
Theorem— Theorem 5 (Nakayama's lemma)
Let be a finitely generated -module and an ideal contained in the Jacobson radical . If then . In particular, over a local ring : if then ; and elements generate if and only if their images span the -vector space .
Proof
The determinant trick. Let generate . Since , each with . So the matrix satisfies , where . Multiplying by the adjugate of gives for every . Expanding the determinant, with . So with .
Conclusion. Since , the element is a unit, and .
Generators over a local ring. If the images of span , let . Then , so the finitely generated module satisfies , hence . The converse is clear.
∎
So over a local ring, all minimal generating sets of a finitely generated module have the same size, — a basis-free substitute for dimension. Finite generation is essential: is a -module with .
Theorem— Theorem 6 (Hilbert's Nullstellensatz)
Let be an algebraically closed field.
- (Weak form) The maximal ideals of are exactly the ideals , . Consequently, if is a proper ideal then .
- (Strong form) For every ideal , .
Hence and are mutually inverse, inclusion-reversing bijections between radical ideals of and algebraic subsets of ; prime ideals correspond to irreducible algebraic sets, and maximal ideals to points.
Proof
We prove it for (the same argument works for every uncountable algebraically closed field); the general case needs Zariski's lemma — a field that is finitely generated as a -algebra is a finite extension of — proved in Atiyah–Macdonald, Chapters 5 and 7, or Eisenbud, Theorem 4.19.
Weak form. Each is maximal, being the kernel of the surjection onto the field . Conversely let be maximal and , a field containing . As a -vector space, is spanned by the images of the countably many monomials. Suppose some is not in . If were transcendental over , the uncountably many elements , , would be linearly independent: a relation with distinct gives, after clearing denominators, , a polynomial identity in the transcendental , and substituting for in that polynomial gives . This contradicts countable dimension. So is algebraic: for some non-zero , which factors as ; since is a field, for some , a contradiction. Hence , and if is the image of , then for all , so , and equality holds because is maximal. Finally, a proper ideal lies in some maximal (Proposition 1), and then every element of vanishes at .
Strong form (Rabinowitsch's trick). Clearly . Conversely, let vanish on . By Theorem 4, . In consider . It has no zeros: at a common zero of the we have , so . By the weak form is not proper: for some polynomials . Substitute in the field (if there is nothing to prove): . Multiplying by a high power clears all denominators and gives .
The bijection follows: for algebraic sets and for radical ideals. is irreducible iff is prime, by the usual argument with .
∎
The hypothesis "algebraically closed" is essential: over , the ideal of is maximal (with ) but not of the form , and although .
Theorem— Theorem 7 (dimension; stated)
Let be a field. Then . More generally, if is a finitely generated -algebra and a domain, then equals the transcendence degree of over , and every maximal chain of primes in has this length.
Proof sketch. The chain consists of primes (each quotient is a polynomial ring, a domain), so . For one uses Noether normalisation — is integral over a polynomial subring with — and the theorems of lying over, going up and incomparability (Cohen–Seidenberg) for integral extensions, which show that and have the same dimension; then induct on . See Atiyah–Macdonald, Chapters 5 and 11, or Eisenbud, Chapters 8–13. Mathlib proves for every Noetherian (see the formal section).
Theorem— Theorem 8 (primary decomposition; stated)
In a Noetherian ring every ideal is a finite intersection of primary ideals ( is primary if and imply for some ). In a minimal decomposition the primes are distinct and uniquely determined by (Lasker 1905 for polynomial rings, Noether 1921).
For example, in , . The zero set is the line , but the decomposition also records an embedded primary component at the origin: vanishes on the line, , yet , and times the nilpotent is — the ideal remembers a fuzzy point stuck to the line. The first experiment detects exactly this with Gröbner bases.
Explore: tangency is a nilpotent
The parabola meets the horizontal line where . Algebraically, the intersection is described by the ring
Move the slider. For there are two intersection points , and (Chinese remainder theorem): two reduced points. As they merge, and at the ring becomes , which is not reduced: the class of is a non-zero nilpotent, remembering that the two points collided along the -direction — the line is tangent. For there are no real points, but over there are still two, at : this is why the Nullstellensatz needs an algebraically closed field.
Two points merging into a double point
At c = 0 the intersection ring k[x]/(x²) has a nilpotent: the line is tangent.
- y = x²
- y = c
- y = x²: y = 1
- y = c: y = 1
The first experiment confirms this: but , whereas for the secant the ideal is already radical.
Commutative algebra in Lean and Mathlib
Mathlib's commutative algebra library is large. We start with the difference between prime and maximal ideals, proved directly, and the library fact that maximal ideals are prime:
/-- **A prime ideal need not be maximal.** In `ℤ` the zero ideal is prime (because `ℤ` is an
integral domain: `ab = 0` forces `a = 0` or `b = 0`), but it is not maximal, since
`(0) ⊊ (2) ⊊ ℤ`. In a PID every *non-zero* prime ideal is maximal, so `(0)` is the only
exception in `ℤ`. -/
theorem zero_prime_not_maximal : (⊥ : Ideal ℤ).IsPrime ∧ ¬ (⊥ : Ideal ℤ).IsMaximal := by
refine ⟨Ideal.isPrime_bot, fun hmax => ?_⟩
-- `(2)` lies strictly between `(0)` and `ℤ`
have h2 : (⊥ : Ideal ℤ) < Ideal.span {2} := by
rw [bot_lt_iff_ne_bot, Ne, Ideal.span_singleton_eq_bot]
norm_num
have htop : Ideal.span {(2 : ℤ)} = ⊤ := hmax.1.2 _ h2
rw [Ideal.span_singleton_eq_top] at htop
exact absurd (Int.isUnit_iff.mp htop) (by norm_num)/-- **Every maximal ideal is prime** (because `R/𝔪` is a field, hence a domain).
Mathlib: `Ideal.IsMaximal.isPrime`. -/
theorem maximal_is_prime {R : Type*} [CommRing R] {m : Ideal R} (hm : m.IsMaximal) : m.IsPrime :=
hm.isPrimeHilbert's basis theorem is in Mathlib, proved via leading coefficients as above. We prove that the hypothesis "finitely many variables" in the corollary cannot be dropped, using Mathlib's characterisation of Noetherian modules by stabilising chains (monotone_stabilizes_iff_noetherian) and an evaluation homomorphism:
/-- **Hilbert's basis theorem**: if `R` is Noetherian, so is `R[X]`. Mathlib:
`Polynomial.isNoetherianRing`, proved via ideals of leading coefficients, as in the lesson. -/
theorem hilbert_basis (R : Type*) [CommRing R] [IsNoetherianRing R] :
IsNoetherianRing (Polynomial R) :=
Polynomial.isNoetherianRing/-- **Corollary**: `k[x₁, …, xₙ]` (more generally `R[x₁, …, xₙ]` for Noetherian `R`) is
Noetherian, by induction on `n`. Mathlib: `MvPolynomial.isNoetherianRing`. -/
theorem hilbert_basis_mv (R : Type*) [CommRing R] [IsNoetherianRing R] (n : ℕ) :
IsNoetherianRing (MvPolynomial (Fin n) R) :=
inferInstance/-- **`k[x₀, x₁, x₂, …]` is not Noetherian.** Human proof: let `Iₙ = (x₀, …, xₙ₋₁)`. The chain
`I₀ ⊆ I₁ ⊆ ⋯` is increasing; if it stabilised at `n`, then `xₙ ∈ Iₙ₊₁ = Iₙ`. But the evaluation
homomorphism sending `xᵢ ↦ 0` for `i < n` and `xᵢ ↦ 1` otherwise kills `Iₙ` and sends `xₙ ↦ 1`. -/
theorem infinitely_many_variables_not_noetherian (k : Type*) [Field k] :
¬ IsNoetherianRing (MvPolynomial ℕ k) := by
intro hnoeth
let I : ℕ →o Ideal (MvPolynomial ℕ k) :=
⟨fun n => Ideal.span (MvPolynomial.X '' {i | i < n}), fun a b hab =>
Ideal.span_mono (Set.image_mono fun i (hi : i < a) => lt_of_lt_of_le hi hab)⟩
obtain ⟨n, hn⟩ := (monotone_stabilizes_iff_noetherian).mpr hnoeth I
-- evaluation killing the first `n` variables
let φ : MvPolynomial ℕ k →+* k := MvPolynomial.eval fun i => if i < n then 0 else 1
have hker : I n ≤ RingHom.ker φ := by
show Ideal.span _ ≤ _
rw [Ideal.span_le]
rintro _ ⟨i, hi, rfl⟩
simp only [SetLike.mem_coe, RingHom.mem_ker, φ, MvPolynomial.eval_X]
exact (ite_eq_left_iff.mpr fun h => absurd hi h)
have hmem : (MvPolynomial.X n : MvPolynomial ℕ k) ∈ I n := by
rw [hn (n + 1) (Nat.le_succ n)]
exact Ideal.subset_span ⟨n, Nat.lt_succ_self n, rfl⟩
have h1 : φ (MvPolynomial.X n) = 0 := hker hmem
simp [φ] at h1Nakayama's lemma, proved here from Mathlib's determinant trick exactly as in the text — the only extra step is that is a unit when lies in the Jacobson radical (Ideal.mem_jacobson_bot) — and Mathlib's own statement:
/-- **Nakayama's lemma.** Let `N` be a finitely generated module and `I` an ideal contained in
the Jacobson radical. If `N ⊆ I N` then `N = 0`. Human proof: the determinant trick
(Cayley–Hamilton applied to a matrix expressing the generators in terms of themselves with
coefficients in `I`) gives `r ∈ R` with `r - 1 ∈ I` and `r N = 0`. Since `r - 1` lies in the
Jacobson radical, `r = 1 + (r - 1)` is a unit, so `N = r⁻¹ r N = 0`. (Mathlib's version is
`Submodule.eq_bot_of_le_smul_of_le_jacobson_bot`.) -/
theorem nakayama {R M : Type*} [CommRing R] [AddCommGroup M] [Module R M] (I : Ideal R)
(N : Submodule R M) (hN : N.FG) (hIN : N ≤ I • N) (hjac : I ≤ Ideal.jacobson ⊥) :
N = ⊥ := by
obtain ⟨r, hr, hrN⟩ := Submodule.exists_sub_one_mem_and_smul_eq_zero_of_fg_of_le_smul I N hN hIN
-- `r = 1 + (r - 1)` is a unit, because `r - 1` lies in the Jacobson radical
have hunit : IsUnit r := by
have h := (Ideal.mem_jacobson_bot.mp (hjac hr)) 1
simpa using h
rw [eq_bot_iff]
intro n hn
have h0 : r • n = 0 := hrN n hn
rw [Submodule.mem_bot]
calc n = (1 : R) • n := (one_smul R n).symm
_ = ((hunit.unit⁻¹ : Rˣ) * r : R) • n := by rw [hunit.val_inv_mul]
_ = (hunit.unit⁻¹ : Rˣ) • (r • n) := mul_smul _ _ _
_ = 0 := by rw [h0, smul_zero]/-- **Nakayama's lemma, Mathlib's version** (`Submodule.eq_bot_of_le_smul_of_le_jacobson_bot`). For a
local ring, `I = 𝔪` lies in the Jacobson radical, giving the familiar form: if `M` is finitely
generated and `𝔪 M = M` then `M = 0`. -/
theorem nakayama_library {R M : Type*} [CommRing R] [AddCommGroup M] [Module R M] (I : Ideal R)
(N : Submodule R M) (hN : N.FG) (hIN : N ≤ I • N) (hjac : I ≤ Ideal.jacobson ⊥) :
N = ⊥ :=
Submodule.eq_bot_of_le_smul_of_le_jacobson_bot I N hN hIN hjacLocalisation at a prime, through the predicate IsLocalization.AtPrime S p (" is a localisation of at "), which lets every construction of be used interchangeably:
/-- **Primes of a localisation.** If `S` is the localisation of `R` at the complement of a prime
`𝔭`, the prime ideals of `S` correspond, preserving inclusion, to the prime ideals of `R`
contained in `𝔭`. Mathlib: `IsLocalization.AtPrime.orderIsoOfPrime`. In particular `R_𝔭` has a
unique maximal ideal: it is local. -/
noncomputable def localization_primes {R : Type*} [CommRing R] (p : Ideal R) [p.IsPrime]
(S : Type*) [CommRing S] [Algebra R S] [IsLocalization.AtPrime S p] :
{ q : Ideal S // q.IsPrime } ≃o { q : Ideal R // q.IsPrime ∧ q ≤ p } :=
IsLocalization.AtPrime.orderIsoOfPrime S p/-- **`R_𝔭` is a local ring.** Mathlib: the instance `Localization.AtPrime.isLocalRing`. -/
theorem localization_local {R : Type*} [CommRing R] (p : Ideal R) [p.IsPrime] :
IsLocalRing (Localization.AtPrime p) :=
inferInstanceThe Nullstellensatz: first, why the radical is needed; then Mathlib's strong and weak forms (stated for finitely many variables over an algebraically closed field); and the dimension of polynomial rings:
/-- **`(x²)` is not a radical ideal of `k[x]`.** Its zero set is the single point `0`, whose
vanishing ideal is `(x)`; and indeed `x ∉ (x²)` although `x² ∈ (x²)`. So the Nullstellensatz
must return the radical `√I`, not `I`. Proof: `x² ∣ x` would force the coefficient of `x` in
`x` to vanish. -/
theorem x_sq_not_radical (k : Type*) [Field k] :
(Polynomial.X : Polynomial k) ^ 2 ∈ Ideal.span {Polynomial.X ^ 2} ∧
(Polynomial.X : Polynomial k) ∉ Ideal.span {Polynomial.X ^ 2} := by
refine ⟨Ideal.subset_span rfl, fun h => ?_⟩
rw [Ideal.mem_span_singleton, Polynomial.X_pow_dvd_iff] at h
have := h 1 (by norm_num)
simp at this/-- **Hilbert's Nullstellensatz** (strong form): over an algebraically closed field `k`, a
polynomial vanishes on the zero set of an ideal `I ⊆ k[x₁, …, xₙ]` exactly when some power of it
lies in `I`: `I(V(I)) = √I`. Mathlib: `MvPolynomial.vanishingIdeal_zeroLocus_eq_radical`. -/
theorem nullstellensatz {k : Type*} [Field k] [IsAlgClosed k] {n : ℕ}
(I : Ideal (MvPolynomial (Fin n) k)) :
MvPolynomial.vanishingIdeal k (MvPolynomial.zeroLocus k I) = I.radical :=
MvPolynomial.vanishingIdeal_zeroLocus_eq_radical I/-- **Weak Nullstellensatz**: over an algebraically closed field, the maximal ideals of
`k[x₁, …, xₙ]` are exactly the ideals `𝔪ₐ = {f : f(a) = 0}` of points `a ∈ kⁿ`. Mathlib:
`MvPolynomial.isMaximal_iff_eq_vanishingIdeal_singleton`. -/
theorem maximal_ideals_are_points {k : Type*} [Field k] [IsAlgClosed k] {n : ℕ}
(I : Ideal (MvPolynomial (Fin n) k)) :
I.IsMaximal ↔ ∃ a : Fin n → k, I = MvPolynomial.vanishingIdeal k {a} :=
MvPolynomial.isMaximal_iff_eq_vanishingIdeal_singleton/-- **`dim k[x₁, …, xₙ] = n`.** The chain `0 ⊂ (x₁) ⊂ (x₁, x₂) ⊂ ⋯ ⊂ (x₁, …, xₙ)` shows `≥ n`; the
reverse inequality is the hard part. Mathlib: `MvPolynomial.ringKrullDim_of_isNoetherianRing_of_finite`
(`dim R[x₁, …, xₙ] = dim R + n` for Noetherian `R`) and `ringKrullDim_eq_zero_of_field`. -/
theorem krull_dim_polynomial (k : Type*) [Field k] (n : ℕ) :
ringKrullDim (MvPolynomial (Fin n) k) = n := by
rw [MvPolynomial.ringKrullDim_of_isNoetherianRing_of_finite, ringKrullDim_eq_zero_of_field,
Nat.card_eq_fintype_card, Fintype.card_fin, zero_add]What is and is not formalised. Proved here: is prime but not maximal; is not Noetherian; Nakayama's lemma from the determinant trick; is not radical. From Mathlib: maximal ⇒ prime, Hilbert's basis theorem, the determinant trick, the primes of a localisation and locality of , both forms of the Nullstellensatz (for all algebraically closed fields, via Jacobson rings rather than our countability argument), and . Not formalised here: Proposition 2(3) and the local–global principle, the countability proof of the Nullstellensatz for , primary decomposition (Mathlib proves the Lasker–Noether theorem for Noetherian modules as Submodule.isLasker), Noether normalisation (Mathlib: exists_finite_inj_algHom_of_fg), and lying over and going up (Mathlib: Ideal.exists_ideal_over_prime_of_isIntegral and its relatives).
Radicals and spectra, computed
The first experiment decides ideal membership in with Gröbner bases, finds the least with in several tangency examples (parabola and tangent line, circle and tangent line, the cusp and its tangent), and checks the answer against Rabinowitsch's single test from the proof of Theorem 6.
"""The Nullstellensatz with Groebner bases: tangency, nilpotents and radicals.
For an ideal I = (g1, ..., gr) of Q[x, y], membership f in I is decided by a
Groebner basis. The Nullstellensatz says f vanishes on the complex zero set
V(I) exactly when f^k lies in I for some k, and Rabinowitsch's trick turns
this into one membership test: f is in the radical of I iff 1 lies in the
ideal (g1, ..., gr, 1 - t f) of Q[x, y, t]. We test both on examples where a
line is tangent to a curve (the intersection is a double point, and the
coordinate ring has a nilpotent), and on an ideal with no real zeros.
Exact symbolic computation with sympy.
"""
import sympy as sp
x, y, t = sp.symbols("x y t")
def in_ideal(f, gens, variables=(x, y)):
"""Decide f in (gens) with a Groebner basis (lex order)."""
basis = sp.groebner(list(gens), *variables, order="lex")
return basis.contains(sp.sympify(f))
def radical_exponent(f, gens, max_k=6):
"""Least k <= max_k with f^k in (gens), or None."""
for k in range(1, max_k + 1):
if in_ideal(sp.expand(f ** k), gens):
return k
return None
def in_radical(f, gens):
"""Rabinowitsch: f is in rad(gens) iff 1 is in (gens, 1 - t f)."""
g = sp.groebner(list(gens) + [1 - t * f], x, y, t, order="lex")
return list(g.exprs) == [1]
def is_proper(gens):
"""(gens) is a proper ideal iff its reduced Groebner basis is not [1]."""
return list(sp.groebner(list(gens), x, y, order="lex").exprs) != [1]
EXAMPLES = [
("parabola y = x^2, tangent y = 0", [y - x**2, y], x),
("parabola y = x^2, secant y = 1", [y - x**2, y - 1], x**2 - 1),
("circle, tangent line x = 1", [x**2 + y**2 - 1, x - 1], y),
("cusp y^2 = x^3, line y = 0", [y**2 - x**3, y], x),
("double line x^2 = 0, xy = 0", [x**2, x * y], x),
("double line x^2 = 0, xy = 0", [x**2, x * y], y),
]
def main():
print("f vanishes on V(I) iff f^k in I for some k (k = None: never).")
for name, gens, f in EXAMPLES:
k = radical_exponent(f, gens)
rab = in_radical(f, gens)
agree = (k is not None) == rab
print(f" {name}:")
print(f" f = {f}: least k = {k}; Rabinowitsch says {rab}; "
f"agree: {agree}")
print("No real zeros, but proper (complex zeros +-i):",
is_proper([x**2 + 1, y]))
print("Empty complex zero set, so 1 lies in I = (xy - 1, x):",
not is_proper([x * y - 1, x]))
print()
print("Epistemic status: exact Groebner basis computations over Q for "
"the listed\nideals; they illustrate the Nullstellensatz but cannot "
"prove it, and they say\nnothing about ideals not tested. The "
"theorem needs an algebraically closed\nfield, as the ideal "
"(x^2 + 1, y) shows over the reals.")
if __name__ == "__main__":
main()The second experiment works in the finite rings for , where everything can be checked by listing elements: primes coincide with maximal ideals (finite domains are fields, so ), the nilradical equals the Jacobson radical, is local exactly when is a prime power, localisation at — computed from the definition of — gives , and Nakayama's lemma holds for every ideal of every local .
"""Spec, localisation and Nakayama in the finite rings Z/n, by brute force.
The ideals of Z/n are dZ/n for d | n, so everything about Z/n can be checked
by listing elements. For every n <= 60 we compute: the prime and maximal
ideals (they coincide: Z/n has Krull dimension 0), the nilradical (the
nilpotent elements) and the Jacobson radical (intersection of the maximal
ideals), whether Z/n is local, and the localisation at each prime p,
computed from the definition S^-1 R = R / {a : sa = 0 for some s in S},
S = R minus (p), which turns out to be Z/p^e with p^e || n. Finally it checks
Nakayama's lemma for every ideal of every local ring Z/p^e: mM = M forces
M = 0. Exhaustive over a finite range, exact arithmetic.
"""
def ideal(n, d):
"""The ideal generated by d in Z/n, as a frozenset of residues."""
return frozenset(d * k % n for k in range(n))
def ideals(n):
"""All ideals of Z/n (one for each divisor d of n)."""
return {d: ideal(n, d) for d in range(1, n + 1) if n % d == 0}
def is_prime_ideal(n, i):
"""Proper, and ab in I implies a in I or b in I."""
if len(i) == n:
return False
return all(a in i or b in i for a in range(n) for b in range(n)
if a * b % n in i)
def is_maximal_ideal(n, i):
"""Proper, and no ideal strictly between I and Z/n."""
others = ideals(n).values()
return len(i) < n and not any(i < j < frozenset(range(n)) for j in others)
def nilradical(n):
"""Nilpotent elements of Z/n."""
return frozenset(a for a in range(n) if any(pow(a, k, n) == 0
for k in range(1, n + 1)))
def jacobson(n):
"""Intersection of the maximal ideals of Z/n (n >= 2)."""
maxes = [i for i in ideals(n).values() if is_maximal_ideal(n, i)]
out = frozenset(range(n))
for m in maxes:
out &= m
return out
def localisation_size(n, p):
"""|S^-1 (Z/n)| for S = Z/n minus (p), from the definition."""
prime = ideal(n, p)
s = [a for a in range(n) if a not in prime]
killed = {a for a in range(n) if any(si * a % n == 0 for si in s)}
return n // len(killed)
def p_part(n, p):
"""p^e with p^e exactly dividing n."""
q = 1
while n % p == 0:
n, q = n // p, q * p
return q
def prime_divisors(n):
"""The set of primes dividing n."""
return {p for p in range(2, n + 1)
if n % p == 0 and all(p % q for q in range(2, p))}
def nakayama_holds(n):
"""For local Z/n with maximal ideal m: mM = M implies M = 0, all ideals M."""
(m,) = [i for i in ideals(n).values() if is_maximal_ideal(n, i)]
for big_m in ideals(n).values():
m_times = frozenset((a * b) % n for a in m for b in big_m)
if m_times == big_m and big_m != frozenset({0}):
return False
return True
def main():
ns = range(2, 61)
agree = loc_ok = rad_ok = 0
local, nak = [], True
for n in ns:
ids = ideals(n)
primes = {d for d, i in ids.items() if is_prime_ideal(n, i)}
maxes = {d for d, i in ids.items() if is_maximal_ideal(n, i)}
agree += primes == maxes
rad_ok += nilradical(n) == jacobson(n)
loc_ok += all(localisation_size(n, p) == p_part(n, p) for p in primes)
if len(maxes) == 1:
local.append(n)
nak = nak and nakayama_holds(n)
print(f"Rings Z/n for 2 <= n <= 60 ({len(ns)} rings):")
print(f" prime ideals = maximal ideals (dimension 0): {agree} rings")
print(f" nilradical = Jacobson radical: {rad_ok} rings")
print(f" localisation at (p) has p^e elements, p^e||n: {loc_ok} rings")
print(f" local rings: n = {local[:12]} ...")
print(" all local n are prime powers:",
all(len(prime_divisors(n)) == 1 for n in local))
print(f" Nakayama (mM = M implies M = 0) in every local Z/n: {nak}")
n = 12
primes = sorted(d for d, i in ideals(n).items() if is_prime_ideal(n, i))
print(f"Example n = {n}: prime ideals generated by {primes}, nilradical "
f"{sorted(nilradical(n))},")
print(" sizes of the localisations at these primes: "
f"{[localisation_size(n, p) for p in primes]}")
print()
print("Epistemic status: exhaustive and exact for n <= 60, so every "
"statement printed\nis verified in that range. It illustrates, "
"but does not prove, the general\ntheorems (Z/n is Artinian; "
"Z/n localised at (p) is Z/p^e) proved in the lesson.")
if __name__ == "__main__":
main()Exercises
1. Commutative algebra
Warm-upHumanWhich of these ideals are prime? (Choose all that apply.)
2. Commutative algebra
Warm-upHumanWhat is the Krull dimension of ?
3. Commutative algebra
CoreHumanHow many elements does the localisation have? (Here is the prime ideal of generated by .)
4. Commutative algebra
CoreHumanIn the proof of Hilbert's basis theorem, is the ideal of leading coefficients of degree- elements of . Why is there an with ?
5. Commutative algebra
CoreHumanLet , and . Then but . Which hypothesis of Nakayama's lemma fails?
6. Commutative algebra
StretchHumanLet : the unit circle and its tangent line at . Which of these polynomials lie in itself? (Choose all that apply.)
7. Commutative algebra
CoreFormalWhich Lean statement formalises “the polynomial ring in infinitely many variables over a field is not Noetherian”?
8. Commutative algebra
StretchComputationalThe ideals of are for the divisors of . Write prime_ideals(n) (for ) returning the sorted list of divisors of for which the ideal generated by in is prime, checking the definition directly: proper, and or for all residues .
Common misconceptions
Misconception
"Every ring is Noetherian." The rings met first — fields, , , their quotients and localisations — are Noetherian, but is not (the chain never stops), and neither are or the ring of all algebraic integers. A subring of a Noetherian ring need not be Noetherian: .
Misconception
"Prime and maximal ideals are the same thing." Every maximal ideal is prime, but not conversely: and are prime and not maximal. Geometrically, maximal ideals are closed points, and non-maximal primes are generic points of positive-dimensional subvarieties. They do coincide in rings of dimension , such as finite rings and .
Misconception
"An ideal is determined by its zero set." Only its radical is: and in have the same zero set . The Nullstellensatz gives , not , and the difference — nilpotents in — carries real information, such as tangency and multiplicity.
Misconception
"The Nullstellensatz holds over any field" and "Nakayama holds for any module." Over , is a proper ideal with no real zeros, so the weak form fails; algebraic closure is essential. Nakayama needs finite generation: is a module over the local ring with , yet .
Viewpoints
Geometry— The algebra–geometry dictionary
The Nullstellensatz turns geometry into algebra: algebraic sets in correspond to radical ideals, irreducible ones to primes, points to maximal ideals, and polynomial maps between algebraic sets to -algebra homomorphisms of coordinate rings, reversing arrows. Local geometry is local algebra: the local ring consists of rational functions defined near , and the Zariski cotangent space (with the maximal ideal of ) has dimension equal to exactly at smooth points. For the nodal cubic at the origin, is -dimensional on a -dimensional curve: the origin is singular. Smoothness becomes an algebraic property — regularity of the local ring — and Grothendieck's schemes extend the dictionary to all commutative rings (see algebraic geometry).
Topology— The Zariski topology: compact, rarely Hausdorff
with the Zariski topology is always quasi-compact (if then , so is a finite sum and finitely many already have empty intersection), but rarely Hausdorff: the closure of the generic point of is everything. Its topology is coarse but meaningful. Irreducible components of correspond to minimal primes; connected components to idempotents — is disconnected exactly when non-trivially, as for , whose spectrum is two points; and a Noetherian ring has a Noetherian spectrum, in which every closed set is a finite union of irreducible ones (the geometric face of primary decomposition). Principal open sets form a basis, so localisation literally is restriction to an open subset (see point-set topology).
Number theory— Spec ℤ as an arithmetic curve
and the ring of integers of a number field are Noetherian, integrally closed domains of dimension — Dedekind domains — and in them every non-zero ideal factors uniquely into prime ideals, which is what Kummer's "ideal numbers" were invented to restore. The inclusion is integral, and lying over is the statement that every prime has primes of above it: ramifies, splits, stays prime. Localising at — and then completing to the -adic integers — studies a number "near the prime ", just as one studies a function near a point. The resulting analogy between number fields and function fields of curves over finite fields (Dedekind–Weber, Weil) is a guiding heuristic, not a theorem; it has repeatedly predicted true results, such as the Weil conjectures proved by Deligne (see algebraic number theory).
Computation— Gröbner bases: deciding ideal membership
For polynomial rings over a field, Hilbert's existence proofs became algorithms with Gröbner bases, introduced by Bruno Buchberger in his 1965 thesis (supervised by Wolfgang Gröbner). A Gröbner basis of for a monomial order makes division with remainder unique, so iff the remainder of is . With it one can decide membership, compute -membership by Rabinowitsch's trick, eliminate variables (the elimination theorem: a lex Gröbner basis of contains one of ), compute Hilbert polynomials and hence dimension, and find primary decompositions. The cost can be enormous: Mayr and Meyer (1982) showed that ideal membership for polynomials with rational coefficients is EXPSPACE-hard, yet Gröbner bases are routine in practice for small systems and power computer algebra systems such as Singular and Macaulay2. The first experiment uses sympy's implementation.
Wonder Trail
Localisation is the systematic answer to the question this trail asks for the integers: which elements can be given inverses, and what happens to the ring when we insist? Inverting all non-zero integers gives ; inverting only the powers of gives ; inverting a nilpotent destroys the ring.
Wonder Trail · Optional · never gradedInverses and structureEvery integer can be added to another integer to get . So why can almost no integer be multiplied by another integer to get ?Follow the trailHistory and global context
- Ernst Kummer introduced "ideal numbers" in the 1840s to restore unique factorisation in cyclotomic integers; Richard Dedekind replaced them by ideals (1871), and Leopold Kronecker developed a parallel theory of divisors.
- David Hilbert proved the basis theorem (1890) and the Nullstellensatz (1893) in his work on invariant theory; J. L. Rabinowitsch gave the one-page trick for the strong form (1929). Emanuel Lasker (also a world chess champion) proved primary decomposition in polynomial rings (1905).
- Emmy Noether's "Idealtheorie in Ringbereichen" (1921) introduced the ascending chain condition and proved primary decomposition in what are now called Noetherian rings; her school in Göttingen made abstract commutative algebra a subject.
- Wolfgang Krull developed dimension theory, local rings and localisation in the 1920s–30s. Oscar Zariski and André Weil rebuilt algebraic geometry on commutative algebra in the 1940s; Masayoshi Nagata found fundamental counterexamples, including a Noetherian ring of infinite Krull dimension (1962). The lemma named after Tadasi Nakayama was also found by Wolfgang Krull and Gorô Azumaya, and Nakayama himself credited it to them.
- Alexander Grothendieck (Éléments de géométrie algébrique, from 1960) made of an arbitrary ring a geometric space, unifying algebraic geometry and number theory. Bruno Buchberger (1965) introduced Gröbner bases, making much of the theory computable.
Further reading
- M. F. Atiyah and I. G. Macdonald, Introduction to Commutative Algebra (1969) — the classic concise course: localisation (Ch. 3), primary decomposition (Ch. 4), integral dependence and the Nullstellensatz (Ch. 5, 7), dimension theory (Ch. 11).
- David Eisenbud, Commutative Algebra with a View Toward Algebraic Geometry (1995) — comprehensive, with geometric motivation and Gröbner bases.
- Miles Reid, Undergraduate Commutative Algebra (1995) — a gentle first pass, very geometric.
- Hideyuki Matsumura, Commutative Ring Theory (1986) — the standard reference for dimension theory and local rings.
- David Cox, John Little and Donal O'Shea, Ideals, Varieties, and Algorithms (4th ed., 2015) — Gröbner bases and computational algebraic geometry.
- Robin Hartshorne, Algebraic Geometry (1977) — Chapters I–II build varieties and schemes on this lesson's commutative algebra.