Skip to content
The Lumenary
First-year graduateGraduate 150 min

Commutative algebra

Rings as spaces of functions — prime ideals as points, localisation as zooming in, and Hilbert's theorems that make polynomial equations finite and geometric.

Formally verified · 13 LeanComputationally tested · 2 PythonAI-drafted · awaiting human reviewMathematically reviewed: Awaiting human review
MotivationH

Equations, ideals and points

A system of polynomial equations f1=⋯=fr=0f_1 = \cdots = f_r = 0 in nn unknowns has the same solutions as every equation ∑hifi=0\sum h_i f_i = 0 obtained from it, so what really matters is the ideal I=(f1,…,fr)⊆k[x1,…,xn]I = (f_1, \dots, f_r) \subseteq k[x_1, \dots, x_n]. Three questions arise at once.

  1. 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 k[x1,…,xn]k[x_1, \dots, x_n] is finitely generated.
  2. 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 1∈I1 \in I, and ff vanishes on all solutions exactly when some power fmf^m lies in II. So radical ideals and algebraic sets determine each other.
  3. Local behaviour. How do we study a curve near one point — say the crossing point of the nodal cubic y2=x2(x+1)y^2 = x^2(x + 1) — 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 Z\Z 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 11.

IntuitionH

Elements are functions; prime ideals are points

The guiding picture, due in this generality to Grothendieck, treats every commutative ring RR as a ring of functions on a space, Spec⁡R\operatorname{Spec} R, whose points are the prime ideals.

  • The value of f∈Rf \in R at the point p\mathfrak{p} is the image of ff in the field κ(p)=Frac⁡(R/p)\kappa(\mathfrak{p}) = \operatorname{Frac}(R/\mathfrak{p}). For R=ZR = \Z: the integer 66 has value 00 at the points (2)(2) and (3)(3), value 11 at (5)(5) (in F5\mathbb{F}_5), and value 6∈Q6 \in \Q at the "generic point" (0)(0). So ff vanishes at p\mathfrak{p} exactly when f∈pf \in \mathfrak{p}.
  • An ideal II cuts out the closed set V(I)={p:p⊇I}V(I) = \{\mathfrak{p} : \mathfrak{p} \supseteq I\} of points where all of II vanishes.
  • A nilpotent ff (fm=0f^m = 0) vanishes at every point but need not be 00: it records infinitesimal information. In k[x]/(x2)k[x]/(x^2) the class of xx is a non-zero function with value 00 at the only point — it remembers the direction of a tangent (see the widget below).
  • Localising at p\mathfrak{p} allows denominators that do not vanish at p\mathfrak{p}, like passing from polynomials to rational functions defined near a point. Everything that happens away from p\mathfrak{p} is forgotten.

For k[x1,…,xn]k[x_1, \dots, x_n] with k=Ck = \C, the Nullstellensatz will show that the maximal ideals are exactly the points of Cn\C^n, while the other primes correspond to irreducible subvarieties (curves, surfaces, …), each a "generic point" of its variety.

DefinitionsH

Definitions

Definition— prime and maximal ideals; the spectrum

An ideal p≠R\mathfrak{p} \neq R is prime if ab∈pab \in \mathfrak{p} implies a∈pa \in \mathfrak{p} or b∈pb \in \mathfrak{p}; equivalently R/pR/\mathfrak{p} is an integral domain. An ideal m≠R\mathfrak{m} \neq R is maximal if no ideal lies strictly between m\mathfrak{m} and RR; equivalently R/mR/\mathfrak{m} is a field. The spectrum Spec⁡R\operatorname{Spec} R is the set of prime ideals, with the Zariski topology whose closed sets are the V(I)={p:p⊇I}V(I) = \{\mathfrak{p} : \mathfrak{p} \supseteq I\}. A ring homomorphism φ:R→S\varphi : R \to S induces a continuous map Spec⁡S→Spec⁡R\operatorname{Spec} S \to \operatorname{Spec} R, q↦φ−1(q)\mathfrak{q} \mapsto \varphi^{-1}(\mathfrak{q}).

Definition— radicals

The radical of II is I={f:fm∈I for some m≥1}\sqrt{I} = \{f : f^m \in I \text{ for some } m \geq 1\}, and II is radical if I=II = \sqrt I. The nilradical 0\sqrt{0} is the set of nilpotent elements; it equals the intersection of all prime ideals. The Jacobson radical J(R)J(R) is the intersection of all maximal ideals; x∈J(R)x \in J(R) if and only if 1+xy1 + xy is a unit for every y∈Ry \in R.

Definition— localisation

A subset S⊆RS \subseteq R is multiplicative if 1∈S1 \in S and SS is closed under products. The localisation S−1RS^{-1}R consists of fractions r/sr/s (r∈Rr \in R, s∈Ss \in S) with r/s=r′/s′r/s = r'/s' if and only if t(rs′−r′s)=0t(rs' - r's) = 0 for some t∈St \in S, added and multiplied as fractions. The map R→S−1RR \to S^{-1}R, r↦r/1r \mapsto r/1, sends SS to units and is universal with this property: every ring homomorphism R→TR \to T sending SS to units factors uniquely through S−1RS^{-1}R. For a module MM, S−1MS^{-1}M is defined in the same way, and S−1M≅S−1R⊗RMS^{-1}M \cong S^{-1}R \otimes_R M. Important cases: Rf=S−1RR_f = S^{-1}R for S={1,f,f2,… }S = \{1, f, f^2, \dots\}, and Rp=S−1RR_\mathfrak{p} = S^{-1}R for S=R∖pS = R \setminus \mathfrak{p} with p\mathfrak{p} prime.

