The Zcash ArboretumMath Guide PDF

5 Polynomials over a field

Throughout this section F denotes a field. Consider a problem that sounds impossible. Two parties each hold a polynomial of enormous degree—millions of coefficients, say, the encoding of an entire computation—and wish to convince themselves that the two polynomials are equal. Comparing coefficient lists costs as much as reading the computation itself. Could a single spot check suffice: pick one value α at random, evaluate both polynomials there, and declare them equal if the two field elements agree? The astonishing answer is yes—with an error probability so small that no adversary can exploit it—and this section develops exactly the algebra that makes the answer honest.

Polynomials are the engine behind finite fields, error-correcting codes, and—most importantly here—the polynomial commitment schemes and arithmetisation (the encoding of a computation as identities between polynomials) underlying Halo 2 and Zcash Orchard. The single most exploited fact in that edifice is elementary: a nonzero polynomial of degree d over a field has at most d roots. From this one fact the section extracts Lagrange interpolation and the Schwartz–Zippel principle, the probabilistic heart of every interactive proof we eventually construct. The only prerequisite is the field theory of the preceding section.

5.1 The polynomial ring

One point of principle governs everything that follows, so we state it before the first definition: a polynomial is not a function. It is a formal expression—at bottom, a finite list of coefficients—which one may evaluate to obtain a function, but which in general carries more information than that function. Over the finite fields of cryptographic interest the distinction is not pedantic but essential, and the closing subsections of this section (§5.9) return to it at length.

Definition 5.1 (Polynomial).

A polynomial over F in the indeterminate X is a formal expression

f=a0+a1⁢X+a2⁢X2+⋯+an⁢Xn=∑i=0nai⁢Xi,

where n∈ℕ={0,1,2,…} and the coefficients a0,…,an lie in F. Formally, f is identified with its coefficient sequence (a0,a1,a2,…), in which only finitely many entries are nonzero. Two polynomials are equal precisely when their coefficient sequences agree term by term:

∑iai⁢Xi=∑ibi⁢Xi⟺ai=bi⁢ for every ⁢i∈ℕ.

The symbol X is an indeterminate (a formal variable): it is not an element of F and stands for nothing in particular; it is merely a placeholder organising the coefficients. The set of all polynomials over F in X is denoted F⁢[X].

Remark 5.2 (The sequence model).

The fully rigorous rendering of 5.1 takes F⁢[X] to be the set of all functions a:ℕ→F that are eventually zero: there is some N with a⁢(i)=0 for all i>N. The expression ∑iai⁢Xi is then merely suggestive notation for the sequence (a0,a1,…). We use the two viewpoints interchangeably; the notation is justified because the arithmetic of these sequences, defined next, is exactly the arithmetic the notation suggests.

Definition 5.3 (Ring operations on F⁢[X]).

Let f=∑iai⁢Xi and g=∑ibi⁢Xi lie in F⁢[X], with the shorter coefficient sequence zero-padded so that both run over the same index set. Their sum and product are

f+g=∑i≥0(ai+bi)⁢Xi,f⁢g=∑k≥0ck⁢Xkwhereck=∑i+j=kai⁢bj=∑i=0kai⁢bk−i.

The coefficient ck is the convolution of the two coefficient sequences. Both defining sums are finite—only finitely many ai and bj are nonzero, hence only finitely many ck are nonzero—so the sum and the product are again polynomials.

The convolution formula is exactly what multiplying out (∑iai⁢Xi)⁢(∑jbj⁢Xj) and collecting like powers of X gives, using Xi⋅Xj=Xi+j. Stated as a convolution, however, it makes no appeal to substituting a value for X: it is a purely formal manipulation of coefficient sequences. The formal/functional distinction announced above is thereby kept intact at the level of the operations themselves.

The verification that these operations obey the ring axioms (4.1) is a single device applied over and over: to prove an identity between polynomials, compute the coefficient of Xm on each side as a finite sum over index decompositions, then reindex or regroup that sum. No evaluation is ever involved. The associativity step below is the archetype.

Theorem 5.4 (F⁢[X] is a commutative ring).

With the operations of 5.3, the set F⁢[X] is a commutative ring whose additive identity is the zero polynomial 0=(0,0,0,…) and whose multiplicative identity is the constant polynomial 1=(1,0,0,…). Moreover the map c↦(c,0,0,…) embeds F into F⁢[X] as a subring, the constant polynomials; in this sense F⊆F⁢[X].

Proof.

Additive structure. Addition is coordinatewise, so its commutativity and associativity are inherited directly from the corresponding laws of the additive group of F, the sequence (0,0,…) is an additive identity, and (−a0,−a1,…) is an additive inverse of (a0,a1,…). Hence (F⁢[X],+) is an abelian group.

Commutativity of multiplication. The coefficient of Xk in f⁢g is ∑i+j=kai⁢bj; reindexing the sum by (i,j)↦(j,i) and using commutativity of multiplication in F,

∑i+j=kai⁢bj=∑i+j=kbi⁢aj,

which is the coefficient of Xk in g⁢f.

Associativity of multiplication. Write h=∑lcl⁢Xl. The coefficient of Xm in (f⁢g)⁢h is

∑k+l=m(∑i+j=kai⁢bj)⁢cl=∑i+j+l=mai⁢bj⁢cl,

and expanding f⁢(g⁢h) instead produces ∑i+j+l=mai⁢(bj⁢cl), the same symmetric triple sum by associativity in F. Hence (f⁢g)⁢h=f⁢(g⁢h) coefficient by coefficient.

Distributivity. The coefficient of Xk in f⁢(g+h) is ∑i+j=kai⁢(bj+cj), which distributivity in F splits as ∑i+j=kai⁢bj+∑i+j=kai⁢cj: the coefficient of Xk in f⁢g+f⁢h. The other distributive law follows from this one and commutativity.

Identity. With 1=(1,0,0,…), the k-th coefficient of 1⋅f is ∑i+j=k𝟏⁢[i=0]⁢aj=ak, where 𝟏⁢[i=0] denotes the coefficient sequence of 1 (equal to 1 at index 0 and 0 elsewhere); so 1⋅f=f.

