In the first article, we saw why different factorizations of the same matrix can reveal different features. We now take a closer look at a foundational example: Gaussian elimination, and the factorizations LU and Cholesky that arise from it.
Our aim is not merely to write down three algorithms. We will see what the matrix factors record, when those factors exist, and how they help us solve linear systems and understand a positive-definite matrix.
1. Gaussian elimination as multiplication by matrices
The familiar row operation
\[R_i\longleftarrow R_i-mR_j\]can be encoded by an elementary matrix. If $i\neq j$ and $E_{ij}$ denotes the matrix with a $1$ in position $(i,j)$ and zeros elsewhere, then
\[F=I-mE_{ij}\]performs this operation by left multiplication: $FA$ is the transformed matrix. Because $E_{ij}^2=0$, we have $F^{-1}=I+mE_{ij}$.
Successively eliminating entries below the diagonal amounts to finding elementary matrices $F_1,\ldots,F_r$ such that
\[F_r\cdots F_2F_1A=U,\]where $U$ is upper triangular. Consequently,
\[A=F_1^{-1}F_2^{-1}\cdots F_r^{-1}U.\]When elimination requires no row exchanges, the product of the inverse elimination matrices is a lower triangular matrix $L$ with diagonal entries equal to $1$. Thus $A=LU$.
The numbers used in the elimination—the multipliers—are precisely what gets recorded in the lower triangular factor.
2. A complete $3\times3$ example
Consider the real matrix
\[A=\begin{pmatrix} 4&2&2\\ 2&5&1\\ 2&1&3 \end{pmatrix}.\]The first pivot is $4$. To eliminate the two entries below it, use the multipliers $m_{21}=m_{31}=\tfrac12$. The row operations are
\[R_2\longleftarrow R_2-\tfrac12R_1,\qquad R_3\longleftarrow R_3-\tfrac12R_1.\]They give
\[\begin{pmatrix} 4&2&2\\ 0&4&0\\ 0&0&2 \end{pmatrix}=U.\]There is nothing left to eliminate in the second column. The multipliers give
\[L=\begin{pmatrix} 1&0&0\\ \tfrac12&1&0\\ \tfrac12&0&1 \end{pmatrix}, \qquad U=\begin{pmatrix} 4&2&2\\ 0&4&0\\ 0&0&2 \end{pmatrix}.\]A direct multiplication confirms $A=LU$. The factorization has replaced the original matrix by two triangular matrices.
As a quick consequence,
\[\det A=\det L\,\det U=4\cdot4\cdot2=32.\]The determinant is easy to read from the pivots because $\det L=1$.
3. Solving a system using the factors
Suppose we want to solve $Ax=b$, with
\[b=\begin{pmatrix}6\\11\\1\end{pmatrix}.\]From $A=LU$, introduce $y=Ux$ and solve the two triangular systems in order.
First, forward substitution in $Ly=b$ gives
\[y_1=6,\qquad \tfrac12y_1+y_2=11,\qquad \tfrac12y_1+y_3=1.\]Hence $y=(6,8,-2)^T$. Next, back substitution in $Ux=y$ yields
\[2x_3=-2,\qquad 4x_2=8,\qquad 4x_1+2x_2+2x_3=6.\]Therefore,
\[x=\begin{pmatrix}1\\2\\-1\end{pmatrix}.\]It is instructive to verify $Ax=b$ directly.
For a dense $n\times n$ matrix, computing an LU factorization typically requires on the order of $n^3$ arithmetic operations, while either triangular solve takes on the order of $n^2$. This is particularly helpful when many systems share the same matrix $A$ but have different right-hand sides.
4. Why pivoting is sometimes necessary
Can every square matrix be written as $LU$ with $L$ unit lower triangular, without exchanging rows? No.
Consider
\[B=\begin{pmatrix}0&2\\1&3\end{pmatrix}.\]Its first pivot is zero. In fact, if
\[B=\begin{pmatrix}1&0\\ \ell&1\end{pmatrix} \begin{pmatrix}u_{11}&u_{12}\\0&u_{22}\end{pmatrix},\]then the $(1,1)$ entry forces $u_{11}=0$, while the $(2,1)$ entry would be $\ell u_{11}=0$, contradicting $B_{21}=1$.
Swapping the two rows fixes the problem. With
\[P=\begin{pmatrix}0&1\\1&0\end{pmatrix}, \qquad PB=\begin{pmatrix}1&3\\0&2\end{pmatrix},\]we can take $L=I_2$ and $U=PB$. Thus $PB=LU$.
For every nonsingular square matrix over a field, a permutation matrix $P$ can be chosen so that a factorization $PA=LU$ exists. In floating-point arithmetic, partial pivoting typically chooses a row whose entry in the current column has maximal absolute value among the available rows. This helps avoid division by a zero or very small pivot, although it is not an unconditional guarantee of numerical stability in every problem.
A useful existence criterion
For a nonsingular matrix $A\in\mathbb R^{n\times n}$, elimination without row exchanges gives a unique factorization $A=LU$ with $L$ unit lower triangular if and only if all leading principal minors of orders $1,\ldots,n-1$ are nonzero.
Write
\[\Delta_k=\det A[1\!:\!k,\,1\!:\!k], \qquad \Delta_0=1.\]When the factorization exists, its pivots satisfy $u_{kk}=\Delta_k/\Delta_{k-1}$. In particular, $\Delta_k\neq0$ prevents a zero pivot at the $k$th stage. Conversely, if a nonsingular $A$ has an LU factorization without row exchanges, these pivots are nonzero and so are the corresponding leading minors.
This criterion is about an unpivoted factorization of an invertible matrix; singular cases need additional care.
5. Cholesky factorization for symmetric positive-definite matrices
Now return to the $3\times3$ matrix $A$ from Section 2. It is symmetric. Moreover, its leading principal minors are
\[\Delta_1=4,\qquad \Delta_2= \det\begin{pmatrix}4&2\\2&5\end{pmatrix}=16,\qquad \Delta_3=\det A=32.\]All three numbers are positive. By Sylvester’s criterion, a real symmetric matrix is positive definite precisely when all its leading principal minors are positive. Thus $A$ is symmetric positive definite.
An important theorem says that every real symmetric positive-definite matrix has a unique factorization
\[A=CC^T,\]where $C$ is lower triangular and its diagonal entries are strictly positive. This is the Cholesky factorization.
In our example,
\[C=\begin{pmatrix} 2&0&0\\ 1&2&0\\ 1&0&\sqrt2 \end{pmatrix}.\]Indeed, multiplying $C$ by $C^T$ recovers $A$. Notice how the same matrix has the two descriptions $A=LU$ and $A=CC^T$, but the latter additionally exploits symmetry and positivity.
Since $\det C=2\cdot2\cdot\sqrt2$, we again obtain $\det A=(\det C)^2=32$.
6. Where the Cholesky formulas come from
The entries of the Cholesky factor can be constructed column by column. Write $C=(c_{ij})$, with $c_{ij}=0$ for $i<j$.
Comparing entries in $A=CC^T$, for $j=1,\ldots,n$ we obtain
\[c_{jj}= \sqrt{a_{jj}-\sum_{k=1}^{j-1}c_{jk}^{\,2}},\]and for $i>j$,
\[c_{ij}= \frac{a_{ij}-\sum_{k=1}^{j-1}c_{ik}c_{jk}}{c_{jj}}.\]For our matrix, the first column gives $c_{11}=2$ and $c_{21}=c_{31}=1$. The second diagonal entry is $c_{22}=\sqrt{5-1}=2$, while $c_{32}=(1-1)/2=0$. Finally,
\[c_{33}=\sqrt{3-1^2-0^2}=\sqrt2.\]Why are these square roots strictly positive? A short explanation uses Schur complements. Partition a symmetric positive-definite matrix as
\[A=\begin{pmatrix}a&r^T\\r&B\end{pmatrix}, \qquad a>0.\]Then
\[A= \begin{pmatrix}1&0\\r/a&I\end{pmatrix} \begin{pmatrix}a&0\\0&B-rr^T/a\end{pmatrix} \begin{pmatrix}1&r^T/a\\0&I\end{pmatrix}.\]The Schur complement $B-rr^T/a$ is again positive definite: for every nonzero $z$, taking $x=(-r^Tz/a,z)^T$ yields
\[z^T(B-rr^T/a)z=x^TAx>0.\]We may therefore repeat the construction on a smaller positive-definite matrix. This proves existence by induction. The recursive formulas above also force the positive diagonal entries and every subsequent entry, giving uniqueness.
7. LU or Cholesky: what should we remember?
| Question | LU with pivoting | Cholesky |
|---|---|---|
| Main assumption | Square nonsingular matrix for the usual solve | Real symmetric positive-definite matrix |
| Form | $PA=LU$ | $A=CC^T$, with $c_{ii}>0$ |
| Row exchanges | May be needed | Not needed under the stated assumptions |
| Main benefit | General-purpose triangular solves | Uses symmetry and positivity |
| Determinant | $\det A=\det(P)\prod_i u_{ii}$ | $\det A=(\prod_i c_{ii})^2$ |
For Cholesky, the assumptions are essential. A matrix that is merely symmetric need not admit a real lower triangular Cholesky factor with strictly positive diagonal: for example, $\operatorname{diag}(1,-1)$ is not positive definite.
Another distinction is conceptual. LU and Cholesky mainly serve computation and linear-algebraic structure. Later in this series, we will ask for factorizations in which all factors belong to a prescribed matrix group; there the constraints and the notion of minimal length are different.
8. Exercises
Exercise 1. Consider
\[M=\begin{pmatrix}0&2\\1&3\end{pmatrix}.\]Show that $M=LU$ is impossible with $L$ unit lower triangular and $U$ upper triangular. Find a permutation matrix $P$ for which $PM=LU$, and recover $\det M$ from this factorization.
Exercise 2. For
\[H=\begin{pmatrix}9&3\\3&5\end{pmatrix},\]verify that $H$ is positive definite and find the Cholesky factor $C$ with positive diagonal such that $H=CC^T$. Check your answer by multiplication.
Exercise 3. Suppose $A$ is real symmetric positive definite and $A=CC^T$ is its Cholesky factorization. Explain why $\det A>0$ and why each leading principal minor is positive.
Further reading and next article
For deeper treatments of Gaussian elimination, pivoting and Cholesky algorithms, see L. N. Trefethen and D. Bau III, Numerical Linear Algebra (SIAM, 1997), and G. H. Golub and C. F. Van Loan, Matrix Computations, 4th ed. (Johns Hopkins University Press, 2013).
In the Series contents, our next topic is QR Factorization and Orthogonal Matrices. We will replace triangular elimination as the central tool with orthogonal transformations and explore why they are useful in least-squares problems.