Algorithm Search⌘K

Proofs: Hessenberg reduction

These are the human proofs of Hessenberg reduction, at full length.

Householder reduction gives a unitary similarity to Hessenberg form full

This proof shows: correctness, termination, flops.worst.

Notation of the page: A∈Cn×nA \in \mathbb{C}^{n \times n}, Pk=I−βkv^kv^k∗P_k = I - \beta_k \hat v_k \hat v_k^* the reflector of step kk, where v^k\hat v_k is vkv_k padded with kk leading zeros (indices 00 to kk of the 0-based code), and A(k)A^{(k)} the matrix after step kk, with A(0)=AA^{(0)} = A. Exact arithmetic unless stated.

Lemma 1 (the reflector). For x∈Cmx \in \mathbb{C}^m with σ2=∑i≥2∣xi∣2>0\sigma^2 = \sum_{i \ge 2} |x_i|^2 > 0, let ϕ=x1/∣x1∣\phi = x_1 / |x_1| (or ϕ=1\phi = 1 if x1=0x_1 = 0), α=−ϕ∥x∥2\alpha = -\phi \|x\|_2, v=x−αe1v = x - \alpha e_1 and β=2/(v∗v)\beta = 2 / (v^* v). Then P=I−βvv∗P = I - \beta v v^* is unitary and Hermitian, and Px=αe1P x = \alpha e_1.

Proof. P∗=PP^* = P since β\beta is real. P2=I−2βvv∗+β2v(v∗v)v∗=IP^2 = I - 2\beta v v^* + \beta^2 v (v^* v) v^* = I because βv∗v=2\beta v^* v = 2. So PP is unitary. Next, v∗x=∥x∥22−αˉx1=∥x∥22+∥x∥2∣x1∣v^* x = \|x\|_2^2 - \bar\alpha x_1 = \|x\|_2^2 + \|x\|_2 |x_1|, which is real, and v∗v=∥x∥22−2Re⁡(αˉx1)+∣α∣2=2(∥x∥22+∥x∥2∣x1∣)v^* v = \|x\|_2^2 - 2\operatorname{Re}(\bar\alpha x_1) + |\alpha|^2 = 2(\|x\|_2^2 + \|x\|_2 |x_1|). So βv∗x=1\beta v^* x = 1 and Px=x−v=αe1P x = x - v = \alpha e_1. □\square

The choice of the sign makes ∣v1∣=∣x1∣+∥x∥2|v_1| = |x_1| + \|x\|_2, a sum of two nonnegative numbers, so v1v_1 is computed without cancellation. If σ=0\sigma = 0, the code takes β=0\beta = 0, P=IP = I, and the column already has zeros below position 1.

Theorem 1 (invariant). After step kk of the loop of line L1 (k=1,…,n−2k = 1, \dots, n-2 in the 1-based count):

(H) A(k)=Qk∗AQkA^{(k)} = Q_k^* A Q_k with Qk=P1P2⋯PkQ_k = P_1 P_2 \cdots P_k unitary, and aij(k)=0a^{(k)}_{ij} = 0 for all j≤kj \le k and i>j+1i > j + 1.

Proof. By induction on kk; Q0=IQ_0 = I and the statement on zeros is empty for k=0k = 0. Step kk applies PkP_k on the left (line L3) and on the right (line L4), so A(k)=PkA(k−1)Pk=Qk∗AQkA^{(k)} = P_k A^{(k-1)} P_k = Q_k^* A Q_k since Pk∗=PkP_k^* = P_k. The reflector PkP_k acts on rows and columns k+1k+1 to nn only.

Left product. PkP_k leaves rows 1 to kk unchanged, and maps column kk below row kk, the vector x=(ak+1,k(k−1),…,an,k(k−1))x = (a^{(k-1)}_{k+1,k}, \dots, a^{(k-1)}_{n,k}), to αe1\alpha e_1 by Lemma 1. For a column j<kj < k, rows k+1k+1 to nn hold zeros by (H) for k−1k - 1 (since k+1>j+1k + 1 > j + 1), and a linear map sends zero to zero.

