Books
Theme
Text size
Width

[ and ] go to the previous and next page.

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 rref(𝐴). With the bookkeeping of Section 3.2, a whole run of the algorithm is recorded by one invertible matrix 𝐺 with 𝐺𝐴=rref(𝐴). The main theorem of the section says that rref(𝐴) 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 1,…,𝑘 of 𝑀, and the other rows are unpivoted.

Algorithm 3.3.1 (Gauss–Jordan elimination)

Input
A matrix 𝐴∈𝐹𝑚×𝑛.
Output
The matrix rref(𝐴)∈𝐹𝑚×𝑛, and its pivot columns 𝑝1<𝑝2<⋯<𝑝𝑟.

Start with 𝑀=𝐴 and 𝑘=0.

1.

Scan. Find the leftmost column 𝑗 of 𝑀 that has a nonzero entry in an unpivoted row, that is, in one of the rows 𝑘+1,…,𝑚. If there is no such column, halt and output 𝑀.

2.

Swap. If the entry of 𝑀 in position (𝑘+1,𝑗) is 0, swap row 𝑘+1 with the topmost row below it whose entry in column 𝑗 is nonzero.

3.

Scale. Scale row 𝑘+1 by the inverse of its entry in column 𝑗, so that this entry becomes 1. (If it is 1 already, there is nothing to do.) Declare this entry a pivot, set 𝑝𝑘+1=𝑗, and increase 𝑘 by 1. Row 𝑘 is now pivoted.

4.

Clear. For each row 𝑖≠𝑘 whose entry 𝑐 in column 𝑗 is nonzero, add −𝑐 times row 𝑘 to row 𝑖.

5.

Repeat. Go back to step 1.

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 (1,𝑝1),(2,𝑝2),…,(𝑟,𝑝𝑟). (Later passes never move a pivoted row: swaps only involve unpivoted rows.) We call 𝑝1,…,𝑝𝑟 the pivot columns and rows 1,…,𝑟 the pivot rows. The leading entry of a nonzero row is its first nonzero entry, reading from the left.

Each step can be carried out. In step 2, column 𝑗 has a nonzero entry in some unpivoted row, so if row 𝑘+1 has a 0 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.)

Remark 3.3.2 (The one free choice). Every step is determined by the current matrix except, in principle, step 2. The lecture’s version of that step says only “swap rows to make the topmost unpivoted entry of this column nonzero”, leaving open which row to bring up. We have fixed the choice (the topmost suitable row, and no swap when none is needed) so that the output is a function of 𝐴. Other choices have their uses. By hand one might bring up a row whose entry is 1, to avoid fractions; in floating-point arithmetic one brings up the entry of largest absolute value to limit rounding errors (partial pivoting). Whether a different choice can change the output is a real question. Corollary 3.3.18 answers it: it cannot.

Example 3.3.3 (A complete run). We run the algorithm on

𝐴=(002424201234)∈ℚ3×4.

Pass 1. No row is pivoted, and column 1 has nonzero entries, so 𝑗=1. The entry in position (1,1) is 0, and the topmost row below it with a nonzero entry in column 1 is row 2, so we swap rows 1 and 2. Then we scale row 1 by 1/2 and declare the pivot (1,1), so 𝑝1=1. In column 1, row 2 already has a 0 and row 3 has a 1, so we add −1 times row 1 to row 3:

𝐴⟶𝐸12(242000241234)⟶𝐸1,1/2(121000241234)
⟶𝐸1,−1,3(121000240024).

Pass 2. Rows 2 and 3 are unpivoted. Column 2 has entries 0,0 in these rows (the 2 in row 1 does not count, since row 1 is pivoted), so the scan moves on and finds 𝑗=3. The entry in position (2,3) is 2≠0, so there is no swap. We scale row 2 by 1/2 and declare the pivot (2,3), so 𝑝2=3. Then we clear column 3 above and below the pivot:

⟶𝐸2,1/2(121000120024)⟶𝐸2,−1,1(120−200120024)
⟶𝐸2,−2,3(120−200120000).

End. Only row 3 is unpivoted, and it is zero, so the next scan finds no column and the algorithm halts after two passes. The output is

rref(𝐴)=(120−200120000),

with pivot columns 𝑝1=1 and 𝑝2=3. The run used six row operations, with elementary matrices (in the notation of Definition 3.2.2) 𝐸12, 𝐸1,1/2, 𝐸1,−1,3, 𝐸2,1/2, 𝐸2,−1,1, 𝐸2,−2,3.

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).

(002424201234)⇝(120−200120000)
Gauss–Jordan elimination on the matrix of Example 3.3.3. Step forward and back to see each elementary matrix; pivots are boxed. Use “Edit” to row reduce your own matrix, over ℚ or over 𝔽𝑝.

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 2 we cleared row 3 before row 1, which does not matter). So Example 3.2.8 already computed

rref(12−1251370)=(10−7013000),

together with the product 𝐺 of the four elementary matrices.

Exercise 3.3.4.routine Run Gauss–Jordan elimination on

𝐵=(024111234)∈ℚ3×3,

listing the elementary matrix of every row operation. What are the pivot columns?

Solution.

Uses. Algorithm 3.3.1 (Gauss–Jordan elimination), Proposition 3.2.7 (Row operations are left multiplications)

Hint 1. Pass 1 picks column 1. The (1,1) entry is 0, so the first operation is a swap.
Hint 2. In pass 2 the pivot is in position (2,2) and has to be scaled. Remember to clear above it as well as below it.
Sketch. The operations are 𝐸12, 𝐸1,−2,3, 𝐸2,1/2, 𝐸2,−1,1, 𝐸2,−1,3, and rref(𝐵) has rows (1,0,−1), (0,1,2), (0,0,0). The pivot columns are 1 and 2.

Pass 1. Column 1 has nonzero entries, so 𝑗=1. The (1,1) entry is 0 and row 2 is the topmost row with a nonzero entry in column 1, so we swap rows 1 and 2 (𝐸12). The new (1,1) entry is 1, so no scaling is needed; 𝑝1=1. Row 3 has entry 2 in column 1, so we add −2 times row 1 to row 3 (𝐸1,−2,3):

𝐵⟶𝐸12(111024234)⟶𝐸1,−2,3(111024012).

Pass 2. Column 2 has the nonzero entries 2,1 in the unpivoted rows 2,3, so 𝑗=2, and the (2,2) entry is nonzero, so there is no swap. Scaling row 2 by 1/2 (𝐸2,1/2) gives the row (0,1,2), and 𝑝2=2. Rows 1 and 3 have entry 1 in column 2, so we add −1 times row 2 to each (𝐸2,−1,1, 𝐸2,−1,3):

⟶𝐸2,1/2(111012012)⟶𝐸2,−1,1(10−1012012)⟶𝐸2,−1,3(10−1012000).

End. The only unpivoted row is zero, so the next scan finds no column and the algorithm halts. The pivot columns are 1 and 2.

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.

Proposition 3.3.6 (Termination). Let 𝐴∈𝐹𝑚×𝑛. Gauss–Jordan elimination on 𝐴 halts after completing at most 𝑚 passes, and so performs at most 𝑚(𝑚+1) elementary row operations.

Proof.routine

Hint 1. Find a quantity that changes in the same direction in every pass.
Hint 2. Track 𝑘, the number of pivoted rows. What does each pass do to it, and how large can it get?
Sketch. Each pass increases 𝑘 by 1 in step 3, no step decreases it, and 𝑘≤𝑚, since once 𝑘=𝑚 there is no unpivoted row and step 1 halts. A pass performs at most one swap, one scaling, and 𝑚−1 replacements.
Every pass increases the number 𝑘 of pivoted rows by 1, in step 3, and no step decreases 𝑘. A pass can only begin if some row is unpivoted, that is, if 𝑘<𝑚; when 𝑘=𝑚, step 1 finds no column and halts. So at most 𝑚 passes are completed before the algorithm halts. Each pass performs at most one swap, at most one scaling, and at most 𝑚−1 replacements (one for each row other than row 𝑘), so at most 𝑚+1 row operations. In total there are at most 𝑚(𝑚+1). □

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.

Intuition (Choosing the invariant). The obvious invariant is that the current matrix is 𝐺𝐴 for a product 𝐺 of elementary matrices, but it says nothing about the shape. For the shape we want three facts about the pivots found so far: each pivot column is a standard basis vector, the pivots descend to the right, and each pivot row vanishes to the left of its pivot. The first one maintains itself. A later pass swaps and scales unpivoted rows and adds multiples of an unpivoted row to other rows, and every unpivoted row has a 0 in column 𝑝𝑠, because that column is 𝐞𝑠. The other two depend on where the next pivot is found. They are safe if the unpivoted rows vanish in every column up to the last pivot, so we add this to the invariant. It is exactly what choosing the leftmost column in step 1, followed by clearing, keeps true.

Lemma 3.3.7 (The loop invariant). Let 𝐴∈𝐹𝑚×𝑛, and suppose Gauss–Jordan elimination on 𝐴 has completed 𝑘 passes, with pivot columns 𝑝1,…,𝑝𝑘 and current matrix 𝑀. Put 𝑝0=0. Then:

  1. (a)𝑀=𝐺𝐴 for some product 𝐺 of elementary matrices;
  2. (b)𝑝1<𝑝2<⋯<𝑝𝑘;
  3. (c)for 1≤𝑠≤𝑘, column 𝑝𝑠 of 𝑀 is 𝐞𝑠;
  4. (d)for 1≤𝑠≤𝑘, row 𝑠 of 𝑀 has zeros in columns 1,…,𝑝𝑠−1;
  5. (e)rows 𝑘+1,…,𝑚 of 𝑀 have zeros in columns 1,…,𝑝𝑘.

Proof.standard

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)

Hint 1. Induct on 𝑘. In pass 𝑘+1, let 𝑗 be the column chosen by step 1. What does the choice of 𝑗 say about rows 𝑘+1,…,𝑚 in columns 1,…,𝑗−1?
Hint 2. Let 𝐮 be row 𝑘+1 after step 3. Every operation of the pass either moves or scales unpivoted rows, or adds a multiple of 𝐮 to another row. Where is 𝐮 zero?
Hint 3. For (b), use (e) for the old 𝑘: the unpivoted rows vanish in columns 1,…,𝑝𝑘, so the scan cannot stop before column 𝑝𝑘+1.
Sketch. By the choice of 𝑗, rows 𝑘+1,…,𝑚 vanish in columns 1,…,𝑗−1, and so does the new pivot row 𝐮; by (e), 𝑗>𝑝𝑘. The pass only swaps and scales unpivoted rows and adds multiples of 𝐮, so columns 𝑝𝑠 with 𝑠≤𝑘 and the zeros in (d) are untouched, while step 4 turns column 𝑗 into 𝐞𝑘+1. Rows 𝑘+2,…,𝑚 are old unpivoted rows plus multiples of 𝐮, so they vanish in columns 1,…,𝑗.

We induct on 𝑘. Before the first pass, 𝑘=0 and 𝑀=𝐴=𝐼𝑚𝐴, and (b)–(e) say nothing.

Suppose that (a)–(e) hold after 𝑘 passes, with current matrix 𝑀, and that pass 𝑘+1 takes place, with column 𝑗 chosen in step 1. Let 𝑀′ be the matrix after the pass. By the choice of 𝑗 as the leftmost suitable column,

rows𝑘+1,…,𝑚of𝑀have zeros in columns1,…,𝑗−1.
(3.3.1)

The pass does three things. step 2 may exchange two rows among rows 𝑘+1,…,𝑚. step 3 scales row 𝑘+1; call the resulting row 𝐮. step 4 adds multiples of 𝐮 to other rows and leaves row 𝑘+1 equal to 𝐮. By (3.3.1), 𝐮 has zeros in columns 1,…,𝑗−1, and by step 3 it has entry 1 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 𝑘≥1, then by (e), rows 𝑘+1,…,𝑚 of 𝑀 vanish in columns 1,…,𝑝𝑘, so the column 𝑗 found by the scan satisfies 𝑗>𝑝𝑘. Hence 𝑝1<⋯<𝑝𝑘<𝑝𝑘+1=𝑗.

(c) Let 𝑠≤𝑘. Column 𝑝𝑠 of 𝑀 is 𝐞𝑠, so its entries in rows 𝑘+1,…,𝑚 are 0. 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 0 in column 𝑝𝑠. So column 𝑝𝑠 of 𝑀′ is still 𝐞𝑠. For the new pivot: after step 3 the entry of row 𝑘+1 in column 𝑗 is 1, and each operation of step 4 changes a single row 𝑖≠𝑘+1, replacing its entry 𝑐 in column 𝑗 by 𝑐−𝑐⋅1=0. So column 𝑗 of 𝑀′ is 𝐞𝑘+1.

(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 1,…,𝑗−1, a range containing 1,…,𝑝𝑠−1. So row 𝑠 of 𝑀′ still vanishes in columns 1,…,𝑝𝑠−1. Row 𝑘+1 of 𝑀′ is 𝐮, which vanishes in columns 1,…,𝑗−1=𝑝𝑘+1−1.

(e) Let 𝑖≥𝑘+2. Row 𝑖 of 𝑀′ is one of the rows 𝑘+1,…,𝑚 of 𝑀 (possibly moved by the swap) plus a multiple of 𝐮. By (3.3.1) both vanish in columns 1,…,𝑗−1, so row 𝑖 of 𝑀′ does too, and its entry in column 𝑗 is 0 by (c). So rows 𝑘+2,…,𝑚 of 𝑀′ vanish in columns 1,…,𝑝𝑘+1.

This completes the induction. □

Proposition 3.3.8 (Properties of the output). Let 𝑅 be the output of Gauss–Jordan elimination on 𝐴∈𝐹𝑚×𝑛, with pivot columns 𝑝1<⋯<𝑝𝑟. Then 𝑟≤min(𝑚,𝑛), and:

  1. (a)rows 𝑟+1,…,𝑚 of 𝑅 are zero;
  2. (b)for 1≤𝑠≤𝑟, the leading entry of row 𝑠 is the pivot, a 1 in column 𝑝𝑠;
  3. (c)for 1≤𝑠≤𝑟, column 𝑝𝑠 of 𝑅 is 𝐞𝑠.

In particular, 𝑅 satisfies the following conditions.

  1. (R1)Every zero row lies below every nonzero row.
  2. (R2)The leading entry of every nonzero row is 1.
  3. (R3)The leading entry of each nonzero row lies strictly to the right of the leading entry of every row above it.
  4. (R4)In a column that contains the leading entry of some row, every other entry is 0.

Proof.routine

Hint 1. Apply Lemma 3.3.7 after the last pass, and ask why the algorithm halted.
Hint 2. The scan found no column with a nonzero entry in rows 𝑟+1,…,𝑚. What does that say about those rows?
Sketch. There are at most 𝑚 passes and the 𝑝𝑠 are distinct columns, so 𝑟≤min(𝑚,𝑛). The algorithm halted because rows 𝑟+1,…,𝑚 have no nonzero entry, which is (a). Parts (b) and (c) are (c) and (d) of Lemma 3.3.7. Then (R1)–(R4) follow, using 𝑝1<⋯<𝑝𝑟 for (R3).

The algorithm completes 𝑟 passes and then halts. By Proposition 3.3.6, 𝑟≤𝑚, and by Lemma 3.3.7(b), 𝑝1<⋯<𝑝𝑟 are 𝑟 distinct columns, so 𝑟≤𝑛.

(a) The algorithm halted because step 1 found no column with a nonzero entry in one of the rows 𝑟+1,…,𝑚. So these rows are zero.

(b), (c) By Lemma 3.3.7(d), row 𝑠 of 𝑅 vanishes in columns 1,…,𝑝𝑠−1, and by Lemma 3.3.7(c), column 𝑝𝑠 of 𝑅 is 𝐞𝑠, so the entry of row 𝑠 in column 𝑝𝑠 is 1.

By (a) and (b), the nonzero rows of 𝑅 are exactly rows 1,…,𝑟, which gives (R1). Their leading entries are the pivots, which are 1 and lie in the columns 𝑝1<⋯<𝑝𝑟; this gives (R2) and (R3). The columns containing leading entries are 𝑝1,…,𝑝𝑟, so (R4) is (c). □

3.3.3Reduced row echelon form

Definition 3.3.9 (Reduced row echelon form). Let 𝐴∈𝐹𝑚×𝑛. The reduced row echelon form of 𝐴, written rref(𝐴) or 𝐴𝑟, is the output of Gauss–Jordan elimination (Algorithm 3.3.1) on 𝐴. The pivots and pivot columns of 𝐴 are those found by this run; by Proposition 3.3.8(b), the pivots are the leading entries of the nonzero rows of rref(𝐴). A matrix 𝑅 is in reduced row echelon form (or in RREF) if rref(𝑅)=𝑅.

This is the lecture’s definition: rref(𝐴) 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 (𝐺𝐴=rref(𝐴)). For every 𝐴∈𝐹𝑚×𝑛 there is a matrix 𝐺∈𝐹𝑚×𝑚 that is a product of elementary matrices, and hence invertible, with

𝐺𝐴=rref(𝐴).

Explicitly, 𝐺=𝐸𝑡⋯𝐸2𝐸1, where 𝐸1,…,𝐸𝑡 are the elementary matrices of the row operations of the run, in the order performed.

Proof.routine

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)

Hint 1. Which part of Lemma 3.3.7 is about 𝐺𝐴?
Hint 2. Apply it after the last pass, and recall that products of elementary matrices are invertible.
Sketch. By Lemma 3.3.7(a) after the last pass, rref(𝐴)=𝐺𝐴 with 𝐺=𝐸𝑡⋯𝐸1 the product of the elementary matrices of the run (Proposition 3.2.7). Such a product is invertible by Corollary 3.2.11.
By Proposition 3.2.7, performing the operations of the run one after another gives 𝐸1𝐴, then 𝐸2𝐸1𝐴, and so on; this is the content of Lemma 3.3.7(a). After the last operation the matrix is rref(𝐴)=𝐸𝑡⋯𝐸1𝐴=𝐺𝐴. By Corollary 3.2.11, 𝐺 is invertible. □

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, 𝐴∼rref(𝐴) (Definition 3.2.21). Second, by Corollary 3.2.23, ker𝑇𝐴=ker𝑇rref(𝐴), and by Proposition 3.2.14, 𝐴𝐱=𝐲 if and only if rref(𝐴)𝐱=𝐺𝐲. Section 3.4 reads the solutions off this second system.

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.

  1. (a)𝐺(𝐴|𝐵)=(rref(𝐴)|𝐺𝐵).
  2. (b)Performing on the 𝑚×(𝑛+𝑝) matrix (𝐴|𝐵) the run of Gauss–Jordan elimination with step 1 restricted to the first 𝑛 columns ends at (rref(𝐴)|𝐺𝐵).

