Basic NTTFast correctness facts #
Cached-plan well-formedness, twiddle-table facts, and shared proof helpers for
NTTFast correctness.
The cached twiddle powers for a stage have exactly one entry per butterfly offset.
Entries of the cached twiddle powers are the corresponding powers of the stage root.
Looking up a valid stage in the twiddle table returns that stage's twiddle powers.
A plan built directly from a domain has well-formed cached data.
Loading raw coefficients into a domain-sized array is Array.ofFn with zero padding.
Folding over List.range is equivalent to the corresponding natural recursion.
First projections of pair-valued folds over List.range match natural recursion.
Two fold functions give the same range fold when they agree at every step.
A property preserved by every step is preserved by folding over List.range.
Congruence for range folds under an invariant preserved by the left fold.
Shift a List.range' fold by one when the folded function shifts its index.
Reindex a List.range' fold as a fold over List.range with an offset.
Split a List.range' fold over an appended interval into two folds.
Move an operation through a range fold when it commutes with every step.
Swap two range folds when every step of one commutes with every step of the other.
Split a fold of paired same-index operations into two separate range folds.
Fold a pair of consecutive indexed operations as one fold over twice the range.
Split a fold of four same-index operations into four separate range folds.
Express the recursive DIT block loop as a fold over baseline NTT block steps.