Embedding. Let ι⁢(c)=(c,0,0,…). The map ι preserves sums coordinatewise, and ι⁢(c)⁢ι⁢(d) has k-th coefficient c⁢d for k=0 and 0 otherwise, so ι⁢(c)⁢ι⁢(d)=ι⁢(c⁢d); also ι⁢(1)=1. Distinct constants give distinct sequences, so ι is an injective ring homomorphism (4.21) and its image is a subring of F⁢[X] isomorphic to F. □

Remark 5.5 (Scalar multiplication).

Multiplying f=∑iai⁢Xi by a constant c∈F, viewed as the constant polynomial ι⁢(c), gives the scalar multiple c⁢f=∑i(c⁢ai)⁢Xi. Together with addition, this makes F⁢[X] a vector space over F—a structure studied systematically in the linear-algebra section later in the volume; informally, a system closed under addition and under scaling by field elements, in which the monomials 1,X,X2,X3,… play the role of an infinite coordinate system (a basis). This linear structure is relied on constantly, for instance whenever we count polynomials of bounded degree.

5.2 Degree

Definition 5.6 (Degree, leading coefficient, monic).

Let f=∑iai⁢Xi∈F⁢[X] be nonzero. The degree deg⁡f is the largest index n with an≠0; the coefficient an is the leading coefficient lc⁡(f), the term an⁢Xn is the leading term, and a0 is the constant term. A nonzero polynomial is monic if its leading coefficient is 1. The constant polynomials are the elements of F embedded by 5.4; the nonzero ones have degree 0. The zero polynomial is assigned deg⁡0=−∞, with the conventions −∞<n, −∞+n=−∞, and −∞+(−∞)=−∞ for every n∈ℤ. Polynomials of degree 1, 2, and 3 are called linear, quadratic, and cubic respectively.

The convention deg⁡0=−∞ is not pedantry: it makes the degree formulas below hold without exceptions, which streamlines every later induction on degree. Induction on degree is thereby set up as a reusable device for the rest of the volume.

Proposition 5.7 (Degree of sums and products).

For all f,g∈F⁢[X],

deg⁡(f+g)≤max⁡{deg⁡f,deg⁡g}, (1)

with equality whenever deg⁡f≠deg⁡g, and

deg⁡(f⁢g)=deg⁡f+deg⁡g. (2)
Proof.

If either polynomial is zero, both statements reduce to the −∞ conventions of 5.6. So let f and g be nonzero, of degrees m and n with leading coefficients am and bn.

Sum. The coefficient of Xk in f+g is ak+bk, which vanishes for k>max⁡{m,n}; this is (1). If m>n, the coefficient of Xm is am+0=am≠0, giving equality (symmetrically for n>m). When m=n, cancellation am+bm=0 can lower the degree, which is why the sum bound is only an inequality.

Product. The coefficient cm+n=∑i+j=m+nai⁢bj has only the surviving term i=m, j=n: terms with i>m have ai=0, and terms with i<m force j>n, so bj=0. Hence cm+n=am⁢bn, and the same argument shows ck=0 for k>m+n. Since F is a field it has no zero divisors (4.28), so am⁢bn≠0; therefore deg⁡(f⁢g)=m+n and lc⁡(f⁢g)=lc⁡(f)⁢lc⁡(g). □

The product formula (2) is the first place the field hypothesis does real work: it required am⁢bn≠0, that is, the absence of zero divisors in F. This single fact has sweeping consequences for everything that follows, beginning with the next three corollaries.

Corollary 5.8 (F⁢[X] is an integral domain).

The ring F⁢[X] has no zero divisors: if f⁢g=0, then f=0 or g=0.

Proof.

If f and g are both nonzero, then deg⁡(f⁢g)=deg⁡f+deg⁡g≥0 by (2), so f⁢g≠0. Contrapositively, f⁢g=0 forces f=0 or g=0. □

Corollary 5.9 (Cancellation).

Let f,g,h∈F⁢[X] with h≠0. If f⁢h=g⁢h, then f=g.

Proof.

From f⁢h=g⁢h we get (f−g)⁢h=0; since h≠0, 5.8 forces f−g=0. □

Proposition 5.10 (Units of F⁢[X]).

A polynomial f∈F⁢[X] is a unit—has a multiplicative inverse in F⁢[X]—if and only if it is a nonzero constant. Thus F⁢[X]×=F×.

Proof.

A nonzero constant c has the inverse c−1∈F⊆F⁢[X]. Conversely, f⁢g=1 gives deg⁡f+deg⁡g=deg⁡1=0 by (2); since degrees of nonzero polynomials are nonnegative, deg⁡f=deg⁡g=0, and f is a nonzero constant. □

Definition 5.11 (Associates).

Two polynomials f,g∈F⁢[X] are associates if f=u⁢g for some unit u∈F×, that is, if they differ only by a nonzero scalar factor.

Every nonzero polynomial f has exactly one monic associate, obtained by dividing through by its leading coefficient: lc(f)−1f. Choosing the monic representative is the standard way to pin down the greatest common divisor or the irreducible factor uniquely, and we adopt this normalisation below.

5.3 Division with remainder

The arithmetic of F⁢[X] parallels that of the integers ℤ with remarkable fidelity: greatest common divisors, a Euclidean algorithm, a Bézout identity, primes (here called irreducibles), and unique factorisation all reappear. The source of the parallel is a single statement, division with remainder, in which degree plays the role that absolute value plays in ℤ.

Theorem 5.12 (Division algorithm).

Let f,g∈F⁢[X] with g≠0. There exist unique polynomials q,r∈F⁢[X] such that

f=q⁢g+randdeg⁡r<deg⁡g.

We call q the quotient and r the remainder, and write q=f⁢div⁡g and r=fmodg.

Proof.

Existence. Fix g, of degree n with leading coefficient bn, and induct on deg⁡f. If deg⁡f<n—including f=0 with deg⁡f=−∞—take q=0 and r=f. Otherwise let m=deg⁡f≥n, with leading coefficient am, and form

f1=f−ambn⁢Xm−n⁢g.

The subtracted term has degree m and leading coefficient (am/bn)⁢bn=am, so it cancels the leading term of f: either f1=0 or deg⁡f1<m. By the induction hypothesis f1=q1⁢g+r with deg⁡r<n, and then f=(q1+(am/bn)⁢Xm−n)⁢g+r. The field hypothesis enters visibly here: division by the leading coefficient bn requires bn−1 to exist.

