The LUP decomposition of an n×n matrix A is the triple (L,U,P) satisfying
PA=LU
Here:
L: unit lower triangular, n×n with all diagonal entries 1
U: upper triangular, n×n
P: permutation matrix, n×n
Properties
P permutes the rows of A, placing large entries in the pivot position to avoid dividing by a small or zero element. Same reordering as partial pivoting.
LUP decomposition exists for any nonsingular matrix A.
LUP decomposition of A is not unique.
LUP decomposition solves Ax=b more robustly than LU decomposition without pivoting, at approximately the same cost.
Solving Ax=b
Multiplying Ax=b by P and substituting PA=LU gives
An n×n matrix can be partitioned into a 2×2 grid of smaller matrices, called blocks. Each block is itself a matrix, vector, or scalar, sized so the blocks line up into an n×n whole.
(aˉ11aˉ21aˉ12TAˉ22)
Here:
aˉ11: 1×1, a scalar
aˉ12T: 1×(n−1), a row vector
aˉ21: (n−1)×1, a column vector
Aˉ22: (n−1)×(n−1), a matrix
Block matrices multiply like ordinary matrices, treating each block as if it were a single entry, provided block dimensions are compatible for each product and sum.
The Schur complement of aˉ11 in the block matrix above is
Aˉ22−aˉ11aˉ21aˉ12T
The block Aˉ22 with the effect of aˉ11‘s row and column subtracted out.
Base Case
n=1: A=(a), so L=(1), U=(a), P=(1).
Recursive Step
Choose row i so that ∣ai1∣≥∣aj1∣ for all j=1,2,…,n.
Let P1 be the permutation matrix that moves row i to row 1, leaving the other rows in order.
Let Aˉ=P1A, partitioned in block form
Aˉ=(aˉ11aˉ21aˉ12TAˉ22)
Eliminate the first column below aˉ11
Aˉ=(1aˉ21/aˉ110TIn−1)(aˉ110aˉ12TA′)
A′ is the Schur complement of aˉ11 in Aˉ, as defined above.
Recurse on A′ to find P2,L2,U2 with P2A′=L2U2.
aˉ11
Scalar. The pivot, already the largest entry of column 1 after the swap.
aˉ12T 1×(n−1) row vector. The rest of pivot row 1, to the right of aˉ11.
aˉ21 (n−1)×1 column vector. The rest of column 1, below aˉ11. This is what elimination must zero out.
Aˉ22 (n−1)×(n−1) block. Everything else, untouched by the swap.
aˉ21/aˉ11
Column of multipliers, 1 per row below the pivot. Same role as mji in ordinary LU: the amount of the pivot row subtracted from each row below to clear column 1.
A′ (n−1)×(n−1) block left over after elimination. Algebraically identical to what remains of Aˉ22 once each row has had a multiple of aˉ12T subtracted from it.
The recursion is elimination applied to 1 column at a time, exactly as in Gaussian elimination, but written so each step reduces the problem to a strictly smaller matrix A′ instead of looping over rows.
A′ depends on aˉ21, aˉ12T, aˉ11, all fixed only after P1 is chosen and the first elimination is done.
The pivot row for A′ is therefore chosen from A′‘s own first column, not from A‘s. This is why P cannot be computed in 1 pass: P2 requires A′, and A′ requires P1.
The recursion bottoms out at n=1, where there is nothing left to pivot or eliminate.
Building L, U, P From the Base Case
The recursion computes A′ going down, then builds L, U, P going back up, 1 level at a time, using the combine formulas.
At each level, the level below has already returned a smaller L2, U2, P2 solving P2A′=L2U2. That triple is embedded whole into the bottom-right (n−1)×(n−1) block of the current level’s L, U, P. The current level contributes only its own pivot row and pivot column, in the first row and column.
U
Top row is aˉ11 and aˉ12T, unchanged from this level. Bottom-right block is U2, unchanged from below. No mixing between levels, since elimination already zeroed out the rest of column 1.
L
Top row is 1 then zeros, since row 1 of Aˉ was never used to eliminate anything. First column below the diagonal is the multiplier column aˉ21/aˉ11, but permuted by P2 first, so its entries land in the same row order as L2. Bottom-right block is L2, unchanged from below.
P P2 is embedded into the bottom-right block of an n×n identity, giving a matrix that reorders rows 2,…,n and leaves row 1 fixed. This is multiplied by P1, so P1‘s swap is applied first, then P2‘s reordering.
Unwinding starts at the base case, L=(1), U=(a), P=(1), and combines 1 level at a time until level 1 returns the full n×nL, U, P.
Worked Example
A=026598508
Level 1, n=3:
Column 1 is (026)T. Largest magnitude is 6, row 3. i=3.