The decimation-in-frequency and decimation-in-time stages compute the DFT in bit-reversed and natural order, and their pairing computes the cyclic convolution full
This proof shows: correctness, complexity.
Setting. R is a commutative ring, n=2t with t≥0, and ω∈R satisfies ωn=1 and, if t≥1, ωn/2=−1. This implies that ω is a principal n-th root of unity (proved on the page on roots of unity). Conversely, a principal root has ωn/2=−1 whenever 2n⋅1 is not a zero divisor, for then ∑j<n(ωn/2)j=2n(1+ωn/2)=0 forces ωn/2=−1; this covers every field of characteristic other than 2, every Z/pZ with p odd, and every ring in which n is a unit. (Without it the radix-2 split fails: in Z/4Z, ω=1 is a principal 4-th root, but ω2=−1.) If t≥2, the element ω2 has the same two properties for n/2, since (ω2)n/4=ωn/2=−1; this is what the inductions use. For 0≤i<2t let revt(i) be i with its t binary digits reversed, and let (Py)i=yrevt(i). Since revt is an involution, P−1=P. Two facts about digits are used: for 0≤q<2t−1,
revt(q)=2revt−1(q),revt(2t−1+q)=2revt−1(q)+1,(1) because the top digit of q is 0 and that of 2t−1+q is 1, and reversal moves the top digit to the bottom. Also, revt(2q)=revt−1(q) and revt(2q+1)=2t−1+revt−1(q) by the same reasoning.
Lemma 1 (decimation in frequency). Let Dtω be the map of lines L3 to L10 on an array of length 2t, with W[k]=ωk. Then Dtω(x)=PDFTω(x).
Proof. Induction on t. For t=0 the loop does nothing and P is the identity. Let t≥1 and n=2t. The first pass has h=n/2, one block s=0, and stride n/(2h)=1; its butterflies touch the disjoint pairs (k,k+n/2), read both cells before writing, and produce
uj=xj+xj+n/2,vj=ωj(xj−xj+n/2),0≤j<n/2. Split the sum for Xk at n/2 and use ω(j+n/2)k=ωjk(−1)k:
Xk=j<n/2∑(xj+(−1)kxj+n/2)ωjk. For k=2m this is ∑juj(ω2)jm, and for k=2m+1 it is ∑j(xj−xj+n/2)ωj(ω2)jm=∑jvj(ω2)jm. So (X2m)m=DFTω2(u) and (X2m+1)m=DFTω2(v).
The later passes have h≤n/4, so every block of length 2h lies inside one half of the array, and no butterfly mixes the halves. On each half, the pass with half length h reads W[k⋅n/(2h)]=ωkn/(2h)=(ω2)k⋅(n/2)/(2h), which is the twiddle factor of the pass with half length h of Dt−1ω2. So the later passes apply Dt−1ω2 to u and to v separately. By the induction hypothesis, for 0≤q<n/2, position q ends with X2revt−1(q), and position n/2+q ends with X2revt−1(q)+1. By (1) these are Xrevt(q) and Xrevt(n/2+q). □
Correctness of ITERATIVE-FFT. Lines L11 and L12 visit each pair {j,revt(j)} with j=revt(j) once, at its smaller element, and swap it, so they apply P. By Lemma 1 the result is PPDFTω(x)=DFTω(x).
Lemma 2 (decimation in time). Let Ttω be the map of lines L16 to L22 on an array of length 2t with V[k]=ωk. Then Ttω(Pz)=DFTω(z) for each z∈R2t.
Proof. Induction on t; t=0 is trivial. Let t≥1, n=2t, and y=Pz. The passes with h≤n/4 never mix the halves, and on each half they are the passes of Tt−1ω2, by the same computation of the twiddle factors as in Lemma 1. By the facts after (1), for q<n/2, yq=zrevt(q)=z2revt−1(q) and yn/2+q=z2revt−1(q)+1. So the first half of y is Pt−1e with em=z2m, and the second half is Pt−1o with om=z2m+1. By the induction hypothesis, after the first t−1 passes the halves hold E=DFTω2(e) and O=DFTω2(o). The last pass, h=n/2, maps (Ek,Ok) to (Ek+ωkOk, Ek−ωkOk). Splitting Xk by the parity of j gives Xk=Ekmodn/2+ωkOkmodn/2, and ωk+n/2=−ωk, so these two values are Xk and Xk+n/2. □
Correctness of CYCLIC-CONVOLUTION. By Lemma 1, after line L13, a and b hold Pa^ and Pb^, where a^=DFTω(a). Since (Py)i=yrevt(i), line L14 gives c=P(a^⊙b^) with the entrywise product ⊙. The element ω−1=ωn−1 is again a principal n-th root of unity (its powers are those of ω in another order), so Lemma 2 applies with the root ω−1 and gives DFTω−1(a^⊙b^) after line L22. By the convolution theorem, a^⊙b^=DFTω(a∗b), where (a∗b)m=∑jajb(m−j)modn: indeed ∑m(a∗b)mωmk=∑jajωjk∑mb(m−j)modnω(m−j)k, and the inner sum is b^k because ωn=1. Finally, DFTω−1(DFTω(y))=ny, since its entry j is ∑mym∑kω(m−j)k=nyj by the definition of a principal root. So after line L22, c=n(a∗b), and since n is a unit, line L23 returns a∗b.
Operation count. In every pass there are n/(2h) blocks of h butterflies, so n/2 butterflies, each with one addition, one subtraction and one multiplication. There are t=lgn passes. So lines L3 to L10, and also lines L16 to L22, do exactly nlgn additions and subtractions and 2nlgn multiplications, for every input, and ITERATIVE-FFT does no further ring operation except at most n/2 multiplications for the table of line L2. CYCLIC-CONVOLUTION does three such transforms, n multiplications in line L14 and n in line L23: 3nlgn additions and 23nlgn+2n multiplications, besides the two tables. The index work is proportional to the number of butterflies plus O(n) for the permutation, so the time is Θ(nlogn) for every input. The transforms write only into the arrays they are given; the tables take Θ(n) extra space. ■