Definition— local ring

A ring is local if it has exactly one maximal ideal m\mathfrak{m}; then R∖mR \setminus \mathfrak{m} is the set of units, and k=R/mk = R/\mathfrak{m} is its residue field.

Definition— Noetherian ring and module

A module is Noetherian if every ascending chain of submodules N1⊆N2⊆⋯N_1 \subseteq N_2 \subseteq \cdots 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 A⊆BA \subseteq B are rings, b∈Bb \in B is integral over AA if it satisfies a monic polynomial bn+an−1bn−1+⋯+a0=0b^n + a_{n-1}b^{n-1} + \cdots + a_0 = 0 with ai∈Aa_i \in A; BB is integral over AA if every element is. The Krull dimension dim⁡R\dim R is the supremum of the lengths nn of chains of prime ideals p0⊊p1⊊⋯⊊pn\mathfrak{p}_0 \subsetneq \mathfrak{p}_1 \subsetneq \cdots \subsetneq \mathfrak{p}_n.

Definition— algebraic sets

For a field kk and T⊆k[x1,…,xn]T \subseteq k[x_1, \dots, x_n], the algebraic set V(T)={a∈kn:f(a)=0 for all f∈T}V(T) = \{a \in k^n : f(a) = 0 \text{ for all } f \in T\}; for X⊆knX \subseteq k^n, the ideal I(X)={f:f(a)=0 for all a∈X}I(X) = \{f : f(a) = 0 \text{ for all } a \in X\}. Always I(X)I(X) is radical, T⊆I(V(T))T \subseteq I(V(T)) and V(I(V(T)))=V(T)V(I(V(T))) = V(T).

Worked examplesH

Examples and non-examples

Example— Spec ℤ and Spec k[x]

The primes of Z\Z are (0)(0) and (p)(p) for primes pp; the (p)(p) are maximal and (0)(0) is not, since (0)⊊(2)⊊Z(0) \subsetneq (2) \subsetneq \Z. So dim⁡Z=1\dim \Z = 1. The closed sets are Spec⁡Z\operatorname{Spec}\Z and the finite sets of non-zero primes; the point (0)(0) is dense — a generic point. Likewise for kk algebraically closed, Spec⁡k[x]={(x−a):a∈k}∪{(0)}\operatorname{Spec} k[x] = \{(x - a) : a \in k\} \cup \{(0)\}: the affine line plus a generic point. In any PID, every non-zero prime is maximal.

Example— Spec k[x, y]

For kk algebraically closed the primes of k[x,y]k[x, y] are: the maximal ideals (x−a,y−b)(x - a, y - b) (points of the plane, by the Nullstellensatz); the principal ideals (f)(f) with ff irreducible (irreducible curves, such as (y−x2)(y - x^2)); and (0)(0). The chain (0)⊊(x)⊊(x,y)(0) \subsetneq (x) \subsetneq (x, y) shows that (x)(x) is prime but not maximal: k[x,y]/(x)≅k[y]k[x,y]/(x) \cong k[y] is a domain, not a field. So dim⁡k[x,y]≥2\dim k[x, y] \geq 2, with equality by the dimension theorem.

Example— Localisations

  • Z(p)={a/b:p∤b}\Z_{(p)} = \{a/b : p \nmid b\} is local with maximal ideal pZ(p)p\Z_{(p)}; its primes are (0)(0) and (p)(p) — all other primes of Z\Z became units.
  • Z[1/2]=Rf\Z[1/2] = R_f for R=ZR = \Z, f=2f = 2, has the primes (0)(0) and (p)(p) for odd pp: the point (2)(2) has been removed from Spec⁡Z\operatorname{Spec} \Z, an open subset.
  • S−1R=0S^{-1}R = 0 exactly when 0∈S0 \in S: inverting a nilpotent kills the ring, since 1/1=fm/fm=01/1 = f^m/f^m = 0.
  • For n=pemn = p^e m with p∤mp \nmid m, (Z/n)(p)≅Z/pe(\Z/n)_{(p)} \cong \Z/p^e: by the Chinese remainder theorem Z/n≅Z/pe×Z/m\Z/n \cong \Z/p^e \times \Z/m, the element s=(1,0)s = (1, 0) lies outside (p)(p) and kills the second factor, and every aa with p∤ap \nmid a is already a unit modulo pep^e. The second experiment checks this from the definition for all n≤60n \leq 60.

Example— Rings that are not Noetherian

  • k[x1,x2,x3,… ]k[x_1, x_2, x_3, \dots]: the chain (x1)⊊(x1,x2)⊊⋯(x_1) \subsetneq (x_1, x_2) \subsetneq \cdots never stabilises (formalised below), and the ideal (x1,x2,… )(x_1, x_2, \dots) is not finitely generated. It is a subring of the Noetherian field k(x1,x2,… )k(x_1, x_2, \dots), so subrings of Noetherian rings need not be Noetherian.
  • The ring of continuous functions C([0,1])C([0, 1]): the ideals In={f:f=0 on [0,1/n]}I_n = \{f : f = 0 \text{ on } [0, 1/n]\} increase strictly.
  • The ring Z‾\overline{\Z} of all algebraic integers: (2)⊊(21/2)⊊(21/4)⊊⋯(2) \subsetneq (2^{1/2}) \subsetneq (2^{1/4}) \subsetneq \cdots.

Example— Integral extensions

