LU Decomposition
Statement
Let be an invertible matrix over a field . Then there exist matrices and such that
where is unit lower-triangular (ones on the diagonal, zeros above) and is upper-triangular (zeros below the diagonal). The factorization is unique when it exists without pivoting.
When row swaps are required, the decomposition takes the form for a permutation matrix .
Visualization
Factor :
Step 1 — eliminate below :
Multiplier . Subtract times row 1 from row 2:
Result:
Verification:
Also: .
Proof Sketch
- Gaussian elimination. Apply row operations to reduce to upper-triangular form. At step , subtract multiples of row from all rows below it. This works without swaps when all pivot entries are nonzero.
- Encoding the multipliers. Each row operation "subtract times row from row " corresponds to multiplying on the left by a unit lower-triangular matrix . The product is again unit lower-triangular.
- Determinant. Since (product of ones on diagonal), . This follows from .
- Uniqueness (no pivoting case). If with unit lower and upper triangular, then is both lower and upper triangular with ones on the diagonal, so it equals .
Connections
LU decomposition depends on Determinant MultiplicativityDeterminant MultiplicativityThe determinant of a product equals the product of determinantsRead more → () and is a concrete construction underlying the Rank–Nullity TheoremRank–Nullity TheoremThe dimensions of image and kernel of a linear map sum to the domain dimensionRead more → (Gaussian elimination reveals the rank). It generalizes Cramer's RuleCramer's RuleExplicit determinant formula for the solution of a linear systemRead more → as a more efficient solver.
Lean4 Proof
-- We prove the triangular determinant product rule, which is the key algebraic
-- fact behind LU: det of upper-triangular = product of diagonal entries.
-- Mathlib: Matrix.det_of_upperTriangular in LinearAlgebra.Matrix.Block
-- For a concrete 2x2 LU verification we use decide on rational matrices.
open Matrix in
theorem det_upper_triangular_is_diag_prod
{n : Type*} [LinearOrder n] [Fintype n] (M : Matrix n n ℚ)
(h : M.BlockTriangular id) : M.det = ∏ i : n, M i i :=
det_of_upperTriangular h
-- Concrete LU check for the 2x2 example: A = L * U
theorem lu_example_2x2 :
let A : Matrix (Fin 2) (Fin 2) ℚ := !![4, 3; 6, 3]
let L : Matrix (Fin 2) (Fin 2) ℚ := !![1, 0; 3/2, 1]
let U : Matrix (Fin 2) (Fin 2) ℚ := !![4, 3; 0, -3/2]
A = L * U := by decideReferenced by
- QR DecompositionLinear Algebra