24.2  Elimination, Pivoting, and Cost

Chapter 3 solved Ax=b by elimination and packaged the work as A=LU or PA=LU. It said nothing about how much arithmetic that costs, and almost nothing about what rounding does to it — only a remark, about a two-by-two matrix with a tiny corner entry, ending: “Chapter 24 makes this precise.” Chapter 8 left a second note: “Chapter 24 reads Gaussian elimination itself as a sequence of Schur complements of 1×1 pivots.” Chapter 13 left a third, that Cholesky “does about half the arithmetic of a general LU factorization” and needs no pivoting.

This section pays all three. Section 1 supplied the model and the word backward stable; here that word is applied to the oldest algorithm in the book. Throughout, matrices are real, since the representable numbers of Definition 24.1.1 are real, and |M| denotes the entrywise absolute value (|mij|), with |M|≤|N| read entrywise.

24.2.1. Elimination is a sequence of Schur complements

Chapter 8 built a machine for one block elimination: if M=(ABCD) with A invertible, then subtracting CA−1 times the first block row from the second leaves (ABOM/A), where M/A=D−CA−1B is the Schur complement (Definition 8.3.1, Theorem 8.3.1). Gaussian elimination is that machine run with a 1×1 block, n−1 times. Saying so exactly is the cleanest description of the algorithm there is, and it is what makes block versions of it possible.

Theorem 24.2.1 (Elimination Produces Schur Complements)

Let A∈Mn(F) and 1≤k≤n−1, and suppose the first k steps of elimination without row swaps (Chapter 3 §06) are carried out with nonzero pivots, producing A(k). Partition A=(AkBCD),A(k)=(VB′OS), with Ak,V∈Mk(F), the zero block being what the first k steps created. Then Ak is invertible and S=A/Ak=D−CAk−1B. In particular, for k=1 and a11≠0, one step of elimination replaces the trailing (n−1)×(n−1) block by the Schur complement of the 1×1 pivot block.

Idea. The first k steps multiply A on the left by a unit lower triangular matrix whose columns k+1,…,n are those of the identity — that is exactly what Lemma 3.6.3 (c) says, and it is the whole point. Such a matrix has block form (L11OL21I). Multiply that by the partitioned A(k), match the four blocks against A, and the L11 cancels out of the bottom-right block, leaving the Schur complement.

Proof. Write ℓj for the j-th multiplier vector, whose first j entries are zero, and recall from Chapter 3 §06 that step j multiplies on the left by Gj(−ℓj), with inverse Gj(ℓj) by Lemma 3.6.3 (b). Hence A=LkA(k) where, by Lemma 3.6.3 (c), Lk=G1(ℓ1)⋯Gk(ℓk)=I+∑j=1kℓjej⊤. Only columns 1,…,k of Lk differ from those of I, so partitioning Lk as A is partitioned gives Lk=(L11OL21In−k), with L11∈Mk(F) unit lower triangular, hence invertible by Lemma 3.6.1 (b).

By Theorem 8.1.1, (AkBCD)=(L11OL21I)(VB′OS)=(L11VL11B′L21VL21B′+S). Comparing blocks: Ak=L11V, B=L11B′, C=L21V, and D=L21B′+S.

Now V is upper triangular with the first k pivots on its diagonal, and those are nonzero by hypothesis, so V is invertible by Lemma 3.6.2. Therefore Ak=L11V is invertible, and Ak−1=V−1L11−1. Hence CAk−1B=(L21V)(V−1L11−1)(L11B′)=L21B′, and so S=D−L21B′=D−CAk−1B=A/Ak. This proves the theorem.

Example (Two steps, two Schur complements)

Let A=(123275−148). Carry out two steps of elimination without row swaps, then compute A/A1 and A/A2 directly from Definition 8.3.1, and check Theorem 24.2.1 in both cases.

Solution. The elimination. The first multipliers are ℓ21=2/1=2 and ℓ31=−1/1=−1; subtracting ℓi1 times row 1 from row i gives A(1). The second multiplier is ℓ32=6/3=2, and row 3 becomes (0,0,11−2(−1))=(0,0,13): A(1)=(12303−10611),A(2)=(12303−10013).

The Schur complement of the 1×1 block. Here A1=(1), B=(23), C=(2−1)⊤, and D=(7548), so A/A1=D−CA1−1B=(7548)−(2−1)(23)=(7548)−(46−2−3)=(3−1611), which is exactly the trailing block of A(1).

The Schur complement of the 2×2 block. Now A2=(1227), with detA2=3 and A2−1=13(7−2−21), while C=(−14) and B=(35)⊤. Then CA2−1=13(−156)=(−52),A/A2=8−(−52)(35)=8−(−5)=13, the trailing 1×1 block of A(2). Both readings agree with Theorem 24.2.1, and as an arithmetic check the pivots 1,3,13 multiply to 39, which is detA — the corollary below says why that is no coincidence.

Two consequences come out for free. The first identifies the pivots with ratios of minors, which is how Chapter 13 §01 wrote them in Sylvester’s criterion.

Corollary 24.2.2 (Pivots Are Ratios of Leading Minors)

Let A∈Mn(F), let 1≤k≤n−1, and write Aj for the leading principal j×j submatrix of A, with detA0:=1.

  • (a) If the first k pivots of elimination without row swaps are nonzero, then A1,…,Ak are invertible and the j-th pivot equals detAj/detAj−1 for j≤k.
  • (b) Conversely, if A1,…,An−1 are invertible then elimination without row swaps succeeds on A with nonzero pivots, and A=LU by Theorem 3.6.4.