Uniqueness. Suppose f=q⁢g+r=q′⁢g+r′ with both remainders of degree <n. Then (q−q′)⁢g=r′−r. If q≠q′, then deg⁡((q−q′)⁢g)=deg⁡(q−q′)+n≥n by (2), whereas deg⁡(r′−r)≤max⁡{deg⁡r′,deg⁡r}<n by (1)—a contradiction. Hence q=q′, and then r=f−q⁢g=r′. □

Remark 5.13 (Polynomial long division).

The existence proof is constructive, and it is precisely polynomial long division: repeatedly eliminate the current leading term by subtracting an appropriate monomial multiple of g. Each step strictly lowers the degree of the running remainder, so the process terminates after at most deg⁡f−deg⁡g+1 steps when deg⁡f≥deg⁡g, and takes no steps when f=0 or deg⁡f<deg⁡g. The device is reusable in both of its guises: as an algorithm, and as the leading-term-elimination pattern for inductions on degree.

For a concrete instance, divide f=X3+2⁢X+1 by g=X2+1 over ℚ. Subtracting X⋅g=X3+X leaves X+1, whose degree 1 is already below deg⁡g=2; hence q=X and r=X+1, and indeed

X3+2⁢X+1=X⁢(X2+1)+(X+1).

One elimination step suffices here.

Definition 5.14 (Divisibility).

For f,g∈F⁢[X], we say g divides f, written g∣f, if f=q⁢g for some q∈F⁢[X]; equivalently, for g≠0, if the remainder fmodg is 0. In that case g is a divisor (or factor) of f.

5.4 Roots and the factor theorem

The destination of this subsection is the central counting bound of the whole section, stated at once so that the reader knows what the machinery is for: a nonzero polynomial of degree d over a field has at most d distinct roots (5.18 below). Everything the volume later builds on polynomials—the cyclicity of the multiplicative group of a finite field, Lagrange interpolation, the Schwartz–Zippel principle—is load-bearing on this one fact. To reach it we must first say what a root is, and that requires making substitution precise: this is the first place where a polynomial gives rise to a function.

Definition 5.15 (Evaluation and roots).

Let f=∑i=0nai⁢Xi∈F⁢[X] and α∈F. The evaluation of f at α is the field element

f⁢(α)=∑i=0nai⁢αi∈F,

obtained by substituting α for the indeterminate X. An element α∈F is a root (or zero) of f if f⁢(α)=0.

Proposition 5.16 (Evaluation is a ring homomorphism).

Fix α∈F. The evaluation map evα:F⁢[X]→F, f↦f⁢(α), satisfies

(f+g)⁢(α)=f⁢(α)+g⁢(α),(f⁢g)⁢(α)=f⁢(α)⁢g⁢(α),1⁢(α)=1

for all f,g∈F⁢[X]; that is, evα is a ring homomorphism.

Proof.

Additivity is immediate from the coordinatewise definition of addition. For multiplicativity, with ck=∑i+j=kai⁢bj as in 5.3,

(f⁢g)⁢(α)=∑kck⁢αk=∑k∑i+j=kai⁢bj⁢αi+j=(∑iai⁢αi)⁢(∑jbj⁢αj)=f⁢(α)⁢g⁢(α),

the middle equality because expanding the product of the two finite sums and grouping terms by k=i+j produces exactly the double sum. The formal reason evaluation respects the algebra is that the convolution defining polynomial multiplication collapses to ordinary multiplication in F via αi⁢αj=αi+j. Finally 1⁢(α)=1 by direct substitution. □

Theorem 5.17 (Remainder theorem; factor theorem).

Let f∈F⁢[X] and α∈F.

  1. 1.

    (Remainder theorem.) The remainder of f upon division by the linear polynomial X−α is the constant f⁢(α): there is q∈F⁢[X] with f=q⁢(X−α)+f⁢(α).

  2. 2.

    (Factor theorem.) The element α is a root of f if and only if (X−α)∣f.

Proof.

(1) Divide f by X−α (5.12): since deg⁡(X−α)=1, the remainder has degree <1, hence is a constant r∈F. Evaluating f=q⁢(X−α)+r at α via 5.16 gives f⁢(α)=q⁢(α)⁢(α−α)+r=r.

(2) By (1) and the uniqueness of the remainder, (X−α)∣f holds exactly when the remainder f⁢(α) is 0, that is, when α is a root of f. □

The factor theorem is an immediate but powerful consequence of the division algorithm: it converts a statement about values (a root) into a statement about divisibility (a linear factor). Iterating that conversion proves the promised bound.

Theorem 5.18 (At most d roots).

A nonzero polynomial f∈F⁢[X] of degree d has at most d distinct roots in F.

Proof.

We induct on d=deg⁡f. If d=0, then f is a nonzero constant, which evaluates to itself everywhere and so has 0≤d roots. Let d≥1. If f has no root in F the claim holds; otherwise let α be a root. By the factor theorem, f=(X−α)⁢q, and deg⁡q=d−1 by (2). Now let β≠α be any other root of f. Evaluating with 5.16,

0=f⁢(β)=(β−α)⁢q⁢(β);

since β−α≠0 and F has no zero divisors (4.28), we get q⁢(β)=0. Every root of f other than α is therefore a root of q, and by the induction hypothesis q has at most d−1 distinct roots. Hence f has at most (d−1)+1=d. □

Remark 5.19 (Why a field is needed).

Both ingredients of the proof—the absence of zero divisors and the degree bookkeeping—are essential. Over a ring with zero divisors the bound fails outright: in ℤ/8⁢ℤ the quadratic X2−1 has the four roots 1¯,3¯,5¯,7¯, since 12=1, 32=9≡1, 52=25≡1, and 72=49≡1(mod8)—a degree-2 polynomial with four roots. This is why the polynomial methods underlying Halo 2 require a field, and indeed a finite field 𝔽p or 𝔽q, beneath them.

Corollary 5.20 (Few points determine a low-degree polynomial).

Let f,g∈F⁢[X] both have degree at most d. If f⁢(α)=g⁢(α) for d+1 distinct values α∈F, then f=g as polynomials.

Proof.

The difference h=f−g has deg⁡h≤max⁡{deg⁡f,deg⁡g}≤d by (1) and vanishes at d+1 distinct points. Were h nonzero, it would be a polynomial of degree at most d with d+1 distinct roots, contradicting 5.18. Hence h=0, that is, f=g. □

