These are the human proofs of Good-Thomas prime-factor FFT, at full length.
The Good-Thomas re-indexing turns a DFT with coprime factors into a multidimensional DFT without twiddle factors full
This proof shows: correctness, complexity, error-bound.
Let R be a commutative ring, n=n1⋯nr with the ni pairwise coprime, and ω∈R a principal n-th root of unity: ωn=1 and ∑j=0n−1ωjl=0 for 1≤l≤n−1. Put Ni=n/ni and ei=Ni−1modni. Define ι(j1,…,jr)=∑iNijimodn (line L2) and κ(k1,…,kr)=∑iNieikimodn (line L5), on tuples with 0≤ji,ki<ni.
Lemma 1 (bijections).ι and κ are bijections onto {0,…,n−1}, and κ(k1,…,kr)≡ki(modni) for every i.
Proof. For a=i, na∣Ni, so ι(j)≡Naja(modna) and κ(k)≡Naeaka≡ka(modna). Since gcd(Na,na)=1, Na is invertible modulo na, so the residues of ι(j) modulo all na determine j, and those of κ(k) are k itself. By the Chinese remainder theorem a number in {0,…,n−1} is determined by its residues modulo the na, so both maps are injective, and both sets have n elements. □
Lemma 2 (splitting the kernel).ωι(j)κ(k)=∏i=1r(ωNi)jiki.
Proof. Since ωn=1, exponents may be taken modulo n. ι(j)κ(k)≡∑a,iNaNieijaki(modn). For a=i, NaNi is a multiple of n, since every nb divides Na or Ni and the nb are pairwise coprime; so only the terms a=i remain, and ωι(j)κ(k)=∏i(ωNi)Nieijiki. Now (ωNi)ni=1 and Niei≡1(modni), so (ωNi)Nieijiki=(ωNi)jiki. □
Lemma 3 (axis roots). If n is a unit of R, then ωNi is a principal ni-th root of unity. (Theorem 1 below does not need this; it matters when line L4 uses a fast short DFT, such as a radix-2 FFT, that requires a principal root.)
Proof. Let ζ=ωNi. Then ζni=ωn=1. Fix 1≤l≤ni−1 and put T=∑m=0ni−1ζml. Writing j=qni+m with 0≤q<Ni and 0≤m<ni, and using ωqniNil=1, we get ∑j=0n−1ωjNil=NiT. The left side is 0 because 1≤Nil≤n−Ni<n and ω is principal. Since Nini=n is a unit, so is Ni, hence T=0. □
Proof. Line L2 sets A[j1,…,jr]=xι(j). The loop of lines L3 and L4 applies, for i=1,…,r, the DFT of length ni with the root ωNi along the axis i. These maps act on different indices and are linear, so after the loop
by Lemma 2. Since ι is a bijection (Lemma 1), this is ∑j=0n−1xjωjκ(k)=Xκ(k). Line L5 stores it at the index κ(k), and since κ is a bijection, every entry of X is written exactly once. □
Theorem 2 (inverse). If n is a unit of R, running GOOD-THOMAS with ω−1 and multiplying by n−1 returns x from X.
Proof.ω−1 is a principal n-th root (as in Theorem 2 of the FFT proof), so by Theorem 1 the procedure computes Yl=∑kXkω−lk=∑jxj∑kω(j−l)k=nxl, by the definition of a principal root. □
Operation count. Line L4 for the axis i runs Ni=n/ni short DFTs. If each costs M(ni) multiplications and S(ni) additions, the total is n∑iM(ni)/ni multiplications and n∑iS(ni)/ni additions. Lines L2 and L5 are permutations, with no ring operations. The direct short DFT used by the implementation does (ni−1)2 multiplications by roots other than 1 and ni(ni−1) additions, so the total is at most n∑i(ni−1) of each.
Theorem 3 (rounding error over C). Suppose ω=e−2πi/n, each computed root power r^ has ∣r^−r∣≤μ, complex products have relative error at most 2γ2 (Higham, Lemma 3.5), and the short DFTs are direct sums evaluated left to right. Then
∥X^−X∥2≤i=1∑rni(γni−1+2γ2+μ)∥X∥2+O(u2).
Proof. Let ci=γni−1+2γ2+μ. Consider one short DFT of a line z∈Cm, m=ni, with outputs Yk=∑lzlrlk, ∣r∣=1. Each product zlr^lk is computed with error at most (μ+2γ2)∣zl∣+O(u2), and the recursive sum of m complex terms tl has error at most γm−1∑l∣tl∣, since each of the real and imaginary parts does and (∑lal)2+(∑lbl)2≤∑lal2+bl2 for al,bl≥0. So ∣Y^k−Yk∣≤ci∑l∣zl∣+O(u2)≤cim∥z∥2+O(u2), and over the m outputs, ∥Y^−Y∥2≤cim∥z∥2+O(u2)=cim∥Y∥2+O(u2), since ∥Y∥2=m∥z∥2. Summing over the lines of an axis, the pass i maps the array z(i−1) to Siz(i−1) with Si=niQi, Qi unitary, and adds an error ei with ∥ei∥2≤cini∥Siz(i−1)∥2+O(u2). The permutations of lines L2 and L5 are exact and preserve norms. By linearity, the final error is ∑iSr⋯Si+1ei, and ∥Sr⋯Si+1Siz(i−1)∥2=n∥x∥2(1+O(u))=∥X∥2(1+O(u)), so each term has norm at most cini∥X∥2+O(u2). Summing over i gives the bound. ■