In particular, the restricted run on (𝐴|𝐼𝑚) ends at (rref(𝐴)|𝐺).

Proof.routine

Uses. Definition 2.4.1 (Matrix product), Theorem 3.3.10 (𝐺𝐴=rref(𝐴)), Proposition 3.2.7 (Row operations are left multiplications)

Hint 1. Compute 𝐺(𝐴|𝐵) one column at a time.
Hint 2. For (b): the decisions in steps step 1 through step 4 depend only on entries in the scanned columns. How do row operations act on the individual columns of a matrix?
Sketch. Column 𝑙 of 𝐺𝑀 is 𝐺 times column 𝑙 of 𝑀, which gives (a). A row operation changes each column by itself, so during the restricted run the first 𝑛 columns evolve exactly as in the run on 𝐴; since every decision depends only on them, the restricted run performs the same operations 𝐸1,…,𝐸𝑡 and ends at 𝐺(𝐴|𝐵).

(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 𝐺𝐴=rref(𝐴) 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 𝐸1,…,𝐸𝑡, and the restricted run ends at 𝐸𝑡⋯𝐸1(𝐴|𝐵)=𝐺(𝐴|𝐵), which is (rref(𝐴)|𝐺𝐵) by (a). □

The row reducer does exactly this when it shows 𝐺: it carries 𝐼𝑚 along. For Example 3.3.3,

(𝐴|𝐼3)=(002410024200101234001)
⇝(120−2−1/21/2000121/2000000−1−1/21),

so

𝐺=(−1/21/201/200−1−1/21),𝐺𝐴=(120−200120000)=rref(𝐴).

The last row of 𝐺 is worth a look. Since the last row of 𝐺𝐴 is zero, −1 times row 1 of 𝐴, minus 1/2 times row 2, plus row 3, is the zero row. So a zero row of rref(𝐴) 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.

Theorem 3.3.12 (Matrices in RREF). A matrix 𝑅∈𝐹𝑚×𝑛 is in reduced row echelon form if and only if it satisfies conditions (R1)–(R4) of Proposition 3.3.8. In that case the pivots of 𝑅 are its leading entries.

Proof.standard

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)

Hint 1. One direction is Proposition 3.3.8, applied to 𝑅=rref(𝑅).
Hint 2. For the other, let rows 1,…,𝑟 be the nonzero rows of 𝑅, with leading entries in columns 𝑐1<⋯<𝑐𝑟. Run the algorithm on 𝑅 and show by induction that pass 𝑘 changes nothing.
Hint 3. In pass 𝑘, which is the leftmost column with a nonzero entry in rows 𝑘,…,𝑚? What is the entry in row 𝑘 there, and what does (R4) say about the rest of that column?
Sketch. If rref(𝑅)=𝑅, then 𝑅 is an output, so (R1)–(R4) hold by Proposition 3.3.8. Conversely, if (R1)–(R4) hold, then in pass 𝑘 the rows 𝑘,…,𝑚 vanish to the left of 𝑐𝑘, the leading entry of row 𝑘, which is 1. So the scan picks 𝑐𝑘, there is no swap and no scaling, and by (R4) nothing needs clearing. After 𝑟 passes only zero rows are unpivoted, and the algorithm halts with output 𝑅.

Suppose 𝑅 is in RREF. Then 𝑅=rref(𝑅) 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 1,…,𝑟 for some 𝑟, and by (R3), their leading entries lie in columns 𝑐1<𝑐2<⋯<𝑐𝑟. We show by induction on 𝑘=0,1,…,𝑟 that after 𝑘 passes of Gauss–Jordan elimination on 𝑅, the current matrix is still 𝑅 and the pivots are the leading entries of rows 1,…,𝑘. For 𝑘=0 there is nothing to show.

Suppose this holds for some 𝑘<𝑟, and consider pass 𝑘+1. Rows 𝑘+2,…,𝑟 have their leading entries in columns 𝑐𝑘+2,…,𝑐𝑟, all to the right of 𝑐𝑘+1, and rows 𝑟+1,…,𝑚 are zero. Together with the leading entry of row 𝑘+1, this shows that rows 𝑘+1,…,𝑚 vanish in columns 1,…,𝑐𝑘+1−1, and that row 𝑘+1 has a nonzero entry in column 𝑐𝑘+1. So step 1 picks 𝑗=𝑐𝑘+1, and step 2 does nothing. By (R2) the entry in position (𝑘+1,𝑐𝑘+1) is already 1, so step 3 changes nothing and declares this leading entry a pivot. By (R4) all other entries of column 𝑐𝑘+1 are 0, so step 4 changes nothing. This completes the induction.

After 𝑟 passes the unpivoted rows are rows 𝑟+1,…,𝑚, which are zero by (R1), so the algorithm halts and outputs 𝑅. Hence rref(𝑅)=𝑅, and the pivots are the leading entries. □

Since rref(𝐴) satisfies (R1)–(R4) by Proposition 3.3.8, Theorem 3.3.12 gives rref(rref(𝐴))=rref(𝐴): running the algorithm a second time changes nothing. The shape described by (R1)–(R4) is a staircase. For instance, every 4×6 matrix in RREF with pivot columns 1,3,6 looks like

(1∗0∗∗0001∗∗0000001000000),

where each ∗ is an arbitrary scalar. The pivot columns are 𝐞1,𝐞2,𝐞3, everything below the staircase is 0, and the non-pivot columns are free above it.

Example 3.3.13 (Matrices in RREF). The identity 𝐼𝑛 and the zero matrix 0∈𝐹𝑚×𝑛 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

(10301−2),(015000010000),(1234),(100).

In the second matrix, the entry 5 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:

(R1):(0010),(R2):(1002),(R3):(0110),(R4):(1101).

In the first, a zero row lies above a nonzero row. In the second, a leading entry is 2. In the third, the leading entry of row 2 lies to the left of that of row 1. In the fourth, the leading entry of row 2 has a nonzero entry above it. The last three have reduced row echelon form 𝐼2, and the first has (1000).

Exercise 3.3.15.routine
  1. (a)Which of the following matrices are in RREF? For each one that is not, name a condition among (R1)–(R4) that fails.

    (100001010),(14020013),(010000001),(10−1010000),(110001001).
  2. (b)Find all 2×2 matrices over a field 𝐹 that are in RREF. How many are there over 𝔽𝑝?

Solution.

Uses. Theorem 3.3.12 (Matrices in RREF)

Hint 1. Locate the leading entry of each row, then check (R1)–(R4) one at a time.
Hint 2. For (b), sort by the number of nonzero rows, and then by the position of the leading entries.
Sketch. (a) In RREF: the second and fourth. The first fails (R3), the third fails (R1), the fifth fails (R4). (b) 0, (1𝑎00) for 𝑎∈𝐹, (0100), and 𝐼2; over 𝔽𝑝 there are 𝑝+3.

(a) By Theorem 3.3.12 we check (R1)–(R4).

  • The first matrix fails (R3): the leading entry of row 3 (column 2) lies to the left of that of row 2 (column 3).
  • The second is in RREF: the leading entries are 1s in columns 1 and 3, and those columns are 𝐞1 and 𝐞2.
  • The third fails (R1): the zero row 2 lies above the nonzero row 3.
  • The fourth is in RREF: leading 1s in columns 1 and 2, which are 𝐞1 and 𝐞2, and the zero row is last.
  • The fifth fails (R4): column 3 contains the leading entry of row 2 and also a nonzero entry in row 3. (It also fails (R3).)

(b) Let 𝑅∈𝐹2×2 be in RREF. If 𝑅 has no nonzero row, 𝑅=0. If it has one, it is row 1 by (R1). Its leading 1 is in column 1 or column 2: in the first case 𝑅=(1𝑎00) with 𝑎∈𝐹 arbitrary (column 2 contains no leading entry, so (R4) says nothing about it), and in the second case 𝑅=(0100). If both rows are nonzero, their leading 1s are in columns 1 and 2 by (R3), and by (R4) 𝑅=𝐼2. All these matrices satisfy (R1)–(R4). Over 𝔽𝑝 there are 1+𝑝+1+1=𝑝+3 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 rref(𝐴), 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 𝐫1,…,𝐫𝑛, entries 𝑟𝑖𝑗, and pivot columns 𝑝1<⋯<𝑝𝑟. Put 𝑝𝑡=𝑛+1 for 𝑡>𝑟.

  1. (a)For 0≤𝑠≤𝑚, every column 𝐫𝑗 with 𝑗<𝑝𝑠+1 has zeros in rows 𝑠+1,…,𝑚. That is, 𝐫𝑗=𝑟1𝑗𝐞1+⋯+𝑟𝑠𝑗𝐞𝑠.
  2. (b)𝐫𝑝𝑠=𝐞𝑠 for 1≤𝑠≤𝑟.
  3. (c)Column 𝑗 is a pivot column if and only if 𝐫𝑗 is not a linear combination of 𝐫1,…,𝐫𝑗−1.
  4. (d)If column 𝑗 is not a pivot column, and 𝑝1,…,𝑝𝑡 are the pivot columns to the left of it, then

    𝐫𝑗=𝑟1𝑗𝐫𝑝1+𝑟2𝑗𝐫𝑝2+⋯+𝑟𝑡𝑗𝐫𝑝𝑡.

Proof.standard

Uses. Theorem 3.3.12 (Matrices in RREF), Proposition 3.3.8 (Properties of the output), Definition 1.3.4 (Linear combination)

Hint 1. For (a), take a row 𝑖≥𝑠+1. Where is its leading entry, if it has one?
Hint 2. For (c), a pivot column 𝐫𝑝𝑠=𝐞𝑠 has a 1 in row 𝑠. What is the entry in row 𝑠 of every earlier column, and of every combination of them?
Hint 3. For (d), apply (a) with 𝑠=𝑡 and substitute 𝐞𝑠=𝐫𝑝𝑠.
Sketch. (a) A row 𝑖>𝑠 is zero or has its leading entry in column 𝑝𝑖≥𝑝𝑠+1>𝑗. (b) is (R2) with (R4). For (c), columns before 𝑝𝑠 vanish in row 𝑠 by (a), and so do their combinations, while 𝐫𝑝𝑠=𝐞𝑠 does not. For a non-pivot column 𝑗 with 𝑡 pivot columns before it, 𝑗<𝑝𝑡+1, so (a) and (b) give (d), which exhibits 𝐫𝑗 as a combination of earlier columns.

By Theorem 3.3.12, 𝑅 satisfies (R1)–(R4) and its pivots are its leading entries: the leading entry of row 𝑠 is a 1 in column 𝑝𝑠 for 𝑠≤𝑟, and rows 𝑟+1,…,𝑚 are zero.

(a) Let 𝑗<𝑝𝑠+1 and 𝑖≥𝑠+1. If 𝑖≤𝑟, the leading entry of row 𝑖 is in column 𝑝𝑖≥𝑝𝑠+1>𝑗, so 𝑟𝑖𝑗=0. If 𝑖>𝑟, row 𝑖 is zero. So 𝑟𝑖𝑗=0 for all 𝑖≥𝑠+1.

(b) Column 𝑝𝑠 contains the leading entry of row 𝑠, which is 1 by (R2), and its other entries are 0 by (R4).

(c), (d) Suppose first that 𝑗=𝑝𝑠 is a pivot column. By (a), applied with 𝑠−1, every column 𝐫𝑙 with 𝑙<𝑗 has entry 0 in row 𝑠, and therefore so does every linear combination of 𝐫1,…,𝐫𝑗−1. But 𝐫𝑗=𝐞𝑠 has entry 1 in row 𝑠. So 𝐫𝑗 is not such a combination.

Now suppose 𝑗 is not a pivot column, and let 𝑝1,…,𝑝𝑡 be the pivot columns to its left (𝑡=0 if there are none). Then 𝑝𝑡+1>𝑗, so by (a) and (b),

𝐫𝑗=𝑟1𝑗𝐞1+⋯+𝑟𝑡𝑗𝐞𝑡=𝑟1𝑗𝐫𝑝1+⋯+𝑟𝑡𝑗𝐫𝑝𝑡.

This is (d), and since 𝑝1,…,𝑝𝑡<𝑗, it shows that 𝐫𝑗 is a combination of earlier columns. (For 𝑡=0, 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 𝐞1,𝐞2,… 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 𝐞1,…,𝐞𝑟. Then 𝐺 fixes every vector in span(𝐞1,…,𝐞𝑟), 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).

Theorem 3.3.17 (Uniqueness of the reduced row echelon form). Let 𝑅,𝑅′∈𝐹𝑚×𝑛 be in RREF, and suppose 𝑅′=𝐺𝑅 for some invertible 𝐺∈𝐹𝑚×𝑚. Then 𝑅′=𝑅.

Proof (pivot by pivot).hard

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)

Hint 1. Let 𝐠1,…,𝐠𝑚 be the columns of 𝐺. Column 𝑗 of 𝑅′ is 𝐺𝐫𝑗=𝑟1𝑗𝐠1+⋯+𝑟𝑚𝑗𝐠𝑚. Why are the 𝐠𝑖 linearly independent?
Hint 2. Let 𝑝𝑠 and 𝑞𝑠 be the pivot columns of 𝑅 and 𝑅′ (with value 𝑛+1 when there are fewer than 𝑠 pivots). Prove by induction on 𝑠 that 𝑝𝑠=𝑞𝑠, and that 𝐠𝑠=𝐞𝑠 when 𝑝𝑠≤𝑛.
Hint 3. If 𝑝𝑠<𝑞𝑠, compute column 𝑝𝑠 of 𝑅′ in two ways: as 𝐺𝐞𝑠=𝐠𝑠, and with Lemma 3.3.16(a) for 𝑅′. If 𝑞𝑠<𝑝𝑠, compute column 𝑞𝑠 of 𝑅′ in two ways and look at its 𝑠th entry.
Sketch. The columns 𝐠𝑖 of 𝐺 are independent since 𝐺𝐜=𝟎 forces 𝐜=𝟎. By induction on 𝑠: if 𝑝𝑠<𝑞𝑠, then 𝐠𝑠=𝐺𝐞𝑠 is column 𝑝𝑠 of 𝑅′, which lies in the span of 𝐞1,…,𝐞𝑠−1, that is, of 𝐠1,…,𝐠𝑠−1: a contradiction. If 𝑞𝑠<𝑝𝑠, column 𝑞𝑠 of 𝑅 lies in span(𝐞1,…,𝐞𝑠−1), and 𝐺 fixes that span, so column 𝑞𝑠 of 𝑅′ has 𝑠th entry 0, not 𝐞𝑠. So 𝑝𝑠=𝑞𝑠, and then 𝐠𝑠=𝐺𝐞𝑠=𝐞𝑠. Finally every column of 𝑅 lies in span(𝐞1,…,𝐞𝑟), which 𝐺 fixes.

Write 𝐫𝑗, 𝐫𝑗′, and 𝐠𝑖 for the columns of 𝑅, 𝑅′, and 𝐺, and 𝑝1<⋯<𝑝𝑟 and 𝑞1<⋯<𝑞𝑟′ for the pivot columns of 𝑅 and 𝑅′. Put 𝑝𝑠=𝑛+1 for 𝑠>𝑟 and 𝑞𝑠=𝑛+1 for 𝑠>𝑟′. We use two facts.

  • By Definition 2.3.8, column 𝑗 of 𝑅′ is

    𝐫𝑗′=𝐺𝐫𝑗=𝑟1𝑗𝐠1+⋯+𝑟𝑚𝑗𝐠𝑚.

    In particular 𝐺𝐞𝑖=𝐠𝑖.

  • The columns of 𝐺 are linearly independent: if 𝑐1𝐠1+⋯+𝑐𝑚𝐠𝑚=𝟎, then 𝐺𝐜=𝟎 for 𝐜=(𝑐1,…,𝑐𝑚), so 𝐜=𝐺−1𝐺𝐜=𝟎.

We prove by induction on 𝑠=1,2,…,𝑚 that

𝑝𝑠=𝑞𝑠,and𝐠𝑠=𝐞𝑠if𝑝𝑠≤𝑛.

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), 𝐫𝑝𝑠′=𝐺𝐫𝑝𝑠=𝐺𝐞𝑠=𝐠𝑠. On the other hand 𝑝𝑠<𝑞𝑠, so by Lemma 3.3.16(a) for 𝑅′, the column 𝐫𝑝𝑠′ lies in span(𝐞1,…,𝐞𝑠−1), which is span(𝐠1,…,𝐠𝑠−1). So 𝐠𝑠 is a linear combination of 𝐠1,…,𝐠𝑠−1, contradicting the independence of the columns of 𝐺.

Suppose 𝑞𝑠<𝑝𝑠. Then 𝑞𝑠≤𝑛, so 𝑠≤𝑟′, and for 𝑡<𝑠, 𝑞𝑡<𝑞𝑠≤𝑛; by the induction hypothesis 𝑝𝑡=𝑞𝑡≤𝑛 and 𝐠𝑡=𝐞𝑡. By Lemma 3.3.16(a) for 𝑅, 𝐫𝑞𝑠=∑𝑡<𝑠𝑟𝑡𝑞𝑠𝐞𝑡, so

𝐫𝑞𝑠′=𝐺𝐫𝑞𝑠=∑𝑡<𝑠𝑟𝑡𝑞𝑠𝐠𝑡=∑𝑡<𝑠𝑟𝑡𝑞𝑠𝐞𝑡,

whose 𝑠th entry is 0. 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, 𝐞𝑠=𝐫𝑝𝑠′=𝐺𝐫𝑝𝑠=𝐺𝐞𝑠=𝐠𝑠. This completes the induction.

In particular 𝑟=𝑟′, since 𝑟 is the number of 𝑠 with 𝑝𝑠≤𝑛, and 𝐠𝑠=𝐞𝑠 for 𝑠≤𝑟. Finally, let 𝑗 be any column. By Lemma 3.3.16(a) with 𝑠=𝑟, 𝐫𝑗=∑𝑡≤𝑟𝑟𝑡𝑗𝐞𝑡, so