Proof.

  • (a) Invertibility of A1,…,Ak is Theorem 24.2.1 applied with 1,…,k in place of k. For j=1 the pivot is a11=detA1/detA0, as claimed. For 2≤j≤k, the j-th pivot is the (j,j) entry of A(j−1), which by the theorem (with j−1 in place of k) is the (1,1) entry of A/Aj−1. That entry is ajj minus row j of C times Aj−1−1 times column j of B, so it involves only rows and columns 1,…,j of A: it equals the 1×1 matrix Aj/Aj−1. By Theorem 8.3.2 (a), detAj=detAj−1⋅det(Aj/Aj−1), which is the claim.

  • (b) We show by induction on j that the j-th pivot is nonzero, for j=1,…,n−1. For j=1 the pivot is a11=detA1≠0. Let 2≤j≤n−1 and suppose the first j−1 pivots are nonzero. Then Theorem 24.2.1 applies with j−1 in place of k, and the calculation in (a) identifies the j-th pivot as detAj/detAj−1, which is nonzero because Aj and Aj−1 are invertible (Theorem 7.5.2). So elimination never stops, and Theorem 3.6.4 gives A=LU.

Quick check. The matrix (0110) has no LU factorization (Example (An invertible matrix with no LU factorization)). Which hypothesis of Corollary 24.2.2 (b) fails, and what does Theorem 24.2.1 say about it?

Solution. A1=O1 is not invertible, so (b) does not apply. Theorem 24.2.1 does not apply either: it assumes the first pivot is nonzero, and here it is 0, so the Schur complement A/A1 is not even defined — Definition 8.3.1 requires the pivot block to be invertible. This is the whole content of Chapter 3’s “elimination stops”: there is no Schur complement to form.

24.2.2. What elimination costs

A flop is one arithmetic operation: one addition, subtraction, multiplication, or division, or one square root. Counting flops is crude — it ignores which operations are slow and how data moves — but it captures how the work grows with n. We quote leading terms, writing 23n3+O(n2) and meaning it. The constant matters and the exponent matters more: halving the constant is worth having, but a smaller exponent overtakes it at some size and stays ahead forever.

Proposition 24.2.3 (The Cost of Elimination)

Counting each of the five operations as one flop, and counting only arithmetic on matrix and vector entries:

  • (a) Elimination without row swaps on A∈Mn(R) costs n(n−1)(4n+1)6=23n3−12n2−16n flops, that is 23n3+O(n2).
  • (b) Forward substitution with a unit lower triangular L costs n2−n flops and back substitution with an upper triangular U costs n2, so solving Ax=b from a factorization costs 2n2−n flops.
  • (c) The Cholesky recursion of Chapter 13 §02 on a positive definite A∈Mn(R) costs n(n+1)(2n+1)6=13n3+12n2+16n flops, that is 13n3+O(n2), of which n are square roots.

Proof.

  • (a) At step k the algorithm computes n−k multipliers, one division each, and then replaces each of the (n−k)2 entries of the trailing block by aij−ℓikakj, two flops each. The entries below the pivot are set to zero without arithmetic. So the cost is ∑k=1n−1[(n−k)+2(n−k)2]=∑j=1n−1(j+2j2)=(n−1)n2+(n−1)n(2n−1)3, using ∑j≤mj=m(m+1)/2 and ∑j≤mj2=m(m+1)(2m+1)/6 with m=n−1. Putting the two terms over 6 gives n(n−1)(3+2(2n−1))/6=n(n−1)(4n+1)/6.

  • (b) Forward substitution computes xi=bi−∑j<iℓijxj with no division, since ℓii=1: that is 2(i−1) flops, and ∑i≤n2(i−1)=n(n−1). Back substitution computes xi=(bi−∑j>iuijxj)/uii, which is 2(n−i)+1 flops, and ∑i≤n(2(n−i)+1)=n(n−1)+n=n2.

  • (c) Column j of the recursion computes ℓjj=(ajj−∑k<jℓjk2)1/2, costing 2(j−1) flops for the sum and one square root, and then ℓij=(aij−∑k<jℓikℓjk)/ℓjj for each of the n−j rows below, costing 2(j−1)+1 flops each. The total is ∑j=1n(n−j+1)(2j−1)=∑i=1ni(2n−2i+1)=(2n+1)n(n+1)2−2⋅n(n+1)(2n+1)6, substituting i=n−j+1; the two terms combine to n(n+1)(2n+1)(12−13)=n(n+1)(2n+1)/6.

Comparing (a) and (c): 13n3 against 23n3. This is Chapter 13 §02’s “Cholesky does about half the arithmetic of a general LU factorization”, now a count rather than a claim, for the reason that section gave — the recursion produces one triangular factor instead of two. Part (b) says the factorization is the expensive part: solving m systems with the same A costs 23n3+2mn2, not m times 23n3.

24.2.3. One row at a time

Every algorithm below computes its entries the same way: accumulate a sum of products into a running total, then possibly divide. Analyzing that pattern once saves doing it three times.

Lemma 24.2.4 (One Row of Substitution)

Let m≥0, let t1,…,tm, y1,…,ym, c, and d≠0 be representable, and suppose s0=c,sp=fl(sp−1−fl(tpyp))(p=1,…,m),z=fl(sm/d) are computed in the model of Definition 24.1.1, with (m+1)u<1. Then there are θ0,…,θm with c=dz(1+θ0)+∑p=1mtpyp(1+θp),|θp|≤γm+1  for all p. If the final division is omitted, so that z=sm, the same identity holds with d=1 and |θp|≤γm.

Idea. Unroll the recursion, then divide the whole identity by the product of the accumulation factors. Dividing is the trick: it moves those factors onto c’s neighbors as inverse factors, which is exactly what Lemma 24.1.1 was stated to allow.

Proof. By (FP2) there are δp,εp,η, all of modulus at most u, with fl(tpyp)=tpyp(1+δp), sp=(sp−1−tpyp(1+δp))(1+εp), and z=(sm/d)(1+η). Induction on m gives sm=c∏p=1m(1+εp)−∑p=1mtpyp(1+δp)∏q=pm(1+εq), the case m=0 being s0=c, and the step from m−1 to m multiplying everything by 1+εm and subtracting the new term.

