Agarwal–Cooley: a short product is a multidimensional cyclic convolution
ProvedIntMul.HvdH.agarwal_cooley_polyfourier-analysisinteger-multiplication
Agarwal–Cooley reindexing. Let be pairwise coprime, , and let be the Chinese-remainder isomorphism . Let be a commutative ring and with . Then for every ,
where exponents in are read as their representatives in .
So the coefficients of are the entries of the -dimensional cyclic convolution of the arrays and . These are steps (1)–(2) of Proposition 5.4: since , the product may be computed modulo , and the ring isomorphism , , is a relabelling of coefficients.
Formalization Note is Mathlib's ZMod.prodEquivPi, and is natDegree (so ).
Preamble
import Mathlib open Polynomial
Formal statement
namespace IntMul.HvdH
theorem agarwal_cooley_poly {d : ℕ} (s : Fin d → ℕ) [∀ i, NeZero (s i)]
(hcop : Pairwise (Function.onFun Nat.Coprime s)) {R : Type} [CommRing R] (F G : R[X])
(hdeg : F.natDegree + G.natDegree < ∏ i, s i) (j : ℕ) (hj : j < ∏ i, s i) :
(F * G).coeff j =
∑ b : Π i, ZMod (s i),
F.coeff ((ZMod.prodEquivPi s hcop).symm b).val *
G.coeff ((ZMod.prodEquivPi s hcop).symm (ZMod.prodEquivPi s hcop j - b)).val := by sorry
end IntMul.HvdHSource
D. Harvey and J. van der Hoeven, Integer multiplication in time O(n log n), Annals of Mathematics 193 (2021), no. 2, 563–617, https://doi.org/10.4007/annals.2021.193.2.4, §5.3 proof of Proposition 5.4, steps (1)–(2) (deg H < S, so it suffices to compute F G mod x^S − 1; the Agarwal–Cooley isomorphism Z[x]/(x^S−1) ≅ Z[x_1,…,x_d]/(x_i^{s_i}−1) sending x to x_1⋯x_d, for pairwise coprime s_i); R. Agarwal and J. Cooley, New algorithms for digital convolution, IEEE Trans. ASSP 25 (1977)