Characteristic-Independent Cantor–Zassenhaus Finite-Field Root Finding #
This module implements randomized finite-field root finding via the degree-one specialization of
Cantor–Zassenhaus splitting over an arbitrary finite field F (of either odd or even
characteristic). Polynomials are represented as little-endian coefficient lists
(Polynomial.CoeffList), and randomness is modeled as a Cslib.ProbComp computation drawing
uniform field elements via Cslib.ProbComp.uniform F.
Given a coefficient list p : List F representing a nonzero univariate polynomial of degree at
most d over a finite field F of cardinality q = Fintype.card F:
- Linear squarefree part (
linearPartCL): computesg₀ = gcd(p, X^q - X mod p)using binary modular exponentiation (powModCL), isolating the squarefree product of distinct linear factorsX - r(r ∈ F) and discarding irreducible factors of degree greater than1as well as root multiplicities ([vonZurGathenGerhard2013], §14.5). - Degree-one characteristic-independent splitting (
czSplitPoly,czRefineList): specializes equal-degree splitting to degree1:- In odd characteristic (
q % 2 = 1), splits factors using(X - a)^((q - 1)/2) - 1 mod gfor a uniforma ∈ F([Rabin1980b];[CantorZassenhaus1981];[vonZurGathenGerhard2013], §§14.3 and 14.5). - In characteristic
2(q = 2^mwithm = Nat.log 2 q), splits factors using the Frobenius trace polynomial∑_{k < m} (a * X)^(2^k) mod g(tracePolyModCL) for a uniforma ∈ F([vonZurGathenGerhard2013], Exercise 14.16). In both regimes, each independent uniform samplea ∈ Fseparates any fixed pair of distinct rootsr₁ ≠ r₂with probability at least1 / 3(at least1 / 2in characteristic2and(q - 1) / (2 * q) ≥ 1 / 3for all odd prime powersq ≥ 3).
- In odd characteristic (
- Fixed-round sampling schedule & root extraction (
czLoopFacs,extractLinearRoots,findRootsCZ): instead of a Las Vegas loop that retries until all factors are linear,findRootsCZ rounds pexecutes a fixed budget ofroundssynchronous refinement rounds—making0queries and returning[]immediately wheng₀.length ≤ 1, and otherwise drawing one uniform elementa ← ProbComp.uniform Fper round and applying it to every current factor of length greater than2. Afterward,extractLinearRootsreads-c₀ / c₁from each length-2 factor and drops any unsplit factors of degree at least2.
Scope and guarantees #
This module delivers finite-field root finding (degree-one factors only); it does not return
general equal-degree factors of degree greater than 1.
isQueryBounded_findRootsCZ:findRootsCZissues at mostroundsuniform queries (counting uniform samples fromProbComp.uniform F, not algebraic operations or running time).findRootsCZ_sound: every element in any supported output is a root ofofCoeffList pinF.findRootsCZ_complete: for any nonzeroofCoeffList pof degree at mostd, the probability that at least oneF-root is missing from the output is at mostd^2 * (2 / 3)^rounds.
Main definitions #
Cslib.Algorithms.Algebra.CantorZassenhaus.powModCL: binary modular exponentiation on coefficient lists.Cslib.Algorithms.Algebra.CantorZassenhaus.tracePolyModCL: Frobenius trace polynomial modulo a coefficient list for characteristic-2 splitting.Cslib.Algorithms.Algebra.CantorZassenhaus.linearPartCL: squarefree linear partgcd(p, X^q - X mod p).Cslib.Algorithms.Algebra.CantorZassenhaus.czSplitPoly,czRefineList,czLoopFacs,extractLinearRoots,findRootsCZ: degree-one Cantor–Zassenhaus splitting, fixed-round refinement loop, linear root extraction, and finite-field root finder.
Main results #
Cslib.Algorithms.Algebra.CantorZassenhaus.ofCoeffList_powModCL: correctness of binary modular exponentiation on coefficient lists.Cslib.Algorithms.Algebra.CantorZassenhaus.isQueryBounded_findRootsCZ:findRootsCZmakes at mostroundsuniform queries.Cslib.Algorithms.Algebra.CantorZassenhaus.findRootsCZ_sound: every returned element is a root ofofCoeffList pinF.Cslib.Algorithms.Algebra.CantorZassenhaus.findRootsCZ_complete: failure probability of missing anyF-root is at mostd^2 * (2 / 3)^roundsfor nonzero inputs of degree at mostd.
References #
Binary modular exponentiation base ^ e mod m on polynomial coefficient lists.
powModCL base e m represents (ofCoeffList base) ^ e % ofCoeffList m.
Trace polynomial ∑_{k=0}^{m-1} (a * X)^(2^k) mod g for characteristic-2 degree-one splitting
([vonZurGathenGerhard2013], Exercise 14.16).
Squarefree linear-factor part gcd(p, X^q - X mod p) of a univariate coefficient list p
([vonZurGathenGerhard2013], §14.5).
One degree-one Cantor–Zassenhaus splitting polynomial given field cardinality q and sample
a : F: (X - a)^((q - 1)/2) - 1 mod g when q is odd ([Rabin1980b],
[CantorZassenhaus1981], [vonZurGathenGerhard2013] §§14.3, 14.5), and the Frobenius trace
polynomial tracePolyModCL (Nat.log 2 q) a g when q is even ([vonZurGathenGerhard2013],
Exercise 14.16).
Refine a list of squarefree linear-splitting factors using one sample a : F.
Each factor g of length at most 2 is kept as is. For a factor g of length greater than 2,
computes h = gcd(g, czSplitPoly q a g) and splits g into [h, g / h] when 1 < h.length
and h.length < g.length, or retains [g] otherwise.
Extract the unique root -c₀ / c₁ from every linear (length-2) factor in a list, dropping
factors of any other length.
Run r synchronous rounds of Cantor–Zassenhaus factor refinement, drawing one uniform sample
from ProbComp.uniform F per round and applying czRefineList to the current factor list.
Fixed-round Cantor–Zassenhaus finite-field root finder over a finite field F.
Extracts the squarefree linear part g₀ = linearPartCL (Fintype.card F) p = gcd(p, X^q - X mod p)
(discarding irreducible factors of degree greater than 1), runs rounds synchronous refinement
rounds with one uniform draw from ProbComp.uniform F per round (or zero draws if g₀.length ≤ 1),
and returns the roots extracted from all resulting linear factors.
findRootsCZ issues at most rounds uniform queries (one ProbComp.uniform F draw per
refinement round, or zero when linearPartCL (Fintype.card F) p has length at most 1). This
counts uniform samples only and makes no claim about algebraic operation count or running time.
Soundness of findRootsCZ: every element in any supported output is a root of
ofCoeffList p in F.
Completeness of findRootsCZ: if ofCoeffList p ≠ 0 has degree at most d, then the
probability that findRootsCZ misses at least one F-root is at most
d^2 * (2 / 3)^rounds.