Each 1+εp is nonzero, since |εp|≤u<1, so we may divide the identity by ∏p≤m(1+εp) and rearrange: c=sm∏p=1m(1+εp)−1+∑p=1mtpyp(1+δp)∏q=1p−1(1+εq)−1. From z=(sm/d)(1+η) we get sm=dz(1+η)−1. So the first term is dz times a product of m+1 factors of the form (1+δ)±1 with |δ|≤u, which by Lemma 24.1.1 is 1+θ0 with |θ0|≤γm+1. The p-th term of the sum carries 1+(p−1)=p≤m such factors, so it is tpyp(1+θp) with |θp|≤γp≤γm+1.

If the division is omitted, the first term carries only the m inverse factors, so |θ0|≤γm, and the rest of the argument is unchanged. This proves the lemma.

24.2.4. Solving a triangular system

Here is the cleanest backward error analysis in the subject, and the model for every other one in this chapter. Note in advance what it does not assume: nothing about the size of the diagonal entries of T, nothing about its conditioning, and no pivoting of any kind.

Theorem 24.2.5 (Backward Error of a Triangular Solve)

Let T∈Mn(R) be lower triangular with representable entries and nonzero diagonal, let b∈Rn be representable, and let nu<1. Let x^ be computed by forward substitution in the model: for each i, the products tijx^j are subtracted from bi one at a time in increasing order of j, and the result is divided by tii — that is, exactly the computation of Lemma 24.2.4 with m=i−1. Then there is a lower triangular ΔT with (T+ΔT)x^=band|Δtij|≤γi|tij|≤γn|tij|(j≤i). The same statement, with γn+1−i in place of γi, holds for back substitution with an upper triangular T.

Idea. Row i is the pattern of Lemma 24.2.4, with c=bi, the m=i−1 products tijx^j, and the final division by tii. The lemma hands back an identity in which every coefficient of x^j is tij times something within γi of 1; that “something minus one”, times tij, is Δtij.

Proof. Fix i. The quantities x^1,…,x^i−1 are already computed, hence representable, so Lemma 24.2.4 applies with m=i−1, c=bi, tp=tip, yp=x^p, d=tii, and z=x^i. Since m+1=i≤n and nu<1, it gives θ0,…,θi−1 of modulus at most γi with bi=tiix^i(1+θ0)+∑j<itijx^j(1+θj). Define Δtii=tiiθ0, Δtij=tijθj for j<i, and Δtij=0 for j>i. Then ΔT is lower triangular, |Δtij|≤γi|tij|≤γn|tij| since γi≤γn, and the display says precisely that row i of (T+ΔT)x^ equals bi. As i was arbitrary, (T+ΔT)x^=b.

For back substitution, row i has n−i products instead of i−1, so the lemma applies with m=n−i and the bound is γn+1−i. This proves the theorem.

This is as strong as a backward error statement gets. The perturbation is bounded entrywise, and entrywise relative to the entries of T itself: a zero entry of T is not perturbed at all, and a tiny entry is perturbed only in its own last digits. So a triangular solve is backward stable in the sense of Definition 24.1.3 — with the constant c=1.02n in any model with nu≤0.01, since γn≤1.02nu there — whatever κ(T) may be.

Warning. Backward stable is not accurate, and this theorem is where the point bites hardest. Theorem 24.2.5 holds for every nonsingular triangular T. It does not say x^ is near x. By Theorem 24.1.3 the forward error can be about κ(T)γn, and triangular matrices can be spectacularly ill-conditioned. Take the n×n matrix T with 1 on the diagonal and −1 everywhere above it. Its row sums of moduli are n,n−1,…,1, so ‖T‖∞=n. Its inverse has 1 on the diagonal and 2j−i−1 in position (i,j) for j>i: back substitution on Tx=ej gives xj=1 and xi=∑p>ixp for i<j, and each partial sum of 1,1,2,4,… is the next term. Hence ‖T−1‖∞=1+(1+2+⋯+2n−2)=2n−1 and κ∞(T)=n2n−1, so for n=60 a backward stable solve can still return nonsense. Stability is a promise about the data, and a promise about the data is worth only what the conditioning of the problem makes it worth.

24.2.5. The factorization itself

For the factorization we analyze the ordering that computes each entry of L and U by one accumulation. In exact arithmetic it produces the same factors as Chapter 3’s row operations — for invertible A this is Theorem 3.6.5 — but it groups the arithmetic differently, and rounding notices the difference.

Algorithm. Elimination, one entry at a time. Input: A∈Mn(R). Set ℓii=1. For i=1,2,…,n:

  • for j=i,…,n, put uij=aij−∑k<iℓikukj;
  • if uii=0, stop; otherwise for r=i+1,…,n, put ℓri=(ari−∑k<iℓrkuki)/uii.
Theorem 24.2.6 (Backward Error of a Factorization)

Let A∈Mn(R) have representable entries, let nu<1, and suppose the algorithm above runs to completion in the model of Definition 24.1.1, producing L^ and U^. Then L^U^=A+ΔAwith|ΔA|≤γn|L^||U^| entrywise.

Idea. Each entry is one application of Lemma 24.2.4: the entries of U with no division, the entries of L with one. In both cases the lemma returns aij as a sum of the products ℓ^ipu^pj, each with its own factor 1+θp. Collecting the terms is exactly forming the (i,j) entry of L^U^, and the θp are what is left over.

Proof. Case i≤j. The computation of u^ij is Lemma 24.2.4 with m=i−1, c=aij, tp=ℓ^ip, yp=u^pj, no division, and z=u^ij. Writing θi for the θ0 of the lemma, and using ℓ^ii=1, aij=∑p=1iℓ^ipu^pj(1+θp),|θp|≤γi−1. (For i=1 the sum has one term and θ1=0.) Since ℓ^ip=0 for p>i, the sum without the θp is (L^U^)ij. Hence |aij−(L^U^)ij|=|∑p≤iℓ^ipu^pjθp|≤γi−1∑p≤i|ℓ^ip||u^pj|=γi−1(|L^||U^|)ij, the last equality again because ℓ^ip=0 for p>i.

