Algorithm Search⌘K

Proofs: Cantor-Zassenhaus algorithm

These are the human proofs of Cantor-Zassenhaus algorithm, at full length.

CANTOR-ZASSENHAUS returns the complete factorization 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}, and f∈Fp[x]f \in \mathbb{F}_p[x] nonzero with c=lc(f)c = \mathrm{lc}(f). We use two facts from the pages on the stages. DISTINCT-DEGREE(s)(s), for monic square-free ss, returns the pairs (g,d)(g, d) with g≠1g \ne 1 the product of the irreducible factors of ss of degree dd. EQUAL-DEGREE(g,d)(g, d), for such gg, returns the irreducible factors of gg and stops with probability 11.

Lemma 1 (derivative). Let u=∏qqequ = \prod_q q^{e_q} be monic with distinct monic irreducible qq. Then gcd⁡(u,u′)=∏p∤eqqeq−1∏p∣eqqeq\gcd(u, u') = \prod_{p \nmid e_q} q^{e_q - 1} \prod_{p \mid e_q} q^{e_q}.

Proof. Fix one qq and write u=qetu = q^{e} t with q∤tq \nmid t. Then u′=qe−1(e q′t+qt′)u' = q^{e - 1}(e\, q' t + q t'). If p∣ep \mid e, the first term is zero and qe∣u′q^e \mid u'. If p∤ep \nmid e, then q∤e q′tq \nmid e\, q' t: q∤tq \nmid t, and q′≠0q' \ne 0 has degree less than deg⁡q\deg q, since an irreducible qq with q′=0q' = 0 would be a pp-th power (∑jajpxj)p\left(\sum_j a_{jp} x^j\right)^p. So qe−1q^{e-1} is the exact power of qq that divides u′u'. Taking the minimum with eqe_q for every qq gives the claim. □\square

Lemma 2 (pp-th roots). If every exponent of v=∑iaixiv = \sum_i a_i x^i is a multiple of pp, then v=(∑jajpxj)pv = \left(\sum_j a_{jp} x^j\right)^p.

Proof. In characteristic pp, (y+z)p=yp+zp(y + z)^p = y^p + z^p, and ap=aa^p = a for a∈Fpa \in \mathbb{F}_p by Fermat's little theorem. So (∑jajpxj)p=∑jajppxjp=∑jajpxjp=v\left(\sum_j a_{jp} x^j\right)^p = \sum_j a_{jp}^p x^{jp} = \sum_j a_{jp} x^{jp} = v. □\square

Invariant of the work list. We prove by induction on the pushes: for every pair (u,k)(u, k) on the work list, k=pjk = p^j for some j≥0j \ge 0, and u=∏qeq/ku = \prod q^{e_q / k}, the product over the irreducible q∣fq \mid f with pj∣eqp^j \mid e_q, where eqe_q is the multiplicity of qq in ff.

Base. At line L1, (f/c,1)(f/c, 1) has this form with j=0j = 0.

Step. Let (u,k)(u, k) with k=pjk = p^j be popped at line L3, and write ϵq=eq/k\epsilon_q = e_q / k for the multiplicities in uu. By Lemma 1, line L3 gives v=∏p∤ϵqqϵq−1∏p∣ϵqqϵqv = \prod_{p \nmid \epsilon_q} q^{\epsilon_q - 1} \prod_{p \mid \epsilon_q} q^{\epsilon_q} and w=u/v=∏p∤ϵqqw = u / v = \prod_{p \nmid \epsilon_q} q. Claim: before the test at line L4,

w=∏p∤ϵq, ϵq≥iq,v=∏p∤ϵq, ϵq≥iqϵq−i∏p∣ϵqqϵq.w = \prod_{p \nmid \epsilon_q,\ \epsilon_q \ge i} q, \qquad v = \prod_{p \nmid \epsilon_q,\ \epsilon_q \ge i} q^{\epsilon_q - i} \prod_{p \mid \epsilon_q} q^{\epsilon_q}.

This holds for i=1i = 1. At line L5, every q∣wq \mid w has p∤ϵqp \nmid \epsilon_q, and q∣vq \mid v exactly when ϵq>i\epsilon_q > i, so y=∏p∤ϵq, ϵq>iqy = \prod_{p \nmid \epsilon_q,\ \epsilon_q > i} q and s=∏p∤ϵq, ϵq=iqs = \prod_{p \nmid \epsilon_q,\ \epsilon_q = i} q. Line L9 then makes w=yw = y and divides each exponent ϵq−i≥1\epsilon_q - i \ge 1 in vv by one factor qq, which is the claim for i+1i + 1.

The loop ends when w=1w = 1, that is, when no qq with p∤ϵqp \nmid \epsilon_q has ϵq≥i\epsilon_q \ge i. Then v=∏p∣ϵqqϵqv = \prod_{p \mid \epsilon_q} q^{\epsilon_q}. All exponents of vv as a polynomial are multiples of pp, since vv is the pp-th power of ∏p∣ϵqqϵq/p\prod_{p \mid \epsilon_q} q^{\epsilon_q / p}, and by Lemma 2 and unique factorization, the pp-th root at line L10 is ∏p∣ϵqqϵq/p=∏pj+1∣eqqeq/(pk)\prod_{p \mid \epsilon_q} q^{\epsilon_q / p} = \prod_{p^{j+1} \mid e_q} q^{e_q / (p k)}. So the pushed pair (⋅,pk)(\cdot, p k) has the claimed form with j+1j + 1. □\square

Output. In the step above, each qq with pj∣eqp^j \mid e_q and p∤eq/pjp \nmid e_q / p^j is in ss exactly once, at i=ϵq=eq/ki = \epsilon_q = e_q / k. Then ss is monic and square-free, so by the facts on DISTINCT-DEGREE and EQUAL-DEGREE, lines L7 and L8 append (q,ik)=(q,eq)(q, i k) = (q, e_q), and only such pairs. Every irreducible q∣fq \mid f has a unique jj with pj∣eqp^j \mid e_q and p∤eq/pjp \nmid e_q / p^j, and the pair with k=pjk = p^j is on the work list by the invariant, since pj′∣eqp^{j'} \mid e_q for all j′≤jj' \le j. So the result lists every (q,eq)(q, e_q) exactly once, and line L11 returns cc and this list. Then f=c∏qqeqf = c \prod_q q^{e_q}.

Termination. For a pushed pair with k=pjk = p^{j}, deg⁡u≤n/pj\deg u \le n / p^{j}, so j≤log⁡pnj \le \log_p n for u≠1u \ne 1, and a pair is pushed only if v≠1v \ne 1. So at most log⁡pn+1\log_p n + 1 pairs are popped. In the inner loop at line L4, ii grows by one per step, and w=1w = 1 as soon as ii exceeds every ϵq\epsilon_q, so it stops after at most deg⁡u\deg u steps. Each call of EQUAL-DEGREE stops with probability 11. So the algorithm stops with probability 11. ■\blacksquare

Back to Cantor-Zassenhaus algorithm