𝐫𝑗′=𝐺𝐫𝑗=∑𝑡≤𝑟𝑟𝑡𝑗𝐠𝑡=∑𝑡≤𝑟𝑟𝑡𝑗𝐞𝑡=𝐫𝑗.

So 𝑅′=𝑅, as desired. □

Proof (via relations among columns).hard

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)

Hint 1. By Corollary 3.2.17, 𝑅 and 𝑅′=𝐺𝑅 satisfy the same linear relations among their columns. Use only this.
Hint 2. By Lemma 3.3.16(c), being a pivot column is a statement about relations among the columns. Conclude that 𝑅 and 𝑅′ have the same pivot columns.
Hint 3. A non-pivot column of 𝑅 satisfies the relation of Lemma 3.3.16(d). Transfer that relation to 𝑅′.
Sketch. The columns satisfy ∑𝑙𝑥𝑙𝐫𝑙=𝟎⇔∑𝑙𝑥𝑙𝐫𝑙′=𝟎. “Column 𝑗 is a combination of earlier columns” is such a relation, so by Lemma 3.3.16(c) the pivot columns agree, and pivot columns are 𝐞𝑠 in both. A non-pivot column satisfies 𝐫𝑗=∑𝑠𝑟𝑠𝑗𝐫𝑝𝑠; the same relation in 𝑅′ gives 𝐫𝑗′=∑𝑠𝑟𝑠𝑗𝐞𝑠=𝐫𝑗.

Let 𝐫𝑗 and 𝐫𝑗′=𝐺𝐫𝑗 be the columns of 𝑅 and 𝑅′. By Corollary 3.2.17, for all 𝑥1,…,𝑥𝑛∈𝐹,

𝑥1𝐫1+⋯+𝑥𝑛𝐫𝑛=𝟎⇔𝑥1𝐫1′+⋯+𝑥𝑛𝐫𝑛′=𝟎.
(3.3.2)

We show that (3.3.2) alone forces 𝑅=𝑅′.

The pivot columns agree. For scalars 𝑐1,…,𝑐𝑗−1, the equation

𝐫𝑗=𝑐1𝐫1+⋯+𝑐𝑗−1𝐫𝑗−1

is the relation in (3.3.2) with 𝑥𝑙=𝑐𝑙 for 𝑙<𝑗, 𝑥𝑗=−1, and 𝑥𝑙=0 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 𝑝1<⋯<𝑝𝑟 be the common pivot columns.

The columns agree. By Lemma 3.3.16(b), 𝐫𝑝𝑠=𝐞𝑠=𝐫𝑝𝑠′ for each 𝑠. Let 𝑗 be a non-pivot column, with pivot columns 𝑝1,…,𝑝𝑡 to its left. By Lemma 3.3.16(d) for 𝑅,

𝐫𝑗=𝑟1𝑗𝐫𝑝1+⋯+𝑟𝑡𝑗𝐫𝑝𝑡.

This is a relation among the columns of 𝑅, so by (3.3.2) the same relation holds in 𝑅′:

𝐫𝑗′=𝑟1𝑗𝐫𝑝1′+⋯+𝑟𝑡𝑗𝐫𝑝𝑡′=𝑟1𝑗𝐞1+⋯+𝑟𝑡𝑗𝐞𝑡=𝐫𝑗,

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 𝐞1,…,𝐞𝑟, 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 ker𝑇𝑅=ker𝑇𝑅′, and we will exploit this in Corollary 3.3.20.

Corollary 3.3.18 (RREF and row equivalence). Let 𝐴,𝐵∈𝐹𝑚×𝑛.

  1. (a)rref(𝐺𝐴)=rref(𝐴) for every invertible 𝐺∈𝐹𝑚×𝑚.
  2. (b)𝐴∼𝐵 if and only if rref(𝐴)=rref(𝐵).
  3. (c)If 𝑅 is in RREF and 𝐴∼𝑅, then 𝑅=rref(𝐴). 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 rref(𝐴).

Proof.standard

Uses. Theorem 3.3.17 (Uniqueness of the reduced row echelon form), Theorem 3.3.10 (𝐺𝐴=rref(𝐴)), 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)

Hint 1. For (a), write rref(𝐴)=𝑁𝐴 and rref(𝐺𝐴)=𝑀𝐺𝐴 with 𝑀, 𝑁 invertible, and express rref(𝐺𝐴) as an invertible matrix times rref(𝐴).
Hint 2. For (b), use (a) in one direction, and 𝐴∼rref(𝐴) with symmetry and transitivity of ∼ in the other.
Sketch. (a) rref(𝐺𝐴)=(𝑀𝐺𝑁−1)rref(𝐴), both sides are in RREF, and 𝑀𝐺𝑁−1 is invertible, so Theorem 3.3.17 applies. (b) If 𝐵=𝐸𝑘⋯𝐸1𝐴, apply (a). If rref(𝐴)=rref(𝐵), then 𝐴∼rref(𝐴)=rref(𝐵)∼𝐵. (c) is (b) with 𝐵=𝑅, since rref(𝑅)=𝑅; matrices satisfying (R1)–(R4) are in RREF by Theorem 3.3.12.

(a) By Theorem 3.3.10 there are invertible 𝑁,𝑀∈𝐹𝑚×𝑚 with rref(𝐴)=𝑁𝐴 and rref(𝐺𝐴)=𝑀(𝐺𝐴). Then

rref(𝐺𝐴)=𝑀𝐺𝐴=(𝑀𝐺𝑁−1)(𝑁𝐴)=(𝑀𝐺𝑁−1)rref(𝐴),

and 𝑀𝐺𝑁−1 is invertible, with inverse 𝑁𝐺−1𝑀−1. Both rref(𝐺𝐴) and rref(𝐴) are in RREF (by Proposition 3.3.8 and Theorem 3.3.12), so Theorem 3.3.17 gives rref(𝐺𝐴)=rref(𝐴).

(b) If 𝐴∼𝐵, then 𝐵=𝐺𝐴 with 𝐺=𝐸𝑘⋯𝐸1 a product of elementary matrices, which is invertible, so rref(𝐵)=rref(𝐴) by (a). Conversely, suppose rref(𝐴)=rref(𝐵). By Theorem 3.3.10, 𝐴∼rref(𝐴) and 𝐵∼rref(𝐵), so by symmetry and transitivity (Proposition 3.2.22), 𝐴∼rref(𝐴)=rref(𝐵)∼𝐵.

(c) If 𝑅 is in RREF, then rref(𝑅)=𝑅, and 𝐴∼𝑅 gives rref(𝐴)=rref(𝑅)=𝑅 by (b). A sequence of row operations that turns 𝐴 into a matrix 𝑅 satisfying (R1)–(R4) shows 𝐴∼𝑅, and 𝑅 is in RREF by Theorem 3.3.12. □

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 rref(𝐴). 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 𝐚1,…,𝐚𝑛, and let 𝑟𝑖𝑗 be the entries of rref(𝐴).

  1. (a)Column 𝑗 is a pivot column of 𝐴 if and only if 𝐚𝑗 is not a linear combination of 𝐚1,…,𝐚𝑗−1.
  2. (b)If column 𝑗 is not a pivot column and 𝑝1,…,𝑝𝑡 are the pivot columns to its left, then

    𝐚𝑗=𝑟1𝑗𝐚𝑝1+⋯+𝑟𝑡𝑗𝐚𝑝𝑡.

Proof.routine

Uses. Theorem 3.3.10 (𝐺𝐴=rref(𝐴)), Corollary 3.2.17 (Row operations preserve relations among columns), Lemma 3.3.16 (Reading the columns of a matrix in RREF)

Hint 1. Write rref(𝐴)=𝐺𝐴. How are the columns of rref(𝐴) related to those of 𝐴, and which relations do they share?
Hint 2. Combine Corollary 3.2.17(b) with Lemma 3.3.16(c) and (d).
Sketch. With rref(𝐴)=𝐺𝐴 and 𝐺 invertible, the columns 𝐫𝑙=𝐺𝐚𝑙 satisfy the same relations as the 𝐚𝑙. So 𝐚𝑗 is a combination of earlier columns, with given coefficients, exactly when 𝐫𝑗 is; now apply Lemma 3.3.16(c) and (d).
By Theorem 3.3.10, rref(𝐴)=𝐺𝐴 with 𝐺 invertible, so the columns of rref(𝐴) are 𝐫𝑙=𝐺𝐚𝑙. By Corollary 3.2.17(b), applied with 𝑐𝑙=0 for 𝑙>𝑗, we have 𝐚𝑗=∑𝑙<𝑗𝑐𝑙𝐚𝑙 if and only if 𝐫𝑗=∑𝑙<𝑗𝑐𝑙𝐫𝑙. So 𝐚𝑗 is a combination of 𝐚1,…,𝐚𝑗−1 if and only if 𝐫𝑗 is a combination of 𝐫1,…,𝐫𝑗−1, and (a) follows from Lemma 3.3.16(c). Similarly, (b) follows from the relation of Lemma 3.3.16(d). □

For the matrix of Example 3.3.3, the pivot columns are 1 and 3, and Corollary 3.3.19(b) reads off 𝐚2=2𝐚1 and 𝐚4=−2𝐚1+2𝐚3 from the entries of rref(𝐴). Indeed −2(0,2,1)+2(2,2,3)=(4,0,4). Chapter 4 uses this description to extract bases from spanning lists.

Finally, we can prove the converse promised in Remark 3.2.25.

Corollary 3.3.20 (The kernel is a complete invariant). For 𝐴,𝐵∈𝐹𝑚×𝑛, the following are equivalent:
  1. (i)𝐴∼𝐵;
  2. (ii)rref(𝐴)=rref(𝐵);
  3. (iii)ker𝑇𝐴=ker𝑇𝐵.

Proof.standard

Uses. Corollary 3.3.18 (RREF and row equivalence), Corollary 3.2.23 (Row equivalent matrices have the same kernel), Theorem 3.3.10 (𝐺𝐴=rref(𝐴)), 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)

Hint 1. (i) ⇔ (ii) is Corollary 3.3.18(b), and (i) ⇒ (iii) is Corollary 3.2.23. Only (iii) ⇒ (ii) is new.
Hint 2. Reduce to RREF: ker𝑇rref(𝐴)=ker𝑇𝐴. What does 𝐱∈ker𝑇𝑅 say about the columns of 𝑅?
Hint 3. Reread the second proof of Theorem 3.3.17. Which hypothesis did it really use?
Sketch. If ker𝑇𝐴=ker𝑇𝐵, then 𝑅=rref(𝐴) and 𝑅′=rref(𝐵) have the same kernel by Corollary 3.2.23. By Definition 2.3.8, 𝐱∈ker𝑇𝑅 says 𝑥1𝐫1+⋯+𝑥𝑛𝐫𝑛=𝟎, so 𝑅 and 𝑅′ satisfy the same linear relations among their columns. The second proof of Theorem 3.3.17 used nothing else, so 𝑅=𝑅′.

(i) ⇔ (ii) is Corollary 3.3.18(b), and (i) ⇒ (iii) is Corollary 3.2.23. We prove (iii) ⇒ (ii).

Suppose ker𝑇𝐴=ker𝑇𝐵, and let 𝑅=rref(𝐴) and 𝑅′=rref(𝐵). By Theorem 3.3.10 and Corollary 3.2.23, ker𝑇𝑅=ker𝑇𝐴=ker𝑇𝐵=ker𝑇𝑅′. By Definition 2.3.8, 𝑅𝐱=𝑥1𝐫1+⋯+𝑥𝑛𝐫𝑛, so ker𝑇𝑅=ker𝑇𝑅′ says exactly that for all 𝑥1,…,𝑥𝑛∈𝐹,

𝑥1𝐫1+⋯+𝑥𝑛𝐫𝑛=𝟎⇔𝑥1𝐫1′+⋯+𝑥𝑛𝐫𝑛′=𝟎,

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 rref(𝐴) is a canonical representative of that class. For example, a 2×3 matrix 𝐴 has ker𝑇𝐴=span((1,1,1)) if and only if rref(𝐴)=(10−101−1) (Exercise 3.3.49).

Exercise 3.3.21.routine Decide which two of the following real matrices are row equivalent:

𝐴=(123247),𝐵=(001122),𝐶=(123369).

Solution.

Uses. Corollary 3.3.18 (RREF and row equivalence), Algorithm 3.3.1 (Gauss–Jordan elimination)

Hint 1. By Corollary 3.3.18(b), compare reduced row echelon forms.
Hint 2. 𝐶 has a row that is a multiple of the other, so it has one pivot.
Sketch. rref(𝐴)=rref(𝐵)=(120001) and rref(𝐶)=(123000), so 𝐴∼𝐵, and 𝐶 is row equivalent to neither.
For 𝐴: adding −2 times row 1 to row 2 gives (123001), and adding −3 times row 2 to row 1 gives (120001). For 𝐵: swapping the rows gives (122001), and adding −2 times row 2 to row 1 gives (120001). For 𝐶: adding −3 times row 1 to row 2 gives (123000). Each result satisfies (R1)–(R4), so by Corollary 3.3.18(c) these are the reduced row echelon forms. By Corollary 3.3.18(b), 𝐴∼𝐵, while 𝐶 is row equivalent to neither.

3.3.5Inverses by row reduction

For a square matrix 𝐴, row reduction decides whether 𝐴 is invertible and, if it is, computes 𝐴−1. 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 ker𝑇𝐴 (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 rref(𝐴)=𝐺𝐴 (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 ker𝑇𝐴, 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).

Theorem 3.3.23 (Invertibility and RREF). Let 𝐴∈𝐹𝑛×𝑛, and let 𝐺 be a product of elementary matrices with 𝐺𝐴=rref(𝐴) (Theorem 3.3.10). Then 𝐴 is invertible if and only if rref(𝐴)=𝐼𝑛, and in that case 𝐴−1=𝐺.

Proof.standard

Uses. Theorem 3.3.10 (𝐺𝐴=rref(𝐴)), 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)

Hint 1. If rref(𝐴)=𝐼𝑛, then 𝐺𝐴=𝐼𝑛 with 𝐺 invertible. Why does this make 𝐺 a two-sided inverse of 𝐴?
Hint 2. Conversely, a square matrix in RREF with 𝑛 pivots is 𝐼𝑛. If there are fewer pivots, what does the last row look like?
Hint 3. A matrix whose last row is zero has no right inverse. If 𝐴 were invertible, would 𝐺𝐴 be?
Sketch. If 𝐺𝐴=𝐼𝑛, then 𝐴=𝐺−1, so 𝐴𝐺=𝐼𝑛 too and 𝐴−1=𝐺. If 𝑅=rref(𝐴) has 𝑛 pivots, its pivot columns are 1,…,𝑛 and 𝑅=𝐼𝑛. Otherwise its last row is zero, so the last row of 𝑅𝑋 is zero for every 𝑋 and 𝑅 is not invertible; but if 𝐴 were invertible, 𝑅=𝐺𝐴 would be.

Suppose rref(𝐴)=𝐼𝑛, so 𝐺𝐴=𝐼𝑛. Since 𝐺 is invertible (Corollary 3.2.11), multiplying on the left by 𝐺−1 gives 𝐴=𝐺−1. Hence 𝐴𝐺=𝐺−1𝐺=𝐼𝑛 as well, so 𝐴 is invertible with 𝐴−1=𝐺.

Conversely, suppose 𝑅=rref(𝐴)≠𝐼𝑛, and let 𝑝1<⋯<𝑝𝑟 be its pivot columns. If 𝑟=𝑛, then 𝑝1,…,𝑝𝑛 are 𝑛 increasing numbers among 1,…,𝑛, 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 ∑𝑘𝑟𝑛𝑘𝑥𝑘𝑙=0, so 𝑅𝑋≠𝐼𝑛; thus 𝑅 is not invertible. If 𝐴 were invertible, then 𝑅=𝐺𝐴 would be invertible, with inverse 𝐴−1𝐺−1. 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
𝐴−1, or the conclusion that 𝐴 is not invertible.

1.

Form the 𝑛×2𝑛 matrix (𝐴|𝐼𝑛).

2.

Row reduce it with Gauss–Jordan elimination, scanning only the first 𝑛 columns in step 1 of Algorithm 3.3.1. The result is (rref(𝐴)|𝐺).

3.

If the left block is 𝐼𝑛, output 𝐴−1=𝐺. Otherwise 𝐴 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 𝐴.

Intuition (Why carrying 𝐼𝑛 along works). Column 𝑗 of 𝐴−1 is the solution of 𝐴𝐱=𝐞𝑗, since 𝐴(𝐴−1𝐞𝑗)=𝐞𝑗. So inverting 𝐴 means solving the 𝑛 systems 𝐴𝐱=𝐞1,…,𝐴𝐱=𝐞𝑛, which share the coefficient matrix 𝐴. Row reducing (𝐴|𝐼𝑛) solves all of them at once: when the left block becomes 𝐼𝑛, the system 𝐴𝐱=𝐞𝑗 has become 𝐼𝑛𝐱=𝐺𝐞𝑗 (Proposition 3.2.14), whose solution, column 𝑗 of 𝐺, can be read off.

Example 3.3.25 (Inverting a 3×3 matrix). Let

𝐴=(021110210)∈ℚ3×3.

Swapping rows 1 and 2 of (𝐴|𝐼3) and then adding −2 times row 1 to row 3 finishes pass 1:

(021100110010210001)⟶𝐸12(110010021100210001)
⟶𝐸1,−2,3(1100100211000−100−21).

Pass 2 scales row 2 by 1/2 and clears column 2 with 𝐸2,−1,1 and 𝐸2,1,3; pass 3 scales row 3 by 2 and clears column 3 with 𝐸3,1/2,1 and 𝐸3,−1/2,2:

⟶(10−1/2−1/210011/21/200001/21/2−21)
⟶(1000−1101002−10011−42).

The left block is 𝐼3, so 𝐴 is invertible and

𝐴−1=(0−1102−11−42).

As a check, the first row of 𝐴 times the columns of 𝐴−1 gives (0+0+1,0+4−4,0−2+2)=(1,0,0), and similarly for the other rows. Fractions appeared along the way even though 𝐴 and 𝐴−1 have integer entries; Exercise 3.3.61 explains when integer arithmetic suffices.