Case i>j. The computation of ℓ^ij is Lemma 24.2.4 with m=j−1, c=aij, tp=ℓ^ip, yp=u^pj, d=u^jj, and z=ℓ^ij. Writing θj for θ0, aij=∑p=1jℓ^ipu^pj(1+θp),|θp|≤γj. Since u^pj=0 for p>j, the sum without the θp is again (L^U^)ij, and the same estimate gives |aij−(L^U^)ij|≤γj(|L^||U^|)ij.

In both cases the constant is at most γn. This proves the theorem.

Remark. What is proved and what is not. The theorem is about the ordering displayed above. Chapter 3’s ordering, which updates the whole trailing block at each step, satisfies the same bound |ΔA|≤γn|L^||U^|; the proof is a different induction of comparable length, and we do not give it here. Nothing later in this chapter uses it. Also, the theorem assumes the algorithm completes, which in the model means every computed u^ii is nonzero; it says nothing about what happens when one of them is zero, or about the case where a pivot is nonzero only by a rounding accident. One more seam will appear below: the growth bound for partial pivoting, proved in the next subsection, concerns the exact elimination in Chapter 3’s ordering, whereas the bound just proved concerns the factors this ordering computes in the model. In exact arithmetic, and for invertible A, the two orderings produce the same L and U, by Theorem 3.6.5; in the model they agree only to within rounding, and we do not quantify that here. Nothing below is allowed to cross that seam quietly. Eq. 24.2.1, proved next, measures growth in the computed factors, which is a quantity one can read off after the fact; the a priori bound 2n−1 of Theorem 24.2.8 is a statement about exact elimination. The three places that put the two together — the warning after Example (A matrix that really grows) and the solutions to A1 and B3 — say that they are doing so, and each of them uses the combination only to show that even its most favorable reading proves nothing.

The bound is useless until we know how big |L^||U^| is, and that is not controlled by A. It is controlled by what the algorithm does to A, which is why elimination needs a pivoting rule at all. The quantity to watch has a name.

Definition 24.2.1 (Growth factor)

Let elimination — with whatever pivoting rule is in force — be run on A∈Mn(R), producing an upper factor U. The growth factor of that run is gn:=maxi,j|uij|maxi,j|aij|, the largest entry in modulus the algorithm produces, relative to the largest entry in modulus it was given. For a run in the model, U means the computed U^.

Remark. The classical definition takes the maximum over every intermediate matrix A(0)=A,A(1),…,A(n−1)=U of the row-operation ordering, not only over U. That quantity is at least gn, so any upper bound proved for it bounds gn too, and it is what the growth theorem of the next subsection actually estimates. The ratio above is the form the backward error bound needs.

Suppose a pivoting rule keeps every multiplier at most 1 in modulus — the next subsection exhibits one, for the algorithm above as well as for Chapter 3’s ordering. Then |ℓ^ip|≤1, so for all i,j (|L^||U^|)ij≤∑p|u^pj|≤nmaxp,q|u^pq|=ngnmaxp,q|apq|, and Theorem 24.2.6 becomes

maxi,j|Δaij|≤nγngnmaxi,j|aij|.
(24.2.1)

Since γn is about nu, the relative backward error is about n2gnu. The dimensional factor n2 is pessimistic and nobody minds it. Everything therefore depends on gn — and on nothing else.

24.2.6. Pivoting

Proposition 24.2.7 (Partial Pivoting Bounds the Multipliers)

Run elimination with partial pivoting: at step k, before eliminating, exchange row k with a row r≥k for which |ark(k−1)| is largest. Then every multiplier satisfies |ℓik|≤1, in exact arithmetic; and in the model |ℓ^ik|≤1 as well.

Proof. After the exchange, the pivot akk(k−1) has the largest modulus in its column among rows k,…,n. If it is zero then the whole column is zero, every multiplier is set to 0, and there is nothing to prove. Otherwise |aik(k−1)|≤|akk(k−1)| for i>k, so |ℓik|=|aik(k−1)/akk(k−1)|≤1.

In the model, ℓ^ik=fl(x) for a real x with |x|≤1. Both 1 and −1 lie in R, by Definition 24.1.1, and the one with the sign of x is at distance 1−|x| from x; since fl(x) is a nearest element of R, also |fl(x)−x|≤1−|x|. If |fl(x)| were greater than 1 we would get |fl(x)−x|≥|fl(x)|−|x|>1−|x|, a contradiction. So |ℓ^ik|≤1.

Remark. The same rule, one entry at a time. The proposition is stated for Chapter 3’s ordering, which has the column entries ark(k−1) in hand at step k. In the entry-at-a-time algorithm those entries appear as the candidate numerators ari−∑k<iℓ^rku^ki with r≥i, and partial pivoting there means: form all of them, exchange rows i and r so that the largest of them in modulus becomes u^ii, and only then divide. The proof above applies word for word, with the candidate numerator in place of ark(k−1) — it uses nothing about those numbers except that the divisor is the largest of them in modulus — so every multiplier of that ordering satisfies |ℓ^ri|≤1 too. That is what licenses the hypothesis under which Eq. 24.2.1 was derived for the computed factors of Theorem 24.2.6.

Theorem 24.2.8 (Growth Under Partial Pivoting)

In exact arithmetic, elimination with partial pivoting on any A∈Mn(R) has growth factor gn≤2n−1.

Idea. One step replaces an entry by itself minus a multiple, of modulus at most 1, of another entry. Two numbers of modulus at most M cannot make more than 2M. Repeat n−1 times.

