Algorithm Search⌘K

Proofs: Equal-degree factorization

These are the human proofs of Equal-degree factorization, at full length.

EQUAL-DEGREE returns the irreducible factors and stops with probability one full

This proof shows: correctness.

Let pp be a prime, Fp=Z/pZ\mathbb{F}_p = \mathbb{Z}/p\mathbb{Z}, d≥1d \ge 1, and f=q1⋯qr∈Fp[x]f = q_1 \cdots q_r \in \mathbb{F}_p[x] with distinct monic irreducible qjq_j of degree dd. Let K=FpdK = \mathbb{F}_{p^d} be a field with pdp^d elements. For odd pp, e=(pd−1)/2e = (p^d - 1)/2. For p=2p = 2, T(y)=y+y2+⋯+y2d−1T(y) = y + y^2 + \cdots + y^{2^{d-1}}.

Lemma 1 (pieces). Every polynomial on the stack and in the output is monic and is the product of a nonempty set of the qjq_j, and the sets of all polynomials on the stack and in the output form a partition of {q1,…,qr}\{q_1, \ldots, q_r\}.

Proof. This holds after line L1. Line L3 removes hh and either line L4 moves it to the output, or line L6 or line L9 pushes gg and h/gh/g, or line L9 pushes hh back. In line L6 and line L9, gg is a monic divisor of hh with g≠1g \ne 1 and g≠hg \ne h (in line L6, g≠hg \ne h since deg⁡a<deg⁡h\deg a < \deg h and a≠0a \ne 0). As hh is square-free, gg is the product of a nonempty proper subset of the factors of hh, and h/gh/g is the product of the rest. □\square

Output. By Lemma 1, each output hh with deg⁡h=d\deg h = d is a product of qjq_j of degree dd, so it is exactly one qjq_j. When the stack is empty, Lemma 1 says that the output is a partition of {q1,…,qr}\{q_1, \ldots, q_r\} into single factors, so it lists each qjq_j exactly once.

Lemma 2 (Chinese remainder theorem). Let h=qj1⋯qjsh = q_{j_1} \cdots q_{j_s} as in Lemma 1. The map a↦(a mod qj1,…,a mod qjs)a \mapsto (a \bmod q_{j_1}, \ldots, a \bmod q_{j_s}) is a ring isomorphism from Fp[x]/(h)\mathbb{F}_p[x]/(h) onto ∏i=1sFp[x]/(qji)\prod_{i=1}^s \mathbb{F}_p[x]/(q_{j_i}), and each factor is a field with pdp^d elements. So if aa is uniform among the polynomials of degree less than deg⁡h\deg h, the residues ai=a mod qjia_i = a \bmod q_{j_i} are independent and uniform in fields with pdp^d elements.

Proof. The qjiq_{j_i} are pairwise coprime, so this is the Chinese remainder theorem for Fp[x]\mathbb{F}_p[x]. Both sides have pdeg⁡hp^{\deg h} elements, so the bijection maps the uniform distribution to the uniform distribution on the product. Each qjiq_{j_i} is irreducible of degree dd, so Fp[x]/(qji)\mathbb{F}_p[x]/(q_{j_i}) is a field with pdp^d elements. □\square

Lemma 3 (the values of bb). Let LL be a field with pdp^d elements and y∈Ly \in L.

  1. If pp is odd, then ye∈{0,1,−1}y^e \in \{0, 1, -1\}; ye=0y^e = 0 only for y=0y = 0, and ye=1y^e = 1 for exactly (pd−1)/2(p^d - 1)/2 values of yy.
  2. If p=2p = 2, then T(y)∈{0,1}T(y) \in \{0, 1\}, and T(y)=1T(y) = 1 for exactly 2d−12^{d-1} values of yy.

Proof. (1) The group L×L^\times is cyclic of even order pd−1p^d - 1. For y≠0y \ne 0, (ye)2=ypd−1=1(y^e)^2 = y^{p^d - 1} = 1, so ye=±1y^e = \pm 1, and 1≠−11 \ne -1 since pp is odd. The map y↦yey \mapsto y^e is a group homomorphism from L×L^\times to {±1}\{\pm 1\}. With a generator γ\gamma, γe≠1\gamma^e \ne 1 because the order of γ\gamma is 2e>e2e > e, so the map is onto and its kernel has (pd−1)/2(p^d - 1)/2 elements.

