Skip to content
The Lumenary
Advanced undergraduateUndergraduate 120 min

Rings, ideals and fields

Where addition and multiplication live together. Integers and polynomials share a division algorithm and unique factorisation, 6=2⋅3=(1+−5)(1−−5)6 = 2 \cdot 3 = (1+\sqrt{-5})(1-\sqrt{-5}) shows that unique factorisation can fail, and ideals were invented to repair it.

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

When factorisation stops being unique

Every whole number greater than 11 factors into primes in essentially one way. Polynomials over a field behave the same way: x4−1=(x−1)(x+1)(x2+1)x^4 - 1 = (x - 1)(x + 1)(x^2 + 1) over Q\Q, and there is no other factorisation into irreducibles. The reason is the same in both cases: division with remainder, which gives Euclid's algorithm, then Bézout's identity, then Euclid's lemma (p∣ab⇒p∣ap \mid ab \Rightarrow p \mid a or p∣bp \mid b), and finally uniqueness.

Mathematicians soon found they wanted to factor other kinds of numbers. In his Algebra (1770), Leonhard Euler solved y3=x2+2y^3 = x^2 + 2 in integers by factoring x2+2=(x+−2)(x−−2)x^2 + 2 = (x + \sqrt{-2})(x - \sqrt{-2}) and arguing as if unique factorisation held for numbers a+b−2a + b\sqrt{-2}. (It does, but Euler did not prove it.) In 1847 Gabriel Lamé announced a proof of Fermat's Last Theorem that factored xp+ypx^p + y^p over the complex pp-th roots of unity, and it rested on the same unproved assumption. Joseph Liouville pointed out the gap at once. Ernst Kummer had already discovered that unique factorisation fails for some of these number systems. The simplest failure is in the numbers a+b−5a + b\sqrt{-5}, a,b∈Za, b \in \Z:

6=2⋅3=(1+−5)(1−−5),6 = 2 \cdot 3 = (1 + \sqrt{-5})(1 - \sqrt{-5}),

where none of the four factors can be broken down further, and 22 is not a unit multiple of either 1±−51 \pm \sqrt{-5}.

Kummer's response was to invent "ideal numbers" that restore uniqueness, and Richard Dedekind turned them into the ideals of this lesson. We define rings and their ideals, find their units and zero divisors, and prove the chain

Euclidean domain  ⟹  principal ideal domain  ⟹  unique factorisation domain,\text{Euclidean domain} \;\Longrightarrow\; \text{principal ideal domain} \;\Longrightarrow\; \text{unique factorisation domain},

with examples showing that neither arrow reverses and that Z[−5]\Z[\sqrt{-5}] is not even a UFD.

IntuitionH

Two operations, and the multiples of a number

A group has one operation (see groups). Numbers, polynomials, matrices and functions have two, addition and multiplication, linked by the distributive law. A ring is the structure they share.

The ring axioms say nothing about division, and the interesting questions are about it. Which elements can be inverted? Can a product of non-zero elements be zero? Is there a division algorithm? Does factorisation into "atoms" exist, and is it unique?

The key new notion is the set of all multiples of an element. In Z\Z the multiples of 66 form 6Z6\Z. This set is closed under addition, and it absorbs multiplication: any integer times a multiple of 66 is again a multiple of 66. Divisibility is containment: 2∣62 \mid 6 exactly when 6Z⊆2Z6\Z \subseteq 2\Z. A gcd is a generator of a sum: 4Z+6Z=2Z4\Z + 6\Z = 2\Z. Sets of this kind are called ideals. In Z[−5]\Z[\sqrt{-5}] the set (2,1+−5)(2, 1 + \sqrt{-5}) of all combinations 2α+(1+−5)β2\alpha + (1 + \sqrt{-5})\beta is an ideal, but it consists of the multiples of no single element: it behaves like a "gcd of 22 and 1+−51 + \sqrt{-5}" that does not exist as a number. Kummer's ideal numbers were exactly such missing gcds.

DefinitionsH

Rings, ideals and the factorisation hierarchy

Convention. In this lesson (and the following ones) a ring has a multiplicative identity 11, and ring homomorphisms preserve it. Some books (for example in analysis) allow rings without 11; then 2Z2\Z is a ring. Commutativity is not assumed unless stated. Integral domains and fields are commutative and have 0≠10 \ne 1.

Definition— ring

A ring is a set RR with two operations ++ and ⋅\cdot such that (R,+)(R, +) is an abelian group with identity 00, multiplication is associative with identity 11, and the distributive laws a(b+c)=ab+aca(b + c) = ab + ac and (a+b)c=ac+bc(a + b)c = ac + bc hold. RR is commutative if ab=baab = ba for all a,ba, b. A subring is a subset containing 11 and closed under ++, −- and ⋅\cdot.

Definition— units, zero divisors, domains and fields

A unit is an element uu with some vv such that uv=vu=1uv = vu = 1; the units form a group R×R^\times. A zero divisor is a non-zero aa with ab=0ab = 0 or ba=0ba = 0 for some non-zero bb. An integral domain is a commutative ring with 0≠10 \ne 1 and no zero divisors. A field is a commutative ring with 0≠10 \ne 1 in which every non-zero element is a unit. (A division ring drops commutativity.)

Definition— ring homomorphism, kernel

A ring homomorphism f:R→Sf : R \to S satisfies f(a+b)=f(a)+f(b)f(a + b) = f(a) + f(b), f(ab)=f(a)f(b)f(ab) = f(a)f(b) and f(1)=1f(1) = 1. Its kernel is ker⁡f={a∣f(a)=0}\ker f = \{a \mid f(a) = 0\}.

Definition— ideal

A left ideal of RR is an additive subgroup II with ra∈Ira \in I for all r∈Rr \in R, a∈Ia \in I; a two-sided ideal also has ar∈Iar \in I. In a commutative ring the notions coincide and we just say ideal. The ideal generated by a1,…,ana_1, \dots, a_n in a commutative ring is (a1,…,an)={r1a1+⋯+rnan}(a_1, \dots, a_n) = \{r_1a_1 + \dots + r_na_n\}. An ideal is principal if it equals (a)(a) for one element aa.

Definition— prime and maximal ideals

In a commutative ring RR, an ideal P≠RP \ne R is prime if ab∈Pab \in P implies a∈Pa \in P or b∈Pb \in P, and an ideal M≠RM \ne R is maximal if there is no ideal strictly between MM and RR. (In quotients we prove that R/PR/P is a domain and R/MR/M a field exactly in these cases.)

Definition— divisibility, irreducible and prime elements

Let RR be an integral domain. Then a∣ba \mid b if b=acb = ac for some cc; aa and bb are associates if b=uab = ua for a unit uu. A non-zero non-unit pp is irreducible if p=abp = ab forces aa or bb to be a unit, and prime if p∣abp \mid ab forces p∣ap \mid a or p∣bp \mid b.

Definition— Euclidean domain, PID, UFD

An integral domain RR is

  • a Euclidean domain if there is a function δ:R∖{0}→N\delta : R \setminus \{0\} \to \N such that for all aa and all b≠0b \ne 0 there are q,rq, r with a=qb+ra = qb + r and either r=0r = 0 or δ(r)<δ(b)\delta(r) \lt \delta(b);
  • a principal ideal domain (PID) if every ideal is principal;
  • a unique factorisation domain (UFD) if every non-zero non-unit is a product of irreducibles, uniquely up to the order of the factors and replacing factors by associates.
commutative ringsℤ/6ℤ, ℤ × ℤintegral domainsℤ[√−5]UFDsℤ[x], k[x, y]PIDsℤ[(1+√−19)/2]Euclidean domainsℤ, k[x], ℤ[i]fieldsℚ, ℝ, ℂ, 𝔽ₚ = ℤ/pℤ
The hierarchy proved in this lesson, with an example in each layer that is not in the next one inside. Fields are Euclidean (with δ constant). ℤ[(1+√−19)/2] is a PID that is not Euclidean, ℤ[x] and k[x, y] are UFDs that are not PIDs, ℤ[√−5] is a domain that is not a UFD, and ℤ/6ℤ is not a domain.
Worked examplesH

A gallery of rings

Example— Numbers

Z⊂Q⊂R⊂C\Z \subset \Q \subset \R \subset \C are commutative rings. Q\Q, R\R, C\C are fields; Z\Z is a domain whose only units are ±1\pm 1. The Gaussian integers Z[i]={a+bi∣a,b∈Z}\Z[i] = \{a + bi \mid a, b \in \Z\} and Z[−5]={a+b−5}\Z[\sqrt{-5}] = \{a + b\sqrt{-5}\} are subrings of C\C, hence domains. Each has a multiplicative norm N(a+bd)=(a+bd)(a−bd)=a2−db2N(a + b\sqrt{d}) = (a + b\sqrt d)(a - b\sqrt d) = a^2 - db^2: so N(a+bi)=a2+b2N(a + bi) = a^2 + b^2 and N(a+b−5)=a2+5b2N(a + b\sqrt{-5}) = a^2 + 5b^2. If uv=1uv = 1 then N(u)N(v)=1N(u)N(v) = 1, so units have norm 11. The units of Z[i]\Z[i] are therefore ±1,±i\pm 1, \pm i, and those of Z[−5]\Z[\sqrt{-5}] are ±1\pm 1.

Example— Remainders

In Z/nZ\Z/n\Z, a residue aa is a unit iff gcd⁡(a,n)=1\gcd(a, n) = 1. Otherwise, if a≠0a \ne 0, it is a zero divisor: with d=gcd⁡(a,n)>1d = \gcd(a, n) \gt 1, we have a⋅nd=ad n≡0a \cdot \frac{n}{d} = \frac{a}{d}\, n \equiv 0. In Z/12Z\Z/12\Z the units are 1,5,7,111, 5, 7, 11, and the other seven non-zero residues are zero divisors. Some elements are nilpotent (62=36≡06^2 = 36 \equiv 0 in Z/12Z\Z/12\Z) and some are idempotent (42=16≡44^2 = 16 \equiv 4). So Z/nZ\Z/n\Z is a domain iff it is a field iff nn is prime. The field Z/pZ\Z/p\Z is also written Fp\mathbb{F}_p.