Proof. Write Mk=maxi,j|aij(k)|, and let B=(bij) be A(k−1) after the row exchange of step k; an exchange only permutes entries, so maxi,j|bij|=Mk−1. Every entry of A(k) is either an entry of B (the rows 1,…,k are left alone, and the entries below the pivot are set to 0) or of the form aij(k)=bij−ℓikbkj,|aij(k)|≤|bij|+|ℓik||bkj|≤2Mk−1, using |ℓik|≤1 from Proposition 24.2.7. Hence Mk≤2Mk−1 for every k, and by induction Mk≤2kM0. The intermediate matrices are A(0),…,A(n−1), so maxi,j,k|aij(k)|=max0≤k≤n−1Mk≤2n−1M0, which is gn≤2n−1. This proves the theorem.

Remark. One expects the same argument in the model to give Mk≤2(1+u)2Mk−1, the subtraction and the multiplication each contributing a factor 1+δ, and hence gn≤(2(1+u)2)n−1, which for any u worth using is 2n−1 in all but the last digits. We have not written that induction out, and nothing in this section cites it: Theorem 24.2.8, the exact-arithmetic statement, is the only growth bound we have, and the passages that carry it over to a computed factorization say that they are doing so.

Quick check. Run elimination on (1234) without row swaps, and again with partial pivoting, and compute g2 each time. Does partial pivoting make the growth factor smaller?

Solution. Without a swap the multiplier is 3 and u22=4−3⋅2=−2, so U=(120−2) and g2=2/4=12. With partial pivoting the rows are exchanged, the multiplier is 13, and u22=2−13⋅4=23, so U=(3402/3) and g2=4/4=1. Pivoting made the growth factor larger, and gn<1 is perfectly possible. Partial pivoting does not minimize growth; it bounds the multipliers, and Theorem 24.2.8 turns that into a worst-case bound — here 21=2, which both runs respect.

The bound 2n−1 is dreadful, and it is attained.

Example (A matrix that really grows)

Let Yn∈Mn(R) have 1 on the diagonal, −1 strictly below it, 0 strictly above it except in the last column, and 1 throughout the last column. For n=4, Y4=(1001−1101−1−111−1−1−11). Run elimination with partial pivoting on Y4 and on Y5, and compute the growth factor of each.

Solution. The runs below are in exact arithmetic, so the factors are L and U, with no hats. Every entry of Yn has modulus 1, so gn is simply the largest modulus of an entry of the resulting U.

Step 1 on Y4. Column 1 is (1,−1,−1,−1); all four entries have modulus 1, so the largest is already in place and no exchange is made. The multipliers are −1, so each lower row has row 1 added to it. Rows 2,3,4 become (0,1,0,2), (0,−1,1,2), (0,−1,−1,2): the last column has doubled.

Step 2. Column 2 below the diagonal is (−1,−1) against the pivot 1; again no exchange, multipliers −1. Rows 3,4 become (0,0,1,4) and (0,0,−1,4).

Step 3. Multiplier −1 again; row 4 becomes (0,0,0,8). So U=(1001010200140008),g4=81=8=23.

For n=5 the same three observations repeat once more: no exchange is ever made, every multiplier is −1, and the last column runs 1,2,4,8,16 down the diagonal of U, giving g5=16=24.

Every entry of Yn is ±1, and partial pivoting does exactly what it is told; for these two sizes the bound of Theorem 24.2.8 is attained, not approached. The same three observations run by induction for every n, and Exercise (C2: The growth bound is attained for every n) carries that induction out.

Warning. Partial pivoting is not proved stable by anything in this chapter. Eq. 24.2.1 bounds the backward error by nγngnmaxi,j|aij|, where gn is the growth in the computed factors, and the only bound we have on growth is Theorem 24.2.8’s 2n−1, for the exact elimination; the remark after Theorem 24.2.6 records that gap and we have not closed it. Grant it anyway, and the resulting backward error bound is about n22n−1u, which for n=60 exceeds 1 and says nothing at all — so even the optimistic reading proves nothing. What is true in practice is that gn is almost always a small multiple of 1 — but “almost always” is a statement about the matrices people meet, not a theorem, and Example (A matrix that really grows), with Exercise (C2: The growth bound is attained for every n) for general n, shows there is no theorem to be had. Partial pivoting is used because it is cheap and because its failures are rare and constructed, not because it is backward stable in the sense of Definition 24.1.3. That is an honest summary of the state of the subject, and the reader should not accept a tidier one.

24.2.7. The example Chapter 3 promised

Chapter 3 §06 ended its discussion of pivoting with a two-by-two matrix and a promise: after describing how (ε111) makes elimination produce a computed LU whose (2,2) entry is 0 instead of 1, it wrote “Swapping the rows first gives the harmless multiplier ε. Chapter 24 makes this precise.” Here it is, made precise.

Example (The tiny pivot, in the model)

Work in the six-digit decimal model of Example (The model we compute in), where u=5×10−6, and take A=(ε111),b=(12),ε=10−8. Factor and solve without an exchange, then with one. In each case compute L^U^ exactly and report the backward error.

Solution. The exact answer. Subtracting the first equation’s ε-multiple, (1−ε)x1=1, so x=(11−ε,1−2ε1−ε)=(1.00000001…,0.99999999…). Also κ∞(A)=4/(1−ε)<5, exactly as in Chapter 16 §08: the problem is well conditioned.

Without the exchange. The multiplier is fl(1/ε)=108, and u^22=fl(1−fl(108⋅1))=fl(1−108)=fl(−99999999)=−108, the last step by rounding to six digits. Forward substitution gives y^1=1 and y^2=fl(2−108)=−108; back substitution gives x^2=fl(−108/−108)=1 and then x^1=fl((1−1)/ε)=0. The computed answer is (0,1) — Chapter 16 §08’s (0,1), reproduced here in a model rather than by hand-waving about digits. Multiplying the computed factors exactly, L^U^=(101081)(10−810−108)=(10−8110)=A+ΔA,ΔA=(000−1). So ‖ΔA‖∞/‖A‖∞=12. The backward error is not O(u); it is O(1). This factorization is not backward stable, and it is not even close.

