Cost of cyclic reduction full
This proof shows: time.worst, time.best, space.extra, flops.worst, span.worst.
Let the levels have orders N0=n, Nj+1=⌊Nj/2⌋, until NL=1, so L=⌊log2n⌋.
Flops per row. A reduced row with both neighbours costs 2 divisions (α, γ), 6 multiplications and 4 additions: 12 flops. A reduced row without a right neighbour (when Nj is even, the last odd row) costs 6. Recovering an even unknown costs 5 flops with two neighbours, 3 with one, and the final 1×1 solve costs 1.
Exact count for n=2k−1. Then Nj=2k−j−1 is odd for all j, so every reduced row has both neighbours. The reduced rows number ∑j≥1Nj=∑i=1k−1(2i−1)=n−k, costing 12(n−k). The recovered unknowns number ∑j<L(Nj−Nj+1)=n−1; at each of the k−1 levels two of them are at the ends, so they cost 5(n−1)−4(k−1). With the final division, the total is 12(n−k)+5(n−1)−4(k−1)+1=17n−16k.
General n. Every row costs at most its two-neighbour price, so the flops are at most 12∑j≥1Nj+5(n−1)+1. Since ∑j≥1⌊n/2j⌋=n−s(n), where s(n)≥1 is the number of ones in the binary expansion of n, this is at most 12(n−1)+5(n−1)+1≤17n. Each level has at most 2 end unknowns at 3 flops and at most one reduced row at 6, so at most 4+6=10 flops fewer than the full price 12(n−s(n))+5(n−1)+1. With s(n)≤log2n+1 and L≤log2n, the count is at least 17n−22log2n−16, which is 17n−O(logn). (For n<400 the tests observe the sharper lower bound 17n−16(⌊log2n⌋+1).)
Time. Each flop is O(1) work, and the bookkeeping per row is O(1), so the time is Θ(n) in every case (every row is touched at least once).
Space. Level j≥1 stores four arrays of length Nj, and the back substitution an array of length Nj; ∑j≥1Nj<n, so the extra storage is at most 5n+O(1) numbers plus the copy of the input, Θ(n).
Span. With one processor per row, the rows of a level in lines L3 to L6 depend only on the previous level, so a level takes O(1) parallel steps; the same holds for lines L10 to L11. There are 2L+1=Θ(logn) such phases, and they are sequential since each uses the previous one. So the span is Θ(logn). ■
Correctness of cyclic reduction full
This proof shows: correctness, termination.
Exact arithmetic. A level acts on a tridiagonal system of order N≥2 with rows aixi−1+bixi+cixi+1=di, a0=cN−1=0. Let E={0,2,4,…} and O={1,3,5,…} be the even and odd indices below N.
Lemma 1 (one level is a Schur complement). Suppose bk=0 for every k∈E. Write A in the order (E,O) as (DEAOEAEOAOO). Then DE is diagonal, AOO is diagonal, and the Schur complement S=AOO−AOEDE−1AEO, with right-hand side dO−AOEDE−1dE, is the tridiagonal system of line L6.
Proof. Two indices of the same parity differ by at least 2, so they are not coupled, and both diagonal blocks are diagonal. Row i∈O of AOE has the entries ai in column i−1 and ci in column i+1 (if i+1<N). Column j∈O of AEO has cj−1 in row j−1 and aj+1 in row j+1. So (AOEDE−1AEO)ij is a sum over k∈{i−1,i+1}∩{j−1,j+1}, which is empty unless ∣i−j∣≤2. For j=i it is aici−1/bi−1+ciai+1/bi+1, so Sii=bi+αici−1+γiai+1. For j=i−2 only k=i−1 contributes, aiai−1/bi−1, so Si,i−2=αiai−1; symmetrically Si,i+2=γici+1. The right-hand side is di+αidi−1+γidi+1 in the same way. (When i+1=N, the terms with i+1 are absent, as in line L5.) □
Theorem 2 (one level is exact). Under the hypothesis of Lemma 1, x solves Ax=d if and only if xO solves SxO=dO−AOEDE−1dE and, for each i∈E, xi=(di−aixi−1−cixi+1)/bi.
Proof. The block system is DExE+AEOxO=dE and AOExE+AOOxO=dO. The first gives xE=DE−1(dE−AEOxO), which is line L11, and substituting it into the second gives the reduced system. Conversely these two relations imply both block equations. □
Theorem 3 (the algorithm is elimination without pivoting on PAPT). Let P order the indices as the even indices of level 0, then (in original numbering) those eliminated at level 1, and so on, ending with the single index of the last level. The pivots used by the algorithm are, in order, the pivots of Gaussian elimination without pivoting on PAPT. Hence the algorithm runs without a zero pivot if and only if all leading principal minors of PAPT are nonzero, and then it returns A−1d.
Proof. Eliminating the first block of PAPT, the diagonal block DE, by Gaussian elimination uses the pivots bk, k∈E, unchanged, since no elimination step touches another row of E; what remains is exactly the Schur complement S of Lemma 1. Induct on the levels: the pivots of the next block are the even diagonal entries of S, and so on, and the last pivot is the 1×1 system of line L7. Gaussian elimination without pivoting completes if and only if the leading principal minors are nonzero, since the k-th pivot is the ratio of the k-th and (k−1)-th minors. By Theorem 2 at every level, the back substitution returns the solution. □
In particular, if A is singular then so is PAPT, its last leading minor is det(PAPT)=0, and the algorithm stops with a zero pivot.
Theorem 4 (diagonal dominance improves). If β=β(A)=maxi(∣ai∣+∣ci∣)/∣bi∣<1, then every bk=0 and the reduced matrix satisfies β(S)≤β2.
Proof. Fix i∈O and write p=∣ai∣, q=∣ci∣, s=∣ci−1∣/∣bi−1∣ and t=∣ai+1∣/∣bi+1∣ (with q=t=0 when i+1=N). Dominance of rows i−1 and i+1 gives ∣ai−1∣/∣bi−1∣≤β−s and ∣ci+1∣/∣bi+1∣≤β−t. Hence
∣Si,i−2∣+∣Si,i+2∣=p∣bi−1∣∣ai−1∣+q∣bi+1∣∣ci+1∣≤β(p+q)−(ps+qt), ∣Sii∣≥∣bi∣−ps−qt. Since p+q≤β∣bi∣, the first bound is at most β2∣bi∣−(ps+qt)≤β2(∣bi∣−ps−qt)≤β2∣Sii∣, using β2≤1. Also ∣Sii∣≥∣bi∣−(p+q)β≥(1−β2)∣bi∣>0. □
Theorem 5 (SPD is preserved). If A is symmetric positive definite, then PAPT is, every Schur complement of a symmetric positive definite matrix is symmetric positive definite, and all pivots are positive. □
Termination. Each pass of line L2 maps N≥2 to ⌊N/2⌋, with 1≤⌊N/2⌋<N, so after ⌊log2n⌋ passes N=1; the back substitution pops the same number of systems. The algorithm either raises at a zero pivot or returns. ■