Algorithm Search⌘K

Proofs: MRRR algorithm

These are the human proofs of MRRR algorithm, at full length.

MRRR assigns every eigenvalue one vector, its twisted vectors have residuals bounded by the eigenvalue error, and the representation tree is finite full

This proof shows: correctness, termination.

Exact arithmetic throughout, except where an approximation λ^\hat\lambda of an eigenvalue is fed in; the floating-point behaviour is cited at the end. Notation of the page: TT is real symmetric tridiagonal of order nn, unreduced on each block; a representation is LDLTL D L^T with LL unit lower bidiagonal (lil_i in position (i+1,i)(i + 1, i)) and D=diag⁡(d1,…,dn)D = \operatorname{diag}(d_1, \dots, d_n); its tridiagonal has diagonal αi=di+di−1li−12\alpha_i = d_i + d_{i-1} l_{i-1}^2 (with d0l02=0d_0 l_0^2 = 0) and off-diagonal βi=dili\beta_i = d_i l_i. We assume that no pivot Di+D^+_i or Di−D^-_i below is zero (the code replaces an exact zero by a tiny number, which is a perturbation of size 2−10002^{-1000}).

Lemma 1 (stationary qd). With s1=−τs_1 = -\tau, Di+=di+siD^+_i = d_i + s_i, Li+=dili/Di+L^+_i = d_i l_i / D^+_i, si+1=Li+lisi−τs_{i+1} = L^+_i l_i s_i - \tau and Dn+=dn+snD^+_n = d_n + s_n, we have L+D+(L+)T=LDLT−τIL^+ D^+ (L^+)^T = L D L^T - \tau I.

Proof. Both sides are symmetric tridiagonal. Off-diagonal: Di+Li+=dili=βiD^+_i L^+_i = d_i l_i = \beta_i. Diagonal 11: D1+=d1−τ=α1−τD^+_1 = d_1 - \tau = \alpha_1 - \tau. Diagonal i+1i + 1: we need Di+1++Di+(Li+)2=di+1+dili2−τD^+_{i+1} + D^+_i (L^+_i)^2 = d_{i+1} + d_i l_i^2 - \tau. Now dili2−Di+(Li+)2=dili2−diliLi+=li(Di+Li+−diLi+)=liLi+(Di+−di)=Li+lisid_i l_i^2 - D^+_i (L^+_i)^2 = d_i l_i^2 - d_i l_i L^+_i = l_i (D^+_i L^+_i - d_i L^+_i) = l_i L^+_i (D^+_i - d_i) = L^+_i l_i s_i, so the requirement is Di+1+=di+1+Li+lisi−τ=di+1+si+1D^+_{i+1} = d_{i+1} + L^+_i l_i s_i - \tau = d_{i+1} + s_{i+1}, which is the definition. □\square

Lemma 2 (progressive qd from the bottom). With pn=dn−μp_n = d_n - \mu and, for i=n−1,…,1i = n - 1, \dots, 1, Di+1−=dili2+pi+1D^-_{i+1} = d_i l_i^2 + p_{i+1}, Ui−=dili/Di+1−U^-_i = d_i l_i / D^-_{i+1}, pi=pi+1di/Di+1−−μp_i = p_{i+1} d_i / D^-_{i+1} - \mu, and D1−=p1D^-_1 = p_1, we have U−D−(U−)T=LDLT−μIU^- D^- (U^-)^T = L D L^T - \mu I with U−U^- unit upper bidiagonal (Ui−U^-_i in position (i,i+1)(i, i + 1)).

Proof. The product has off-diagonal Di+1−Ui−=diliD^-_{i+1} U^-_i = d_i l_i and diagonal Di−+Di+1−(Ui−)2D^-_i + D^-_{i+1} (U^-_i)^2, with the second term absent for i=ni = n. For i=ni = n: Dn−=dn−1ln−12+dn−μ=αn−μD^-_n = d_{n-1} l_{n-1}^2 + d_n - \mu = \alpha_n - \mu. For i<ni < n, using Di−=di−1li−12+piD^-_i = d_{i-1} l_{i-1}^2 + p_i (or p1p_1 for i=1i = 1), the requirement Di−+(dili)2/Di+1−=αi−μD^-_i + (d_i l_i)^2 / D^-_{i+1} = \alpha_i - \mu becomes pi=di−μ−di2li2/Di+1−=di(Di+1−−dili2)/Di+1−−μ=dipi+1/Di+1−−μp_i = d_i - \mu - d_i^2 l_i^2 / D^-_{i+1} = d_i (D^-_{i+1} - d_i l_i^2) / D^-_{i+1} - \mu = d_i p_{i+1} / D^-_{i+1} - \mu, the definition. □\square