(𝐴|𝐼3)⇝(1000−1101002−10011−42)
Inverting the matrix of Example 3.3.25: (𝐴|𝐼3) is row reduced, with pivots sought only in the left block. Edit the left block to try other matrices; when it does not reduce to 𝐼3, the summary says that 𝐴 is not invertible.

Example 3.3.26 (A matrix that is not invertible). Let 𝐴∈ℚ3×3 have rows (1,2,3), (4,5,6), (7,8,9). The algorithm gives

(𝐴|𝐼3)⇝(10−1−5/32/300124/3−1/300001−21).

The left block is not 𝐼3, so 𝐴 is not invertible. The last row of 𝐺 says more: since the last row of 𝐺𝐴 is zero, row 1 of 𝐴 minus twice row 2 plus row 3 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.routine Let

𝐴=(120011101).

Use Algorithm 3.3.24 to decide whether 𝐴 is invertible over ℚ, and over 𝔽3, and find 𝐴−1 when it exists.

Solution.

Uses. Algorithm 3.3.24 (Inverting a matrix by row reduction), Theorem 3.3.23 (Invertibility and RREF)

Hint 1. The two computations agree until some pivot has to be divided by. Which number is it?
Hint 2. Over ℚ, pass 3 divides row 3 by 3. In 𝔽3, 3=0.
Sketch. After two passes, valid over any field, the third row of (𝐴|𝐼3) is (0,0,3|−1,2,1). Over ℚ, 3 is a pivot, and 3𝐴−1 has rows (1,−2,2), (1,1,−1), (−1,2,1). Over 𝔽3 the third row of the left block is zero, so 𝐴 is not invertible.

Pass 1 adds −1 times row 1 to row 3; pass 2 adds −2 times row 2 to row 1 and 2 times row 2 to row 3. This is the same over any field:

(120100011010101001)⇝(1201000110100−21−101)
⇝(10−21−20011010003−121).

Over ℚ. Pass 3 scales row 3 by 1/3 and then adds 2 times row 3 to row 1 and −1 times row 3 to row 2:

⇝(1001/3−2/32/30101/31/3−1/3001−1/32/31/3).

So 𝐴 is invertible over ℚ and

𝐴−1=13(1−2211−1−121).

Check: the first row of 𝐴 times the columns of 3𝐴−1 gives (1+2,−2+2,2−2)=(3,0,0), and similarly for the others.

Over 𝔽3. Here 3=0, so the last row of the left block above is zero, and the algorithm stops: 𝐴 is not invertible over 𝔽3. (Indeed, in the computation above, the last row of the right block gives −1 times row 1 of 𝐴 plus 2 times row 2 plus row 3, which is (−1+0+1,−2+2+0,0+2+1)=(0,0,3), and 3=0 in 𝔽3.)

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.

Definition 3.3.28 (Row echelon form). A matrix 𝑈∈𝐹𝑚×𝑛 is in row echelon form if it satisfies (R1) and (R3): every zero row lies below every nonzero row, and the leading entry of each nonzero row lies strictly to the right of the leading entry of every row above it. The leading entries of the nonzero rows are the pivots of 𝑈. A row echelon form of 𝐴 is a matrix in row echelon form that is row equivalent to 𝐴.

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 𝐴.

Example 3.3.29 (Row echelon forms are not unique). Let 𝐴=(1234) over ℚ. Gaussian elimination gives (120−2). Swapping the rows first and then clearing gives (3402/3), and rref(𝐴)=𝐼2 is also a row echelon form of 𝐴. All three have their pivots in columns 1 and 2.

The pivot positions, unlike the entries, are always the same.

Proposition 3.3.30 (Pivots of row echelon forms). If 𝑈 is a row echelon form of 𝐴, then the columns containing the pivots of 𝑈 are the pivot columns of 𝐴.

Proof.standard

Uses. Corollary 3.3.18 (RREF and row equivalence), Theorem 3.3.12 (Matrices in RREF)

Hint 1. Turn 𝑈 into a matrix in RREF by row operations that do not move any leading entry.
Hint 2. Scale each nonzero row by the inverse of its leading entry. Then clear above the pivots, one pivot at a time. Check that clearing column 𝑐𝑠 never disturbs a leading entry or a column cleared earlier.
Sketch. Scaling makes the leading entries 1. Clearing above the pivots (say from the last one up) only adds multiples of a pivot row to rows above it, which changes those rows only to the right of their own leading entries, and never refills a column already cleared, since a pivot row is zero in the columns of later pivots once those are cleared. The result satisfies (R1)–(R4), has the same leading positions as 𝑈, and is row equivalent to 𝐴, so it is rref(𝐴).
Let rows 1,…,𝑟 be the nonzero rows of 𝑈, with leading entries in columns 𝑐1<⋯<𝑐𝑟. First scale each row 𝑠≤𝑟 by the inverse of its leading entry. Then, for 𝑠=𝑟,𝑟−1,…,1 in this order, add suitable multiples of row 𝑠 to rows 1,…,𝑠−1 so that column 𝑐𝑠 has zeros above row 𝑠. Row 𝑠 vanishes in the columns before 𝑐𝑠, so adding a multiple of it to a row 𝑖<𝑠 changes row 𝑖 only in columns 𝑐𝑠,…,𝑛, all to the right of 𝑐𝑖. Moreover, when we process 𝑠, row 𝑠 has already been cleared in the columns 𝑐𝑠+1,…,𝑐𝑟 (it lies above those pivots), so the columns cleared earlier are not disturbed. The final matrix 𝑅 therefore satisfies (R1)–(R4) with leading entries in columns 𝑐1,…,𝑐𝑟, and it is row equivalent to 𝑈, hence to 𝐴. By Corollary 3.3.18(c), 𝑅=rref(𝐴), so 𝑐1,…,𝑐𝑟 are the pivot columns of 𝐴 (Theorem 3.3.12). □

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 rref(𝐴) 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.

Definition 3.3.31 (Triangular matrices). A matrix 𝐿∈𝐹𝑛×𝑛 is lower triangular if 𝑙𝑖𝑗=0 whenever 𝑖<𝑗, and unit lower triangular if moreover 𝑙𝑖𝑖=1 for every 𝑖. Upper triangular and unit upper triangular matrices are defined in the same way with 𝑖>𝑗. A diagonal matrix is one that is both.
Lemma 3.3.32 (Products and inverses of triangular matrices).
  1. (a)If 𝐿,𝐿′∈𝐹𝑛×𝑛 are lower triangular, then so is 𝐿𝐿′, and (𝐿𝐿′)𝑖𝑖=𝑙𝑖𝑖𝑙𝑖𝑖′.
  2. (b)A unit lower triangular matrix is invertible, and its inverse is unit lower triangular.
  3. (c)The same statements hold for upper triangular matrices.

Proof.standard

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)

Hint 1. For (a), in (𝐿𝐿′)𝑖𝑗=∑𝑘𝑙𝑖𝑘𝑙𝑘𝑗′, which 𝑘 can give a nonzero term?
Hint 2. For (b), reduce 𝐿 to 𝐼𝑛 by clearing below the diagonal one column at a time, from left to right, and check that every elementary matrix used is unit lower triangular.
Sketch. (a) A term 𝑙𝑖𝑘𝑙𝑘𝑗′ can be nonzero only if 𝑗≤𝑘≤𝑖. (b) When column 𝑠 is processed, row 𝑠 is 𝐞𝑠𝖳, so adding multiples of it to the rows below only kills the entries below the diagonal in column 𝑠. This gives 𝐺𝐿=𝐼𝑛 with 𝐺 a product of matrices 𝐸𝑠𝑐𝑖, 𝑠<𝑖, which are unit lower triangular; so 𝐿−1=𝐺 is unit lower triangular by (a). (c) Transpose.

(a) We have (𝐿𝐿′)𝑖𝑗=∑𝑘𝑙𝑖𝑘𝑙𝑘𝑗′, and 𝑙𝑖𝑘𝑙𝑘𝑗′ can be nonzero only if 𝑘≤𝑖 and 𝑘≥𝑗. If 𝑖<𝑗 there is no such 𝑘, so (𝐿𝐿′)𝑖𝑗=0. If 𝑖=𝑗, only 𝑘=𝑖 contributes, giving 𝑙𝑖𝑖𝑙𝑖𝑖′.

(b) Let 𝐿 be unit lower triangular. For 𝑠=1,…,𝑛−1 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 1,…,𝑠−1 equal to 𝐞1,…,𝐞𝑠−1. This holds for 𝑠=1. If it holds for 𝑠, then row 𝑠 has zeros in columns 1,…,𝑠−1 (as those columns are 𝐞1,…,𝐞𝑠−1), a 1 in column 𝑠, and zeros after it; so row 𝑠 is 𝐞𝑠𝖳. Adding a multiple of it to row 𝑖>𝑠 changes only the (𝑖,𝑠) entry, which becomes 0. So afterwards column 𝑠 is 𝐞𝑠 and the claim holds for 𝑠+1. 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), 𝐿=𝐺−1, and 𝐿−1=𝐺.

(c) A matrix is (unit) upper triangular if and only if its transpose is (unit) lower triangular. If 𝑈,𝑈′ are upper triangular, then 𝑈𝑈′=(𝑈′𝖳𝑈𝖳)𝖳 by Proposition 2.4.23, which is upper triangular by (a), with the same diagonal entries. If 𝑈 is unit upper triangular, then 𝑈𝖳 has a unit lower triangular inverse 𝑉 by (b), and transposing 𝑈𝖳𝑉=𝑉𝑈𝖳=𝐼𝑛 shows that 𝑉𝖳, which is unit upper triangular, is the inverse of 𝑈. □

A permutation matrix is a product of swap matrices 𝐸𝑖𝑗 (equivalently, a matrix with exactly one 1 in each row and each column and zeros elsewhere; see Definition 5.2.29).

Theorem 3.3.33 (PLU and LU factorizations). Let 𝐴∈𝐹𝑚×𝑛.

  1. (a)There are a permutation matrix 𝑃∈𝐹𝑚×𝑚, a unit lower triangular 𝐿∈𝐹𝑚×𝑚, and a matrix 𝑈∈𝐹𝑚×𝑛 in row echelon form such that 𝑃𝐴=𝐿𝑈.
  2. (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 0 if there is no pass 𝑠).

Proof.hard

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 𝑚

Hint 1. Induct on the number of rows. Perform the first pass of Gaussian elimination and write the result in block form.
Hint 2. After moving a row with a nonzero entry 𝑎 in the first nonzero column 𝑗 to the top, write the first pass of Gaussian elimination as a factorization 𝑃1𝐴=(10ℓ𝐼)(0𝑎𝐰00𝐴′).
Hint 3. Apply the induction hypothesis 𝑃′𝐴′=𝐿′𝑈′ and assemble 𝑃, 𝐿, 𝑈 in block form. Where does 𝑃′ have to act on ℓ?
Sketch. Bring a nonzero entry 𝑎 of the first nonzero column 𝑗 to the top with a swap 𝑃1. With 𝐛 the rest of column 𝑗 and ℓ=𝑎−1𝐛, 𝑃1𝐴=(10ℓ𝐼)(0𝑎𝐰00𝐴′), the first pass of elimination. If 𝑃′𝐴′=𝐿′𝑈′, then 𝑃=(100𝑃′)𝑃1, 𝐿=(10𝑃′ℓ𝐿′), 𝑈=(0𝑎𝐰00𝑈′) work, by block multiplication. Without swaps 𝑃=𝐼𝑚, and the columns of 𝐿 are the multipliers, pass by pass.

(a) We induct on 𝑚. If 𝑚=1, take 𝑃=𝐿=(1) and 𝑈=𝐴; a single row is in row echelon form. Let 𝑚≥2. If 𝐴=0, take 𝑃=𝐿=𝐼𝑚 and 𝑈=0. Otherwise, let 𝑗 be the first nonzero column of 𝐴, choose a row 𝑖 with 𝑎𝑖𝑗≠0, and let 𝑃1=𝐸1𝑖 (or 𝑃1=𝐼𝑚 if 𝑖=1). Then 𝐵=𝑃1𝐴 has first 𝑗−1 columns zero and a nonzero entry 𝑎=𝑏1𝑗. Write

𝐵=(0𝑎𝐰0𝐛𝐵′),

where the zero blocks have 𝑗−1 columns, 𝐛∈𝐹𝑚−1 is the rest of column 𝑗, 𝐰∈𝐹1×(𝑛−𝑗), and 𝐵′∈𝐹(𝑚−1)×(𝑛−𝑗). Let ℓ=𝑎−1𝐛 and 𝐴′=𝐵′−ℓ𝐰. Multiplying blockwise (Definition 2.4.33),

𝐵=(10ℓ𝐼𝑚−1)(0𝑎𝐰00𝐴′),
(3.3.3)

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 𝑃=𝑃1. If 𝑗<𝑛, the induction hypothesis gives a permutation matrix 𝑃′, a unit lower triangular 𝐿′, and a row echelon form 𝑈′ with 𝑃′𝐴′=𝐿′𝑈′. Put

𝑃=(100𝑃′)𝑃1,𝐿=(10𝑃′ℓ𝐿′),𝑈=(0𝑎𝐰00𝑈′).

By (3.3.3) and blockwise multiplication,

𝑃𝐴=(100𝑃′)𝐵=(10𝑃′ℓ𝑃′)(0𝑎𝐰00𝐴′)=(0𝑎𝐰0𝑃′ℓ𝑎𝑃′ℓ𝐰+𝑃′𝐴′),
𝐿𝑈=(10𝑃′ℓ𝐿′)(0𝑎𝐰00𝑈′)=(0𝑎𝐰0𝑃′ℓ𝑎𝑃′ℓ𝐰+𝐿′𝑈′),

and these agree because 𝑃′𝐴′=𝐿′𝑈′. Here 𝐿 is unit lower triangular because 𝐿′ is. 𝑃 is a permutation matrix, because if 𝑃′ is a product of swaps 𝐸𝑘𝑙 of size 𝑚−1, then (100𝑃′) is the product of the swaps 𝐸(𝑘+1)(𝑙+1) of size 𝑚. Finally, 𝑈 is in row echelon form: its first row has leading entry 𝑎 in column 𝑗, its other rows vanish in columns 1,…,𝑗, 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 (1,𝑗) entry is already nonzero and we may take 𝑃1=𝐼; then 𝑃=𝐼𝑚. In (3.3.3) the entries of ℓ=𝑎−1𝐛 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

𝐴=(211433879).

Pass 1 uses the multipliers ℓ21=2 and ℓ31=4 and leaves rows (0,1,1) and (0,3,5); pass 2 uses ℓ32=3 and leaves (0,0,2). So

𝐴=𝐿𝑈=(100210431)(211011002).

The multipliers drop into 𝐿 with no further computation. By contrast, (0110) has no LU factorization: if (10ℓ1)(𝑢𝑣0𝑤)=(0110), then 𝑢=0 from the (1,1) entry, and then the (2,1) entry is ℓ𝑢=0≠1. A swap is unavoidable here, and 𝑃=𝐸12 gives 𝑃𝐴=𝐼2=𝐼2𝐼2.

Once 𝑃𝐴=𝐿𝑈 is known, 𝐴𝐱=𝐲 is equivalent to 𝐿(𝑈𝐱)=𝑃𝐲. One solves 𝐿𝐳=𝑃𝐲 from the top down (𝑧1 first, then 𝑧2, and so on: forward substitution) and then 𝑈𝐱=𝐳 from the bottom up (back substitution). For 𝐴∈𝐹𝑛×𝑛 each of these costs about 𝑛2 arithmetic operations, while the factorization itself costs a multiple of 𝑛3:

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 1,…,𝑘−1 (Lemma 3.3.7(d)). So the scaling touches 𝑛−𝑘+1 entries, and each of the 𝑛−1 replacements touches 𝑛−𝑘+1 entries, with one multiplication and one addition each. The total number of multiplications is at most

∑𝑘=1𝑛𝑛(𝑛−𝑘+1)=𝑛⋅𝑛(𝑛+1)2≈𝑛32,

and there are about as many additions: roughly 𝑛3 arithmetic operations in all. Gaussian elimination only clears the 𝑛−𝑘 rows below the pivot, which costs

∑𝑘=1𝑛(𝑛−𝑘)(𝑛−𝑘+1)=𝑛3−𝑛3

multiplications and divisions, and about as many additions: about 2𝑛3/3 operations in all; back substitution adds only about 𝑛2 per right-hand side. Either way, doubling the size of the matrix multiplies the work by about 8. 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 (1,1) entry is 0, so the proof of Theorem 3.3.33 starts with 𝑃1=𝐸12. Then ℓ=(0,2), and the remaining 2×2 block 𝐴′=(21−10) needs no swap: its multiplier is −1/2, leaving 1/2. So

𝐸12𝐴=(110021210)=(1000102−1/21)(110021001/2).

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

𝐴=𝐿𝐷𝐿𝖳.

Proof.hard

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)

Hint 1. Factor 𝑈=𝐷𝑈1 with 𝑈1 unit upper triangular, so 𝐴=𝐿𝐷𝑈1. Transpose this equation.
Hint 2. You get 𝐿𝐷𝑈1=𝑈1𝖳𝐷𝐿𝖳. Rearrange it so that one side is lower triangular and the other upper triangular.
Hint 3. A matrix that is both lower and upper triangular is diagonal. Compare diagonal entries.
Sketch. Write 𝑈=𝐷𝑈1 with 𝑈1=𝐷−1𝑈 unit upper triangular. Transposing 𝐴=𝐿𝐷𝑈1 gives 𝐴=𝑈1𝖳𝐷𝐿𝖳, and moving the outer factors across shows that (𝑈1𝖳)−1𝐿𝐷, which is lower triangular with diagonal 𝐷, equals 𝐷𝐿𝖳𝑈1−1, which is upper triangular. So both equal 𝐷. Hence (𝑈1𝖳)−1𝐿=𝐼𝑛, so 𝑈1=𝐿𝖳 and 𝑈=𝐷𝐿𝖳.

Since the diagonal entries 𝑑𝑖=𝑢𝑖𝑖 are nonzero, 𝐷 is invertible, with 𝐷−1 diagonal with entries 𝑑𝑖−1. Let 𝑈1=𝐷−1𝑈; this scales row 𝑖 of 𝑈 by 𝑑𝑖−1, so 𝑈1 is unit upper triangular, and 𝑈=𝐷𝑈1. Then 𝐴=𝐿𝐷𝑈1, and transposing (Proposition 2.4.23, with 𝐷𝖳=𝐷) gives

