These are the human proofs of Fast wavelet transform, at full length.
The periodic fast wavelet transform is orthogonal, its transposed cascade inverts it, and its rounding error grows linearly in the number of levels full
This proof shows: correctness, complexity, error-bound.
Let h=(h0,…,hL−1) be real with L even and ∑lhlhl+2s=δs,0 for every integer s, where hl=0 outside 0≤l<L and δ is the Kronecker delta. Let gl=(−1)lhL−1−l, also zero outside 0≤l<L. For an even m≥2, let Wm be the m×m matrix with
so that lines L6 and L7 compute (s,d)=Wma for the block a of length m.
Lemma 1 (filter identities). For every integer s, ∑lglgl+2s=δs,0 and ∑lhlgl+2s=0.
Proof. With r=L−1−l, ∑lglgl+2s=∑l(−1)2l+2shL−1−lhL−1−l−2s=∑rhrhr−2s=δs,0, by the hypothesis with the shift −s. Next, P=∑lhlgl+2s=∑l(−1)lhlhL−1−2s−l, using (−1)2s=1. Substitute l′=L−1−2s−l: P=∑l′(−1)L−1−2s−l′hL−1−2s−l′hl′=−∑l′(−1)l′hl′hL−1−2s−l′=−P, because L−1−2s is odd. So P=0. □
Lemma 2 (periodization). Let p,q be filters with ∑lplql+2s=cδs,0 for every integer s, and let m be even. Then for 0≤i,i′<m/2, ∑c=0m−1Pi,cQi′,c=cδi,i′, where Pi,c=∑l:2i+l≡cpl and Qi′,c is defined in the same way from q.
Proof. Expanding, ∑cPi,cQi′,c=∑l,l′plql′[2i+l≡2i′+l′(modm)]. The condition says l′=l+2(i−i′)+tm for some integer t, and since m is even, 2(i−i′)+tm=2σt with σt=i−i′+tm/2. So the sum is ∑t∑lplql+2σt=c∑tδσt,0. Since ∣i−i′∣<m/2, σt=0 holds for at most one t, namely t=0 when i=i′, and for no t when i=i′. □
Theorem 1 (one level).Wm is orthogonal for every even m≥2.
Proof. The rows of Wm are the periodized shifts of h (rows i<m/2) and of g (rows m/2+i). Lemma 2 with (p,q)=(h,h) and c=1 (the hypothesis), with (g,g) and c=1, and with (h,g) and c=0 (Lemma 1) gives WmWmT=I. A square matrix with WWT=I is orthogonal. □
Theorem 2 (forward and inverse). Let n be divisible by 2J, and let T=(Wn/2J−1⊕I)⋯(Wn/2⊕In/2)Wn, where Wm⊕I acts on the first m entries and fixes the rest. Then FWT(x,h,J) returns Tx, T is orthogonal, and INVERSE-FWT(Tx,h,J)=x.
Proof. Keep the array z=(a,y[m…n−1]), the current smooth block followed by the details already stored. Initially (line L3) z=x. A pass of lines L5 to L8 replaces the first m entries of z by Wma=(s,d), storing d at positions m/2,…,m−1 and keeping s as the new smooth block of length m/2; so it multiplies z by Wm⊕I. Each block length m=n/2ℓ−1 for ℓ≤J is even because 2J∣n. After J passes and line L9, y=Tx. Each factor is orthogonal by Theorem 1, so T is orthogonal, with T−1=TT=WnT(Wn/2T⊕I)⋯. For the inverse, line L14 computes, for the block (a,d) with d=y[m…2m−1],
So the passes of lines L12 to L15 apply W2mT for 2m=n/2J−1,…,n, in the reverse order of the forward passes, each to the leading block, while the details still to be used stay in place in y. This is TT, so INVERSE-FWT(Tx)=TTTx=x. With J=0, T=I and both procedures return their input. □
Lemma 3 (counting). For a filter p of even length L with ∑lpl2=1, an even m and a vector a∈Rm, ∑i<m/2(∑l∣pl∣∣a(2i+l)modm∣)2≤2L∥a∥22.
Proof. By the Cauchy-Schwarz inequality the left side is at most ∑i∑la(2i+l)modm2. For a fixed index r, the pairs (i,l) with 2i+l≡r(modm) are, for each l with l≡r(mod2), exactly one i∈[0,m/2), and none for the other l, because m is even. There are L/2 such l, so each ar2 appears exactly L/2 times. □
Theorem 3 (rounding error). Suppose the stored filter satisfies ∣h^l−hl∣≤μ∣hl∣, so also ∣g^l−gl∣≤μ∣gl∣, and each dot product of length L in lines L6 and L7 is evaluated in floating point with unit roundoff u and γL=Lu/(1−Lu). Then the computed y^ satisfies
∥y^−Tx∥2≤JL(μ+γL)∥x∥2+O(u2).
Proof. Let z0=x and let zℓ be the computed array after the pass ℓ, and write Mℓ=Wmℓ⊕I with mℓ=n/2ℓ−1. Lines L8 and L9 only copy, so zℓ=Mℓzℓ−1+eℓ, where eℓ is zero outside the first mℓ entries. Write a for the first mℓ entries of zℓ−1. The standard bound for a dot product computed with perturbed coefficients gives, for each output, ∣s^i−si∣≤(μ+γL(1+μ))∑l∣hl∣∣a(2i+l)modmℓ∣, and the same with g for di. Since ∑lhl2=∑lgl2=1, Lemma 3 for h and for g gives ∥eℓ∥22≤(μ+γL)2L∥a∥22+O(u3), so ∥eℓ∥2≤L(μ+γL)∥zℓ−1∥2+O(u2). By induction, using linearity, zJ=MJ⋯M1x+∑ℓ=1JMJ⋯Mℓ+1eℓ. Each Mk is orthogonal by Theorem 1, and ∥zℓ−1∥2=∥x∥2+O(u), so
∥y^−Tx∥2≤ℓ=1∑J∥eℓ∥2≤JL(μ+γL)∥x∥2+O(u2).□
The same argument, with Lemma 3 applied to the transposed sums of line L14 (each output bc is a sum of L products, L/2 from each filter), gives a bound of the same form for INVERSE-FWT.
Operation count. The pass for the block length m computes m/2 dot products of length L with h and m/2 with g: Lm multiplications and (L−1)m additions. Summing over m=n,n/2,…,n/2J−1 gives Ln(2−21−J)<2Ln multiplications and (L−1)n(2−21−J)<2(L−1)n additions. Line L2 costs nothing but sign changes. The inverse pass for the output length 2m does 2Lm multiplications and 2Lm additions, so less than 2Ln of each in total. Both procedures therefore run in Θ(Ln) time, independent of J. ■