Gauss's Lemma (Polynomial)

lean4-proofring-theoryvisualization
f,g primitive    fg primitivef,g \text{ primitive} \implies fg \text{ primitive}

Statement

Let RR be a UFD and K=Frac(R)K = \operatorname{Frac}(R) its fraction field. A polynomial fR[x]f \in R[x] is primitive if the ideal generated by its coefficients equals RR (equivalently, no prime of RR divides all coefficients).

Gauss's Lemma (content form): The product of two primitive polynomials is primitive.

Gauss's Lemma (irreducibility form): A primitive polynomial fR[x]f \in R[x] is irreducible over RR if and only if it is irreducible over KK.

In particular, if fZ[x]f \in \mathbb{Z}[x] is primitive and has no factorisation over Z\mathbb{Z}, it has no factorisation over Q\mathbb{Q} either.

Visualization

Primitive part extraction. Given f(x)=2x2+4x+6f(x) = 2x^2 + 4x + 6, extract the content:

f(x) = 2x^2 + 4x + 6
     = 2 · (x^2 + 2x + 3)
       ^^    ^^^^^^^^^^^^
    content   primitive part

Content: gcd(2,4,6)=2\gcd(2, 4, 6) = 2. Primitive part: x2+2x+3x^2 + 2x + 3 (coefficients have gcd=1\gcd = 1).

Product of primitives stays primitive. Let f=x+1f = x + 1 and g=x1g = x - 1, both primitive.

Prime pppp \mid all coeffs of ff?pp \mid all coeffs of gg?pp \mid all coeffs of fg=x21fg = x^2-1?
22No (121 \nmid 2)NoNo (11 is odd)
33NoNoNo
any ppNoNoNo

No prime divides all coefficients of fgfg, so fgfg is primitive.

Proof Sketch

  1. Content is multiplicative. For fR[x]f \in R[x], define cont(f)=gcd\operatorname{cont}(f) = \gcd of all coefficients. The key identity is cont(fg)=cont(f)cont(g)\operatorname{cont}(fg) = \operatorname{cont}(f)\cdot\operatorname{cont}(g) up to units.

  2. Primitive times primitive. If ff and gg are primitive and pp is any prime, reduce ff and gg modulo pp. Since (R/pR)[x](R/pR)[x] is an integral domain (as pRpR is prime), fˉgˉ0\bar{f}\,\bar{g} \ne 0. So pp does not divide all coefficients of fgfg.

  3. Irreducibility transfer. If ff is primitive and f=ghf = g \cdot h over KK, clear denominators: write g=(1/d1)g1g = (1/d_1)g_1, h=(1/d2)h2h = (1/d_2)h_2 with g1,h2R[x]g_1, h_2 \in R[x] primitive. Then d1d2f=g1h2d_1 d_2 f = g_1 h_2, and taking contents: d1d2cont(f)=cont(g1)cont(h2)=1d_1 d_2 \cdot \operatorname{cont}(f) = \operatorname{cont}(g_1)\operatorname{cont}(h_2) = 1. So d1d2d_1 d_2 is a unit, meaning f=g1h2f = g_1 h_2 is a factorisation in R[x]R[x].

  4. Contrapositive. If ff is irreducible over RR, then any KK-factorisation descends to an RR-factorisation — but one factor must be a unit in R[x]R[x], hence a unit in K[x]K[x] too. So ff is irreducible over KK.

Connections

Gauss's Lemma is the bridge that makes Eisenstein's CriterionEisenstein's Criterionpa0,,an1,  p2a0,  pan    f irreduciblep \mid a_0,\dots,a_{n-1},\; p^2 \nmid a_0,\; p \nmid a_n \implies f \text{ irreducible}A prime-divisibility condition on coefficients that certifies irreducibility of a polynomial over ℤ or any UFD.Read more → work over Q\mathbb{Q}: one proves irreducibility over Z\mathbb{Z} and Gauss transfers it. The result generalises to any UFD, and UFDs arise from the chain 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 →.

Lean4 Proof

-- Mathlib: IsPrimitive.irreducible_iff_irreducible_map_fraction_map
-- in Mathlib.RingTheory.Polynomial.GaussLemma
open Polynomial in
/-- Gauss's Lemma: a primitive polynomial over ℤ is irreducible iff
    its image in ℚ[X] is irreducible. -/
theorem gauss_lemma_int (p : [X]) (hp : p.IsPrimitive) :
    Irreducible p  Irreducible (p.map (algebraMap  )) :=
  hp.irreducible_iff_irreducible_map_fraction_map