Z[i]\Z[i] is integral over Z\Z (i2+1=0i^2 + 1 = 0, and sums and products of integral elements are integral). Q\Q is not integral over Z\Z: a rational root of a monic integer polynomial is an integer (rational root theorem). The subring A=k[t2,t3]⊆k[t]A = k[t^2, t^3] \subseteq k[t], the coordinate ring of the cusp y2=x3y^2 = x^3 (with x=t2x = t^2, y=t3y = t^3), has k[t]k[t] integral over it (tt is a root of T2−t2T^2 - t^2), and t=t3/t2t = t^3/t^2 lies in the fraction field of AA but not in AA: the cusp is not normal, and k[t]k[t] is its normalisation.

ProofH

The main theorems

Theorem— Proposition 1 (primes, maximals, radicals)

  1. m\mathfrak{m} is maximal iff R/mR/\mathfrak{m} is a field; p\mathfrak{p} is prime iff R/pR/\mathfrak{p} is a domain. Hence every maximal ideal is prime.
  2. Every proper ideal is contained in a maximal ideal (using Zorn's lemma).
  3. The nilradical is the intersection of all prime ideals.

Proof

(1) Ideals of R/mR/\mathfrak{m} correspond to ideals of RR containing m\mathfrak{m}; a non-zero ring is a field iff its only ideals are 00 and itself. The statement for primes is the definition read in R/pR/\mathfrak{p}. A field is a domain.

(2) The proper ideals containing II, 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 11); Zorn's lemma gives a maximal element.

(3) A nilpotent ff satisfies fm=0∈pf^m = 0 \in \mathfrak{p}, so f∈pf \in \mathfrak{p} for every prime. Conversely, if ff is not nilpotent then S={1,f,f2,… }S = \{1, f, f^2, \dots\} does not contain 00, so Rf≠0R_f \neq 0 has a maximal ideal n\mathfrak{n} by (2), and its preimage in RR is a prime not containing ff.

∎

Theorem— Proposition 2 (primes of a localisation; local properties)

Let S⊆RS \subseteq R be multiplicative and ι:R→S−1R\iota : R \to S^{-1}R.

  1. q↦ι−1(q)\mathfrak{q} \mapsto \iota^{-1}(\mathfrak{q}) is an inclusion-preserving bijection from the primes of S−1RS^{-1}R to the primes of RR disjoint from SS, with inverse p↦S−1p\mathfrak{p} \mapsto S^{-1}\mathfrak{p}. In particular RpR_\mathfrak{p} is local with maximal ideal pRp\mathfrak{p}R_\mathfrak{p}, and its primes correspond to the primes of RR contained in p\mathfrak{p}.
  2. Localisation is exact: if M′→M→M′′M' \to M \to M'' is exact, so is S−1M′→S−1M→S−1M′′S^{-1}M' \to S^{-1}M \to S^{-1}M''.
  3. For a module MM, M=0M = 0 if and only if Mm=0M_\mathfrak{m} = 0 for every maximal ideal m\mathfrak{m}.

Proof

(1) The preimage of a prime is a prime, and it misses SS because ι(S)\iota(S) consists of units. Conversely, let p\mathfrak{p} be prime with p∩S=∅\mathfrak{p} \cap S = \varnothing. Then S−1p={a/s:a∈p}S^{-1}\mathfrak{p} = \{a/s : a \in \mathfrak{p}\} is a proper ideal: if a/s=1a/s = 1 then t(a−s)=0t(a - s) = 0 for some t∈St \in S, so ts=ta∈pts = ta \in \mathfrak{p}, impossible as ts∈Sts \in S. It is prime: if (a/s)(b/s′)=c/s′′(a/s)(b/s') = c/s'' with c∈pc \in \mathfrak{p} then t(abs′′−css′)=0t(abs'' - css') = 0, so tabs′′∈ptabs'' \in \mathfrak{p} and, since t,s′′∉pt, s'' \notin \mathfrak{p}, a∈pa \in \mathfrak{p} or b∈pb \in \mathfrak{p}. The same computation shows ι−1(S−1p)=p\iota^{-1}(S^{-1}\mathfrak{p}) = \mathfrak{p}, and every ideal JJ of S−1RS^{-1}R satisfies J=S−1ι−1(J)J = S^{-1}\iota^{-1}(J) (if a/s∈Ja/s \in J then a/1∈Ja/1 \in J). For S=R∖pS = R \setminus \mathfrak{p}, the primes of RpR_\mathfrak{p} correspond to primes contained in p\mathfrak{p}, and the largest, pRp\mathfrak{p}R_\mathfrak{p}, is the unique maximal ideal.

(2) If g∘f=0g \circ f = 0 then the localised composite is 00. Let m/s∈S−1Mm/s \in S^{-1}M map to 00: then t g(m)=g(tm)=0t\,g(m) = g(tm) = 0 for some t∈St \in S, so tm=f(m′)tm = f(m'), and m/s=f(m′)/(ts)m/s = f(m')/(ts).

(3) Suppose M≠0M \neq 0 and pick m≠0m \neq 0. Its annihilator {r:rm=0}\{r : rm = 0\} is a proper ideal, contained in some maximal m\mathfrak{m}. Then m/1≠0m/1 \neq 0 in MmM_\mathfrak{m}, because tm=0tm = 0 would put t∈Ann⁡(m)⊆mt \in \operatorname{Ann}(m) \subseteq \mathfrak{m}.