Lemma 3 (twisted factorization). Let M=LDLT−μIM = L D L^T - \mu I, γk=sk+pk+μ\gamma_k = s_k + p_k + \mu, and fix rr. Define zr=1z_r = 1, zi=−Li+zi+1z_i = -L^+_i z_{i+1} for i=r−1,…,1i = r - 1, \dots, 1, and zi+1=−Ui−ziz_{i+1} = -U^-_i z_i for i=r,…,n−1i = r, \dots, n - 1. Then Mz=γrerM z = \gamma_r e_r. If MM is nonsingular, γr=1/(M−1)rr\gamma_r = 1 / (M^{-1})_{rr}.

Proof. By Lemma 1, Mz=L+D+wM z = L^+ D^+ w with w=(L+)Tzw = (L^+)^T z, and wi=zi+Li+zi+1=0w_i = z_i + L^+_i z_{i+1} = 0 for i<ri < r. Row ii of L+D+wL^+ D^+ w is Di+wi+Li−1+Di−1+wi−1D^+_i w_i + L^+_{i-1} D^+_{i-1} w_{i-1}, which vanishes for i<ri < r. By Lemma 2, Mz=U−D−vM z = U^- D^- v with v=(U−)Tzv = (U^-)^T z, and vi=zi+Ui−1−zi−1=0v_i = z_i + U^-_{i-1} z_{i-1} = 0 for i>ri > r; row ii of U−D−vU^- D^- v is Di−vi+Ui−Di+1−vi+1D^-_i v_i + U^-_i D^-_{i+1} v_{i+1}, which vanishes for i>ri > r. So Mz=c erM z = c \, e_r with c=(Mz)r=βr−1zr−1+(αr−μ)+βrzr+1c = (Mz)_r = \beta_{r-1} z_{r-1} + (\alpha_r - \mu) + \beta_r z_{r+1}. Now βr−1zr−1=−Dr−1+(Lr−1+)2=Dr+−(αr−μ)\beta_{r-1} z_{r-1} = -D^+_{r-1} (L^+_{r-1})^2 = D^+_r - (\alpha_r - \mu) by the diagonal of Lemma 1, and βrzr+1=−Dr+1−(Ur−)2=Dr−−(αr−μ)\beta_r z_{r+1} = -D^-_{r+1} (U^-_r)^2 = D^-_r - (\alpha_r - \mu) by the diagonal of Lemma 2 (terms with index 00 or n+1n + 1 are absent, and the identities still hold with D1+=α1−μD^+_1 = \alpha_1 - \mu, Dn−=αn−μD^-_n = \alpha_n - \mu). Hence c=Dr++Dr−−(αr−μ)=(dr+sr)+(dr−1lr−12+pr)−(dr+dr−1lr−12−μ)=γrc = D^+_r + D^-_r - (\alpha_r - \mu) = (d_r + s_r) + (d_{r-1} l_{r-1}^2 + p_r) - (d_r + d_{r-1} l_{r-1}^2 - \mu) = \gamma_r. Finally z=γrM−1erz = \gamma_r M^{-1} e_r, and zr=1z_r = 1 gives γr(M−1)rr=1\gamma_r (M^{-1})_{rr} = 1. □\square

Lemma 4 (counts). The number of negative Di+D^+_i in Lemma 1 equals the number of eigenvalues of LDLTL D L^T less than τ\tau.

Proof. LDLT−τI=L+D+(L+)TL D L^T - \tau I = L^+ D^+ (L^+)^T is congruent to D+D^+, and by Sylvester's law of inertia it has as many negative eigenvalues as D+D^+ has negative entries. Its eigenvalues are λ−τ\lambda - \tau. □\square

