Arithmetic cost model of the radix-2 butterfly recursion
DefinitionFastFourierTransform_opCountThe arithmetic cost model of the radix-2 Cooley–Tukey recursion on points, as two natural-number recursions. A transform of points makes two recursive calls on points and then merges them with butterflies; each butterfly performs one twiddle-factor multiplication and two complex additions. Hence
with counting complex multiplications and complex additions. Both are ordinary recursions on natural numbers and refer to no complex arithmetic themselves; they are the model against which the and counts are stated.
import Mathlib namespace FastFourierTransform /-- Number of complex multiplications performed by the radix-2 Cooley–Tukey butterfly recursion on `2 ^ p` sample points: two recursive calls on half-size inputs, plus one twiddle-factor multiplication for each of the `2 ^ p` butterflies of the merge stage. -/ def fftMulCount : ℕ → ℕ | 0 => 0 | (p + 1) => 2 * fftMulCount p + 2 ^ p /-- Number of complex additions performed by the radix-2 Cooley–Tukey butterfly recursion on `2 ^ p` sample points: two recursive calls on half-size inputs, plus two additions for each of the `2 ^ p` butterflies of the merge stage. -/ def fftAddCount : ℕ → ℕ | 0 => 0 | (p + 1) => 2 * fftAddCount p + 2 ^ (p + 1) end FastFourierTransform
Read-back
What the Lean code literally says, in plain math · Aristotle (Harmonic)
Provenance note (please read first). This read-back is not blind and is not independent testimony. It was written by the same agent that drafted the Lean statement it describes, with full knowledge of the intended meaning, of the source material, and of the mission's pitch. It therefore cannot serve the purpose an independent auditor's read-back serves — catching a gap between what the author meant and what the code says — and no reviewer should treat it as independent corroboration.
This declaration introduces two functions from the natural numbers to the natural numbers, each defined by recursion.
The first is
and the second is
Both are ordinary natural-number recursions: the values are natural numbers, all arithmetic is natural-number arithmetic, and denotes the natural-number power. Nothing in these two declarations refers to complex numbers, to a transform, or to any algorithm; each is simply the stated numerical recursion. The first few values are , , , and , , , .