∎

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 RR the following are equivalent: (a) RR is Noetherian; (b) every ideal of RR 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 Σ\Sigma had no maximal element, we could choose I1⊊I2⊊⋯I_1 \subsetneq I_2 \subsetneq \cdots in Σ\Sigma (dependent choice). (c ⇒ b) Among the finitely generated ideals contained in II choose a maximal one, JJ; if a∈I∖Ja \in I \setminus J then J+(a)J + (a) is larger and finitely generated, so J=IJ = I. (b ⇒ a) Given a chain I1⊆I2⊆⋯I_1 \subseteq I_2 \subseteq \cdots, the union II is an ideal, generated by finitely many elements, which all lie in some InI_n; then In=In+1=⋯=II_n = I_{n+1} = \cdots = I. Ideals of R/IR/I are ideals of RR containing II, and ideals of S−1RS^{-1}R are S−1JS^{-1}J by Proposition 2, so (b) passes to both. For modules: RnR^n is Noetherian by induction using 0→Rn−1→Rn→R→00 \to R^{n-1} \to R^n \to R \to 0 (a chain in RnR^n stabilises if its intersections with Rn−1R^{n-1} and its images in RR do), and quotients of Noetherian modules are Noetherian.

∎

Theorem— Theorem 4 (Hilbert's basis theorem)

If RR is Noetherian, then so is R[x]R[x]. Hence R[x1,…,xn]R[x_1, \dots, x_n] — in particular k[x1,…,xn]k[x_1, \dots, x_n] and Z[x1,…,xn]\Z[x_1, \dots, x_n] — and every finitely generated RR-algebra are Noetherian.

Proof

Let I⊆R[x]I \subseteq R[x] be an ideal; we show it is finitely generated. For d≥0d \geq 0 let Ld⊆RL_d \subseteq R be the set of leading coefficients of polynomials in II of degree dd, together with 00. Each LdL_d is an ideal (sums and multiples of leading coefficients of degree-dd elements are leading coefficients of degree-dd elements, or 00), and Ld⊆Ld+1L_d \subseteq L_{d+1} (multiply by xx). Since RR is Noetherian, the chain stabilises at some LNL_N, and each of L0,…,LNL_0, \dots, L_N is finitely generated. For each d≤Nd \leq N and each generator of LdL_d, choose a polynomial in II of degree dd with that leading coefficient; let J⊆IJ \subseteq I be the ideal generated by these finitely many polynomials.

We show by induction on degree that every f∈If \in I lies in JJ. If f=0f = 0 there is nothing to do. Let deg⁡f=d\deg f = d with leading coefficient a∈Lda \in L_d. If d≤Nd \leq N, write a=∑riaia = \sum r_i a_i with aia_i the chosen generators of LdL_d and gi∈Jg_i \in J the chosen polynomials of degree dd; then f−∑rigi∈If - \sum r_i g_i \in I has degree less than dd. If d>Nd > N, then a∈Ld=LNa \in L_d = L_N, so a=∑riaia = \sum r_i a_i with aia_i the generators of LNL_N, and f−∑rixd−Ngi∈If - \sum r_i x^{d - N} g_i \in I has degree less than dd. By induction this difference lies in JJ, so f∈Jf \in J. The statements about several variables follow by induction, since R[x1,…,xn]=R[x1,…,xn−1][xn]R[x_1, \dots, x_n] = R[x_1, \dots, x_{n-1}][x_n], 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 MM be a finitely generated RR-module and II an ideal contained in the Jacobson radical J(R)J(R). If IM=MIM = M then M=0M = 0. In particular, over a local ring (R,m)(R, \mathfrak{m}): if mM=M\mathfrak{m}M = M then M=0M = 0; and elements m1,…,mn∈Mm_1, \dots, m_n \in M generate MM if and only if their images span the R/mR/\mathfrak{m}-vector space M/mMM/\mathfrak{m}M.

Proof

The determinant trick. Let m1,…,mnm_1, \dots, m_n generate MM. Since M=IMM = IM, each mi=∑jaijmjm_i = \sum_j a_{ij} m_j with aij∈Ia_{ij} \in I. So the matrix A=(aij)A = (a_{ij}) satisfies (Id−A) m=0(\mathrm{Id} - A)\,\mathbf{m} = 0, where m=(m1,…,mn)T\mathbf{m} = (m_1, \dots, m_n)^{\mathsf T}. Multiplying by the adjugate of Id−A\mathrm{Id} - A gives det⁡(Id−A) mi=0\det(\mathrm{Id} - A)\, m_i = 0 for every ii. Expanding the determinant, r=det⁡(Id−A)=1+xr = \det(\mathrm{Id} - A) = 1 + x with x∈Ix \in I. So rM=0r M = 0 with r−1∈Ir - 1 \in I.

Conclusion. Since x=r−1∈J(R)x = r - 1 \in J(R), the element r=1+xr = 1 + x is a unit, and M=r−1rM=0M = r^{-1} r M = 0.

Generators over a local ring. If the images of m1,…,mnm_1, \dots, m_n span M/mMM/\mathfrak{m}M, let N=Rm1+⋯+RmnN = Rm_1 + \cdots + Rm_n. Then M=N+mMM = N + \mathfrak{m}M, so the finitely generated module M/NM/N satisfies m(M/N)=M/N\mathfrak{m}(M/N) = M/N, hence M/N=0M/N = 0. The converse is clear.

∎

So over a local ring, all minimal generating sets of a finitely generated module have the same size, dim⁡kM/mM\dim_k M/\mathfrak{m}M — a basis-free substitute for dimension. Finite generation is essential: Q\Q is a Z(p)\Z_{(p)}-module with pQ=Q≠0p\Q = \Q \neq 0.

Theorem— Theorem 6 (Hilbert's Nullstellensatz)

Let kk be an algebraically closed field.

  1. (Weak form) The maximal ideals of k[x1,…,xn]k[x_1, \dots, x_n] are exactly the ideals ma=(x1−a1,…,xn−an)\mathfrak{m}_a = (x_1 - a_1, \dots, x_n - a_n), a∈kna \in k^n. Consequently, if II is a proper ideal then V(I)≠∅V(I) \neq \varnothing.
  2. (Strong form) For every ideal II,   I(V(I))=I\;I(V(I)) = \sqrt{I}.

Hence VV and II are mutually inverse, inclusion-reversing bijections between radical ideals of k[x1,…,xn]k[x_1, \dots, x_n] and algebraic subsets of knk^n; prime ideals correspond to irreducible algebraic sets, and maximal ideals to points.

Proof

We prove it for k=Ck = \C (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 kk-algebra is a finite extension of kk — proved in Atiyah–Macdonald, Chapters 5 and 7, or Eisenbud, Theorem 4.19.

Weak form. Each ma\mathfrak{m}_a is maximal, being the kernel of the surjection f↦f(a)f \mapsto f(a) onto the field C\C. Conversely let m\mathfrak{m} be maximal and K=C[x1,…,xn]/mK = \C[x_1, \dots, x_n]/\mathfrak{m}, a field containing C\C. As a C\C-vector space, KK is spanned by the images of the countably many monomials. Suppose some t∈Kt \in K is not in C\C. If tt were transcendental over C\C, the uncountably many elements 1/(t−c)1/(t - c), c∈Cc \in \C, would be linearly independent: a relation ∑i=1rλi/(t−ci)=0\sum_{i=1}^{r} \lambda_i/(t - c_i) = 0 with distinct cic_i gives, after clearing denominators, ∑iλi∏j≠i(t−cj)=0\sum_i \lambda_i \prod_{j \neq i}(t - c_j) = 0, a polynomial identity in the transcendental tt, and substituting cic_i for tt in that polynomial gives λi=0\lambda_i = 0. This contradicts countable dimension. So tt is algebraic: p(t)=0p(t) = 0 for some non-zero p∈C[T]p \in \C[T], which factors as p=c∏(T−cj)p = c\prod (T - c_j); since KK is a field, t=cjt = c_j for some jj, a contradiction. Hence K=CK = \C, and if ai∈Ca_i \in \C is the image of xix_i, then xi−ai∈mx_i - a_i \in \mathfrak{m} for all ii, so ma⊆m\mathfrak{m}_a \subseteq \mathfrak{m}, and equality holds because ma\mathfrak{m}_a is maximal. Finally, a proper ideal II lies in some maximal ma\mathfrak{m}_a (Proposition 1), and then every element of II vanishes at aa.

Strong form (Rabinowitsch's trick). Clearly I⊆I(V(I))\sqrt{I} \subseteq I(V(I)). Conversely, let ff vanish on V(I)V(I). By Theorem 4, I=(g1,…,gr)I = (g_1, \dots, g_r). In C[x1,…,xn,t]\C[x_1, \dots, x_n, t] consider J=(g1,…,gr,1−tf)J = (g_1, \dots, g_r, 1 - tf). It has no zeros: at a common zero (a,b)(a, b) of the gig_i we have f(a)=0f(a) = 0, so 1−bf(a)=11 - bf(a) = 1. By the weak form JJ is not proper: 1=∑ihi gi+h (1−tf)1 = \sum_i h_i\, g_i + h\,(1 - tf) for some polynomials hi,hh_i, h. Substitute t=1/ft = 1/f in the field C(x1,…,xn)\C(x_1, \dots, x_n) (if f=0f = 0 there is nothing to prove): 1=∑ihi(x,1/f) gi(x)1 = \sum_i h_i(x, 1/f)\, g_i(x). Multiplying by a high power fNf^N clears all denominators and gives fN=∑ih~igi∈If^N = \sum_i \tilde h_i g_i \in I.

The bijection follows: V(I(X))=XV(I(X)) = X for algebraic sets and I(V(I))=II(V(I)) = I for radical ideals. XX is irreducible iff I(X)I(X) is prime, by the usual argument with X⊆V(f)∪V(g)=V(fg)X \subseteq V(f) \cup V(g) = V(fg).

∎

The hypothesis "algebraically closed" is essential: over R\R, the ideal (x2+1)(x^2 + 1) of R[x]\R[x] is maximal (with R[x]/(x2+1)≅C\R[x]/(x^2 + 1) \cong \C) but not of the form ma\mathfrak{m}_a, and V(x2+1)=∅V(x^2 + 1) = \varnothing although 1∉(x2+1)1 \notin (x^2 + 1).

Theorem— Theorem 7 (dimension; stated)

Let kk be a field. Then dim⁡k[x1,…,xn]=n\dim k[x_1, \dots, x_n] = n. More generally, if AA is a finitely generated kk-algebra and a domain, then dim⁡A\dim A equals the transcendence degree of Frac⁡(A)\operatorname{Frac}(A) over kk, and every maximal chain of primes in AA has this length.

Proof sketch. The chain 0⊊(x1)⊊(x1,x2)⊊⋯⊊(x1,…,xn)0 \subsetneq (x_1) \subsetneq (x_1, x_2) \subsetneq \cdots \subsetneq (x_1, \dots, x_n) consists of primes (each quotient is a polynomial ring, a domain), so dim⁡≥n\dim \geq n. For ≤n\leq n one uses Noether normalisation — AA is integral over a polynomial subring k[y1,…,yd]k[y_1, \dots, y_d] with d=trdeg⁡d = \operatorname{trdeg} — and the theorems of lying over, going up and incomparability (Cohen–Seidenberg) for integral extensions, which show that AA and k[y1,…,yd]k[y_1, \dots, y_d] have the same dimension; then induct on dd. See Atiyah–Macdonald, Chapters 5 and 11, or Eisenbud, Chapters 8–13. Mathlib proves dim⁡R[x1,…,xn]=dim⁡R+n\dim R[x_1, \dots, x_n] = \dim R + n for every Noetherian RR (see the formal section).

Theorem— Theorem 8 (primary decomposition; stated)

In a Noetherian ring every ideal is a finite intersection of primary ideals (q\mathfrak{q} is primary if ab∈qab \in \mathfrak{q} and a∉qa \notin \mathfrak{q} imply bm∈qb^m \in \mathfrak{q} for some mm). In a minimal decomposition I=q1∩⋯∩qsI = \mathfrak{q}_1 \cap \cdots \cap \mathfrak{q}_s the primes qi\sqrt{\mathfrak{q}_i} are distinct and uniquely determined by II (Lasker 1905 for polynomial rings, Noether 1921).

For example, in k[x,y]k[x, y], (x2,xy)=(x)∩(x2,y)(x^2, xy) = (x) \cap (x^2, y). The zero set is the line x=0x = 0, but the decomposition also records an embedded primary component at the origin: xx vanishes on the line, x∉(x2,xy)x \notin (x^2, xy), yet x2∈(x2,xy)x^2 \in (x^2, xy), and yy times the nilpotent xx is 00 — the ideal remembers a fuzzy point stuck to the line. The first experiment detects exactly this with Gröbner bases.

Explore

Explore: tangency is a nilpotent

The parabola y=x2y = x^2 meets the horizontal line y=cy = c where x2=cx^2 = c. Algebraically, the intersection is described by the ring

k[x,y]/(y−x2,  y−c)  ≅  k[x]/(x2−c).k[x, y]/(y - x^2,\; y - c) \;\cong\; k[x]/(x^2 - c).

Move the slider. For c>0c > 0 there are two intersection points (±c,c)(\pm\sqrt{c}, c), and k[x]/(x2−c)≅k×kk[x]/(x^2 - c) \cong k \times k (Chinese remainder theorem): two reduced points. As c→0c \to 0 they merge, and at c=0c = 0 the ring becomes k[x]/(x2)k[x]/(x^2), which is not reduced: the class of xx is a non-zero nilpotent, remembering that the two points collided along the xx-direction — the line is tangent. For c<0c < 0 there are no real points, but over C\C there are still two, at x=±i−cx = \pm i\sqrt{-c}: 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.

PQ
  • y = x²
  • y = c
  • y = x²: y = 1
  • y = c: y = 1

The first experiment confirms this: x∉(y−x2,y)x \notin (y - x^2, y) but x2∈(y−x2,y)x^2 \in (y - x^2, y), whereas for the secant y=1y = 1 the ideal is already radical.

Formal mathematicsF

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:

zero_prime_not_maximalLean 4Proved here from basic factsFormally verified
/-- **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)
Axioms used: propext, Classical.choice, Quot.soundformal/Lumenary/CommutativeAlgebra.leanTry it in the Lean web editor
maximal_is_primeLean 4Applies a library theoremFormally verified
/-- **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.isPrime
Axioms used: propext, Classical.choice, Quot.soundformal/Lumenary/CommutativeAlgebra.leanTry it in the Lean web editor

Hilbert'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_basisLean 4Applies a library theoremFormally verified
/-- **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
Axioms used: propext, Classical.choice, Quot.soundformal/Lumenary/CommutativeAlgebra.leanTry it in the Lean web editor
hilbert_basis_mvLean 4Applies a library theoremFormally verified
/-- **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
Axioms used: propext, Classical.choice, Quot.soundformal/Lumenary/CommutativeAlgebra.leanTry it in the Lean web editor
infinitely_many_variables_not_noetherianLean 4Proved here from basic factsFormally verified
/-- **`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 h1
Axioms used: propext, Classical.choice, Quot.soundformal/Lumenary/CommutativeAlgebra.leanTry it in the Lean web editor

Nakayama's lemma, proved here from Mathlib's determinant trick exactly as in the text — the only extra step is that 1+x1 + x is a unit when xx lies in the Jacobson radical (Ideal.mem_jacobson_bot) — and Mathlib's own statement:

nakayamaLean 4Proved here from basic factsFormally verified
/-- **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]
Axioms used: propext, Classical.choice, Quot.soundformal/Lumenary/CommutativeAlgebra.leanTry it in the Lean web editor
nakayama_libraryLean 4Applies a library theoremFormally verified
/-- **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 hjac
Axioms used: propext, Classical.choice, Quot.soundformal/Lumenary/CommutativeAlgebra.leanTry it in the Lean web editor

Localisation at a prime, through the predicate IsLocalization.AtPrime S p ("SS is a localisation of RR at p\mathfrak{p}"), which lets every construction of RpR_\mathfrak{p} be used interchangeably:

localization_primesLean 4Applies a library theoremFormally verified
/-- **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
Axioms used: propext, Classical.choice, Quot.soundformal/Lumenary/CommutativeAlgebra.leanTry it in the Lean web editor
localization_localLean 4Applies a library theoremFormally verified
/-- **`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) :=
  inferInstance
Axioms used: propext, Classical.choice, Quot.soundformal/Lumenary/CommutativeAlgebra.leanTry it in the Lean web editor

The 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_sq_not_radicalLean 4Proved here from basic factsFormally verified
/-- **`(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
Axioms used: propext, Classical.choice, Quot.soundformal/Lumenary/CommutativeAlgebra.leanTry it in the Lean web editor
nullstellensatzLean 4Applies a library theoremFormally verified
/-- **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
Axioms used: propext, Classical.choice, Quot.soundformal/Lumenary/CommutativeAlgebra.leanTry it in the Lean web editor
maximal_ideals_are_pointsLean 4Applies a library theoremFormally verified
/-- **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
Axioms used: propext, Classical.choice, Quot.soundformal/Lumenary/CommutativeAlgebra.leanTry it in the Lean web editor
krull_dim_polynomialLean 4Applies a library theoremFormally verified
/-- **`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]
Axioms used: propext, Classical.choice, Quot.soundformal/Lumenary/CommutativeAlgebra.leanTry it in the Lean web editor

What is and is not formalised. Proved here: (0)⊆Z(0) \subseteq \Z is prime but not maximal; k[x0,x1,… ]k[x_0, x_1, \dots] is not Noetherian; Nakayama's lemma from the determinant trick; (x2)(x^2) is not radical. From Mathlib: maximal ⇒ prime, Hilbert's basis theorem, the determinant trick, the primes of a localisation and locality of RpR_\mathfrak{p}, both forms of the Nullstellensatz (for all algebraically closed fields, via Jacobson rings rather than our countability argument), and dim⁡k[x1,…,xn]=n\dim k[x_1, \dots, x_n] = n. Not formalised here: Proposition 2(3) and the local–global principle, the countability proof of the Nullstellensatz for C\C, 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).

