Back substitution is correct and backward stable full
This proof shows: correctness, termination.
We use the notation of the page: U is n×n upper triangular, u is the unit roundoff and γk=ku/(1−ku) for ku<1.
Termination. Line L1 runs n times and line L4 runs n−i times for each i, so the algorithm stops after n2 flops or after it returns at line L2.
Theorem 1 (exact arithmetic). If each uii=0, BACK-SUBSTITUTION returns the unique x with Ux=b. If some uii=0, it returns SINGULAR, and U is singular.
Proof. If some uii=0 then detU=∏iuii=0, and line L2 returns SINGULAR at the largest such i (the loop reaches it before any smaller index). Now assume each uii=0 and let x∗ be the solution, which exists because detU=0. We show by downward induction on i the claim P(i): after the pass of line L1 for i, xk=xk∗ for k=i,…,n.
Base and step together. Assume P(i+1), or nothing when i=n. Lines L3 to L5 give s=bi−∑j=i+1nuijxj=bi−∑j=i+1nuijxj∗ by the hypothesis. Row i of Ux∗=b is uiixi∗+∑j>iuijxj∗=bi, because uij=0 for j<i. So s=uiixi∗ and line L6 sets xi=xi∗. With P(i+1) this gives P(i).
P(1) is the claim. □
Lemma 2 (Higham, Lemma 3.1). If ∣δk∣≤u and σk∈{1,−1} for k=1,…,m, and mu<1, then ∏k=1m(1+δk)σk=1+θm with ∣θm∣≤γm.
Proof. By induction on m, the product lies between (1−u)m and (1−u)−m, since each factor lies in [1−u,1/(1−u)]: for 1+δ this follows from 1+u≤1/(1−u), and for 1/(1+δ) from 1/(1+u)≥1−u. Bernoulli's inequality gives (1−u)m≥1−mu≥1−γm. For the upper end, (1−u)−m≤(1−mu)−1=1+γm, again by (1−u)m≥1−mu. □
Theorem 3 (floating point). Assume the standard model: each operation returns fl(a∘b)=(a∘b)(1+δ) with ∣δ∣≤u, no underflow or overflow happens, and nu<1. If BACK-SUBSTITUTION runs to the end, its output x^ satisfies (U+ΔU)x^=b with ∣Δuij∣≤γn−i+1∣uij∣≤γn∣uij∣ for all i,j.
Proof. Fix a row i and let k=n−i. Write pj=fl(uijx^j)=uijx^j(1+αj) for j=i+1,…,n. Line L5 computes si=bi and sj=fl(sj−1−pj)=(sj−1−pj)(1+βj), where we index s by the last j used. Line L6 computes x^i=(sn/uii)(1+δ), so uiix^i(1+δ)−1=sn.
Unroll the recursion for s:
sn=bil=i+1∏n(1+βl)−j=i+1∑nuijx^j(1+αj)l=j∏n(1+βl). Divide both sides by ∏l=i+1n(1+βl) and put the result into uiix^i(1+δ)−1=sn:
uiix^i(1+δ)−1l=i+1∏n(1+βl)−1+j=i+1∑nuijx^j(1+αj)l=i+1∏j−1(1+βl)−1=bi. The factor of uii is a product of k+1 terms of the form (1+δ)±1, and the factor of uij is a product of 1+(j−i−1)≤k such terms. By Lemma 2 each factor is 1+θ with ∣θ∣≤γk+1=γn−i+1, since γm grows with m. Set Δuij=θijuij for j≥i and Δuij=0 for j<i. Then row i of (U+ΔU)x^=b holds exactly, with ∣Δuij∣≤γn−i+1∣uij∣. This holds for each row, and γn−i+1≤γn. ■
Remarks. Forward substitution has the same proof with the rows taken in the order 1,…,n; row i then has i−1 products, so its bound is γ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+1 factors, so the bound γn is the same (Higham, Theorem 8.5).