Shared radix-2 NTT transform #
This file provides the root-parametric bit-reversal and butterfly machinery used by forward and inverse radix-2 NTTs.
Reverse the lowest bits bits of i.
Instances For
def
CompPoly.CPolynomial.NTT.Transform.butterflyStageSpec
{R : Type u_1}
[Field R]
(D : Domain R)
(stage : ℕ)
(a : Array R)
:
Array R
Pure structural-recursive specification of one butterfly stage.
This matches the imperative control flow of butterflyStage, but replaces the
for loops with explicit Nat.rec recursors.
Instances For
theorem
CompPoly.CPolynomial.NTT.Transform.butterflyStage_eq_butterflyStageSpec
{R : Type u_1}
[Field R]
(D : Domain R)
(stage : ℕ)
(a : Array R)
:
The imperative butterfly loop agrees with the pure pointwise butterfly stage specification.
This is where the local set! bookkeeping for one stage belongs.