ComputationC

Radicals and spectra, computed

The first experiment decides ideal membership in Q[x,y]\Q[x, y] with Gröbner bases, finds the least mm with fm∈If^m \in I in several tangency examples (parabola and tangent line, circle and tangent line, the cusp y2=x3y^2 = x^3 and its tangent), and checks the answer against Rabinowitsch's single test 1∈(I,1−tf)1 \in (I, 1 - tf) from the proof of Theorem 6.

Radicals and the Nullstellensatz by Groebner basesPythonSymbolic computationExact computationComputationally tested
"""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()
Runs entirely in your browser, in an isolated worker. Nothing is sent to a server.

The second experiment works in the finite rings Z/n\Z/n for n≤60n \leq 60, where everything can be checked by listing elements: primes coincide with maximal ideals (finite domains are fields, so dim⁡Z/n=0\dim \Z/n = 0), the nilradical equals the Jacobson radical, Z/n\Z/n is local exactly when nn is a prime power, localisation at (p)(p) — computed from the definition of S−1RS^{-1}R — gives Z/pe\Z/p^e, and Nakayama's lemma holds for every ideal of every local Z/pe\Z/p^e.

Spec, localisation and Nakayama in the rings Z/nPythonExact computationExhaustive finite checkComputationally tested
"""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()
Runs entirely in your browser, in an isolated worker. Nothing is sent to a server.
Exercises

