Gaussian elimination is a list of instructions: swap
these rows, scale that one, add a multiple of one row to
another. So far it lives outside algebra, as something
we do to a matrix. This section turns every row
operation into a matrix, so that “apply an operation”
becomes “multiply on the left”. With that one
observation the algorithm becomes a tool for proofs. We
use it to prove the main theorem about invertible
matrices, to show that a one-sided inverse of a square
matrix is automatically two-sided, which Chapter 0
stated after Definition 0.9.13 but
could not prove, and to compute inverses.
Throughout, is
a field, and we use the three elementary row operations
of Definition 3.2.1
with their notation: the swap
(), the
scaling (
non-zero), and the replacement (, any ).
Row
operations are matrix multiplications
We have already seen one row operation disguised as a
product. In Example (Row equivalence)
of Chapter 0, multiplying on the left by replaced row 2 by row
2 minus twice row 1, that is, it performed . Look
at itself: it is
what that same operation does to the identity matrix
. This is no
accident, and it deserves a name.
An elementary matrix is the identity matrix after
one row operation.
Definition
3.4.1 (Elementary matrix)
Let . A
matrix is an elementary matrix
if it is obtained from by performing
exactly one elementary row operation.
Writing for
the matrix unit (
in entry ,
elsewhere; see Example (Standard Bases)),
the three kinds are:
- ,
obtained by with : the identity
with rows and
swapped;
- , with in position , obtained by with ;
- , obtained by with
and : the identity
with an extra in
entry .
In words: start from , do
one operation, and record the result.
The size is the
number of rows of the matrices we plan
to operate on. Type 3 puts in row , column : the row that changes
is , and the row
that gets copied is .
Examples. In , come from , (over a
field where ), and . The degenerate case is worth a look:
is
elementary, since “multiply row 1 by ” is a legal operation,
and so is . The identity is an elementary matrix.
For the
elementary matrices are exactly the matrices with , since there are
no two distinct rows to swap or combine.
Non-example by minimal change.
Change in
to . The matrix is still
diagonal and still differs from in one entry, but
“multiply row 2 by ” is not an elementary
row operation: the clause fails. Likewise is a rearrangement of the rows of
, but every one
of its rows has moved, and a single swap moves only two
rows. So it is not elementary. It is, however, the
product of two
elementary matrices, as Exercise A1 at the end of this
section checks.
The whole point of the definition is the next
theorem. To perform a row operation on
any matrix, multiply on the left by
what that operation does to the identity.
Theorem
3.4.1 (Row operations are left
multiplications)
Let be an
elementary row operation on matrices with rows, and let be the
corresponding elementary matrix. Then for
every and every ,
Idea. Each operation builds every
new row as a combination of the old rows, with
coefficients that do not depend on the matrix: for , new
row is , and every other row is copied.
Feed in , whose
rows are the standard row vectors, and the coefficients
appear as the entries of . Then the row view of
a product says
forms exactly those combinations of the rows of .
Proof. Let be the
rows of , and
write for
the -th row of
. By Definition 3.2.1,
for each there
are scalars , depending on but
not on , such that row of is . Explicitly, every row that the
operation does not touch has and all other
, and the
touched rows are:
- for : row
is and row
is ;
- for : row is ;
- for : row is .
Applying to
, row of is . So the -entry of is . By Theorem 0.9.2 (rows),
row of is , and by Theorem 0.9.3 (rows
version) this equals , which is row of . Since every row
agrees, . This proves the theorem.
So a sequence of operations , performed in that order, turns into by applying the theorem times and using
associativity. The whole of Gaussian elimination is a
single matrix standing on the left.
Warning. The first
operation stands rightmost. Doing
and then on gives , while the product in the other
order is . Also, multiplying by on the
right performs a
column operation: adds
column 1 to column 2, and column operations change
solution sets.
Example
(Three operations, three products)
Let . Compute , and , and
check that each is the result of the corresponding row
operation.
Solution. By the row view, row
of is the combination
of the rows of
whose weights are row of .
- Rows of
are , so : rows 1 and 3 are swapped.
- Row 2 of is , so : row 2 is multiplied by 5.
- Row 3 of is , so row 3 of the product is , and : this is .
In each case the product agrees with the operation,
as Theorem 3.4.1
predicts.
Quick check. Which elementary
matrix performs ? Which operation undoes it, and what is
its matrix?
Solution. Apply the operation to
: row 2 becomes
,
so the matrix is , with in entry . The operation
undoes it, since row 3 is unchanged by both; its matrix
is .
Every row operation can be undone by another row
operation, and the matching statement for matrices
is:
Theorem
3.4.2 (Elementary matrices are
invertible)
Every elementary matrix is invertible, and its
inverse is an elementary matrix of the same kind:
Proof. Let , and let
be the
operation on the same line of the display: for a
swap, for (legal, since gives ), and for
.
In each case
and for every , as in Theorem 3.2.2 (a):
swapping twice restores the order; scaling by and multiplies row
by ; and adding
and then
to row restores row , because means row is not changed in
between. Let . By Theorem 3.4.1,
Hence
is invertible with , which is the matrix in the display.
This proves the theorem.
The hypothesis did real work: “add times row to row ” is scaling by , which destroys row
when and cannot be
undone. That is why Definition 3.2.1
excludes it.
The
invertible matrix theorem
Chapter 0 defined an invertible matrix by the
existence of a two-sided inverse, and gave only one
practical test, , for matrices (Theorem 0.9.8). For
larger matrices, searching for with
directly is hopeless. What we want is a list of
conditions, each of which we can check by a method we
already have, that are all equivalent to invertibility.
Then we may test whichever is cheapest.
We need one small fact about square matrices in
reduced form.
Lemma
3.4.3 (Square reduced matrices)
Let be in reduced row echelon form. Then
either ,
or the last row of is zero.
Proof. Suppose the last row of
is not zero.
Since zero rows of a matrix in echelon form come after
all non-zero rows (Definition 3.2.3),
no row of is
zero, so each of the rows has a pivot. Let
the pivot of row
be in column .
Pivots move strictly to the right as we go down, so
. A strictly increasing
list of integers
in
must be , so . By Definition 3.2.4,
each pivot equals
and is the only non-zero entry of its column, so column
of is for every . Hence .
Here is the theorem. It collects, for a square
matrix, facts about solving systems, about row
reduction, and about the columns as vectors in the sense
of Chapter 1.
Theorem
3.4.4 (Invertible Matrix Theorem)
Let , with columns . The following are equivalent.
- (a) is invertible.
- (b) The homogeneous
system
has only the trivial solution .
- (c) The reduced row
echelon form of
is .
- (d) is a product of
elementary matrices.
- (e) For
every , the system has a
solution.
- (f) The columns
are linearly independent.
- (g) The columns
span .
- (h) The columns
form a basis of .
Idea. Eight conditions would need
56 implications if proved pairwise; a cycle through them
needs far fewer. The plan:
① the core cycle (a) (b) (c) (d) (a), where
each arrow uses one earlier tool (cancel by ; row reduction;
elementary matrices; products of invertible
matrices);
② (b) (f),
which is the column view ;
③ (f) (h) (g),
which is “count instead of check” in the -dimensional space ;
④ (g) (e),
which is “consistent means is in the column
span”.
The only arrow that needs a new argument is (b) (c); the
others quote a result we already have. An RREF that is
not has a zero
row, so it really has fewer equations than unknowns, and
such a homogeneous system has a non-trivial
solution.
Proof. (a) (b).
Suppose is
invertible and . Multiplying on the left by and using Theorem 0.9.4, .
(b) (c).
Suppose (b) holds. By Theorem 3.2.3,
is row
equivalent to a matrix in reduced row echelon
form, and is the
RREF of by Theorem 3.3.4. By
Lemma 3.3.1, has the same
solutions as , so it too has only the trivial solution.
Suppose, for a contradiction, that . By Lemma 3.4.3, the
last row of is
zero. If ,
then and
is a
non-trivial solution. If , the last equation of reads , so has the same
solutions as the homogeneous system formed by
the first
rows. That system has equations in unknowns, so by Corollary 3.2.5 it
has a non-trivial solution. Either way we contradict
(b). Hence .
(c) (d).
Suppose the RREF of is . By Definition 3.2.2
there are row operations
taking to . If , then is
elementary. Otherwise, with , Theorem 3.4.1 gives
. Each is invertible by Theorem 3.4.2, so
multiplying on the left by , then , and so on,
gives and each is elementary
by Theorem 3.4.2.
(d) (a).
Suppose with each elementary and . Each is invertible by Theorem 3.4.2, and
a product of two invertible matrices is invertible by Theorem 0.9.7 (part
3). By induction on , is invertible.
So far (a), (b), (c), (d) are equivalent.
(b)
(f). By Theorem 0.9.3, . So “ only for ” says exactly that forces , which is Definition 1.4.1 for
the columns.
(f) (h)
(g). The columns form a list of exactly vectors in , and (Example (Dimensions of the Running Examples)).
By Theorem 1.6.4, such
a list is a basis if it is linearly independent, and
also if it spans. Conversely a basis is independent and
spanning by Definition 1.5.1.
Hence (f) (h) (g) (h) (f).
(g)
(e). By Theorem 3.1.1,
has a
solution if and only if . So (e) says every
lies in
this span, that is, . The reverse
inclusion always holds, so (e) is equivalent to (g).
Combining the four parts, all eight conditions are
equivalent. This proves the theorem.
In practice the theorem is a menu. To show a matrix
is invertible, pick the most convenient
item, very often (b): take a solution of and show it is
. To show a
matrix is not invertible, exhibit one
non-zero solution of , or one linear relation among the columns.
The list grows in both directions. Chapter 2 has already
given the operator form of it, in terms of kernels and
images (Theorem 2.5.7), and
later chapters add determinants in Chapter 7,
eigenvalues in Chapter 9, and positive definiteness and
singular values in Chapter 13.
Quick check. Is invertible? Use
whichever item of Theorem 3.4.4 is
quickest.
Solution. No. The third column is
the sum of the first two: . So is a linear relation with
coefficients not all zero, item (f) fails, and hence (a)
fails. Equivalently, is a non-trivial solution of .
Warning. The theorem is about
square matrices. For , the columns span (the first two are
), so (g)
holds, but solves , so (b) fails. The proof of (f) (g) used
that the number of columns equals , and that is
exactly what breaks.
One-sided
inverses are two-sided
Chapter 0 left a gap on purpose. The definition of
invertibility (Definition 0.9.13)
asks for both and . Chapter 0
then stated that, for square matrices, the first
equation already implies the second, but that nothing
there could prove it: the entries of and are different sums.
Now we can prove it, and the proof uses the menu above
instead of entries.
Theorem
3.4.5 (One-sided inverses of square
matrices)
Let . If , then . Hence and are both invertible,
and
.
Idea. We cannot touch directly, so we aim
at invertibility of one factor instead. Which one? From
, a
vector killed by
is killed by , so it is . That is item (b) for
. Once exists, we may
cancel it: .
Proof. Suppose , and let
with
. Then, by
Theorem 0.9.4, So has only the trivial solution, and is invertible by Theorem 3.4.4 ((b)
(a)).
Multiplying on the right by and using
associativity, Therefore . Since is
invertible with inverse by Theorem 0.9.7 (part
2), we get . This proves the theorem.
By symmetry, also implies : apply the
theorem with the roles of and swapped. So from now
on, to verify that is the inverse of a
square matrix ,
one product suffices. We also get a useful
consequence of the same kind: if and
is invertible,
then and are invertible
(Exercise B3 at the end of this section).
Warning. For
non-square matrices a one-sided inverse
need not be two-sided. Let Then , but . In fact no
has :
, so
. The proof above breaks because no longer gives invertibility: is not square, so Theorem 3.4.4 does
not apply.
Computing
the inverse
Theorem 3.4.4 (c)
says is
invertible exactly when it row reduces to . The proof of (c)
(d)
even produced a matrix: if , then is a left inverse, hence
the inverse by Theorem 3.4.5. We
do not want to multiply out the by hand. The trick
is to let the operations act on at the same time as
on : since , the operations that turn into turn into . We write for the
matrix
whose first
columns are those of and whose last columns are those of
.
Algorithm. Input:
.
- Form the matrix .
- Row reduce it to reduced row echelon form , with .
- If ,
output . Otherwise, output “ is not
invertible”.
In practice, stop as soon as a zero row appears in
the left half:
is then not invertible (see the remark after the
theorem).
Theorem
3.4.6 (Inverse by row reduction)
Let , and let be the reduced row echelon form of
,
with . Then is the reduced row
echelon form of .
Consequently, is
invertible if and only if , and in that case .
Idea. Two things need checking.
First, the operations act on the two halves
independently, so the left half is transformed exactly
as alone would
be. Second, the left half of a reduced matrix is itself
reduced, so it really is the RREF of . The first is the
column view of a product; the second is a small check on
the staircase shape. After that, and , and Theorem 3.4.5
finishes.
Proof. Let be
row operations taking to , and put
with (and if ). By Theorem 3.4.1,
. By Theorem 0.9.2
(columns), each column of is
times the
corresponding column, so
Claim. is in reduced row
echelon form.
Proof. If row of is non-zero, its first
non-zero entry is also the first non-zero entry of row
of , so the
pivots of the non-zero rows of are pivots of , in the same
positions. Suppose row of is zero but some later
row of
is non-zero. Row
of cannot be
zero, since zero rows of come after its non-zero rows and row
is non-zero. So
its pivot lies in a column , while the pivot
of row lies in a
column , to
the left: this contradicts the staircase condition of Definition 3.2.3.
Hence the zero rows of come last, the pivots
of move strictly
right, and each pivot of is and the only non-zero
entry in its column, because this holds in . So satisfies Definition 3.2.4.
Now is obtained from by the operations
(Theorem 3.4.1), so
is row
equivalent to ,
and is in
reduced form. By Theorem 3.3.4,
is the RREF of
. By Theorem 3.4.4 ((a)
(c)), is
invertible if and only if . If , then , and Theorem 3.4.5 gives
.
This proves the theorem.
Example
(A
inverse)
Find the inverse of , or show that it does not exist.
Solution. Row reduce , naming
each operation. The left half now has three pivots, so no zero
row will appear. Clear above the pivots, from the bottom
up: The left half is , so by Theorem 3.4.6 is invertible and
Check one product: row 1 of times the columns of
gives , , ; rows 2 and
3 give
and in
the same way. So , and by Theorem 3.4.5 this
single product is enough.
Example
(When the algorithm stops)
Decide whether
is invertible.
Solution. Row reduce : A zero row has appeared in the left half, so
by the remark after Theorem 3.4.6,
is not
invertible. The right half of that row is not wasted: it
records the combination of rows that produced zero. Row
3 of the left half is of , and indeed .
Finally, the method writes an invertible matrix as a
product of elementary matrices, as in Theorem 3.4.4
(d).
Example
(Factoring into elementary matrices)
Write as a product of elementary matrices,
and read off .
Solution. Reduce to , keeping integers:
The elementary matrices of these operations
are , , ,
and by Theorem 3.4.1,
. Multiplying on the left by , then , then , and using Theorem 3.4.2,
Multiplying out confirms it: the last two
factors give , and then
the first factor adds twice row 1 to row 2, giving . Also is a left
inverse of ,
hence by Theorem 3.4.5:
which agrees with Theorem 0.9.8, since
. The
factorization is not unique: a different sequence of
operations gives different factors.
Permutation
matrices
A row swap is one elementary matrix. Doing several of
them in a row is not, but the product is still a matrix
of a single recognizable kind, and it is worth naming
here because it turns up far beyond this chapter: it is
how a relabeling of coordinates becomes a matrix.
Definition
3.4.2 (Permutation matrix)
Let be a permutation of . The
permutation matrix of is the matrix whose -th column is . A matrix
is a permutation matrix if it equals
for some
.
Equivalently, a permutation matrix has exactly one
in each row and
in each column, and zeros elsewhere. The identity is
, and is for the
transposition , which is also the elementary matrix . By contrast
is not
a permutation matrix: each column is still non-zero, but
its first row contains two ’s, and its second
column is
not a standard basis vector.
Lemma
3.4.7 (Permutation matrices)
Let .
- (a) . In particular a product of
permutation matrices is a permutation matrix.
- (b) is invertible
and .
- (c) If is a
transposition, then is the elementary
matrix that
swaps rows and
, and .
Proof.
(a) By Theorem 0.9.3, and so . So the
-th column of
is , for every , which is the
claim.
(b) By Theorem 0.9.2, , which is
if and
otherwise. Since
is
injective, exactly when . Hence , and by Theorem 3.4.5,
is
invertible with inverse .
(c) Swapping rows
and of produces a matrix
whose column is
, whose column
is , and whose other
columns are . These are the
columns , so the swap
matrix is .
Since , part (a) gives . This proves the lemma.
By (c) and Theorem 3.4.1,
is with rows and swapped, and by (a)
every permutation matrix is a product of such swaps
applied in turn, since for every permutation is a product of
transpositions (Theorem 0.10.4). So
is
always with its
rows rearranged.
Row
equivalence, revisited
Two descriptions of “row equivalent” are now on the
table. Example (Row equivalence)
of Chapter 0 said for some invertible . Definition 3.2.2
says is
reachable from
by finitely many row operations. Chapter 0 promised that
they agree, and now it is one line each way.
Theorem
3.4.8 (Row equivalence is left multiplication
by an invertible matrix)
Let . Then is row equivalent to
(that is, can be reached from
by row
operations) if and only if for some
invertible .
Proof. Suppose row
operations take to . By Theorem 3.4.1,
with , and is
invertible by Theorem 3.4.2 and
Theorem 0.9.7 (part
3). (If , take
.)
Suppose
with invertible.
By Theorem 3.4.4 ((a)
(d)),
for some elementary matrices . Let be the operation
with . By Theorem 3.4.1,
performing ,
then , …,
then on
produces .
Hence is row
equivalent to .
So the equivalence relation of Example (Row equivalence)
is the one Gaussian elimination moves along, and “two
matrices have the same RREF” is the same as “each is an
invertible matrix times the other”. In the next section
this form, , is what makes row spaces and ranks easy
to compare.
Exercises
A. Check your
understanding
Exercise
(A1)
- (a) Define an
elementary matrix, and write down the elementary
matrix that performs .
- (b) State four of
the conditions in Theorem 3.4.4.
- (c) True or false:
the product of two elementary matrices is always an
elementary matrix. Justify your answer.
- (d) True or false:
if , and , then . Justify your
answer.
- (e) True or false:
if
and has
a solution for each , then is invertible. Justify
your answer.
- (f) Describe the
method for computing the inverse of a square matrix, and
how it detects a matrix that is not invertible.
Solution.
- (a) An elementary
matrix in is
one obtained from by exactly one
elementary row operation (Definition 3.4.1).
Applying to gives .
- (b) For , each of
the following is equivalent to being invertible:
has only
the trivial solution; the RREF of is ; is a product of
elementary matrices; the columns of form a basis of .
- (c) False. A single
row operation changes at most two rows of (a swap changes two,
a scaling or an addition changes one), so every
elementary matrix has at least one row equal to the
corresponding row of . But (by the row view, its rows are
rows 2, 1, 3 of ) differs from
in every row.
Hence it is a product of two elementary matrices that is
not elementary.
- (d) False. With
and , but . Theorem 3.4.5 needs
square matrices.
- (e) True. Let solve , and let
have columns
.
By Theorem 0.9.2, has columns , so
, and
is invertible by
Theorem 3.4.5.
- (f) Row reduce to reduced
form .
If , then
; if
, in
particular if a zero row appears in the left half at any
stage, is not
invertible (Theorem 3.4.6).
B. Practice
Exercise
(B1: Inverses by row reduction)
For each matrix, find the inverse or show that it is
not invertible.
- (a) .
- (b) .
- (c) .
Solution.
- (a) Row reduce : The left half is , so by Theorem 3.4.6,
. Check: row 1 of against the columns of
gives , , , and rows 2
and 3 give and , so , which suffices by Theorem 3.4.5.
- (b) Row reduce : A zero row appears in the left half, so is not invertible
(remark after Theorem 3.4.6). The
right half of that row says , that is, row 3 of
is .
- (c) Over we have , so subtracting a
row is adding it. Row reduce : Hence . Check in
: row 1 of
is , and against
the columns of it gives , , ; rows 2 and 3
give and
similarly.
Exercise
(B2: A product of elementary matrices)
Let .
- (a) Write as a product of
elementary matrices.
- (b) Hence write
as a
product of elementary matrices, and compute it.
Solution.
- (a) Reduce to : With , , , Theorem 3.4.1 gives
. Multiplying on the left by in turn and using Theorem 3.4.2,
Check: the last two factors give , and adding twice row 1
to row 2 gives .
- (b) Since , Theorem 3.4.5 gives
(The last two factors give , and then
gives the answer.) This agrees with Theorem 0.9.8, since
.
Exercise
(B3: Invertible products)
Let , and suppose is invertible. Prove
that and are both
invertible.
Solution. Let . Then
by associativity, so has the right inverse
, and by Theorem 3.4.5 is invertible.
Similarly , so has the left inverse
. By Theorem 3.4.5 with
the roles of the two matrices swapped ( times is ), is invertible. This
proves the claim.
C. Going deeper
Exercise
(C1: Triangular matrices)
Let be upper triangular (Definition 0.9.5).
- (a) Prove that is invertible if and
only if for every .
- (b) Prove that if
is invertible,
then is
upper triangular.
Hint: for (a), use item (b) or item (f) of Theorem 3.4.4; for
(b), consider the systems .
Solution.
(a) Suppose
every , and let . Row
of this system reads , since for . We show by downward induction. Row is , and , so . If , row
becomes , so since . Hence , and
is invertible by Theorem 3.4.4 ((b)
(a)).
Suppose
for some . Every
column of
has zero entries
in rows : below the diagonal by triangularity, and in
row of column
by assumption. So
the columns all lie
in , a subspace of dimension (its spanning list
is a sub-list of the standard basis, hence independent).
By Theorem 1.6.3 (a), a
list of vectors there is linearly dependent. A
non-trivial relation among ,
extended by zero coefficients on , is
a non-trivial relation among all the columns. So the
columns of are
dependent, and
is not invertible by Theorem 3.4.4 ((a)
(f)).
(For , the
span is and
, so the
same conclusion holds.)
(b) Suppose is invertible, so
every
by (a). Fix , and
let be the -th column of . By Theorem 0.9.2, is the -th column of , so
. For
, row of this system reads
. By the same downward induction
as in (a), running only over ,
we get . So the -th column of has zeros below
position . As
was arbitrary,
is upper
triangular.
Exercise
(C2: All right inverses)
Let .
- (a) Find all with .
- (b) Show that there
is no with .
Solution.
- (a) By Theorem 0.9.2, means that
the columns of
satisfy and . The matrix is already in reduced
form with pivots in columns 1 and 2 and free, so means , , and its
solutions are the multiples of . One solution
of is
, and one
solution of is . By Theorem 3.1.3,
Hence the right inverses of are exactly infinitely many of them.
- (b) Suppose , and let
,
so . Then
, a contradiction since . Hence has no left
inverse.
Exercise
(C3: Nilpotent perturbations of the identity)
Let and suppose for some integer
.
- (a) Prove that is invertible,
by using item (b) of Theorem 3.4.4.
- (b) Verify that
, and
deduce a formula for .
Solution.
- (a) Let with . Then
.
Multiplying on the left by and using this again,
, and inductively for
every .
Taking , ,
so
(multiply by ). By Theorem 3.4.4 ((b)
(a)),
is
invertible.
- (b) Expanding with
Theorem 0.9.4, since the terms for in the
first sum cancel against the terms of the
second, and . By Theorem 3.4.5,
.