𝐿𝐷𝑈1=𝐴=𝐴𝖳=𝑈1𝖳𝐷𝐿𝖳.

Here 𝑈1𝖳 is unit lower triangular and 𝐿𝖳 is unit upper triangular. Multiplying on the left by (𝑈1𝖳)−1 and on the right by 𝑈1−1, which exist by Lemma 3.3.32, gives

(𝑈1𝖳)−1𝐿𝐷=𝐷𝐿𝖳𝑈1−1.

By Lemma 3.3.32, (𝑈1𝖳)−1𝐿 is unit lower triangular, so the left side is lower triangular with diagonal entries 𝑑1,…,𝑑𝑛; the right side is upper triangular. So both sides are diagonal, and comparing diagonals they equal 𝐷. Thus (𝑈1𝖳)−1𝐿𝐷=𝐷, and multiplying on the right by 𝐷−1 gives (𝑈1𝖳)−1𝐿=𝐼𝑛, that is, 𝐿=𝑈1𝖳. Hence 𝑈1=𝐿𝖳 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 1,…,𝑛 since rref(𝐴)=𝐼𝑛 (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

𝐴=(123234346),

Gaussian elimination uses the multipliers ℓ21=2, ℓ31=3, ℓ32=2, and its output 𝑈 has rows (1,2,3), (0,−1,−2), (0,0,1). So 𝐷=diag(1,−1,1) and

𝐴=(100210321)(1000−10001)(123012001).

Over ℝ, when every diagonal entry of 𝐷 is positive, 𝐷=𝐷02 with 𝐷0 diagonal with entries 𝑑𝑖, and 𝐴=(𝐿𝐷0)(𝐿𝐷0)𝖳 is a product of a lower triangular matrix and its transpose. This is the Cholesky factorization of a positive definite matrix (Section 8.3). The signs of the 𝑑𝑖 are not an accident of the computation either: by Sylvester’s law of inertia (Section 12.2), the numbers of positive and of negative 𝑑𝑖 are determined by 𝐴.

Exercises

Exercise 3.3.39.routine Let

𝐴=(121012431012221)∈ℚ3×5.

(a) Find rref(𝐴), its pivot columns, and a matrix 𝐺 with 𝐺𝐴=rref(𝐴).

(b) Without further row reduction, write each non-pivot column of 𝐴 as a linear combination of the pivot columns.

Solution.

Uses. Algorithm 3.3.1 (Gauss–Jordan elimination), Proposition 3.3.11 (Carrying extra columns along), Corollary 3.3.19 (Pivot columns, intrinsically)

Hint 1. No swaps are needed. Carry 𝐼3 along to get 𝐺.
Hint 2. For (b), the entries of a non-pivot column of rref(𝐴) are the coefficients (Corollary 3.3.19).
Sketch. rref(𝐴) has rows (1,2,0,0,5), (0,0,1,0,−4), (0,0,0,1,2), so the pivot columns are 1,3,4, and 𝐺 has rows (4,−2,1), (−3,2,−1), (1,−1,1). Then 𝐚2=2𝐚1 and 𝐚5=5𝐚1−4𝐚3+2𝐚4.

(a) We row reduce (𝐴|𝐼3), scanning only the first five columns (Proposition 3.3.11). Pass 1: the pivot is the (1,1) entry; add −2 times row 1 to row 2 and −1 times row 1 to row 3. Pass 2: column 2 now vanishes in rows 2 and 3, so the pivot is the (2,3) entry, which is 1; add −1 times row 2 to rows 1 and 3. Pass 3: the pivot is the (3,4) entry, which is 1; add row 3 to row 1 and −1 times row 3 to row 2. The stages after each pass are

(121011000011−2−21000120−101)⇝(120−133−100011−2−210000121−11)
⇝(120054−210010−4−32−1000121−11).

So

rref(𝐴)=(120050010−400012),𝐺=(4−21−32−11−11),

with pivot columns 1,3,4. As a check, row 1 of 𝐺𝐴 is

4(1,2,1,0,1)−2(2,4,3,1,0)+(1,2,2,2,1)=(1,2,0,0,5).

(b) By Corollary 3.3.19(b), 𝐚2=2𝐚1 and 𝐚5=5𝐚1−4𝐚3+2𝐚4. Indeed,

5(1,2,1)−4(1,3,2)+2(0,1,2)=(1,0,1)=𝐚5.

Exercise 3.3.40.routine Find the reduced row echelon form of

𝐴=(110101111010)

over ℚ and over 𝔽2. Where do the two computations part ways, and why?

Solution.

Uses. Algorithm 3.3.1 (Gauss–Jordan elimination), Corollary 3.3.19 (Pivot columns, intrinsically)

Hint 1. The first two passes involve only the scalars 1 and −1, so they read the same over both fields (remember −1=1 in 𝔽2).
Hint 2. After two passes the third row is (0,0,2,0). Can 2 be a pivot?
Sketch. After two passes both computations reach the rows (1,0,−1,0), (0,1,1,1), (0,0,2,0). Over ℚ, 2 is a pivot and rref(𝐴) has rows (1,0,0,0), (0,1,0,1), (0,0,1,0). Over 𝔽2, 2=0 and −1=1, so rref(𝐴) has rows (1,0,1,0), (0,1,1,1), (0,0,0,0).

Pass 1 adds −1 times row 1 to row 3, which becomes (0,−1,1,−1). Pass 2, with pivot (2,2), adds −1 times row 2 to row 1 and row 2 to row 3:

(10−1001110020).

So far every operation makes sense over any field.

Over ℚ. The third row has the entry 2≠0 in column 3, which becomes the pivot of pass 3. Scaling row 3 by 1/2 and adding row 3 to row 1 and −1 times row 3 to row 2 gives

rref(𝐴)=(100001010010).

Over 𝔽2. Here 2=0 and −1=1, so after pass 2 the matrix is

(101001110000).

Its unpivoted row is zero, so the algorithm halts, and this is rref(𝐴) over 𝔽2.

The computations part ways at the entry 2 in pass 3, which is a valid pivot over ℚ and is 0 over 𝔽2. In terms of Corollary 3.3.19: over 𝔽2 the third column of 𝐴 is the sum of the first two, (1,0,1)+(1,1,0)=(0,1,1), so column 3 is not a pivot column. Over ℚ, a combination 𝑥(1,0,1)+𝑦(1,1,0) equal to (0,1,1) would need 𝑥=1 and 𝑦=1 (from the third and second entries), but then the first entry is 2≠0; so the third column is a pivot column.

Exercise 3.3.41.routine Over ℂ, let

𝐴=(1𝑖001𝑖𝑖01),𝐵=(10𝑖011𝑖10).

Use Algorithm 3.3.24 to find 𝐴−1, and to show that 𝐵 is not invertible. For 𝐵, find the linear relation among its rows that the algorithm produces.

Solution.

Uses. Algorithm 3.3.24 (Inverting a matrix by row reduction), Theorem 3.3.23 (Invertibility and RREF)

Hint 1. In pass 1 for 𝐴, add −𝑖 times row 1 to row 3, and remember 𝑖2=−1.
Hint 2. Pass 3 for 𝐴 divides by 1−𝑖, whose inverse is (1+𝑖)/2. For 𝐵, the left block gets a zero row in pass 2; read the relation off the right block.
Sketch. For 𝐴, the passes use 𝐸1,−𝑖,3, then 𝐸2,−𝑖,1 and 𝐸2,−1,3, then a scaling by (1+𝑖)/2 and two replacements; the inverse has entries (±1±𝑖)/2. For 𝐵, two passes leave the left row (0,0,0) with right row (−𝑖,−1,1), so 𝐵 is not invertible, and −𝑖 times row 1, minus row 2, plus row 3 is zero.

The matrix 𝐴. Pass 1 adds −𝑖 times row 1 to row 3, which becomes (0,−𝑖2,1|−𝑖,0,1)=(0,1,1|−𝑖,0,1). Pass 2 (pivot (2,2)) adds −𝑖 times row 2 to row 1 and −1 times row 2 to row 3:

(1011−𝑖001𝑖010001−𝑖−𝑖−11).

Pass 3 scales row 3 by (1−𝑖)−1=(1+𝑖)/2, which turns the right part of row 3 into 12(1−𝑖,−1−𝑖,1+𝑖), and then adds −1 times row 3 to row 1 and −𝑖 times row 3 to row 2. The result is

𝐴−1=12(1+𝑖1−𝑖−1−𝑖−1−𝑖1+𝑖1−𝑖1−𝑖−1−𝑖1+𝑖).

Check: the first row of 𝐴 times the first column of 2𝐴−1 is (1+𝑖)+𝑖(−1−𝑖)=1+𝑖−𝑖+1=2, times the second column it is (1−𝑖)+𝑖(1+𝑖)=0, and times the third (−1−𝑖)+𝑖(1−𝑖)=0; the other rows are similar.

The matrix 𝐵. Pass 1 adds −𝑖 times row 1 to row 3: the left part becomes (𝑖,1,0)−𝑖(1,0,𝑖)=(0,1,1) and the right part (−𝑖,0,1). Pass 2 adds −1 times row 2 to row 3, which becomes (0,0,0|−𝑖,−1,1). The left block now has a zero row, so 𝐵 is not invertible. The right part of the zero row says that −𝑖 times row 1 of 𝐵, minus row 2, plus row 3, is zero:

−𝑖(1,0,𝑖)−(0,1,1)+(𝑖,1,0)=(0,0,1−1)=𝟎.

Exercise 3.3.42.standard For a scalar 𝑐, let

𝐴𝑐=(1212𝑐212𝑐).

(a) Find rref(𝐴𝑐) for every 𝑐∈ℝ. For which 𝑐 is 𝐴𝑐 invertible?

(b) Answer the same questions over 𝔽3, for 𝑐∈𝔽3.

Solution.

Uses. Algorithm 3.3.1 (Gauss–Jordan elimination), Theorem 3.3.23 (Invertibility and RREF)

Hint 1. Pass 1 works for every 𝑐. Write down the resulting rows 2 and 3.
Hint 2. They are (0,𝑐−4,0) and (0,0,𝑐−1). Split into cases according to which of 𝑐−4 and 𝑐−1 vanish. In 𝔽3, 4=1.
Sketch. After pass 1 the rows are (1,2,1), (0,𝑐−4,0), (0,0,𝑐−1). Over ℝ: rref(𝐴𝑐)=𝐼3 for 𝑐≠1,4; rref(𝐴4) has rows (1,2,0), (0,0,1), 𝟎; rref(𝐴1) has rows (1,0,1), (0,1,0), 𝟎. Over 𝔽3, 𝑐−4=𝑐−1: rref(𝐴1) has rows (1,2,1), 𝟎, 𝟎, and rref(𝐴𝑐)=𝐼3 for 𝑐=0,2.

Pass 1 adds −2 times row 1 to row 2 and −1 times row 1 to row 3, giving

(1210𝑐−4000𝑐−1).

(a) If 𝑐≠4 and 𝑐≠1: pass 2 scales row 2 by (𝑐−4)−1, making it (0,1,0), and adds −2 times it to row 1, which becomes (1,0,1). Pass 3 scales row 3 to (0,0,1) and subtracts it from row 1. So rref(𝐴𝑐)=𝐼3.

If 𝑐=4: the rows are (1,2,1), (0,0,0), (0,0,3). In pass 2, column 2 vanishes in rows 2 and 3, so the scan moves to column 3; the (2,3) entry is 0, so rows 2 and 3 are swapped. Scaling by 1/3 and subtracting the new row 2 from row 1 gives

rref(𝐴4)=(120001000).

If 𝑐=1: the rows are (1,2,1), (0,−3,0), (0,0,0). Pass 2 scales row 2 to (0,1,0) and adds −2 times it to row 1, so

rref(𝐴1)=(101010000).

By Theorem 3.3.23, 𝐴𝑐 is invertible exactly when 𝑐≠1 and 𝑐≠4.

(b) In 𝔽3, 𝑐−4=𝑐−1, since 3=0. If 𝑐=1, rows 2 and 3 are both zero after pass 1, and

rref(𝐴1)=(121000000).

If 𝑐=0 or 𝑐=2, then 𝑐−4=𝑐−1≠0, and the computation of the first case of (a) applies verbatim: rref(𝐴𝑐)=𝐼3. So over 𝔽3, 𝐴𝑐 is invertible exactly when 𝑐≠1.

Exercise 3.3.43.routine Let 𝐴∈𝐹𝑚×𝑛 and 𝑅=rref(𝐴).

  1. (a)Show that rref(𝑐𝐴)=𝑅 for every nonzero 𝑐∈𝐹.
  2. (b)Show that rref((𝐴|𝐴))=(𝑅|𝑅).
  3. (c)Let (𝐴𝐴)∈𝐹2𝑚×𝑛 be the matrix with 𝐴 stacked on top of itself. Show that rref(𝐴𝐴)=(𝑅0).

Solution.

Uses. Corollary 3.3.18 (RREF and row equivalence), Theorem 3.3.12 (Matrices in RREF), Proposition 3.3.11 (Carrying extra columns along)

Hint 1. In each part, find a matrix in RREF that is row equivalent to the given one, and use Corollary 3.3.18(c).
Hint 2. For (b), 𝐺(𝐴|𝐴)=(𝑅|𝑅). Check (R1)–(R4) for (𝑅|𝑅): where are its leading entries?
Hint 3. For (c), first subtract each of the top rows from the corresponding bottom row.
Sketch. (a) Scaling every row by 𝑐 turns 𝐴 into 𝑐𝐴, so 𝑐𝐴∼𝐴. (b) (𝐴|𝐴)∼(𝑅|𝑅), whose nonzero rows have their leading entries in the left block, and whose pivot columns are those of 𝑅; so it satisfies (R1)–(R4). (c) Subtracting rows gives (𝐴0), and the run of the algorithm on 𝐴, performed on the top 𝑚 rows, gives (𝑅0), which satisfies (R1)–(R4).

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 rref(𝑐𝐴)=𝑅.

(b) By Proposition 3.3.11(a), 𝐺(𝐴|𝐴)=(𝐺𝐴|𝐺𝐴)=(𝑅|𝑅), so (𝐴|𝐴)∼(𝑅|𝑅). The nonzero rows of (𝑅|𝑅) are the nonzero rows of 𝑅, in the same positions, and since the left block is 𝑅, their leading entries are the leading entries of 𝑅. So (R1), (R2), and (R3) hold for (𝑅|𝑅) because they hold for 𝑅. The columns containing leading entries are the pivot columns of 𝑅, in the left block, and each of them is a standard basis vector; this is (R4). So rref((𝐴|𝐴))=(𝑅|𝑅).

(c) For 𝑖=1,…,𝑚, add −1 times row 𝑖 to row 𝑚+𝑖. This turns (𝐴𝐴) into (𝐴0). Then perform the row operations of the run of Gauss–Jordan elimination on 𝐴, applied to rows 1,…,𝑚 only; they turn (𝐴0) into (𝑅0). This matrix satisfies (R1)–(R4): its nonzero rows are those of 𝑅, at the top, and it is 𝑅 with 𝑚 zero rows appended. So rref(𝐴𝐴)=(𝑅0).

Exercise 3.3.44.standard Let 𝐴∈𝐹𝑚×𝑛 and 𝐵∈𝐹𝑚×𝑝.

  1. (a)Show that the first 𝑛 columns of rref((𝐴|𝐵)) form rref(𝐴).
  2. (b)Give an example in which the last 𝑝 columns of rref((𝐴|𝐵)) differ from the matrix 𝐺𝐵 of Proposition 3.3.11.

Solution.

Uses. Theorem 3.3.10 (𝐺𝐴=rref(𝐴)), Proposition 3.3.11 (Carrying extra columns along), Theorem 3.3.12 (Matrices in RREF), Corollary 3.3.18 (RREF and row equivalence)

Hint 1. Write rref((𝐴|𝐵))=(𝑆|𝑇)=𝐻(𝐴|𝐵) with 𝐻 invertible. Then 𝑆=𝐻𝐴. It suffices to show that 𝑆 is in RREF. Why?
Hint 2. Some nonzero rows of (𝑆|𝑇) may have their leading entry in the right block. What do these rows look like in 𝑆, and where are they?
Hint 3. For (b), try 𝐴=(11) and 𝐵=(12).
Sketch. (𝑆|𝑇)=(𝐻𝐴|𝐻𝐵). The rows of (𝑆|𝑇) whose leading entries lie in the left block come first, by (R3), and the remaining rows vanish in the left block; so 𝑆 satisfies (R1)–(R4), with pivot columns the pivot columns of (𝑆|𝑇) among 1,…,𝑛. Then 𝑆=rref(𝐻𝐴)=rref(𝐴). For 𝐴=(11), 𝐵=(12): rref((𝐴|𝐵))=𝐼2, while 𝐺𝐵=(1,1).

(a) By Theorem 3.3.10 and Proposition 3.3.11(a), rref((𝐴|𝐵))=𝐻(𝐴|𝐵)=(𝐻𝐴|𝐻𝐵) for some invertible 𝐻. Write 𝑆=𝐻𝐴 and 𝑇=𝐻𝐵. We show that 𝑆 is in RREF; then 𝑆=rref(𝑆)=rref(𝐻𝐴)=rref(𝐴) by Corollary 3.3.18(a).

Let rows 1,…,𝑟 be the nonzero rows of (𝑆|𝑇), with leading entries in columns 𝑐1<⋯<𝑐𝑟, and let 𝑡 be the number of 𝑐𝑠 that are at most 𝑛, so that 𝑐1,…,𝑐𝑡≤𝑛<𝑐𝑡+1,…,𝑐𝑟. For 𝑠≤𝑡, row 𝑠 of 𝑆 is nonzero, with the same leading entry as row 𝑠 of (𝑆|𝑇). For 𝑠>𝑡, the leading entry of row 𝑠 of (𝑆|𝑇) is in the right block, so row 𝑠 of 𝑆 is zero; and rows 𝑟+1,…,𝑚 of 𝑆 are zero as well. So the nonzero rows of 𝑆 are rows 1,…,𝑡, which is (R1), and (R2) and (R3) for 𝑆 follow from (R2) and (R3) for (𝑆|𝑇). Finally, for 𝑠≤𝑡, column 𝑐𝑠 of (𝑆|𝑇) is 𝐞𝑠 by (R2) and (R4), and it is a column of 𝑆. This is (R4) for 𝑆. By Theorem 3.3.12, 𝑆 is in RREF.

(b) Let 𝐴=(11) and 𝐵=(12). The run on 𝐴 is the single operation 𝐸1,−1,2, so 𝐺=(10−11) and 𝐺𝐵=(11). But (𝐴|𝐵)=(1112) reduces to (1101) and then to 𝐼2, whose last column is (01)≠𝐺𝐵. The full algorithm also pivots in the column of 𝐵, and then clears above that pivot.

Exercise 3.3.45.standard Prove or disprove each statement. Throughout, 𝐴 and 𝐵 are matrices over 𝐹 of sizes for which the expressions make sense.

  1. (a)rref(𝐴𝖳)=rref(𝐴)𝖳 for every square 𝐴.
  2. (b)rref(𝐴𝐵)=rref(𝐴)rref(𝐵).
  3. (c)If rref(𝐴)=rref(𝐵), then im𝑇𝐴=im𝑇𝐵.
  4. (d)If 𝐴 and 𝐵 have the same size and im𝑇𝐴=im𝑇𝐵, then rref(𝐴)=rref(𝐵).
  5. (e)rref(rref(𝐴)𝐵)=rref(𝐴𝐵).

Solution.

Uses. Corollary 3.3.18 (RREF and row equivalence), Theorem 3.3.10 (𝐺𝐴=rref(𝐴)), Theorem 3.3.12 (Matrices in RREF)

Hint 1. Only one of the statements is true. Look for 2×2 counterexamples, or even 1×2 ones, with many zeros.
Hint 2. For (e), write rref(𝐴)=𝐺𝐴 with 𝐺 invertible.
Sketch. (a) False for 𝐴=(0100). (b) False for 𝐴=(0100), 𝐵=(0010). (c) False for (1000) and (0010). (d) False for (10) and (01). (e) True: rref(𝐴)𝐵=𝐺(𝐴𝐵), so Corollary 3.3.18(a) applies.

(a) False. Let 𝐴=(0100). It satisfies (R1)–(R4), so rref(𝐴)=𝐴 and rref(𝐴)𝖳=(0010), which violates (R1) and so is not even in RREF. In fact rref(𝐴𝖳)=(1000).

(b) False. Let 𝐴=(0100) and 𝐵=(0010). Then rref(𝐴)=𝐴, rref(𝐵)=(1000), and rref(𝐴)rref(𝐵)=0. But 𝐴𝐵=(1000), which is its own reduced row echelon form.

(c) False. Let 𝐴=(1000) and 𝐵=(0010)=𝐸12𝐴. Then rref(𝐴)=rref(𝐵)=𝐴, but im𝑇𝐴=span(𝐞1) and im𝑇𝐵=span(𝐞2).

(d) False. Let 𝐴=(10) and 𝐵=(01) in 𝐹1×2. Both images are all of 𝐹, but both matrices are in RREF and they are different.

(e) True. By Theorem 3.3.10, rref(𝐴)=𝐺𝐴 with 𝐺 invertible, so rref(𝐴)𝐵=𝐺(𝐴𝐵), and Corollary 3.3.18(a) gives rref(𝐺(𝐴𝐵))=rref(𝐴𝐵).

Exercise 3.3.46.standard
  1. (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 𝐼𝑚.

  2. (b)Suppose 𝑅 has 𝑟 pivots. Describe all invertible 𝐺 with 𝐺𝑅=𝑅.

Solution.

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)

Hint 1. Reread the statement proved by induction in the first proof of Theorem 3.3.17. For which 𝑠 does it say anything about 𝐠𝑠?
Hint 2. Try 𝑅=(10).
Hint 3. For (b), show that 𝐺𝑅=𝑅 exactly when 𝐺𝐞𝑠=𝐞𝑠 for 𝑠≤𝑟, and write 𝐺 in block form.
Sketch. The induction gives 𝐠𝑠=𝐞𝑠 only when 𝑝𝑠≤𝑛, that is, for 𝑠≤𝑟. Counterexample: 𝑅=(10), 𝐺=(1101). In general 𝐺𝑅=𝑅 if and only if 𝐺=(𝐼𝑟𝑋0𝑌), and such a 𝐺 is invertible exactly when 𝑌 is.

(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 𝐠𝑟+1,…,𝐠𝑚, so the claim does not follow. It is false: for 𝑅=(10) and 𝐺=(1101), 𝐺 is invertible (with inverse (1−101)) and 𝐺𝑅=𝑅, but 𝐺≠𝐼2.

(b) Let 𝑝1<⋯<𝑝𝑟 be the pivot columns of 𝑅. If 𝐺𝑅=𝑅, then 𝐺𝐞𝑠=𝐺𝐫𝑝𝑠=𝐫𝑝𝑠=𝐞𝑠 for 𝑠≤𝑟 (Lemma 3.3.16(b)). Conversely, if 𝐺𝐞𝑠=𝐞𝑠 for 𝑠≤𝑟, then by Lemma 3.3.16(a) (with 𝑠=𝑟) every column of 𝑅 is a combination ∑𝑡≤𝑟𝑐𝑡𝐞𝑡, and 𝐺 fixes it; so 𝐺𝑅=𝑅. Hence 𝐺𝑅=𝑅 if and only if the first 𝑟 columns of 𝐺 are 𝐞1,…,𝐞𝑟, that is,

𝐺=(𝐼𝑟𝑋0𝑌)

for some 𝑋∈𝐹𝑟×(𝑚−𝑟) and 𝑌∈𝐹(𝑚−𝑟)×(𝑚−𝑟).

Such a 𝐺 is invertible if and only if 𝑌 is. If 𝑌 is invertible, block multiplication (Definition 2.4.33) shows that (𝐼𝑟−𝑋𝑌−10𝑌−1) is a two-sided inverse of 𝐺. Conversely, let 𝐻=(𝐻11𝐻12𝐻21𝐻22) be an inverse of 𝐺, in the same block sizes. The first block column of 𝐻𝐺 is (𝐻11𝐻21), which must be (𝐼𝑟0), so 𝐻21=0. Then the lower right blocks of 𝐻𝐺=𝐼𝑚 and 𝐺𝐻=𝐼𝑚 say 𝐻22𝑌=𝐼𝑚−𝑟 and 𝑌𝐻22=𝐼𝑚−𝑟. So 𝑌 is invertible.

So the invertible 𝐺 with 𝐺𝑅=𝑅 are exactly the matrices (𝐼𝑟𝑋0𝑌) with 𝑋 arbitrary and 𝑌 invertible. Only when 𝑟=𝑚 is 𝐺=𝐼𝑚 forced.

Exercise 3.3.47.standard 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.

Solution.

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)

Hint 1. Find the place in the proof of Lemma 3.3.7 where the choice of the leftmost column was used.
Hint 2. Run the modified algorithm on (1101), choosing column 2 in the first pass.
Sketch. The proof used that rows 𝑘+1,…,𝑚 vanish to the left of the chosen column, which is what the leftmost choice guarantees; parts (b), (d), (e) of the invariant depend on it. Choosing column 2 first in (1101) gives the output (0110), which violates (R3).

The proof of Lemma 3.3.7 began with the observation that rows 𝑘+1,…,𝑚 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 𝐴=(1101), choosing column 2 in pass 1. The (1,2) entry is already 1, so it becomes a pivot with 𝑝1=2, and clearing column 2 adds −1 times row 1 to row 2, giving (11−10). In pass 2, the only unpivoted row is (−1,0), so 𝑗=1; scaling by −1 gives (1,0), and clearing adds −1 times row 2 to row 1. The output is

(0110),

which violates (R3), so it is not in RREF. (Here 𝑝1=2>1=𝑝2, 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.standard Let 𝑝 be a prime.

  1. (a)Show that exactly 2𝑝2+2𝑝+3 matrices in 𝔽𝑝2×3 are in RREF.
  2. (b)Deduce that 𝔽𝑝2×3 splits into exactly 2𝑝2+2𝑝+3 row equivalence classes. How many is that for 𝑝=2?

Solution.

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)

Hint 1. Sort the matrices in RREF by their set of pivot columns. Which entries are then forced, and which are free?
Hint 2. By Lemma 3.3.16(a), a non-pivot column has zeros below the rows of the pivots to its left, and is arbitrary in those rows.
Hint 3. For (b), how many matrices in RREF does a row equivalence class contain?
Sketch. No pivots: 1 matrix. One pivot in column 1, 2, 3: 𝑝2, 𝑝, 1 matrices. Two pivots in columns (1,2), (1,3), (2,3): 𝑝2, 𝑝, 1. Total 1+2(𝑝2+𝑝+1). By Corollary 3.3.18(b), each class contains exactly one matrix in RREF; for 𝑝=2 there are 15 classes.

(a) By Theorem 3.3.12 we count the matrices satisfying (R1)–(R4), sorted by their pivot columns. The pivot columns are 𝐞1,𝐞2,… 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 1 matrix.
  • One pivot, in column 1: (1𝑎𝑏000), so 𝑝2 matrices. In column 2: (01𝑎000), so 𝑝. In column 3: (001000), so 1.
  • Two pivots, in columns 1,2: (10𝑎01𝑏), so 𝑝2. In columns 1,3: (1𝑎0001), so 𝑝. In columns 2,3: (010001), so 1.

Each displayed matrix satisfies (R1)–(R4) for every choice of 𝑎,𝑏. The total is 1+2(𝑝2+𝑝+1)=2𝑝2+2𝑝+3.

(b) Every class contains a matrix in RREF, namely rref(𝐴) for any 𝐴 in it, and by Corollary 3.3.18(b) two matrices in RREF are row equivalent only if they are equal (as rref(𝑅)=𝑅). So 𝑅↦ (the class of 𝑅) is a bijection from the matrices in RREF to the classes, and there are 2𝑝2+2𝑝+3 classes. For 𝑝=2 this is 15.

Exercise 3.3.49.standard Find all matrices 𝐴∈ℝ2×3 with ker𝑇𝐴=span((1,1,1)).

Solution.

Uses. Corollary 3.3.20 (The kernel is a complete invariant), Corollary 3.3.18 (RREF and row equivalence), Theorem 3.3.10 (𝐺𝐴=rref(𝐴))

Techniques. Reduce to RREF (Technique 3.3.22)

Hint 1. Find one matrix in RREF with this kernel.
Hint 2. 𝑅0=(10−101−1) works. By Corollary 3.3.20, 𝐴 has the same kernel as 𝑅0 exactly when rref(𝐴)=𝑅0. Which matrices have this reduced row echelon form?
Sketch. The matrix 𝑅0 is in RREF and has kernel span((1,1,1)). By Corollary 3.3.20, ker𝑇𝐴=ker𝑇𝑅0 if and only if rref(𝐴)=𝑅0, if and only if 𝐴=𝐻𝑅0 with 𝐻 invertible. So 𝐴=(𝑎𝑏−𝑎−𝑏𝑐𝑑−𝑐−𝑑) with (𝑎𝑏𝑐𝑑) invertible.

Let 𝑅0=(10−101−1), which is in RREF. Its kernel consists of the 𝐱 with 𝑥1−𝑥3=0 and 𝑥2−𝑥3=0, that is, 𝐱=𝑥3(1,1,1); so ker𝑇𝑅0=span((1,1,1)). By Corollary 3.3.20, ker𝑇𝐴=span((1,1,1)) if and only if rref(𝐴)=rref(𝑅0)=𝑅0.

If rref(𝐴)=𝑅0, then by Theorem 3.3.10, 𝐺𝐴=𝑅0 with 𝐺 invertible, so 𝐴=𝐺−1𝑅0. Conversely, if 𝐴=𝐻𝑅0 with 𝐻 invertible, then rref(𝐴)=rref(𝑅0)=𝑅0 by Corollary 3.3.18(a). So the answer is the set of matrices

𝐴=(𝑎𝑏𝑐𝑑)(10−101−1)=(𝑎𝑏−𝑎−𝑏𝑐𝑑−𝑐−𝑑)

with (𝑎𝑏𝑐𝑑) invertible.

Exercise 3.3.50.standard For 𝐮,𝐱∈𝐹𝑛 write 𝐮⋅𝐱=𝑢1𝑥1+⋯+𝑢𝑛𝑥𝑛. The row space of 𝐴∈𝐹𝑚×𝑛 is the span of its rows, viewed as vectors in 𝐹𝑛.

  1. (a)Show that 𝐱∈ker𝑇𝐴 if and only if 𝐯⋅𝐱=0 for every 𝐯 in the row space of 𝐴.
  2. (b)Deduce that 𝐴,𝐵∈𝐹𝑚×𝑛 are row equivalent if and only if they have the same row space.

Solution.

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)

