Chapter 3: Linear systems and row reduction
3.3Gauss–Jordan elimination
In Example 3.1.13 we solved the running system by eliminating unknowns, choosing each move by eye and stopping when the answer looked readable. To prove theorems with elimination we need a procedure with no judgment calls in it. This section states one, Gauss–Jordan elimination, proves that it terminates, and studies its output, the reduced row echelon form . With the bookkeeping of Section 3.2, a whole run of the algorithm is recorded by one invertible matrix with . The main theorem of the section says that depends only on : every way of row reducing to a matrix of this shape ends at the same matrix. As a first application, we decide whether a square matrix is invertible, and compute its inverse, by row reduction.
3.3.1The algorithm
Intuition (How elimination is organized). Read the rows of as equations and the columns as unknowns. Elimination uses one equation to remove one unknown from all the other equations, and the natural order is left to right. Find the first unknown that occurs in some equation, move such an equation to the top, divide it by its coefficient of , and subtract multiples of it from every other equation, so that occurs in no other equation. The top equation is now used up; we call its row pivoted. Then do the same with the equations that are left: find the leftmost unknown that still occurs in one of them, and so on.
Gauss–Jordan elimination clears the column of each new pivot above it as well as below it, so at the end each pivot is alone in its column. (Clearing only below gives Gaussian elimination, Section 3.3.6.) A column whose nonzero entries all lie in pivoted rows is skipped: it is already a combination of earlier pivot columns, and in Section 3.4 its unknown becomes a free variable.
In the algorithm below, is the current matrix and is the number of pivoted rows. The pivoted rows are always rows of , and the other rows are unpivoted.
Algorithm 3.3.1 (Gauss–Jordan elimination)
- Input
- A matrix .
- Output
- The matrix , and its pivot columns
.
Start with and .
One execution of step 1 through step 4 that does not halt in step 1 is a pass. Each pass creates exactly one pivot, so after passes the pivots sit in positions
Each step can be carried out. In step 2, column has a nonzero entry in some unpivoted row, so if row has a there, a row below it does not. In step 3 the entry is nonzero, so it has an inverse in . In step 4 every operation adds a multiple of row , which the step never changes, so the operations can be performed one at a time in any order with the same result. (Compare Exercise 3.1.35, where a row was used after it had been replaced.)
Example 3.3.3 (A complete run). We run the algorithm on
Pass 1. No row is pivoted, and column has nonzero entries, so . The entry in position is , and the topmost row below it with a nonzero entry in column is row , so we swap rows and . Then we scale row by and declare the pivot , so . In column , row already has a and row has a , so we add times row to row :
Pass 2. Rows and are unpivoted. Column has entries in these rows (the in row does not count, since row is pivoted), so the scan moves on and finds . The entry in position is , so there is no swap. We scale row by and declare the pivot , so . Then we clear column above and below the pivot:
End. Only row is unpivoted, and it is zero, so the next scan finds no column and the algorithm halts after two passes. The output is
with pivot columns and . The run used six row operations, with elementary matrices (in the notation of Definition 3.2.2) , , , , , .
The row reducer below performs the same run, one row operation at a time. Next to the current matrix it shows the product of the elementary matrices used so far, and at every step (Theorem 3.3.10).
The running system is also a good test. In Example 3.1.13 the four operations on its coefficient matrix were exactly the two passes of the algorithm (in pass we cleared row before row , which does not matter). So Example 3.2.8 already computed
together with the product of the four elementary matrices.
Exercise 3.3.4. Run Gauss–Jordan elimination on
listing the elementary matrix of every row operation. What are the pivot columns?
Uses. Algorithm 3.3.1 (Gauss–Jordan elimination), Proposition 3.2.7 (Row operations are left multiplications)
Pass 1. Column has nonzero entries, so . The entry is and row is the topmost row with a nonzero entry in column , so we swap rows and (). The new entry is , so no scaling is needed; . Row has entry in column , so we add times row to row ():
Pass 2. Column has the nonzero entries in the unpivoted rows , so , and the entry is nonzero, so there is no swap. Scaling row by () gives the row , and . Rows and have entry in column , so we add times row to each (, ):
End. The only unpivoted row is zero, so the next scan finds no column and the algorithm halts. The pivot columns are and .
3.3.2Termination and the shape of the output
An algorithm is a construction, and a construction can be a proof: running Gauss–Jordan elimination on will prove that is row equivalent to a matrix of a very special shape. For that we have to show two things about every run, not just the one in Example 3.3.3. It stops, and what it stops with has the shape we want. The method is worth naming.
Technique 3.3.5 (Algorithms as proofs: invariants and termination). To prove that something exists, it is often enough to give a procedure that builds it. Two things then have to be proved about the procedure.
Termination. Find a quantity that moves in one direction at every step and cannot do so forever, such as a nonnegative integer that decreases, or an integer that increases and is bounded above. (Such a quantity is sometimes called a monovariant.)
Correctness. Find an invariant: a statement about the current state that is true at the start and that each step keeps true. When the procedure halts, the invariant together with the reason for halting gives the property of the output. Formally this is induction on the number of steps.
The art is in choosing the invariant. The property we want at the end is rarely preserved step by step on its own, and usually has to be strengthened, by adding facts about the intermediate states, until it is. Reach for this technique whenever a result says that some reduction is always possible (“every matrix can be brought to the form …”, “the process ends with …”). The canonical example is Gauss–Jordan elimination: termination is Proposition 3.3.6, and the invariant is Lemma 3.3.7. Later examples are Gram–Schmidt orthogonalization (Section 6.4) and the Euclidean algorithm for polynomials (Section 7.1); Exercise 3.2.54 is a small one.
Used in 15 places and 1 practice exercise
Proposition 3.3.6, Lemma 3.3.7, Proposition 3.3.8, Theorem 3.3.10, Theorem 3.3.12, Exercise 3.3.47, Exercise 3.3.53, Exercise 3.3.56, Exercise 3.6.11, Exercise 5.2.43, Algorithm 5.4.22, Exercise 5.4.48, Theorem 6.4.15, Theorem 7.1.45, Proposition 8.3.25; 1 practice exercise.
Uses. Algorithm 3.3.1 (Gauss–Jordan elimination)
Techniques. Algorithms as proofs: invariants and termination (Technique 3.3.5)
Now for the shape of the output. In Example 3.3.3 the pivots formed a staircase descending to the right, each pivot was alone in its column, and the leftover row was zero. The first two facts are what each pass sets up for its own pivot; the real issue is that later passes must not undo the work of earlier ones.
Lemma 3.3.7 (The loop invariant). Let , and suppose Gauss–Jordan elimination on has completed passes, with pivot columns and current matrix . Put . Then:
- (a) for some product of elementary matrices;
- (b)
; - (c)for , column of is ;
- (d)for , row of has zeros in columns ;
- (e)rows of have zeros in columns .
Uses. Algorithm 3.3.1 (Gauss–Jordan elimination), Proposition 3.2.7 (Row operations are left multiplications), induction on
Techniques. Algorithms as proofs: invariants and termination (Technique 3.3.5)
We induct on . Before the first pass, and , and (b)–(e) say nothing.
Suppose that (a)–(e) hold after passes, with current matrix , and that pass takes place, with column chosen in step 1. Let be the matrix after the pass. By the choice of as the leftmost suitable column,
The pass does three things. step 2 may exchange two rows among rows . step 3 scales row ; call the resulting row . step 4 adds multiples of to other rows and leaves row equal to . By (3.3.1), has zeros in columns , and by step 3 it has entry in column .
(a) Each operation of the pass is left multiplication by an elementary matrix (Proposition 3.2.7). So , where is the product of the elementary matrices of the pass, and is again a product of elementary matrices.
(b) If , then by (e), rows of vanish in columns , so the column found by the scan satisfies . Hence
(c) Let . Column of is , so its entries in rows are . Steps step 2 and step 3 only exchange or scale entries in these rows, and step 4 adds multiples of , which is a multiple of one of these rows and so also has entry in column . So column of is still . For the new pivot: after step 3 the entry of row in column is , and each operation of step 4 changes a single row , replacing its entry in column by . So column of is .
(d) Let . Row is not touched by steps step 2 and step 3, and in step 4 it changes by a multiple of , which vanishes in columns , a range containing . So row of still vanishes in columns . Row of is , which vanishes in columns .
(e) Let . Row of is one of the rows of (possibly moved by the swap) plus a multiple of . By (3.3.1) both vanish in columns , so row of does too, and its entry in column is by (c). So rows of vanish in columns .
This completes the induction. □
Proposition 3.3.8 (Properties of the output). Let be the output of Gauss–Jordan elimination on , with pivot columns . Then , and:
- (a)rows of are zero;
- (b)for , the leading entry of row is the pivot, a in column ;
- (c)for , column of is .
In particular, satisfies the following conditions.
- (R1)Every zero row lies below every nonzero row.
- (R2)The leading entry of every nonzero row is .
- (R3)The leading entry of each nonzero row lies strictly to the right of the leading entry of every row above it.
- (R4)In a column that contains the leading entry of some row, every other entry is .
Uses. Lemma 3.3.7 (The loop invariant), Proposition 3.3.6 (Termination)
Techniques. Algorithms as proofs: invariants and termination (Technique 3.3.5)
The algorithm completes passes and then halts. By Proposition 3.3.6, , and by Lemma 3.3.7(b), are distinct columns, so .
(a) The algorithm halted because step 1 found no column with a nonzero entry in one of the rows . So these rows are zero.
(b), (c) By Lemma 3.3.7(d), row of vanishes in columns , and by Lemma 3.3.7(c), column of is , so the entry of row in column is .
By (a) and (b), the nonzero rows of are exactly rows , which gives (R1). Their leading entries are the pivots, which are and lie in the columns ; this gives (R2) and (R3). The columns containing leading entries are , so (R4) is (c). □
3.3.3Reduced row echelon form
This is the lecture’s definition: is whatever the algorithm outputs. It has the advantage of being concrete, and the drawback that it is not yet clear which matrices are in RREF, or whether a different way of row reducing could end somewhere else. We settle both questions in this section and the next. First, the bookkeeping of Section 3.2 turns the run into one matrix.
Theorem 3.3.10 (). For every there is a matrix that is a product of elementary matrices, and hence invertible, with
Explicitly, , where are the elementary matrices of the row operations of the run, in the order performed.
Uses. Lemma 3.3.7 (The loop invariant), Proposition 3.2.7 (Row operations are left multiplications), Corollary 3.2.11 (Products of elementary matrices)
Techniques. Algorithms as proofs: invariants and termination (Technique 3.3.5)
In other words, running the algorithm on is the same as multiplying on the left by one well-chosen invertible matrix. Two consequences are immediate. First, (Definition 3.2.21). Second, by Corollary 3.2.23,
The matrix is found by performing the operations of the run on . It is convenient to do this alongside the run itself, by adjoining to .
Proposition 3.3.11 (Carrying extra columns along). Let and , and let be as in Theorem 3.3.10.
- (a)
. - (b)Performing on the matrix the run of Gauss–Jordan elimination with step 1 restricted to the first columns ends at .
In particular, the restricted run on ends at .
Uses. Definition 2.4.1 (Matrix product), Theorem 3.3.10 (), Proposition 3.2.7 (Row operations are left multiplications)
(a) By Definition 2.4.1, column of is times column of , for any matrix with rows. The first columns of are those of and the last are those of , so the first columns of form and the last form .
(b) For the same reason, if is elementary, the first columns of form . So as long as the restricted run on and the run on perform the same operations, the first columns of the current matrix of the former are the current matrix of the latter. Every decision in steps step 1 through step 4 (which column, which rows, which scalars, whether to halt) depends only on the entries in the scanned columns. So, by induction on the number of operations, the two runs perform the same operations , and the restricted run ends at
The row reducer does exactly this when it shows : it carries along. For Example 3.3.3,
so
The last row of is worth a look. Since the last row of is zero, times row of , minus times row , plus row , is the zero row. So a zero row of records a linear relation among the rows of (see Exercise 3.3.57).
Which matrices are in RREF
We now characterize the matrices in RREF by their shape, without reference to the algorithm. One direction is Proposition 3.3.8. For the other, we run the algorithm on a matrix of the right shape and watch it do nothing.
Uses. Proposition 3.3.8 (Properties of the output), Algorithm 3.3.1 (Gauss–Jordan elimination), Definition 3.3.9 (Reduced row echelon form), induction on the number of passes
Techniques. Algorithms as proofs: invariants and termination (Technique 3.3.5)
Suppose is in RREF. Then is an output of the algorithm, so it satisfies (R1)–(R4) by Proposition 3.3.8, and by Proposition 3.3.8(b) its pivots are its leading entries.
Conversely, suppose satisfies (R1)–(R4). By (R1), its nonzero rows are rows for some , and by (R3), their leading entries lie in columns
Suppose this holds for some , and consider pass . Rows have their leading entries in columns , all to the right of , and rows are zero. Together with the leading entry of row , this shows that rows vanish in columns , and that row has a nonzero entry in column . So step 1 picks , and step 2 does nothing. By (R2) the entry in position is already , so step 3 changes nothing and declares this leading entry a pivot. By (R4) all other entries of column are , so step 4 changes nothing. This completes the induction.
After passes the unpivoted rows are rows , which are zero by (R1), so the algorithm halts and outputs . Hence , and the pivots are the leading entries. □
Since satisfies (R1)–(R4) by Proposition 3.3.8, Theorem 3.3.12 gives
where each is an arbitrary scalar. The pivot columns are , everything below the staircase is , and the non-pivot columns are free above it.
Example 3.3.13 (Matrices in RREF). The identity and the zero matrix are in RREF. (For the leading entries are the diagonal entries; the zero matrix has no nonzero rows, so (R2)–(R4) say nothing.) So are
In the second matrix, the entry sits in a non-pivot column, where (R4) imposes nothing.
Non-example 3.3.14 (Four ways to fail). Over , each matrix below violates exactly one condition:
In the first, a zero row lies above a nonzero row. In the second, a leading entry is . In the third, the leading entry of row lies to the left of that of row . In the fourth, the leading entry of row has a nonzero entry above it. The last three have reduced row echelon form , and the first has .
(a)Which of the following matrices are in RREF? For each one that is not, name a condition among (R1)–(R4) that fails.
- (b)Find all matrices over a field that are in RREF. How many are there over ?
Uses. Theorem 3.3.12 (Matrices in RREF)
(a) By Theorem 3.3.12 we check (R1)–(R4).
- The first matrix fails (R3): the leading entry of row (column ) lies to the left of that of row (column ).
- The second is in RREF: the leading entries are s in columns and , and those columns are and .
- The third fails (R1): the zero row lies above the nonzero row .
- The fourth is in RREF: leading s in columns and , which are and , and the zero row is last.
- The fifth fails (R4): column contains the leading entry of row and also a nonzero entry in row . (It also fails (R3).)
(b) Let be in RREF. If has no nonzero row, . If it has one, it is row by (R1). Its leading is in column or column : in the first case with arbitrary (column contains no leading entry, so (R4) says nothing about it), and in the second case . If both rows are nonzero, their leading s are in columns and by (R3), and by (R4) . All these matrices satisfy (R1)–(R4). Over there are of them.
3.3.4Uniqueness
Two people row reducing the same matrix by hand will rarely perform the same operations. One may bring up a different row in step 2, or clear everything below the pivots first and the entries above them afterwards. If both end with a matrix satisfying (R1)–(R4), do they end with the same matrix? Equivalently, can one row equivalence class contain two different matrices in RREF? This matters beyond hand computation. Properties we read off , such as the number of pivots (the rank, Section 3.5) or which columns are pivot columns, should belong to , and we will constantly want to replace by a row equivalent matrix without changing them.
The answer is that the reduced row echelon form is unique. We first record how to read the columns of a matrix in RREF.
Lemma 3.3.16 (Reading the columns of a matrix in RREF). Let be in RREF, with columns , entries , and pivot columns . Put for .
- (a)For , every column with has zeros in rows . That is,
. - (b) for .
- (c)Column is a pivot column if and only if is not a linear combination of .
(d)If column is not a pivot column, and are the pivot columns to the left of it, then
Uses. Theorem 3.3.12 (Matrices in RREF), Proposition 3.3.8 (Properties of the output), Definition 1.3.4 (Linear combination)
By Theorem 3.3.12, satisfies (R1)–(R4) and its pivots are its leading entries: the leading entry of row is a in column for , and rows are zero.
(a) Let and . If , the leading entry of row is in column , so . If , row is zero. So for all .
(b) Column contains the leading entry of row , which is by (R2), and its other entries are by (R4).
(c), (d) Suppose first that is a pivot column. By (a), applied with , every column with has entry in row , and therefore so does every linear combination of . But has entry in row . So is not such a combination.
Now suppose is not a pivot column, and let be the pivot columns to its left ( if there are none). Then , so by (a) and (b),
This is (d), and since , it shows that is a combination of earlier columns. (For , it says , the empty combination.) Together with the first case, this proves (c). □
So a matrix in RREF records two kinds of information: which columns are new, in the sense of not being combinations of earlier columns (the pivot columns, which are in order), and how each other column is built from the pivot columns before it (its entries).
Intuition (Two strategies for uniqueness). We want to show: if and are both in RREF and is invertible, then . There are two natural ways to think about this.
Track . Left multiplication by sends column of , which is , to column of . If we knew that had its pivots in the same columns, that column would be too, so : the first columns of are . Then fixes every vector in , which contains every column of , so . So everything comes down to showing that the pivot columns agree, and it is natural to do this one pivot at a time, from left to right, using invertibility of to rule out a pivot that appears earlier in one matrix than in the other. This is an induction on the pivots.
Forget . Row operations preserve the linear relations among the columns (Corollary 3.2.17). By Lemma 3.3.16, these relations determine which columns are pivot columns, and how the other columns are expressed through them. So two RREF matrices with the same relations among their columns are equal.
The first approach gives information about that the second does not; the second is shorter and proves a stronger statement (Corollary 3.3.20).
Proof (pivot by pivot).
Uses. Lemma 3.3.16 (Reading the columns of a matrix in RREF), Definition 2.3.8 (Matrix–vector product), Definition 2.5.12 (Invertible), induction on
Techniques. Uniqueness via two candidates (Technique 1.1.8)
Write , , and for the columns of , , and , and and for the pivot columns of and . Put for and for . We use two facts.
By Definition 2.3.8, column of is
In particular .
- The columns of are linearly independent: if
, then for , so .
We prove by induction on that
Fix , and assume this holds for every .
Suppose . Then , so , and for we have , hence and by the induction hypothesis. By Lemma 3.3.16(b),
Suppose . Then , so , and for , ; by the induction hypothesis and . By Lemma 3.3.16(a) for ,
whose th entry is . But by Lemma 3.3.16(b) for , a contradiction.
Hence . If this number is at most , then by Lemma 3.3.16(b) for both matrices,
In particular , since is the number of with , and for . Finally, let be any column. By Lemma 3.3.16(a) with ,
So , as desired. □
Proof (via relations among columns).
Uses. Corollary 3.2.17 (Row operations preserve relations among columns), Lemma 3.3.16 (Reading the columns of a matrix in RREF)
Techniques. Uniqueness via two candidates (Technique 1.1.8)
Let and be the columns of and . By Corollary 3.2.17, for all ,
We show that (3.3.2) alone forces .
The pivot columns agree. For scalars , the equation
is the relation in (3.3.2) with for , , and for . So it holds if and only if the same equation holds with in place of . Hence is a linear combination of the earlier columns of if and only if is a linear combination of the earlier columns of . By Lemma 3.3.16(c), applied to and to , column is a pivot column of if and only if it is a pivot column of . Let be the common pivot columns.
The columns agree. By Lemma 3.3.16(b),
This is a relation among the columns of , so by (3.3.2) the same relation holds in :
where the last equality is Lemma 3.3.16(d) and (b) for again. So every column of equals the corresponding column of . □
The two proofs teach different things. The first shows how rigid is: whenever is again in RREF, the first columns of are , although its other columns can be anything that keeps invertible (Exercise 3.3.46). The second never looks at . It used only that and satisfy the same linear relations among their columns, that is, that , and we will exploit this in Corollary 3.3.20.
Corollary 3.3.18 (RREF and row equivalence). Let .
- (a)
for every invertible . - (b) if and only if .
- (c)If is in RREF and , then . In particular, any sequence of elementary row operations that turns into a matrix satisfying (R1)–(R4), performed in any order and with any choices, ends at .
Uses. Theorem 3.3.17 (Uniqueness of the reduced row echelon form), Theorem 3.3.10 (), Theorem 3.3.12 (Matrices in RREF), Proposition 3.3.8 (Properties of the output), Corollary 3.2.11 (Products of elementary matrices), Proposition 3.2.22 (Row equivalence is an equivalence relation), Definition 3.2.21 (Row equivalence)
Techniques. Uniqueness via two candidates (Technique 1.1.8)
(a) By Theorem 3.3.10 there are invertible with and
and is invertible, with inverse . Both and are in RREF (by Proposition 3.3.8 and Theorem 3.3.12), so Theorem 3.3.17 gives
(b) If , then with a product of elementary matrices, which is invertible, so by (a). Conversely, suppose . By Theorem 3.3.10, and , so by symmetry and transitivity (Proposition 3.2.22),
(c) If is in RREF, then , and gives
Part (c) settles the question from Remark 3.3.2. A run of the algorithm that makes other choices in step 2 still ends at a matrix satisfying (R1)–(R4), since the proofs of Lemma 3.3.7 and Proposition 3.3.8 never used which row was brought up; so it ends at . The same goes for Gaussian elimination followed by clearing upward (Section 3.3.6), and for any improvised hand computation. It also shows that the pivot columns, and their number, are determined by . Here is a description of them that does not mention the algorithm at all.
Corollary 3.3.19 (Pivot columns, intrinsically). Let have columns , and let be the entries of .
- (a)Column is a pivot column of if and only if is not a linear combination of .
(b)If column is not a pivot column and are the pivot columns to its left, then
Uses. Theorem 3.3.10 (), Corollary 3.2.17 (Row operations preserve relations among columns), Lemma 3.3.16 (Reading the columns of a matrix in RREF)
For the matrix of Example 3.3.3, the pivot columns are and , and Corollary 3.3.19(b) reads off and from the entries of . Indeed
Finally, we can prove the converse promised in Remark 3.2.25.
- (i);
- (ii);
- (iii).
Uses. Corollary 3.3.18 (RREF and row equivalence), Corollary 3.2.23 (Row equivalent matrices have the same kernel), Theorem 3.3.10 (), Definition 2.3.8 (Matrix–vector product), Theorem 3.3.17 (Uniqueness of the reduced row echelon form)
Techniques. Reduce to RREF (Technique 3.3.22)
(i) (ii) is Corollary 3.3.18(b), and (i) (iii) is Corollary 3.2.23. We prove (iii) (ii).
Suppose , and let and . By Theorem 3.3.10 and Corollary 3.2.23,
where and are the columns of and . This is (3.3.2). The second proof of Theorem 3.3.17 deduced from (3.3.2) and Lemma 3.3.16 alone, so . □
So the kernel of , a subspace of , determines the row equivalence class of among matrices, and is a canonical representative of that class. For example, a matrix has
Exercise 3.3.21. Decide which two of the following real matrices are row equivalent:
Uses. Corollary 3.3.18 (RREF and row equivalence), Algorithm 3.3.1 (Gauss–Jordan elimination)
3.3.5Inverses by row reduction
For a square matrix , row reduction decides whether is invertible and, if it is, computes . The idea is one we will use again and again: invertibility does not change when is multiplied on the left by an invertible matrix, and for a matrix in RREF it is visible at a glance.
Technique 3.3.22 (Reduce to RREF). Many properties of a matrix do not change when is replaced by with invertible: for example, the kernel (Corollary 3.2.23), the linear relations among the columns (Corollary 3.2.17), and, for square , invertibility. To decide such a property, replace by (Theorem 3.3.10), where the answer can be read off the pivots and the zero rows. Two things have to be checked: that the property really is unchanged by left multiplication by invertible matrices, and what the property says about a matrix in RREF.
Reach for it whenever a question about is really about , about relations among the columns of , or about solutions of (where must be replaced by , Proposition 3.2.14). The canonical example is Theorem 3.3.23. It is the method of Section 3.4 and Section 3.5, and later of rank–nullity (Section 4.2) and of the equality of row rank and column rank (Section 4.3).
Used in 33 places
Corollary 3.3.20, Theorem 3.3.23, Exercise 3.3.49, Exercise 3.3.50, Proposition 3.4.1, Corollary 3.4.4, Theorem 3.4.9, Proposition 3.4.15, Proposition 3.4.16, Corollary 3.4.20, Exercise 3.4.45, Theorem 3.5.19, Theorem 3.5.27, Exercise 3.5.42, Exercise 3.5.45, Exercise 3.6.6, Exercise 3.6.7, Exercise 3.6.9, Exercise 3.6.10, Problem 3.3, Problem 3.4, Problem 3.5, Problem 3.6, Problem 3.8, Problem 3.10, Problem 3.11, Problem 3.12, Problem 3.14, Problem 3.17, Theorem 4.2.7, Theorem 4.2.11, Theorem 4.3.8, Problem 4.6.
Uses. Theorem 3.3.10 (), Corollary 3.2.11 (Products of elementary matrices), Proposition 3.3.8 (Properties of the output), Definition 2.5.12 (Invertible)
Techniques. Reduce to RREF (Technique 3.3.22)
Suppose , so . Since is invertible (Corollary 3.2.11), multiplying on the left by gives . Hence as well, so is invertible with .
Conversely, suppose , and let be its pivot columns. If , then are increasing numbers among , so for every , and by Proposition 3.3.8(c) column of is ; that is, , which we have excluded. So , and row of is zero by Proposition 3.3.8(a). Then for every , the entry of is , so ; thus is not invertible. If were invertible, then would be invertible, with inverse . So is not invertible. □
This gives an algorithm. To find the operations of the run and their product at the same time, we carry along as in Proposition 3.3.11.
Algorithm 3.3.24 (Inverting a matrix by row reduction)
- Input
- A square matrix .
- Output
- , or the conclusion that is not invertible.
The algorithm is correct by Proposition 3.3.11 and Theorem 3.3.23. Two practical remarks. If is invertible, all pivots lie in the left block, so restricting the scan makes no difference; it only matters when is not invertible. And one may stop as soon as the left block acquires a zero row: at that moment the left block is with invertible, and a matrix with a zero row is not invertible (as in the proof above), so neither is .
Example 3.3.25 (Inverting a matrix). Let
Swapping rows and of and then adding times row to row finishes pass :
Pass scales row by and clears column with and ; pass scales row by and clears column with and :
The left block is , so is invertible and
As a check, the first row of times the columns of gives
Example 3.3.26 (A matrix that is not invertible). Let have rows , , . The algorithm gives
The left block is not , so is not invertible. The last row of says more: since the last row of is zero, row of minus twice row plus row is zero, which is easy to confirm.
For square matrices, Theorem 3.3.23 says in particular that an invertible matrix is row equivalent to . Section 3.5 turns this into the statement that every invertible matrix is a product of elementary matrices (Theorem 3.5.19), and fits it into the Fundamental Theorems. Also note that in the proof, was enough to conclude , because was known to be invertible. That a one-sided inverse of a square matrix is always two-sided is Theorem 3.5.23.
Exercise 3.3.27. Let
Use Algorithm 3.3.24 to decide whether is invertible over , and over , and find when it exists.
Uses. Algorithm 3.3.24 (Inverting a matrix by row reduction), Theorem 3.3.23 (Invertibility and RREF)
Pass adds times row to row ; pass adds times row to row and times row to row . This is the same over any field:
Over . Pass scales row by and then adds times row to row and times row to row :
So is invertible over and
Check: the first row of times the columns of gives
Over . Here , so the last row of the left block above is zero, and the algorithm stops: is not invertible over . (Indeed, in the computation above, the last row of the right block gives times row of plus times row plus row , which is
3.3.6Row echelon form Beyond 21-242
Echelon forms and triangular factorizations are standard in LADW and in numerical linear algebra, but not part of the course.
Clearing above the pivots is not needed to solve a system: once each pivot has zeros below it, the equations can be solved from the bottom up. This gives a cheaper algorithm and a weaker normal form.
Gaussian elimination is Algorithm 3.3.1 with two changes: step 3 of Algorithm 3.3.1 only declares the pivot, without scaling, and step 4 of Algorithm 3.3.1 clears only the rows below row . If the pivot is and row has entry in the pivot column, the pass adds times row to row , where is the multiplier. The proof of Lemma 3.3.7 goes through with (c) weakened to “column of has a nonzero entry in row and zeros below it” (a pivot row is never changed after its own pass), and as in Proposition 3.3.8 the output is a row echelon form of .
The pivot positions, unlike the entries, are always the same.
Uses. Corollary 3.3.18 (RREF and row equivalence), Theorem 3.3.12 (Matrices in RREF)
The second phase of this proof, scaling and clearing upward from the last pivot, is called back substitution. Gaussian elimination followed by back substitution is the usual way of computing by hand, and by Corollary 3.3.18 it gives the same answer as Gauss–Jordan elimination.
3.3.7LU and PLU factorizations Beyond 21-242
Suppose we must solve for one and many right-hand sides , as happens constantly in applications. The work of elimination is almost all spent on and does not depend on , so it is worth recording once and for all. Gaussian elimination without swaps only adds multiples of a row to rows below it, and the elementary matrices of such operations are lower triangular. This suggests factoring into triangular pieces.
- (a)If are lower triangular, then so is , and
. - (b)A unit lower triangular matrix is invertible, and its inverse is unit lower triangular.
- (c)The same statements hold for upper triangular matrices.
Uses. Definition 2.4.1 (Matrix product), Proposition 3.2.7 (Row operations are left multiplications), Corollary 3.2.11 (Products of elementary matrices), Proposition 2.4.23 (Transpose of a product)
(a) We have
(b) Let be unit lower triangular. For in turn, and for each , add times row to row , where is the current entry. We claim that just before column is processed, the current matrix is unit lower triangular with columns equal to . This holds for . If it holds for , then row has zeros in columns (as those columns are ), a in column , and zeros after it; so row is . Adding a multiple of it to row changes only the entry, which becomes . So afterwards column is and the claim holds for . At the end the matrix is , so , where is the product of the elementary matrices with that were used. Each of these is unit lower triangular (its only off-diagonal entry is in position ), so is unit lower triangular by (a). Since is invertible (Corollary 3.2.11), , and .
(c) A matrix is (unit) upper triangular if and only if its transpose is (unit) lower triangular. If are upper triangular, then
A permutation matrix is a product of swap matrices (equivalently, a matrix with exactly one in each row and each column and zeros elsewhere; see Definition 5.2.29).
Theorem 3.3.33 (PLU and LU factorizations). Let .
- (a)There are a permutation matrix , a unit lower triangular , and a matrix in row echelon form such that .
- (b)If Gaussian elimination on never needs a swap, then , where is the output of Gaussian elimination and the entry of in position , for , is the multiplier of pass (and if there is no pass ).
Uses. Definition 2.4.33 (Block matrix), Definition 3.3.31 (Triangular matrices), Definition 3.3.28 (Row echelon form), Definition 5.2.29 (Permutation matrix), induction on
(a) We induct on . If , take and ; a single row is in row echelon form. Let . If , take and . Otherwise, let be the first nonzero column of , choose a row with , and let (or if ). Then has first columns zero and a nonzero entry . Write
where the zero blocks have columns, is the rest of column , , and
since the lower blocks of the product are and . (The right factor is the result of the first pass of Gaussian elimination on .) If , the blocks , , are empty, and (3.3.3) is the required factorization with . If , the induction hypothesis gives a permutation matrix , a unit lower triangular , and a row echelon form with . Put
By (3.3.3) and blockwise multiplication,
and these agree because . Here is unit lower triangular because is. is a permutation matrix, because if is a product of swaps of size , then is the product of the swaps of size . Finally, is in row echelon form: its first row has leading entry in column , its other rows vanish in columns , and below the first row it has the shape of , which is in row echelon form.
(b) If Gaussian elimination needs no swaps, then at every stage of the induction the entry is already nonzero and we may take ; then . In (3.3.3) the entries of are the multipliers of the first pass, and is the lower right part of the matrix after the first pass, on which the later passes operate. So by induction column of holds the multipliers of pass below the diagonal, and is the output of Gaussian elimination. □
Example 3.3.34 (An LU factorization). Let
Pass uses the multipliers and and leaves rows and ; pass uses and leaves . So
The multipliers drop into with no further computation. By contrast, has no LU factorization: if
Once is known, is equivalent to . One solves from the top down ( first, then , and so on: forward substitution) and then from the bottom up (back substitution). For each of these costs about arithmetic operations, while the factorization itself costs a multiple of :
Remark 3.3.35 (How much work elimination takes). Let be invertible, and suppose no swaps are needed. In pass of Gauss–Jordan elimination the pivot is in position , and the pivot row vanishes in columns (Lemma 3.3.7(d)). So the scaling touches entries, and each of the replacements touches entries, with one multiplication and one addition each. The total number of multiplications is at most
and there are about as many additions: roughly arithmetic operations in all. Gaussian elimination only clears the rows below the pivot, which costs
multiplications and divisions, and about as many additions: about operations in all; back substitution adds only about per right-hand side. Either way, doubling the size of the matrix multiplies the work by about . A system with a few thousand unknowns is routine for a computer, whereas the formula for the solution that comes out of determinants in Section 5.5 involves sums with terms.
Example 3.3.36 (A PLU factorization). For the matrix of Example 3.3.25, the entry is , so the proof of Theorem 3.3.33 starts with . Then , and the remaining block needs no swap: its multiplier is , leaving . So
3.3.8Symmetric matrices: Beyond 21-242
A matrix is symmetric if . Elimination does not see symmetry: the of an LU factorization of a symmetric matrix is usually not symmetric. But the symmetry is hiding in the factorization, and it can be recovered.
Theorem 3.3.37 ( factorization). Let be symmetric, and suppose with unit lower triangular and upper triangular with nonzero diagonal entries. Let be the diagonal matrix with the same diagonal entries as . Then , so
Uses. Lemma 3.3.32 (Products and inverses of triangular matrices), Proposition 2.4.23 (Transpose of a product), Definition 3.3.31 (Triangular matrices)
Since the diagonal entries are nonzero, is invertible, with diagonal with entries . Let ; this scales row of by , so is unit upper triangular, and . Then , and transposing (Proposition 2.4.23, with ) gives
Here is unit lower triangular and is unit upper triangular. Multiplying on the left by and on the right by , which exist by Lemma 3.3.32, gives
By Lemma 3.3.32, is unit lower triangular, so the left side is lower triangular with diagonal entries ; the right side is upper triangular. So both sides are diagonal, and comparing diagonals they equal . Thus , and multiplying on the right by gives , that is, . Hence and . □
The hypothesis holds whenever is invertible and Gaussian elimination on needs no swaps. Then by Theorem 3.3.33(b), and by Proposition 3.3.30 the pivots of lie in the pivot columns of , which are since (Theorem 3.3.23); so the diagonal entries of are its pivots, which are nonzero.
Example 3.3.38 (An factorization). For the symmetric matrix
Gaussian elimination uses the multipliers , , , and its output has rows , , . So and
Over , when every diagonal entry of is positive, with diagonal with entries , and
Exercises
Exercise 3.3.39. Let
(a) Find , its pivot columns, and a matrix with .
(b) Without further row reduction, write each non-pivot column of as a linear combination of the pivot columns.
Uses. Algorithm 3.3.1 (Gauss–Jordan elimination), Proposition 3.3.11 (Carrying extra columns along), Corollary 3.3.19 (Pivot columns, intrinsically)
(a) We row reduce , scanning only the first five columns (Proposition 3.3.11). Pass : the pivot is the entry; add times row to row and times row to row . Pass : column now vanishes in rows and , so the pivot is the entry, which is ; add times row to rows and . Pass : the pivot is the entry, which is ; add row to row and times row to row . The stages after each pass are
So
with pivot columns . As a check, row of is
(b) By Corollary 3.3.19(b), and
Exercise 3.3.40. Find the reduced row echelon form of
over and over . Where do the two computations part ways, and why?
Uses. Algorithm 3.3.1 (Gauss–Jordan elimination), Corollary 3.3.19 (Pivot columns, intrinsically)
Pass adds times row to row , which becomes . Pass , with pivot , adds times row to row and row to row :
So far every operation makes sense over any field.
Over . The third row has the entry in column , which becomes the pivot of pass . Scaling row by and adding row to row and times row to row gives
Over . Here and , so after pass the matrix is
Its unpivoted row is zero, so the algorithm halts, and this is over .
The computations part ways at the entry in pass , which is a valid pivot over and is over . In terms of Corollary 3.3.19: over the third column of is the sum of the first two,
Exercise 3.3.41. Over , let
Use Algorithm 3.3.24 to find , and to show that is not invertible. For , find the linear relation among its rows that the algorithm produces.
Uses. Algorithm 3.3.24 (Inverting a matrix by row reduction), Theorem 3.3.23 (Invertibility and RREF)
The matrix . Pass adds times row to row , which becomes
Pass scales row by , which turns the right part of row into , and then adds times row to row and times row to row . The result is
Check: the first row of times the first column of is
The matrix . Pass adds times row to row : the left part becomes
Exercise 3.3.42. For a scalar , let
(a) Find for every . For which is invertible?
(b) Answer the same questions over , for .
Uses. Algorithm 3.3.1 (Gauss–Jordan elimination), Theorem 3.3.23 (Invertibility and RREF)
Pass adds times row to row and times row to row , giving
(a) If and : pass scales row by , making it , and adds times it to row , which becomes . Pass scales row to and subtracts it from row . So .
If : the rows are , , . In pass , column vanishes in rows and , so the scan moves to column ; the entry is , so rows and are swapped. Scaling by and subtracting the new row from row gives
If : the rows are , , . Pass scales row to and adds times it to row , so
By Theorem 3.3.23, is invertible exactly when and .
(b) In , , since . If , rows and are both zero after pass , and
If or , then , and the computation of the first case of (a) applies verbatim: . So over , is invertible exactly when .
Exercise 3.3.43. Let and .
- (a)Show that for every nonzero .
- (b)Show that
. - (c)Let be the matrix with stacked on top of itself. Show that .
Uses. Corollary 3.3.18 (RREF and row equivalence), Theorem 3.3.12 (Matrices in RREF), Proposition 3.3.11 (Carrying extra columns along)
In each part we exhibit a matrix that satisfies (R1)–(R4) and is row equivalent to the given matrix; by Corollary 3.3.18(c) it is the reduced row echelon form.
(a) Scaling each of the rows of by turns into , so , and is in RREF. So .
(b) By Proposition 3.3.11(a),
(c) For , add times row to row . This turns into . Then perform the row operations of the run of Gauss–Jordan elimination on , applied to rows only; they turn into . This matrix satisfies (R1)–(R4): its nonzero rows are those of , at the top, and it is with zero rows appended. So .
Exercise 3.3.44. Let and .
- (a)Show that the first columns of form .
- (b)Give an example in which the last columns of differ from the matrix of Proposition 3.3.11.
Uses. Theorem 3.3.10 (), Proposition 3.3.11 (Carrying extra columns along), Theorem 3.3.12 (Matrices in RREF), Corollary 3.3.18 (RREF and row equivalence)
(a) By Theorem 3.3.10 and Proposition 3.3.11(a),
Let rows be the nonzero rows of , with leading entries in columns , and let be the number of that are at most , so that
(b) Let and . The run on is the single operation , so and . But reduces to and then to , whose last column is . The full algorithm also pivots in the column of , and then clears above that pivot.
Exercise 3.3.45. Prove or disprove each statement. Throughout, and are matrices over of sizes for which the expressions make sense.
- (a)
for every square . - (b)
. - (c)If , then .
- (d)If and have the same size and , then .
- (e)
.
Uses. Corollary 3.3.18 (RREF and row equivalence), Theorem 3.3.10 (), Theorem 3.3.12 (Matrices in RREF)
(a) False. Let . It satisfies (R1)–(R4), so and , which violates (R1) and so is not even in RREF. In fact .
(b) False. Let and . Then , , and
(c) False. Let and . Then
(d) False. Let and in . Both images are all of , but both matrices are in RREF and they are different.
(e) True. By Theorem 3.3.10, with invertible, so
(a)Find the error in the following argument, and give a counterexample to its conclusion.
Claim. If is in RREF and is invertible with , then .
Proof. Apply the first proof of Theorem 3.3.17 with . Its induction shows that for every , so every column of is the corresponding column of .
- (b)Suppose has pivots. Describe all invertible with .
Uses. Theorem 3.3.17 (Uniqueness of the reduced row echelon form), Lemma 3.3.16 (Reading the columns of a matrix in RREF), Definition 2.4.33 (Block matrix), Definition 2.5.12 (Invertible)
(a) The induction in the first proof of Theorem 3.3.17 shows for all , but only when , that is, for . It says nothing about the columns , so the claim does not follow. It is false: for and , is invertible (with inverse ) and , but .
(b) Let be the pivot columns of . If , then
for some and
Such a is invertible if and only if is. If is invertible, block multiplication (Definition 2.4.33) shows that is a two-sided inverse of . Conversely, let
So the invertible with are exactly the matrices with arbitrary and invertible. Only when is forced.
Exercise 3.3.47. Find the error in the following argument, and give a counterexample to its conclusion.
Claim. Change step 1 of Algorithm 3.3.1 of Algorithm 3.3.1 so that it picks any column with a nonzero entry in an unpivoted row, not necessarily the leftmost one. The output of the modified algorithm is still in RREF.
Proof. The proofs of Lemma 3.3.7 and Proposition 3.3.8 go through word for word.
Uses. Lemma 3.3.7 (The loop invariant), Proposition 3.3.8 (Properties of the output)
Techniques. Algorithms as proofs: invariants and termination (Technique 3.3.5)
The proof of Lemma 3.3.7 began with the observation that rows vanish in the columns before the chosen column . That is exactly what choosing the leftmost column guarantees, and parts (b), (d), and (e) were derived from it. With an arbitrary choice, none of them survives.
Counterexample: run the modified algorithm on , choosing column in pass . The entry is already , so it becomes a pivot with , and clearing column adds times row to row , giving . In pass , the only unpivoted row is , so ; scaling by gives , and clearing adds times row to row . The output is
which violates (R3), so it is not in RREF. (Here , so (b) of the invariant fails.)
What does survive is (a) and (c): the output is still row equivalent to , and each pivot column is a standard basis vector, because a column has zeros in all unpivoted rows whichever column is chosen next. Only the staircase is lost.
Exercise 3.3.48. Let be a prime.
- (a)Show that exactly matrices in are in RREF.
- (b)Deduce that splits into exactly row equivalence classes. How many is that for ?
Uses. Theorem 3.3.12 (Matrices in RREF), Lemma 3.3.16 (Reading the columns of a matrix in RREF), Corollary 3.3.18 (RREF and row equivalence)
(a) By Theorem 3.3.12 we count the matrices satisfying (R1)–(R4), sorted by their pivot columns. The pivot columns are in order, and by Lemma 3.3.16(a) a non-pivot column has zeros in every row below the rows of the pivots to its left, while its entries in those rows are arbitrary.
- No pivots: only the zero matrix. That is matrix.
- One pivot, in column : , so matrices. In column : , so . In column : , so .
- Two pivots, in columns : , so . In columns : , so . In columns : , so .
Each displayed matrix satisfies (R1)–(R4) for every choice of . The total is
(b) Every class contains a matrix in RREF, namely for any in it, and by Corollary 3.3.18(b) two matrices in RREF are row equivalent only if they are equal (as ). So (the class of ) is a bijection from the matrices in RREF to the classes, and there are classes. For this is .
Uses. Corollary 3.3.20 (The kernel is a complete invariant), Corollary 3.3.18 (RREF and row equivalence), Theorem 3.3.10 ()
Techniques. Reduce to RREF (Technique 3.3.22)
Let , which is in RREF. Its kernel consists of the with and , that is, ; so
If , then by Theorem 3.3.10, with invertible, so . Conversely, if with invertible, then
with invertible.
Exercise 3.3.50. For write
- (a)Show that if and only if for every in the row space of .
- (b)Deduce that are row equivalent if and only if they have the same row space.
Uses. Definition 2.3.8 (Matrix–vector product), Corollary 3.3.20 (The kernel is a complete invariant), Exercise 3.2.46, Definition 1.3.10 (Span)
Techniques. Reduce to RREF (Technique 3.3.22)
(a) Let be the rows of . By Definition 2.3.8, the th entry of is
(b) If , they have the same row space by Exercise 3.2.46. Conversely, suppose and have the same row space. By (a), and are both the set of with for all in this common row space. So , and by Corollary 3.3.20.
Exercise 3.3.51. Let , and let have in every diagonal position, in every position directly above the diagonal, and elsewhere.
- (a)Row reduce to show that is invertible, and that has entry in position for , and for .
- (b)Find the inverse of the matrix with for and for .
Uses. Corollary 3.3.18 (RREF and row equivalence), Theorem 3.3.23 (Invertibility and RREF), Proposition 3.3.11 (Carrying extra columns along)
(a) For , let
the row vector we expect as row of . For , row of has left part and right part . Row has left part and right part .
For in this order, add times row to row . We claim that afterwards row is . When row is processed it has not been changed yet, and row is already (for this was noted above, and otherwise by induction). So row becomes
since
At the end the matrix is , where has rows . Let be the product of the elementary matrices used, so
(b) Take in (a): the matrix with on the diagonal and directly above it has inverse with entries for and below the diagonal, which is . So is invertible and : it has on the diagonal, in each position , and elsewhere.
Uses. Definition 2.5.12 (Invertible), Definition 2.4.1 (Matrix product)
Let be the matrix all of whose entries are , so . Each entry of is a sum of products , so
Suppose , and let . Then
and the same computation, with the factors in the other order, gives (all the matrices involved are combinations of and , which commute). So is invertible and : its diagonal entries are and its other entries are . For instance, for over ,
Suppose . Then
Over , exactly when divides . So is invertible over if and only if is not a multiple of ; for example, over , if and only if is even.
Exercise 3.3.53. A matrix is upper triangular if whenever .
- (a)Let be upper triangular with every diagonal entry nonzero. Show that Gauss–Jordan elimination on performs no swaps, and that every elementary matrix it uses is upper triangular. Deduce that is invertible, and that is upper triangular with diagonal entries .
- (b)Let be upper triangular with some diagonal entry . Find a nonzero with , and conclude that is not invertible.
Uses. Algorithm 3.3.1 (Gauss–Jordan elimination), Theorem 3.3.23 (Invertibility and RREF), Definition 2.4.1 (Matrix product)
Techniques. Algorithms as proofs: invariants and termination (Technique 3.3.5)
(a) We show by induction on that before pass , the current matrix is upper triangular, its first columns are , and its rows are those of . For , .
Assume this before pass . Rows of vanish in columns (as is upper triangular), and the entry is . So step 1 of Algorithm 3.3.1 picks column , and there is no swap. step 3 of Algorithm 3.3.1 multiplies by the diagonal matrix . In column , the rows have entry , so step 4 of Algorithm 3.3.1 only changes rows , using the matrices with ; the single off-diagonal entry of such a matrix is in position , above the diagonal. Adding a multiple of row , which vanishes in columns , to a row changes it only in columns , all to the right of the diagonal entry . So after the pass, is still upper triangular, column is , columns are unchanged, and rows are untouched. This completes the induction.
After pass the matrix is , so , and by Theorem 3.3.23 is invertible with , the product of the elementary matrices used. Each of them is upper triangular. If and are upper triangular, then
(b) Let be the smallest index with , so for . Put for and , and for in turn, put
Since is upper triangular, entry of is . For this involves only with , which are . For it is . For it is
Together, (a) and (b) show that an upper triangular matrix is invertible if and only if all its diagonal entries are nonzero.
Exercise 3.3.54. Let be a subfield of a field (for example or ), and let , so that is also a matrix over .
- (a)Show that is the same whether it is computed over or over .
- (b)Deduce that if is invertible as a matrix over , then has all its entries in .
- (c)Show that are row equivalent over (using elementary matrices with entries in ) if and only if they are row equivalent over .
Uses. Definition 1.1.32 (Subfield), Algorithm 3.3.1 (Gauss–Jordan elimination), Theorem 3.3.23 (Invertibility and RREF), Corollary 3.3.18 (RREF and row equivalence)
(a) By Definition 1.1.32, the sum and product of elements of , computed in , are their sum and product in , and the inverse in of a nonzero element of lies in and is its inverse there (inverses are unique). We show by induction on the number of operations performed that the runs of Algorithm 3.3.1 on over and over perform the same operations, with the same current matrices, all of whose entries lie in . At the start both current matrices are . If the current matrices agree and have entries in , then every decision of the next step (which column, whether an entry is , which row to swap) is the same, the scalars used (inverses and negatives of entries) are the same elements of , and the operation produces the same matrix, with entries in . So the outputs agree.
(b) Over , is invertible, so by Theorem 3.3.23, and by (a) this also holds over . Running Algorithm 3.3.24 over produces with and , and by Theorem 3.3.23 is the inverse of , over and hence over (where inverses are unique).
(c) An elementary matrix over is an elementary matrix over , so row equivalence over implies row equivalence over . Conversely, if and are row equivalent over , then by Corollary 3.3.18(b) over and by (a),
where the subscript records the field used. By Corollary 3.3.18(b) over , and are row equivalent over .
- (a)Describe a procedure that, given , decides whether and, if so, finds an invertible with .
- (b)Carry it out for and over .
Uses. Proposition 3.3.11 (Carrying extra columns along), Corollary 3.3.18 (RREF and row equivalence), Theorem 3.3.23 (Invertibility and RREF)
(a) Row reduce and , scanning only the first columns. By Proposition 3.3.11 this gives and with
(b) For : adding times row to row gives , and adding times row to row gives . The same operations on give . For : swapping the rows gives , and adding times row to row gives
Check:
Exercise 3.3.56. Let be or . A matrix is strictly diagonally dominant if in every row the diagonal entry outweighs the rest:
Show that Gauss–Jordan elimination on such an never needs a swap, and conclude that is invertible.
Uses. Algorithm 3.3.1 (Gauss–Jordan elimination), Theorem 3.3.23 (Invertibility and RREF), Definition B.1.7 (Modulus)
Techniques. Algorithms as proofs: invariants and termination (Technique 3.3.5)
We show by induction on that before pass the current matrix satisfies: (i) columns of are ; (ii) rows of vanish in columns ; (iii) the block is strictly diagonally dominant. For , and this is the hypothesis.
Assume (i)–(iii) before pass . By (iii),
To prove (iii) for , fix , and let denote a sum over with . The dominance of row and of row in the old block give
Using the triangle inequality and then these two bounds (the first multiplied by
where the last inequality is . So the new block is strictly diagonally dominant, which completes the induction.
So every pass finds its pivot on the diagonal without a swap, and after pass the matrix is by (i). Hence , and is invertible by Theorem 3.3.23.
Uses. Definition 2.4.1 (Matrix product), Proposition 3.3.8 (Properties of the output), Lemma 3.3.16 (Reading the columns of a matrix in RREF), Definition 2.5.12 (Invertible)
Let and let be the rows of . By Definition 2.4.1, row of is , and
By Proposition 3.3.8(a), rows of are zero, so for . Hence every linear combination of is a relation.
Conversely, let , and put . Then , and
Now is times row of , plus , plus times row of . Let be the pivot columns. Column of is (Lemma 3.3.16(b)), so row of has entry in column if and otherwise, and the entry of in column is . Hence for , and
In the language of transposes, says . So the transposes of the last rows of span , one of the four fundamental subspaces of Section 4.3.
Exercise 3.3.58. Let be a prime. For , let be the number of matrices over that are in RREF and have no zero row; put , and for .
(a)Show that for and ,
- (b)For , compute , and the number of row equivalence classes in .
Uses. Theorem 3.3.12 (Matrices in RREF), Lemma 3.3.16 (Reading the columns of a matrix in RREF), Corollary 3.3.18 (RREF and row equivalence)
(a) Let be an matrix in RREF with no zero row. By Theorem 3.3.12, it has pivots, one in each row, in columns .
Column is a pivot column. Then , column is , and row , whose leading entry is in column , is . Deleting row and column leaves an matrix . Rows of have zero entries in column , so they keep their leading entries, and satisfies (R1)–(R4) with no zero row. Conversely, for any such , the matrix satisfies (R1)–(R4) with no zero row and has column as a pivot column. So there are matrices in this case.
Column is not a pivot column. Then all pivots lie in columns , and deleting column leaves an matrix in RREF without zero rows (the leading entries are unchanged). Conversely, given such a matrix, appending any column gives a matrix satisfying (R1)–(R4): the leading entries are unchanged, and (R4) says nothing about a column without a leading entry. So there are matrices in this case. (When there are none, consistent with .)
Adding the two cases gives the recursion.
(b) With : and
A matrix in RREF has nonzero rows, which by (R1) are its top rows, and they form an matrix in RREF without zero rows. So there are
The recursion is a -analogue of Pascal’s rule
Exercise 3.3.59. Let
(a) Find the LU factorization of .
(b) Find the factorization of the symmetric matrix , and write with lower triangular.
Uses. Theorem 3.3.33 (PLU and LU factorizations), Theorem 3.3.37 ( factorization)
(a) Pass uses the multipliers and , leaving rows and . Pass uses , leaving . By Theorem 3.3.33(b),
Check the last row:
(b) Pass uses and , leaving rows and . Pass uses , leaving . So
and . By Theorem 3.3.37, ; indeed . So
Check: the rows of have pairwise products (row with rows ), , , and , which are the entries of .
Uses. Lemma 3.3.32 (Products and inverses of triangular matrices), Exercise 3.3.53, Definition 2.5.12 (Invertible)
Suppose with unit lower triangular and upper triangular. By Lemma 3.3.32, is invertible, so is invertible, as a product of invertible matrices. By Exercise 3.3.53(b), the diagonal entries of are nonzero, and then by Exercise 3.3.53(a), is upper triangular. Multiplying on the left by and on the right by gives
By Lemma 3.3.32, the left side is unit lower triangular and the right side is upper triangular. A matrix that is both is diagonal, with the diagonal entries of the left side, which are . So
Exercise 3.3.61. Call an matrix an integer elementary matrix if it is a swap , a sign change , or a replacement with . Show that for the following are equivalent:
- (i) is invertible (over ), and has integer entries;
- (ii) is a product of integer elementary matrices.
In other words, the matrices that can be inverted without leaving are exactly those that can be row reduced to without leaving .
Uses. Exercise 3.2.54, Proposition 3.2.10 (Inverses of elementary matrices), Definition 2.4.33 (Block matrix), induction on
(ii) (i). Integer elementary matrices have integer entries, and by Proposition 3.2.10 their inverses , , are again integer elementary. If with all integer elementary, then is invertible with , a product of integer matrices, so it has integer entries.
(i) (ii). We show by induction on that there is a product of integer elementary matrices with ; then is a product of integer elementary matrices by the first part. For , with and integers, so , and or works.
Let and . The entry of is , so every common divisor of divides . For in turn, if the current entries in positions and are not both , apply Exercise 3.2.54(b) to them: it gives integer elementary matrices that turn this pair into (their gcd, ), and acting on rows and only, they are integer elementary matrices. Row operations of this kind do not change the set of common divisors of the entries of the first column (each new entry is an integer combination of old ones, and the operations can be undone by integer elementary matrices), so at the end the first column is , where is a common divisor of the original entries; hence . So we have a product of integer elementary matrices with
This matrix is invertible with integer inverse . Write in the same block sizes. Comparing first block columns in gives and , and then the lower right blocks of and give and . So is invertible with integer inverse , and by the induction hypothesis there is a product of integer elementary matrices with . Each factor of gives the integer elementary matrix (with indices shifted by one), so is a product of integer elementary matrices, and
For the matrix of Example 3.3.25, which has an integer inverse, this explains why fractions could have been avoided there.
More practice
The practice bank has 30 exercises on this section’s topics.