The corollary is the deterministic skeleton of two constructions developed later in this section: Lagrange interpolation (§5.7), its constructive converse, and the Schwartz–Zippel principle (§5.10), its probabilistic refinement. The root bound is thus positioned as the load-bearing fact behind the polynomial identity testing and interpolation machinery used by the proving system.

5.5 Greatest common divisors

Because F⁢[X] supports division with remainder, the entire theory of greatest common divisors from elementary number theory (§2) transfers verbatim from ℤ to F⁢[X], with degree replacing absolute value as the measure that decreases. We run through the transfer explicitly, both because the statements are used constantly and because the polynomial Euclidean algorithm is itself a tool of the trade.

Definition 5.21 (Greatest common divisor).

Let f,g∈F⁢[X], not both zero. A greatest common divisor of f and g is a polynomial d such that

  1. 1.

    d∣f and d∣g; and

  2. 2.

    every common divisor c of f and g satisfies c∣d.

A greatest common divisor is determined only up to multiplication by a unit; the unique monic one (5.23) is singled out and denoted gcd⁡(f,g). When gcd⁡(f,g)=1, the polynomials f and g are called coprime (or relatively prime). Since every polynomial divides 0, we have gcd(f,0)=lc(f)−1f for f≠0.

Lemma 5.22 (Euclidean step).

Let f,g∈F⁢[X] with g≠0, and let f=q⁢g+r be the division of 5.12. Then the pairs (f,g) and (g,r) have exactly the same common divisors; in particular, their greatest common divisors coincide.

Proof.

If c∣f and c∣g, then c∣(f−q⁢g)=r; so c is a common divisor of (g,r). Conversely, if c∣g and c∣r, then c∣(q⁢g+r)=f. The two sets of common divisors are therefore equal, hence so are their maximal elements under divisibility. □

Theorem 5.23 (Euclidean algorithm; Bézout’s identity).

Let f,g∈F⁢[X], not both zero. Then gcd⁡(f,g) exists and is unique as a monic polynomial, and there exist s,t∈F⁢[X] with

gcd⁡(f,g)=s⁢f+t⁢g. (3)

Concretely: set r0=f and r1=g, and while ri≠0 divide

ri−1=qi⁢ri+ri+1,deg⁡ri+1<deg⁡ri.

The degrees strictly decrease, so some rN+1=0; the last nonzero remainder rN, made monic, is gcd⁡(f,g).

Proof.

Termination. If r1=0, the algorithm stops at once with N=0 and rN=f≠0. Otherwise the degrees deg⁡r1>deg⁡r2>… form a strictly decreasing sequence of nonnegative integers, which cannot continue forever; so some rN+1=0 with rN≠0.

The gcd property. 5.22, applied at each division, preserves the set of common divisors:

{common divisors of ⁢(f,g)} ={common divisors of ⁢(r1,r2)}
=⋯={common divisors of ⁢(rN,0)},

and the last set is exactly the set of divisors of rN, since every polynomial divides 0. Thus rN divides both f and g, and every common divisor of f and g divides rN: the monic associate lc(rN)−1rN is a monic greatest common divisor.

Uniqueness. Two monic greatest common divisors divide each other, so they differ by a unit u∈F× (5.10); comparing leading coefficients of monic polynomials forces u=1.

Bézout. We show by induction on i that each remainder ri is an F⁢[X]-linear combination of f and g. The bases r0=1⋅f+0⋅g and r1=0⋅f+1⋅g are trivial, and the recurrence ri+1=ri−1−qi⁢ri expresses ri+1 as a combination once ri−1 and ri are. Hence rN=s0⁢f+t0⁢g for some s0,t0∈F⁢[X]; dividing through by lc⁡(rN) yields (3). □

Remark 5.24 (Extended Euclidean algorithm).

Carrying the linear-combination coefficients along with the remainders, exactly as in the integer case (Theorem 2.13), produces s and t explicitly alongside the gcd. The standard application is inversion in a quotient F⁢[X]/(m) for irreducible m: if gcd⁡(f,m)=1, then s⁢f+t⁢m=1, so s is the inverse of f modulo m. This is how one divides in the extension fields 𝔽q constructed in 6. The polynomial version matters both because it parallels the integer one exactly and because it computes gcds of the polynomials a proof system manipulates. A caveat on deployed practice: the curves of Halo 2 and Orchard are defined over prime fields 𝔽p, not extension fields, and field inversion there uses the integer extended Euclidean algorithm (Theorem 2.13) or Fermat’s little theorem—not the polynomial algorithm in F⁢[X]/(m).

Corollary 5.25 (Euclid’s lemma in F⁢[X]).

Let p,f,g∈F⁢[X].

  1. 1.

    If gcd⁡(p,f)=1 and p∣f⁢g, then p∣g.

  2. 2.

    If p is irreducible and p∣f⁢g, then p∣f or p∣g.

Here irreducible is the polynomial analogue of prime, made precise in 5.26 below.

Proof.

(1) Multiplying the Bézout identity s⁢p+t⁢f=1 by g gives s⁢p⁢g+t⁢f⁢g=g. The polynomial p divides both terms on the left—the second because p∣f⁢g—hence divides g.

(2) Suppose p∤f. The gcd gcd⁡(p,f) is a monic divisor of p that is not the monic associate of p (otherwise p∣f). By irreducibility the only monic divisors of p are 1 and its monic associate, so gcd⁡(p,f)=1 and part (1) applies. □

5.6 Unique factorisation

Definition 5.26 (Irreducible polynomial).

A polynomial p∈F⁢[X] is irreducible over F if deg⁡p≥1 and p admits no factorisation p=g⁢h with both deg⁡g≥1 and deg⁡h≥1; equivalently, p is nonconstant and its only factorisations are the trivial ones, (unit)×(associate of ⁢p). A nonconstant polynomial that is not irreducible is reducible.

Remark 5.27 (Irreducibility is relative to the base field).