Hint 1. The 𝑖th entry of 𝐴𝐱 is (row 𝑖 of 𝐴) ⋅𝐱. How does 𝐯⋅𝐱 behave when 𝐯 is a linear combination?
Hint 2. For (b), one direction is Exercise 3.2.46. For the other, use (a) and Corollary 3.3.20.
Sketch. (a) 𝐴𝐱=𝟎 says that every row is orthogonal to 𝐱 in this sense, and 𝐯↦𝐯⋅𝐱 respects linear combinations. (b) Row equivalent matrices have the same row space by Exercise 3.2.46. If the row spaces agree, (a) shows that the kernels agree, and Corollary 3.3.20 gives 𝐴∼𝐵.

(a) Let 𝐯1,…,𝐯𝑚 be the rows of 𝐴. By Definition 2.3.8, the 𝑖th entry of 𝐴𝐱 is 𝑎𝑖1𝑥1+⋯+𝑎𝑖𝑛𝑥𝑛=𝐯𝑖⋅𝐱, so 𝐴𝐱=𝟎 if and only if 𝐯𝑖⋅𝐱=0 for all 𝑖. By distributivity, (𝑐𝐮+𝑐′𝐮′)⋅𝐱=𝑐(𝐮⋅𝐱)+𝑐′(𝐮′⋅𝐱), so if 𝐯=𝑐1𝐯1+⋯+𝑐𝑚𝐯𝑚 and every 𝐯𝑖⋅𝐱=0, then 𝐯⋅𝐱=0. Conversely, each 𝐯𝑖 lies in the row space. This proves (a).

(b) If 𝐴∼𝐵, they have the same row space by Exercise 3.2.46. Conversely, suppose 𝐴 and 𝐵 have the same row space. By (a), ker𝑇𝐴 and ker𝑇𝐵 are both the set of 𝐱 with 𝐯⋅𝐱=0 for all 𝐯 in this common row space. So ker𝑇𝐴=ker𝑇𝐵, and 𝐴∼𝐵 by Corollary 3.3.20.

Exercise 3.3.51.standard Let 𝑎∈𝐹, and let 𝐵∈𝐹𝑛×𝑛 have 1 in every diagonal position, 𝑎 in every position (𝑖,𝑖+1) directly above the diagonal, and 0 elsewhere.

  1. (a)Row reduce (𝐵|𝐼𝑛) to show that 𝐵 is invertible, and that 𝐵−1 has entry (−𝑎)𝑗−𝑖 in position (𝑖,𝑗) for 𝑗≥𝑖, and 0 for 𝑗<𝑖.
  2. (b)Find the inverse of the 𝑛×𝑛 matrix 𝑈 with 𝑢𝑖𝑗=1 for 𝑗≥𝑖 and 𝑢𝑖𝑗=0 for 𝑗<𝑖.

Solution.

Uses. Corollary 3.3.18 (RREF and row equivalence), Theorem 3.3.23 (Invertibility and RREF), Proposition 3.3.11 (Carrying extra columns along)

Hint 1. Work from the bottom up: for 𝑖=𝑛−1,𝑛−2,…,1, add −𝑎 times row 𝑖+1 to row 𝑖. Any sequence of row operations that reaches (𝐼𝑛|𝐶) will do, by Corollary 3.3.18(c).
Hint 2. Prove by downward induction on 𝑖 what row 𝑖 looks like after it has been processed.
Hint 3. For (b), 𝑈 is the answer to (a) for 𝑎=−1.
Sketch. Processing rows from the bottom up, row 𝑖 becomes (𝐞𝑖𝖳|𝐜𝑖) with 𝐜𝑖=∑𝑗≥𝑖(−𝑎)𝑗−𝑖𝐞𝑗𝖳, because 𝐞𝑖𝖳−𝑎𝐜𝑖+1=𝐜𝑖. So 𝐻(𝐵|𝐼𝑛)=(𝐼𝑛|𝐶) for a product 𝐻 of elementary matrices, and 𝐵−1=𝐶. For 𝑎=−1, (a) says that the matrix with 1 on the diagonal and −1 just above it has inverse 𝑈; so 𝑈−1 is that matrix.

(a) For 𝑖=1,…,𝑛, let

𝐜𝑖=∑𝑗=𝑖𝑛(−𝑎)𝑗−𝑖𝐞𝑗𝖳,

the row vector we expect as row 𝑖 of 𝐵−1. For 𝑖<𝑛, row 𝑖 of (𝐵|𝐼𝑛) has left part 𝐞𝑖𝖳+𝑎𝐞𝑖+1𝖳 and right part 𝐞𝑖𝖳. Row 𝑛 has left part 𝐞𝑛𝖳 and right part 𝐞𝑛𝖳=𝐜𝑛.

For 𝑖=𝑛−1,𝑛−2,…,1 in this order, add −𝑎 times row 𝑖+1 to row 𝑖. We claim that afterwards row 𝑖 is (𝐞𝑖𝖳|𝐜𝑖). When row 𝑖 is processed it has not been changed yet, and row 𝑖+1 is already (𝐞𝑖+1𝖳|𝐜𝑖+1) (for 𝑖+1=𝑛 this was noted above, and otherwise by induction). So row 𝑖 becomes

(𝐞𝑖𝖳+𝑎𝐞𝑖+1𝖳−𝑎𝐞𝑖+1𝖳|𝐞𝑖𝖳−𝑎𝐜𝑖+1)=(𝐞𝑖𝖳|𝐜𝑖),

since

𝐞𝑖𝖳−𝑎∑𝑗≥𝑖+1(−𝑎)𝑗−𝑖−1𝐞𝑗𝖳=𝐞𝑖𝖳+∑𝑗≥𝑖+1(−𝑎)𝑗−𝑖𝐞𝑗𝖳=𝐜𝑖.