Right product. PkP_k on the right combines only columns k+1k+1 to nn. Columns 1 to kk, which hold all the zeros we need, are unchanged.

So after both products, column kk has zeros in rows k+2k + 2 to nn, and the earlier columns keep theirs. Line L5 stores exact zeros where the exact result is zero. □\square

Corollary (correctness). After the last step, k=n−2k = n - 2, the matrix H=A(n−2)H = A^{(n-2)} has hij=0h_{ij} = 0 for i>j+1i > j + 1 and every j≤n−2j \le n - 2; for j≥n−1j \ge n - 1 the condition i>j+1≥ni > j + 1 \ge n is empty. So HH is upper Hessenberg and A=QHQ∗A = Q H Q^* with Q=Qn−2Q = Q_{n-2}, which line L6 accumulates. As a similarity, HH has the same eigenvalues as AA. The first column of QQ is e1e_1, because each PkP_k fixes e1e_1. If AA is Hermitian, then H=Q∗AQH = Q^* A Q is Hermitian and Hessenberg, hence tridiagonal.

Termination. The loop of line L1 has n−2n - 2 iterations (none if n≤2n \le 2), each of finite length.

Theorem 2 (flop count). For real AA, computing HH costs 10n3/3+O(n2)10n^3/3 + O(n^2) flops, and accumulating QQ costs 4n3/3+O(n2)4n^3/3 + O(n^2) more.

Proof. At step kk the reflector has length m=n−km = n - k. Line L3 updates the m×(n−k+1)m \times (n - k + 1) block of rows k+1k + 1 to nn and columns kk to nn: for each column, one inner product and one update, 4m4m flops, so 4m(m+1)4m(m + 1) flops. Line L4 updates the n×mn \times m block of all rows and columns k+1k + 1 to nn: 4nm4 n m flops. Summing over m=2,…,n−1m = 2, \dots, n - 1 (the vector xx has length mm at k=n−mk = n - m): ∑4m2≈4n3/3\sum 4m^2 \approx 4n^3/3 and ∑4nm≈2n3\sum 4nm \approx 2n^3, which add to 10n3/3+O(n2)10n^3/3 + O(n^2). For QQ, a backward accumulation Q=P1(P2(⋯Pn−2))Q = P_1(P_2(\cdots P_{n-2})) that works on the trailing m×mm \times m block costs ∑4m2=4n3/3+O(n2)\sum 4m^2 = 4n^3/3 + O(n^2); the forward product of line L6 updates all nn rows and costs ∑4nm=2n3+O(n2)\sum 4 n m = 2n^3 + O(n^2), which is the simple form the code uses. □\square

Theorem 3 (backward stability). In floating point with unit roundoff uu, the computed H^\hat H satisfies H^=Q∗(A+E)Q\hat H = Q^* (A + E) Q for an exactly unitary QQ and ∥E∥F≤c n2u∥A∥F\|E\|_F \le c \, n^2 u \|A\|_F for a modest constant cc, and the computed Q^\hat Q is within c n2uc\, n^2 u of QQ in the Frobenius norm.

Sketch with source. Each computed reflector is close to an exact unitary reflector, and applying a nearly exact reflector to a matrix gives the exact product with a nearby matrix, with a relative backward error of order mum u for a vector of length mm (Higham, Accuracy and Stability of Numerical Algorithms, second edition, Chapter 19). Sequences of nn such products accumulate the errors additively, because unitary matrices do not change the Frobenius norm of the errors. Golub and Van Loan state the result in Section 7.4.3, and Trefethen and Bau prove the normwise form ∥E∥/∥A∥=O(u)\|E\| / \|A\| = O(u) in Lecture 26.

Back to Hessenberg reduction