These are the human proofs of dqds algorithm, at full length.
The dqds transform shifts the squared singular values, stays positive below the smallest one, and the algorithm returns them full
This proof shows: correctness, termination.
Notation of the page. B is n×n upper bidiagonal with diagonal qk and superdiagonal ek, qk≥0, ek≥0. Its singular values are σ1≥⋯≥σn≥0. S is the accumulated shift. The arithmetic is exact except in the last section.
Lemma 0 (signs do not matter). The bidiagonal with entries ak,bk and the one with entries ∣ak∣,∣bk∣ have the same singular values.
Proof. Choose signs sk,tk∈{±1} one after another so that skaktk=∣ak∣ and skbktk+1=∣bk∣. Then diag(s)Bdiag(t) is the matrix with absolute values, and orthogonal factors keep singular values. □
Lemma 1 (the transform). Let ek>0 for all k and τ∈R. Suppose lines L4 to L9 run with every q^k=0. Then the output defines B^ with B^TB^=BBT−τI.
Proof.BBT is tridiagonal, with (BBT)kk=qk+ek (where en=0) and (BBT)k,k+12=qk+1ek. Also B^TB^ is tridiagonal, with (B^TB^)kk=q^k+e^k−1 (where e^0=0) and (B^TB^)k,k+12=q^ke^k. Both off-diagonals are nonnegative, so it is enough to match the diagonals and the squared off-diagonals.
By induction, the d at the start of iteration k (with d1=q1−τ) satisfies dk=qk−e^k−1−τ. For k=1 this is L4. If it holds for k, then L7 and L8 give
Hence L6 gives q^k+e^k−1=dk+ek+e^k−1=qk+ek−τ for k<n. L9 gives q^n+e^n−1=qn−τ. For the off-diagonal, L7 gives q^ke^k=ekqk+1. □
So σi(B^)2=σi(B)2−τ for every i, because BBT and BTB have the same eigenvalues. After the update S←S+τ at L10, the multiset {S+σi(B)2} is the same as before the transform. It is therefore the multiset of squared singular values of the input matrix.
Lemma 2 (the meaning of dk). Suppose all qj>0 and ej>0, and q^1,…,q^k−1>0. Let Bk be the leading k×k block of B. Then q^1,…,q^k−1,dk are the pivots of the Cholesky (LDLT) factorization of BkBkT−τI.
Proof.BkBkT agrees with the leading k×k block of BBT, except at (k,k), where it has qk instead of qk+ek. The pivots of a tridiagonal T satisfy p1=t11 and pj=tjj−tj−1,j2/pj−1. For BBT−τI this reads pj=qj+ej−τ−qjej−1/pj−1. By Lemma 1, q^j=dj+ej and dj=qj−τ−qjej−1/q^j−1, so pj=q^j for j<k. The last pivot of BkBkT−τI uses qk in place of qk+ek, which gives dk. □
Lemma 3 (positivity). Let all qj,ej>0. The transform runs with every dk>0 if and only if τ<σn2, and then every q^k>0 and e^k>0.
Proof. Suppose first that τ<σn2. B is upper triangular and nonsingular, so B−1 is upper triangular with leading block Bk−1. Hence ∥Bk−1∥2≤∥B−1∥2, that is, σmin(Bk)≥σn. Therefore BkBkT−τI is positive definite for every k, and its last pivot dk is positive by Lemma 2, by induction on k. Then q^k=dk+ek>0 and e^k=ekqk+1/q^k>0.
Conversely, if every dk>0, then every q^k>0. By Lemma 2 with k=n, these are the Cholesky pivots of BBT−τI, so that matrix is positive definite and τ<σn2. □
If τ=σn2 exactly, the same argument gives dk>0 for k<n and dn=0. If some qj=0, then σn=0, line L3 takes τ=0, and the transform runs with dk≥0. When q^k=0, then dk=ek=0, and the code sets e^k=0 and restarts d at qk+1−τ. That is the transform applied to the two blocks separately, so Lemma 1 still holds blockwise. The transform therefore keeps all quantities nonnegative.
Lemma 4 (the Newton shift is a lower bound). If all qj>0, the value τ of line L3 satisfies 0<τ≤σn2.
Proof. Let cj=∥B−1ej∥22, where ej is the j-th unit vector. From B−1B=I, column j gives qjB−1ej+ej−1B−1ej−1=ej. The vector B−1ej−1 is supported on rows 1,…,j−1 and is orthogonal to ej. Hence cj=(1+ej−1cj−1)/qj and c1=1/q1. So ∑jcj=∥B−1∥F2=∑iσi−2≥σn−2, and τ=1/∑jcj≤σn2. This value is also −f(0)/f′(0) for f(x)=det(BBT−xI), which is one Newton step from 0. □
By Lemmas 3 and 4, in exact arithmetic the test at L8 fails only when τ=σn2 exactly. In that case dn=0≥0 and the transform is accepted.
Lemma 5 (deflation). Suppose en−1≤u2(S+qn) at L2. Recording S+qn and continuing with the leading (n−1)×(n−1) block changes each eigenvalue of BBT+SI by at most (u+u2)(S+qn).
Proof. Write M=BBT+SI. The matrix M′ is block diagonal, with the leading block Bn−1Bn−1T+SI and the trailing entry S+qn. Then M−M′ has only three nonzero entries: en−1 at (n−1,n−1) and β=qnen−1 at (n−1,n) and (n,n−1). Its 2-norm is at most en−1+β. Since qn≤S+qn, we have β≤u(S+qn), and en−1≤u2(S+qn). Weyl's inequality bounds each eigenvalue change by ∥M−M′∥2. □
Since S≥0 and every eigenvalue of M is at least S, the bound is of the order of u times the deflated value. That makes it relative for that value. For the remaining values it is at most (u+u2) times their own size, plus (u+u2)qn. When en−1=0, the deflation is exact.
Theorem (correctness and termination). In exact arithmetic, the values returned at L11 are the singular values of the input, provided the loop ends without the step cap. The loop always ends, after at most n+60n passes.
Proof. By Lemma 0, the squared variables represent the input. Each accepted transform keeps the multiset {S+σi(B)2} (Lemma 1, with Lemma 3 and the remarks for the degenerate cases). An exact deflation with en−1=0 splits M into two blocks. The recorded S+qn is the eigenvalue of the trailing 1×1 block, and the rest is carried by the leading block. When n=1, the value is S+q1. L11 returns their square roots, sorted. For termination, each pass of L2 either lowers n, which can happen at most n times, or performs a transform. Transforms are counted and capped at 60n, after which the code raises an error. □
Convergence (cited, not proved here). With τ=0, the qd recurrences give ek(t)→0 like (σk+1/σk)2t (Rutishauser 1954; Fernando and Parlett 1994). Aishima, Matsuo, Murota and Sugihara (2008) proved global convergence of dqds under a class of shift strategies, together with its asymptotic rate. The bound of 60n transforms is a safety cap. In the tests, about 9 transforms per value were used.
Floating point (cited). Fernando and Parlett (1994) proved that the computed dqds transform is mixed stable in the relative sense. Make relative changes of a few ulps to each qk and ek, apply the exact transform, and change each output entry by a few ulps; the result is the computed (q^,e^). Demmel and Kahan (1990) proved that relative changes of size at most η in the 2n−1 entries of a bidiagonal matrix change each singular value by a factor between (1+η)−(2n−1) and (1+η)2n−1. Combining the two results bounds the relative error in each σi by O(nu) per transform, whatever the ratio σi/σ1.