Algorithm Search⌘K

Proofs: LUP-SOLVE

These are the human proofs of LUP-SOLVE, at full length.

LUP-SOLVE solves A x = b, and its result has a componentwise backward error of at most γ_3n P^T |L||U| full

This proof shows: correctness, termination.

AA is a nonsingular n×nn \times n matrix with PA=LUP A = L U, LL unit lower triangular, UU upper triangular with nonzero diagonal, and row ii of PAP A equal to row πi\pi_i of AA, so (Pb)i=bπi(P b)_i = b_{\pi_i}. The algorithm stops, because each loop has a fixed length.

Exact arithmetic

Claim 1. After the loop of line L1, Ly=PbL y = P b.

Proof. By induction on ii we show: after iteration ii, the first ii equations of Ly=PbL y = P b hold, that is ∑j≤klkjyj=bπk\sum_{j \le k} l_{kj} y_j = b_{\pi_k} for k≤ik \le i, and y1,…,yiy_1, \ldots, y_i do not change later. The case i=0i = 0 is empty. In iteration ii, line L2 sets yi=bπi−∑j<ilijyjy_i = b_{\pi_i} - \sum_{j < i} l_{ij} y_j, which is equation ii because lii=1l_{ii} = 1, and it writes no other entry. □\square

Claim 2. After the loop of line L3, Ux=yU x = y.

Proof. By induction on the number n−i+1n - i + 1 of passes: after the pass for ii, equations k=i,…,nk = i, \ldots, n of Ux=yU x = y hold, that is ∑j≥kukjxj=yk\sum_{j \ge k} u_{kj} x_j = y_k. In the pass for ii, the values xi+1,…,xnx_{i+1}, \ldots, x_n are fixed, and line L4 sets xi=(yi−∑j>iuijxj)/uiix_i = (y_i - \sum_{j > i} u_{ij} x_j)/u_{ii}, which is defined because uii≠0u_{ii} \ne 0 and is exactly equation ii. □\square

Theorem. LUP-SOLVE returns the solution of Ax=bA x = b.

Proof. By the claims, PAx=LUx=Ly=PbP A x = L U x = L y = P b. PP is a permutation matrix, so it is invertible, and Ax=bA x = b. Since AA is nonsingular, this xx is the unique solution. ■\blacksquare

Floating point

Assume the standard model, ∣δ∣≤u|\delta| \le u for each operation, and 3nu<13 n u < 1. Let L^\hat L, U^\hat U be the factors computed by the LUP decomposition, with the permutation PP that it chose, so that

L^U^=PA+ΔA1,∣ΔA1∣≤γn∣L^∣ ∣U^∣(1)\hat L \hat U = P A + \Delta A_1, \qquad |\Delta A_1| \le \gamma_n |\hat L|\,|\hat U| \tag{1}

(Higham, Theorem 9.3; the proof is on the page of LUP decomposition).

Step 1: the substitutions. Line L2 evaluates yi=c−∑j<iajbjy_i = c - \sum_{j<i} a_j b_j with c=bπic = b_{\pi_i}; line L4 evaluates the same kind of expression and divides it by uiiu_{ii}. By Higham, Lemma 8.4, the computed value of (c−∑j=1k−1ajbj)/bk(c - \sum_{j=1}^{k-1} a_j b_j)/b_k satisfies bky^(1+θk)=c−∑j=1k−1ajbj(1+θj)b_k \hat y (1 + \theta_k) = c - \sum_{j=1}^{k-1} a_j b_j (1 + \theta_j) with each ∣θj∣≤γk|\theta_j| \le \gamma_k, in any order of the sum. Moving each factor 1+θ1 + \theta onto the matrix entry gives, for the whole forward and back substitution,

(L^+ΔL)y^=Pb,∣ΔL∣≤γn∣L^∣,(U^+ΔU)x^=y^,∣ΔU∣≤γn∣U^∣.(2)(\hat L + \Delta L)\hat y = P b, \quad |\Delta L| \le \gamma_n |\hat L|, \qquad (\hat U + \Delta U)\hat x = \hat y, \quad |\Delta U| \le \gamma_n |\hat U|. \tag{2}

This is Higham, Theorem 8.5. The permutation of bb is exact.

Step 2: combine. From (2),

Pb=(L^+ΔL)(U^+ΔU)x^=(L^U^+ΔL U^+L^ ΔU+ΔL ΔU)x^.P b = (\hat L + \Delta L)(\hat U + \Delta U)\hat x = (\hat L \hat U + \Delta L\, \hat U + \hat L\, \Delta U + \Delta L\, \Delta U)\hat x.

Insert (1): Pb=(PA+E)x^P b = (P A + E)\hat x with E=ΔA1+ΔL U^+L^ ΔU+ΔL ΔUE = \Delta A_1 + \Delta L\, \hat U + \hat L\, \Delta U + \Delta L\, \Delta U. Each term is bounded entry by entry:

∣E∣≤γn∣L^∣∣U^∣+γn∣L^∣∣U^∣+γn∣L^∣∣U^∣+γn2∣L^∣∣U^∣=(3γn+γn2) ∣L^∣ ∣U^∣.|E| \le \gamma_n |\hat L||\hat U| + \gamma_n |\hat L||\hat U| + \gamma_n |\hat L||\hat U| + \gamma_n^2 |\hat L||\hat U| = (3\gamma_n + \gamma_n^2)\,|\hat L|\,|\hat U|.

Step 3: the constant. For j,k≥1j, k \ge 1 with (j+k)u<1(j + k) u < 1, γj+γk+γjγk≤γj+k\gamma_j + \gamma_k + \gamma_j \gamma_k \le \gamma_{j+k} (Higham, Lemma 3.3). With j=k=nj = k = n it gives 2γn+γn2≤γ2n2\gamma_n + \gamma_n^2 \le \gamma_{2n}, and with j=2nj = 2n, k=nk = n it gives γ2n+γn≤γ3n\gamma_{2n} + \gamma_n \le \gamma_{3n}. So 3γn+γn2=(2γn+γn2)+γn≤γ2n+γn≤γ3n3\gamma_n + \gamma_n^2 = (2\gamma_n + \gamma_n^2) + \gamma_n \le \gamma_{2n} + \gamma_n \le \gamma_{3n}.

Step 4: undo the permutation. Multiply Pb=(PA+E)x^P b = (P A + E)\hat x by PT=P−1P^T = P^{-1}: b=(A+ΔA)x^b = (A + \Delta A)\hat x with ΔA=PTE\Delta A = P^T E, and ∣ΔA∣=PT∣E∣≤γ3nPT∣L^∣ ∣U^∣|\Delta A| = P^T |E| \le \gamma_{3n} P^T |\hat L|\,|\hat U|, because a permutation only moves entries. ■\blacksquare

Residual form. The theorem says r=b−Ax^=ΔA x^r = b - A \hat x = \Delta A\, \hat x, so ∣Pr∣≤γ3n∣L^∣ ∣U^∣ ∣x^∣|P r| \le \gamma_{3n} |\hat L|\,|\hat U|\,|\hat x| entry by entry. The tests of the implementation check this inequality in exact rational arithmetic for each computed solution.

Back to LUP-SOLVE