Exercises

1. Commutative algebra

Warm-upHuman

Which of these ideals are prime? (Choose all that apply.)

Choose all that apply

2. Commutative algebra

Warm-upHuman

What is the Krull dimension of Z[x]\mathbb{Z}[x]?

3. Commutative algebra

CoreHuman

How many elements does the localisation (Z/360)(3)(\mathbb{Z}/360)_{(3)} have? (Here (3)(3) is the prime ideal of Z/360\mathbb{Z}/360 generated by 33.)

4. Commutative algebra

CoreHuman

In the proof of Hilbert's basis theorem, Ld⊆RL_d \subseteq R is the ideal of leading coefficients of degree-dd elements of I⊆R[x]I \subseteq R[x]. Why is there an NN with LN=LN+1=LN+2=⋯L_N = L_{N+1} = L_{N+2} = \cdots?

Choose one

5. Commutative algebra

CoreHuman

Let R=Z(p)R = \mathbb{Z}_{(p)}, m=pZ(p)\mathfrak{m} = p\mathbb{Z}_{(p)} and M=QM = \mathbb{Q}. Then mM=M\mathfrak{m}M = M but M≠0M \neq 0. Which hypothesis of Nakayama's lemma fails?

Choose one

6. Commutative algebra

StretchHuman

Let I=(x2+y2−1,  x−1)⊆C[x,y]I = (x^2 + y^2 - 1,\; x - 1) \subseteq \mathbb{C}[x, y]: the unit circle and its tangent line at (1,0)(1, 0). Which of these polynomials lie in II itself? (Choose all that apply.)