With the exchange. Partial pivoting compares |ε| with 1 and swaps, so we factor PA=(11ε1) with Pb=(2,1). The multiplier is fl(ε/1)=ε, and u^22=fl(1−fl(ε⋅1))=fl(1−10−8)=1, since 1−10−8 lies between the representable neighbors 0.999999 and 1 and is far nearer the second. Forward substitution gives y^1=2 and y^2=fl(1−fl(2ε))=fl(1−2×10−8)=1; back substitution gives x^2=1 and x^1=fl((2−1)/1)=1. The computed answer is (1,1), whose relative error against the exact x is about 10−8, far better than u. Multiplying the computed factors exactly, L^U^=(1010−81)(1101)=(1110−81+10−8)=PA+ΔA,ΔA=(00010−8), so ‖ΔA‖∞/‖A‖∞=5×10−9, comfortably below u. This factorization is backward stable.

What the exchange achieved. Exactly what Eq. 24.2.1 predicts. Without it the growth factor is g2=108: an entry of modulus 108 is created out of a matrix whose largest entry is 1, and creating it destroys the information in a22=1, which lies beneath its last digit. With the exchange, Proposition 24.2.7 keeps the multiplier at ε≤1, g2=1, and nothing large is ever made. Note what was not the problem: κ∞(A)<5 throughout. Chapter 16 §08 said so: “Conditioning bounds what any method can promise; whether a given method keeps that promise is stability.”

24.2.8. Cholesky needs no pivoting

For a positive definite matrix the whole difficulty disappears, and the reason is a one-line inequality about the entries of the factor. Chapter 13 §02 asserted it — “it needs no pivoting: the recursion above never divides by something that positive definiteness allows to be zero” — and left the arithmetic half here.

Theorem 24.2.9 (Cholesky Does Not Grow)

Let A∈Mn(R) be symmetric positive definite with representable entries, and let L be its Cholesky factor, A=LL⊤ with ℓii>0 (Theorem 13.2.3).

  • (a) |ℓij|≤aii for all j≤i, and (|L||L⊤|)ik≤aiiakk≤maxp,q|apq|for all i,k.
  • (b) Suppose (n+1)u<1 and the recursion of Chapter 13 §02 runs to completion in the model, producing L^. Then L^L^⊤=A+ΔA,|ΔA|≤γn+1|L^||L^⊤|.
  • (c) If moreover γn+1<1, then maxi,j|Δaij|≤γn+11−γn+1maxi,j|aij|.

Idea. For (a): the rows of L have known lengths, because (LL⊤)ii=aii is the squared length of row i. An entry is no longer than its row, and Cauchy–Schwarz compares two rows. For (b): each off-diagonal entry is Lemma 24.2.4 again, and the diagonal entry is the same lemma followed by a square root, which contributes two more factors. For (c): part (b) bounds the row lengths of L^ in terms of A, and then (a)’s argument runs again on L^.

Proof.

  • (a) Row i of L has ∑pℓip2=(LL⊤)ii=aii, so every single term satisfies ℓij2≤aii. By the Cauchy–Schwarz inequality (Theorem 11.1.5) applied to the rows i and k of |L|, (|L||L⊤|)ik=∑p|ℓip||ℓkp|≤(∑pℓip2)1/2(∑pℓkp2)1/2=aiiakk. Finally aiiakk≤maxpapp, and maxpapp=maxp,q|apq|: the diagonal entries are positive (take x=ep in Definition 13.1.1), and |apq|=|(LL⊤)pq|≤(|L||L⊤|)pq≤appaqq≤maxpapp, the middle step by the display just proved.

  • (b) Fix i>j. The computation ℓ^ij=fl((aij−∑k<jℓ^ikℓ^jk)/ℓ^jj) is Lemma 24.2.4 with m=j−1 and d=ℓ^jj, so, writing θj for θ0, aij=∑p=1jℓ^ipℓ^jp(1+θp),|θp|≤γj≤γn+1. Since ℓ^jp=0 for p>j, the sum without the θp is (L^L^⊤)ij, so |aij−(L^L^⊤)ij|≤γn+1∑p≤j|ℓ^ip||ℓ^jp|=γn+1(|L^||L^⊤|)ij.

    For i=j, let s^ be the value accumulated before the square root, so ℓ^jj=fl(s^)=s^(1+η) with |η|≤u, and s^=ℓ^jj2(1+η)−2. By the proof of Lemma 24.2.4 with m=j−1 and no division — we need not just the size of θ0′ but its shape, and the proof produces 1+θ0′ as the product of the j−1 factors (1+εp)−1 — ajj=s^(1+θ0′)+∑p<jℓ^jp2(1+θp),|θ0′|,|θp|≤γj−1. Substituting s^, the first term is ℓ^jj2 times a product of (j−1)+2≤n+1 factors of the form (1+δ)±1, which by Lemma 24.1.1 is 1+θj with |θj|≤γn+1. So again ajj=∑p≤jℓ^jpℓ^jp(1+θp) with all |θp|≤γn+1, and the displayed estimate follows as before. Since L^ is lower triangular, the entries with i<j are the transposes of these, and ΔA is symmetric.

  • (c) The diagonal case of (b) reads |aii−(L^L^⊤)ii|≤γn+1(L^L^⊤)ii, because (|L^||L^⊤|)ii=∑pℓ^ip2=(L^L^⊤)ii. Hence (L^L^⊤)ii(1−γn+1)≤aii, that is ∑pℓ^ip2≤aii1−γn+1. Cauchy–Schwarz as in (a), now for L^, gives (|L^||L^⊤|)ik≤aiiakk/(1−γn+1)≤maxp,q|apq|/(1−γn+1). Substituting into (b) gives (c). This proves the theorem.