Example— Polynomials

For a commutative ring RR, R[x]R[x] is the ring of polynomials with coefficients in RR. If RR is a domain, then deg⁡(fg)=deg⁡f+deg⁡g\deg(fg) = \deg f + \deg g for non-zero f,gf, g, because the leading coefficients multiply. So R[x]R[x] is a domain and its units are the units of RR (constants). For a field kk, k[x]k[x] behaves remarkably like Z\Z: there is long division, and its irreducible elements play the role of primes (see polynomials). Over a non-domain strange things happen: in (Z/4Z)[x](\Z/4\Z)[x], (1+2x)2=1+4x+4x2=1(1 + 2x)^2 = 1 + 4x + 4x^2 = 1, so the non-constant polynomial 1+2x1 + 2x is a unit.

Example— Non-commutative rings

The matrix ring Mn(k)M_n(k) (n≥2n \ge 2) is not commutative and has zero divisors and nilpotents: (0100)2=0\left(\begin{smallmatrix} 0 & 1 \\ 0 & 0 \end{smallmatrix}\right)^2 = 0. Its two-sided ideals are only 00 and Mn(k)M_n(k), although it has many left ideals. The quaternions H={a+bi+cj+dk}\mathbb{H} = \{a + bi + cj + dk\} with i2=j2=k2=ijk=−1i^2 = j^2 = k^2 = ijk = -1 form a division ring that is not a field, since ij=k=−jiij = k = -ji.

Example— Products and functions

Z×Z\Z \times \Z with componentwise operations is a commutative ring with zero divisors: (1,0)(0,1)=(0,0)(1, 0)(0, 1) = (0, 0). The continuous functions C([0,1])C([0, 1]) form a commutative ring. It has zero divisors (two non-zero functions with disjoint supports multiply to 00), and for each c∈[0,1]c \in [0, 1] the functions vanishing at cc form a maximal ideal.

Example— Ideals, subrings and generators

  • The ideals of Z\Z are the nZ=(n)n\Z = (n). Every ideal of Z\Z is an additive subgroup, and these are the nZn\Z (see groups, Theorem 1). Similarly the ideals of Z/nZ\Z/n\Z are the (d)(d) for divisors dd of nn.
  • Z\Z is a subring of Q\Q but not an ideal: 12⋅1∉Z\frac12 \cdot 1 \notin \Z. In the other direction, 2Z2\Z is an ideal of Z\Z but not a subring (it does not contain 11). A proper ideal never contains a unit.
  • In Z[x]\Z[x]: (x)(x), the polynomials with constant term 00, is a prime ideal but not maximal, since (x)⊊(2,x)⊊Z[x](x) \subsetneq (2, x) \subsetneq \Z[x]. The ideal (2,x)(2, x), the polynomials with even constant term, is maximal and not principal (Theorem 12).
  • In Z\Z, (p)(p) is maximal for pp prime, and (0)(0) is prime but not maximal. In C[x,y]\C[x, y], (x)(x) is prime and (x,y)(x, y) is maximal.
ProofH

Units, zero divisors and ideals

Theorem— Proposition 1 (first consequences of the axioms)

In every ring: (a) 0⋅a=a⋅0=00 \cdot a = a \cdot 0 = 0 and (−a)b=−(ab)(-a)b = -(ab); (b) if 0=10 = 1 then R={0}R = \{0\}; (c) R×R^\times is a group under multiplication; (d) a unit is not a zero divisor.

Proof

(a) 0a=(0+0)a=0a+0a0a = (0 + 0)a = 0a + 0a; subtract 0a0a. Then ab+(−a)b=(a+(−a))b=0b=0ab + (-a)b = (a + (-a))b = 0b = 0. (b) a=a⋅1=a⋅0=0a = a \cdot 1 = a \cdot 0 = 0. (c) 11 is a unit, (uv)(v−1u−1)=1=(v−1u−1)(uv)(uv)(v^{-1}u^{-1}) = 1 = (v^{-1}u^{-1})(uv), and u−1u^{-1} is a unit with inverse uu. (d) If uu is a unit and ua=0ua = 0, then a=u−1(ua)=u−1⋅0=0a = u^{-1}(ua) = u^{-1} \cdot 0 = 0; similarly if au=0au = 0.

∎

Theorem— Theorem 2 (finite domains are fields)

Every finite integral domain is a field.

Proof

Let a≠0a \ne 0 in the finite domain RR. The map ma:R→Rm_a : R \to R, x↦axx \mapsto ax, is injective: ax=ayax = ay gives a(x−y)=0a(x - y) = 0, so x=yx = y, since there are no zero divisors. An injective map from a finite set to itself is surjective, so ab=1ab = 1 for some bb.

∎