Choose all that apply

7. Commutative algebra

CoreFormal

Which Lean statement formalises “the polynomial ring in infinitely many variables over a field kk is not Noetherian”?

Choose one

8. Commutative algebra

StretchComputational

The ideals of Z/n\mathbb{Z}/n are dZ/nZd\mathbb{Z}/n\mathbb{Z} for the divisors dd of nn. Write prime_ideals(n) (for n≥2n \ge 2) returning the sorted list of divisors dd of nn for which the ideal generated by dd in Z/n\mathbb{Z}/n is prime, checking the definition directly: proper, and ab∈I⇒a∈Iab \in I \Rightarrow a \in I or b∈Ib \in I for all residues a,ba, b.

Runs entirely in your browser, in an isolated worker. Nothing is sent to a server.
Common misconceptionsH

Common misconceptions

Misconception

"Every ring is Noetherian." The rings met first — fields, Z\Z, k[x1,…,xn]k[x_1, \dots, x_n], their quotients and localisations — are Noetherian, but k[x1,x2,x3,… ]k[x_1, x_2, x_3, \dots] is not (the chain (x1)⊊(x1,x2)⊊⋯(x_1) \subsetneq (x_1, x_2) \subsetneq \cdots never stops), and neither are C([0,1])C([0, 1]) or the ring of all algebraic integers. A subring of a Noetherian ring need not be Noetherian: k[x1,x2,… ]⊆k(x1,x2,… )k[x_1, x_2, \dots] \subseteq k(x_1, x_2, \dots).