Compare (c) with Eq. 24.2.1. For a general matrix the backward error carried the factor gn, which partial pivoting bounds only by 2n−1, sharply. Here the same quantity is bounded by the largest entry of A itself, with no growth factor and no pivoting: the Cholesky recursion is unconditionally backward stable. The reason sits entirely in part (a) — the rows of the factor cannot be longer than the diagonal of A allows — and that is a fact about positive definiteness, not about arithmetic. Chapter 13 §02 called positive definiteness “the one structural hypothesis under which elimination is unconditionally safe”; this is the proof.

Warning. Part (a) bounds |ℓij| by aii, the diagonal entry of its own row, not of its column. The column version is false. For A=(0.010.090.09100), which is positive definite since 0.01>0 and detA=1−0.0081>0 (Theorem 13.1.5 (d)), the factor is ℓ11=0.1, ℓ21=0.9, and |ℓ21|=0.9 is nine times a11=0.1. It is at most a22=10, as (a) requires. An entry of L can be far larger than the pivot it was divided by; what it cannot exceed is the size of its own row.

24.2.9. Exercises

A. Check your understanding

Exercise (A1)
  • (a) Define a flop and the growth factor gn.
  • (b) State the partial pivoting rule, and say what Proposition 24.2.7 gets from it.
  • (c) State the leading term of the flop count for an LU factorization, for two triangular solves and for Cholesky.
  • (d) Decide whether each statement is correct, with a reason: (i) “a triangular solve needs pivoting when the diagonal entries are small”; (ii) “elimination with partial pivoting is backward stable”; (iii) “a backward stable factorization gives an accurate solution”.
  • (e) In one sentence, what does Theorem 24.2.1 say about the trailing block after k steps?

Solution.

  • (a) A flop is one arithmetic operation — an addition, subtraction, multiplication, division, or square root. The growth factor is gn=maxi,j|uij|/maxi,j|aij|, the largest entry in modulus the elimination produces relative to the largest in modulus it was given (Definition 24.2.1); the classical version maximizes over every intermediate matrix as well, and is at least as large.

  • (b) At step k, exchange row k with the row r≥k maximizing |ark(k−1)|. The consequence is |ℓik|≤1 for every multiplier, in exact arithmetic and in the model.

  • (c) 23n3, 2n2, and 13n3 respectively (Proposition 24.2.3); the third is half the first.

  • (d)
    • (i) Incorrect. Theorem 24.2.5 holds for every nonsingular triangular matrix, with no hypothesis on the diagonal and no pivoting. (ii) Incorrect as stated. The only growth bound available is Theorem 24.2.8’s gn≤2n−1, proved for the exact elimination, and Example (A matrix that really grows) shows it is attained; even granting its transfer to the computed factors — the gap recorded in the remark after Theorem 24.2.6 — the resulting backward error bound n22n−1u is vacuous for moderate n. (iii) Incorrect. It gives an accurate solution only when the problem is well conditioned; Theorem 24.1.3 supplies the missing factor κ(A).
  • (e) It is the Schur complement A/Ak of the leading k×k block — so elimination is the repeated formation of Schur complements of 1×1 pivots.

B. Practice

Exercise (B1: A Schur complement by two routes)

Let A=(21−145−1−282).

  • (a) Carry out one step of elimination without row swaps and read off the trailing 2×2 block.
  • (b) Compute A/A1=D−Ca11−1B directly from Definition 8.3.1 and check that the two agree.
  • (c) Carry out the second step and verify Corollary 24.2.2 (a) by computing detA1, detA2, and detA3.

Solution.

  • (a) The multipliers are ℓ21=4/2=2 and ℓ31=−2/2=−1. Subtracting gives rows (0,3,1) and (0,9,1), so the trailing block is (3191).

  • (b) Here A1=(2), B=(1,−1), C=(4,−2)⊤, D=(5−182), so Ca11−1B=12(4−2)(1−1)=(2−2−11),A/A1=(3191), which agrees with (a), as Theorem 24.2.1 says it must.

  • (c) The second multiplier is 9/3=3, and the second step turns (0,9,1) into (0,0,1−3)=(0,0,−2). So the pivots are 2,3,−2. Now detA1=2, detA2=10−4=6, and detA=2(10+8)−1(8−2)+(−1)(32+10)=36−6−42=−12. The ratios are 2/1=2, 6/2=3, and −12/6=−2: the pivots, as claimed.

Exercise (B2: Growth, with and without a swap)

Let A=(10−4111), and work in the six-digit decimal model.

  • (a) Factor A without an exchange, compute g2, and compute L^U^ exactly.
  • (b) Do the same after exchanging the rows.
  • (c) Compare the two backward errors with the bound of Eq. 24.2.1.

Solution.

  • (a) The multiplier is fl(1/10−4)=104, and u^22=fl(1−104)=−9999.00, which is exactly representable. So L^U^=(101041)(10−410−9999)=(10−4111)=A, so here ΔA=O: with six digits, 1−104 is not rounded, and nothing is lost. The growth factor is g2=9999/1=9999.

  • (b) After the exchange the multiplier is 10−4 and u^22=fl(1−10−4)=0.999900, again exact, so L^U^=PA exactly and g2=1.

  • (c) Both backward errors are zero, so both satisfy the bound. For n=2 the entry-at-a-time algorithm and Chapter 3’s row operations perform the very same three operations, so Eq. 24.2.1 applies to these runs as it stands, with g2 read off the computed factors. The point is the bound, not the outcome: in (a) it is 2γ2g2≈4×9999u≈0.2, which permits a catastrophe, while in (b) it is about 4u, which does not. Large growth does not force a large backward error; it removes the guarantee that there is none, and Example (The tiny pivot, in the model) shows what happens when the permission is taken up.

Exercise (B3: The Cholesky entry bound)

