Motivation
Modular composition asks, given univariate polynomials f,g,h over a ring, for f(g(X))modh(X). It is the bottleneck step in the classical algorithms for factoring univariate polynomials over finite fields (Cantor–Zassenhaus, von zur Gathen–Shoup, Kaltofen–Shoup), for irreducibility testing and for computing minimal polynomials. Brent and Kung (1978) gave an algorithm using O(n(ω+1)/2) operations for degree n, and for three decades no algorithm with a near-linear operation count was known in general.
Kedlaya and Umans (Dagstuhl Seminar Proceedings 08381, 2008; journal version SIAM J. Comput. 40(6), 2011, doi:10.1137/08073408X) obtained near-linear modular composition over finite fields, and with it asymptotically faster algorithms for factoring polynomials over finite fields. Their route has two halves: a reduction of modular composition to multivariate multipoint evaluation (Section 3), and new fast algorithms for the latter (Sections 4 and 6). This mission formalizes the correctness of the first half, Theorem 3.1. The paper notes that Shoup and Smolensky used essentially the same transformation in an unpublished 1992 manuscript.
Setting
Throughout, R is an arbitrary commutative ring. Variables are indexed from 0.
MULTIVARIATE MULTIPOINT EVALUATION (Problem 2.1): given f∈R[X0,…,Xm−1] with individual degrees at most d−1 and points α0,…,αN−1∈Rm, output f(α0),…,f(αN−1).
MODULAR COMPOSITION (Problem 2.2): given f∈R[X0,…,Xm−1] with individual degrees at most d−1, and g0,…,gm−1,h∈R[X] of degree at most N−1 with the leading coefficient of h a unit, output f(g0(X),…,gm−1(X))modh(X), the unique r with degr<degh and h∣f(g0,…,gm−1)−r.
The inverse Kronecker map (Definition 2.3) ψh,ℓ:R[X0,…,Xm−1]→R[Y0,0,…,Ym−1,ℓ−1] is the R-linear map that sends the monomial ∏iXiei to ∏i∏j<ℓYi,jai,j, where ei=∑j≥0ai,jhj is the base-h expansion. It trades individual degree for number of variables: every individual degree of ψh,ℓ(f) is below h.
The algorithm of Theorem 3.1 takes 2≤d0<d, sets ℓ=⌈logd0d⌉ and N′=Nmℓd0, receives points β0,…,βN′−1∈R whose differences are units, and
- computes f′=ψd0,ℓ(f);
- computes gi,j=gid0jmodh for all i and j<ℓ;
- computes αi,j,k=gi,j(βk);
- computes f′(α0,0,k,…,αm−1,ℓ−1,k) for k<N′ (one multivariate multipoint evaluation);
- interpolates these N′ values at the nodes βk;
- outputs the result modulo h.
Formalization targets
Goal: Theorem 3.1, correctness
algorithm(d0,d,f,g,h,β)=f(g0(X),…,gm−1(X))modh(X),
for all m,N≥1, 2≤d0<d, f with individual degrees ≤d−1, gi,h of degree ≤N−1 with lc(h) a unit, and β0,…,βN′−1 distinct with unit differences. The right-hand side is stated through the characterization of the remainder (divisibility by h and degree below degh).
Milestones (in the order the proof uses them)
- Definition 2.3, remark: if every individual degree of f is at most hℓ−1, then ψh,ℓ(f)(X0h0,…,Xm−1hℓ−1)=f.
- Definition 2.3, remark: ψh,ℓ is injective on such polynomials (not used by the goal).
- Proof of Theorem 3.1: f′(g0,0,…,gm−1,ℓ−1)≡f(g0,…,gm−1)(modh).
- Proof of Theorem 3.1, Step 5: degf′(g0,0(X),…,gm−1,ℓ−1(X))<N′.
A supporting theorem states that the interpolation formula over a commutative ring (Figure 1) recovers every polynomial of degree <n from its values at n nodes with unit differences.
Significance
Theorem 3.1 says that modular composition is no harder than one multivariate multipoint evaluation with mℓ variables, individual degrees below d0, and N′ points, up to quasi-linear univariate work. Combined with the paper's fast multipoint evaluation algorithms this gives modular composition over Fq in n1+o(1)log1+o(1)q bit operations, and from there the paper's improved bounds for polynomial factorization, irreducibility testing, minimal polynomials and modular power projection (Sections 7–8). The converse reduction (Theorem 3.3) shows the two problems are essentially equivalent.
The paper's proof of correctness is a short paragraph; the operation counts are the paper's main concern. This mission makes the correctness exact: the algorithm is defined step for step, and its output is proved equal to the specification. As far as the platform's corpus shows, neither the inverse Kronecker map nor this reduction has a machine-checked statement; the running-time half is not part of this mission.
Difficulty
The obvious argument substitutes gid0j for Yi,j and invokes the inverse Kronecker identity. Two points keep this from being immediate. First, ψh,ℓ is linear but not multiplicative, and it discards base-h digits beyond position ℓ−1; the identity holds only for individual degrees at most hℓ−1, which here requires d≤d0⌈logd0d⌉. Second, the algorithm never sees f′(g0,0,…) itself, only its values at N′ points: interpolation recovers it only if its degree is below N′, which is why Step 2 reduces modulo h before substituting, and interpolation over a ring (not a field) needs the unit-difference hypothesis throughout. Mathlib's Lagrange interpolation is stated over fields, so the ring version must be handled directly.
Formalization scope
- R is any commutative ring (
CommRing R); there is no field or nontriviality assumption.
- Variables are
Fin m; the new variables Yi,j are Fin m × Fin ℓ; points are Fin N'.
- Individual degrees are
MvPolynomial.degreeOf; "degree at most N−1" is natDegree ≤ N - 1.
- ℓ is
Nat.clog d₀ d and N′=Nmℓd0; ℓ is not a free parameter.
- "mod h" for h with unit leading coefficient is the remainder on division by the monic associate h⋅lc(h)−1; interpolation is the Lagrange formula with
Ring.inverse of the node differences.
- Step 4 is
MvPolynomial.eval, which is exactly the output of Problem 2.1.
- Added hypotheses: m≥1 and N≥1 (the paper does not consider m=0, where N′=0, or N=0, where "degree at most N−1" would collapse in natural-number arithmetic).
- In the goal, "degr<degh" is weakened to "degr<degh or r=0" only to cover the zero ring; in any nontrivial ring the two agree.
- Only correctness is formalized. Operation counts, the O(⋅) and polylog bounds, and the count of invocations are out of scope.
Step 5 is the interpolation formula applied to the N′ computed values and nodes alone; it is not defined as the polynomial f′(g0,0,…,gm−1,ℓ−1), and the goal is the six-step output, not the congruence alone, so the statement cannot be closed by unfolding definitions.
Useful infrastructure, reusable beyond this mission: base-h digit manipulation of exponent vectors, Lagrange interpolation over commutative rings with unit node differences, and remainders modulo polynomials with unit leading coefficient. Proofs of any milestone, and of the supporting interpolation theorem, are welcome independently.
Selected references
- K. S. Kedlaya, C. Umans, Fast polynomial factorization and modular composition, Dagstuhl Seminar Proceedings 08381, 2008. http://drops.dagstuhl.de/opus/volltexte/2008/1777
- K. S. Kedlaya, C. Umans, Fast polynomial factorization and modular composition, SIAM J. Comput. 40(6):1767–1802, 2011. https://doi.org/10.1137/08073408X
- R. P. Brent, H. T. Kung, Fast algorithms for manipulating formal power series, J. ACM 25(4):581–595, 1978. https://doi.org/10.1145/322092.322099
- J. von zur Gathen, J. Gerhard, Modern Computer Algebra, Cambridge University Press, 1999. https://doi.org/10.1017/CBO9781139856065