Skip to content
The Lumenary
First-year graduateGraduate 150 min

Algebraic number theory

When unique factorisation fails — and how ideals, the class group and the units of a number field measure and repair the failure.

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

Six is two times three — and something else

Fermat claimed in 1640 that an odd prime is a sum of two squares exactly when it leaves remainder 11 on division by 44: 5=12+225 = 1^2 + 2^2, 13=22+3213 = 2^2 + 3^2, but 77 and 1111 are not sums of two squares. In the Gaussian integers Z[i]={a+bi:a,b∈Z}\Z[i] = \{a + bi : a, b \in \Z\} the statement becomes a statement about factorisation: p=a2+b2=(a+bi)(a−bi)p = a^2 + b^2 = (a + bi)(a - bi), so the primes p≡1(mod4)p \equiv 1 \pmod 4 split in Z[i]\Z[i] while those ≡3(mod4)\equiv 3 \pmod 4 stay prime. Since Z[i]\Z[i] has unique factorisation, this can be proved by arithmetic in Z[i]\Z[i].

The method seems to promise a proof of much more. In 1847 Gabriel Lamé announced to the Paris Academy a proof of Fermat's Last Theorem, factoring

xp+yp=(x+y)(x+ζy)(x+ζ2y)⋯(x+ζp−1y),ζ=e2πi/p,x^p + y^p = (x + y)(x + \zeta y)(x + \zeta^2 y) \cdots (x + \zeta^{p-1} y), \qquad \zeta = e^{2\pi i/p},

in Z[ζ]\Z[\zeta]. Joseph Liouville immediately asked whether Z[ζ]\Z[\zeta] has unique factorisation; Ernst Kummer had already shown that for p=23p = 23 it does not. The simplest failure is in Z[−5]\Z[\sqrt{-5}]:

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

and 22, 33, 1±−51 \pm \sqrt{-5} are all irreducible (proved below, and in Lean). Kummer's response was to invent "ideal numbers" — the missing common factors — and Dedekind turned them into ideals. With ideals, factorisation is unique again; the class group measures how far ideals are from being numbers, and the unit group measures the other ambiguity in factorisation.

Algebraic number theory studies number fields — finite extensions of Q\Q — through their rings of integers. This lesson assumes elementary number theory (quadratic residues), field extensions and commutative algebra (integral extensions, Noetherian rings, localisation).

IntuitionH

Ideal numbers

In Z[−5]\Z[\sqrt{-5}], the numbers 22 and 1+−51 + \sqrt{-5} "ought" to have a common factor p\mathfrak{p} with p2=2\mathfrak{p}^2 = 2 — but no element has norm 22 (the norm of a+b−5a + b\sqrt{-5} is a2+5b2a^2 + 5b^2), so no such element exists. Kummer and Dedekind replace the missing gcd by the set of all its "multiples", which does exist:

p=(2,1+−5),q=(3,1+−5),q′=(3,1−−5).\mathfrak{p} = (2, 1 + \sqrt{-5}), \qquad \mathfrak{q} = (3, 1 + \sqrt{-5}), \qquad \mathfrak{q}' = (3, 1 - \sqrt{-5}).

These ideals are prime, not principal, and

(2)=p2,(3)=qq′,(1+−5)=pq,(1−−5)=pq′.(2) = \mathfrak{p}^2, \quad (3) = \mathfrak{q}\mathfrak{q}', \quad (1 + \sqrt{-5}) = \mathfrak{p}\mathfrak{q}, \quad (1 - \sqrt{-5}) = \mathfrak{p}\mathfrak{q}'.

So both factorisations of 66 are regroupings of the single ideal factorisation (6)=p2qq′(6) = \mathfrak{p}^2\mathfrak{q}\mathfrak{q}', exactly as 6=2⋅36 = 2 \cdot 3 regroups 2⋅32 \cdot 3 in Z\Z. The non-principal ideals are the ghosts of the missing numbers. Since p2=(2)\mathfrak{p}^2 = (2) is principal, the ghost p\mathfrak{p} has order 22 in the class group, which here is Z/2\Z/2: every non-principal ideal of Z[−5]\Z[\sqrt{-5}] becomes principal when multiplied by p\mathfrak{p}.

Geometrically, a ring of integers is a lattice: Z[−5]\Z[\sqrt{-5}] is the lattice spanned by 11 and −5\sqrt{-5} in C\C, and its non-zero ideals are sublattices of finite index (the index is the norm of the ideal).

01+√−52
The lattice ℤ[√−5] in the complex plane (all dots) and the ideal 𝔭 = (2, 1 + √−5) (filled dots), the sublattice of a + b√−5 with a ≡ b (mod 2). It has index 2, so N(𝔭) = 2 — but no lattice point has a² + 5b² = 2, so 𝔭 is not principal.
DefinitionsH

Definitions

Definition— number field, algebraic integers, ring of integers

A number field is a field K⊇QK \supseteq \Q with n=[K:Q]<∞n = [K : \Q] < \infty. An element α∈K\alpha \in K is an algebraic integer if it is a root of a monic polynomial with coefficients in Z\Z. The algebraic integers of KK form a subring OK\mathcal{O}_K, the ring of integers (Proposition 1). For K=QK = \Q, OK=Z\mathcal{O}_K = \Z: a rational root of a monic integer polynomial is an integer.

Definition— embeddings, norm, trace

A number field of degree nn has exactly nn field embeddings σ1,…,σn:K→C\sigma_1, \dots, \sigma_n : K \to \C; r1r_1 of them are real (σ(K)⊆R\sigma(K) \subseteq \R) and the others come in r2r_2 complex-conjugate pairs, so n=r1+2r2n = r_1 + 2r_2. The norm and trace of α∈K\alpha \in K are N(α)=∏iσi(α)N(\alpha) = \prod_i \sigma_i(\alpha) and Tr⁡(α)=∑iσi(α)\operatorname{Tr}(\alpha) = \sum_i \sigma_i(\alpha) — the determinant and trace of multiplication by α\alpha on the Q\Q-vector space KK. Both are rational, the norm is multiplicative, and both are integers when α∈OK\alpha \in \mathcal{O}_K. For K=Q(d)K = \Q(\sqrt d), N(a+bd)=a2−db2N(a + b\sqrt d) = a^2 - db^2 and Tr⁡(a+bd)=2a\operatorname{Tr}(a + b\sqrt d) = 2a.

Definition— integral basis and discriminant

An integral basis is a Z\Z-basis ω1,…,ωn\omega_1, \dots, \omega_n of OK\mathcal{O}_K (one exists: OK≅Zn\mathcal{O}_K \cong \Z^n, Proposition 3). The discriminant of KK is dK=det⁡(σi(ωj))2=det⁡(Tr⁡(ωiωj))d_K = \det\big(\sigma_i(\omega_j)\big)^2 = \det\big(\operatorname{Tr}(\omega_i\omega_j)\big), a non-zero integer independent of the choice of integral basis. Its sign is (−1)r2(-1)^{r_2}, and the primes that ramify in KK are exactly those dividing dKd_K.

Definition— Dedekind domain; fractional ideals; class group

A Dedekind domain is a Noetherian, integrally closed domain in which every non-zero prime ideal is maximal. For a domain RR with fraction field KK, a fractional ideal is a non-zero RR-submodule a⊆K\mathfrak{a} \subseteq K with da⊆Rd\mathfrak{a} \subseteq R for some non-zero d∈Rd \in R; products are defined as for ideals. The principal fractional ideals are xRxR, x∈K×x \in K^\times. The ideal class group Cl⁡(K)\operatorname{Cl}(K) of a number field is the group of fractional ideals of OK\mathcal{O}_K modulo the principal ones (a group by Theorem 4), and the class number is hK=#Cl⁡(K)h_K = \#\operatorname{Cl}(K).

Definition— norm of an ideal; splitting of primes

The norm of a non-zero ideal is N(a)=#(OK/a)N(\mathfrak{a}) = \#(\mathcal{O}_K/\mathfrak{a}); it is multiplicative, and N(αOK)=∣N(α)∣N(\alpha\mathcal{O}_K) = |N(\alpha)|. For a rational prime pp, write pOK=p1e1⋯pgegp\mathcal{O}_K = \mathfrak{p}_1^{e_1} \cdots \mathfrak{p}_g^{e_g} (Theorem 4). The exponent eie_i is the ramification index and fi=[OK/pi:Fp]f_i = [\mathcal{O}_K/\mathfrak{p}_i : \mathbb{F}_p] the residue degree; comparing norms gives ∑ieifi=n\sum_i e_i f_i = n. In a quadratic field there are three possibilities: pp splits (pOK=pp′p\mathcal{O}_K = \mathfrak{p}\mathfrak{p}' with p≠p′\mathfrak{p} \neq \mathfrak{p}'), is inert (pOKp\mathcal{O}_K is prime), or ramifies (pOK=p2p\mathcal{O}_K = \mathfrak{p}^2).

Definition— units

The unit group OK×\mathcal{O}_K^\times consists of the elements with inverses in OK\mathcal{O}_K, equivalently those of norm ±1\pm 1. Its torsion subgroup μK\mu_K is the finite cyclic group of roots of unity in KK.

Worked examplesH

Examples

Example— Quadratic fields

For squarefree d≠0,1d \neq 0, 1 and K=Q(d)K = \Q(\sqrt d) (Theorem 2):

ddOK\mathcal{O}_KdKd_Kr1,r2r_1, r_2units
−1-1Z[i]\Z[i]−4-40,10, 1±1,±i\pm 1, \pm i
−3-3Z[ζ3]\Z[\zeta_3], ζ3=−1+−32\zeta_3 = \frac{-1 + \sqrt{-3}}{2}−3-30,10, 1the six roots of unity ±ζ3j\pm\zeta_3^j
−5-5Z[−5]\Z[\sqrt{-5}]−20-200,10, 1±1\pm 1
22Z[2]\Z[\sqrt 2]882,02, 0±(1+2)n\pm(1 + \sqrt 2)^n, n∈Zn \in \Z
55Z[1+52]\Z\big[\frac{1 + \sqrt 5}{2}\big]552,02, 0±φn\pm\varphi^n, φ=1+52\varphi = \frac{1 + \sqrt 5}{2}

The golden ratio φ\varphi is an algebraic integer (φ2=φ+1\varphi^2 = \varphi + 1) although its coordinates are halves: Z[5]\Z[\sqrt 5] is not the whole ring of integers of Q(5)\Q(\sqrt 5).

Example— Factorisations in the Gaussian integers