Lemma 5 (bisection). Let ν(x)\nu(x) be the count of Lemma 4. The routine bisect(k) ends with lo<hilo < hi, ν(lo)<k≤ν(hi)\nu(lo) < k \le \nu(hi), and returns the midpoint λ^\hat\lambda; hence the kk-th smallest eigenvalue λk\lambda_k of LDLTL D L^T satisfies ∣λ^−λk∣≤(hi−lo)/2≤umax⁡(∣lo∣,∣hi∣)|\hat\lambda - \lambda_k| \le (hi - lo)/2 \le u \max(|lo|, |hi|) when the width test stops it, and the loop runs at most 400400 steps after finitely many bracket expansions.

Proof. ν\nu is nondecreasing, 00 below the spectrum and nn above it, so moving lolo down by doubling steps reaches ν(lo)<k\nu(lo) < k and moving hihi up reaches ν(hi)≥k\nu(hi) \ge k after finitely many steps. Each bisection step keeps the half on which the invariant holds. The invariant gives λk∈[lo,hi)\lambda_k \in [lo, hi): at most k−1k - 1 eigenvalues lie below lolo, so λk≥lo\lambda_k \ge lo, and at least kk lie below hihi, so λk<hi\lambda_k < hi. The midpoint is then within (hi−lo)/2(hi - lo)/2 of λk\lambda_k. □\square

Lemma 6 (residual and angle of a twisted vector). Let λj\lambda_j be the eigenvalue of LDLTL D L^T nearest to μ\mu, δ=∣λj−μ∣\delta = |\lambda_j - \mu|, g=min⁡i≠j∣λi−μ∣g = \min_{i \ne j} |\lambda_i - \mu|, and suppose δ<g/(2n)\delta < g / (2n). For rr minimizing ∣γk∣|\gamma_k| and z^=z/∥z∥2\hat z = z / \|z\|_2: ∥Mz^∥2≤∣γr∣≤2nδ\|M \hat z\|_2 \le |\gamma_r| \le 2 n \delta, and sin⁡∠(z^,vj)≤2nδ/g\sin\angle(\hat z, v_j) \le 2 n \delta / g.

Proof. With orthonormal eigenvectors viv_i, (M−1)kk=∑ivi(k)2/(λi−μ)(M^{-1})_{kk} = \sum_i v_i(k)^2 / (\lambda_i - \mu). Pick kk with vj(k)2≥1/nv_j(k)^2 \ge 1/n. Then ∣(M−1)kk∣≥1/(nδ)−1/g≥1/(2nδ)|(M^{-1})_{kk}| \ge 1/(n\delta) - 1/g \ge 1/(2 n \delta), so by Lemma 3 ∣γk∣≤2nδ|\gamma_k| \le 2n\delta and the minimum is no larger. By Lemma 3, ∥Mz^∥=∣γr∣/∥z∥≤∣γr∣\|M \hat z\| = |\gamma_r| / \|z\| \le |\gamma_r|, since ∥z∥≥∣zr∣=1\|z\| \ge |z_r| = 1. Write z^=cos⁡θ vj+sin⁡θ w\hat z = \cos\theta \, v_j + \sin\theta \, w with w⊥vjw \perp v_j a unit vector; then ∥Mz^∥≥∥Mw∥sin⁡θ≥gsin⁡θ\|M \hat z\| \ge \|M w\| \sin\theta \ge g \sin\theta, because MM maps the orthogonal complement of vjv_j into itself with smallest singular value gg. □\square

Theorem 7 (correctness and termination). On each unreduced block: (a) the loop terminates; (b) every eigenvalue index is assigned exactly one value and one unit vector; (c) every representation on the stack equals T−σIT - \sigma I for its accumulated shift σ\sigma; (d) for an index finished as a singleton in a representation where the relative gap condition holds, the returned pair (σ+λ^,z^)(\sigma + \hat\lambda, \hat z) satisfies ∥(T−(σ+λ^)I)z^∥2≤2nδ\|(T - (\sigma + \hat\lambda) I) \hat z\|_2 \le 2 n \delta and sin⁡∠(z^,v)≤2nδ/g\sin\angle(\hat z, v) \le 2 n \delta / g with δ\delta, gg as in Lemma 6 for that representation; (e) vectors from a fallback cluster are orthonormal.

