Algorithm Search⌘K

Proofs: Cholesky decomposition

These are the human proofs of Cholesky decomposition, at full length.

Cholesky's algorithm finds the factor exactly when A is positive definite, and is backward stable full

This proof shows: correctness, termination.

Notation: AA is a real symmetric n×nn \times n matrix, AjA_j is its leading j×jj \times j block, RjR_j is the leading j×jj \times j block of the computed RR, uu is the unit roundoff and γm=mu/(1−mu)\gamma_m = m u / (1 - m u). The algorithm stops: line L1 runs nn times and each inner loop has a fixed length.

Exact arithmetic

Invariant I(j)I(j). After the pass of line L1 for jj: for all 1≤k≤j1 \le k \le j and k≤i≤nk \le i \le n,

aki=∑l=1krlkrli,rkk>0.a_{ki} = \sum_{l=1}^{k} r_{lk} r_{li}, \qquad r_{kk} > 0.

Initialization. I(0)I(0) is empty and true.

Maintenance. Assume I(j−1)I(j - 1) and that line L3 does not return. Line L2 gives s=ajj−∑k<jrkj2>0s = a_{jj} - \sum_{k<j} r_{kj}^2 > 0, and line L4 gives rjj=s>0r_{jj} = \sqrt s > 0, so ajj=∑k≤jrkj2a_{jj} = \sum_{k \le j} r_{kj}^2. For i>ji > j, line L6 gives rjjrji=aji−∑k<jrkjrkir_{jj} r_{ji} = a_{ji} - \sum_{k<j} r_{kj} r_{ki}, so aji=∑k≤jrkjrkia_{ji} = \sum_{k \le j} r_{kj} r_{ki}. With I(j−1)I(j - 1) this is I(j)I(j).

At the end. I(n)I(n) says (RTR)ki=∑l≤min⁡(k,i)rlkrli=aki(R^T R)_{ki} = \sum_{l \le \min(k, i)} r_{lk} r_{li} = a_{ki} for k≤ik \le i, since rlk=0r_{lk} = 0 for l>kl > k. Both sides are symmetric, so RTR=AR^T R = A.

Lemma 1. Assume I(j−1)I(j - 1). Then the value ss of line L2 at step jj is s=det⁡Aj/det⁡(Rj−1)2s = \det A_j / \det(R_{j-1})^2 (with det⁡R0=1\det R_0 = 1), and det⁡Rj−1>0\det R_{j-1} > 0.

Proof. Let c=(r1j,…,rj−1,j)Tc = (r_{1j}, \ldots, r_{j-1, j})^T. By I(j−1)I(j - 1), Aj=(Rj−1TRj−1Rj−1TccTRj−1ajj)A_j = \begin{pmatrix} R_{j-1}^T R_{j-1} & R_{j-1}^T c \\ c^T R_{j-1} & a_{jj} \end{pmatrix}. Multiply out to check that

Aj=(Rj−1T0cT1)(Rj−1c0s),s=ajj−cTc:A_j = \begin{pmatrix} R_{j-1}^T & 0 \\ c^T & 1 \end{pmatrix} \begin{pmatrix} R_{j-1} & c \\ 0 & s \end{pmatrix}, \qquad s = a_{jj} - c^T c:

the block (2,2)(2, 2) of the product is cTc+s=ajjc^T c + s = a_{jj}, and the other blocks are those of AjA_j. Both factors are triangular, so det⁡Aj=det⁡(Rj−1)⋅det⁡(Rj−1)⋅s\det A_j = \det(R_{j-1}) \cdot \det(R_{j-1}) \cdot s. Rj−1R_{j-1} is triangular with positive diagonal, so det⁡Rj−1>0\det R_{j-1} > 0. □\square

Theorem 2. (a) If AA is positive definite, the algorithm returns RR upper triangular with positive diagonal and RTR=AR^T R = A. (b) If it returns NOT-POSITIVE-DEFINITE, then AA is not positive definite. (c) The factor is unique, and A=RTRA = R^T R with such an RR implies that AA is positive definite.

Proof. (a) For z∈Rjz \in \mathbb{R}^j, z≠0z \ne 0, put z~=(z,0,…,0)∈Rn\tilde z = (z, 0, \ldots, 0) \in \mathbb{R}^n. Then zTAjz=z~TAz~>0z^T A_j z = \tilde z^T A \tilde z > 0, so AjA_j is positive definite, its eigenvalues are positive and det⁡Aj>0\det A_j > 0. By Lemma 1 and induction on jj, s>0s > 0 at each step, so line L3 never returns, and I(n)I(n) gives RTR=AR^T R = A.

(b) If line L3 returns at step jj, then s≤0s \le 0, and Lemma 1 gives det⁡Aj≤0\det A_j \le 0. By the argument of (a), AA is then not positive definite.

(c) Let SS be upper triangular with positive diagonal and STS=AS^T S = A. Entry (j,i)(j, i), i≥ji \ge j, of STS=AS^T S = A reads aji=∑k≤jskjskia_{ji} = \sum_{k \le j} s_{kj} s_{ki}. By induction on jj, rows 1,…,j−11, \ldots, j - 1 of SS and RR agree; then sjj2=ajj−∑k<jskj2s_{jj}^2 = a_{jj} - \sum_{k<j} s_{kj}^2 is the value of line L2, and sjj>0s_{jj} > 0 forces sjj=rjjs_{jj} = r_{jj}; the entries sjis_{ji}, i>ji > j, then solve the same equation as line L6. So S=RS = R. Finally, if A=RTRA = R^T R with RR nonsingular, then zTAz=∥Rz∥22>0z^T A z = \|R z\|_2^2 > 0 for z≠0z \ne 0. □\square