Z[i]\Z[i] is Euclidean for the norm a2+b2a^2 + b^2, hence a PID and a UFD, with h=1h = 1. Its primes lie over rational primes as follows: 2=−i(1+i)22 = -i(1 + i)^2 ramifies; p≡1(mod4)p \equiv 1 \pmod 4 splits, e.g. 5=(2+i)(2−i)5 = (2 + i)(2 - i) and 13=(3+2i)(3−2i)13 = (3 + 2i)(3 - 2i); p≡3(mod4)p \equiv 3 \pmod 4 is inert, e.g. 33 and 77 stay prime. Fermat's two-squares theorem is exactly the statement that p≡1(mod4)p \equiv 1 \pmod 4 splits.

Example— Factorisations in ℤ[√−5]

Using the Dedekind–Kummer theorem (Theorem 5) with f=x2+5f = x^2 + 5:

  • p=2p = 2: x2+5≡(x+1)2(mod2)x^2 + 5 \equiv (x + 1)^2 \pmod 2, so (2)=p2(2) = \mathfrak{p}^2 with p=(2,1+−5)\mathfrak{p} = (2, 1 + \sqrt{-5}) — ramified.
  • p=5p = 5: x2+5≡x2x^2 + 5 \equiv x^2, so (5)=(−5)2(5) = (\sqrt{-5})^2 — ramified, with a principal prime.
  • p=3p = 3: x2+5≡(x−1)(x+1)(mod3)x^2 + 5 \equiv (x - 1)(x + 1) \pmod 3, so (3)=(3,−5−1)(3,−5+1)(3) = (3, \sqrt{-5} - 1)(3, \sqrt{-5} + 1) — split into non-principal primes (no element has norm 33).
  • p=29p = 29: −5≡24≡132(mod29)-5 \equiv 24 \equiv 13^2 \pmod{29}, so 2929 splits, and here the primes are principal: 29=32+5⋅22=(3+2−5)(3−2−5)29 = 3^2 + 5 \cdot 2^2 = (3 + 2\sqrt{-5})(3 - 2\sqrt{-5}).
  • p=11p = 11: −5-5 is not a square mod 1111, so 1111 is inert.

The first experiment shows the pattern: an odd prime p≠5p \neq 5 splits when p≡1,3,7,9(mod20)p \equiv 1, 3, 7, 9 \pmod{20} and is inert when p≡11,13,17,19(mod20)p \equiv 11, 13, 17, 19 \pmod{20}; among the split primes, the factors are principal exactly for p≡1,9(mod20)p \equiv 1, 9 \pmod{20}.

Example— Cyclotomic fields

