The iterative radix-2 FFT computes the DFT, and INVERSE-FFT inverts it full
This proof shows: correctness, complexity.
Let R be a commutative ring, n=2t with t≥0, and ω∈R with ωn/2=−1 if n≥2. Then ωn=1. Write x for the input array and x′ for the array as the algorithm changes it. For h=2q with 0≤q≤t and a block start s with h∣s, let c(s,h)=revt−q(s/h), so 0≤c(s,h)<n/h, and define the subsequence x(s,h)∈Rh by xm(s,h)=xc(s,h)+mn/h for 0≤m<h.
Lemma 1 (split). Let N=2M≥2 and ζ∈R with ζM=−1. For y∈RN, let E and O be the DFTs of length M with the root ζ2 of (y0,y2,…,yN−2) and (y1,y3,…,yN−1). Then for 0≤k<M,
m=0∑N−1ymζmk=Ek+ζkOk,m=0∑N−1ymζm(k+M)=Ek−ζkOk. Proof. Split the sum by the parity of m=2m′ or m=2m′+1: ∑mymζmk′=∑m′y2m′(ζ2)m′k′+ζk′∑m′y2m′+1(ζ2)m′k′ for each k′. For k′=k this is Ek+ζkOk. For k′=k+M, (ζ2)m′(k+M)=(ζ2)m′k(ζ2M)m′=(ζ2)m′k because ζ2M=1, and ζk+M=−ζk. □
Lemma 2 (indices). Let h=2q with q<t and 2h∣s. Then c(s,h)=c(s,2h) and c(s+h,h)=c(s,2h)+n/(2h). Hence x(s,h) and x(s+h,h) are the even-indexed and the odd-indexed entries of x(s,2h).
Proof. Let s/(2h)=a. Then s/h=2a and (s+h)/h=2a+1, written with t−q binary digits. Reversing t−q digits moves the lowest digit to the top place 2t−q−1=n/(2h) and reverses the other t−q−1 digits, so revt−q(2a+b)=b⋅n/(2h)+revt−q−1(a) for b∈{0,1}, and revt−q−1(a)=c(s,2h). So xm(s,h)=xc(s,2h)+2m⋅n/(2h)=x2m(s,2h) and xm(s+h,h)=xc(s,2h)+(2m+1)n/(2h)=x2m+1(s,2h). □
Invariant (I). When line L6 tests h=2q, for each s with h∣s and 0≤k<h,
x′[s+k]=m=0∑h−1xm(s,h)(ωn/h)mk. Initialization. Lines L3 and L4 swap each pair {j,revt(j)} with j<revt(j) exactly once and leave the fixed points alone. Since revt is an involution, the pairs are disjoint, and afterwards x′[j]=xrevt(j) for each j. Line L5 sets h=1, and (I) for h=1 says x′[s]=x0(s,1)=xrevt(s), which holds.
Maintenance. Let (I) hold for h<n, and fix a block start s with 2h∣s. Put ζ=ωn/(2h) and M=h. Then ζM=ωn/2=−1 and ζ2=ωn/h. By (I) and Lemma 2, before the loop of line L8 the cells x′[s…s+h−1] hold E and the cells x′[s+h…s+2h−1] hold O, the DFTs with the root ζ2 of the even and odd entries of y=x(s,2h). For each k<h, lines L9 to L12 read only the cells s+k and s+k+h, and write only those two cells, so the iterations for different k do not interfere, and blocks for different s are disjoint. The table entry is W[k⋅n/(2h)]=ωkn/(2h)=ζk by line L2, and k⋅n/(2h)<n/2, so it is in the table. Line L9 saves u=Ek before line L11 overwrites it, line L10 computes v=ζkOk, and lines L11 and L12 store Ek+ζkOk and Ek−ζkOk. By Lemma 1 with N=2h, these are the entries k and k+h of the DFT of x(s,2h) with the root ζ=ωn/(2h). After line L13 doubles h, (I) holds for the new h.
Termination. The loop ends when h=n. Then the only block start is s=0, c(0,n)=rev0(0)=0, and x(0,n)=x. So by (I), x′[k]=∑mxmωmk=Xk for each k.
Theorem 1. If n=2t and ωn/2=−1 (no condition when n=1), FFT(x,ω) replaces x by Fnx, with (Fnx)k=∑jxjωjk. This holds in particular when ω is a principal n-th root of unity and n is a unit, because then ωn/2=−1 by the cancellation lemma, and for ω=e∓2πi/n over C.
Proof. The invariant and the termination step above. □
Theorem 2. If ω is a principal n-th root of unity and n is a unit of R, then INVERSE-FFT(Fnx,ω) returns x.
Proof. The element ω−1=ωn−1 is a principal n-th root: (ω−1)n=1, and for 1≤k≤n−1, ∑jω−jk=∑jωj(n−k)=0 since 1≤n−k≤n−1. So by Theorem 1, line L14 computes Yj=∑kXkω−jk=∑lxl∑kω(l−j)k. By the summation lemma in the form of the definition of a principal root, the inner sum is n if l=j and 0 otherwise, for 0≤l,j≤n−1. So Yj=nxj, and line L15 returns xj. ■
Operation count. Each pass of the loop of line L6 runs n/(2h) blocks of h butterflies, and each butterfly does one multiplication (line L10) and two additions (lines L11 and L12). There are t passes, with h=1,2,…,n/2. So the butterflies use exactly 2nt=2nlgn multiplications and nlgn additions in R. Line L2 needs at most max(n/2−2,0) multiplications if each power is the previous one times ω, and line L15 needs n more for the inverse.