Proof. (c) The root satisfies LDLT=T−σIL D L^T = T - \sigma I by Gaussian elimination without pivoting, whose pivots are all positive by the test in root_ldl (so T−σIT - \sigma I is positive definite). A child built from (LDLT,τ)(L D L^T, \tau) satisfies L+D+(L+)T=LDLT−τI=T−(σ+τ)IL^+ D^+ (L^+)^T = L D L^T - \tau I = T - (\sigma + \tau) I by Lemma 1, and is pushed with shift σ+τ\sigma + \tau. Induction on the depth.

(b) The root is pushed with all indices 1,…,m1, \dots, m. When a node is popped, _groups partitions its index list into consecutive runs; each run of length one is assigned at once, each longer run is either assigned at once (fallback) or pushed as a child with exactly that index list. So the index lists of the nodes ever pushed form a tree in which the children of a node partition a subset of its indices and the remaining indices are assigned in the node; every index is assigned exactly once. The eigenvalues of a child are the same indices because a shift preserves the order: the kk-th smallest eigenvalue of T−σIT - \sigma I minus τ\tau is the kk-th smallest of T−(σ+τ)IT - (\sigma + \tau) I.

(a) A child is pushed only when the depth of its parent is below maxdepth, so the tree has height at most maxdepth, and each node has at most m/2m/2 children because each child has at least two indices. So the tree is finite. Each node does finitely many operations: by Lemma 5 each bisection ends, the shift search tries at most 2⋅TRIES2 \cdot \mathrm{TRIES} shifts, and the fallback tries at most mm twist indices per eigenvalue.

(d) By (c), T−(σ+λ^)I=LDLT−λ^I=MT - (\sigma + \hat\lambda) I = L D L^T - \hat\lambda I = M, and Lemma 6 applies.

(e) Each kept vector is normalized after being made orthogonal to the earlier ones (twice, which in exact arithmetic is once); the Rayleigh-Ritz step multiplies this orthonormal set by the orthogonal eigenvector matrix of a small symmetric matrix. □\square

Remarks (what is cited, not proved). (1) The size of δ\delta. By Lemma 5, δ≤u∣λj(rep)∣\delta \le u |\lambda_j^{(\mathrm{rep})}| for an eigenvalue λj(rep)\lambda_j^{(\mathrm{rep})} of the representation, so Lemma 6 gives sin⁡∠≤2nu/relgap\sin\angle \le 2 n u / \mathrm{relgap} with relgap=g/∣λj(rep)∣\mathrm{relgap} = g / |\lambda_j^{(\mathrm{rep})}|; the clustering rule makes relgap\mathrm{relgap} at least about gaptol\mathrm{gaptol} for singletons. This is why MRRR shifts a cluster until its members have large relative gaps. (2) Floating point. That the computed stationary and progressive transforms are exact for small relative perturbations of LL, DD and the outputs (mixed relative stability), that a relatively robust representation determines its eigenvalues and eigenvectors to high relative accuracy, and that the computed vectors from different representations are numerically orthogonal, ∣z^iTz^j∣=O(nu/gaptol)|\hat z_i^T \hat z_j| = O(n u / \mathrm{gaptol}), and have residuals O(nu∥T∥)O(n u \|T\|), are the theorems of Dhillon and Parlett (2004a, 2004b) and Dhillon, Parlett and Vömel (2006), under the hypothesis that every representation used is relatively robust for its cluster. The element growth test of the code is the heuristic check of that hypothesis used in LAPACK; it is not a proof. The tests observe residuals below 1.3 nu∥T∥1.3 \, n u \|T\|, orthogonality below 9 nu9 \, n u on random matrices and on glued Wilkinson matrices, and 68 nu68 \, n u on W21+W_{21}^+, whose singletons have relative gaps just above gaptol\mathrm{gaptol}.

Back to MRRR algorithm