Proofs: LUP decomposition
These are the human proofs of LUP decomposition, at full length.
LUP-DECOMPOSITION computes PA = LU with bounded multipliers, and reports SINGULAR exactly for singular A full
This proof shows: correctness, termination.
We work in exact arithmetic first. is a real matrix, is the -th unit vector, and for a permutation we write for the matrix with . The algorithm stops: line L2 runs at most times, and each inner loop has a fixed length.
State after pass . Let be the array after pass (for , the input ) and the current permutation. Define
- : the unit lower triangular matrix with for and , and for and ;
- : the matrix with when and , or when and , and otherwise.
So , where is upper triangular and is the trailing block of .
Invariant (I). After pass (when line L4 has not returned): , each multiplier satisfies , and the diagonal entries of are nonzero.
Initialization. For , is the identity, , , and there are no multipliers or pivots. So (I) holds.
Maintenance. Assume (I) after pass , with , and trailing block (rows and columns to ). Pass does three things.
- The swap (line L5). Let be the permutation matrix that exchanges rows and , where . The new permutation has . Then
because . The matrix is with rows and exchanged and then columns and exchanged. Columns to of are those of the identity, so the column exchange undoes the row exchange on them, and is again unit lower triangular: it is with the multipliers in columns to of rows and exchanged. This is exactly what line L5 does to the stored multipliers, because it exchanges whole rows. The matrix is with rows and exchanged; both rows have zeros in columns to , so has the same shape, with trailing block equal to with two rows exchanged, and this is what line L5 does to the trailing block. So after line L5, holds with the array updated in the same way.
-
The pivot. We show that if line L4 does not return, the pivot after the swap is nonzero, and that for . Line L3 picks with maximal over , so after the swap for each . Line L4 returns when this maximum is ; if it does not return, .
-
The elimination (lines L6 to L9). Write the trailing block after the swap as with . Lines L7 set in column below the pivot, and lines L8 and L9 replace by . Now
as one checks block by block: the block is , and the block is . Embedding this identity in rows and columns to gives for the new array, because the first factor puts into column of the unit lower triangular factor (columns to of were the identity) and the second factor is the new . By step 2, , and the new pivot is nonzero. So (I) holds after pass .
Termination with success. If line L4 never returns, then after pass the trailing block is empty, is upper triangular with nonzero diagonal, , and (I) gives with . Line L10 returns this result.
SINGULAR is reported exactly for singular . By (I) after pass , , and , , where the are nonzero. So if and only if . If is nonsingular, is nonsingular, so its first column is not zero, and line L4 does not return at pass ; by induction on , it never returns. If line L4 returns at pass , the first column of is zero, so and is singular. If is singular, the algorithm cannot reach line L10, because then ; so line L4 returns at some pass.
Floating point
Assume the standard model , , and . Swaps and comparisons are exact. So the computed result is the result of elimination without pivoting applied to the matrix , where is the permutation that the computation chose. Entry of is processed by the recurrence for , and then by for or for . This is the evaluation of , followed by a division in the second case, with . By the standard bound for such an expression (Higham, Lemma 8.4), for
and for the same bound holds with and the sum to . Since for , this is with (Higham, Theorem 9.3). The pivot rule makes exactly, because with is at most in modulus under rounding to nearest. The -norm bound on the page follows from and .