The polynomial X2+1 is irreducible over ℝ (it has no real root, and a real quadratic factors precisely when it has a root, by the test below), yet splits as (X−i)⁢(X+i) over ℂ, and factors as (X+1)2 over 𝔽2, by direct expansion in characteristic 2. Degree-1 polynomials are irreducible over every field. A useful rootlessness test: a polynomial of degree 2 or 3 is irreducible over F if and only if it has no root in F, because any nontrivial factorisation of a quadratic or cubic must include a linear factor, which by the factor theorem (5.17) supplies a root. The test fails from degree 4 onward: a product of two irreducible quadratics has no roots yet is reducible.

Theorem 5.28 (F⁢[X] is a unique factorisation domain).

Every nonconstant f∈F⁢[X] factors as

f=c⁢p1⁢p2⁢⋯⁢pk

with c=lc⁡(f)∈F× a constant and each pi monic irreducible. The factorisation is unique up to order: if also f=c′⁢q1⁢⋯⁢ql with c′∈F× and each qj monic irreducible, then c=c′, k=l, and the qj are a reordering of the pi.

Proof.

The proof is templated on the fundamental theorem of arithmetic (Theorem 2.18), with degree in place of absolute value.

Existence, by induction on deg⁡f≥1. If f is irreducible, then f=lc⁡(f)⋅p1 with p1 its monic associate. If f=g⁢h is reducible with 1≤deg⁡g,deg⁡h<deg⁡f, the induction hypothesis factors g and h, and multiplying the two factorisations—collecting the two constants into one—factors f.

Uniqueness. Comparing leading coefficients in the two factorisations gives c=c′=lc⁡(f), since monic factors contribute leading coefficient 1 by (2). Cancelling the constants (5.9) leaves p1⁢⋯⁢pk=q1⁢⋯⁢ql; we induct on k. For k=1 the left side is irreducible, so l=1 and p1=q1. For k≥2: p1 divides q1⁢⋯⁢ql, so iterating Euclid’s lemma (5.25(2)) gives p1∣qj for some j. A monic irreducible dividing a monic irreducible equals it: qj=p1⁢h forces deg⁡h=0 by irreducibility of qj, and comparing leading coefficients gives h=1. Cancel p1=qj from both sides (5.9). If l=1, the cancellation leaves p2⁢⋯⁢pk=1, which is impossible: the left side is a product of k−1≥1 nonconstant polynomials and so has degree at least 1 by (2), while deg⁡1=0. Hence l≥2, and the induction hypothesis, applied to p2⁢⋯⁢pk=∏j′≠jqj′, concludes k=l and matches the remaining factors. □

Remark 5.29 (The structural reason: F⁢[X] is a PID).

The deeper explanation of unique factorisation is structural. The degree function and 5.12 make F⁢[X] a Euclidean domain—an integral domain with division with remainder relative to a size measure—and every Euclidean domain is a principal ideal domain (PID): each ideal (4.17) of F⁢[X] is (g)={q⁢g:q∈F⁢[X]} for a single generator g, namely any nonzero element of least degree in a nonzero ideal (the zero ideal is generated by 0), by the same division-and-minimality argument that proved every ideal of ℤ principal (Example 4.18(2)). The generator of the ideal {s⁢f+t⁢g:s,t∈F⁢[X]} is a gcd of f and g, and Bézout’s identity (3) is the concrete shadow of this principality. The standard chain

Euclidean⟹PID⟹UFD

has thus been walked explicitly for F⁢[X], ending at 5.28.

5.7 Lagrange interpolation

The corollary “few points determine a low-degree polynomial” (5.20) says that a polynomial of degree at most d is pinned down by its values at d+1 points. The present subsection proves the constructive converse: any d+1 prescribed values at distinct points are attained by exactly one polynomial of degree at most d, and there is an explicit formula for it. This is the algebraic backbone of secret sharing, of Reed–Solomon error-correcting codes, and of the polynomial encodings in Halo 2.

Theorem 5.30 (Lagrange interpolation).

Let x0,…,xd∈F be distinct (the nodes) and let y0,…,yd∈F be arbitrary targets. There exists a unique f∈F⁢[X] with deg⁡f≤d and f⁢(xi)=yi for all i, given explicitly by

f⁢(X)=∑i=0dyi⁢ℓi⁢(X),whereℓi⁢(X)=∏j≠iX−xjxi−xj

are the Lagrange basis polynomials for the nodes.

Proof.

The ℓi are genuine polynomials. Each denominator ∏j≠i(xi−xj) is a product of nonzero field elements, the nodes being distinct, hence is an invertible constant; so ℓi is a polynomial, of degree exactly d (a product of d linear factors divided by a nonzero constant).

The delta property. Writing δi⁢m for the Kronecker symbol (equal to 1 if i=m and 0 otherwise),

ℓi⁢(xm)=δi⁢m(0≤i,m≤d): (4)

at m=i every factor (xi−xj)/(xi−xj) is 1, while at m≠i the factor with j=m has numerator xm−xm=0. Consequently f⁢(xm)=∑iyi⁢ℓi⁢(xm)=ym for each m, and deg⁡f≤d by (1), each summand having degree at most d.

Uniqueness. Two interpolants of degree at most d agree at the d+1 distinct nodes, hence are equal by 5.20. □

Example 5.31 (A worked interpolation over ℚ).

Find the polynomial of degree at most 2 with f⁢(0)=1, f⁢(1)=3, and f⁢(2)=7. The basis polynomials for the nodes 0,1,2 are

ℓ0 =(X−1)⁢(X−2)(0−1)⁢(0−2)=(X−1)⁢(X−2)2,
ℓ1 =(X−0)⁢(X−2)(1−0)⁢(1−2)=−X⁢(X−2),
ℓ2 =(X−0)⁢(X−1)(2−0)⁢(2−1)=X⁢(X−1)2.

Hence

f= 1⋅ℓ0+3⋅ℓ1+7⋅ℓ2=12⁢(X2−3⁢X+2)+3⁢(2⁢X−X2)+72⁢(X2−X)=X2+X+1,

and indeed f⁢(0)=1, f⁢(1)=3, f⁢(2)=7.

Remark 5.32 (The evaluation isomorphism).

Fix d+1 distinct nodes and let V={f∈F⁢[X]:deg⁡f≤d}. In the language of the linear-algebra section later in the volume, V is a (d+1)-dimensional vector space over F with basis 1,X,…,Xd, and the evaluation map

ev:V→Fd+1,f⟼(f⁢(x0),…,f⁢(xd)),