The same argument shows that in a finite commutative ring every non-zero element is either a unit or a zero divisor: if mam_a is not injective, then a(x−y)=0a(x - y) = 0 with x≠yx \ne y. (Wedderburn's little theorem, 1905, says more: a finite division ring is commutative, hence a field.) The first experiment checks the unit/zero-divisor dichotomy in every Z/nZ\Z/n\Z with n≤60n \le 60.

Theorem— Proposition 3 (kernels, units in ideals, fields)

Let RR and SS be rings.

  1. If f:R→Sf : R \to S is a ring homomorphism, then ker⁡f\ker f is a two-sided ideal of RR and f(R)f(R) is a subring of SS.
  2. An ideal containing a unit is all of RR.
  3. A commutative ring RR with 0≠10 \ne 1 is a field iff its only ideals are (0)(0) and RR.
  4. Every ring homomorphism from a field to a non-zero ring is injective.

Proof

(1) ker⁡f\ker f is an additive subgroup. If f(a)=0f(a) = 0 then f(ra)=f(r)⋅0=0f(ra) = f(r) \cdot 0 = 0 and f(ar)=0f(ar) = 0. The image contains f(1)=1f(1) = 1 and is closed under the operations. (2) If u∈Iu \in I is a unit, then 1=u−1u∈I1 = u^{-1}u \in I and r=r⋅1∈Ir = r \cdot 1 \in I for all rr. (3) If RR is a field and I≠0I \ne 0, then II contains a non-zero element, which is a unit, so I=RI = R by (2). Conversely, if the only ideals are 00 and RR and a≠0a \ne 0, then (a)=R∋1(a) = R \ni 1, so aa is a unit. (4) ker⁡f\ker f is an ideal of the field and does not contain 11, since f(1)=1≠0f(1) = 1 \ne 0. So ker⁡f=0\ker f = 0 by (3).

∎

Conversely, every two-sided ideal is the kernel of some homomorphism, namely the quotient map R→R/IR \to R/I. That construction belongs to quotient rings. Together they give the key result: the kernels of ring homomorphisms are exactly the two-sided ideals, just as the kernels of group homomorphisms are exactly the normal subgroups.

Theorem— Proposition 4 (divisibility is containment)

In an integral domain RR: (a) a∣b  ⟺  (b)⊆(a)a \mid b \iff (b) \subseteq (a); (b) (a)=(b)  ⟺  a,b(a) = (b) \iff a, b are associates; (c) (u)=R  ⟺  u(u) = R \iff u is a unit; (d) a non-zero pp is prime iff (p)(p) is a prime ideal.

Proof

(a) b=ac  ⟺  b∈(a)  ⟺  (b)⊆(a)b = ac \iff b \in (a) \iff (b) \subseteq (a). (b) If (a)=(b)(a) = (b) with a≠0a \ne 0, write b=acb = ac and a=bda = bd. Then a=acda = acd, so a(1−cd)=0a(1 - cd) = 0, and cd=1cd = 1 since RR is a domain: cc is a unit. (If a=0a = 0 then b=0b = 0.) The converse is clear. (c) is the case b=1b = 1 of (b). (d) This is a restatement: p∣x  ⟺  x∈(p)p \mid x \iff x \in (p), and (p)≠R(p) \ne R iff pp is not a unit.

∎

Theorem— Proposition 5 (prime implies irreducible)

In an integral domain every prime element is irreducible.

Proof

Let pp be prime and p=abp = ab. Then p∣abp \mid ab, so (say) p∣ap \mid a: a=pca = pc. Then p=pcbp = pcb, so p(1−cb)=0p(1 - cb) = 0, and cb=1cb = 1 because p≠0p \ne 0. Hence bb is a unit.

∎

The converse fails in general, and it is exactly what fails in Z[−5]\Z[\sqrt{-5}] (Theorem 11). In a UFD the converse holds. If pp is irreducible and p∣abp \mid ab, factor aa, bb and ab/pab/p into irreducibles. By uniqueness, pp is associate to an irreducible factor of aa or of bb.

ProofH

Euclidean domain ⇒ PID ⇒ UFD

Theorem— Theorem 6 (three Euclidean domains)

Z\Z with δ(a)=∣a∣\delta(a) = |a|, k[x]k[x] for a field kk with δ(f)=deg⁡f\delta(f) = \deg f, and Z[i]\Z[i] with δ=N\delta = N are Euclidean domains.

Proof

For Z\Z this is the division algorithm, and for k[x]k[x] it is polynomial long division: if deg⁡a≥deg⁡b\deg a \ge \deg b, subtract lead(a)lead(b)xdeg⁡a−deg⁡b b\frac{\text{lead}(a)}{\text{lead}(b)}x^{\deg a - \deg b}\,b to lower the degree of aa, and repeat. This uses that the leading coefficient of bb is invertible, which is why kk must be a field.

For Z[i]\Z[i], let a,b∈Z[i]a, b \in \Z[i] with b≠0b \ne 0, and compute the exact quotient a/b=s+ti∈Q(i)a/b = s + ti \in \Q(i). Choose integers m,nm, n with ∣s−m∣≤12|s - m| \le \frac12 and ∣t−n∣≤12|t - n| \le \frac12, and set q=m+niq = m + ni, r=a−qbr = a - qb. Then r∈Z[i]r \in \Z[i] and, with NN extended to Q(i)\Q(i) (still multiplicative),

N(r)=N(b) N ⁣(ab−q)=N(b)((s−m)2+(t−n)2)≤N(b)(14+14)<N(b).N(r) = N(b)\, N\!\left(\tfrac{a}{b} - q\right) = N(b)\big((s - m)^2 + (t - n)^2\big) \le N(b)\left(\tfrac14 + \tfrac14\right) \lt N(b).

∎

a/bq
Euclidean division in ℤ[i]: the exact quotient a/b (gold) lies in some unit square of the lattice ℤ[i], within distance √2/2 of a corner q. The remainder r = a − qb then has N(r) ≤ N(b)/2. For ℤ[√−5] the lattice is stretched vertically by √5 and the same argument fails: the centre of a box is too far from every corner.

Theorem— Theorem 7 (Euclidean domains are PIDs)

Every ideal of a Euclidean domain is principal.

Proof

Let II be an ideal. If I=0I = 0 then I=(0)I = (0). Otherwise choose b∈I∖{0}b \in I \setminus \{0\} with δ(b)\delta(b) least, by well-ordering of N\N. For a∈Ia \in I write a=qb+ra = qb + r with r=0r = 0 or δ(r)<δ(b)\delta(r) \lt \delta(b). Then r=a−qb∈Ir = a - qb \in I, so minimality forces r=0r = 0. Hence a∈(b)a \in (b), and I=(b)I = (b).

∎

Theorem— Theorem 8 (arithmetic in a PID)

Let RR be a PID. (a) Any a,ba, b have a gcd dd, with (a,b)=(d)(a, b) = (d), and d=ra+sbd = ra + sb for some r,sr, s (Bézout). (b) Every irreducible element is prime (Euclid's lemma). (c) Every non-zero prime ideal is maximal.

Proof

(a) (a,b)(a, b) is principal, say (d)(d). Since a,b∈(d)a, b \in (d), dd is a common divisor. Since d∈(a,b)d \in (a, b), d=ra+sbd = ra + sb, so every common divisor of aa and bb divides dd.

(b) Let pp be irreducible, p∣abp \mid ab and p∤ap \nmid a. Write (p,a)=(d)(p, a) = (d). Then p=dxp = dx, so dd or xx is a unit. If xx were a unit, (d)=(p)(d) = (p) would contain aa, giving p∣ap \mid a. So dd is a unit, (p,a)=R(p, a) = R, and 1=rp+sa1 = rp + sa. Multiplying by bb gives b=rpb+s(ab)b = rpb + s(ab), a sum of two multiples of pp, so p∣bp \mid b.

(c) Let (p)≠0(p) \ne 0 be prime, and (p)⊆(m)≠R(p) \subseteq (m) \ne R. By Proposition 4(d) and Proposition 5, pp is irreducible. From p=mxp = mx with mm not a unit, xx is a unit, so (m)=(p)(m) = (p).

∎

Theorem— Theorem 9 (PIDs are UFDs)

Every principal ideal domain is a unique factorisation domain.

Proof

Chains stabilise. Let I1⊆I2⊆⋯I_1 \subseteq I_2 \subseteq \cdots be ideals. Their union II is an ideal (any two elements lie in a common InI_n), so I=(d)I = (d). Then d∈Ind \in I_n for some nn, and I⊆In⊆Im⊆II \subseteq I_n \subseteq I_m \subseteq I for all m≥nm \ge n.

Existence. Suppose a non-zero non-unit aa is not a product of irreducibles. Then aa is not irreducible, so a=a1b1a = a_1b_1 with neither factor a unit. If both a1a_1 and b1b_1 were products of irreducibles, so would aa be; say a1a_1 is not. Moreover (a)⊊(a1)(a) \subsetneq (a_1): equality would make b1b_1 a unit, by Proposition 4(b). Repeating with a1a_1 gives a strictly increasing chain (a)⊊(a1)⊊(a2)⊊⋯(a) \subsetneq (a_1) \subsetneq (a_2) \subsetneq \cdots, which contradicts the first step.

Uniqueness. Suppose p1⋯pm=u q1⋯qnp_1 \cdots p_m = u\,q_1 \cdots q_n with all pi,qjp_i, q_j irreducible and uu a unit. We use induction on mm. If m=0m = 0, the right side is a unit, so it has no irreducible factors and n=0n = 0. If m≥1m \ge 1: p1p_1 is prime by Theorem 8(b), so it divides some qjq_j. Since qjq_j is irreducible and p1p_1 is not a unit, qj=vp1q_j = vp_1 with vv a unit. Cancel p1p_1 (we are in a domain) and apply the induction hypothesis to p2⋯pm=(uv) q1⋯qj^⋯qnp_2 \cdots p_m = (uv)\,q_1 \cdots \widehat{q_j} \cdots q_n.

∎

So Z\Z, k[x]k[x] and Z[i]\Z[i] have unique factorisation. In Z[i]\Z[i] the prime 5=(2+i)(2−i)5 = (2 + i)(2 - i) splits, while 33 stays prime. Which primes split is the question behind Fermat's theorem on sums of two squares, treated in number theory.

ProofH

Where the hierarchy breaks

Theorem— Theorem 10 (the norm on ℤ[√−5])

In Z[−5]\Z[\sqrt{-5}], N(x+y−5)=x2+5y2N(x + y\sqrt{-5}) = x^2 + 5y^2 is multiplicative, N(z)=0N(z) = 0 only for z=0z = 0, the units are ±1\pm 1, and no element has norm 22 or 33.

Proof

N(z)=zzˉN(z) = z\bar z, and complex conjugation is multiplicative, so N(zw)=N(z)N(w)N(zw) = N(z)N(w). A sum x2+5y2x^2 + 5y^2 of non-negative terms is 00 only if x=y=0x = y = 0, and it is 11 only if y=0y = 0 and x=±1x = \pm 1. If x2+5y2∈{2,3}x^2 + 5y^2 \in \{2, 3\}, then y=0y = 0 (else the sum is at least 55), and x2∈{2,3}x^2 \in \{2, 3\} is impossible.

∎

Theorem— Theorem 11 (ℤ[√−5] is not a UFD, and not a PID)

In Z[−5]\Z[\sqrt{-5}]: (a) 22, 33, 1+−51 + \sqrt{-5} and 1−−51 - \sqrt{-5} are irreducible, and 22 is associate to neither 1±−51 \pm \sqrt{-5}, so 6=2⋅3=(1+−5)(1−−5)6 = 2 \cdot 3 = (1 + \sqrt{-5})(1 - \sqrt{-5}) are two genuinely different factorisations; (b) 22 is irreducible but not prime; (c) the ideal (2,1+−5)(2, 1 + \sqrt{-5}) is not principal.

Proof

(a) The norms are 4,9,6,64, 9, 6, 6. A factorisation z=abz = ab into non-units would need N(a)N(a) to be a proper divisor of N(z)N(z) greater than 11, that is 22 or 33, which is impossible by Theorem 10. The units are ±1\pm 1, and ±2≠1±−5\pm 2 \ne 1 \pm \sqrt{-5}.

(b) 2∣6=(1+−5)(1−−5)2 \mid 6 = (1 + \sqrt{-5})(1 - \sqrt{-5}). But 2∣x+y−52 \mid x + y\sqrt{-5} requires x,yx, y even, so 22 divides neither factor.

(c) Let J={x+y−5∣x≡y(mod2)}J = \{x + y\sqrt{-5} \mid x \equiv y \pmod 2\}. It is closed under addition, and under multiplication by −5\sqrt{-5}, since −5(x+y−5)=−5y+x−5\sqrt{-5}(x + y\sqrt{-5}) = -5y + x\sqrt{-5} and −5y≡y≡x-5y \equiv y \equiv x. So JJ is an ideal. It contains 22 and 1+−51 + \sqrt{-5} but not 11, so (2,1+−5)⊆J≠R(2, 1 + \sqrt{-5}) \subseteq J \ne R. If (2,1+−5)=(g)(2, 1 + \sqrt{-5}) = (g), then g∣2g \mid 2 and g∣1+−5g \mid 1 + \sqrt{-5}, so N(g)N(g) divides gcd⁡(4,6)=2\gcd(4, 6) = 2. Thus N(g)=1N(g) = 1, since no norm is 22, and gg is a unit — contradicting (g)⊆J≠R(g) \subseteq J \ne R. (Alternatively: a PID is a UFD, and (a) shows Z[−5]\Z[\sqrt{-5}] is not.)

∎

Ideals restore uniqueness here. With P=(2,1+−5)P = (2, 1 + \sqrt{-5}), Q=(3,1+−5)Q = (3, 1 + \sqrt{-5}) and Qˉ=(3,1−−5)\bar Q = (3, 1 - \sqrt{-5}), one checks that P2=(2)P^2 = (2), QQˉ=(3)Q\bar Q = (3), PQ=(1+−5)PQ = (1 + \sqrt{-5}) and PQˉ=(1−−5)P\bar Q = (1 - \sqrt{-5}). So both factorisations of 66 refine to the same factorisation into prime ideals, (6)=P2QQˉ(6) = P^2 Q \bar Q. Dedekind proved that in the ring of integers of any number field, every non-zero ideal factors uniquely into prime ideals (see algebraic number theory).

Theorem— Theorem 12 (neither implication reverses)

(a) Z[x]\Z[x] is a UFD but not a PID: the ideal (2,x)(2, x) is not principal. (b) Z[1+−192]\Z\big[\frac{1 + \sqrt{-19}}{2}\big] is a PID but not a Euclidean domain (for any function δ\delta).

Proof

(a) That Z[x]\Z[x] is a UFD is Gauss's lemma: if RR is a UFD, so is R[x]R[x] (Dummit and Foote, §9.3). Suppose (2,x)=(f)(2, x) = (f). Since f∣2f \mid 2, degrees give deg⁡f=0\deg f = 0, so f=c∈Zf = c \in \Z. Since c∣xc \mid x, c=±1c = \pm 1. But every element 2g+xh2g + xh of (2,x)(2, x) has even constant term, and ff is such an element, so cc is even. Contradiction.

(b) We only sketch this; full proofs are in Dummit and Foote, §8.1–8.2. The ring is not Euclidean (Motzkin, 1949): in a Euclidean domain that is not a field, an element uu of least size among non-zero non-units has the property that every element is congruent modulo uu to 00 or a unit, and in this ring (whose units are ±1\pm 1) no such uu exists. It is a PID because it has a weaker "Dedekind–Hasse" norm property, and because the class number of Q(−19)\Q(\sqrt{-19}) is 11.

∎

Formal mathematicsF

Rings in Lean and Mathlib

Mathlib's Ring, CommRing, IsDomain and Field classes match the lesson's conventions: rings have a 11, and ring homomorphisms R →+* S preserve it. Ideal R is defined as a submodule of RR over itself, which is exactly "an additive subgroup that absorbs multiplication". Prime p and Irreducible p are the lesson's definitions. IsPrincipalIdealRing R, EuclideanDomain R and UniqueFactorizationMonoid R are the three layers of the hierarchy.

Units and zero divisors (Proposition 1(d), the Z/6Z\Z/6\Z example and Theorem 2):

unit_mul_eq_zeroLean 4Proved here from basic factsFormally verified
/-- A unit is never a zero divisor: if `u` is a unit and `u * a = 0` then `a = 0`, because
`a = u⁻¹ * (u * a) = u⁻¹ * 0 = 0`. (This works in every ring, commutative or not.) -/
theorem unit_mul_eq_zero {R : Type*} [Ring R] {u a : R} (hu : IsUnit u) (h : u * a = 0) :
    a = 0 := by
  obtain ⟨v, rfl⟩ := hu
  calc a = (↑v⁻¹ * ↑v) * a := by simp
    _ = ↑v⁻¹ * (↑v * a) := mul_assoc _ _ _
    _ = 0 := by rw [h, mul_zero]
Axioms used: propextformal/Lumenary/Rings.leanTry it in the Lean web editor
zmod_six_zero_divisorsLean 4Proved here from basic factsFormally verified
/-- `ℤ/6ℤ` is not an integral domain: `2 · 3 = 0` although neither factor is `0`.
`decide` computes in `ZMod 6`. -/
theorem zmod_six_zero_divisors : (2 : ZMod 6) * 3 = 0 ∧ (2 : ZMod 6) ≠ 0 ∧ (3 : ZMod 6) ≠ 0 := by
  decide
Axioms used: propext, Quot.soundformal/Lumenary/Rings.leanTry it in the Lean web editor
finite_domain_inverseLean 4Proved here from basic factsFormally verified
/-- In a finite integral domain every non-zero `a` has an inverse. Multiplication by `a` is
injective (cancellation: `a * x = a * y` and `a ≠ 0` give `x = y`); an injective map from a
finite set to itself is surjective; so some `b` has `a * b = 1`. -/
theorem finite_domain_inverse {R : Type*} [CommRing R] [IsDomain R] [Finite R] (a : R)
    (ha : a ≠ 0) : ∃ b : R, a * b = 1 := by
  have inj : Function.Injective (fun x : R => a * x) := fun x y h => mul_left_cancel₀ ha h
  exact Finite.injective_iff_surjective.mp inj 1
Axioms used: propext, Classical.choice, Quot.soundformal/Lumenary/Rings.leanTry it in the Lean web editor
finite_domain_is_fieldLean 4Applies a library theoremFormally verified
/-- Every finite integral domain is a field. Mathlib's `Finite.isDomain_to_isField` proves this
even without commutativity — that stronger statement includes Wedderburn's little theorem that
finite division rings are commutative. -/
theorem finite_domain_is_field (R : Type*) [CommRing R] [IsDomain R] [Finite R] : IsField R :=
  Finite.isDomain_to_isField R
Axioms used: propext, Classical.choice, Quot.soundformal/Lumenary/Rings.leanTry it in the Lean web editor

Kernels and ideals (Proposition 3). The kernel is built by hand and then identified with Mathlib's RingHom.ker:

kerIdealLean 4Formally verified
/-- The kernel of a ring homomorphism, built by hand as an ideal: it contains `0`, is closed
under addition, and absorbs multiplication, since `f (r * x) = f r * 0 = 0`. -/
def kerIdeal {R S : Type*} [CommRing R] [CommRing S] (f : R →+* S) : Ideal R where
  carrier := {x | f x = 0}
  zero_mem' := by simp
  add_mem' {x y} hx hy := by simp_all
  smul_mem' r x hx := by simp_all
Axioms used: propextformal/Lumenary/Rings.leanTry it in the Lean web editor
kerIdeal_eqLean 4Proved here from basic factsFormally verified
/-- The hand-built kernel is Mathlib's `RingHom.ker f`: both are `{x | f x = 0}`. -/
theorem kerIdeal_eq {R S : Type*} [CommRing R] [CommRing S] (f : R →+* S) :
    kerIdeal f = RingHom.ker f := by
  ext x
  simp [kerIdeal, RingHom.mem_ker]
Axioms used: propext, Quot.soundformal/Lumenary/Rings.leanTry it in the Lean web editor
eq_top_of_unit_memLean 4Proved here from basic factsFormally verified
/-- An ideal that contains a unit `u` is the whole ring: it contains `u⁻¹ * u = 1`, and then
`r = r * 1` for every `r`. -/
theorem eq_top_of_unit_mem {R : Type*} [CommRing R] (I : Ideal R) {u : R} (hu : IsUnit u)
    (h : u ∈ I) : I = ⊤ := by
  rw [Ideal.eq_top_iff_one]
  obtain ⟨v, rfl⟩ := hu
  have : (↑v⁻¹ * ↑v : R) ∈ I := I.mul_mem_left _ h
  simpa using this
Axioms used: propext, Quot.soundformal/Lumenary/Rings.leanTry it in the Lean web editor
field_idealsLean 4Proved here from basic factsFormally verified
/-- A field has exactly two ideals, `0` and the whole field: a non-zero ideal contains a non-zero
element, which is a unit. -/
theorem field_ideals {K : Type*} [Field K] (I : Ideal K) : I = ⊥ ∨ I = ⊤ := by
  by_cases h : I = ⊥
  · exact Or.inl h
  · obtain ⟨x, hx, hx0⟩ := Submodule.exists_mem_ne_zero_of_ne_bot h
    exact Or.inr (eq_top_of_unit_mem I (IsUnit.mk0 x hx0) hx)
Axioms used: propext, Classical.choice, Quot.soundformal/Lumenary/Rings.leanTry it in the Lean web editor

Prime and irreducible elements: Proposition 5, and Theorem 8(b), which is the heart of "PID ⇒ UFD". The Lean proof follows the human one line by line, using Ideal.mem_span_pair for the Bézout step:

prime_irreducibleLean 4Proved here from basic factsFormally verified
/-- In an integral domain every prime element is irreducible. If `p = a * b`, then `p ∣ a` or
`p ∣ b`; say `a = p * c`. Then `p = p * c * b`, and cancelling `p ≠ 0` gives `1 = c * b`, so `b`
is a unit. -/
theorem prime_irreducible {R : Type*} [CommRing R] [IsDomain R] {p : R} (hp : Prime p) :
    Irreducible p := by
  refine ⟨hp.not_isUnit, fun a b hab => ?_⟩
  rcases hp.dvd_or_dvd ⟨1, by rw [← hab, mul_one]⟩ with ⟨c, hc⟩ | ⟨c, hc⟩
  · right
    have h : p * 1 = p * (c * b) := by
      calc p * 1 = a * b := by rw [mul_one, hab]
        _ = p * (c * b) := by rw [hc, mul_assoc]
    exact IsUnit.of_mul_eq_one_right c (mul_left_cancel₀ hp.ne_zero h).symm
  · left
    have h : p * 1 = p * (c * a) := by
      calc p * 1 = a * b := by rw [mul_one, hab]
        _ = p * (c * a) := by rw [hc, mul_comm a, mul_assoc]
    exact IsUnit.of_mul_eq_one_right c (mul_left_cancel₀ hp.ne_zero h).symm
Axioms used: No axiomsformal/Lumenary/Rings.leanTry it in the Lean web editor
pid_irreducible_primeLean 4Proved here from basic factsFormally verified
/-- **Euclid's lemma in a principal ideal domain**: irreducible elements are prime. Let `p` be
irreducible with `p ∣ a * b` and `p ∤ a`. The ideal `(p, a)` is principal, say `(d)`. From
`p = d * x`, either `x` is a unit — then `(d) = (p)` contains `a`, so `p ∣ a`, impossible — or `d`
is a unit, so `(p, a)` is everything: `1 = r * p + s * a`. Then `b = r * p * b + s * (a * b)` is
divisible by `p`. -/
theorem pid_irreducible_prime {R : Type*} [CommRing R] [IsDomain R] [IsPrincipalIdealRing R]
    {p : R} (hp : Irreducible p) : Prime p := by
  refine ⟨hp.ne_zero, hp.not_isUnit, fun a b hab => ?_⟩
  by_cases hpa : p ∣ a
  · exact Or.inl hpa
  right
  obtain ⟨d, hd⟩ := (IsPrincipalIdealRing.principal (Ideal.span {p, a})).principal
  have hd' : Ideal.span {p, a} = Ideal.span {d} := hd
  have hpd : p ∈ Ideal.span {d} := by rw [← hd']; exact Ideal.subset_span (by simp)
  have had : a ∈ Ideal.span {d} := by rw [← hd']; exact Ideal.subset_span (by simp)
  obtain ⟨x, hx⟩ := Ideal.mem_span_singleton'.mp hpd
  have hpdx : p = d * x := by rw [← hx, mul_comm]
  rcases hp.isUnit_or_isUnit hpdx with hdu | hxu
  · -- `d` is a unit, so `1 ∈ (p, a)`.
    have h1 : (1 : R) ∈ Ideal.span {p, a} := by
      rw [hd', eq_top_of_unit_mem _ hdu (Ideal.mem_span_singleton_self d)]
      exact Submodule.mem_top
    obtain ⟨r, s, hrs⟩ := Ideal.mem_span_pair.mp h1
    obtain ⟨c, hc⟩ := hab
    exact ⟨r * b + s * c, by
      calc b = (r * p + s * a) * b := by rw [hrs, one_mul]
        _ = p * (r * b + s * c) := by rw [add_mul, mul_assoc s, hc]; ring⟩
  · -- `x` is a unit, so `d` divides `p` and `p` divides `d ∣ a`: contradiction.
    exfalso
    apply hpa
    obtain ⟨y, hy⟩ := Ideal.mem_span_singleton'.mp had
    obtain ⟨u, rfl⟩ := hxu
    exact ⟨y * ↑u⁻¹, by rw [← hy, ← hx]; linear_combination (-(y * d)) * Units.mul_inv u⟩
Axioms used: propext, Classical.choice, Quot.soundformal/Lumenary/Rings.leanTry it in the Lean web editor

The hierarchy itself (Theorems 6, 7 and 9) is in Mathlib as instances, so these proofs are just inferInstance. The real content is in the cited library proofs:

ed_is_pidLean 4Applies a library theoremFormally verified
/-- Every Euclidean domain is a principal ideal domain: a non-zero ideal is generated by any of
its elements of least size. This is Mathlib's instance `EuclideanDomain.instIsPrincipalIdealRing`. -/
theorem ed_is_pid (R : Type*) [EuclideanDomain R] : IsPrincipalIdealRing R :=
  inferInstance
Axioms used: propext, Classical.choice, Quot.soundformal/Lumenary/Rings.leanTry it in the Lean web editor
pid_is_ufdLean 4Applies a library theoremFormally verified
/-- Every principal ideal domain is a unique factorisation domain. Mathlib's instance
`PrincipalIdealRing.to_uniqueFactorizationMonoid` combines Euclid's lemma (`pid_irreducible_prime`
above) with the ascending chain condition on principal ideals. -/
theorem pid_is_ufd (R : Type*) [CommRing R] [IsDomain R] [IsPrincipalIdealRing R] :
    UniqueFactorizationMonoid R :=
  inferInstance
Axioms used: propext, Classical.choice, Quot.soundformal/Lumenary/Rings.leanTry it in the Lean web editor
polynomial_pidLean 4Applies a library theoremFormally verified
/-- For a field `K`, the polynomial ring `K[X]` is Euclidean (divide with remainder, measuring
size by degree), hence a principal ideal domain. Mathlib: `Polynomial.instEuclideanDomain`. -/
theorem polynomial_pid (K : Type*) [Field K] : IsPrincipalIdealRing K[X] :=
  inferInstance
Axioms used: propext, Classical.choice, Quot.soundformal/Lumenary/Rings.leanTry it in the Lean web editor
gaussian_pidLean 4Applies a library theoremFormally verified
/-- The Gaussian integers `ℤ[i]` are Euclidean for the norm `a² + b²` (round the exact quotient
in `ℚ(i)` to the nearest lattice point), hence a principal ideal domain. Mathlib: the
`EuclideanDomain` instance on `GaussianInt`. -/
theorem gaussian_pid : IsPrincipalIdealRing GaussianInt :=
  inferInstance
Axioms used: propext, Classical.choice, Quot.soundformal/Lumenary/Rings.leanTry it in the Lean web editor
int_poly_ufdLean 4Applies a library theoremFormally verified
/-- `ℤ[X]` is a unique factorisation domain (Gauss's lemma: `R[X]` is a UFD when `R` is).
Mathlib: `Polynomial.uniqueFactorizationMonoid`. -/
theorem int_poly_ufd : UniqueFactorizationMonoid ℤ[X] :=
  inferInstance
Axioms used: propext, Classical.choice, Quot.soundformal/Lumenary/Rings.leanTry it in the Lean web editor

Theorem 12(a), proved here: (2,x)(2, x) is not principal in Z[x]\Z[x]. The proof compares degrees, then the coefficient of xx, then constant terms, exactly as in the lesson:

int_poly_not_pidLean 4Proved here from basic factsFormally verified
/-- `ℤ[X]` is **not** a principal ideal domain: the ideal `(2, X)` is not principal. If
`(2, X) = (f)`, then `f ∣ 2` forces `f` to be a constant `c`; `f ∣ X` forces `c ∣ 1`; but every
element `2g + Xh` of `(2, X)` has an even constant term, so `c` is even. -/
theorem int_poly_not_pid : ¬ IsPrincipalIdealRing ℤ[X] := by
  intro h
  obtain ⟨f, hf⟩ := (h.principal (Ideal.span {(2 : ℤ[X]), X})).principal
  have hfs : Ideal.span {(2 : ℤ[X]), X} = Ideal.span {f} := hf
  have h2 : (2 : ℤ[X]) ∈ Ideal.span {f} := by rw [← hfs]; exact Ideal.subset_span (by simp)
  have hX : (X : ℤ[X]) ∈ Ideal.span {f} := by rw [← hfs]; exact Ideal.subset_span (by simp)
  have hf' : f ∈ Ideal.span {(2 : ℤ[X]), X} := by rw [hfs]; exact Ideal.mem_span_singleton_self f
  -- The constant term of `f` is even.
  obtain ⟨a, b, hab⟩ := Ideal.mem_span_pair.mp hf'
  have heven : f.coeff 0 = 2 * a.coeff 0 := by
    rw [← hab]
    simp [mul_comm]
  -- `f` is constant, because it divides `2`.
  obtain ⟨g, hg⟩ := Ideal.mem_span_singleton'.mp h2
  have hf0 : f ≠ 0 := by rintro rfl; simp at hg
  have hg0 : g ≠ 0 := by rintro rfl; simp at hg
  have hdeg : f.natDegree = 0 := by
    have := congrArg natDegree hg
    rw [natDegree_mul hg0 hf0] at this
    have h2deg : (2 : ℤ[X]).natDegree = 0 := natDegree_ofNat 2
    omega
  rw [eq_C_of_natDegree_eq_zero hdeg] at hX
  -- `C c ∣ X` gives `c * q₁ = 1`, so `c ∣ 1`; but `c` is even.
  obtain ⟨q, hq⟩ := Ideal.mem_span_singleton'.mp hX
  have h1 := congrArg (fun p : ℤ[X] => p.coeff 1) hq
  simp only [coeff_mul_C, coeff_X_one] at h1
  rw [heven] at h1
  have h21 : (2 : ℤ) ∣ 1 := ⟨q.coeff 1 * a.coeff 0, by rw [← h1]; ring⟩
  omega
Axioms used: propext, Classical.choice, Quot.soundformal/Lumenary/Rings.leanTry it in the Lean web editor

Finally Z[−5]\Z[\sqrt{-5}], which Mathlib writes ℤ√(-5), with elements ⟨x, y⟩ meaning x+y−5x + y\sqrt{-5}. Mathlib provides the multiplicative norm but no domain instance for negative dd, so we prove one ourselves from the norm. We then prove Theorems 10 and 11(a, b) and conclude that Z[−5]\Z[\sqrt{-5}] is not a UFD:

norm_formulaLean 4Proved here from basic factsFormally verified
/-- The norm on `ℤ[√−5]` is `N(x + y√−5) = (x + y√−5)(x − y√−5) = x² + 5y²`. It is
multiplicative (Mathlib's `Zsqrtd.norm_mul`). -/
theorem norm_formula (z : ℤ√(-5)) : z.norm = z.re ^ 2 + 5 * z.im ^ 2 := by
  rw [Zsqrtd.norm_def]
  ring
Axioms used: propext, Quot.soundformal/Lumenary/Rings.leanTry it in the Lean web editor
norm_eq_zeroLean 4Proved here from basic factsFormally verified
/-- Only `0` has norm `0`: `x² + 5y² = 0` forces `x = y = 0`. -/
theorem norm_eq_zero (z : ℤ√(-5)) (h : z.norm = 0) : z = 0 := by
  rw [norm_formula] at h
  have hre : z.re ^ 2 = 0 := by nlinarith [sq_nonneg z.re, sq_nonneg z.im]
  have him : z.im ^ 2 = 0 := by nlinarith [sq_nonneg z.re, sq_nonneg z.im]
  ext
  · simpa using hre
  · simpa using him
Axioms used: propext, Classical.choice, Quot.soundformal/Lumenary/Rings.leanTry it in the Lean web editor
isDomainLean 4Formally verified
/-- `ℤ[√−5]` is an integral domain: if `a * b = 0` then `N(a) N(b) = N(a * b) = 0`, so one of
the norms is `0`, and only `0` has norm `0`. (Mathlib provides this instance for `ℤ[√d]` with
`d` a positive non-square; here `d = −5`.) -/
instance isDomain : IsDomain (ℤ√(-5)) :=
  @NoZeroDivisors.to_isDomain _ _ _ ⟨fun {a b} h => by
    have hn := congrArg Zsqrtd.norm h
    rw [Zsqrtd.norm_mul, Zsqrtd.norm_zero] at hn
    rcases mul_eq_zero.mp hn with ha | hb
    · exact Or.inl (norm_eq_zero a ha)
    · exact Or.inr (norm_eq_zero b hb)⟩
Axioms used: propext, Classical.choice, Quot.soundformal/Lumenary/Rings.leanTry it in the Lean web editor
norm_ne_twoLean 4Proved here from basic factsFormally verified
/-- No element of `ℤ[√−5]` has norm `2`: `x² + 5y² = 2` forces `y = 0` and then `x² = 2`. -/
theorem norm_ne_two (z : ℤ√(-5)) : z.norm ≠ 2 := by
  rw [norm_formula]
  intro h
  have him : z.im = 0 := by nlinarith [sq_nonneg z.re, sq_nonneg z.im]
  rw [him] at h
  have hle : z.re ≤ 1 := by nlinarith
  have hge : -1 ≤ z.re := by nlinarith
  interval_cases z.re <;> simp at h
Axioms used: propext, Classical.choice, Quot.soundformal/Lumenary/Rings.leanTry it in the Lean web editor
two_mul_threeLean 4Proved here from basic factsFormally verified
/-- Two factorisations of `6`: `2 · 3 = (1 + √−5)(1 − √−5)`. -/
theorem two_mul_three : (2 : ℤ√(-5)) * 3 = ⟨1, 1⟩ * ⟨1, -1⟩ := by
  decide
Axioms used: propextformal/Lumenary/Rings.leanTry it in the Lean web editor
two_irreducibleLean 4Proved here from basic factsFormally verified
/-- `2` is irreducible in `ℤ[√−5]`. It is not a unit (its norm is `4`, units have norm `1`). If
`2 = a * b` then `N(a) N(b) = 4`; neither norm is `2` (`norm_ne_two`), so one of them is `1`, and
that factor is a unit. -/
theorem two_irreducible : Irreducible (2 : ℤ√(-5)) := by
  have hunit : ∀ z : ℤ√(-5), z.norm = 1 → IsUnit z :=
    fun z hz => (Zsqrtd.norm_eq_one_iff' (by norm_num) z).mp hz
  refine ⟨fun h => ?_, fun a b hab => ?_⟩
  · have := (Zsqrtd.norm_eq_one_iff' (by norm_num) 2).mpr h
    rw [norm_formula] at this
    norm_num at this
  · have hn := congrArg Zsqrtd.norm hab
    rw [Zsqrtd.norm_mul, norm_formula 2] at hn
    norm_num at hn
    have ha0 := Zsqrtd.norm_nonneg (by norm_num) a
    have hb0 := Zsqrtd.norm_nonneg (by norm_num) b
    have ha2 := norm_ne_two a
    have hb2 := norm_ne_two b
    have hapos : 0 < a.norm := by
      rcases ha0.lt_or_eq with h | h
      · exact h
      · rw [← h] at hn; simp at hn
    have hbpos : 0 < b.norm := by
      rcases hb0.lt_or_eq with h | h
      · exact h
      · rw [← h] at hn; simp at hn
    have hale : a.norm ≤ 4 := by
      have := mul_le_mul_of_nonneg_left (show (1 : ℤ) ≤ b.norm by omega) ha0
      linarith
    interval_cases hna : a.norm
    · exact Or.inl (hunit a hna)
    · exact absurd rfl ha2
    · omega
    · exact Or.inr (hunit b (by omega))
Axioms used: propext, Classical.choice, Quot.soundformal/Lumenary/Rings.leanTry it in the Lean web editor
two_not_primeLean 4Proved here from basic factsFormally verified
/-- `2` is not prime in `ℤ[√−5]`: it divides `(1 + √−5)(1 − √−5) = 6` but neither factor, since
`2 * c` always has even real part while `1 ± √−5` has real part `1`. -/
theorem two_not_prime : ¬ Prime (2 : ℤ√(-5)) := by
  intro hp
  rcases hp.dvd_or_dvd ⟨3, two_mul_three.symm⟩ with ⟨c, hc⟩ | ⟨c, hc⟩
  · have := congrArg Zsqrtd.re hc
    simp at this
    omega
  · have := congrArg Zsqrtd.re hc
    simp at this
    omega
Axioms used: propext, Quot.soundformal/Lumenary/Rings.leanTry it in the Lean web editor
not_ufdLean 4Proved here from basic factsFormally verified
/-- **`ℤ[√−5]` is not a unique factorisation domain.** In a UFD every irreducible element is
prime, but `2` is irreducible (`two_irreducible`) and not prime (`two_not_prime`). -/
theorem not_ufd : ¬ UniqueFactorizationMonoid (ℤ√(-5)) := fun h =>
  two_not_prime (h.irreducible_iff_prime.mp two_irreducible)
Axioms used: propext, Classical.choice, Quot.soundformal/Lumenary/Rings.leanTry it in the Lean web editor

What is and is not formalised. Proved independently here: Proposition 1(d), Theorem 2, Proposition 3(2, 3) and the kernel ideal, Proposition 5, Theorem 8(b), Theorem 12(a) (non-principality of (2,x)(2, x)), and Theorems 10 and 11(a, b) — that Z[−5]\Z[\sqrt{-5}] is a domain but not a UFD. Cited from Mathlib: Theorems 6, 7 and 9, Gauss's lemma for Z[x]\Z[x], and the finite-domain theorem in its non-commutative (Wedderburn) form. Not formalised: Theorem 11(c) and the ideal factorisation of (6)(6), and Theorem 12(b). As far as we know, Mathlib does not contain the fact that Z[1+−192]\Z\big[\frac{1+\sqrt{-19}}{2}\big] is a non-Euclidean PID.

ComputationC

Census and factorisation by computer

The first program sorts every residue of Z/nZ\Z/n\Z into units, zero divisors and 00, counts nilpotents, idempotents and ideals, and checks the general statements of the lesson for every n≤60n \le 60.

Units, zero divisors and ideals of Z/nZPythonExact computationExhaustive finite checkComputationally tested
"""Units, zero divisors, nilpotents and ideals in the rings Z/nZ.

For each n the program sorts the residues 0, ..., n - 1 into units (elements
with a multiplicative inverse) and zero divisors (non-zero a with ab = 0 for
some non-zero b), finds the nilpotent elements (a^k = 0) and the idempotents
(e^2 = e), and lists all ideals by brute force. It confirms, for every n up to
60, that each non-zero residue is exactly one of unit or zero divisor, that the
units number phi(n) = #{a : gcd(a, n) = 1}, that the ideals correspond to the
divisors of n, and that Z/nZ is a domain exactly when it is a field, exactly
when n is prime. Exact and exhaustive for these n only.
"""

from math import gcd

def units(n):
    """Residues a in Z/nZ with some b such that a * b = 1 (mod n)."""
    return [a for a in range(n) if any(a * b % n == 1 % n for b in range(n))]

def zero_divisors(n):
    """Non-zero residues a with a * b = 0 (mod n) for some non-zero b."""
    return [a for a in range(1, n) if any(a * b % n == 0 for b in range(1, n))]

def nilpotents(n):
    """Residues a with a^k = 0 (mod n) for some k >= 1 (k = n suffices)."""
    return [a for a in range(n) if pow(a, n, n) == 0]

def idempotents(n):
    """Residues e with e * e = e (mod n)."""
    return [e for e in range(n) if e * e % n == e]

def ideals(n):
    """All ideals of Z/nZ, found by brute force as sorted tuples.

    An ideal is an additive subgroup closed under multiplication by every
    residue. Every subset generated by one element is checked, and the ideal
    generated by a set is the one generated by the gcd, so this is complete;
    the test file also checks completeness against all subsets for small n.
    """
    found = set()
    for a in range(n):
        ideal = tuple(sorted({a * r % n for r in range(n)}))
        found.add(ideal)
    return sorted(found, key=len)

def is_ideal(subset, n):
    """True when subset is non-empty, closed under +, and absorbs products."""
    s = set(subset)
    return bool(s) and all((x + y) % n in s and x * r % n in s
                           for x in s for y in s for r in range(n))

def is_prime(n):
    """Trial division."""
    return n >= 2 and all(n % p for p in range(2, int(n ** 0.5) + 1))

def main():
    print(" n  units  zero divisors  ideals  idempotents  non-zero nilpotents")
    for n in (2, 4, 6, 7, 8, 9, 10, 12, 15, 30):
        u, z = units(n), zero_divisors(n)
        nil = [a for a in nilpotents(n) if a]
        print(f"{n:>2}  {len(u):>5}  {len(z):>13}  {len(ideals(n)):>6}  "
              f"{len(idempotents(n)):>11}  {nil}")
    split = phi = divisors = domain = True
    for n in range(2, 61):
        u, z = set(units(n)), set(zero_divisors(n))
        split &= u.isdisjoint(z) and u | z == set(range(1, n))
        phi &= len(u) == sum(gcd(a, n) == 1 for a in range(n))
        divisors &= len(ideals(n)) == sum(n % d == 0 for d in range(1, n + 1))
        domain &= (not z) == (len(u) == n - 1) == is_prime(n)
    print("For every n from 2 to 60:")
    print(f"  each non-zero residue is a unit or a zero divisor, not both: {split}")
    print(f"  number of units = phi(n) = #{{a : gcd(a, n) = 1}}: {phi}")
    print(f"  number of ideals = number of divisors of n: {divisors}")
    print(f"  no zero divisors <=> every non-zero a a unit <=> n prime: {domain}")
    print()
    print("Epistemic status: exact, exhaustive checks for n <= 60. In a finite")
    print("commutative ring every non-zero element is a unit or a zero divisor,")
    print("and Z/nZ is a field exactly when n is prime: those are theorems, proved")
    print("in the lesson; the table is evidence and illustration, not proof.")

if __name__ == "__main__":
    main()
Runs entirely in your browser, in an isolated worker. Nothing is sent to a server.

Notice the patterns. Nilpotents appear exactly when nn has a repeated prime factor. There are 2ω(n)2^{\omega(n)} idempotents, where ω(n)\omega(n) is the number of distinct prime factors; this reflects the Chinese remainder theorem Z/nZ≅∏Z/pkZ\Z/n\Z \cong \prod \Z/p^k\Z of the next lesson. The table is exact evidence for these nn. The statements that hold for all nn are the theorems proved above.

The norm makes factorisation in Z[i]\Z[i] and Z[−5]\Z[\sqrt{-5}] a finite search. A factor of zz has norm dividing N(z)N(z), and there are finitely many elements of each norm. The second program lists every factorisation into irreducibles of the integers 2,…,302, \dots, 30 in both rings.

Unique factorisation in Z[i], and its failure in Z[sqrt(-5)]PythonExact computationExhaustive finite checkCounterexampleComputationally tested
"""Factorisation by norms in Z[i] and Z[sqrt(-5)].

An element x + y*sqrt(d) (d = -1 or -5) has norm N = x^2 - d*y^2, and the norm is
multiplicative, so a factor of z has a norm dividing N(z). That makes an exact
search possible: list the elements of each smaller norm and test divisibility.
The program finds every factorisation of 2, ..., 30 into irreducibles (up to
order and units) in both rings, shows that Euclidean division by 2 fails in
Z[sqrt(-5)] (every remainder has norm at least 6 > N(2) = 4), and checks that
rounding the exact quotient always works in Z[i] on a box of examples.
"""

from fractions import Fraction
from functools import lru_cache
from itertools import product

def norm(z, d):
    """N(x + y sqrt(d)) = x^2 - d y^2 (positive for d < 0, z != 0)."""
    x, y = z
    return x * x - d * y * y

def mul(z, w, d):
    """(a + b r)(c + e r) with r^2 = d."""
    return (z[0] * w[0] + d * z[1] * w[1], z[0] * w[1] + z[1] * w[0])

def divide(z, w, d):
    """Return z / w if it lies in Z[sqrt(d)], else None (uses z * conj(w))."""
    n = norm(w, d)
    x, y = mul(z, (w[0], -w[1]), d)
    if x % n or y % n:
        return None
    return (x // n, y // n)

def of_norm(n, d):
    """All elements of norm n (finitely many, since d < 0)."""
    bound = int(n ** 0.5) + 1
    return [(x, y) for x in range(-bound, bound + 1)
            for y in range(-bound, bound + 1) if norm((x, y), d) == n]

def units(d):
    """The units: the elements of norm 1."""
    return of_norm(1, d)

def canonical(z, d):
    """A fixed representative of z up to multiplication by units."""
    return max(mul(z, u, d) for u in units(d))

def proper_divisors(z, d):
    """Divisors a of z with 1 < N(a) < N(z), one per associate class."""
    n = norm(z, d)
    found = set()
    for m in range(2, n):
        if n % m == 0:
            for a in of_norm(m, d):
                if divide(z, a, d) is not None:
                    found.add(canonical(a, d))
    return sorted(found)

def is_irreducible(z, d):
    """Not zero, not a unit, and no factor of intermediate norm."""
    return norm(z, d) > 1 and not proper_divisors(z, d)

@lru_cache(maxsize=None)
def factorisations(z, d):
    """All factorisations of z into irreducibles, as sorted tuples of
    canonical representatives (so order and units are ignored)."""
    if is_irreducible(z, d):
        return frozenset({(canonical(z, d),)})
    result = set()
    for a in proper_divisors(z, d):
        if is_irreducible(a, d):
            for rest in factorisations(divide(z, a, d), d):
                result.add(tuple(sorted(rest + (a,))))
    return frozenset(result)

def show(z, d):
    """Format x + y*sqrt(d) compactly, e.g. 1+r or 2 or -r."""
    x, y = z
    if y == 0:
        return str(x)
    r = "i" if d == -1 else "r"
    coef = "" if abs(y) == 1 else str(abs(y))
    if x == 0:
        return f"{'-' if y < 0 else ''}{coef}{r}"
    return f"{x}{'-' if y < 0 else '+'}{coef}{r}"

def best_remainder(a, b, d, box=6):
    """Least N(a - q b) over q = (s, t) with |s|, |t| <= box."""
    return min(norm((a[0] - p[0], a[1] - p[1]), d)
               for p in (mul(q, b, d) for q in product(range(-box, box + 1),
                                                         repeat=2)))

def gaussian_rounding_works(limit=6):
    """Check N(a - q b) < N(b) with q = a/b rounded, for a, b in a box."""
    rng = range(-limit, limit + 1)
    for a in product(rng, repeat=2):
        for b in product(rng, repeat=2):
            if b == (0, 0):
                continue
            n = norm(b, -1)
            x, y = mul(a, (b[0], -b[1]), -1)
            q = (round(Fraction(x, n)), round(Fraction(y, n)))
            r = (a[0] - mul(q, b, -1)[0], a[1] - mul(q, b, -1)[1])
            if norm(r, -1) >= n:
                return False
    return True

def main():
    for d, name in ((-1, "Z[i]"), (-5, "Z[sqrt(-5)]  (r = sqrt(-5))")):
        print(f"{name}: integers 2..30 with more than one factorisation")
        several = []
        for n in range(2, 31):
            facs = factorisations((n, 0), d)
            if len(facs) > 1:
                several.append(n)
                first, second = sorted(facs, key=len)[:2]
                shown = "  =  ".join(" ".join(f"({show(p, d)})" for p in f)
                                     for f in (first, second))
                print(f"  {n:>2}: {len(facs)} ways, e.g. {shown}")
        if not several:
            print("  none: every factorisation is unique up to order and units")
    print("Irreducible but not prime in Z[sqrt(-5)]: 2 divides (1+r)(1-r) = 6,")
    print(f"  2 irreducible: {is_irreducible((2, 0), -5)}; 2 divides 1+r: "
          f"{divide((1, 1), (2, 0), -5) is not None}")
    print(f"Euclid fails in Z[sqrt(-5)]: least N((1+r) - 2q) = "
          f"{best_remainder((1, 1), (2, 0), -5)} >= N(2) = 4")
    print(f"Z[i]: rounding a/b gives N(remainder) < N(b) for all a, b with")
    print(f"  coordinates in -6..6: {gaussian_rounding_works()}")
    print()
    print("Epistemic status: exact searches, justified by the multiplicative")
    print("norm, for the integers 2..30 only. They illustrate, but do not prove,")
    print("that Z[i] is a UFD (proved via its Euclidean algorithm) and exhibit a")
    print("genuine counterexample to unique factorisation in Z[sqrt(-5)].")

if __name__ == "__main__":
    main()
Runs entirely in your browser, in an isolated worker. Nothing is sent to a server.

In Z[i]\Z[i] every factorisation is unique, as Theorem 9 guarantees. In Z[−5]\Z[\sqrt{-5}] ten of the integers up to 3030 factor in more than one way, and 1818 factors in five different ways. The searches are exact, and the failure of Euclidean division by 22 is a proved counterexample: (1−2s)+(1−2t)−5(1 - 2s) + (1 - 2t)\sqrt{-5} has norm at least 1+5=6>41 + 5 = 6 \gt 4 for all integers s,ts, t, because odd numbers have odd squares.

Explore

Explore: units and zero divisors on a clock

Switch the clock to the multiplication tab and search for multiplicative partners. For a prime number of hours, every non-zero residue has a partner, so Z/pZ\Z/p\Z is a field. For k=12k = 12, only 1,5,7,111, 5, 7, 11 do. Each of the others times some non-zero residue lands on 00, so those are zero divisors. Try k=8k = 8, 99, 1010 and 1515, and predict which residues will have partners before you look: exactly those coprime to kk.

The clock laboratory

On a clock with k hours, counting wraps around. Explore adding and multiplying.

01234567891011

9 + 5 = 14 ≡ 2 (mod 12)

14 hours forward on a 12-hour clock lands on 2: the remainder when 14 is divided by 12.

Exercises

Exercises

1. Rings, ideals and fields

Warm-upHuman

How many units does the ring Z/12Z\Z/12\Z have?

2. Rings, ideals and fields

Warm-upHuman

Which of these rings are integral domains? (Select all that apply.)

Choose all that apply

3. Rings, ideals and fields

CoreHuman

Which of these subsets of Z[x]\Z[x] are ideals? (Select all that apply.)

Choose all that apply

4. Rings, ideals and fields

CoreHuman

Q[x]\Q[x] is a principal ideal domain. Which polynomial generates the ideal I=(x2−1,  x2−3x+2)I = (x^2 - 1,\; x^2 - 3x + 2)?

Choose one

5. Rings, ideals and fields

CoreHuman

In the proof that a Euclidean domain is a PID, we take a non-zero ideal II, choose b∈I∖{0}b \in I \setminus \{0\} of least size δ(b)\delta(b), and divide any a∈Ia \in I as a=qb+ra = qb + r with r=0r = 0 or δ(r)<δ(b)\delta(r) \lt \delta(b). Why must r=0r = 0?

Choose one

6. Rings, ideals and fields

CoreHuman

In Z[−5]\Z[\sqrt{-5}] the element 33 is irreducible. Which of these products show that 33 is not prime — that is, 33 divides the product but divides neither factor? (Select all that apply.)

Choose all that apply

7. Rings, ideals and fields

CoreHuman

How many Gaussian integers x+yix + yi have norm x2+y2=25x^2 + y^2 = 25?

8. Rings, ideals and fields

CoreFormal

Which Lean statement formalises “every finite integral domain is a field”?

Choose one

9. Rings, ideals and fields

StretchComputational

Write classify(n) returning a pair (units, zero_divisors) of sorted lists for the ring Z/nZ\Z/n\Z (n≥2n \ge 2): units are the aa with ab≡1ab \equiv 1 for some bb, and zero_divisors the non-zero aa with ab≡0ab \equiv 0 for some non-zero bb. Then check that together they contain every non-zero residue exactly once.

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

Common misconceptions

Misconception

"Every ring is commutative and has a 11." Matrix rings and the quaternions are not commutative, and some authors do not require a 11 (then 2Z2\Z is a ring and homomorphisms need not preserve 11). State your conventions. In this lesson rings have 11, homomorphisms preserve it, and commutativity is assumed only when said.

Misconception

"Ideals are subrings" (or the reverse). A subring contains 11; a proper ideal never does, since an ideal containing a unit is everything. Z⊂Q\Z \subset \Q is a subring that is not an ideal, and 2Z⊂Z2\Z \subset \Z is an ideal that is not a subring. Ideals are the kernels of homomorphisms; subrings are their images.

Misconception

"Irreducible and prime mean the same thing." In Z\Z, in k[x]k[x] and in every UFD they coincide. In general, prime implies irreducible (Proposition 5) but not conversely: 22 is irreducible in Z[−5]\Z[\sqrt{-5}] and divides (1+−5)(1−−5)(1 + \sqrt{-5})(1 - \sqrt{-5}) without dividing either factor.

Misconception

"A domain in which every element factors into irreducibles has unique factorisation." Existence and uniqueness are separate. In Z[−5]\Z[\sqrt{-5}] every non-zero non-unit does factor into irreducibles (induct on the norm), but not uniquely. Uniqueness needs Euclid's lemma, that is, irreducibles must be prime.

Misconception

"Every PID is Euclidean" and "every UFD is a PID". Z[1+−192]\Z\big[\frac{1 + \sqrt{-19}}{2}\big] is a PID that is not Euclidean, and Z[x]\Z[x] and k[x,y]k[x, y] are UFDs that are not PIDs. The hierarchy is strict.

Misconception

"Z/nZ\Z/n\Z is always a field" or "a ring without zero divisors is a field". Z/6Z\Z/6\Z has zero divisors. Z\Z has none and is not a field. Finiteness is what turns "no zero divisors" into "every non-zero element is a unit" (Theorem 2).

ViewpointsH

Many ways of seeing

Geometry— Ideals are shapes

In the polynomial ring C[x1,…,xn]\C[x_1, \dots, x_n], an ideal II cuts out a shape, the variety V(I)={p∈Cn∣f(p)=0 for all f∈I}V(I) = \{p \in \C^n \mid f(p) = 0 \text{ for all } f \in I\}. Bigger ideals give smaller shapes: (x2+y2−1)(x^2 + y^2 - 1) is the circle, (x2+y2−1,y)(x^2 + y^2 - 1, y) is the two points (±1,0)(\pm 1, 0), and (x−a,y−b)(x - a, y - b) is the single point (a,b)(a, b). Hilbert's Nullstellensatz (1893) makes the dictionary exact. The maximal ideals of C[x1,…,xn]\C[x_1, \dots, x_n] are exactly the ideals (x1−a1,…,xn−an)(x_1 - a_1, \dots, x_n - a_n) of points. Prime ideals correspond to irreducible varieties, and V(I)=V(J)V(I) = V(J) iff II and JJ have the same radical. Ring theory becomes geometry: this is the starting point of commutative algebra and algebraic geometry. Unique factorisation also has a geometric meaning: in a UFD, every hypersurface is cut out by a single equation.

Topology— The space of primes

Grothendieck made every commutative ring RR into a space. Its points are the prime ideals, forming Spec⁡R\operatorname{Spec} R. Its closed sets are the sets V(I)={P∣P⊇I}V(I) = \{P \mid P \supseteq I\}; this is the Zariski topology. Spec⁡Z\operatorname{Spec} \Z has a closed point for each prime pp, and one generic point (0)(0), whose closure is the whole space. Its proper closed sets are the finite sets of primes. The space is connected, and that is the topological form of the fact that Z\Z has no idempotents other than 00 and 11. In general Spec⁡R\operatorname{Spec} R is disconnected iff R≅R1×R2R \cong R_1 \times R_2 with both factors non-zero. This explains the idempotents counted by the first experiment: Spec⁡(Z/nZ)\operatorname{Spec}(\Z/n\Z) is a finite discrete set with one point for each prime dividing nn.

Number theory— Ideal numbers and the class group

For a number field KK, its ring of integers OK\mathcal{O}_K need not be a UFD. It is always a Dedekind domain: non-zero ideals factor uniquely into prime ideals. The failure of unique factorisation of elements is measured by the class group, the group of ideals modulo principal ideals. It is finite, and its order is the class number. For Q(−5)\Q(\sqrt{-5}) the class number is 22: the non-principal ideal P=(2,1+−5)P = (2, 1 + \sqrt{-5}) has P2=(2)P^2 = (2) principal. By the Baker–Heegner–Stark theorem (1952–1967), the imaginary quadratic fields with class number 11 are exactly Q(−d)\Q(\sqrt{-d}) for d=1,2,3,7,11,19,43,67,163d = 1, 2, 3, 7, 11, 19, 43, 67, 163. Kummer proved Fermat's Last Theorem for every prime pp that does not divide the class number of Q(e2πi/p)\Q(e^{2\pi i/p}) (the regular primes). See algebraic number theory.

Analysis— Rings of functions

Analysts meet rings of functions everywhere. For a compact Hausdorff space XX, the maximal ideals of C(X,R)C(X, \R) are exactly the ideals Mx={f∣f(x)=0}M_x = \{f \mid f(x) = 0\} of points (Gelfand–Kolmogorov, 1939). So XX can be recovered from the ring. For commutative C*-algebras, Gelfand duality makes this an equivalence between compact Hausdorff spaces and rings with extra analytic structure. Locally, the ring of convergent power series C{z}\C\{z\} (germs of holomorphic functions at 00) is a PID with essentially one prime, zz. Every non-zero germ is zkz^k times a unit, where kk is its order of vanishing, so it is a discrete valuation ring. In several variables the ring of germs is still a UFD (a consequence of the Weierstrass preparation theorem), but no longer a PID.

Category theory— The category of rings

Rings and homomorphisms form a category Ring\mathbf{Ring}, with commutative rings forming CRing\mathbf{CRing}. Z\Z is initial: every ring receives exactly one homomorphism from Z\Z, determined by 1↦11 \mapsto 1. The zero ring is terminal. Kernels in the categorical sense are subtle, because Ring\mathbf{Ring} is not additive; ideals are best seen as the kernel pairs of homomorphisms, and quotients as coequalisers (limits and colimits). Spec⁡\operatorname{Spec} is a contravariant functor: a homomorphism f:R→Sf : R \to S pulls prime ideals back to prime ideals, giving a continuous map Spec⁡S→Spec⁡R\operatorname{Spec} S \to \operatorname{Spec} R. The category of Grothendieck's affine schemes is equivalent to CRingop\mathbf{CRing}^{\mathrm{op}} — algebra read backwards as geometry.

Wonder Trails

Wonder Trails

History & global context

History and global context

  • Division and Euclid's lemma. Euclid's Elements (Book VII, c. 300 BCE) contains the Euclidean algorithm and the lemma that a prime dividing a product divides a factor (VII.30). Unique factorisation of integers was first stated and proved explicitly by Carl Friedrich Gauss in the Disquisitiones Arithmeticae (1801).
  • Arithmetic with N\sqrt{N}. Brahmagupta (628 CE) discovered the composition identity (x2−Ny2)(z2−Nw2)=(xz+Nyw)2−N(xw+yz)2(x^2 - Ny^2)(z^2 - Nw^2) = (xz + Nyw)^2 - N(xw + yz)^2, which is the multiplicativity of the norm on Z[N]\Z[\sqrt N]. Bhāskara II (12th century) used it in the chakravāla method for x2−Ny2=1x^2 - Ny^2 = 1. In Baghdad, al-Samawʾal (12th century) developed the arithmetic of polynomials, including long division.
  • New integers. Euler (1770) worked with numbers a+b−2a + b\sqrt{-2} and a+b−3a + b\sqrt{-3}, assuming unique factorisation. Gauss (1832) introduced the Gaussian integers to state biquadratic reciprocity and proved that they factor uniquely.
  • Failure and repair. Lamé's 1847 attempt on Fermat's Last Theorem assumed unique factorisation in cyclotomic integers, and Liouville objected at once. Ernst Kummer had found failures in 1844 and introduced "ideal complex numbers" (1847), which let him prove the theorem for regular primes. Richard Dedekind (1871) replaced ideal numbers by ideals, sets of actual numbers, and proved unique factorisation of ideals. Leopold Kronecker developed a parallel theory of divisors.
  • Abstraction. David Hilbert's Zahlbericht (1897) used the word Zahlring. Abraham Fraenkel gave axioms for rings in 1914. Emmy Noether's Idealtheorie in Ringbereichen (1921) founded modern ring theory, with chain conditions (Noetherian rings) like the one in the proof of Theorem 9. Wolfgang Krull, Emil Artin, B. L. van der Waerden's Moderne Algebra (1930–31) and later Alexander Grothendieck's schemes (1960s) shaped the subject as it is taught today.
Further reading

Further reading

  • David S. Dummit and Richard M. Foote, Abstract Algebra (3rd edition, 2004), chapters 7–9 — rings, ideals, EDs, PIDs and UFDs, including Z[1+−192]\Z\big[\frac{1+\sqrt{-19}}{2}\big].
  • Michael Artin, Algebra (2nd edition, 2011), the chapters on rings and factorisation, including quadratic integers and ideal factorisation.
  • Kenneth Ireland and Michael Rosen, A Classical Introduction to Modern Number Theory (2nd edition, 1990), chapter 1 — unique factorisation in Z\Z, k[x]k[x], Z[i]\Z[i] and Z[ω]\Z[\omega].
  • Ian Stewart and David Tall, Algebraic Number Theory and Fermat's Last Theorem (4th edition, 2015) — the story of Kummer, ideals and class groups.
  • M. F. Atiyah and I. G. Macdonald, Introduction to Commutative Algebra (1969) — the next step: localisation, Noetherian rings, Spec.