Exact multidimensional cyclic convolution over a Fermat ring
ProvedIntMul.HvdH.fermConv_eqinteger-multiplication
Let , and with dividing . Put and . Let be integer arrays on the box with all entries of absolute value at most , where
The algorithm fermConv packs each row along the last axis as an integer reduced mod . It applies the synthetic transform with (a principal -th root of unity mod ). It multiplies pointwise mod , applies the inverse transform, takes the balanced residue, unpacks base- digits, folds digits and , and divides by . For every in-box index it returns exactly the cyclic convolution
This is the exact convolution step in a machine implementation of Theorem 3.1 of Harvey–van der Hoeven: the complex convolution of fixed-point Gaussian integers is computed without error, and only one rounding is needed at the end.
Preamble
import Definitions.Def_IntMul_HvdH_FermConv
Formal statement
namespace IntMul.HvdH
theorem fermConv_eq {d : ℕ} (P r : ℕ) (e : Fin d → ℕ) (hr : 1 ≤ r) (hP : 1 ≤ P)
(he1 : ∀ i, 1 ≤ e i) (he : ∀ i, 2 ^ e i ∣ 2 * r)
(x y : (Fin (d + 1) → ℕ) → ℤ) (M : ℤ) (hM0 : 0 ≤ M)
(hx : ∀ z : Fin (d + 1) → ℕ, (∀ i : Fin d, z i.castSucc < 2 ^ e i) → z (Fin.last d) < r → |x z| ≤ M)
(hy : ∀ z : Fin (d + 1) → ℕ, (∀ i : Fin d, z i.castSucc < 2 ^ e i) → z (Fin.last d) < r → |y z| ≤ M)
(hPM : 2 * (2 ^ (∑ i, e i)) ^ 2 * r * M ^ 2 < (2 : ℤ) ^ P)
(j : Fin (d + 1) → ℕ) (hj : ∀ i : Fin d, j i.castSucc < 2 ^ e i) (hc : j (Fin.last d) < r) :
fermConv P r e x y j =
∑ k ∈ Fintype.piFinset (fun i : Fin d => Finset.range (2 ^ e i)), ∑ c ∈ Finset.range r,
x (Fin.snoc (fun i => k i) c) *
y (Fin.snoc (fun i => (j i.castSucc + 2 ^ e i - k i) % 2 ^ e i)
((j (Fin.last d) + r - c) % r)) := by sorry
end IntMul.HvdHSource
Harvey, van der Hoeven, Integer multiplication in time O(n log n), Annals of Math. 193 (2021), https://hal.science/hal-02070778, §3 (variant with exact convolution over a Fermat ring)