is F-linear. Its surjectivity is exactly the existence half of 5.30, and its injectivity exactly the uniqueness half; so ev is a linear isomorphism V≅Fd+1. The Lagrange basis {ℓi} is precisely the basis of V matched to the standard coordinates of Fd+1, by the delta property (4): the polynomial with prescribed values (y0,…,yd) has coordinates (y0,…,yd) in the basis {ℓi}. This switching between a polynomial’s coefficient representation and its evaluation representation is the conceptual core of fast polynomial arithmetic via the fast Fourier transform, treated with the roots of unity later in the volume, and of the evaluation-domain encodings used throughout Halo 2.

Remark 5.33 (The vanishing polynomial).

The companion object to the Lagrange basis is the vanishing polynomial of the node set {x0,…,xd},

Z⁢(X)=∏i=0d(X−xi),

the unique monic polynomial of degree d+1 vanishing at every node. A polynomial g vanishes on the whole node set if and only if Z∣g. One direction is immediate from 5.16. For the other, apply the factor theorem repeatedly: g⁢(x0)=0 gives g=(X−x0)⁢g1; evaluating at x1≠x0 gives 0=(x1−x0)⁢g1⁢(x1), so g1⁢(x1)=0 since F has no zero divisors, and g1=(X−x1)⁢g2; continuing through the remaining nodes strips off one linear factor per node. The repetition is legitimate precisely because the nodes are distinct—the linear factors X−xi are pairwise coprime. The pair (Lagrange basis, vanishing polynomial) is exactly the data a proof system manipulates when arguing that a committed polynomial agrees with prescribed values on an evaluation domain.

5.8 Multiplicity and the formal derivative

A root can be a root “several times over”: the quadratic X2−2⁢X+1=(X−1)2 vanishes at 1 doubly. Counting roots correctly requires making that idea precise, and detecting it requires a derivative—which we define with no limits at all.

Definition 5.34 (Multiplicity of a root).

Let f∈F⁢[X] be nonzero and let α∈F be a root of f. The multiplicity multα⁡(f) is the largest integer m≥1 with (X−α)m∣f. A root of multiplicity 1 is simple; a root of multiplicity at least 2 is repeated (or multiple).

The largest such m exists: the powers (X−α)m have strictly increasing degrees, so only finitely many can divide the fixed f, and at least one does by the factor theorem. An equivalent characterisation is often handier: m=multα⁡(f) exactly when f=(X−α)m⁢g with g⁢(α)≠0. Indeed, writing f=(X−α)m⁢g with m maximal forces g⁢(α)≠0, else the factor theorem would split a further factor X−α off g; conversely, if f=(X−α)m⁢g with g⁢(α)≠0, then (X−α)m+1∣f would give (X−α)m⁢g=(X−α)m+1⁢h, and cancelling (5.9) g=(X−α)⁢h, making α a root of g.

The count of roots with multiplicity still respects the degree. The proof rests on a small device worth isolating, since it recurs.

Lemma 5.35 (Coprime factors multiply).

Let f1,…,fr∈F⁢[X] be pairwise coprime (gcd⁡(fi,fj)=1 for i≠j) and suppose each fi divides f. Then f1⁢f2⁢⋯⁢fr∣f.

Proof.

First let r=2, and write f=f1⁢u=f2⁢v. Bézout (3) gives s⁢f1+t⁢f2=1, so

f=s⁢f1⁢f+t⁢f2⁢f=s⁢f1⁢(f2⁢v)+t⁢f2⁢(f1⁢u)=f1⁢f2⁢(s⁢v+t⁢u),

and f1⁢f2∣f. For r>2, induct: by hypothesis f1⁢⋯⁢fr−1∣f, and the product f1⁢⋯⁢fr−1 is coprime to fr—a nonconstant common divisor would have a monic irreducible factor (5.28), which by Euclid’s lemma (5.25(2)) would divide some fi with i<r as well as fr, contradicting gcd⁡(fi,fr)=1. Now apply the case r=2. □

Proposition 5.36 (Counting roots with multiplicity).

Let f∈F⁢[X] be nonzero of degree d, with all its distinct roots α1,…,αr∈F of multiplicities m1,…,mr. Then

f=(X−α1)m1⁢⋯⁢(X−αr)mr⁢g

for some g∈F⁢[X] with no roots in F, and ∑imi≤d. The number of roots counted with multiplicity is thus at most d, with equality if and only if f splits into linear factors over F.

Proof.

We first check that the powers (X−αi)mi are pairwise coprime. Each X−αi is monic irreducible (degree 1), and by unique factorisation the monic divisors of (X−αi)mi are exactly the powers (X−αi)e with 0≤e≤mi. For i≠j the only monic polynomial that is simultaneously a power of X−αi and of X−αj is 1, since X−αi=X−αj would force αi=αj; so gcd⁡((X−αi)mi,(X−αj)mj)=1.

Each (X−αi)mi divides f by the definition of multiplicity, so 5.35 gives f=(X−α1)m1⁢⋯⁢(X−αr)mr⁢g. Maximality of each mi gives g⁢(αi)≠0: a further factor X−αi inside g would raise the multiplicity. And g has no other roots either: a root β of g is a root of f, hence one of the αi. Taking degrees with (2),

m1+⋯+mr+deg⁡g=d,

so ∑imi≤d, with equality precisely when deg⁡g=0, that is, when f is a constant times a product of linear factors. □

Definition 5.37 (Formal derivative).

The formal derivative is the map D:F⁢[X]→F⁢[X] defined on f=∑i=0nai⁢Xi by

f′=D⁢f=∑i=1ni⁢ai⁢Xi−1=a1+2⁢a2⁢X+⋯+n⁢an⁢Xn−1,

where the coefficient i⁢ai means ai added to itself i times in F—that is, ai multiplied by the image of the integer i under the canonical map ℤ→F (4.30). No limits are involved: the definition is purely formal and algebraic, valid over any field, and it is introduced for one purpose—to detect repeated roots without any appeal to analysis.

Proposition 5.38 (Rules of formal differentiation).

For all f,g∈F⁢[X], c∈F, α∈F, and m≥1:

  1. 1.

    (Linearity.) (f+g)′=f′+g′ and (c⁢f)′=c⁢f′.

  2. 2.

    (Product rule.) (f⁢g)′=f′⁢g+f⁢g′.

  3. 3.

    (Power rule.) ((X−α)m)′=m⁢(X−α)m−1.

