Gaussian elimination solves one system . In
practice the matrix often stays fixed while the
right-hand side changes: the same network under
different loads, the same model fed different data. The
row operations depend only on , so repeating them for
every
wastes almost all of the work. This section stores the
elimination as a factorization , a lower
triangular matrix that remembers the operations times an
upper triangular matrix that is their result. We prove
when it exists and when it is unique, and we repair its
failures with row swaps.
Throughout, is
a field and all matrices are square, in .
Triangular
systems are cheap
Some systems need no elimination at all. Take The last equation mentions only : , so . The second
mentions and
the known :
, so
. The first
then gives , so . This is back substitution:
in an upper triangular system with nonzero diagonal
entries, each equation introduces exactly one new
unknown, read from the bottom up. A lower triangular
system is solved the same way from the top down, by
forward substitution.
Now suppose a matrix factors as with lower triangular and
upper
triangular. Then reads . Naming the inner vector
splits the problem in two: Both are triangular, so both are cheap. The
expensive part, finding and , is done once for all
right-hand sides.
An LU factorization is Gaussian elimination
written down once, so that it never has to be done
again.
LU
factorizations
Definition
3.6.1 (LU factorization)
A matrix is unit lower
triangular if it is lower triangular and
every diagonal entry equals . Let . An
LU factorization of is a pair of matrices in
such that
In words: has
’s on the diagonal
and zeros above it, and the entries below the diagonal
are unrestricted. has zeros strictly
below the diagonal, and its diagonal entries are
unrestricted; some of them may be . The definition says
an factorization: whether there is only
one is a theorem, and it needs a hypothesis.
Example
(An LU factorization from elimination)
Let Reduce
to upper triangular form using only operations “subtract
a multiple of a higher row from a lower row”, and record
each multiplier. Compare the result with the matrix
of the previous
subsection.
Solution. The first pivot is . To clear column 1
below it we subtract times
row 1 from row 2, and
times row 1 from row 3: The second pivot is . We subtract times
row 2 from row 3: Put the multipliers below the diagonal of a
unit lower triangular matrix, each in the position of
the entry it cleared: Multiplying out, row by row, So is an LU factorization of , and is exactly the
triangular matrix of the back substitution above.
The example suggests the general statement:
elimination produces , and the multipliers,
with their signs as subtracted, fill in
. We prove this
below. First, the smallest cases.
- Upper triangular . , and
is unit lower
triangular. So every upper triangular matrix, including
and , has the LU
factorization .
- . Every is upper
triangular, so . Nothing can go wrong here, and that is
exactly why the failure below is instructive.
Nonexample by minimal change. The
matrix has the LU
factorization Change the top-left entry from to , and everything
collapses.
Example
(An invertible matrix with no LU factorization)
Show that has no LU
factorization, over any field , although is invertible.
Solution. is invertible, since
.
Suppose, for a contradiction, that with Then Comparing -entries with gives . Comparing -entries gives
. But
by Theorem 0.7.1, and
in a
field. This contradiction shows that no LU factorization
exists.
What failed is visible: the -entry of any
product is
alone, so a
zero there forces the whole first column of to vanish. In
elimination terms, the first pivot is while the entry below
it is not, and the only cure is to swap
rows, which “subtract a multiple of a higher row from a
lower row” cannot do. We return to this with permutation
matrices.
Why “unit”. Without the ’s on the diagonal of
, uniqueness
would fail even for invertible matrices. If and is any invertible
diagonal matrix, then also ,
where is still
lower triangular and still upper
triangular. When
is invertible and , this is a different pair, and over any
field with more than two elements such a exists. For instance
over . Fixing
the diagonal of
removes this freedom and matches what elimination does:
it never rescales a row.
Warning. Invertible does
not mean “has an LU factorization”. The matrix
of Example (An invertible matrix with no LU factorization)
is invertible and has none. Conversely, a singular
matrix can have one: . Existence of an LU factorization is a
property of the order of the rows, not
of invertibility.
Unit lower
triangular matrices
Elimination builds out of elementary
matrices, and the uniqueness proof below divides one
factorization by another. Both need the same facts:
products and inverses of unit lower triangular matrices
stay unit lower triangular. We also need to know exactly
when a triangular matrix is invertible.
The key observation is a statement about where the
nonzero entries of a product can sit.
Lemma
3.6.1 (Unit lower triangular matrices are
closed)
Let be unit lower triangular. Then:
- (a) is unit lower
triangular;
- (b) is invertible, and
is unit
lower triangular.
Idea. Write , where has nonzero entries
only strictly below the diagonal. Multiplying two such
matrices pushes the nonzero entries
further below the diagonal, so . Then the
geometric series stops after terms and gives the
inverse exactly.
Proof. Say that is
-low if whenever . So -low means lower
triangular, and -low means zero on and
above the diagonal.
Claim. If is -low and is -low, then is -low. A matrix
that is -low is
the zero matrix.
Proof. By Definition 0.9.9,
. A term can be nonzero only if
and
, which
together give . So if , every term is and . For the
second statement, every pair of indices satisfies , so every entry of an -low matrix is .
Write and . Since and are unit lower
triangular, and
are -low.
For (a), by Theorem 0.9.4. Here
is
-low, since a sum
of entries that are both is , and is -low, hence -low, by the Claim. So
is
-low, which says
that is
unit lower triangular.
For (b), let .
Multiplying out, the sum telescopes: where because is -low by the Claim
applied
times. The same computation gives , since
commutes with
its own powers. Hence is invertible with
.
Finally is a sum of -low matrices, by the
Claim, so is
unit lower triangular. This proves the lemma.
Transposing everything, the same statements hold for
unit upper triangular matrices (upper
triangular with ’s
on the diagonal).
The next lemma decides invertibility of a triangular
matrix from its diagonal, without any computation beyond
back substitution.
Lemma
3.6.2 (Invertibility of a triangular
matrix)
An upper triangular matrix is
invertible if and only if every
diagonal entry is nonzero.
Proof. Suppose
every , and let . We
show for
in turn. Suppose
(nothing is assumed when ). Row
of reads , because for . The sum
vanishes, so , and since . Hence is the only solution of ,
and is
invertible by Theorem 3.4.4.
We
prove the contrapositive. Suppose for some . For each , the entries of
column in rows
are zero:
if this is
upper triangularity, and the only remaining case is . So the first
columns of lie in . The list is independent and spans , so (for , has
dimension ). By Theorem 1.6.3 (a),
these columns are
linearly dependent, so the columns of are dependent, and
is not
invertible by Theorem 3.4.4. This
proves the lemma.
Elimination
without row swaps
To prove that elimination always produces an LU
factorization, we first need to say exactly which
elimination we mean. It is Gaussian elimination
restricted to one kind of operation: subtracting a
multiple of a row from a row below
it.
Algorithm. Elimination
without row swaps. Input: . Put . For ,
write and do the following.
- If , set for .
- If
and for
every , set for .
- If
but
for some , stop: a row swap is
needed.
If we did not stop, obtain from by replacing
row with (row
) (row
), for each .
If the loop finishes without stopping, we say
elimination without row swaps succeeds
on . The numbers
() are its
multipliers, and is its
result.
In both nonstopping cases the new -entry is : in the first case by the choice of , in the second
because both terms are already . The multipliers are
well defined: row
is not changed during step , so it does not matter
in which order the rows are updated.
The proof will write each step as a matrix. By Definition 3.4.1,
the elementary matrix of the operation () is , where
is the
matrix unit with
in entry . We
will write the matrix unit as a product of a column and
a row, which holds because
has -entry
, equal to if and , and otherwise. We will use
one more rule constantly: for a vector , the
matrix
is the -th entry , which we treat as a
scalar. In particular for .
For and a vector whose
first entries are
zero, put Its only nonidentity entries are in position , for : it is the
identity with the column vector written into
column below the
diagonal. So is unit
lower triangular.
Lemma
3.6.3 (Multiplier matrices)
Let , and let be vectors such that the
first entries of
are zero
and, for each ,
the first entries
of are
zero ().
Then:
- (a) is the
product, in any order, of the elementary matrices for
;
- (b) ;
- (c) .
Proof. For (a), let . By Theorem 0.9.4, and the last term is zero because for . Repeating this, one factor at a time, the
product of the
in any order is , since .
For (b), , because . Swapping the signs gives the other
order.
For (c), we use induction on ; the case is the definition.
Suppose the formula holds for . Then For , is entry of , which is zero
because the first
entries of are zero. So
the last sum vanishes, and the formula holds for . This proves the
lemma.
Part (c) is the heart of the matter: when the factors
come in the order , they do not
interfere, and each vector lands
untouched in column .
Theorem
3.6.4 (LU from elimination)
Let , and suppose elimination without row
swaps succeeds on , with multipliers
and
result . Let
be the unit
lower triangular matrix whose -entry is for every . Then is upper triangular
and In particular has an LU
factorization.
Idea. Each step of elimination is
left multiplication by a product of elementary matrices,
which collapses to one matrix .
So . To get back, undo the steps
in reverse order. Their inverses
then appear in the order , which
is exactly the order in which, by Lemma 3.6.3 (c),
the multipliers drop into place.
Proof. Let be the matrices produced by the algorithm.
For each , let
, a
vector whose first entries are zero.
Step 1: is upper
triangular. We show by induction on that in every entry
below the diagonal in columns is zero. For
there is
nothing to prove. Suppose it holds for . Step changes only rows , replacing row
by row minus a multiple of row
. In columns , the entry of
row lies below
the diagonal (), so it is by the induction
hypothesis, and the entries of row in these columns stay
. In column , the new entries below
the diagonal are ,
as noted after the algorithm. This completes the
induction, and for it says that is upper
triangular.
Step 2: each step is a matrix. Step
performs the
operations “add times row
to row ” for . By Theorem 3.4.1,
applying them one after another multiplies on the left by
the corresponding elementary matrices . By
Lemma 3.6.3 (a),
their product is .
Hence , and
therefore
Step 3: undo the steps. Multiply
both sides on the left by ,
then by ,
and so on down to .
By Lemma 3.6.3 (b),
each one cancels the factor next to it, and we get By Lemma 3.6.3 (c),
the product on the left of is . Its -entry for is ; its diagonal
entries are ; its
entries above the diagonal are . That is, it is . Hence with unit lower triangular
and upper
triangular, as claimed.
So the multipliers are not something to be remembered
separately: they are the lower
triangular factor. When a computer performs elimination
it stores each in the slot
that it has
just cleared, and at the end the one array holds below the diagonal and
on and above
it.
Warning. The matrix that
performs elimination, , is not with its multipliers
negated. In Example (An LU factorization from elimination)
the operations multiply on the left by and the entry mixes two multipliers. This matrix
is , by Step
3 of the proof. It is , whose factors come in
the order , that has the multipliers cleanly in
place.
Quick check. Find the LU
factorization of over by elimination, and
check it by multiplying.
Solution. The pivot is and the multiplier is
. Subtracting times row 1 from row 2
gives , and . Check: .
Solving
with an LU factorization
Once
is known, each system
costs two substitutions.
Solution. First right-hand
side. Forward substitution in :
Back substitution in :
So . Check: .
Second right-hand side. : , , . Then :
, so
; , so ; , so
. So , and indeed .
Since the diagonal of is , all nonzero,
is invertible by
Lemma 3.6.2, is invertible by Lemma 3.6.1, and so
is
invertible. Each solution found is therefore the only
one.
How much is saved? Count the arithmetic operations
() for an matrix. At step of elimination there
are rows
below the pivot. Each needs one division for its
multiplier, then multiplications and subtractions in the
columns to the right of column . With , the total is
Forward substitution with a unit lower
triangular uses
operations,
and back substitution , so a pair of
triangular solves costs . For that is about
operations for the factorization, done once, against
about
for each new right-hand side.
Uniqueness
The factorization of Example (An LU factorization from elimination)
came from one particular procedure. Could another
procedure give a different pair ? For invertible
matrices, no.
Theorem
3.6.5 (Uniqueness of the LU
factorization)
Let be invertible. If and are LU
factorizations, then and .
Idea. Take the difference in
multiplicative form: from we
get . The matrix is unit lower triangular, and
multiplying by
it must leave an upper triangular matrix. Clearing below
the diagonal column by column, the nonzero pivots of
force to have nothing below
its diagonal. Invertibility of is what provides those
nonzero pivots.
Proof. By Lemma 3.6.1 (b),
and are invertible.
Hence is a product of invertible
matrices, so it is invertible by Theorem 0.9.7, and by
Lemma 3.6.2 its
diagonal entries are all nonzero.
Let . By Lemma 3.6.1, is unit
lower triangular. Multiplying on
the left by gives , so is upper
triangular. We show for all , by induction on the column .
Fix , and
suppose
whenever
and . Let
. Since
is upper
triangular and , where the third equality uses for , and the last
uses for
(here
).
Since , we get . This completes the induction, so is lower triangular
with ’s on the
diagonal and nothing below it: .
Hence , and multiplying by gives . Then . This proves the theorem.
Two consequences are worth saying. The LU
factorization of an invertible matrix does not depend on
how it was found, so it is legitimate to speak of
the factors and . And if elimination
without row swaps succeeds on an invertible , then every pivot is
nonzero: row is
not changed after step , so the pivot of step
is , which is nonzero
by the first paragraph of the proof. So the second case
of the algorithm (a zero pivot over a zero column) never
occurs.
Row swaps
and the PLU factorization
Example (An invertible matrix with no LU factorization)
showed that some matrices, even invertible ones, have no
LU factorization, because elimination meets a zero pivot
with a nonzero entry below it. The cure in Gaussian
elimination is to swap rows. We now show that the swaps
can all be collected in front, as a single matrix that
rearranges the rows of
before elimination starts. After that
rearrangement, no swaps are needed.
Matrices that rearrange rows were named in Definition 3.4.2:
has -th column , a
product of permutation matrices is one, , and a transposition gives the
row-swap elementary matrix (Lemma 3.4.7). One
more fact about them is needed here and nowhere else,
because it is about the Gauss transforms of this
section: a swap that leaves the first coordinates alone can
be pushed through .
Proof. Write . Its effect
on a vector is to exchange entries and , which are both beyond
position , so
still
has its first
entries zero. Since , we have . By Lemma 3.4.7 (b) and
(c), , so by Theorem 0.9.5.
Therefore using from Lemma 3.4.7 (c).
This proves the lemma.
Definition
3.6.2 (PLU factorization)
Let . A PLU factorization of
is a triple
of
matrices in
such that
In words: after rearranging the rows of by , the matrix has an LU
factorization. By Lemma 3.4.7 (b)
this can also be written , which is why some books write the
factorization as with their our . For example, has the PLU
factorization , since . An LU factorization is the
special case .
To produce ,
run elimination and allow a swap whenever a zero pivot
has a nonzero entry below it.
Algorithm. Elimination with
row swaps. Input: . Put . For ,
with :
- If
for every , set and all , and let
.
- Otherwise choose some with . Let
be the matrix
swapping rows and
(so if ), and let . Set
for , and obtain from by replacing row with (row ) (row
) for each .
This version never stops. Here is the result it
delivers.
Theorem
3.6.7 (Existence of a PLU factorization)
Every has a PLU factorization.
Idea. Step
roadmap. ① As before, each step is a matrix:
, and
the final matrix
is upper triangular. ② The swaps are tangled with the
multiplier matrices. A swap of two rows below row can be pushed to the
right past at
the price of swapping the entries of the multiplier
vector: this is Lemma 3.4.7 (d). ③
Once all swaps sit next to , the rest is the LU
proof word for word. In practice, ② says: when you swap
two rows, also swap the multipliers already stored in
those rows.
Proof. Run elimination with row
swaps on ,
producing , swap matrices ,
and multipliers . Let , whose first entries are zero.
Step 1. Exactly as in Step 1 of the
proof of Theorem 3.6.4,
every entry of below the
diagonal in columns is zero. The only new point is the
swap in step : it
exchanges rows
and ,
whose entries in columns are below the diagonal and hence zero,
so the swap does not disturb these columns. After the
swap the pivot is nonzero, and
the new entries below it are . Hence is upper triangular.
By Lemma 3.4.7 (c), Theorem 3.4.1 and
Lemma 3.6.3 (a), as
in Step 2 of that proof, This also holds in the first case of the
algorithm, where and .
Step 2. For put
, with . We claim that the first
entries of
are zero and that For
both sides are . Suppose the claim holds for , and multiply it on the
left by . The matrix is or swaps rows and , both
beyond every . So by Lemma 3.4.7 (c) and
Lemma 3.6.6, for
each and
each vector with its first
entries zero,
and again
has its first
entries zero. Applying this for
moves to
the right past every factor , replacing
by (note ). This is the claim for .
Step 3. By Step 1, . Write and . By Step 2, is a
permutation matrix by Lemma 3.4.7 (a) and
(c). Multiplying on the left by ,
then ,
and so on, and using Lemma 3.6.3 (b) and
(c) as in Step 3 of the proof of Theorem 3.6.4,
where
is unit lower triangular because the first entries of each
are zero. So is a PLU factorization of . This proves the
theorem.
Example
(A swap in the middle)
Find a PLU factorization of
Solution. Step 1. The
pivot is nonzero,
so no swap. The multipliers are and : Step 2. The pivot position holds , but the entry below it
is . Elimination
without row swaps would stop here. We swap rows 2 and 3,
so :
The entry below the new pivot is already , so , and is upper
triangular.
By Step 2 of the proof, the stored multipliers of
step 1 are swapped too: . Hence Check: is with rows 2 and 3
swapped, and Notice where the multipliers ended up: in row 2 and in row 3, traveling
with the rows they belong to. To solve ,
multiply by and
solve by two substitutions; since is invertible, this
changes no solutions. For ,
. Forward substitution in
gives ,
, . Back substitution in
gives ,
,
. Check: .
Symmetric
matrices: the LDLᵀ factorization
When is
symmetric, the two factors of are secretly
related: up to a diagonal matrix, is the transpose of
. In Example (An LU factorization from elimination)
the factors look unrelated, but that matrix is not
symmetric. Try a symmetric one: with multipliers , , . Divide
each row of by
its diagonal entry: the rows become , , . These are the
columns of , read as
rows. So with , and .
Theorem
3.6.8 (LDLᵀ factorization)
Let be symmetric and
invertible, and suppose is an LU
factorization. Then the diagonal entries of
are nonzero, and
with ,
Idea. Pull the diagonal out of
, writing with unit upper triangular,
so .
Transposing, , which is a second LU
factorization of the same invertible matrix. Uniqueness
forces the two to agree, so .
Proof. As in the proof of Theorem 3.6.5,
is
invertible, so its diagonal entries are nonzero by Lemma 3.6.2. Hence
is invertible,
with . Let
. Row
of is times row
of , so is upper triangular
with , and .
Since is
symmetric and , Theorem 0.9.5 gives
Here is unit lower
triangular, because is unit upper
triangular. And is upper
triangular: its -entry is , and when , since is lower triangular.
So
is an LU factorization of the invertible matrix . By Theorem 3.6.5,
and
.
Therefore , as claimed.
The factorization stores about half as much: and the diagonal determine everything.
Over , when
every entry of
is positive, one can split and
write ; this is the
Cholesky factorization, which Chapter
13 connects with positive definite matrices.
Exercises
A. Check your
understanding
Exercise
(A1)
- (a) Define an LU
factorization of a matrix , and a PLU factorization.
- (b) True or false:
every invertible matrix has an LU factorization. Justify
your answer.
- (c) Suppose . In which order
are the two triangular systems solved to find a solution
of , and what is each one?
- (d) True or false:
the product of two unit lower triangular matrices is
unit lower triangular. Justify your answer.
- (e) True or false:
the zero matrix in has more than one
LU factorization. Justify your answer.
- (f) What is the
inverse of a permutation matrix ?
Solution.
- (a) See Definition 3.6.1:
with
unit lower
triangular and
upper triangular. See Definition 3.6.2:
with
a permutation
matrix, unit
lower triangular, and upper triangular.
- (b) False. is invertible but has no
LU factorization, by Example (An invertible matrix with no LU factorization).
- (c) First , by
forward substitution; then , by
back substitution. Then .
- (d) True, by Lemma 3.6.1
(a).
- (e) True. For every
, , so is an LU
factorization; and give two different ones. This does not
contradict Theorem 3.6.5,
because is not
invertible.
- (f) , by Lemma 3.4.7
(b).
B. Practice
Exercise
(B1: An LU factorization)
Find the LU factorization of by elimination without row swaps. Hence show
that is
invertible.
Solution. Step 1. The
pivot is , with
multipliers and : Step 2. The pivot is , with multiplier :
By Theorem 3.6.4,
Check: .
The diagonal entries of are nonzero, so is invertible by Lemma 3.6.2, and
is invertible by
Lemma 3.6.1. Hence
is
invertible by Theorem 0.9.7.
Exercise
(B2: Two systems, one factorization)
With
as in Exercise (B1: An LU factorization),
solve for and
for , using only forward and back
substitution.
Solution. For . : ; , so ; , so . Then :
, so ; , so ; , so . Hence .
Check: .
For . :
; ; . Then : , so ; , so ; , so . Hence . Check: .
Since is
invertible (Exercise (B1: An LU factorization)),
each solution is the only one, by Theorem 0.9.7.
Exercise
(B3: A PLU factorization)
Let .
- (a) Explain why
has no LU
factorization.
- (b) Find a PLU
factorization of .
- (c) Hence solve
.
Solution.
- (a) If , then the -entry gives , and
the -entry
gives . But , a
contradiction, exactly as in Example (An invertible matrix with no LU factorization).
- (b) The first pivot
position holds
and the entry below is , so swap rows 1 and 2,
:
The multipliers are , , , and no
swap happens after step 1, so they need no rearranging.
Hence Check: , and .
- (c)
holds if and only if , since is invertible (Lemma 3.4.7 (b)).
Swapping the first two entries of , we
solve . :
, , . : , so ; , so ; , so . Hence . Check: .
C. Going deeper
Exercise
(C1: Leading principal submatrices)
For and , the leading principal
submatrix is the top-left corner of
, with entries
for .
- (a) Let be lower triangular
and upper
triangular in . Show that for
every .
- (b) Deduce that if
has an LU
factorization with invertible, then every
leading principal submatrix is
invertible.
- (c) Prove the
converse: if are all invertible, then has an LU
factorization with invertible.
Hint for (c): induction on . Write with in its top-left
corner, a column , a row , and a corner
entry , and look
for and of the same
shape.
Solution.
(a) Let . By Definition 0.9.9,
. If , then , so because
is lower
triangular. Hence , as
claimed.
(b) Suppose with invertible. By (a),
.
The matrix is
unit lower triangular, so it is invertible by Lemma 3.6.1. By Lemma 3.6.2, are
nonzero; is
upper triangular with diagonal , so
is invertible
by the same lemma. Hence is invertible by Theorem 0.9.7.
(c) We prove by
induction on that
every
whose leading principal submatrices are all invertible
has an LU factorization with invertible. For , with , and
works.
Let and
suppose the statement holds for . Write The leading principal submatrices of are ,
all invertible, so by the induction hypothesis
with unit
lower triangular and upper triangular
and invertible. Put , , and , and let Then
is unit lower triangular and is upper triangular.
Computing
entry by entry, splitting each sum into and : the top-left block
is ; the top-right
column is ; the bottom-left row is
; the corner is
. Hence .
Finally is invertible by hypothesis, and is invertible by Lemma 3.6.1, so
is
invertible by Theorem 0.9.7. This
completes the induction.
In the language of elimination: is the -th pivot, and (c) shows
that invertible leading corners are exactly what keeps
every pivot nonzero.
Exercise
(C2: An LDLᵀ factorization)
Let .
- (a) Find the LU
factorization of , show that is invertible, and
write .
- (b) Deduce that
for every nonzero .
Solution.
- (a) Step 1: pivot
, multipliers
,
. Row
2 becomes , row 3 becomes . Step 2: pivot , multiplier ; row 3
becomes . Hence and by Theorem 3.6.4. The
diagonal of
is nonzero, so
is invertible
(Lemma 3.6.2), is invertible (Lemma 3.6.1), and
is
invertible. is
symmetric, so by Theorem 3.6.8, with
, which confirms the theorem directly.
- (b) Let
and put . By Lemma 3.6.1, is invertible, so
is invertible
by Theorem 0.9.7 (4), so
(otherwise ). By Theorem 0.9.5, , so reading the matrix as a real number. Each term is
, and at least
one ,
which makes its term strictly positive. Hence .
Exercise
(C3: Counting matrices without an LU
factorization)
- (a) Let . Prove that
has an LU
factorization if and only if or .
- (b) Let be a prime. How many
matrices in have
no LU factorization? List them for
.
Solution.
(a) Suppose
with
and . As in Example (An invertible matrix with no LU factorization),
, so and . If , then . Hence or .
If
,
elimination without row swaps succeeds with multiplier
, and
indeed If ,
then is upper
triangular and .
(b) By (a), has no LU
factorization exactly when and . There are choices of , and choices each of and , so there are such matrices.
For this
gives of the
matrices: , , and , that
is,