For a prime pp and ζ=e2πi/p\zeta = e^{2\pi i/p}, K=Q(ζ)K = \Q(\zeta) has degree p−1p - 1 (the cyclotomic polynomial Φp=xp−1+⋯+1\Phi_p = x^{p-1} + \cdots + 1 is irreducible by Eisenstein's criterion applied to Φp(x+1)\Phi_p(x + 1)), r1=0r_1 = 0, r2=(p−1)/2r_2 = (p - 1)/2, ring of integers Z[ζ]\Z[\zeta] and discriminant (−1)(p−1)/2pp−2(-1)^{(p-1)/2} p^{p-2} (both formalised in Mathlib). The prime pp is totally ramified: (p)=(1−ζ)p−1(p) = (1 - \zeta)^{p-1}. A prime q≠pq \neq p splits into (p−1)/f(p - 1)/f primes, where ff is the order of qq modulo pp. Kummer proved Fermat's Last Theorem for exponent pp whenever pp does not divide the class number of Q(ζp)\Q(\zeta_p) (a regular prime); h(Q(ζp))=1h(\Q(\zeta_p)) = 1 exactly for p≤19p \leq 19 (Montgomery and Uchida, 1971), and 3737 is the first irregular prime.

ProofH

The main theorems

Theorem— Proposition 1 (integrality)

For α\alpha in a field K⊇QK \supseteq \Q the following are equivalent: (a) α\alpha is an algebraic integer; (b) Z[α]\Z[\alpha] is a finitely generated Z\Z-module; (c) α\alpha lies in a subring of KK that is a finitely generated Z\Z-module. Consequently the algebraic integers of KK form a ring. Moreover, an algebraic number is an algebraic integer exactly when its minimal polynomial over Q\Q has integer coefficients.

Proof

(a ⇒ b) If αm=−(cm−1αm−1+⋯+c0)\alpha^m = -(c_{m-1}\alpha^{m-1} + \cdots + c_0) with ci∈Zc_i \in \Z, every power of α\alpha is a Z\Z-combination of 1,α,…,αm−11, \alpha, \dots, \alpha^{m-1}. (b ⇒ c) is clear. (c ⇒ a) Let M=Zm1+⋯+ZmrM = \Z m_1 + \cdots + \Z m_r be a subring containing α\alpha. Then αmi=∑jaijmj\alpha m_i = \sum_j a_{ij} m_j with aij∈Za_{ij} \in \Z, so (αI−A)m=0(\alpha I - A)\mathbf{m} = 0; multiplying by the adjugate gives det⁡(αI−A) mi=0\det(\alpha I - A)\, m_i = 0 for all ii, and since 1∈M1 \in M, det⁡(αI−A)=0\det(\alpha I - A) = 0 — a monic integer equation for α\alpha. If α,β\alpha, \beta are algebraic integers, Z[α,β]\Z[\alpha, \beta] is generated by the finitely many αiβj\alpha^i \beta^j with i,ji, j below the degrees of their equations, and contains α±β\alpha \pm \beta and αβ\alpha\beta, which are therefore integral by (c). For the last statement: if α\alpha is integral with monic integer equation gg, its minimal polynomial ff divides gg; the roots of ff are roots of gg, hence algebraic integers, so the coefficients of ff (symmetric functions of the roots) are algebraic integers and rational, hence integers. The converse is the definition.

∎

Theorem— Theorem 2 (rings of integers of quadratic fields)

Let d≠0,1d \neq 0, 1 be squarefree and K=Q(d)K = \Q(\sqrt d). Then

OK={Z[d],d≡2,3(mod4),Z[1+d2],d≡1(mod4),dK={4d,d≡2,3(mod4),d,d≡1(mod4).\mathcal{O}_K = \begin{cases} \Z[\sqrt d], & d \equiv 2, 3 \pmod 4, \\[2pt] \Z\big[\tfrac{1 + \sqrt d}{2}\big], & d \equiv 1 \pmod 4, \end{cases} \qquad d_K = \begin{cases} 4d, & d \equiv 2, 3 \pmod 4, \\ d, & d \equiv 1 \pmod 4. \end{cases}

Proof

Let α=a+bd\alpha = a + b\sqrt d with a,b∈Qa, b \in \Q and b≠0b \neq 0 (rationals are integral only if integers). Its minimal polynomial is x2−2ax+(a2−db2)x^2 - 2a x + (a^2 - db^2), so by Proposition 1, α∈OK\alpha \in \mathcal{O}_K iff A=2a∈ZA = 2a \in \Z and a2−db2∈Za^2 - db^2 \in \Z. Then 4(a2−db2)=A2−d(2b)2∈4Z4(a^2 - db^2) = A^2 - d(2b)^2 \in 4\Z, so d(2b)2∈Zd(2b)^2 \in \Z. Writing 2b=u/v2b = u/v in lowest terms, v2∣du2v^2 \mid du^2 with gcd⁡(u,v)=1\gcd(u, v) = 1, so v2∣dv^2 \mid d, and v=1v = 1 because dd is squarefree: B=2b∈ZB = 2b \in \Z. The condition is now A2≡dB2(mod4)A^2 \equiv dB^2 \pmod 4. Squares are 00 or 11 mod 44. If d≡2d \equiv 2 or 3(mod4)3 \pmod 4, then A2−dB2≡0A^2 - dB^2 \equiv 0 forces A,BA, B both even, i.e. a,b∈Za, b \in \Z. If d≡1(mod4)d \equiv 1 \pmod 4, the condition is A2≡B2(mod4)A^2 \equiv B^2 \pmod 4, i.e. A≡B(mod2)A \equiv B \pmod 2: α=A−B2+B⋅1+d2\alpha = \frac{A - B}{2} + B\cdot\frac{1 + \sqrt d}{2} with A−B2∈Z\frac{A - B}{2} \in \Z. In both cases the ring is Z[ω]\Z[\omega] with ω=d\omega = \sqrt d or 1+d2\frac{1 + \sqrt d}{2}, and dK=det⁡(1ω1ω′)2=(ω−ω′)2d_K = \det\begin{pmatrix} 1 & \omega \\ 1 & \omega' \end{pmatrix}^2 = (\omega - \omega')^2, which is (2d)2=4d(2\sqrt d)^2 = 4d or (d)2=d(\sqrt d)^2 = d.

∎

Theorem— Proposition 3 (rings of integers are Dedekind domains)

OK\mathcal{O}_K is a free Z\Z-module of rank n=[K:Q]n = [K : \Q], and it is a Dedekind domain. For every non-zero ideal a\mathfrak{a}, OK/a\mathcal{O}_K/\mathfrak{a} is finite.

Proof

Every non-zero ideal meets Z\Z. If 0≠α∈a0 \neq \alpha \in \mathfrak{a}, then N(α)=α⋅∏i≥2σi(α)N(\alpha) = \alpha \cdot \prod_{i \geq 2}\sigma_i(\alpha); the second factor N(α)/αN(\alpha)/\alpha lies in KK and is an algebraic integer (a product of conjugates of α\alpha), hence in OK\mathcal{O}_K. So N(α)∈a∩Z∖{0}N(\alpha) \in \mathfrak{a} \cap \Z \setminus \{0\}.

Freeness (sketch). Choose a Q\Q-basis β1,…,βn\beta_1, \dots, \beta_n of KK inside OK\mathcal{O}_K (multiply any basis by integers) and let D=det⁡(Tr⁡(βiβj))≠0D = \det(\operatorname{Tr}(\beta_i\beta_j)) \neq 0 (the trace form is non-degenerate in characteristic zero). If α=∑cjβj∈OK\alpha = \sum c_j \beta_j \in \mathcal{O}_K with cj∈Qc_j \in \Q, then Tr⁡(αβi)=∑jcjTr⁡(βiβj)∈Z\operatorname{Tr}(\alpha\beta_i) = \sum_j c_j \operatorname{Tr}(\beta_i\beta_j) \in \Z, and Cramer's rule gives cj∈1DZc_j \in \frac{1}{D}\Z. So ⨁Zβj⊆OK⊆1D⨁Zβj\bigoplus \Z\beta_j \subseteq \mathcal{O}_K \subseteq \frac{1}{D}\bigoplus\Z\beta_j, and a subgroup of a free abelian group of rank nn containing a free subgroup of rank nn is free of rank nn.

Dedekind. OK\mathcal{O}_K is Noetherian, since every ideal is a subgroup of Zn\Z^n, hence finitely generated. It is integrally closed in KK: an element of KK integral over OK\mathcal{O}_K is integral over Z\Z (transitivity of integrality, via Proposition 1(c)), so lies in OK\mathcal{O}_K. If a∋m≠0\mathfrak{a} \ni m \neq 0 with m∈Zm \in \Z, then OK/a\mathcal{O}_K/\mathfrak{a} is a quotient of OK/mOK≅(Z/m)n\mathcal{O}_K/m\mathcal{O}_K \cong (\Z/m)^n, so it is finite. Finally, for a non-zero prime p\mathfrak{p}, OK/p\mathcal{O}_K/\mathfrak{p} is a finite integral domain, hence a field (multiplication by a non-zero element is injective, hence surjective), so p\mathfrak{p} is maximal.

∎

Theorem— Theorem 4 (unique factorisation of ideals)

Let RR be a Dedekind domain. Every non-zero proper ideal of RR is a product of non-zero prime ideals, uniquely up to order. The fractional ideals form a free abelian group on the non-zero primes, and for ideals, a⊇b\mathfrak{a} \supseteq \mathfrak{b} if and only if a\mathfrak{a} divides b\mathfrak{b} ("to contain is to divide").

Proof

Let KK be the fraction field. For a non-zero prime p\mathfrak{p} put p−1={x∈K:xp⊆R}\mathfrak{p}^{-1} = \{x \in K : x\mathfrak{p} \subseteq R\}, an RR-module containing RR.

Lemma A: every non-zero ideal contains a product of non-zero primes. If not, since RR is Noetherian there is a maximal counterexample a\mathfrak{a}. It is not prime (a prime contains itself) and not RR, so there are b,c∉ab, c \notin \mathfrak{a} with bc∈abc \in \mathfrak{a}. The ideals a+(b)\mathfrak{a} + (b) and a+(c)\mathfrak{a} + (c) are strictly larger, so contain products of primes, and their product, contained in a+(bc)=a\mathfrak{a} + (bc) = \mathfrak{a}, does too — a contradiction.

Lemma B: for every non-zero ideal a\mathfrak{a}, ap−1⊋a\mathfrak{a}\mathfrak{p}^{-1} \supsetneq \mathfrak{a}. First, p−1≠R\mathfrak{p}^{-1} \neq R: pick 0≠a∈p0 \neq a \in \mathfrak{p} and, by Lemma A, primes with p1⋯pr⊆(a)\mathfrak{p}_1 \cdots \mathfrak{p}_r \subseteq (a) and rr minimal. Since p⊇p1⋯pr\mathfrak{p} \supseteq \mathfrak{p}_1 \cdots \mathfrak{p}_r is prime, it contains some pi\mathfrak{p}_i, say p1\mathfrak{p}_1, and then p1=p\mathfrak{p}_1 = \mathfrak{p} because non-zero primes are maximal. By minimality p2⋯pr⊈(a)\mathfrak{p}_2 \cdots \mathfrak{p}_r \not\subseteq (a) (for r=1r = 1 read this product as RR, and note aa is not a unit), so there is b∈p2⋯pr∖(a)b \in \mathfrak{p}_2 \cdots \mathfrak{p}_r \setminus (a). Then bp⊆(a)b\mathfrak{p} \subseteq (a), i.e. b/a∈p−1b/a \in \mathfrak{p}^{-1}, but b/a∉Rb/a \notin R. Now let a=(α1,…,αm)\mathfrak{a} = (\alpha_1, \dots, \alpha_m) and suppose ap−1=a\mathfrak{a}\mathfrak{p}^{-1} = \mathfrak{a}. For x∈p−1x \in \mathfrak{p}^{-1} write xαi=∑jaijαjx\alpha_i = \sum_j a_{ij}\alpha_j with aij∈Ra_{ij} \in R; the determinant trick gives det⁡(xI−A)=0\det(xI - A) = 0, so xx is integral over RR, hence x∈Rx \in R because RR is integrally closed. Thus p−1=R\mathfrak{p}^{-1} = R, a contradiction.

Lemma C: pp−1=R\mathfrak{p}\mathfrak{p}^{-1} = R. Indeed p⊆pp−1⊆R\mathfrak{p} \subseteq \mathfrak{p}\mathfrak{p}^{-1} \subseteq R, the first inclusion is strict by Lemma B, and p\mathfrak{p} is maximal.

Existence. Suppose some non-zero proper ideal has no factorisation, and let a\mathfrak{a} be a maximal one. Choose a maximal ideal p⊇a\mathfrak{p} \supseteq \mathfrak{a}. Then a⊊ap−1⊆pp−1=R\mathfrak{a} \subsetneq \mathfrak{a}\mathfrak{p}^{-1} \subseteq \mathfrak{p}\mathfrak{p}^{-1} = R. If ap−1=R\mathfrak{a}\mathfrak{p}^{-1} = R then a=ap−1p=p\mathfrak{a} = \mathfrak{a}\mathfrak{p}^{-1}\mathfrak{p} = \mathfrak{p}, which factors; otherwise ap−1\mathfrak{a}\mathfrak{p}^{-1} factors by maximality, ap−1=p1⋯pr\mathfrak{a}\mathfrak{p}^{-1} = \mathfrak{p}_1 \cdots \mathfrak{p}_r, and then a=p1⋯prp\mathfrak{a} = \mathfrak{p}_1 \cdots \mathfrak{p}_r\mathfrak{p}. Either way a contradiction.

Uniqueness. If p1⋯pr=q1⋯qs\mathfrak{p}_1 \cdots \mathfrak{p}_r = \mathfrak{q}_1 \cdots \mathfrak{q}_s, then the prime p1\mathfrak{p}_1 contains some qj\mathfrak{q}_j, hence equals it; multiplying by p1−1\mathfrak{p}_1^{-1} (Lemma C) cancels it, and induction finishes.

Group and divisibility. A fractional ideal a\mathfrak{a} has da⊆Rd\mathfrak{a} \subseteq R, so a=(d)−1(da)\mathfrak{a} = (d)^{-1}(d\mathfrak{a}) is a quotient of products of primes, each invertible by Lemma C. If a⊇b\mathfrak{a} \supseteq \mathfrak{b} then c=a−1b⊆a−1a=R\mathfrak{c} = \mathfrak{a}^{-1}\mathfrak{b} \subseteq \mathfrak{a}^{-1}\mathfrak{a} = R is an ideal with b=ac\mathfrak{b} = \mathfrak{a}\mathfrak{c}; the converse is clear.

∎

The hypothesis "integrally closed" is used exactly once, in Lemma B, and it is necessary: in the non-integrally-closed ring Z[−3]\Z[\sqrt{-3}], the ideal p=(2,1+−3)\mathfrak{p} = (2, 1 + \sqrt{-3}) satisfies p2=2p\mathfrak{p}^2 = 2\mathfrak{p} but p≠(2)\mathfrak{p} \neq (2), so p\mathfrak{p} is not invertible and factorisation is not unique; passing to OK=Z[ζ3]\mathcal{O}_K = \Z[\zeta_3] repairs this.

Theorem— Theorem 5 (Dedekind–Kummer)

Suppose OK=Z[ω]\mathcal{O}_K = \Z[\omega], let f∈Z[x]f \in \Z[x] be the minimal polynomial of ω\omega, and let pp be prime. If fˉ=gˉ1e1⋯gˉrer\bar f = \bar g_1^{e_1} \cdots \bar g_r^{e_r} in Fp[x]\mathbb{F}_p[x] with distinct monic irreducible gˉi\bar g_i, and gi∈Z[x]g_i \in \Z[x] are any monic lifts, then

pOK=p1e1⋯prer,pi=(p,gi(ω)),N(pi)=pdeg⁡gi,p\mathcal{O}_K = \mathfrak{p}_1^{e_1} \cdots \mathfrak{p}_r^{e_r}, \qquad \mathfrak{p}_i = (p, g_i(\omega)), \qquad N(\mathfrak{p}_i) = p^{\deg g_i},

with the pi\mathfrak{p}_i distinct primes. In particular, for a quadratic field and an odd prime p∤dp \nmid d, pp splits if (dp)=1\left(\frac{d}{p}\right) = 1 and is inert if (dp)=−1\left(\frac{d}{p}\right) = -1; the ramified primes are those dividing dKd_K.

Proof

Reduction of coefficients gives OK/pOK=Z[x]/(f,p)≅Fp[x]/(fˉ)\mathcal{O}_K/p\mathcal{O}_K = \Z[x]/(f, p) \cong \mathbb{F}_p[x]/(\bar f). The primes of OK\mathcal{O}_K containing pp correspond to the primes of this ring, i.e. to the ideals (gˉi)(\bar g_i); explicitly, pi\mathfrak{p}_i is the kernel of OK→Fp[x]/(gˉi)\mathcal{O}_K \to \mathbb{F}_p[x]/(\bar g_i), ω↦x\omega \mapsto x, which is (p,gi(ω))(p, g_i(\omega)), with residue field of degree deg⁡gi\deg g_i, so N(pi)=pdeg⁡giN(\mathfrak{p}_i) = p^{\deg g_i}. Next, ∏ipiei⊆(p)+(∏igi(ω)ei)\prod_i \mathfrak{p}_i^{e_i} \subseteq (p) + \big(\prod_i g_i(\omega)^{e_i}\big), and ∏igiei≡f(modp)\prod_i g_i^{e_i} \equiv f \pmod p with f(ω)=0f(\omega) = 0, so ∏igi(ω)ei∈(p)\prod_i g_i(\omega)^{e_i} \in (p). Hence ∏piei⊆(p)\prod \mathfrak{p}_i^{e_i} \subseteq (p), i.e. (p)(p) divides ∏piei\prod\mathfrak{p}_i^{e_i} (Theorem 4). Comparing norms, N(pOK)=pnN(p\mathcal{O}_K) = p^n and N(∏piei)=p∑eideg⁡gi=pdeg⁡f=pnN(\prod \mathfrak{p}_i^{e_i}) = p^{\sum e_i \deg g_i} = p^{\deg f} = p^n, so the two ideals are equal. For a quadratic field with ω=d\omega = \sqrt d (or 1+d2\frac{1 + \sqrt d}{2}, whose minimal polynomial has discriminant dd), fˉ\bar f has two distinct roots, no roots or a double root according as its discriminant is a non-zero square, a non-square or zero modulo pp.

∎

(The theorem holds more generally when pp does not divide the index [OK:Z[ω]][\mathcal{O}_K : \Z[\omega]]; Mathlib proves this form.) So in Q(−5)\Q(\sqrt{-5}): pp splits iff −5-5 is a non-zero square mod pp, and by quadratic reciprocity this depends only on p mod 20p \bmod 20 — the residues found by the first experiment.

Theorem— Theorem 6 (UFD ⇔ PID for Dedekind domains)

A Dedekind domain is a unique factorisation domain if and only if it is a principal ideal domain. Hence OK\mathcal{O}_K has unique factorisation of elements if and only if hK=1h_K = 1.

Proof

A PID is a UFD (standard). Conversely let RR be a Dedekind UFD and p\mathfrak{p} a non-zero prime ideal. Pick 0≠a∈p0 \neq a \in \mathfrak{p}; aa is not a unit, so it factors into irreducibles, and since p\mathfrak{p} is prime one irreducible factor π\pi lies in p\mathfrak{p}. In a UFD irreducibles are prime, so (π)(\pi) is a non-zero prime ideal; being non-zero it is maximal, and (π)⊆p≠R(\pi) \subseteq \mathfrak{p} \neq R forces (π)=p(\pi) = \mathfrak{p}. So every non-zero prime is principal, and by Theorem 4 so is every non-zero ideal, a product of primes.

∎

In Z[−5]\Z[\sqrt{-5}] the element 22 is irreducible but not prime (formalised below), so Z[−5]\Z[\sqrt{-5}] is not a UFD and hQ(−5)>1h_{\Q(\sqrt{-5})} > 1.

Theorem— Theorem 7 (Minkowski's bound; finiteness of the class group)

Every ideal class of a number field KK of degree nn contains an integral ideal of norm at most

MK=n!nn(4π)r2∣dK∣.M_K = \frac{n!}{n^n}\left(\frac{4}{\pi}\right)^{r_2}\sqrt{|d_K|}.

Since there are only finitely many ideals of bounded norm, the class group is finite. Moreover ∣dK∣>1|d_K| > 1 for K≠QK \neq \Q.

Proof sketch. The embeddings map OK\mathcal{O}_K to a lattice in Rr1×Cr2≅Rn\R^{r_1} \times \C^{r_2} \cong \R^n of covolume 2−r2∣dK∣2^{-r_2}\sqrt{|d_K|}, and an ideal a\mathfrak{a} to a sublattice of covolume 2−r2∣dK∣ N(a)2^{-r_2}\sqrt{|d_K|}\,N(\mathfrak{a}). Minkowski's convex body theorem — a convex, centrally symmetric region of volume greater than 2n2^n times the covolume contains a non-zero lattice point — applied to a suitably scaled region {∑∣xi∣≤t}\{\sum|x_i| \leq t\} yields 0≠α∈a0 \neq \alpha \in \mathfrak{a} with ∣N(α)∣≤MKN(a)|N(\alpha)| \leq M_K N(\mathfrak{a}) (using the AM–GM inequality). Given a class, choose a\mathfrak{a} in the inverse class with a\mathfrak{a} integral; then αa−1\alpha\mathfrak{a}^{-1} is an integral ideal in the original class with norm ∣N(α)∣/N(a)≤MK|N(\alpha)|/N(\mathfrak{a}) \leq M_K. An ideal of norm mm contains mm, and OK/mOK\mathcal{O}_K/m\mathcal{O}_K is finite, so there are finitely many such ideals. Since MK≥1M_K \geq 1 (every class contains an ideal of norm ≥1\geq 1), ∣dK∣≥nnn!(π/4)n/2>1\sqrt{|d_K|} \geq \frac{n^n}{n!}(\pi/4)^{n/2} > 1 for n≥2n \geq 2. Full proofs: Neukirch, Chapter I, §5–6; Marcus, Chapter 5. □\square

Example— Computing class groups with the Minkowski bound

  • Q(i)\Q(i): M=24⋅4π⋅2=4π<2M = \frac{2}{4}\cdot\frac{4}{\pi}\cdot 2 = \frac{4}{\pi} < 2, so every class contains the ideal (1)(1): h=1h = 1.
  • Q(−3)\Q(\sqrt{-3}): M=12⋅4π3≈1.10M = \frac{1}{2}\cdot\frac{4}{\pi}\sqrt 3 \approx 1.10: h=1h = 1. (Mathlib proves exactly this, as IsCyclotomicExtension.Rat.three_pid.)
  • Q(2)\Q(\sqrt 2): M=128≈1.41M = \frac{1}{2}\sqrt 8 \approx 1.41: h=1h = 1.
  • Q(−5)\Q(\sqrt{-5}): M=12⋅4π20≈2.85M = \frac{1}{2}\cdot\frac{4}{\pi}\sqrt{20} \approx 2.85, so every class contains an ideal of norm 11 or 22. The only ideal of norm 22 is p=(2,1+−5)\mathfrak{p} = (2, 1 + \sqrt{-5}) (since (2)=p2(2) = \mathfrak{p}^2), which is not principal because a2+5b2=2a^2 + 5b^2 = 2 has no solution. So Cl⁡={[(1)],[p]}≅Z/2\operatorname{Cl} = \{[(1)], [\mathfrak{p}]\} \cong \Z/2, and h=2h = 2.

Theorem— Theorem 8 (Dirichlet's unit theorem)

OK×≅μK×Zr1+r2−1\mathcal{O}_K^\times \cong \mu_K \times \Z^{r_1 + r_2 - 1}: there are fundamental units ε1,…,εr\varepsilon_1, \dots, \varepsilon_r, r=r1+r2−1r = r_1 + r_2 - 1, such that every unit is uniquely ζε1n1⋯εrnr\zeta\varepsilon_1^{n_1} \cdots \varepsilon_r^{n_r} with ζ∈μK\zeta \in \mu_K and ni∈Zn_i \in \Z.

Proof for quadratic fields. If KK is imaginary quadratic (r1=0r_1 = 0, r2=1r_2 = 1, r=0r = 0), a unit a+bωa + b\omega has norm 11, and NN is a positive definite quadratic form, so there are finitely many units: they are roots of unity, ±1\pm 1 except for Q(i)\Q(i) and Q(−3)\Q(\sqrt{-3}). If K=Q(d)K = \Q(\sqrt d) is real (r=1r = 1), view K⊆RK \subseteq \R. For C>1C > 1, a unit uu with 1<u<C1 < u < C has conjugate u′=±1/uu' = \pm 1/u, so ∣u′∣<1|u'| < 1; then u+u′u + u' and u−u′u - u' are bounded, which bounds the coordinates of uu in the lattice OK\mathcal{O}_K, so there are finitely many such units. If there is at least one unit >1> 1 (below), let ε\varepsilon be the smallest. Any unit u>0u > 0 satisfies εn≤u<εn+1\varepsilon^n \leq u < \varepsilon^{n+1} for some n∈Zn \in \Z, and uε−nu\varepsilon^{-n} is a unit in [1,ε)[1, \varepsilon), hence equal to 11. So the units are ±εn\pm\varepsilon^n. That a unit >1> 1 exists is the solvability of Pell's equation x2−dy2=1x^2 - dy^2 = 1 in positive integers (Lagrange, 1768; proved in Mathlib as Pell.exists_of_not_isSquare); for d=2d = 2, 1+21 + \sqrt 2 is a unit of infinite order (formalised below). □\square

The general case (sketch): the logarithmic embedding ℓ(u)=(log⁡∣σ(u)∣)σ∈Rr1+r2\ell(u) = (\log|\sigma(u)|)_\sigma \in \R^{r_1 + r_2} (one coordinate per real embedding and per pair of complex ones, the latter doubled) is a homomorphism into the hyperplane ∑=0\sum = 0 (because ∣N(u)∣=1|N(u)| = 1). Its kernel is finite — algebraic integers all of whose conjugates have absolute value 11 are roots of unity (Kronecker) — and its image is discrete, because a bounded region contains finitely many algebraic integers with bounded conjugates. The hard step is that the image spans the hyperplane, again by Minkowski's theorem. See Neukirch, Chapter I, §7. Mathlib formalises the full theorem (below).

Explore

Explore: units on hyperbolas, roots of unity on circles

Units of Z[2]\Z[\sqrt 2]. A unit a+b2a + b\sqrt 2 has norm a2−2b2=±1a^2 - 2b^2 = \pm 1, so the points (a,b)(a, b) lie on the two hyperbolas below. Multiplying by the fundamental unit 1+21 + \sqrt 2 sends (a,b)↦(a+2b,a+b)(a, b) \mapsto (a + 2b, a + b), hopping between the hyperbolas: (1,0)→(1,1)→(3,2)→(7,5)→(17,12)→⋯(1, 0) \to (1, 1) \to (3, 2) \to (7, 5) \to (17, 12) \to \cdots, with norms alternating +1,−1+1, -1. On the logarithmic scale these powers are evenly spaced — a rank-one lattice, as Dirichlet's theorem says. The points (3,2)(3, 2), (17,12)(17, 12), … also give the best rational approximations 3/23/2, 17/1217/12, 99/7099/70 to 2\sqrt 2.

The units a + b√2 of ℤ[√2] (a, b ≥ 0)

Every unit is ±(1 + √2)ⁿ: the powers alternate between norm +1 and norm −1 and approach the asymptote b = a/√2.

11+√2(1+√2)²(1+√2)³(1+√2)⁴
  • a² − 2b² = 1
  • a² − 2b² = −1
  • b = a/√2
  • a² − 2b² = 1: y = 0
  • a² − 2b² = −1: y = 1
  • b = a/√2: y = 0.7071

Cyclotomic integers. The pp-th roots of unity are the vertices of a regular pp-gon; Z[ζp]\Z[\zeta_p] is the ring of integer combinations of them. Change nn: for n=3n = 3 you get Z[ζ3]\Z[\zeta_3] (class number 11), for n=5n = 5 the ring Z[ζ5]\Z[\zeta_5] (class number 11, also proved in Mathlib), and Kummer's theory says what happens for larger primes: the class number of Q(ζ23)\Q(\zeta_{23}) is 33.

The fifth roots of unity

ℤ[ζ₅] has ζ = e^{2πi/5} as a generator; its four embeddings into ℂ send ζ to the four non-trivial vertices.

Try
72°w₀w₁w₂w₃w₄c

Drag the points, or focus one with Tab and use the arrow keys (hold Shift for small steps).

c =+i

Solutions of wⁿ = c for n = 5:

  • w₀ = 1
  • w₁ = 0.309 + 0.951i
  • w₂ = −0.809 + 0.588i
  • w₃ = −0.809 − 0.588i
  • w₄ = 0.309 − 0.951i

All roots lie on the circle of radius |c|^(1/n) ≈ 1.

Neighbouring roots are 72° apart: 360° ÷ 5.

w₀ is the principal root, at the angle (arg c)/n; the others follow by equal turns.

Because c = 1, these are the roots of unity of order 5.

The roots add up to 0, so the regular polygon is balanced around the origin.

Formal mathematicsF

Algebraic number theory in Lean and Mathlib

We first prove, from scratch, everything about Z[−5]\Z[\sqrt{-5}] used in the lesson, working in Mathlib's Zsqrtd (-5) (written ℤ√(-5)), whose norm is multiplicative. The norm, the fact that the ring is a domain (needed to talk about unique factorisation at all), and the key arithmetic fact that nothing has norm 22:

norm_sqrt_neg_fiveLean 4Proved here from basic factsFormally verified
/-- **The norm on `ℤ[√−5]`.** `N(a + b√−5) = (a + b√−5)(a − b√−5) = a² + 5b²`. In Mathlib the norm
of `z : ℤ√d` is `z.re * z.re - d * z.im * z.im`, multiplicative by `Zsqrtd.norm_mul`. -/
theorem norm_sqrt_neg_five (z : ℤ√(-5)) : z.norm = z.re ^ 2 + 5 * z.im ^ 2 := by
  rw [Zsqrtd.norm_def]
  ring
Axioms used: propext, Quot.soundformal/Lumenary/AlgebraicNumberTheory.leanTry it in the Lean web editor
isDomain_sqrt_neg_fiveLean 4Formally verified
/-- **`ℤ[√−5]` is an integral domain.** If `xy = 0` then `N(x) N(y) = N(xy) = 0`, so `N(x) = 0` or
`N(y) = 0`; and `N(a + b√−5) = a² + 5b² = 0` forces `a = b = 0` (Mathlib: `Zsqrtd.norm_eq_zero`,
since `−5` is not a square). -/
instance isDomain_sqrt_neg_five : IsDomain (ℤ√(-5)) := by
  have hns : ∀ n : ℤ, (-5 : ℤ) ≠ n * n := fun n h => by nlinarith [mul_self_nonneg n]
  have : NoZeroDivisors (ℤ√(-5)) :=
    ⟨fun {x y} hxy => by
      have h := congrArg Zsqrtd.norm hxy
      rw [Zsqrtd.norm_mul, Zsqrtd.norm_zero, mul_eq_zero] at h
      rcases h with h | h
      · exact Or.inl ((Zsqrtd.norm_eq_zero hns x).mp h)
      · exact Or.inr ((Zsqrtd.norm_eq_zero hns y).mp h)⟩
  exact NoZeroDivisors.to_isDomain _
Axioms used: propext, Classical.choice, Quot.soundformal/Lumenary/AlgebraicNumberTheory.leanTry it in the Lean web editor
norm_ne_twoLean 4Proved here from basic factsFormally verified
/-- **No element of `ℤ[√−5]` has norm `2`.** If `a² + 5b² = 2` then `b = 0` (otherwise the left
side is at least `5`), and `a² = 2` has no integer solution. -/
theorem norm_ne_two (z : ℤ√(-5)) : z.norm ≠ 2 := by
  rw [norm_sqrt_neg_five]
  intro h
  have hb : z.im = 0 := by nlinarith [sq_nonneg z.re, sq_nonneg z.im]
  rw [hb] at h
  have ha : z.re ^ 2 = 2 := by linarith
  have h1 : z.re ≤ 1 := by nlinarith [sq_nonneg (z.re - 2)]
  have h2 : -1 ≤ z.re := by nlinarith [sq_nonneg (z.re + 2)]
  interval_cases z.re <;> norm_num at ha
Axioms used: propext, Classical.choice, Quot.soundformal/Lumenary/AlgebraicNumberTheory.leanTry it in the Lean web editor

Then 22 is irreducible but not prime, so Z[−5]\Z[\sqrt{-5}] is not a UFD:

two_irreducibleLean 4Proved here from basic factsFormally verified
/-- **`2` is irreducible in `ℤ[√−5]`.** It is not a unit, since `N(2) = 4 ≠ 1`. If `2 = xy` then
`N(x) N(y) = 4` with both norms non-negative; `N(x) = 2` is impossible, so `N(x) = 1` or
`N(y) = 1`, and an element of norm `1` is a unit (Mathlib: `Zsqrtd.norm_eq_one_iff'`). -/
theorem two_irreducible : Irreducible (2 : ℤ√(-5)) := by
  have hd : (-5 : ℤ) ≤ 0 := by norm_num
  have hnorm2 : (2 : ℤ√(-5)).norm = 4 := by
    rw [norm_sqrt_neg_five]; simp
  refine ⟨fun hu => ?_, fun x y hxy => ?_⟩
  · have := (Zsqrtd.norm_eq_one_iff' hd 2).mpr hu
    rw [hnorm2] at this
    norm_num at this
  · have h := congrArg Zsqrtd.norm hxy
    rw [Zsqrtd.norm_mul, hnorm2] at h
    have hx0 := Zsqrtd.norm_nonneg hd x
    have hy0 := Zsqrtd.norm_nonneg hd y
    have hx2 := norm_ne_two x
    have hypos : 0 < y.norm := by
      rcases hy0.lt_or_eq with h' | h'
      · exact h'
      · rw [← h'] at h; norm_num at h
    have hxle : x.norm ≤ 4 := by nlinarith
    have hxpos : 0 < x.norm := by
      rcases hx0.lt_or_eq with h' | h'
      · exact h'
      · rw [← h'] at h; norm_num at h
    interval_cases hn : x.norm
    · exact Or.inl ((Zsqrtd.norm_eq_one_iff' hd x).mp hn)
    · exact absurd rfl hx2
    · omega
    · right
      exact (Zsqrtd.norm_eq_one_iff' hd y).mp (by omega)
Axioms used: propext, Classical.choice, Quot.soundformal/Lumenary/AlgebraicNumberTheory.leanTry it in the Lean web editor
two_not_primeLean 4Proved here from basic factsFormally verified
/-- **…but `2` is not prime in `ℤ[√−5]`.** `2` divides `(1 + √−5)(1 − √−5) = 6 = 2 · 3`, yet it
divides neither factor: `1 ± √−5 = 2(a + b√−5)` would give `1 = 2a`. -/
theorem two_not_prime : ¬ Prime (2 : ℤ√(-5)) := by
  intro hp
  have hdvd : (2 : ℤ√(-5)) ∣ ⟨1, 1⟩ * ⟨1, -1⟩ :=
    ⟨3, by ext <;> simp [Zsqrtd.re_mul, Zsqrtd.im_mul]⟩
  rcases hp.dvd_or_dvd hdvd with ⟨c, hc⟩ | ⟨c, hc⟩
  · have := congrArg Zsqrtd.re hc
    simp [Zsqrtd.re_mul] at this
    omega
  · have := congrArg Zsqrtd.re hc
    simp [Zsqrtd.re_mul] at this
    omega
Axioms used: propext, Quot.soundformal/Lumenary/AlgebraicNumberTheory.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 and not prime. Concretely, `6 = 2 · 3 = (1 + √−5)(1 − √−5)` are
two factorisations into irreducibles that do not match up to units. (The *ideals* still factor
uniquely: `(6) = 𝔭₂² 𝔭₃ 𝔭₃'` — see the lesson.) -/
theorem not_ufd : ¬ UniqueFactorizationMonoid (ℤ√(-5)) := by
  intro h
  exact two_not_prime (UniqueFactorizationMonoid.irreducible_iff_prime.mp two_irreducible)
Axioms used: propext, Classical.choice, Quot.soundformal/Lumenary/AlgebraicNumberTheory.leanTry it in the Lean web editor

The two cases of Dirichlet's unit theorem for quadratic rings: finitely many units for Z[−5]\Z[\sqrt{-5}], infinitely many for Z[2]\Z[\sqrt 2]:

units_sqrt_neg_fiveLean 4Proved here from basic factsFormally verified
/-- **The units of `ℤ[√−5]` are `±1`** — the imaginary quadratic case of Dirichlet's unit theorem
(rank `r₁ + r₂ − 1 = 0 + 1 − 1 = 0`). A unit has norm `1`, and `a² + 5b² = 1` forces `b = 0` and
`a = ±1`. -/
theorem units_sqrt_neg_five (z : ℤ√(-5)) : IsUnit z ↔ z = 1 ∨ z = -1 := by
  have hd : (-5 : ℤ) ≤ 0 := by norm_num
  constructor
  · intro hu
    have h := (Zsqrtd.norm_eq_one_iff' hd z).mpr hu
    rw [norm_sqrt_neg_five] at h
    have hb : z.im = 0 := by nlinarith [sq_nonneg z.re, sq_nonneg z.im]
    rw [hb] at h
    have ha : z.re ^ 2 = 1 := by linarith
    have h1 : z.re ≤ 1 := by nlinarith [sq_nonneg (z.re - 1)]
    have h2 : -1 ≤ z.re := by nlinarith [sq_nonneg (z.re + 1)]
    interval_cases hre : z.re
    · right; ext <;> simp [hre, hb]
    · norm_num at ha
    · left; ext <;> simp [hre, hb]
  · rintro (rfl | rfl)
    · exact isUnit_one
    · exact isUnit_one.neg
Axioms used: propext, Classical.choice, Quot.soundformal/Lumenary/AlgebraicNumberTheory.leanTry it in the Lean web editor
one_add_sqrt_two_unitLean 4Proved here from basic factsFormally verified
/-- **`1 + √2` is a unit of `ℤ[√2]`**: `(1 + √2)(−1 + √2) = 2 − 1 = 1`. Units of `ℤ[√2]` are the
elements of norm `a² − 2b² = ±1`, i.e. solutions of Pell-type equations. -/
theorem one_add_sqrt_two_unit : IsUnit (⟨1, 1⟩ : ℤ√2) :=
  IsUnit.of_mul_eq_one ⟨-1, 1⟩ (by ext <;> simp [Zsqrtd.re_mul, Zsqrtd.im_mul])
Axioms used: propextformal/Lumenary/AlgebraicNumberTheory.leanTry it in the Lean web editor
one_add_sqrt_two_infinite_orderLean 4Proved here from basic factsFormally verified
/-- **`1 + √2` has infinite order**, so `ℤ[√2]` has infinitely many units — the real quadratic
case of Dirichlet's unit theorem (rank `r₁ + r₂ − 1 = 2 + 0 − 1 = 1`). Proof: multiplying
`a + b√2` by `1 + √2` gives `(a + 2b) + (a + b)√2`, so by induction every power
`(1 + √2)ⁿ⁺¹` has both coordinates at least `1`; but `1 = 1 + 0√2`. -/
theorem one_add_sqrt_two_infinite_order (n : ℕ) : (⟨1, 1⟩ : ℤ√2) ^ (n + 1) ≠ 1 := by
  have key : ∀ m : ℕ, 1 ≤ ((⟨1, 1⟩ : ℤ√2) ^ (m + 1)).re ∧ 1 ≤ ((⟨1, 1⟩ : ℤ√2) ^ (m + 1)).im := by
    intro m
    induction m with
    | zero => simp
    | succ m ih =>
      rw [pow_succ, Zsqrtd.re_mul, Zsqrtd.im_mul]
      obtain ⟨h1, h2⟩ := ih
      constructor <;> simp <;> omega
  intro h
  have := (key n).2
  rw [h] at this
  simp at this
Axioms used: propext, Quot.soundformal/Lumenary/AlgebraicNumberTheory.leanTry it in the Lean web editor

Mathlib's number field library proves the general theory. Proposition 3 and Theorem 4:

ring_of_integers_dedekindLean 4Applies a library theoremFormally verified
/-- **The ring of integers of a number field is a Dedekind domain**: Noetherian, integrally closed
and of dimension one. Mathlib: an instance in `Mathlib.NumberTheory.NumberField.Basic`, proved
from the fact that `𝓞 K` is the integral closure of the Dedekind domain `ℤ` in `K`. -/
theorem ring_of_integers_dedekind (K : Type*) [Field K] [NumberField K] :
    IsDedekindDomain (𝓞 K) :=
  inferInstance
Axioms used: propext, Classical.choice, Quot.soundformal/Lumenary/AlgebraicNumberTheory.leanTry it in the Lean web editor
ideals_factor_uniquelyLean 4Applies a library theoremFormally verified
/-- **Unique factorisation of ideals.** In a Dedekind domain the non-zero ideals form a unique
factorisation monoid: every non-zero ideal is a product of prime ideals, uniquely up to order.
Mathlib: `Ideal.uniqueFactorizationMonoid`. -/
theorem ideals_factor_uniquely (K : Type*) [Field K] [NumberField K] :
    UniqueFactorizationMonoid (Ideal (𝓞 K)) :=
  inferInstance
Axioms used: propext, Classical.choice, Quot.soundformal/Lumenary/AlgebraicNumberTheory.leanTry it in the Lean web editor

Theorem 7 and Theorem 6 (in the form "class number one ⇔ PID"):

class_group_finiteLean 4Applies a library theoremFormally verified
/-- **The class group of a number field is finite.** Mathlib proves it by showing that every
ideal class contains an ideal of bounded norm (`ClassGroup.fintypeOfAdmissibleOfFinite`); the
lesson's proof uses the Minkowski bound instead (Mathlib:
`NumberField.exists_ideal_in_class_of_norm_le`). -/
theorem class_group_finite (K : Type*) [Field K] [NumberField K] :
    Finite (ClassGroup (𝓞 K)) :=
  inferInstance
Axioms used: propext, Classical.choice, Quot.soundformal/Lumenary/AlgebraicNumberTheory.leanTry it in the Lean web editor
class_number_one_iffLean 4Applies a library theoremFormally verified
/-- **Class number one ⇔ principal ideal domain** (and, for Dedekind domains, ⇔ unique
factorisation domain, as proved in the lesson). Mathlib: `NumberField.classNumber_eq_one_iff`. -/
theorem class_number_one_iff (K : Type*) [Field K] [NumberField K] :
    classNumber K = 1 ↔ IsPrincipalIdealRing (𝓞 K) :=
  classNumber_eq_one_iff
Axioms used: propext, Classical.choice, Quot.soundformal/Lumenary/AlgebraicNumberTheory.leanTry it in the Lean web editor

Theorem 8, with the rank:

dirichlet_unit_theoremLean 4Applies a library theoremFormally verified
/-- **Dirichlet's unit theorem.** There are units `ε₁, …, ε_r` (a fundamental system) such that
every unit of `𝓞 K` is uniquely `ζ ε₁^{n₁} ⋯ ε_r^{n_r}` with `ζ` a root of unity and `nᵢ ∈ ℤ`;
here `r = r₁ + r₂ − 1` is one less than the number of infinite places. Mathlib:
`NumberField.Units.exist_unique_eq_mul_prod`. -/
theorem dirichlet_unit_theorem (K : Type*) [Field K] [NumberField K] (x : (𝓞 K)ˣ) :
    ∃! ζe : Units.torsion K × (Fin (Units.rank K) → ℤ),
      x = ζe.1 * ∏ i, (Units.fundSystem K i) ^ (ζe.2 i) :=
  Units.exist_unique_eq_mul_prod K x
Axioms used: propext, Classical.choice, Quot.soundformal/Lumenary/AlgebraicNumberTheory.leanTry it in the Lean web editor
unit_rankLean 4Applies a library theoremFormally verified
/-- **The rank of the unit group is `r₁ + r₂ − 1`.** Mathlib defines `Units.rank K` as the number of
infinite places minus one, and counts the infinite places as `r₁ + r₂`
(`InfinitePlace.card_eq_nrRealPlaces_add_nrComplexPlaces`). -/
theorem unit_rank (K : Type*) [Field K] [NumberField K] :
    Units.rank K = InfinitePlace.nrRealPlaces K + InfinitePlace.nrComplexPlaces K - 1 := by
  rw [Units.rank, InfinitePlace.card_eq_nrRealPlaces_add_nrComplexPlaces]
Axioms used: propext, Classical.choice, Quot.soundformal/Lumenary/AlgebraicNumberTheory.leanTry it in the Lean web editor

Cyclotomic integers, and Fermat's two-squares theorem (the splitting of p≡1(mod4)p \equiv 1 \pmod 4 in Z[i]\Z[i]):

cyclotomic_integersLean 4Applies a library theoremFormally verified
/-- **The ring of integers of `ℚ(ζ_p)` is `ℤ[ζ_p]`.** For a prime `p` and a primitive `p`-th root of
unity `ζ`, the integral closure of `ℤ` in `ℚ(ζ)` is generated by `ζ`. Mathlib:
`IsCyclotomicExtension.Rat.isIntegralClosure_adjoin_singleton_of_prime` (proved via the
Eisenstein criterion for the minimal polynomial of `ζ − 1`). -/
theorem cyclotomic_integers {p : ℕ} [Fact p.Prime] {K : Type*} [Field K] [CharZero K]
    [IsCyclotomicExtension {p} ℚ K] {ζ : K} (hζ : IsPrimitiveRoot ζ p) :
    IsIntegralClosure (Algebra.adjoin ℤ ({ζ} : Set K)) ℤ K :=
  IsCyclotomicExtension.Rat.isIntegralClosure_adjoin_singleton_of_prime hζ
Axioms used: propext, Classical.choice, Quot.soundformal/Lumenary/AlgebraicNumberTheory.leanTry it in the Lean web editor
sum_of_two_squaresLean 4Applies a library theoremFormally verified
/-- **Fermat's two-squares theorem**: a prime `p` with `p mod 4 ≠ 3` is a sum of two squares.
In the lesson's language: such a `p` splits in `ℤ[i]` as `(a + bi)(a − bi)`. Mathlib:
`Nat.Prime.sq_add_sq` (proved via the Gaussian integers, a Euclidean domain). -/
theorem sum_of_two_squares {p : ℕ} [Fact p.Prime] (hp : p % 4 ≠ 3) :
    ∃ a b : ℕ, a ^ 2 + b ^ 2 = p :=
  Nat.Prime.sq_add_sq hp
Axioms used: propext, Classical.choice, Quot.soundformal/Lumenary/AlgebraicNumberTheory.leanTry it in the Lean web editor

What is and is not formalised. Proved here: all the arithmetic of Z[−5]\Z[\sqrt{-5}] in the lesson (domain, irreducibility and non-primality of 22, not a UFD, units ±1\pm 1) and the infinitude of the units of Z[2]\Z[\sqrt 2]. From Mathlib: rings of integers are Dedekind, unique factorisation of ideals, finiteness of the class group, h=1⇔h = 1 \Leftrightarrow PID, Dirichlet's unit theorem with rank r1+r2−1r_1 + r_2 - 1, OQ(ζp)=Z[ζp]\mathcal{O}_{\Q(\zeta_p)} = \Z[\zeta_p], and the two-squares theorem. Not formalised here: Theorem 2 (Mathlib does not yet have a packaged computation of the rings of integers of all quadratic fields), the computation h(Q(−5))=2h(\Q(\sqrt{-5})) = 2 (we prove h>1h > 1 via "not a UFD", but not h=2h = 2), and the Dedekind–Kummer theorem, which Mathlib proves as KummerDedekind.normalizedFactors_ideal_map_eq_normalizedFactors_min_poly_mk_map but which we do not restate.

ComputationC

Splitting primes and counting classes

The first experiment factors every prime below 200200 in Q(i)\Q(i), Q(−5)\Q(\sqrt{-5}), Q(2)\Q(\sqrt 2) and Q(5)\Q(\sqrt 5) by Theorem 5, checks the answer against the Kronecker symbol (dKp)\left(\frac{d_K}{p}\right), and then looks at the split primes of Q(−5)\Q(\sqrt{-5}): the prime factors are principal exactly when p=a2+5b2p = a^2 + 5b^2, which happens for p≡1,9(mod20)p \equiv 1, 9 \pmod{20} — the class group made visible. About half the primes split in each field, an instance of the Chebotarev density theorem.

Splitting of primes in quadratic fieldsPythonExact computationExhaustive finite checkComputationally tested
"""How rational primes split in quadratic fields, and the class group at work.

For K = Q(sqrt d) the ring of integers is Z[w] with w = sqrt d (d = 2, 3 mod 4)
or w = (1 + sqrt d)/2 (d = 1 mod 4), and the Dedekind-Kummer theorem says
that p splits, is inert or ramifies according as the minimal polynomial of w
has two, no or one (double) root modulo p. We compute this for every prime
p < 200 in four fields and compare with the prediction from the Kronecker
symbol (D/p) of the discriminant D. Then, in Q(sqrt -5), whose class number
is 2, we ask which split primes have *principal* prime factors: exactly those
with p = a^2 + 5b^2. They turn out to be the primes p = 1, 9 (mod 20), while
p = 3, 7 (mod 20) split into non-principal ideals - the class group made
visible. Exact and exhaustive for p < 200; the general statements are
theorems (Dedekind-Kummer; genus theory), not consequences of the check.
"""

import math

def is_prime(n):
    """Trial division primality test."""
    return n >= 2 and all(n % q for q in range(2, math.isqrt(n) + 1))

def discriminant(d):
    """Discriminant of Q(sqrt d) for squarefree d != 0, 1."""
    return d if d % 4 == 1 else 4 * d

def min_poly(d):
    """Coefficients (b, c) of x^2 + b x + c, the minimal polynomial of w."""
    if d % 4 == 1:
        return (-1, (1 - d) // 4)
    return (0, -d)

def roots_mod_p(d, p):
    """Distinct roots modulo p of the minimal polynomial of w."""
    b, c = min_poly(d)
    return [x for x in range(p) if (x * x + b * x + c) % p == 0]

def splitting_type(d, p):
    """'split', 'inert' or 'ramified', by Dedekind-Kummer."""
    b, c = min_poly(d)
    roots = roots_mod_p(d, p)
    if len(roots) == 2:
        return "split"
    if not roots:
        return "inert"
    # one distinct root: check it is a double root (discriminant = 0 mod p)
    return "ramified" if (b * b - 4 * c) % p == 0 else "split"

def kronecker(a, p):
    """Kronecker symbol (a/p) for a prime p."""
    if p == 2:
        if a % 2 == 0:
            return 0
        return 1 if a % 8 in (1, 7) else -1
    r = pow(a % p, (p - 1) // 2, p)
    return 0 if a % p == 0 else (1 if r == 1 else -1)

PREDICTION = {1: "split", -1: "inert", 0: "ramified"}

def norm_form_represents(p, d):
    """True if p = a^2 + |d| b^2 for integers a, b (d < 0)."""
    return any(math.isqrt(p + d * b * b) ** 2 == p + d * b * b
               for b in range(math.isqrt(p // -d) + 1))

def main():
    primes = [p for p in range(2, 200) if is_prime(p)]
    print(f"Primes p < 200 ({len(primes)} primes), factored in O_K:")
    print(f"{'field':<10}{'D':>5}  split  inert  ramified  agrees with (D/p)")
    for d, name in [(-1, "Q(i)"), (-5, "Q(sqrt-5)"), (2, "Q(sqrt2)"),
                    (5, "Q(sqrt5)")]:
        D = discriminant(d)
        types = [splitting_type(d, p) for p in primes]
        agree = all(t == PREDICTION[kronecker(D, p)]
                    for t, p in zip(types, primes))
        counts = [types.count(t) for t in ("split", "inert", "ramified")]
        print(f"{name:<10}{D:>5}  {counts[0]:>5}  {counts[1]:>5}  "
              f"{counts[2]:>8}  {agree}")
    split = [p for p in primes if splitting_type(-5, p) == "split"]
    principal = [p for p in split if norm_form_represents(p, -5)]
    other = [p for p in split if p not in principal]
    print("Q(sqrt-5), class number 2: split primes p = P P'.")
    print(f"  P principal (p = a^2+5b^2): {principal[:9]} ...")
    print(f"  P not principal:            {other[:9]} ...")
    print("  residues mod 20, principal:",
          sorted({p % 20 for p in principal}),
          " not principal:", sorted({p % 20 for p in other}))
    print()
    print("Epistemic status: exact and exhaustive for primes below 200. The")
    print("agreement with (D/p) is the Dedekind-Kummer theorem; the residues")
    print("mod 20 illustrate genus theory. Neither is proved by this check.")

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

The second experiment computes class numbers of imaginary quadratic fields in two independent ways — counting Gauss's reduced binary quadratic forms, and Dirichlet's analytic class number formula h(D)=−w2∣D∣∑a=1∣D∣−1χD(a) ah(D) = -\frac{w}{2|D|}\sum_{a=1}^{|D|-1}\chi_D(a)\,a — finds the nine discriminants with class number one, and computes fundamental units of real quadratic rings from continued fractions. Notice how erratically the units grow: the unit theorem says one generator exists, not how big it is.

Class numbers by reduced forms and fundamental unitsPythonExact computationExhaustive finite checkComputationally tested
"""Class numbers of imaginary quadratic fields and units of real ones.

Gauss's reduced binary quadratic forms count ideal classes: for a negative
fundamental discriminant D, the class number h(D) of Q(sqrt D) equals the
number of reduced primitive forms a x^2 + b xy + c y^2 with b^2 - 4ac = D,
|b| <= a <= c (and b >= 0 if |b| = a or a = c). We compute h(D) this way for
every fundamental discriminant -200 <= D < 0, and check each value against
Dirichlet's analytic class number formula
    h(D) = -(w / (2|D|)) * sum_{a=1}^{|D|-1} chi_D(a) * a,
where chi_D is the Kronecker symbol and w is the number of roots of unity.
Then, for real quadratic rings Z[sqrt d], we find the fundamental unit by the
continued fraction of sqrt d (the smallest solution of x^2 - d y^2 = +-1),
showing how wildly its size varies - Dirichlet's unit theorem promises one
fundamental unit but says nothing about how large it is. Exact integer
arithmetic, exhaustive in the stated range.
"""

import math

def is_squarefree(n):
    """True if no square of a prime divides n (n != 0)."""
    n = abs(n)
    return all(n % (q * q) for q in range(2, math.isqrt(n) + 1))

def is_fundamental(D):
    """Fundamental discriminant test for D != 0, 1."""
    if D % 4 == 1:
        return is_squarefree(D)
    if D % 4 == 0:
        m = D // 4
        return m % 4 in (2, 3) and is_squarefree(m)
    return False

def reduced_forms(D):
    """Reduced primitive positive definite forms (a, b, c) of discriminant D < 0."""
    forms = []
    a = 1
    while 3 * a * a <= -D:
        for b in range(-a + 1, a + 1):
            if (b * b - D) % (4 * a):
                continue
            c = (b * b - D) // (4 * a)
            if c < a or (c == a and b < 0):
                continue
            if math.gcd(math.gcd(a, b), c) == 1:
                forms.append((a, b, c))
        a += 1
    return forms

def class_number(D):
    """h(D) as the number of reduced primitive forms."""
    return len(reduced_forms(D))

def kronecker(D, n):
    """Kronecker symbol (D/n) for n >= 1."""
    result, m, p = 1, n, 2
    while m > 1:
        if m % p:
            p += 1
            continue
        m //= p
        if p == 2:
            factor = 0 if D % 2 == 0 else (1 if D % 8 in (1, 7) else -1)
        else:
            r = pow(D % p, (p - 1) // 2, p)
            factor = 0 if D % p == 0 else (1 if r == 1 else -1)
        result *= factor
    return result

def class_number_formula(D):
    """Dirichlet's formula h = -(w / 2|D|) sum chi_D(a) a, as an exact integer."""
    w = {-3: 6, -4: 4}.get(D, 2)
    s = sum(kronecker(D, a) * a for a in range(1, -D))
    value = -w * s
    if value % (2 * -D):
        raise ArithmeticError("formula did not give an integer")
    return value // (2 * -D)

def fundamental_unit(d):
    """Smallest x + y sqrt d (x, y > 0) with x^2 - d y^2 = +-1, d not a square."""
    a0 = math.isqrt(d)
    m, q, a = 0, 1, a0
    h_prev, h = 1, a0
    k_prev, k = 0, 1
    while h * h - d * k * k not in (1, -1):
        m = q * a - m
        q = (d - m * m) // q
        a = (a0 + m) // q
        h_prev, h = h, a * h + h_prev
        k_prev, k = k, a * k + k_prev
    return h, k, h * h - d * k * k

def main():
    discs = [D for D in range(-200, 0) if is_fundamental(D)]
    hs = {D: class_number(D) for D in discs}
    agree = all(hs[D] == class_number_formula(D) for D in discs)
    print(f"Fundamental discriminants -200 <= D < 0: {len(discs)} fields")
    print("  h(D) by reduced forms equals Dirichlet's formula for all:",
          agree)
    print("  h(D) for the first fields:")
    first = sorted(discs, reverse=True)[:20]
    for start in (0, 10):
        print("   " + " ".join(f"{D}:{hs[D]}" for D in first[start:start + 10]))
    print("  class number 1:", [D for D in sorted(discs, reverse=True)
                                if hs[D] == 1])
    print("  forms of D = -20 (Q(sqrt-5)):", reduced_forms(-20))
    print(f"  largest h in range: {max(hs.values())}")
    print("Fundamental units of Z[sqrt d] (x + y sqrt d, norm x^2 - d y^2):")
    for d in (2, 3, 7, 19, 31, 43, 46, 94):
        x, y, nrm = fundamental_unit(d)
        print(f"  d = {d:>2}: {x} + {y} sqrt{d}  (norm {nrm:+d})")
    print()
    print("Epistemic status: exact integer computations, exhaustive for the")
    print("stated discriminants. That -163 is the last D with h(D) = 1 is the")
    print("Baker-Heegner-Stark theorem; the computation only covers |D| <= 200.")

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

Exercises

1. Algebraic number theory

Warm-upHuman

What is the discriminant dKd_K of the quadratic field K=Q(−7)K = \mathbb{Q}(\sqrt{-7})?

2. Algebraic number theory

Warm-upHuman

Which ring is the ring of integers of Q(13)\mathbb{Q}(\sqrt{13})?

Choose one

3. Algebraic number theory

CoreHuman

List the primes p<25p < 25 that are inert (remain prime) in the Gaussian integers Z[i]\mathbb{Z}[i]. Enter them as a set, for example {2, 5}.

Write elements separated by commas. Order and repeats don’t matter — just like in a set!

4. Algebraic number theory

CoreHuman

In the proof that a Dedekind UFD is a PID, we find an irreducible π\pi with (π)⊆p(\pi) \subseteq \mathfrak{p} for a non-zero prime p\mathfrak{p} and conclude (π)=p(\pi) = \mathfrak{p}. Which property is used for this last step?

Choose one

5. Algebraic number theory

CoreHuman

Using the Minkowski bound MK≈2.85M_K \approx 2.85 for K=Q(−5)K = \mathbb{Q}(\sqrt{-5}), what is the class number hKh_K?

6. Algebraic number theory

StretchHuman

In R=Z[−3]R = \mathbb{Z}[\sqrt{-3}], let p=(2,1+−3)\mathfrak{p} = (2, 1 + \sqrt{-3}). One checks that p2=2p\mathfrak{p}^2 = 2\mathfrak{p} although p≠(2)\mathfrak{p} \neq (2). Which hypothesis of Theorem 4 fails, and where does the proof break?

Choose one

7. Algebraic number theory

CoreHuman

What is the rank of the unit group OK×\mathcal{O}_K^\times for K=Q(23)K = \mathbb{Q}(\sqrt[3]{2})? (The minimal polynomial x3−2x^3 - 2 has one real root and two complex conjugate roots.)

8. Algebraic number theory

CoreFormal

Which pair of Lean facts about ℤ√(-5) (Mathlib's Z[−5]\mathbb{Z}[\sqrt{-5}]) is exactly what the lesson uses to prove ¬ UniqueFactorizationMonoid (ℤ√(-5))?

Choose one

9. Algebraic number theory

StretchComputational

Write inert_primes(d, bound) returning the sorted list of primes p<boundp < \text{bound} that are inert in Q(d)\mathbb{Q}(\sqrt d) (d≠0,1d \ne 0, 1 squarefree). Use Dedekind–Kummer: with ω=d\omega = \sqrt d (d≡2,3 mod 4d \equiv 2, 3 \bmod 4) or ω=1+d2\omega = \frac{1 + \sqrt d}{2} (d≡1 mod 4d \equiv 1 \bmod 4), pp is inert exactly when the minimal polynomial of ω\omega has no root modulo pp.

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

Common misconceptions

Misconception

"Every ring of integers has unique factorisation, like Z\Z." It fails already in Z[−5]\Z[\sqrt{-5}]: 6=2⋅3=(1+−5)(1−−5)6 = 2 \cdot 3 = (1 + \sqrt{-5})(1 - \sqrt{-5}) with all four factors irreducible and no two associate. What survives is unique factorisation of ideals (Theorem 4): (6)=p2qq′(6) = \mathfrak{p}^2\mathfrak{q}\mathfrak{q}', and both element factorisations are regroupings of it. Element factorisation is unique exactly when every ideal is principal, hK=1h_K = 1 (Theorem 6).

Misconception

"The ring of integers of Q(d)\Q(\sqrt d) is Z[d]\Z[\sqrt d]." Only when d≡2,3(mod4)d \equiv 2, 3 \pmod 4. For d≡1(mod4)d \equiv 1 \pmod 4 the element 1+d2\frac{1 + \sqrt d}{2} is a root of x2−x−d−14x^2 - x - \frac{d - 1}{4}, an integer polynomial: the golden ratio 1+52\frac{1 + \sqrt 5}{2} and ζ3=−1+−32\zeta_3 = \frac{-1 + \sqrt{-3}}{2} are algebraic integers. Working in the too-small ring Z[−3]\Z[\sqrt{-3}] even destroys unique factorisation of ideals, because it is not integrally closed.

Misconception

"A prime number stays prime in any ring of integers" — or the opposite, "every prime splits." All three behaviours occur, governed by the reduction of a minimal polynomial (Theorem 5): in Z[i]\Z[i], 22 ramifies, 55 splits and 33 stays prime. Whether pp splits in Q(d)\Q(\sqrt d) depends only on pp modulo 4∣d∣4|d|, by quadratic reciprocity.

Misconception

"Units are just ±1\pm 1." That is true for Z\Z and for imaginary quadratic fields other than Q(i)\Q(i) and Q(−3)\Q(\sqrt{-3}), but real quadratic fields have infinitely many units, ±εn\pm\varepsilon^n, and the fundamental unit can be enormous: for d=94d = 94 it is 2143295+221064942143295 + 221064\sqrt{94}. In general the unit group has rank r1+r2−1r_1 + r_2 - 1.

ViewpointsH

Viewpoints

Geometry— The geometry of numbers

Minkowski's insight (Geometrie der Zahlen, 1896) was that OK\mathcal{O}_K embedded by (σ1,…,σr1,σr1+1,… )(\sigma_1, \dots, \sigma_{r_1}, \sigma_{r_1+1}, \dots) is a lattice in Rn\R^n, and that arithmetic questions become questions about lattice points in convex bodies. His convex body theorem proves the finiteness of the class group (Theorem 7), the inequality ∣dK∣>1|d_K| > 1 for K≠QK \neq \Q, and — applied to the logarithmic embedding — Dirichlet's unit theorem, where the units form a lattice of covolume related to the regulator in the hyperplane ∑xi=0\sum x_i = 0. The same technique gives Lagrange's four-squares theorem (via a lattice in R4\R^4) and Fermat's two-squares theorem (a lattice of covolume pp in R2\R^2 must contain a non-zero point in the disc of area 2πp>4p2\pi p > 4p). The picture in the intuition section — an ideal as a sublattice of index N(a)N(\mathfrak{a}) — is this viewpoint in miniature.

Topology— Primes as points, extensions as coverings (an analogy)

Think of Spec⁡OK\operatorname{Spec}\mathcal{O}_K as a curve whose points are the non-zero primes (see algebraic geometry). A finite extension L/KL/K gives a map Spec⁡OL→Spec⁡OK\operatorname{Spec}\mathcal{O}_L \to \operatorname{Spec}\mathcal{O}_K that behaves like a branched covering of degree [L:K][L : K]: over most points there are ∑eifi=[L:K]\sum e_i f_i = [L : K] "sheets", and the finitely many ramified primes (those dividing the relative discriminant) are the branch points. For Galois extensions the Galois group acts on the fibres like deck transformations, and the decomposition group and Frobenius element of a prime mirror the local monodromy around a point. The analogy predicts true theorems: the Hilbert class field of KK — its maximal unramified abelian extension — has Galois group isomorphic to Cl⁡(K)\operatorname{Cl}(K), as the maximal abelian unramified cover of a space has deck group H1H_1, the abelianised fundamental group; and Minkowski's theorem that every extension of Q\Q ramifies somewhere says "Spec⁡Z\operatorname{Spec}\Z is simply connected". This is an analogy, not an identity — étale fundamental groups (Grothendieck) make it precise.

Analysis— Dedekind zeta functions and the class number formula

The Dedekind zeta function ζK(s)=∑aN(a)−s=∏p(1−N(p)−s)−1\zeta_K(s) = \sum_{\mathfrak{a}} N(\mathfrak{a})^{-s} = \prod_{\mathfrak{p}}(1 - N(\mathfrak{p})^{-s})^{-1} (Re⁡s>1\operatorname{Re} s > 1) encodes the splitting of all primes at once — its Euler product is Theorem 4 read analytically. It continues meromorphically to C\C with a simple pole at s=1s = 1 whose residue is given by the analytic class number formula:

Res⁡s=1ζK(s)=2r1(2π)r2 hK RKwK∣dK∣,\operatorname{Res}_{s=1}\zeta_K(s) = \frac{2^{r_1}(2\pi)^{r_2}\, h_K\, R_K}{w_K\sqrt{|d_K|}},

where RKR_K is the regulator (the covolume of the unit lattice) and wK=#μKw_K = \#\mu_K. So the class number and the units, the two measures of failure of unique factorisation, appear together in an analytic invariant. For a quadratic field ζK(s)=ζ(s)L(s,χdK)\zeta_K(s) = \zeta(s)L(s, \chi_{d_K}), which turns the formula into Dirichlet's finite sum used in the second experiment. This is the bridge to analytic number theory; Siegel's theorem h(d)=∣d∣1/2+o(1)h(d) = |d|^{1/2 + o(1)} for imaginary quadratic fields comes from it.

Algebra— Galois theory of primes

If L/QL/\Q is Galois with group GG, then GG permutes the primes above pp transitively, so ee and ff are the same for all of them and efg=[L:Q]efg = [L : \Q]. For unramified pp there is a well-defined Frobenius conjugacy class Frobp⊆G\mathrm{Frob}_p \subseteq G, the elements acting as x↦xpx \mapsto x^p on a residue field. For abelian GG, Frobp\mathrm{Frob}_p is an element, and for cyclotomic fields it is simply p mod np \bmod n in (Z/n)×≅Gal⁡(Q(ζn)/Q)(\Z/n)^\times \cong \operatorname{Gal}(\Q(\zeta_n)/\Q) — this is why the splitting of qq in Q(ζp)\Q(\zeta_p) depends on the order of qq mod pp, and why quadratic reciprocity follows from the inclusion Q(±p)⊆Q(ζp)\Q(\sqrt{\pm p}) \subseteq \Q(\zeta_p). Class field theory (Takagi, Artin) describes all abelian extensions of KK in terms of ideals of KK; the Chebotarev density theorem says each conjugacy class CC occurs as Frobp\mathrm{Frob}_p for a proportion ∣C∣/∣G∣|C|/|G| of primes — half of all primes split in each quadratic field, as the first experiment shows. Non-abelian generalisations are the subject of the Langlands programme.

Wonder Trails

Wonder Trail

Clock arithmetic is the arithmetic of Z/n\Z/n — the residue rings OK/a\mathcal{O}_K/\mathfrak{a} of this lesson generalise it, and the Dedekind–Kummer theorem reduces the factorisation of primes to factoring polynomials on a "clock" Fp\mathbb{F}_p.

Wonder Trail · Optional · never gradedClock arithmeticIt's 9 o'clock. What time will it be in 5 hours — and in 29 hours? Can a clock teach us a whole new kind of arithmetic?Follow the trail
History & global context

History and global context

  • Brahmagupta (Brāhmasphuṭasiddhānta, 628) found the composition identity (a2−Nb2)(c2−Nd2)=(ac+Nbd)2−N(ad+bc)2(a^2 - Nb^2)(c^2 - Nd^2) = (ac + Nbd)^2 - N(ad + bc)^2 — multiplicativity of the norm in Z[N]\Z[\sqrt N] — and used it to generate solutions of x2−Ny2=1x^2 - Ny^2 = 1. Jayadeva and Bhāskara II (Bījagaṇita, 1150) developed the cyclic chakravāla method, solving x2−61y2=1x^2 - 61y^2 = 1 with x=1766319049x = 1766319049, y=226153980y = 226153980.
  • Fermat stated the two-squares theorem (1640) and posed Pell's equation as a challenge (1657); Euler proved the two-squares theorem (1749) and used numbers a+b−3a + b\sqrt{-3} in work on x3+y3=z3x^3 + y^3 = z^3; Lagrange proved that Pell's equation always has a non-trivial solution (1768) and began the theory of binary quadratic forms.
  • Gauss (Disquisitiones Arithmeticae, 1801) developed composition of forms and class numbers — a class group before groups had a name — and conjectured that only finitely many imaginary quadratic fields have class number one; he introduced Z[i]\Z[i] for biquadratic reciprocity (1832). Dirichlet proved the unit theorem (1846) and his class number formula (1839).
  • Kummer found the failure of unique factorisation in cyclotomic integers and introduced ideal numbers (1844–47), proving Fermat's Last Theorem for regular primes. Dedekind replaced ideal numbers by ideals in his supplements to Dirichlet's lectures (1871), proving Theorem 4; Kronecker developed a parallel theory of divisors. Hilbert's Zahlbericht (1897) unified the subject, and Minkowski (1896) brought in the geometry of numbers.
  • Teiji Takagi (1920) and Emil Artin (1927) established class field theory. Kurt Heegner (1952), Alan Baker and Harold Stark (1966–67) proved that exactly nine imaginary quadratic fields have class number one (d=−3,−4,−7,−8,−11,−19,−43,−67,−163d = -3, -4, -7, -8, -11, -19, -43, -67, -163), settling Gauss's problem. Andrew Wiles's proof of Fermat's Last Theorem (1995) used far more than Kummer's methods, but ideals, class groups and Galois actions on primes remain its language.
Further reading

Further reading

  • Daniel A. Marcus, Number Fields (1977; 2nd ed. 2018) — the friendliest first course, with excellent exercises on quadratic and cyclotomic fields.
  • Jürgen Neukirch, Algebraic Number Theory (1999) — the standard graduate text: Dedekind domains, Minkowski theory, units, local fields and class field theory.
  • Kenneth Ireland and Michael Rosen, A Classical Introduction to Modern Number Theory (2nd ed., 1990) — Gaussian and Eisenstein integers, cyclotomy, and Fermat's Last Theorem for small exponents.
  • Ian Stewart and David Tall, Algebraic Number Theory and Fermat's Last Theorem (4th ed., 2015) — from Kummer's ideals to an outline of Wiles's proof.
  • Pierre Samuel, Algebraic Theory of Numbers (1970) — short and elegant.
  • David A. Cox, Primes of the Form x2+ny2x^2 + ny^2 (1989) — forms, class field theory and complex multiplication, starting from exactly the question of which pp are a2+5b2a^2 + 5b^2.