Floating point

Assume the standard model fl(a∘b)=(a∘b)(1+δ)\mathrm{fl}(a \circ b) = (a \circ b)(1 + \delta), fl(a)=a(1+δ)\mathrm{fl}(\sqrt a) = \sqrt a (1 + \delta), ∣δ∣≤u|\delta| \le u, no underflow or overflow, and (3n+1)u<1(3n + 1) u < 1. We use two facts: a product of mm factors (1+δk)±1(1 + \delta_k)^{\pm 1} is 1+θ1 + \theta with ∣θ∣≤γm|\theta| \le \gamma_m (Higham, Lemma 3.1; proved on the back substitution proof page), and γa+γb+γaγb≤γa+b\gamma_a + \gamma_b + \gamma_a \gamma_b \le \gamma_{a+b} (Higham, Lemma 3.3).

Theorem 3. If the algorithm runs to completion, then R^TR^=A+ΔA\hat R^T \hat R = A + \Delta A with ∣ΔA∣≤γn+1∣R^T∣ ∣R^∣|\Delta A| \le \gamma_{n+1} |\hat R^T| \, |\hat R|.

Proof. Fix jj. Off the diagonal (i>ji > j): line L6 computes m=j−1m = j - 1 products, mm subtractions in order and one division. As in the proof of Theorem 3 for back substitution, unrolling the roundings and dividing by the factors of the subtractions gives

r^jjr^ji(1+θ0)+∑k<jr^kjr^ki(1+θk)=aji,\hat r_{jj} \hat r_{ji} (1 + \theta_0) + \sum_{k<j} \hat r_{kj} \hat r_{ki} (1 + \theta_k) = a_{ji},

with ∣θ0∣≤γm+1=γj|\theta_0| \le \gamma_{m+1} = \gamma_j and ∣θk∣≤γm|\theta_k| \le \gamma_m. So ∣aji−∑k≤jr^kjr^ki∣≤γj∑k≤j∣r^kj∣∣r^ki∣|a_{ji} - \sum_{k \le j} \hat r_{kj} \hat r_{ki}| \le \gamma_j \sum_{k \le j} |\hat r_{kj}| |\hat r_{ki}|.

On the diagonal: line L2 gives s^(1+θ0′)+∑k<jr^kj2(1+θk′)=ajj\hat s (1 + \theta_0') + \sum_{k<j} \hat r_{kj}^2 (1 + \theta_k') = a_{jj} with mm factors in θ0′\theta_0' and at most mm in each θk′\theta_k'. Line L4 gives r^jj=s^(1+δ)\hat r_{jj} = \sqrt{\hat s} (1 + \delta), so s^=r^jj2(1+δ)−2\hat s = \hat r_{jj}^2 (1 + \delta)^{-2}. Then the factor of r^jj2\hat r_{jj}^2 is a product of m+2=j+1m + 2 = j + 1 terms, and ∣ajj−∑k≤jr^kj2∣≤γj+1∑k≤jr^kj2|a_{jj} - \sum_{k \le j} \hat r_{kj}^2| \le \gamma_{j+1} \sum_{k \le j} \hat r_{kj}^2.

Set ΔA=R^TR^−A\Delta A = \hat R^T \hat R - A; it is symmetric, its entry (j,i)(j, i), i≥ji \ge j, is bounded as above, and γj≤γj+1≤γn+1\gamma_j \le \gamma_{j+1} \le \gamma_{n+1}. □\square

Theorem 4. The solution computed by CHOLESKY-SOLVE satisfies (A+ΔA′)x^=b(A + \Delta A')\hat x = b with ∣ΔA′∣≤γ3n+1∣R^T∣ ∣R^∣|\Delta A'| \le \gamma_{3n+1} |\hat R^T| \, |\hat R|.

Proof. By the backward error of substitution, the computed y^\hat y and x^\hat x satisfy (R^T+E1)y^=b(\hat R^T + E_1)\hat y = b and (R^+E2)x^=y^(\hat R + E_2)\hat x = \hat y with ∣E1∣≤γn∣R^T∣|E_1| \le \gamma_n |\hat R^T| and ∣E2∣≤γn∣R^∣|E_2| \le \gamma_n |\hat R|. So (R^T+E1)(R^+E2)x^=b(\hat R^T + E_1)(\hat R + E_2)\hat x = b, and

ΔA′=ΔA+E1R^+R^TE2+E1E2,∣ΔA′∣≤(γn+1+2γn+γn2)∣R^T∣ ∣R^∣.\Delta A' = \Delta A + E_1 \hat R + \hat R^T E_2 + E_1 E_2, \qquad |\Delta A'| \le (\gamma_{n+1} + 2 \gamma_n + \gamma_n^2) |\hat R^T| \, |\hat R|.

By the second fact, 2γn+γn2≤γ2n2 \gamma_n + \gamma_n^2 \le \gamma_{2n} and γn+1+γ2n≤γ3n+1\gamma_{n+1} + \gamma_{2n} \le \gamma_{3n+1}. ■\blacksquare

Back to Cholesky decomposition