Proof.

(1) is immediate from the coordinatewise, visibly linear definition of D.

(2) Both sides are bilinear in the pair (f,g): by part (1), each is linear in f with g fixed and linear in g with f fixed. It therefore suffices to verify the identity on monomials f=Xa, g=Xb, since every polynomial is a linear combination of monomials and the general case follows by expanding f=∑aua⁢Xa, g=∑bvb⁢Xb and applying the monomial case termwise. On monomials,

(Xa⁢Xb)′=(Xa+b)′=(a+b)⁢Xa+b−1=a⁢Xa−1⁢Xb+Xa⁢b⁢Xb−1=(Xa)′⁢Xb+Xa⁢(Xb)′,

with the convention that a term carrying the integer coefficient 0 (the case a=0 or b=0) is the zero polynomial.

(3) Induct on m. The base is (X−α)′=1. For the step, the product rule gives

((X−α)m)′=((X−α)⁢(X−α)m−1)′=(X−α)m−1+(X−α)⁢(m−1)⁢(X−α)m−2=m⁢(X−α)m−1.∎

Part (3) of the next theorem must exhibit a repeated root inside an extension field that is not given in advance; the following lemma manufactures the required extension. It is the quotient recipe of Example 4.22 carried out for polynomial rings, and the proof is the argument that made ℤ/p⁢ℤ a field (4.26), transposed from ℤ to F⁢[X].

Lemma 5.39 (Adjoining a root).

Let h∈F⁢[X] be irreducible. Then the quotient ring K=F⁢[X]/(h) is a field; the map a↦a+(h) embeds F into K as a subfield, so that K is an extension of F; and the class α=X+(h) is a root of h in K.

Proof.

The principal ideal (h)=h⁢F⁢[X] is an ideal of the commutative ring F⁢[X] (Example 4.18(2)), so K is a commutative ring under the coset operations (4.20). Its identity is not zero: 1+(h)=0+(h) would say h∣1, impossible since a factorisation 1=h⁢k has degree deg⁡h+deg⁡k=0 by (2), while deg⁡h≥1.

Every nonzero class is a unit. Let f+(h)≠0+(h), i.e. h∤f. The gcd gcd⁡(h,f) is then a monic divisor of the irreducible h other than its monic associate, hence equals 1, exactly as in the proof of 5.25(2); Bézout’s identity (3) supplies s,t∈F⁢[X] with s⁢f+t⁢h=1, and reducing modulo (h) gives (s+(h))⁢(f+(h))=1+(h). So K is a field.

The map ι⁢(a)=a+(h) on constants preserves sums, products, and 1 directly from the coset operations of 4.19, and it is injective: ι⁢(a)=0 with a≠0 would make h divide a nonzero constant, again impossible by degrees. We identify F with its image, making K an extension field of F.

Finally, write h=∑ici⁢Xi and compute in K:

h⁢(α)=∑iι⁢(ci)⁢(X+(h))i=(∑ici⁢Xi)+(h)=h+(h)=0+(h),

so α is a root of h in K. □

Theorem 5.40 (Derivative test for repeated roots; separability).

Let f∈F⁢[X] be nonzero and α∈F.

  1. 1.

    The element α is a repeated root of f—a root of multiplicity at least 2—if and only if f⁢(α)=0 and f′⁢(α)=0.

  2. 2.

    If f has a repeated root in F, then gcd⁡(f,f′)≠1.

  3. 3.

    Call f separable if it has no repeated root in any field containing F. Then f is separable if and only if gcd⁡(f,f′)=1 in F⁢[X].

Proof.

(1) Let α be a root of multiplicity m≥1 and write f=(X−α)m⁢g with g⁢(α)≠0. The product and power rules give

f′=m⁢(X−α)m−1⁢g+(X−α)m⁢g′=(X−α)m−1⁢[m⁢g+(X−α)⁢g′].

If m=1, the first factor is 1 and evaluating at α gives f′⁢(α)=1⋅g⁢(α)=g⁢(α)≠0: a simple root of f is not a root of f′. If m≥2, then (X−α)m−1 divides f′ and vanishes at α, so f′⁢(α)=0. Together with the factor theorem for f⁢(α)=0, this proves the equivalence.

(2) A repeated root α∈F is a common root of f and f′ by (1), so the factor theorem puts the common factor X−α into both, and (X−α)∣gcd⁡(f,f′).

(3) The key observation is that gcds are stable under field extension: for an extension field K of F (4.25), the Euclidean algorithm of 5.23 run on f,f′∈F⁢[X] uses only field operations on their coefficients, which lie in F; run inside K⁢[X] on the same inputs it produces the identical quotients and remainders. Hence the gcd computed in K⁢[X] equals the gcd computed in F⁢[X].

Suppose gcd⁡(f,f′)=1 in F⁢[X], and let K⊇F be any extension. By stability, gcd⁡(f,f′)=1 in K⁢[X] as well, so by (2) applied over K, the polynomial f has no repeated root in K: f is separable.

Conversely, suppose d=gcd⁡(f,f′) is nonconstant; we exhibit a repeated root in some extension. Let h be a monic irreducible factor of d (5.28), and let K=F⁢[X]/(h) be the extension field supplied by 5.39, in which h has a root α. The polynomial h divides d, which divides both f and f′; evaluating the factorisations at α (5.16) gives f⁢(α)=f′⁢(α)=0. By (1), applied over K, the element α is a repeated root of f in K: f is not separable. □

The stability observation in the proof deserves emphasis as a technique: it licenses testing separability—the absence of repeated roots in every extension of the base field at once—by a gcd computation carried out entirely in the base field.

Remark 5.41 (The pitfall of positive characteristic).

The integer coefficient i in f′=∑ii⁢ai⁢Xi−1 is interpreted in F, and may vanish there. Over a field of characteristic p—where p=0 in F, p prime, the setting of 𝔽p and 𝔽q (4.30)—the derivative of Xp is p⁢Xp−1=0. Thus f=Xp−1 over 𝔽p has f′=0 and gcd⁡(f,f′)=gcd⁡(f,0)=f≠1; and indeed

Xp−1=(X−1)pin ⁢𝔽p⁢[X],

