These are the human proofs of Jacobi eigenvalue algorithm, at full length.
Jacobi rotations reduce the off-diagonal norm and converge to the eigenvalues full
This proof shows: correctness, termination.
Notation of the page: A=AT∈Rn×n, off(A)2=∑i=jaij2, ∥⋅∥F the Frobenius norm, and J=J(p,q,θ) the rotation equal to the identity except Jpp=Jqq=c, Jpq=s, Jqp=−s, with c=cosθ, s=sinθ. One rotation step is B=JTAJ. Exact arithmetic unless stated.
Lemma 1 (the rotation zeroes apq). Let apq=0, τ=(aqq−app)/(2apq), let t be the root of smaller modulus of t2+2τt−1=0, that is t=sign(τ)/(∣τ∣+1+τ2) with sign(0)=1, and c=1/1+t2, s=tc. Then bpq=bqp=0, bpp=app−tapq, bqq=aqq+tapq, and ∣θ∣≤π/4.
Proof. Only rows and columns p and q change. The 2×2 block is
so bpq=apq(c2−s2)+cs(app−aqq). With t=s/c, bpq=0 if and only if apq(1−t2)+t(app−aqq)=0, that is t2+2τt−1=0. The two roots have product −1, so the smaller one has ∣t∣≤1 and ∣θ∣=∣arctant∣≤π/4. Next, bpp=c2app−2csapq+s2aqq; with s2(aqq−app)=2s2τapq and 2τt=1−t2, this is app+c2apq(t(1−t2)−2t)=app−tapq, since c2(1+t2)=1. The formula for bqq follows from the invariance of the trace of the block. □
Lemma 2 (the off-diagonal norm drops by 2apq2).off(B)2=off(A)2−2apq2.
Proof.∥B∥F=∥A∥F since J is orthogonal. For r=p,q the pair (brp,brq) is a rotation of (arp,arq), so brp2+brq2=arp2+arq2, and entries outside rows and columns p,q do not change. So the only change of the off-diagonal sum is in the (p,q) block: the Frobenius norm of the 2×2 block is kept, and its off-diagonal part goes from 2apq2 to 0. So ∑ibii2=∑iaii2+2apq2, and the claim follows from off2=∥⋅∥F2−∑i(⋅)ii2. □
Theorem 1 (classical Jacobi converges linearly). If each step rotates on an entry of largest modulus, then off(B)2≤(1−1/N)off(A)2 with N=n(n−1)/2. So after k steps off(A(k))≤(1−1/N)k/2off(A).
Proof.off(A)2=2∑p<qapq2≤2Nmaxp<qapq2, so 2apq2≥off(A)2/N for the largest entry; apply Lemma 2. □
Theorem 2 (the diagonal converges to the eigenvalues). Let A(k)=VkTAVk with Vk orthogonal (the product of the rotations), and let off(A(k))→0. Then, with the eigenvalues λ1≥⋯≥λn of A and the sorted diagonal d[1](k)≥⋯≥d[n](k),
imax∣d[i](k)−λi∣≤off(A(k)),
and the columns of Vk have residuals ∥Avi(k)−aii(k)vi(k)∥2≤off(A(k)).
Proof.A(k)=Dk+Ek with Dk its diagonal and Ek symmetric with ∥Ek∥2≤∥Ek∥F=off(A(k)). By Weyl's inequality, the sorted eigenvalues of A(k), which are those of A, differ from the sorted eigenvalues of Dk, its diagonal entries, by at most ∥Ek∥2. For the residual, AVk=VkA(k), so Avi(k)−aii(k)vi(k)=VkEkei, whose norm is the norm of column i of Ek. □
Theorem 3 (cyclic Jacobi converges, and fast). For the cyclic-by-row order with ∣θ∣≤π/4 (Lemma 1), off(A(k))→0 (Forsythe and Henrici 1960). If the eigenvalues are distinct with minimum gap δ, the convergence is ultimately quadratic per sweep: once off is small compared with δ, one sweep maps off to at most a constant times off2/δ (Henrici 1958; Wilkinson 1962), and Schönhage (1964) extended quadratic convergence to multiple eigenvalues. These are cited results; the proofs are long and not repeated here. The test file measures the ratio offk+1/offk2 and finds it bounded.
Termination of the implementation. The sweep loop of line L2 runs at most max_sweeps times. With the threshold test of line L4, a sweep that performs no rotation ends the loop (line L7). Under Theorem 3 every off-diagonal entry tends to zero, while for a matrix with off(A(k)) small the diagonal entries approach the eigenvalues. If no eigenvalue is zero, ∣appaqq∣ stays bounded away from zero, so every entry eventually falls below its threshold and the sweep loop stops. If some eigenvalues are zero, the entries still go to zero; in floating point they reach exact zero or underflow, and the bound max_sweeps guarantees a stop in every case.
Correctness at the stop. When the loop stops at line L7, every off-diagonal entry satisfies ∣apq∣≤tol∣appaqq∣, so off(A(k))≤tol∑p=q∣appaqq∣≤tolnmaxi∣aii∣≤toln∥A∥2, and Theorem 2 gives the error of the returned eigenvalues and the residuals of the returned vectors.
Floating point. Each rotation is computed in floating point as B^=JT(A+E)J with ∥E∥F≤cnu∥A∥F and J exactly orthogonal, up to a small error in V^ (Wilkinson 1965, Chapter 3 and Chapter 5). A full run of s sweeps is therefore normwise backward stable with an error of order sn3u∥A∥F in this crude bound, and the observed error is of order u∥A∥. For a positive definite A=DHD with D diagonal and H with unit diagonal, Demmel and Veselić (1992) proved that the computed eigenvalues have relative errors of order umaxkκ(Hk), where Hk is the scaled form of the iterate A(k); they observed that maxkκ(Hk) is not much larger than κ(H). This is a stronger result than any normwise bound when D is strongly graded.