Let A=(4−26−25−16−126), whose Cholesky factor was computed in Example (A Cholesky Factorization, and One That Fails) to be L with rows (2,0,0), (−1,2,0), (3,1,4).

  • (a) Check Theorem 24.2.9 (a) entry by entry.
  • (b) Compute |L||L⊤| and check that every entry is at most maxp,q|apq|.
  • (c) What would the bound of Eq. 24.2.1 require if A were factored by general elimination with partial pivoting instead?

Solution.

  • (a) The bound is |ℓij|≤aii. Row 1: 2≤4=2, with equality. Row 2: 1,2≤5≈2.236. Row 3: 3,1,4≤26≈5.099. All hold, and the row sums of squares are 4,5,26, which are a11,a22,a33 exactly.

  • (b) |L| has rows (2,0,0), (1,2,0), (3,1,4), so |L||L⊤|=(4262556526). The largest entry of A in modulus is 26, and every entry above is at most 26 — indeed the (i,k) entry is at most aiiakk: for instance 5≤5⋅26≈11.4.

  • (c) It would require knowing g3 for the computed factors, and the only bound available is Theorem 24.2.8’s exact-arithmetic 22=4; granting the transfer between the two (the remark after Theorem 24.2.6), Eq. 24.2.1 permits max|Δaij|≤3γ3⋅4⋅26=12γ3⋅26. Theorem 24.2.9 (c) permits (γ4/(1−γ4))⋅26 instead: the factor 3g3=12 disappears entirely, and the price is the step from γ3 to γ4/(1−γ4), which is about 43γ3. No pivoting is needed to get it.

C. Going deeper

Exercise (C1: Column diagonal dominance needs no pivoting)

Call A∈Mn(R) strictly column diagonally dominant if |ajj|>∑i≠j|aij| for every j.

  • (a) Show that partial pivoting makes no exchange at the first step.
  • (b) Show that A/A1 is again strictly column diagonally dominant, and that each of its column sums ∑i≥2|aij′| is at most the corresponding column sum ∑i≥1|aij| of A.
  • (c) Deduce that elimination without any exchanges succeeds and that gn<2.

Hint: for (c), bound every entry of every A(k) by a column sum of A.

Solution.

  • (a) Column 1 satisfies |a11|>∑i≥2|ai1|≥|ai1| for each i≥2, so the entry of largest modulus in column 1 is already a11, and it is nonzero.

  • (b) Write aij′=aij−(ai1/a11)a1j for i,j≥2. For the column sums, the triangle inequality gives ∑i≥2|aij′|≤∑i≥2|aij|+|a1j||a11|∑i≥2|ai1|≤∑i≥2|aij|+|a1j|=∑i≥1|aij|, using ∑i≥2|ai1|<|a11|. For dominance, fix j≥2. Then ∑i≥2i≠j|aij′|≤∑i≥2i≠j|aij|+|a1j||a11|∑i≥2i≠j|ai1|<(|ajj|−|a1j|)+|a1j||a11|(|a11|−|aj1|), where the two strict bounds are column-j and column-1 dominance. The right side equals |ajj|−|a1j||aj1|/|a11|, which is at most |ajj−aj1a1j/a11|=|ajj′| by the reverse triangle inequality. So ∑i≥2,i≠j|aij′|<|ajj′|.

  • (c) By (a) and (b) and induction, every Schur complement A(k) restricted to its active block is strictly column diagonally dominant, so no exchange is ever made and no pivot is zero. By (b) and induction, the column sums of the active blocks never increase, so every entry of every A(k) is bounded by maxj∑i|aij| — and the rows that have been frozen into U were bounded the same way when they were created. Finally, dominance gives ∑i|aij|<2|ajj|≤2maxp,q|apq|, so gn<2. Hence such matrices need no pivoting at all.

Exercise (C2: The growth bound is attained for every n)

Let Yn be the matrix of Example (A matrix that really grows): yii=1, yij=−1 for i>j, yin=1 for all i, and yij=0 for j>i with j<n.

  • (a) Prove that partial pivoting makes no exchange at any step, and that every multiplier equals −1.
  • (b) Prove by induction on k that after k steps the active trailing block is again of the form Yn−k, except that its last column is 2k times the all-ones vector.
  • (c) Deduce gn=2n−1, and explain why this does not contradict the practical success of partial pivoting.

Solution.

  • (a) and (b) together, by induction. At step k=1, column 1 is (1,−1,…,−1), every entry of modulus 1, so the pivot y11=1 is already of largest modulus and no exchange is made; the multipliers are −1/1=−1. Subtracting −1 times row 1 from row i adds row 1 to row i. Row 1 is (1,0,…,0,1), so for i≥2 the entries in columns 2,…,n−1 are unchanged, the entry in column 1 becomes 0, and the entry in column n becomes 1+1=2. The trailing (n−1)×(n−1) block therefore has 1 on its diagonal, −1 below, 0 above except in the last column, and 2 throughout its last column: it is Yn−1 with the last column doubled. Since doubling one column changes neither which entry of a column has largest modulus nor the ratios within the other columns, the same applies at every subsequent step, and after k steps the active block is Yn−k with last column 2k times the all-ones vector.

  • (b) Every entry of Yn has modulus 1, so M0=1. By (b) the largest entry ever created is the (n,n) entry after step n−1, namely 2n−1. So gn=2n−1, meeting Theorem 24.2.8 exactly.

This does not contradict anything practical: Yn is a constructed matrix, and the theorem only says the worst case is 2n−1. What the example does destroy is the hope of a theorem: no bound better than 2n−1 can be proved for partial pivoting, so any claim that partial pivoting is backward stable is a claim about the matrices one meets, not about all matrices. That is why Theorem 24.2.9 matters — it is a genuine theorem, for a class of matrices identified in advance.

Found a typo or a mistake? Report it, or read this page’s source

The text of this book is licensed under CC BY-NC-SA 4.0.