Euclidean Domain

lean4-proofring-theoryvisualization
a,b0,  q,r:  a=qb+r,  N(r)<N(b)\forall a, b \ne 0,\; \exists q, r:\; a = qb + r,\; N(r) < N(b)

Statement

A Euclidean domain is an integral domain RR equipped with a norm function N:R{0}NN : R \setminus \{0\} \to \mathbb{N} such that for every aRa \in R and bR{0}b \in R \setminus \{0\}, there exist q,rRq, r \in R with

a=qb+rand either r=0 or N(r)<N(b).a = qb + r \quad \text{and either } r = 0 \text{ or } N(r) < N(b).

Examples:

  • Z\mathbb{Z} with N(n)=nN(n) = |n|: ordinary integer division.
  • k[x]k[x] for a field kk with N(f)=degfN(f) = \deg f: polynomial long division.
  • Z[i]\mathbb{Z}[i] (Gaussian integers) with N(a+bi)=a2+b2N(a+bi) = a^2 + b^2: Euclidean for Gaussian integers.

Key fact: Every Euclidean domain is a PID (principal ideal domain).

Visualization

Division in Z[i]\mathbb{Z}[i] with N(a+bi)=a2+b2N(a+bi) = a^2 + b^2: divide a=5+3ia = 5 + 3i by b=2+ib = 2 + i.

Step 1: Compute a/ba/b in C\mathbb{C}:

5+3i2+i=(5+3i)(2i)(2+i)(2i)=105i+6i3i25=13+i5=2.6+0.2i\frac{5+3i}{2+i} = \frac{(5+3i)(2-i)}{(2+i)(2-i)} = \frac{10-5i+6i-3i^2}{5} = \frac{13+i}{5} = 2.6 + 0.2i

Step 2: Round to nearest Gaussian integer: q=3+0i=3q = 3 + 0i = 3.

Step 3: Compute remainder: r=aqb=(5+3i)3(2+i)=(5+3i)(6+3i)=1+0i=1r = a - qb = (5+3i) - 3(2+i) = (5+3i) - (6+3i) = -1+0i = -1.

Step 4: Check N(r)<N(b)N(r) < N(b): N(1)=1<5=N(2+i)N(-1) = 1 < 5 = N(2+i). Division algorithm holds.

StepValue
aa5+3i5 + 3i
bb2+i2 + i, N(b)=5N(b) = 5
a/ba/b in C\mathbb{C}2.6+0.2i2.6 + 0.2i
qq (rounded)33
r=aqbr = a - qb1-1, N(r)=1N(r) = 1
Check N(r)<N(b)N(r) < N(b)?1<51 < 5

Proof Sketch

Every Euclidean domain is a PID:

  1. Let IRI \subseteq R be a non-zero ideal. Pick bI{0}b \in I \setminus \{0\} with N(b)N(b) minimal.

  2. For any aIa \in I, write a=qb+ra = qb + r with r=0r = 0 or N(r)<N(b)N(r) < N(b).

  3. Since a,bIa, b \in I and II is an ideal, r=aqbIr = a - qb \in I.

  4. By minimality of N(b)N(b), if r0r \ne 0 then N(r)N(b)N(r) \ge N(b), contradiction. So r=0r = 0 and a=qba = qb.

  5. Therefore I=(b)I = (b) is principal. Every ideal is principal, so RR is a PID.

Connections

The Euclidean domain property powers the Euclidean AlgorithmEuclidean Algorithmgcd(m,n)=gcd(nmodm,m)\gcd(m,n) = \gcd(n \bmod m, m)The oldest surviving algorithm, computing the greatest common divisor via iterated remaindersRead more → for computing GCDs. The chain Euclidean \to PID \to UFD (see PID Implies UFDPID Implies UFDPID    UFD\text{PID} \implies \text{UFD}Every principal ideal domain is a unique factorisation domain: elements factor uniquely into irreducibles up to units and order.Read more →) explains why Z\mathbb{Z} has unique prime factorisation. The same norm argument drives polynomial division in Polynomial Division AlgorithmPolynomial Division Algorithmf=qg+r,degr<deggf = q \cdot g + r, \quad \deg r < \deg gFor any polynomial f and monic g, there exist unique q and r with f = qg + r and deg r < deg g.Read more →.

Lean4 Proof

-- Mathlib: Int.euclideanDomain
-- in Mathlib.Algebra.EuclideanDomain.Int (line 20)
-- Mathlib: EuclideanDomain.to_principal_ideal_domain
-- in Mathlib.RingTheory.PrincipalIdealDomain (line 265)

/-- ℤ is a Euclidean domain with norm N(n) = |n|. -/
#check (Int.euclideanDomain : EuclideanDomain )

/-- Every Euclidean domain is a PID. -/
example (R : Type*) [EuclideanDomain R] : IsPrincipalIdealRing R :=
  EuclideanDomain.to_principal_ideal_domain