At the end the matrix is (𝐼𝑛|𝐶), where 𝐶 has rows 𝐜1,…,𝐜𝑛. Let 𝐻 be the product of the elementary matrices used, so 𝐻(𝐵|𝐼𝑛)=(𝐻𝐵|𝐻)=(𝐼𝑛|𝐶). Since 𝐼𝑛 is in RREF and 𝐵∼𝐼𝑛, Corollary 3.3.18(c) gives rref(𝐵)=𝐼𝑛, and 𝐻 is a product of elementary matrices with 𝐻𝐵=rref(𝐵). By Theorem 3.3.23, 𝐵 is invertible and 𝐵−1=𝐻=𝐶, whose (𝑖,𝑗) entry is (−𝑎)𝑗−𝑖 for 𝑗≥𝑖 and 0 otherwise.

(b) Take 𝑎=−1 in (a): the matrix 𝐵 with 1 on the diagonal and −1 directly above it has inverse with entries 1𝑗−𝑖=1 for 𝑗≥𝑖 and 0 below the diagonal, which is 𝑈. So 𝑈=𝐵−1 is invertible and 𝑈−1=𝐵: it has 1 on the diagonal, −1 in each position (𝑖,𝑖+1), and 0 elsewhere.

Exercise 3.3.52.standard Let 𝑛≥1, and let 𝐴∈𝐹𝑛×𝑛 have every diagonal entry 0 and every other entry 1. Write 𝑐=(𝑛−1)∗1=1+⋯+1 (𝑛−1 terms) in 𝐹. Show that 𝐴 is invertible if and only if 𝑐≠0, and find 𝐴−1 in that case. For which 𝑛 is 𝐴 invertible over 𝔽𝑝?

Solution.

Uses. Definition 2.5.12 (Invertible), Definition 2.4.1 (Matrix product)

Hint 1. Row reduce for 𝑛=2 and 𝑛=3 over ℚ and look for a pattern.
Hint 2. Let 𝐽 be the all-ones matrix, so 𝐴=𝐽−𝐼𝑛. Compute 𝐽2, and look for an inverse of the form 𝛼𝐽+𝛽𝐼𝑛.
Hint 3. If 𝑐=0, compute 𝐴𝐽.
Sketch. With 𝐽 the all-ones matrix, 𝐴=𝐽−𝐼𝑛 and 𝐽2=(𝑛∗1)𝐽. If 𝑐≠0, then 𝑐−1𝐽−𝐼𝑛 is a two-sided inverse of 𝐽−𝐼𝑛, by direct multiplication. If 𝑐=0, then 𝐴𝐽=𝑐𝐽=0 with 𝐽≠0, so 𝐴 is not invertible. Over 𝔽𝑝: invertible exactly when 𝑝 does not divide 𝑛−1.

Let 𝐽∈𝐹𝑛×𝑛 be the matrix all of whose entries are 1, so 𝐴=𝐽−𝐼𝑛. Each entry of 𝐽2 is a sum of 𝑛 products 1⋅1, so 𝐽2=(𝑛∗1)𝐽=(𝑐+1)𝐽.

Suppose 𝑐≠0, and let 𝐶=𝑐−1𝐽−𝐼𝑛. Then

𝐴𝐶=(𝐽−𝐼𝑛)(𝑐−1𝐽−𝐼𝑛)=𝑐−1𝐽2−𝐽−𝑐−1𝐽+𝐼𝑛=𝑐−1(𝑐+1)𝐽−𝐽−𝑐−1𝐽+𝐼𝑛=𝐼𝑛,

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 𝐴−1=𝑐−1𝐽−𝐼𝑛: its diagonal entries are 𝑐−1−1 and its other entries are 𝑐−1. For instance, for 𝑛=3 over ℚ,

(011101110)−1=12(−1111−1111−1).

Suppose 𝑐=0. Then 𝐴𝐽=𝐽2−𝐽=(𝑐+1)𝐽−𝐽=𝑐𝐽=0. If 𝐴 were invertible, we would get 𝐽=𝐴−1𝐴𝐽=0, which is false. So 𝐴 is not invertible. (This includes 𝑛=1, where 𝐴=(0).)

Over 𝔽𝑝, 𝑐=0 exactly when 𝑝 divides 𝑛−1. So 𝐴 is invertible over 𝔽𝑝 if and only if 𝑛−1 is not a multiple of 𝑝; for example, over 𝔽2, if and only if 𝑛 is even.

Exercise 3.3.53.standard A matrix 𝑈∈𝐹𝑛×𝑛 is upper triangular if 𝑢𝑖𝑗=0 whenever 𝑖>𝑗.

  1. (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 𝑈−1 is upper triangular with diagonal entries 𝑢11−1,…,𝑢𝑛𝑛−1.
  2. (b)Let 𝑈 be upper triangular with some diagonal entry 0. Find a nonzero 𝐱 with 𝑈𝐱=𝟎, and conclude that 𝑈 is not invertible.

Solution.

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)

Hint 1. For (a), show by induction on 𝑘 that before pass 𝑘 the current matrix is upper triangular, its first 𝑘−1 columns are 𝐞1,…,𝐞𝑘−1, and rows 𝑘,…,𝑛 are still the rows of 𝑈.
Hint 2. In pass 𝑘 the pivot is the (𝑘,𝑘) entry, and only rows above row 𝑘 need clearing. Where is the off-diagonal entry of 𝐸𝑘𝑐𝑖 when 𝑖<𝑘? Products of upper triangular matrices are upper triangular: check it entrywise.
Hint 3. For (b), take the first 𝑘 with 𝑢𝑘𝑘=0, put 𝑥𝑘=1 and 𝑥𝑗=0 for 𝑗>𝑘, and solve for 𝑥𝑘−1,…,𝑥1 from the bottom up.
Sketch. (a) In pass 𝑘, rows 𝑘,…,𝑛 vanish in columns 1,…,𝑘−1 and the (𝑘,𝑘) entry is 𝑢𝑘𝑘≠0, so the pivot is (𝑘,𝑘) with no swap; the scaling is diagonal, and the replacements add multiples of row 𝑘 to rows 𝑖<𝑘, with elementary matrices 𝐸𝑘𝑐𝑖 whose extra entry (𝑖,𝑘) is above the diagonal. So 𝑈−1=𝐺 is a product of upper triangular matrices, and its diagonal is the product of their diagonals. (b) With 𝑘 minimal and 𝑢𝑘𝑘=0, back substitution gives 𝐱≠𝟎 with 𝑥𝑘=1 and 𝑈𝐱=𝟎.

(a) We show by induction on 𝑘=1,…,𝑛 that before pass 𝑘, the current matrix 𝑀 is upper triangular, its first 𝑘−1 columns are 𝐞1,…,𝐞𝑘−1, and its rows 𝑘,…,𝑛 are those of 𝑈. For 𝑘=1, 𝑀=𝑈.

Assume this before pass 𝑘. Rows 𝑘,…,𝑛 of 𝑀 vanish in columns 1,…,𝑘−1 (as 𝑀 is upper triangular), and the (𝑘,𝑘) entry is 𝑢𝑘𝑘≠0. 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 𝐸𝑘,𝑢𝑘𝑘−1. In column 𝑘, the rows 𝑖>𝑘 have entry 𝑢𝑖𝑘=0, 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 1,…,𝑘−1, 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 1,…,𝑘−1 are unchanged, and rows 𝑘+1,…,𝑛 are untouched. This completes the induction.

After pass 𝑛 the matrix is 𝐼𝑛, so rref(𝑈)=𝐼𝑛, and by Theorem 3.3.23 𝑈 is invertible with 𝑈−1=𝐺, the product of the elementary matrices used. Each of them is upper triangular. If 𝑉 and 𝑊 are upper triangular, then (𝑉𝑊)𝑖𝑗=∑𝑙𝑣𝑖𝑙𝑤𝑙𝑗 and a term can be nonzero only if 𝑖≤𝑙≤𝑗; so (𝑉𝑊)𝑖𝑗=0 for 𝑖>𝑗, and (𝑉𝑊)𝑖𝑖=𝑣𝑖𝑖𝑤𝑖𝑖. Hence 𝐺 is upper triangular, and its diagonal is the entrywise product of the diagonals of its factors. The scaling in pass 𝑘 has diagonal entry 𝑢𝑘𝑘−1 in position 𝑘 and 1 elsewhere, and the replacements have only 1s on the diagonal, so 𝐺𝑘𝑘=𝑢𝑘𝑘−1.

(b) Let 𝑘 be the smallest index with 𝑢𝑘𝑘=0, so 𝑢𝑖𝑖≠0 for 𝑖<𝑘. Put 𝑥𝑗=0 for 𝑗>𝑘 and 𝑥𝑘=1, and for 𝑖=𝑘−1,𝑘−2,…,1 in turn, put

𝑥𝑖=−𝑢𝑖𝑖−1∑𝑗=𝑖+1𝑘𝑢𝑖𝑗𝑥𝑗.

Since 𝑈 is upper triangular, entry 𝑖 of 𝑈𝐱 is ∑𝑗≥𝑖𝑢𝑖𝑗𝑥𝑗. For 𝑖>𝑘 this involves only 𝑥𝑗 with 𝑗>𝑘, which are 0. For 𝑖=𝑘 it is 𝑢𝑘𝑘⋅1=0. For 𝑖<𝑘 it is 𝑢𝑖𝑖𝑥𝑖+∑𝑗=𝑖+1𝑘𝑢𝑖𝑗𝑥𝑗=0 by the choice of 𝑥𝑖. So 𝑈𝐱=𝟎 with 𝐱≠𝟎. If 𝑈 were invertible, then 𝐱=𝑈−1𝑈𝐱=𝟎. So 𝑈 is not invertible.

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.standard Let 𝐹 be a subfield of a field 𝐾 (for example ℚ⊆ℝ or ℝ⊆ℂ), and let 𝐴∈𝐹𝑚×𝑛, so that 𝐴 is also a matrix over 𝐾.

  1. (a)Show that rref(𝐴) is the same whether it is computed over 𝐹 or over 𝐾.
  2. (b)Deduce that if 𝐴∈𝐹𝑛×𝑛 is invertible as a matrix over 𝐾, then 𝐴−1 has all its entries in 𝐹.
  3. (c)Show that 𝐴,𝐵∈𝐹𝑚×𝑛 are row equivalent over 𝐾 (using elementary matrices with entries in 𝐾) if and only if they are row equivalent over 𝐹.

Solution.

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)

Hint 1. Compare the two runs step by step. Which field operations does the algorithm use, and do they give the same results in 𝐹 and in 𝐾?
Hint 2. For (b), run Algorithm 3.3.24 over 𝐹.
Hint 3. For (c), one direction is free. For the other, use (a) and Corollary 3.3.18(b) twice.
Sketch. The algorithm only tests entries for being 0, inverts nonzero entries, and adds and multiplies; a subfield is closed under these operations and computes them as 𝐾 does. So by induction the runs over 𝐹 and 𝐾 perform the same operations. (b) Over 𝐾, rref(𝐴)=𝐼𝑛; so the run over 𝐹 gives (𝐼𝑛|𝐺) with 𝐺 over 𝐹, and 𝐺=𝐴−1. (c) rref𝐹(𝐴)=rref𝐾(𝐴)=rref𝐾(𝐵)=rref𝐹(𝐵).

(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 0, 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 rref(𝐴)=𝐼𝑛 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),

rref𝐹(𝐴)=rref𝐾(𝐴)=rref𝐾(𝐵)=rref𝐹(𝐵),

where the subscript records the field used. By Corollary 3.3.18(b) over 𝐹, 𝐴 and 𝐵 are row equivalent over 𝐹.

Exercise 3.3.55.standard
  1. (a)Describe a procedure that, given 𝐴,𝐵∈𝐹𝑚×𝑛, decides whether 𝐴∼𝐵 and, if so, finds an invertible 𝐺 with 𝐺𝐴=𝐵.
  2. (b)Carry it out for 𝐴=(121243) and 𝐵=(001122) over ℚ.

Solution.

Uses. Proposition 3.3.11 (Carrying extra columns along), Corollary 3.3.18 (RREF and row equivalence), Theorem 3.3.23 (Invertibility and RREF)

Hint 1. Compute rref(𝐴)=𝐺𝐴𝐴 and rref(𝐵)=𝐺𝐵𝐵. When can 𝐴∼𝐵 hold, and how would you get from 𝐴 to 𝐵?
Hint 2. If 𝐺𝐴𝐴=𝐺𝐵𝐵, then 𝐵=𝐺𝐵−1𝐺𝐴𝐴. To compute 𝐺𝐵−1𝐺𝐴, you can row reduce (𝐺𝐵|𝐺𝐴).
Sketch. Row reduce (𝐴|𝐼𝑚) and (𝐵|𝐼𝑚) to (𝑅𝐴|𝐺𝐴) and (𝑅𝐵|𝐺𝐵). If 𝑅𝐴≠𝑅𝐵, then 𝐴 and 𝐵 are not row equivalent. If 𝑅𝐴=𝑅𝐵, then 𝐺=𝐺𝐵−1𝐺𝐴 works. In (b), 𝐺𝐴=(3−1−21), 𝐺𝐵=(−2110), and 𝐺=(−21−11).

(a) Row reduce (𝐴|𝐼𝑚) and (𝐵|𝐼𝑚), scanning only the first 𝑛 columns. By Proposition 3.3.11 this gives (𝑅𝐴|𝐺𝐴) and (𝑅𝐵|𝐺𝐵) with 𝑅𝐴=rref(𝐴)=𝐺𝐴𝐴 and 𝑅𝐵=rref(𝐵)=𝐺𝐵𝐵, where 𝐺𝐴,𝐺𝐵 are invertible. If 𝑅𝐴≠𝑅𝐵, then 𝐴 and 𝐵 are not row equivalent, by Corollary 3.3.18(b). If 𝑅𝐴=𝑅𝐵, then 𝐺𝐴𝐴=𝐺𝐵𝐵, so 𝐵=𝐺𝐴 with 𝐺=𝐺𝐵−1𝐺𝐴, which is invertible. To compute it, row reduce (𝐺𝐵|𝐺𝐴), scanning only the first 𝑚 columns: since 𝐺𝐵 is invertible, rref(𝐺𝐵)=𝐼𝑚, and the run’s product is 𝐺𝐵−1 (Theorem 3.3.23), so the result is (𝐼𝑚|𝐺𝐵−1𝐺𝐴) by Proposition 3.3.11.

(b) For 𝐴: adding −2 times row 1 to row 2 gives (121001), and adding −1 times row 2 to row 1 gives 𝑅𝐴=(120001). The same operations on 𝐼2 give 𝐺𝐴=(3−1−21). For 𝐵: swapping the rows gives (122001), and adding −2 times row 2 to row 1 gives 𝑅𝐵=(120001)=𝑅𝐴. The same operations on 𝐼2 give 𝐺𝐵=(−2110). So 𝐴∼𝐵. Since 𝐺𝐵=𝐸2,−2,1𝐸12, its inverse is 𝐸12𝐸2,2,1=(0112) (Corollary 3.2.11), and

𝐺=𝐺𝐵−1𝐺𝐴=(0112)(3−1−21)=(−21−11).

Check:

𝐺𝐴=(−2+2−4+4−2+3−1+2−2+4−1+3)=(001122)=𝐵.

Exercise 3.3.56.hard Let 𝔽 be ℝ or ℂ. A matrix 𝐴∈𝔽𝑛×𝑛 is strictly diagonally dominant if in every row the diagonal entry outweighs the rest:

|𝑎𝑖𝑖|>∑𝑗≠𝑖|𝑎𝑖𝑗|for𝑖=1,…,𝑛.

Show that Gauss–Jordan elimination on such an 𝐴 never needs a swap, and conclude that 𝐴 is invertible.

Solution.

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)

Hint 1. Pass 1 is fine, since 𝑎11≠0. Find an invariant that makes every later pass equally fine.
Hint 2. After pass 1, the entries in rows and columns 2,…,𝑛 are 𝑎𝑖𝑗−𝑎𝑖1𝑎1𝑗/𝑎11. Show that this (𝑛−1)×(𝑛−1) block is again strictly diagonally dominant.
Hint 3. Bound ∑𝑗≥2,𝑗≠𝑖|𝑎1𝑗| using row 1, and ∑𝑗≥2,𝑗≠𝑖|𝑎𝑖𝑗| using row 𝑖, and finish with |𝑥|−|𝑦|≤|𝑥−𝑦|.
Sketch. Invariant before pass 𝑘: columns 1,…,𝑘−1 are 𝐞1,…,𝐞𝑘−1, rows 𝑘,…,𝑛 vanish in those columns, and the block of rows and columns 𝑘,…,𝑛 is strictly diagonally dominant. Then the (𝑘,𝑘) entry is a nonzero pivot, and the new block entries are 𝑚𝑖𝑗−𝑚𝑖𝑘𝑚𝑘𝑗/𝑚𝑘𝑘. Bounding the off-diagonal entries of row 𝑖 of the new block with the dominance of rows 𝑘 and 𝑖 and the triangle inequality shows that the new block is again strictly diagonally dominant. After 𝑛 passes the matrix is 𝐼𝑛.

We show by induction on 𝑘=1,…,𝑛 that before pass 𝑘 the current matrix 𝑀 satisfies: (i) columns 1,…,𝑘−1 of 𝑀 are 𝐞1,…,𝐞𝑘−1; (ii) rows 𝑘,…,𝑛 of 𝑀 vanish in columns 1,…,𝑘−1; (iii) the block (𝑚𝑖𝑗)𝑘≤𝑖,𝑗≤𝑛 is strictly diagonally dominant. For 𝑘=1, 𝑀=𝐴 and this is the hypothesis.

Assume (i)–(iii) before pass 𝑘. By (iii), |𝑚𝑘𝑘|>∑𝑗>𝑘,𝑗≠𝑘|𝑚𝑘𝑗|≥0, so 𝑚𝑘𝑘≠0. By (ii), the scan picks column 𝑘, and the (𝑘,𝑘) entry is nonzero, so there is no swap. The pass scales row 𝑘 by 𝑚𝑘𝑘−1 and then, for each 𝑖≠𝑘, adds −𝑚𝑖𝑘 times the new row 𝑘 to row 𝑖. Row 𝑘 vanishes in columns 1,…,𝑘−1 by (ii), so these columns do not change, and column 𝑘 becomes 𝐞𝑘. This gives (i) and (ii) for 𝑘+1. For 𝑖,𝑗>𝑘, the new entries are