a factorisation the finite-fields section establishes through the freshman’s-dream identity (a+b)p=ap+bp of characteristic p (6.13, applied to (X+(−1))p together with (−1)p=−1 in every 𝔽p): a single root 1 of multiplicity p. This characteristic-p behaviour is a structural feature to respect when working over the finite fields of Orchard, not a pathology to avoid.

5.9 Polynomials versus polynomial functions

The opening of this section insisted that a polynomial is not a function. The debt of that insistence now falls due: we make the relationship precise and show exactly when it is safe—and when it is not—to conflate the two.

Definition 5.42 (Polynomial function).

Every f∈F⁢[X] induces a polynomial function

f~:F→F,α⟼f⁢(α).

The assignment f↦f~ is a ring homomorphism from F⁢[X] to the ring FF of all functions F→F under pointwise operations ((u+v)⁢(α)=u⁢(α)+v⁢(α) and (u⁢v)⁢(α)=u⁢(α)⁢v⁢(α)), by 5.16 applied at every point.

Proposition 5.43 (When formal equals functional).

Let f,g∈F⁢[X].

  1. 1.

    If F is infinite, then f~=g~ as functions implies f=g as polynomials. Equivalently, f↦f~ is injective, and polynomials over an infinite field may be identified with polynomial functions.

  2. 2.

    If F is finite, the map is not injective. Over 𝔽p, the nonzero polynomial Xp−X induces the zero function, since Fermat’s little theorem (Corollary 3.32) gives αp=α for every α∈𝔽p.

Proof.

(1) Let h=f−g, so that h~ is the zero function: h vanishes at every point of the infinite set F. Were h nonzero of degree d, it would have at most d roots (5.18), yet it has infinitely many—a contradiction. Hence h=0.

(2) Let F be finite, with q=|F| elements, and consider the vanishing-polynomial witness

w⁢(X)=∏α∈F(X−α),

a monic polynomial of degree q—in particular nonzero as a formal object—which vanishes at every point of F by construction. Thus w~=0~ while w≠0: the map f↦f~ identifies distinct polynomials. Over F=𝔽p the witness specialises to Xp−X: by Fermat’s little theorem every element of 𝔽p is a root of the monic degree-p polynomial Xp−X, so 5.36 factors it as ∏α∈𝔽p(X−α)—the p distinct linear factors exhaust the degree—and Xp−X induces the zero function despite having degree p≥1. □

Remark 5.44 (Why the formal viewpoint is the correct one).

Part (2) of 5.43 is precisely why polynomials are defined as coefficient sequences and not as functions. Cryptography works over finite fields, where the functional view loses information: the polynomials X and Xp induce the same function on 𝔽p, yet have degrees 1 and p. And the degree of a polynomial—a property of the formal object, invisible to the induced function over a finite field—is what the security of polynomial commitment schemes rests on. A prover commits to a low-degree formal polynomial; the verifier tests it by evaluation; and the gap between agreement-as-function at the tested points and identity to the claimed formal polynomial is exactly what the Schwartz–Zippel lemma, next, quantifies.

5.10 The Schwartz–Zippel lemma

Only one preliminary is needed to state the payoff theorem. To draw α uniformly at random from a finite nonempty set S means to select each element with equal likelihood 1/|S|; the probability of an event is then the fraction of elements of S producing it, so that Pr⁡[f⁢(α)=0]=|{α∈S:f⁢(α)=0}|/|S|. The systematic language of probability is developed later in the volume; this counting case is all the theorem needs.

Theorem 5.45 (Univariate Schwartz–Zippel).

Let f∈F⁢[X] be nonzero of degree at most d, let S⊆F be finite and nonempty, and let α be drawn uniformly at random from S. Then

Pr⁡[f⁢(α)=0]≤d|S|. (5)

More generally, if f,g∈F⁢[X] are distinct, each of degree at most d, then Pr⁡[f⁢(α)=g⁢(α)]≤d/|S|.

Proof.

By 5.18, the nonzero f has at most d roots in F, hence at most d in the subset S. Under the uniform draw,

Pr⁡[f⁢(α)=0]=|{α∈S:f⁢(α)=0}||S|≤d|S|.

For the general form, apply this to h=f−g, which is nonzero and has degree at most d by (1), noting that f⁢(α)=g⁢(α) exactly when h⁢(α)=0. □

Remark 5.46 (The lemma stated plainly, and used).

Inequality (5) formalises the slogan: two low-degree polynomials that agree at many points must be equal. The deterministic version is 5.20—agreement at d+1 points forces equality—and Schwartz–Zippel is its probabilistic refinement: a single random evaluation point detects unequal polynomials of degree at most d, except with probability at most d/|S|. With |S| exponentially large—taking S=𝔽q with q≈2254, the 255-bit fields underlying Orchard—and d polynomially bounded, the failure probability is astronomically small; the term negligible receives its precise asymptotic meaning later in the volume. This is the foundational soundness argument for polynomial identity testing, and hence for the polynomial commitment schemes and arithmetisation checks of Halo 2: to verify a purported polynomial identity, evaluate both sides at a random challenge and compare.

Remark 5.47 (Multivariate generalisation).

The full Schwartz–Zippel lemma extends to polynomials in several indeterminates f∈F⁢[X1,…,Xn]: a nonzero polynomial of total degree d—the largest sum of exponents i1+⋯+in over the monomials with nonzero coefficient—vanishes at a uniformly random point of Sn with probability at most d/|S|. The univariate case proved here is both the base case of the multivariate inductive proof and the version most directly used: the later volumes invoke only the univariate lemma directly. Where an identity in several random challenges arises—for instance a permutation argument drawing a pair of challenges (β,γ)—the multivariate bound applies and follows from the univariate lemma applied once per variable.

The cheque drawn in the section’s opening can now be cashed in full. Two parties hold polynomials f and g of degree at most d over a 255-bit field 𝔽q—even with d in the millions, they agree on a uniformly random challenge α∈𝔽q with probability at most d/q≈d⋅2−254 unless they are literally the same formal polynomial. One evaluation apiece, one comparison of field elements, and the enormous coefficient lists never change hands: that is the trade the proving system makes on every identity it checks, and the entire cost of the bargain is the elementary fact with which the section began—a nonzero polynomial of degree d over a field has at most d roots.