Algorithm Search⌘K

Proofs: Forward and back substitution

These are the human proofs of Forward and back substitution, at full length.

Back substitution is correct and backward stable full

This proof shows: correctness, termination.

We use the notation of the page: UU is n×nn \times n upper triangular, uu is the unit roundoff and γk=ku/(1−ku)\gamma_k = k u / (1 - k u) for ku<1k u < 1.

Termination. Line L1 runs nn times and line L4 runs n−in - i times for each ii, so the algorithm stops after n2n^2 flops or after it returns at line L2.

Theorem 1 (exact arithmetic). If each uii≠0u_{ii} \neq 0, BACK-SUBSTITUTION returns the unique xx with Ux=bU x = b. If some uii=0u_{ii} = 0, it returns SINGULAR, and UU is singular.

Proof. If some uii=0u_{ii} = 0 then det⁡U=∏iuii=0\det U = \prod_i u_{ii} = 0, and line L2 returns SINGULAR at the largest such ii (the loop reaches it before any smaller index). Now assume each uii≠0u_{ii} \neq 0 and let x∗x^* be the solution, which exists because det⁡U≠0\det U \ne 0. We show by downward induction on ii the claim P(i)P(i): after the pass of line L1 for ii, xk=xk∗x_k = x^*_k for k=i,…,nk = i, \ldots, n.

Base and step together. Assume P(i+1)P(i + 1), or nothing when i=ni = n. Lines L3 to L5 give s=bi−∑j=i+1nuijxj=bi−∑j=i+1nuijxj∗s = b_i - \sum_{j=i+1}^n u_{ij} x_j = b_i - \sum_{j=i+1}^n u_{ij} x^*_j by the hypothesis. Row ii of Ux∗=bU x^* = b is uiixi∗+∑j>iuijxj∗=biu_{ii} x^*_i + \sum_{j > i} u_{ij} x^*_j = b_i, because uij=0u_{ij} = 0 for j<ij < i. So s=uiixi∗s = u_{ii} x^*_i and line L6 sets xi=xi∗x_i = x^*_i. With P(i+1)P(i + 1) this gives P(i)P(i).

P(1)P(1) is the claim. □\square

Lemma 2 (Higham, Lemma 3.1). If ∣δk∣≤u|\delta_k| \le u and σk∈{1,−1}\sigma_k \in \{1, -1\} for k=1,…,mk = 1, \ldots, m, and mu<1m u < 1, then ∏k=1m(1+δk)σk=1+θm\prod_{k=1}^m (1 + \delta_k)^{\sigma_k} = 1 + \theta_m with ∣θm∣≤γm|\theta_m| \le \gamma_m.

Proof. By induction on mm, the product lies between (1−u)m(1 - u)^m and (1−u)−m(1 - u)^{-m}, since each factor lies in [1−u,1/(1−u)][1 - u, 1/(1 - u)]: for 1+δ1 + \delta this follows from 1+u≤1/(1−u)1 + u \le 1/(1 - u), and for 1/(1+δ)1/(1 + \delta) from 1/(1+u)≥1−u1/(1 + u) \ge 1 - u. Bernoulli's inequality gives (1−u)m≥1−mu≥1−γm(1 - u)^m \ge 1 - m u \ge 1 - \gamma_m. For the upper end, (1−u)−m≤(1−mu)−1=1+γm(1 - u)^{-m} \le (1 - m u)^{-1} = 1 + \gamma_m, again by (1−u)m≥1−mu(1 - u)^m \ge 1 - m u. □\square

Theorem 3 (floating point). Assume the standard model: each operation returns fl(a∘b)=(a∘b)(1+δ)\mathrm{fl}(a \circ b) = (a \circ b)(1 + \delta) with ∣δ∣≤u|\delta| \le u, no underflow or overflow happens, and nu<1n u < 1. If BACK-SUBSTITUTION runs to the end, its output x^\hat x satisfies (U+ΔU)x^=b(U + \Delta U)\hat x = b with ∣Δuij∣≤γn−i+1∣uij∣≤γn∣uij∣|\Delta u_{ij}| \le \gamma_{n - i + 1} |u_{ij}| \le \gamma_n |u_{ij}| for all i,ji, j.

Proof. Fix a row ii and let k=n−ik = n - i. Write pj=fl(uijx^j)=uijx^j(1+αj)p_j = \mathrm{fl}(u_{ij} \hat x_j) = u_{ij} \hat x_j (1 + \alpha_j) for j=i+1,…,nj = i + 1, \ldots, n. Line L5 computes si=bis_{i} = b_i and sj=fl(sj−1−pj)=(sj−1−pj)(1+βj)s_j = \mathrm{fl}(s_{j-1} - p_j) = (s_{j-1} - p_j)(1 + \beta_j), where we index ss by the last jj used. Line L6 computes x^i=(sn/uii)(1+δ)\hat x_i = (s_n / u_{ii})(1 + \delta), so uiix^i(1+δ)−1=snu_{ii} \hat x_i (1 + \delta)^{-1} = s_n.

Unroll the recursion for ss:

sn=bi∏l=i+1n(1+βl)−∑j=i+1nuijx^j(1+αj)∏l=jn(1+βl).s_n = b_i \prod_{l = i+1}^{n} (1 + \beta_l) - \sum_{j = i+1}^{n} u_{ij} \hat x_j (1 + \alpha_j) \prod_{l = j}^{n} (1 + \beta_l).

Divide both sides by ∏l=i+1n(1+βl)\prod_{l=i+1}^n (1 + \beta_l) and put the result into uiix^i(1+δ)−1=snu_{ii} \hat x_i (1 + \delta)^{-1} = s_n:

uiix^i(1+δ)−1∏l=i+1n(1+βl)−1+∑j=i+1nuijx^j(1+αj)∏l=i+1j−1(1+βl)−1=bi.u_{ii} \hat x_i (1 + \delta)^{-1} \prod_{l = i+1}^{n} (1 + \beta_l)^{-1} + \sum_{j = i+1}^{n} u_{ij} \hat x_j (1 + \alpha_j) \prod_{l = i+1}^{j-1} (1 + \beta_l)^{-1} = b_i.

The factor of uiiu_{ii} is a product of k+1k + 1 terms of the form (1+δ)±1(1 + \delta)^{\pm 1}, and the factor of uiju_{ij} is a product of 1+(j−i−1)≤k1 + (j - i - 1) \le k such terms. By Lemma 2 each factor is 1+θ1 + \theta with ∣θ∣≤γk+1=γn−i+1|\theta| \le \gamma_{k+1} = \gamma_{n - i + 1}, since γm\gamma_m grows with mm. Set Δuij=θijuij\Delta u_{ij} = \theta_{ij} u_{ij} for j≥ij \ge i and Δuij=0\Delta u_{ij} = 0 for j<ij < i. Then row ii of (U+ΔU)x^=b(U + \Delta U)\hat x = b holds exactly, with ∣Δuij∣≤γn−i+1∣uij∣|\Delta u_{ij}| \le \gamma_{n - i + 1} |u_{ij}|. This holds for each row, and γn−i+1≤γn\gamma_{n - i + 1} \le \gamma_n. ■\blacksquare

Remarks. Forward substitution has the same proof with the rows taken in the order 1,…,n1, \ldots, n; row ii then has i−1i - 1 products, so its bound is γi\gamma_i. A different order of the sum in line L5 changes which factors appear in which term, but each term still has at most k+1k + 1 factors, so the bound γn\gamma_n is the same (Higham, Theorem 8.5).

Back to Forward and back substitution