𝑚𝑖𝑗′=𝑚𝑖𝑗−𝑚𝑖𝑘𝑚𝑘𝑗𝑚𝑘𝑘.

To prove (iii) for 𝑘+1, 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 |𝑚𝑖𝑘|/|𝑚𝑘𝑘|≥0, so it may become an equality),

∑′|𝑚𝑖𝑗′|≤∑′|𝑚𝑖𝑗|+|𝑚𝑖𝑘||𝑚𝑘𝑘|∑′|𝑚𝑘𝑗|<|𝑚𝑖𝑖|−|𝑚𝑖𝑘|+|𝑚𝑖𝑘||𝑚𝑘𝑘|(|𝑚𝑘𝑘|−|𝑚𝑘𝑖|)=|𝑚𝑖𝑖|−|𝑚𝑖𝑘𝑚𝑘𝑖𝑚𝑘𝑘|≤|𝑚𝑖𝑖−𝑚𝑖𝑘𝑚𝑘𝑖𝑚𝑘𝑘|=|𝑚𝑖𝑖′|,

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 rref(𝐴)=𝐼𝑛, and 𝐴 is invertible by Theorem 3.3.23.

Exercise 3.3.57.hard Let 𝐴∈𝐹𝑚×𝑛, and let 𝐺∈𝐹𝑚×𝑚 be invertible with 𝐺𝐴=rref(𝐴), which has 𝑟 pivots. For a row vector 𝐳=(𝑧1,…,𝑧𝑚), the product 𝐳𝐴 is 𝑧1 times row 1 of 𝐴, plus ⋯, plus 𝑧𝑚 times row 𝑚. Call 𝐳 a relation among the rows of 𝐴 if 𝐳𝐴=𝟎. Show that the relations among the rows of 𝐴 are exactly the linear combinations of the last 𝑚−𝑟 rows of 𝐺.

Solution.

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)

Hint 1. The rows of 𝐺 numbered 𝑟+1,…,𝑚 are relations, since the corresponding rows of 𝐺𝐴 are zero.
Hint 2. Conversely, if 𝐳𝐴=𝟎, put 𝐰=𝐳𝐺−1, so that 𝐳=𝐰𝐺 and 𝐰rref(𝐴)=𝟎.
Hint 3. Look at the entries of 𝐰rref(𝐴) in the pivot columns.
Sketch. Row 𝑖 of 𝐺𝐴 is (row 𝑖 of 𝐺) 𝐴, so the last 𝑚−𝑟 rows of 𝐺 are relations, and so are their combinations. If 𝐳𝐴=𝟎, then 𝐰=𝐳𝐺−1 satisfies 𝐰𝑅=𝟎 with 𝑅=rref(𝐴); the entry of 𝐰𝑅 in column 𝑝𝑠 is 𝑤𝑠, so 𝑤1=⋯=𝑤𝑟=0, and 𝐳=𝐰𝐺 is a combination of rows 𝑟+1,…,𝑚 of 𝐺.

Let 𝑅=rref(𝐴)=𝐺𝐴 and let 𝛄1,…,𝛄𝑚 be the rows of 𝐺. By Definition 2.4.1, row 𝑖 of 𝐺𝐴 is 𝛄𝑖𝐴, and (𝑐𝐳+𝑐′𝐳′)𝐴=𝑐𝐳𝐴+𝑐′𝐳′𝐴.

By Proposition 3.3.8(a), rows 𝑟+1,…,𝑚 of 𝑅 are zero, so 𝛄𝑖𝐴=𝟎 for 𝑖>𝑟. Hence every linear combination of 𝛄𝑟+1,…,𝛄𝑚 is a relation.

Conversely, let 𝐳𝐴=𝟎, and put 𝐰=𝐳𝐺−1. Then 𝐳=𝐰𝐺, and

𝐰𝑅=𝐰𝐺𝐴=𝐳𝐴=𝟎.

Now 𝐰𝑅 is 𝑤1 times row 1 of 𝑅, plus ⋯, plus 𝑤𝑚 times row 𝑚 of 𝑅. Let 𝑝1<⋯<𝑝𝑟 be the pivot columns. Column 𝑝𝑠 of 𝑅 is 𝐞𝑠 (Lemma 3.3.16(b)), so row 𝑖 of 𝑅 has entry 1 in column 𝑝𝑠 if 𝑖=𝑠 and 0 otherwise, and the entry of 𝐰𝑅 in column 𝑝𝑠 is 𝑤𝑠. Hence 𝑤𝑠=0 for 𝑠≤𝑟, and

𝐳=𝐰𝐺=𝑤𝑟+1𝛄𝑟+1+⋯+𝑤𝑚𝛄𝑚.

In the language of transposes, 𝐳𝐴=𝟎 says 𝐴𝖳𝐳𝖳=𝟎. So the transposes of the last 𝑚−𝑟 rows of 𝐺 span ker𝑇𝐴𝖳, one of the four fundamental subspaces of Section 4.3.

Exercise 3.3.58.hard Let 𝑝 be a prime. For 0≤𝑟≤𝑛, let 𝑁(𝑟,𝑛) be the number of 𝑟×𝑛 matrices over 𝔽𝑝 that are in RREF and have no zero row; put 𝑁(0,𝑛)=1, and 𝑁(𝑟,𝑛)=0 for 𝑟>𝑛.

  1. (a)Show that for 1≤𝑟≤𝑛 and 𝑛≥2,

    𝑁(𝑟,𝑛)=𝑝𝑟𝑁(𝑟,𝑛−1)+𝑁(𝑟−1,𝑛−1).
  2. (b)For 𝑝=2, compute 𝑁(2,4), and the number of row equivalence classes in 𝔽22×4.

Solution.

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)

Hint 1. Split according to whether the last column is a pivot column.
Hint 2. If column 𝑛 is a pivot column, it must hold the last pivot. Delete the last row and the last column. If it is not, delete only the last column. In each case, what can the deleted column have been?
Hint 3. For (b), a class contains exactly one matrix in RREF, and a 2×4 matrix in RREF has 0, 1, or 2 nonzero rows, all at the top.
Sketch. If column 𝑛 is a pivot column, it is the last one, so it is 𝐞𝑟, row 𝑟 is (0,…,0,1), and deleting row 𝑟 and column 𝑛 gives a bijection onto the (𝑟−1)×(𝑛−1) matrices in RREF without zero rows. Otherwise all 𝑟 pivots lie in columns 1,…,𝑛−1, those columns form an 𝑟×(𝑛−1) matrix in RREF without zero rows, and column 𝑛 is arbitrary: 𝑝𝑟 choices. For 𝑝=2: 𝑁(1,𝑛)=2𝑛−1, 𝑁(2,3)=7, 𝑁(2,4)=4⋅7+7=35, and there are 1+15+35=51 classes.

(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 𝑝1<⋯<𝑝𝑟.

Column 𝑛 is a pivot column. Then 𝑝𝑟=𝑛, column 𝑛 is 𝐞𝑟, and row 𝑟, whose leading entry is in column 𝑛, is (0,…,0,1). Deleting row 𝑟 and column 𝑛 leaves an (𝑟−1)×(𝑛−1) matrix 𝑅0. Rows 1,…,𝑟−1 of 𝑅 have zero entries in column 𝑛, so they keep their leading entries, and 𝑅0 satisfies (R1)–(R4) with no zero row. Conversely, for any such 𝑅0, the matrix (𝑅0001) satisfies (R1)–(R4) with no zero row and has column 𝑛 as a pivot column. So there are 𝑁(𝑟−1,𝑛−1) matrices in this case.

Column 𝑛 is not a pivot column. Then all 𝑟 pivots lie in columns 1,…,𝑛−1, and deleting column 𝑛 leaves an 𝑟×(𝑛−1) 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 𝑝𝑟𝑁(𝑟,𝑛−1) matrices in this case. (When 𝑟=𝑛 there are none, consistent with 𝑁(𝑛,𝑛−1)=0.)

Adding the two cases gives the recursion.

(b) With 𝑝=2: 𝑁(1,1)=1 and 𝑁(1,𝑛)=2𝑁(1,𝑛−1)+1, so 𝑁(1,2)=3, 𝑁(1,3)=7, 𝑁(1,4)=15. Next 𝑁(2,2)=4⋅0+𝑁(1,1)=1, 𝑁(2,3)=4⋅1+3=7, and

𝑁(2,4)=4⋅𝑁(2,3)+𝑁(1,3)=28+7=35.

A 2×4 matrix in RREF has 𝑟∈{0,1,2} nonzero rows, which by (R1) are its top 𝑟 rows, and they form an 𝑟×4 matrix in RREF without zero rows. So there are 𝑁(0,4)+𝑁(1,4)+𝑁(2,4)=1+15+35=51 of them. As in Exercise 3.3.48, each row equivalence class contains exactly one matrix in RREF, so 𝔽22×4 has 51 classes.

The recursion is a 𝑝-analogue of Pascal’s rule (𝑛𝑟)=(𝑛−1𝑟)+(𝑛−1𝑟−1). Using row spaces and dimension (Chapter 4), one can show that 𝑁(𝑟,𝑛) is the number of 𝑟-dimensional subspaces of 𝔽𝑝𝑛.

Exercise 3.3.59.routineBeyond 21-242 Let

𝐴=(120372−2−15),𝑆=(42−2251−216).

(a) Find the LU factorization of 𝐴.

(b) Find the 𝐿𝐷𝐿𝖳 factorization of the symmetric matrix 𝑆, and write 𝑆=𝑀𝑀𝖳 with 𝑀 lower triangular.

Solution.

Uses. Theorem 3.3.33 (PLU and LU factorizations), Theorem 3.3.37 (𝐿𝐷𝐿𝖳 factorization)

Hint 1. Run Gaussian elimination and record the multipliers; they are the entries of 𝐿 below the diagonal.
Hint 2. For (b), the diagonal of 𝑈 gives 𝐷. Here all its entries are equal.
Sketch. (a) The multipliers are ℓ21=3, ℓ31=−2, ℓ32=3, and 𝑈 has rows (1,2,0), (0,1,2), (0,0,−1). (b) The multipliers are 1/2, −1/2, 1/2, and 𝑈 has diagonal 4,4,4, so 𝐷=4𝐼3 and 𝑆=(2𝐿)(2𝐿)𝖳; the rows of 𝑀=2𝐿 are (2,0,0), (1,2,0), (−1,1,2).

(a) Pass 1 uses the multipliers ℓ21=3 and ℓ31=−2, leaving rows (0,1,2) and (0,3,5). Pass 2 uses ℓ32=3, leaving (0,0,−1). By Theorem 3.3.33(b),

𝐴=(100310−231)(12001200−1).

Check the last row:

−2(1,2,0)+3(0,1,2)+(0,0,−1)=(−2,−1,5).

(b) Pass 1 uses ℓ21=2/4=1/2 and ℓ31=−2/4=−1/2, leaving rows (0,4,2) and (0,2,5). Pass 2 uses ℓ32=1/2, leaving (0,0,4). So

𝐿=(1001/210−1/21/21),𝑈=(42−2042004),

and 𝐷=4𝐼3. By Theorem 3.3.37, 𝑆=𝐿(4𝐼3)𝐿𝖳; indeed 4𝐿𝖳=𝑈. So 𝑆=(2𝐿)(2𝐿)𝖳=𝑀𝑀𝖳 with

𝑀=2𝐿=(200120−112).

Check: the rows of 𝑀 have pairwise products 4,2,−2 (row 1 with rows 1,2,3), 1+4=5, −1+2=1, and 1+1+4=6, which are the entries of 𝑆.

Exercise 3.3.60.standardBeyond 21-242 Show that an invertible matrix 𝐴∈𝐹𝑛×𝑛 has at most one factorization 𝐴=𝐿𝑈 with 𝐿 unit lower triangular and 𝑈 upper triangular.

Solution.

Uses. Lemma 3.3.32 (Products and inverses of triangular matrices), Exercise 3.3.53, Definition 2.5.12 (Invertible)

Hint 1. Suppose 𝐿1𝑈1=𝐿2𝑈2. Why are 𝑈1 and 𝑈2 invertible, and why is 𝑈1−1 upper triangular?
Hint 2. Rearrange to 𝐿2−1𝐿1=𝑈2𝑈1−1, and look at both sides.
Sketch. 𝑈𝑖=𝐿𝑖−1𝐴 is invertible, so by Exercise 3.3.53 it has nonzero diagonal entries and an upper triangular inverse. Then 𝐿2−1𝐿1=𝑈2𝑈1−1 is unit lower triangular and upper triangular, hence 𝐼𝑛.

Suppose 𝐴=𝐿1𝑈1=𝐿2𝑈2 with 𝐿1,𝐿2 unit lower triangular and 𝑈1,𝑈2 upper triangular. By Lemma 3.3.32, 𝐿𝑖 is invertible, so 𝑈𝑖=𝐿𝑖−1𝐴 is invertible, as a product of invertible matrices. By Exercise 3.3.53(b), the diagonal entries of 𝑈1 are nonzero, and then by Exercise 3.3.53(a), 𝑈1−1 is upper triangular. Multiplying 𝐿1𝑈1=𝐿2𝑈2 on the left by 𝐿2−1 and on the right by 𝑈1−1 gives

𝐿2−1𝐿1=𝑈2𝑈1−1.

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 1. So 𝐿2−1𝐿1=𝐼𝑛=𝑈2𝑈1−1, that is, 𝐿1=𝐿2 and 𝑈1=𝑈2.

Exercise 3.3.61.challengeBeyond 21-242 Call an 𝑛×𝑛 matrix an integer elementary matrix if it is a swap 𝐸𝑖𝑗, a sign change 𝐸𝑖,−1, or a replacement 𝐸𝑖𝑐𝑗 with 𝑐∈ℤ. Show that for 𝐴∈ℤ𝑛×𝑛 the following are equivalent:

  1. (i)𝐴 is invertible (over ℚ), and 𝐴−1 has integer entries;
  2. (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 ℤ.

Solution.

Uses. Exercise 3.2.54, Proposition 3.2.10 (Inverses of elementary matrices), Definition 2.4.33 (Block matrix), induction on 𝑛

Hint 1. (ii) ⇒ (i) is quick. For the converse, induct on 𝑛 and imitate the first pass of Gauss–Jordan elimination, using only integer operations.
Hint 2. Let 𝐵=𝐴−1. The (1,1) entry of 𝐵𝐴=𝐼𝑛 shows that the entries of the first column of 𝐴 have greatest common divisor 1.
Hint 3. Use Exercise 3.2.54 on rows 1 and 𝑖, for 𝑖=2,…,𝑛 in turn, to make the first column 𝐞1. Then show the lower right (𝑛−1)×(𝑛−1) block has an integer inverse.
Sketch. (ii) ⇒ (i): inverses of integer elementary matrices are integer elementary. (i) ⇒ (ii): the first column of 𝐴 has gcd 1, because ∑𝑘𝑏1𝑘𝑎𝑘1=1. Euclid’s algorithm on pairs of rows, done with integer elementary matrices, gives 𝐻𝐴=(1𝐰0𝐴′). This matrix has an integer inverse, and comparing blocks shows that 𝐴′ has one too. By induction 𝐴′ reduces to 𝐼𝑛−1 by integer operations on rows 2,…,𝑛, and integer replacements clear 𝐰. So 𝑃𝐴=𝐼𝑛 for a product 𝑃 of integer elementary matrices, and 𝐴=𝑃−1.

(ii) ⇒ (i). Integer elementary matrices have integer entries, and by Proposition 3.2.10 their inverses 𝐸𝑖𝑗, 𝐸𝑖,−1, 𝐸𝑖(−𝑐)𝑗 are again integer elementary. If 𝐴=𝐸1⋯𝐸𝑘 with all 𝐸𝑙 integer elementary, then 𝐴 is invertible with 𝐴−1=𝐸𝑘−1⋯𝐸1−1, 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 𝐴=𝑃−1 is a product of integer elementary matrices by the first part. For 𝑛=1, 𝐴=(𝑎) with 𝑎 and 1/𝑎 integers, so 𝑎=±1, and 𝑃=(1) or 𝑃=𝐸1,−1 works.

Let 𝑛≥2 and 𝐵=𝐴−1∈ℤ𝑛×𝑛. The (1,1) entry of 𝐵𝐴=𝐼𝑛 is ∑𝑘𝑏1𝑘𝑎𝑘1=1, so every common divisor of 𝑎11,…,𝑎𝑛1 divides 1. For 𝑖=2,…,𝑛 in turn, if the current entries in positions (1,1) and (𝑖,1) are not both 0, apply Exercise 3.2.54(b) to them: it gives 2×2 integer elementary matrices that turn this pair into (their gcd, 0), and acting on rows 1 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 (𝑔,0,…,0), where 𝑔≥1 is a common divisor of the original entries; hence 𝑔=1. So we have a product 𝐻1 of integer elementary matrices with

𝐻1𝐴=(1𝐰0𝐴′),𝐰∈ℤ1×(𝑛−1),𝐴′∈ℤ(𝑛−1)×(𝑛−1).

This matrix is invertible with integer inverse 𝐶=𝐴−1𝐻1−1. Write 𝐶=(𝑐𝐱𝐲𝐶′) in the same block sizes. Comparing first block columns in 𝐶(𝐻1𝐴)=𝐼𝑛 gives 𝑐=1 and 𝐲=𝟎, and then the lower right blocks of 𝐶(𝐻1𝐴)=𝐼𝑛 and (𝐻1𝐴)𝐶=𝐼𝑛 give 𝐶′𝐴′=𝐼𝑛−1 and 𝐴′𝐶′=𝐼𝑛−1. So 𝐴′ is invertible with integer inverse 𝐶′, and by the induction hypothesis there is a product 𝑃′ of (𝑛−1)×(𝑛−1) integer elementary matrices with 𝑃′𝐴′=𝐼𝑛−1. Each factor 𝐹 of 𝑃′ gives the 𝑛×𝑛 integer elementary matrix (100𝐹) (with indices shifted by one), so 𝐻2=(100𝑃′) is a product of integer elementary matrices, and 𝐻2𝐻1𝐴=(1𝐰0𝐼𝑛−1). Finally, adding −𝑤𝑗 times row 𝑗+1 to row 1, for 𝑗=1,…,𝑛−1, clears 𝐰 with integer replacements. This gives 𝑃𝐴=𝐼𝑛 with 𝑃 a product of integer elementary matrices.

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.