Misconception

"Prime and maximal ideals are the same thing." Every maximal ideal is prime, but not conversely: (0)⊆Z(0) \subseteq \Z and (x)⊆k[x,y](x) \subseteq k[x, y] 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 00, such as finite rings and Z/n\Z/n.

Misconception

"An ideal is determined by its zero set." Only its radical is: (x)(x) and (x2)(x^2) in k[x]k[x] have the same zero set {0}\{0\}. The Nullstellensatz gives I(V(I))=II(V(I)) = \sqrt{I}, not II, and the difference — nilpotents in R/IR/I — carries real information, such as tangency and multiplicity.

Misconception

"The Nullstellensatz holds over any field" and "Nakayama holds for any module." Over R\R, (x2+1)(x^2 + 1) is a proper ideal with no real zeros, so the weak form fails; algebraic closure is essential. Nakayama needs finite generation: Q\Q is a module over the local ring Z(p)\Z_{(p)} with pQ=Qp\Q = \Q, yet Q≠0\Q \neq 0.

ViewpointsH

Viewpoints

Geometry— The algebra–geometry dictionary

The Nullstellensatz turns geometry into algebra: algebraic sets in Cn\C^n correspond to radical ideals, irreducible ones to primes, points to maximal ideals, and polynomial maps X→YX \to Y between algebraic sets to C\C-algebra homomorphisms C[Y]→C[X]\C[Y] \to \C[X] of coordinate rings, reversing arrows. Local geometry is local algebra: the local ring OX,a=C[X]ma\mathcal{O}_{X,a} = \C[X]_{\mathfrak{m}_a} consists of rational functions defined near aa, and the Zariski cotangent space m/m2\mathfrak{m}/\mathfrak{m}^2 (with m\mathfrak{m} the maximal ideal of OX,a\mathcal{O}_{X,a}) has dimension equal to dim⁡X\dim X exactly at smooth points. For the nodal cubic y2=x2(x+1)y^2 = x^2(x + 1) at the origin, m/m2\mathfrak{m}/\mathfrak{m}^2 is 22-dimensional on a 11-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

Spec⁡R\operatorname{Spec} R with the Zariski topology is always quasi-compact (if ⋂V(Iα)=∅\bigcap V(I_\alpha) = \varnothing then ∑Iα=R\sum I_\alpha = R, so 11 is a finite sum and finitely many V(Iα)V(I_\alpha) already have empty intersection), but rarely Hausdorff: the closure of the generic point (0)(0) of Spec⁡Z\operatorname{Spec} \Z is everything. Its topology is coarse but meaningful. Irreducible components of Spec⁡R\operatorname{Spec} R correspond to minimal primes; connected components to idempotents — Spec⁡R\operatorname{Spec} R is disconnected exactly when R≅R1×R2R \cong R_1 \times R_2 non-trivially, as for Z/6≅Z/2×Z/3\Z/6 \cong \Z/2 \times \Z/3, 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 D(f)=Spec⁡R∖V(f)≅Spec⁡RfD(f) = \operatorname{Spec} R \setminus V(f) \cong \operatorname{Spec} R_f form a basis, so localisation literally is restriction to an open subset (see point-set topology).

Number theory— Spec ℤ as an arithmetic curve

Z\Z and the ring of integers OK\mathcal{O}_K of a number field are Noetherian, integrally closed domains of dimension 11 — 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 Z⊆Z[i]\Z \subseteq \Z[i] is integral, and lying over is the statement that every prime pp has primes of Z[i]\Z[i] above it: (2)=(1+i)2(2) = (1 + i)^2 ramifies, (5)=(2+i)(2−i)(5) = (2 + i)(2 - i) splits, (3)(3) stays prime. Localising at pp — and then completing to the pp-adic integers Zp\Z_p — studies a number "near the prime pp", 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 II for a monomial order makes division with remainder unique, so f∈If \in I iff the remainder of ff is 00. With it one can decide membership, compute I\sqrt I-membership by Rabinowitsch's trick, eliminate variables (the elimination theorem: a lex Gröbner basis of II contains one of I∩k[xj,…,xn]I \cap k[x_{j}, \dots, x_n]), 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 Trails

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 Q\Q; inverting only the powers of 22 gives Z[1/2]\Z[1/2]; inverting a nilpotent destroys the ring.

Wonder Trail · Optional · never gradedInverses and structureEvery integer can be added to another integer to get 00. So why can almost no integer be multiplied by another integer to get 11?Follow the trail
History & global context

History 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 Spec⁡R\operatorname{Spec} R 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

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.