(2) In characteristic 22, y↦y2y \mapsto y^2 is additive, so TT is additive, and T(y)2=y2+⋯+y2d=T(y)−y+y2d=T(y)T(y)^2 = y^2 + \cdots + y^{2^d} = T(y) - y + y^{2^d} = T(y), since y2d=yy^{2^d} = y in LL. So T(y)T(y) is a root of z2−zz^2 - z, which means T(y)∈{0,1}T(y) \in \{0, 1\}. TT is a polynomial in yy of degree 2d−12^{d-1}, so it has at most 2d−1<2d2^{d-1} < 2^d roots, and TT is not zero. So TT is an onto additive map from LL to {0,1}\{0, 1\}, and each of its two values is taken 2d−12^{d-1} times. □\square

Lemma 4 (one attempt). Let hh be a piece with s≥2s \ge 2 factors, and aa uniform among the polynomials of degree less than deg⁡h\deg h, drawn again while aa is constant. Then the attempt at lines L5 to L9 pushes a proper factorization of hh with probability at least 1/21/2.

Proof. Let m=deg⁡hm = \deg h and let uu be uniform over all polynomials of degree less than mm, constants included, with residues ui=u mod qjiu_i = u \bmod q_{j_i}. Let EE be the event that the values uieu_i^e (or T(ui)T(u_i) for p=2p = 2) are all equal, and for odd pp also all ui≠0u_i \ne 0.

A nonconstant aa that fails lies in EE. By Lemma 2, b=ae mod hb = a^e \bmod h (or T(a) mod hT(a) \bmod h) has residues bi=aieb_i = a_i^e (or T(ai)T(a_i)) modulo qjiq_{j_i}, so gcd⁡(b−1,h)\gcd(b - 1, h) is the product of the qjiq_{j_i} with bi=1b_i = 1, and line L9 splits hh unless all bib_i are equal. If gcd⁡(a,h)≠1\gcd(a, h) \ne 1, line L6 splits hh, since a≠0a \ne 0 and deg⁡a<m\deg a < m give g≠hg \ne h. So for odd pp a failure needs gcd⁡(a,h)=1\gcd(a, h) = 1, that is, all ai≠0a_i \ne 0, and all bib_i equal.

The probability of EE. For odd pp, by Lemma 3 each uiu_i is nonzero with uie=1u_i^e = 1 with probability (pd−1)/(2pd)<1/2(p^d - 1)/(2 p^d) < 1/2, and the same holds for −1-1. By the independence of Lemma 2, Pr⁡[E]<2⋅2−s≤1/2\Pr[E] < 2 \cdot 2^{-s} \le 1/2. For p=2p = 2, each T(ui)T(u_i) is 00 or 11 with probability exactly 1/21/2, so Pr⁡[E]=2⋅2−s≤1/2\Pr[E] = 2 \cdot 2^{-s} \le 1/2.

Drawing again while aa is constant. Then aa is distributed as uu given that uu is not constant. Let cc be the probability that uu is constant and c′c' the probability that uu is a constant in EE. A constant has equal residues, so every nonzero constant is in EE, and for p=2p = 2 also 00; hence c′≥c(p−1)/p≥c/2c' \ge c (p - 1)/p \ge c/2. The failure probability is at most Pr⁡[E and u not constant]/(1−c)=(Pr⁡[E]−c′)/(1−c)≤(1/2−c/2)/(1−c)=1/2\Pr[E \text{ and } u \text{ not constant}]/(1 - c) = (\Pr[E] - c')/(1 - c) \le (1/2 - c/2)/(1 - c) = 1/2. □\square

Termination. Each attempt on a piece with s≥2s \ge 2 factors succeeds with probability at least 1/21/2, independently of earlier attempts. So the number of attempts on that piece until it splits is at most a geometric random variable with mean 22, and it is finite with probability 11. Each split increases the number of pieces by one, and there are at most rr pieces, so there are r−1r - 1 splits and rr outputs in all. Pieces with one factor have degree dd and are output at line L4 without an attempt. So the algorithm stops with probability 11, after an expected number of at most 2(r−1)2(r - 1) attempts, and by the part on the output it then returns q1,…,qrq_1, \ldots, q_r. ■\blacksquare

Back to Equal-degree factorization