Forward NTT #
This file provides spec-level forward NTT definitions together with an iterative radix-2 implementation.
Proof-oriented stagewise specification for the forward transform.
forwardStageSpec D completed a means: start from the bit-reversed input a,
then apply exactly the first completed radix-2 butterfly stages.
Instances For
Stagewise pure specification built from butterflyStageSpec.
This removes the mutable-array implementation details but still mirrors the radix-2 control flow exactly.
Instances For
Mathematical partial-DFT state after completed radix-2 stages.
Each contiguous block of size 2^completed has already been transformed, while
the remaining D.logN - completed bits are still encoded by bit-reversed block
selection.
Instances For
The algorithmic stage recursion agrees with the pure stage recursion.
This is the global bookkeeping bridge from the recursive algorithmic stages to their pointwise closed-form counterparts.
Base case of the mathematical stage invariant: before any butterflies, the state is exactly the bit-reversed input.
The pure stage recursion matches the mathematical partial-DFT state at every stage.
Algorithmic stages coincide with the proof-oriented stagewise specification.
This is the loop-invariant bridge: the imperative for stage in [0:D.logN]
implementation computes the same intermediate states as forwardStageSpec.
Basically, this is recursion vs. for loop bookkeeping.
Once all logN stages are completed, the stagewise specification matches the
direct NTT formula.
Once all logN stages are completed, the stagewise specification matches the
direct NTT formula.