Chapter 2: Linear maps and matrices
2.4Matrix multiplication
Once bases are fixed, a linear map and its matrix carry the same information (Theorem 2.3.20). Linear maps can be composed (Proposition 2.1.17), so matrices should be able to multiply, and the product of two matrices should be the matrix of the composite. This section takes that as the definition of the product. The formula for the entries, the algebraic laws, and the failures of commutativity and cancellation all follow from it, and each of them is the shadow of a fact about composition.
Throughout, , , and are vector spaces over with bases of , of , and of , where . As in Notation 2.1.18, we write for the composite .
2.4.1The product of two matrices
Intuition (Computing from and ). Let and , so that . The -th column of is the coordinate vector of
and is the -th column of . So the -th column of is times the -th column of . As with the matrix–vector product in Section 2.3.2, the answer no longer mentions , , the spaces, or the bases. It is computed from the two matrices alone, so it is an operation on matrices, and we give it a name.
Definition 2.4.1 (Matrix product). Let and , and let be the columns of . The product is the matrix whose -th column is :
It is defined only when the number of columns of equals the number of rows of . By Proposition 2.3.11, applied to the -th column, the entry of in row and column is
The sizes behave like dominoes: an matrix times an matrix is an matrix, and the two inner sizes must match. A column is an matrix, and the product of with it in the sense of Definition 2.4.1 has the single column . So the matrix–vector product of Definition 2.3.8 is the special case , and the notation is unambiguous.
(a)For and ,
- (b)For and , . That is, for every .
Uses. Definition 2.3.1 (Matrix of a linear map), Theorem 2.3.9 (The matrix of a map computes the map), Definition 2.4.1 (Matrix product), Proposition 2.3.16 (The matrix of ), Proposition 2.3.17 (Every linear map is some ), Proposition 2.1.17 (Compositions of linear maps are linear)
Techniques. Translate between maps and matrices (Technique 2.3.27)
(a) Both sides are matrices. By Definition 2.3.1, the -th column of is . By the definition of composition and Theorem 2.3.9,
The vector is the -th column of (Definition 2.3.1), so by Definition 2.4.1 this is the -th column of . The two matrices have the same columns, so they are equal.
(b) The map is linear (Proposition 2.1.17). By (a) with the standard bases of , , and , and by Proposition 2.3.16,
By Proposition 2.3.17, every linear map is multiplication by its standard matrix, so . Evaluating at gives . □
The subscripts in (a) behave like the sizes: in the two inner bases agree and drop out, leaving . Also notice the order. means “first , then ”, and the matrix of the map applied first stands on the right, as does in . This is the price of writing functions to the left of their arguments, and it is why products of matrices are read from right to left.
As with the matrix–vector product (Proposition 2.3.10), the definition is not a convention. Even the special case of standard bases leaves no other choice.
Proposition 2.4.3 (The product is forced). Suppose that for all we are given a rule that assigns to each and a matrix , such that for all and ,
Then for all and .
Uses. Proposition 2.3.16 (The matrix of ), Theorem 2.4.2 (The matrix of a composite)
Techniques. Uniqueness via two candidates (Technique 1.1.8)
Let and . By Proposition 2.3.16, and . Applying the hypothesis to and , and then Theorem 2.4.2,
□
Figure 2.4.1 shows Theorem 2.4.2(b) in the plane. The grid in the last panel of each row is the image of the square grid under the composite, and the two colored arrows are the columns of the product.
Example 2.4.4 (A product by columns). Let and . The columns of are and , which by Definition 2.3.8 are
so . The product is also defined, but it is a matrix:
whose columns are , , and . Even the sizes of and differ.
(a)Let be differentiation and , so that
(Example 2.3.4). By Theorem 2.4.2, and , and indeed The first says
. The second is the matrix form of , which we could only observe one vector at a time in Intuition (One basis or two). (b)Rotating by and then by is rotating by , so (Exercise 2.1.43). By Theorem 2.4.2 and Example 2.3.3,
The first column of the left side is , and by the column view of the product, the first column of the right side is
These are the angle addition formulas for and . In Example 2.1.11 we used those formulas to show that rotations are linear, so here they are recovered rather than proved. But if one accepts from geometry that rotations are linear, then their matrices come from Corollary 2.2.17 without any trigonometric identity, as noted in Section 2.2.5, and this computation is a proof of the angle addition formulas.
(c)Let , a basis of when . In Example 2.3.24 we found and
. Since , Theorem 2.4.2 gives and indeed
, which becomes after multiplying by . Converting standard coordinates into -coordinates and back changes nothing. Matrices whose products are in this way are the invertible matrices of Section 2.5, and those of the form are studied in Section 4.5.
- (a)Over , let and . Compute and . Which of and are defined?
- (b)Over , compute and .
Uses. Definition 2.4.1 (Matrix product), Definition 2.3.8 (Matrix–vector product)
(a) By columns,
The columns of are
A product needs as many columns in as rows in . is , so is not defined, and is , so is not defined either.
(b) By the entry formula, the first product has entries , , , and , and the second has entries , , , and :
The two products differ.
2.4.2Four views of the product
The definition describes one column at a time, but a product can be read in several other ways, and choosing the right one often makes a problem easy. We first fix some notation.
Notation 2.4.7 (Entries, rows, and columns). For a matrix given by an expression, such as , we write or for its entry in row and column , and
A row of an matrix is a matrix, and a column is an matrix, that is, an element of . We identify a matrix with the scalar . The Kronecker delta is
so that and
(a)Entries. The entry of is row of times column of :
(b)Columns. Column of is a combination of the columns of , with coefficients from column of :
(c)Rows. Row of is a combination of the rows of , with coefficients from row of :
(d)Columns times rows. is a sum of products of a column with a row:
Uses. Definition 2.4.1 (Matrix product), Definition 2.3.8 (Matrix–vector product), Definition 1.2.7 (Matrices)
(a) The formula
(b) By Definition 2.4.1, column of is with
(c) By (a), applied to and , the matrix has -th entry . Matrices are added and scaled entrywise (Definition 1.2.7), so the -th entry of is also . By (a), both equal the -th entry of .
(d) By (a), applied with inner size , the matrix has entry . Adding these matrices entrywise over gives the matrix with entry
Each view is the right one for some job.
- The entry view (a) is the quickest way to compute a product by hand, and the one to use in proofs about individual entries, such as the shape of a product of triangular matrices (Proposition 2.4.36).
- The column view (b) answers questions about columns. Since every column of is a linear combination of the columns of , the span of the columns of is contained in the span of the columns of (Proposition 1.4.14): multiplying on the right cannot produce new directions. This is the first step towards (Section 4.3). It also says that multiplying on the right recombines columns, which is how column operations become matrix products (Section 3.2).
- The row view (c) is the mirror image: multiplying on the left recombines its rows. This is why row operations, and Gauss–Jordan elimination as a whole, are left multiplications (Section 3.2, Section 3.3).
- The column–row view (d) writes as a sum of simple pieces, each built from one column and one row. It is the view to use when has few columns, for block multiplication (Theorem 2.4.34), and for decompositions of a matrix into simple pieces (Section 4.3, Section 9.1).
Example 2.4.9 (One product, four ways). Let and over .
Entries.
Columns.
Rows. Row of is , so
Row of is , so row of is times row of , that is, . The row view gave this row with no computation at all.
Columns times rows.
The two terms are and , and their sum is .
Example 2.4.10 (Diagonal matrices). A square matrix is diagonal if whenever . We write
so diagonal matrices multiply entry by entry and commute with each other.
Exercise 2.4.11. Let and .
- (a)Show that if column of is zero, then so is column of , and that if row of is zero, then so is row of .
- (b)Show that if
, then . - (c)Give an example in which has a zero column but has none.
Uses. Proposition 2.4.8 (Four views of the product), Proposition 2.3.13 (Linearity of the product)
(a) By the column view (Proposition 2.4.8(b)),
(b) By the column view and the linearity of (Proposition 2.3.13),
In words: every linear relation among the columns of also holds among the columns of .
(c) We need a nonzero column with . Take and . Then , a zero column, while has none. A square example:
2.4.3Sums and scalar multiples
Matrices of the same size can also be added and scaled entrywise (Definition 1.2.7), and linear maps can be added and scaled pointwise (Proposition 2.1.23). These operations correspond to each other as well.
Proposition 2.4.12 (Matrices of sums and scalar multiples). Let and . Then
So is a linear bijection from onto .
Uses. Definition 2.3.1 (Matrix of a linear map), Definition 2.1.21 (Pointwise operations), Proposition 1.6.19 (Coordinates respect linear combinations), Definition 1.2.7 (Matrices), Theorem 2.3.20 (Linear maps correspond to matrices)
By Definition 2.3.1, Definition 2.1.21, and the linearity of (Proposition 1.6.19), the -th column of is
Matrices are added entrywise (Definition 1.2.7), so the -th column of
So the dictionary of Section 2.3.6 has three more entries: sums, scalar multiples, and composites of maps correspond to sums, scalar multiples, and products of matrices. In the language of Section 4.5, the proposition says that and are isomorphic vector spaces, and dimension counting there gives .
Example 2.4.13 (The difference operator). Let be the substitution , and . From , , and ,
The difference operator of Example 2.3.28 is , so by Proposition 2.4.12 and Example 2.3.6,
which is the matrix computed there column by column.
2.4.4The algebraic laws
- (a)Associativity. .
- (b)Identities. .
- (c)Distributivity.
and . - (d)Scalars.
.
Intuition (The laws come from composition). Read a product of matrices as a sequence of maps, applied from right to left:
Both and are the matrix of “first , then , then ”. The parentheses only record which two of the three steps were combined first, and the composite of three functions does not depend on that: both are
Proof (via composition).
Uses. Theorem 2.4.2 (The matrix of a composite), Proposition 2.1.24 (Algebra of composition), Proposition 2.3.13 (Linearity of the product), Proposition 2.3.17 (Every linear map is some )
Techniques. Translate between maps and matrices (Technique 2.3.27)
By Proposition 2.3.17, two matrices with are equal. So in each case it suffices to show that the two sides define the same linear map. We use Theorem 2.4.2(b), , and Proposition 2.3.13, which says that
(a) By Theorem 2.4.2 and part (a) of Proposition 2.1.24,
(b)
(c) By part (c) of Proposition 2.1.24,
and in the same way
(d) By part (d) of Proposition 2.1.24,
and the middle expression is
The first proof never looks at an entry. The second proof works with entries only, and it is the prototype of a move we will use constantly.
Technique 2.4.15 (Compute entry by entry). To prove an identity between matrices, show that the entries of the two sides agree for all and . Write each entry of a product with Proposition 2.4.8(a), using a new summation index for every product, then rearrange: pull constant factors out of sums, exchange the order of two finite sums, , and collapse sums containing a Kronecker delta,
Reach for it when the statement is about the entries themselves (transposes, traces, triangular or block shapes), or when there is no linear map in sight, for example for matrices whose entries are integers, polynomials, or other matrices. Two things go wrong in practice. Reusing a summation index in a nested sum silently identifies two different indices. And moving a factor past another needs commutativity of the entries, which holds for scalars but not for blocks (Section 2.4.8). The canonical example is the second proof of associativity below.
Used in 18 places and 2 practice exercises
Proposition 2.4.14, Proposition 2.4.23, Proposition 2.4.28, Theorem 2.4.34, Proposition 2.4.36, Proposition 2.4.39, Exercise 2.6.46, Exercise 2.8.6, Exercise 2.8.11, Problem 2.4, Problem 2.12, Theorem 5.5.9, Proposition 6.3.27, Exercise 6.3.60, Proposition 7.1.3, Theorem 7.6.28, Exercise 8.2.45, Proposition 8.3.25; 2 practice exercises.
Proof (entry by entry).
Uses. Proposition 2.4.8 (Four views of the product), Definition 1.1.1 (Field), Notation 2.4.7 (Entries, rows, and columns)
Techniques. Compute entry by entry (Technique 2.4.15)
(a) For and , by Proposition 2.4.8(a) twice,
The steps used distributivity and associativity in and the reordering of a finite sum.
(b)
(c) By distributivity in ,
and the other law is the same with the factors on the other side.
(d) Using commutativity of to move to the front,
and the middle expression is . □
The two proofs teach different things. The first explains why the laws hold: matrices multiply like composites because they are composites in disguise, and composition of functions is associative for trivial reasons. All the work went into the dictionary between maps and matrices. The second is self-contained and mechanical. Look at what it used in (a): the laws of addition, associativity of multiplication, and distributivity, but nothing about inverses or commutativity of multiplication. So the same computation proves associativity for matrices with entries in , in , or in any other number system with these laws, even one whose multiplication is not commutative, where there may be no vector spaces and linear maps to translate into. This is what makes block multiplication associative (Section 2.4.8), since blocks are matrices whose “entries” are matrices.
By associativity, products of three or more matrices need no parentheses.
Notation 2.4.16 (Powers of a matrix). For and an integer , ( factors), and . Then , and if and is a basis of , then
where .
Uses. Proposition 2.4.14 (Algebra of matrices), Definition 1.2.7 (Matrices)
By the two distributive laws of Proposition 2.4.14,
So
2.4.5What fails
Matrix multiplication shares associativity and distributivity with the multiplication of numbers, but three other familiar properties fail. In each case the failure is already visible for composition of maps.
Example 2.4.18 (). Let
Then
In terms of maps, sends and sends . Following through returns it to , but following it through kills it. For a geometric example, let be the projection onto the -axis and the rotation by a right angle, so that by Example 2.1.19. In matrices,
Figure 2.4.1 is a third example. When is defined, may not be, and if both are defined they may have different sizes (Example 2.4.4). So “” is a strong condition, which we express by saying that and commute.
Example 2.4.19 (Zero divisors and the failure of cancellation). With as above and ,
So a product of nonzero matrices can be zero, and even a nonzero square can be zero. In the language of Proposition 1.1.17, has zero divisors. Note also that while .
Cancellation fails with them: with , but . In general, means (Proposition 2.4.14(c)), so cancelling is legitimate exactly when forces . For that are left-invertible (Section 2.5) this holds; for the above it does not, since kills , and any whose columns lie in satisfies .
These examples are , which is the smallest size where anything can go wrong: is just , where multiplication is commutative and there are no zero divisors. For , put the examples in the top left corner of an matrix that is zero elsewhere. By block multiplication (Theorem 2.4.34) the products are computed in that corner, so has the same failures. Finding such examples is an instance of Technique 1.4.18: the first place to look is matrices whose entries are and .
Some matrices do commute. A scalar matrix commutes with every , since
Uses. Proposition 2.4.8 (Four views of the product), Definition 2.3.8 (Matrix–vector product)
By the column view (Proposition 2.4.8(b)), means that sends each column of to . Let . By Definition 2.3.8,
No entry of or is .
2.4.6The transpose
The row view and the column view are mirror images of each other. The transpose makes the mirror precise.
Definition 2.4.21 (Transpose). The transpose of
That is, row of is column of written as a row, and column of is row of written as a column. A square matrix is symmetric if and skew-symmetric if .
For example,
The second matrix is symmetric and the third skew-symmetric; symmetric matrices form the subspace of Example 1.4.11. A vector is a column, so is a row, and for the product
is a scalar. In the other order, for and , the column–row product has entry , as in Proposition 2.4.8(d).
Proposition 2.4.22 (Transpose is a linear involution). For and ,
So is a linear bijection , whose inverse is transposition .
Uses. Definition 2.4.21 (Transpose), Definition 1.2.7 (Matrices), Definition 2.3.5 (Identity matrix)
By Definition 2.4.21,
The entry of is . So transposition is linear, and applying it twice gives the identity map. Hence it is a bijection from to , with transposition as its inverse. □
Proposition 2.4.23 (Transpose of a product). For and ,
Proof (entry by entry).
Uses. Definition 2.4.21 (Transpose), Proposition 2.4.8 (Four views of the product), Definition 1.1.1 (Field)
Techniques. Compute entry by entry (Technique 2.4.15)
Both sides are . Let and . By Definition 2.4.21 and Proposition 2.4.8(a), then commutativity of multiplication in , then Definition 2.4.21 and Proposition 2.4.8(a) again,
□
The first proof used commutativity of at one step, and that step is where the order of the factors flips. The second proof explains the reversal through the views of the product: the row view of is the column view of in a mirror.
Proof (rows become columns).
Uses. Proposition 2.4.8 (Four views of the product), Proposition 2.4.22 (Transpose is a linear involution), Definition 2.4.21 (Transpose), Definition 2.3.8 (Matrix–vector product)
By Definition 2.4.21, column of is the transpose of row of . By the row view (Proposition 2.4.8(c)) and the linearity of transposition (Proposition 2.4.22),
since the transpose of row of is column of . On the other side, column of is the transpose of row of , with entries . By the column view (Proposition 2.4.8(b)), column of is
So and have the same columns. □
By induction,
The column–row products of standard basis vectors are the simplest matrices of all, and we will use them repeatedly.
- (a)Every is
, and these are the only coefficients that work. So the matrices form a basis of . - (b)For : , , and
. - (c)
, for matrices of compatible sizes.
Uses. Proposition 2.4.8 (Four views of the product), Proposition 2.4.14 (Algebra of matrices), Proposition 2.3.13 (Linearity of the product), Definition 1.6.1 (Basis), Notation 2.4.7 (Entries, rows, and columns)
By Proposition 2.4.8(a) with inner size , the entry of is , which is if and otherwise.
(a) Since matrices are added and scaled entrywise, the entry of is
(b) is Proposition 2.3.13(c). By the row view (Proposition 2.4.8(c)),
(c) By associativity (Proposition 2.4.14) and (b), is the entry of , which is . So
□
Part (c) gives the noncommutativity of Example 2.4.18 in its purest form: for ,
- (a)Show that and are symmetric for every .
- (b)Let be symmetric. Show that is symmetric, that is skew-symmetric, and that is symmetric if and only if .
Uses. Proposition 2.4.23 (Transpose of a product), Proposition 2.4.22 (Transpose is a linear involution)
(a) By Proposition 2.4.23 and Proposition 2.4.22,
(b) Since and , Proposition 2.4.23 gives
Finally is symmetric if and only if
2.4.7The trace
Matrix multiplication is not commutative, but there is a number attached to a square matrix that cannot tell from .
Definition 2.4.26 (Trace). The trace of
For example, and , which is over , , or and is over when . In this notation, the trace-zero matrices of Example 1.4.11 are those with .
Uses. Definition 2.4.26 (Trace), Definition 1.2.7 (Matrices), Definition 2.4.21 (Transpose)
Matrices are added and scaled entrywise, so
By Definition 2.4.21, , so . □
The trace is not multiplicative: for and we have , so , but . What it does satisfy is the following.
Proposition 2.4.28 (Cyclicity of the trace). For and ,
Proof (entry by entry).
Uses. Definition 2.4.26 (Trace), Proposition 2.4.8 (Four views of the product), Definition 1.1.1 (Field)
Techniques. Compute entry by entry (Technique 2.4.15)
By Definition 2.4.26 and Proposition 2.4.8(a),
where we exchanged the two finite sums and used commutativity of multiplication in . □
Proof (check on matrix units).
Uses. Lemma 2.4.24 (Matrix units), Proposition 2.4.27 (The trace is linear), Proposition 2.4.14 (Algebra of matrices), Corollary 2.2.6 (Agreeing on a spanning list), Definition 2.4.26 (Trace)
Techniques. Check it on a basis (Technique 2.2.7)
Fix , and define by and . Both are linear: for instance
By associativity and Lemma 2.4.24(b),
The first proof is shorter. The second shows what linearity in buys: only very simple products need to be computed, and each is a picture (one nonzero column, one nonzero row) rather than a sum.
Cyclicity extends to longer products by grouping:
Technique 2.4.29 (Cyclicity of trace). The trace is linear, and it does not see the order of two factors: , so is unchanged by rotating the factors cyclically. Take the trace of both sides of a claimed identity. If the traces differ, the identity is false; and quantities such as , which are invisible to the trace, can be eliminated.
Reach for it when commutators appear (they always have trace ), when a product is conjugated as in (once inverses are available,
Used in 28 places and 5 practice exercises
Proposition 2.4.30, Exercise 2.4.50, Exercise 2.4.52, Exercise 2.4.53, Exercise 2.4.54, Exercise 2.5.44, Exercise 2.8.12, Problem 2.9, Problem 2.16, Problem 2.17, Exercise 4.3.38, Exercise 4.3.43, Proposition 4.5.27, Exercise 4.5.47, Exercise 6.3.48, Exercise 6.4.51, Exercise 6.5.38, Problem 6.11, Problem 6.18, Proposition 7.5.25, Corollary 7.5.26, Exercise 7.5.41, Exercise 7.5.44, Exercise 7.6.56, Exercise 8.1.33, Exercise 8.1.37, Exercise 8.1.38, Exercise 8.3.34; 5 practice exercises.
Uses. Proposition 2.4.27 (The trace is linear), Proposition 2.4.28 (Cyclicity of the trace), Definition 2.4.26 (Trace)
Techniques. Cyclicity of trace (Technique 2.4.29)
In terms of maps: on the infinite-dimensional space , differentiation and multiplication by satisfy , by the product rule (Exercise 2.4.51). Proposition 2.4.30 says that this identity has no solution by matrices, that is, by operators on , when . In quantum mechanics the same relation holds between the position and momentum operators, and this is why they cannot act on a finite-dimensional space.
Remark 2.4.31 (The hypothesis is needed). The matrices of Example 2.4.18 satisfy
Over , where , this is . There is no contradiction with Proposition 2.4.30, because in , and indeed there. In general, over there are matrices with (Exercise 2.4.52).
Exercise 2.4.32. Find the error in the following argument, and show that its conclusion is false.
Claim. For all ,
Proof. By associativity and Proposition 2.4.28,
Uses. Proposition 2.4.28 (Cyclicity of the trace), Lemma 2.4.24 (Matrix units)
The error is in the step
The conclusion is false. In , let , , and . By Lemma 2.4.24(c), and , so
Hence
2.4.8Block matrices
Large matrices often have structure that is visible only when we group their entries into rectangular pieces, such as a block of zeros or a copy of the identity. Multiplication respects this grouping.
Definition 2.4.33 (Block matrix). Let . Split the row indices into consecutive groups of sizes , so , and the column indices into consecutive groups of sizes . The block is the submatrix of formed by the entries in the -th group of rows and the -th group of columns. We then write as an array of blocks,
and call this a block matrix, partitioned with row sizes and column sizes . A block of zeros is written .
For example, with row sizes and column sizes ,
where, for instance, and . A square block matrix with square diagonal blocks is block diagonal if all other blocks are zero, and block upper triangular if whenever .
Theorem 2.4.34 (Block multiplication). Let be partitioned with row sizes and column sizes , and let be partitioned with row sizes (the column sizes of ) and column sizes . Partition with row sizes and column sizes . Then
for and . That is, block matrices are multiplied by the entry formula, treating blocks as entries and keeping each product in its order.
Proof (entry by entry).
Uses. Definition 2.4.33 (Block matrix), Proposition 2.4.8 (Four views of the product)
Techniques. Compute entry by entry (Technique 2.4.15)
Let be the -th row index in the -th group of rows, and the -th column index in the -th group of columns. Write for the -th group of indices in , which has elements. For the -th element of , the entries and are the entries and of the blocks. Splitting the sum over into the groups ,
The left side is the entry of and the right side is the entry of . □
The second proof reduces the theorem to three special cases, each of which is one of the views of Proposition 2.4.8.
Proof (from the views).
Uses. Proposition 2.4.8 (Four views of the product), Definition 2.4.33 (Block matrix)
Let be the -th block row of , that is, the matrix formed by the rows of in the -th group, and let be the -th block column of , the matrix formed by its columns in the -th group.
By the row view (Proposition 2.4.8(c)), each row of in the -th group is the corresponding row of times , so these rows form the matrix . By the column view (Proposition 2.4.8(b)), applied to , its columns in the -th group are times the corresponding columns of , which form . Hence
By the column–row view (Proposition 2.4.8(d)),
and summing over gives
In the second proof the three special cases are what to remember: blocks of columns of produce blocks of columns of , blocks of rows of produce blocks of rows of , and splitting the inner index turns the product into a sum. The partitions must match: the column sizes of must be the row sizes of , or the products are not defined. And the factors cannot be swapped, since blocks are matrices: is not .
For block matrices the theorem says that the block of is
and for block upper triangular matrices
So block diagonal matrices multiply block by block, and in particular
Technique 2.4.35 (Block decomposition). Split matrices into blocks that match the structure of the problem, and compute with the blocks as if they were entries (Theorem 2.4.34). Typical splittings: off a single first row and column, to set up an induction on the size; along a basis that is split into two parts, for example a basis of a subspace extended to a basis of the whole space; or around a block of zeros or a copy of .
Reach for it when a matrix has large zero or identity blocks, when an argument should reduce from size to size , or when a statement concerns a map that preserves a subspace. Two checks: the partitions must match, and products of blocks must keep their order. The canonical example is Proposition 2.4.36. Later it computes determinants of block triangular matrices (Section 5.4), compares with (Section 7.3), and organizes the generalized eigenspace decomposition and the Jordan form (Section 10.2, Section 10.3).
Used in 27 places and 6 practice exercises
Proposition 2.4.36, Exercise 2.4.37, Exercise 2.4.52, Exercise 2.4.55, Exercise 2.5.40, Exercise 2.8.9, Problem 2.13, Problem 2.16, Theorem 3.5.27, Exercise 3.5.46, Problem 3.4, Problem 3.14, Exercise 4.5.53, Theorem 4.7.42, Lemma 4.8.2, Exercise 4.8.13, Problem 4.12, Theorem 5.4.26, Corollary 5.4.27, Exercise 5.4.43, Exercise 5.5.47, Exercise 5.6.14, Exercise 6.3.63, Proposition 7.3.22, Problem 7.2, Problem 7.6, Theorem 8.3.23; 6 practice exercises.
Recall from Exercise 2.3.38 that is upper triangular if whenever .
Proof (by blocks, induction on ).
Uses. Theorem 2.4.34 (Block multiplication), Definition 2.4.33 (Block matrix)
Techniques. Block decomposition (Technique 2.4.35)
We induct on . For every matrix is upper triangular and .
Let and assume the claim for size . Partition and with row sizes and column sizes . Since is upper triangular, its lower left block is the zero column , and its lower right block , which has entries with , is upper triangular. So
for some and upper triangular
that is,
By the induction hypothesis, is upper triangular with diagonal entries for . So every entry of below the diagonal is either in the zero column or below the diagonal of , hence zero, and the diagonal entries of are and those of . □
Proof (entry by entry).
Uses. Proposition 2.4.8 (Four views of the product)
Techniques. Compute entry by entry (Technique 2.4.15)
A third proof translates to maps: by Exercise 2.3.38, is upper triangular exactly when maps each into itself, and a composite of two maps with this property has it too. That proof is the one that generalizes to triangularization in Section 7.5.
Uses. Theorem 2.4.34 (Block multiplication), Proposition 2.4.14 (Algebra of matrices)
Techniques. Block decomposition (Technique 2.4.35)
Let , and partition both factors below with sizes . By Theorem 2.4.34 and Proposition 2.4.14(b), the blocks of the product are ,
For the claim is . If
2.4.9Counting walks Beyond 21-242
Applications to graphs are not part of 21-242.
Powers of a matrix count paths. This is the simplest instance of a theme that runs through Markov chains (Section 11.1) and spectral graph theory (Section 16.5). (Another application of the matrix product, homogeneous coordinates, which turn translations of into matrix products, is in Section 4.7.)
Uses. Proposition 2.4.8 (Four views of the product), Definition 2.4.38 (Adjacency matrix), Notation 2.4.16 (Powers of a matrix)
Techniques. Compute entry by entry (Technique 2.4.15)
We induct on . For , , and there is exactly one walk of length from to (the sequence ) and none from to .
Suppose the claim holds for . A walk of length from to consists of the walk of length from to , followed by the edge ; conversely, any walk of length from to can be extended in this way exactly when is an edge. So the number of walks of length from to whose next-to-last vertex is equals the number of walks of length from to times , which is by the induction hypothesis. Summing over , the number of walks of length from to is
The last claim follows by adding the diagonal entries. □
Example 2.4.40 (Walks in a small graph).
The graph of Figure 2.4.2 has
For instance counts the walks and . In an undirected graph, is the number of neighbours of , and is the number of common neighbours of and . The diagonal entries of are , so . A closed walk of length in a graph without loops goes around a triangle, and each triangle gives closed walks ( starting vertices, directions). So the graph has triangles, namely and .
Exercises
Exercise 2.4.41. Let
- (a)Find and .
- (b)Compute and as products of matrices, and check the answers against the formulas and .
- (c)Compare and , meaning the traces of these two matrices.
Uses. Definition 2.3.1 (Matrix of a linear map), Theorem 2.4.2 (The matrix of a composite), Proposition 2.4.28 (Cyclicity of the trace), Example 2.1.9 (Maps of polynomials)
(a) , , , and , and , , , so
(b) By Theorem 2.4.2,
Similarly
Directly,
(c) Both traces are , although the matrices have different sizes. This is Proposition 2.4.28 for the matrix and the matrix . Note also that is not defined, since the sizes differ; on all of , (Exercise 2.4.51).
Exercise 2.4.42. Let
- (a)Show that
and for . - (b)Suppose are distinct. Show that commutes with if and only if is diagonal.
- (c)Find all that commute with .
Uses. Example 2.4.10 (Diagonal matrices), Proposition 2.4.8 (Four views of the product), Proposition 1.1.17 (No zero divisors)
(a) By Example 2.4.10, row of is and column of is . Reading off the entries gives
(b) By (a), if and only if
(c) Here and . The condition
with the five remaining entries arbitrary. These are the block diagonal matrices with blocks of sizes and , matching the blocks on which is a scalar matrix.
Uses. Lemma 2.4.24 (Matrix units), Proposition 2.4.14 (Algebra of matrices)
If. commutes with every matrix, since
Only if. Suppose commutes with every upper triangular matrix. Fix . The matrix unit is upper triangular, and by associativity and Lemma 2.4.24(b),
The first matrix has entry : it is zero outside column , where it equals column of . The second has entry : it is zero outside row , where it equals row of . Comparing the entries in positions with gives , and comparing those in positions with gives . As was arbitrary, is diagonal, so and
Now let . The matrix unit is upper triangular, and
These are equal, and , so . Hence .
Exercise 2.4.44. Prove or disprove each statement about matrices in , .
- (a)If , then or .
- (b)If and are symmetric, then is symmetric.
- (c).
- (d)If and , then . What if or ?
- (e)If is upper triangular and , then every diagonal entry of is .
Uses. Proposition 2.4.8 (Four views of the product), Definition 2.4.21 (Transpose), Exercise 2.4.25, Proposition 2.4.36 (Products of upper triangular matrices), Example 2.4.18 (), Proposition 1.1.17 (No zero divisors)
Techniques. Finding counterexamples and minimal examples (Technique 1.4.18)
We give the counterexamples for . For , those in (b), (c), and (d) can be placed in the top left corner of an zero matrix (Theorem 2.4.34), and the one in (a) in the top left corner of .
(a) False. swaps and , so , but (in , where , still ). Geometrically, is the reflection across the line . For , the matrix that swaps and and fixes the other works.
(b) False. and are symmetric, but is not. By Exercise 2.4.25, is symmetric exactly when .
(c) False. With and (Example 2.4.18), , so , while gives . In general , and this equals when .
(d) True over . By Proposition 2.4.8(a) and Definition 2.4.21, the entry of is
Over it is false: for ,
(e) True. By Proposition 2.4.36, is upper triangular with diagonal entries . If , then , so by Proposition 1.1.17.
- (a)Show that
satisfies if and only if and . - (b)Let be prime. How many satisfy ?
Uses. Proposition 2.4.8 (Four views of the product), Proposition 1.1.17 (No zero divisors)
(a) By the entry formula,
Suppose . If , the off-diagonal entries give (Proposition 1.1.17), and then the diagonal entries give , so , contradicting . Hence , and then is the entry. Conversely, if and , then the off-diagonal entries are , the entry is , and the entry is
(b) By (a), such correspond to triples with , with . If , we need , that is, or : there are such pairs. If , then , so and is determined by : there are pairs. With nonzero values of , the total is
For the four matrices are , , , and .
- (a)For , let . Show that
for every , where means . - (b)Deduce that over .
- (c)Find and with and , neither equal to .
Uses. Notation 2.4.16 (Powers of a matrix), Proposition 2.4.8 (Four views of the product), Theorem 2.4.2 (The matrix of a composite), Example 2.4.5 (Composites through their matrices)
(a) For the formula reads , since and . If it holds for , then
By the entry formula, this product has diagonal entries , lower left entry , and upper right entry
(b) With and , (a) gives
(c) Over , let . Then, using ,
Over , let
Exercise 2.4.47. Let , , and
- (a)Show that
for every . - (b)Deduce that
for all , and in particular .
Uses. Notation 2.4.16 (Powers of a matrix), Proposition 2.4.8 (Four views of the product), Proposition 2.4.14 (Algebra of matrices)
(a) For ,
(b) By Notation 2.4.16, . The entry of the left side is by (a), and by the entry formula the entry of the right side is
With this is
Exercise 2.4.48. Find the error in the following computation, which claims that for :
Uses. Proposition 2.4.8 (Four views of the product), Proposition 2.4.23 (Transpose of a product)
Everything up to the last equality is correct. In a product
So the computation actually proves Proposition 2.4.23. The claimed identity is false: with and as in Example 2.4.19, we have , while
Exercise 2.4.49. Let .
- (a)Show that
for and . - (b)Show that if for every , then .
- (c)Show that every linear map has the form for exactly one .
Uses. Lemma 2.4.24 (Matrix units), Proposition 2.4.28 (Cyclicity of the trace), Proposition 2.4.27 (The trace is linear), Corollary 2.2.6 (Agreeing on a spanning list), Proposition 2.4.14 (Algebra of matrices)
Techniques. Check it on a basis (Technique 2.2.7)
(a) By Proposition 2.4.28 with the factors and , and by Lemma 2.4.24(b),
(b) Taking
(c) Define by
Uses. Lemma 2.4.24 (Matrix units), Corollary 2.2.6 (Agreeing on a spanning list), Proposition 2.4.27 (The trace is linear)
Techniques. Check it on a basis (Technique 2.2.7), Cyclicity of trace (Technique 2.4.29)
We compute on the matrix units, using Lemma 2.4.24(c) throughout. For ,
so the hypothesis gives
so
Exercise 2.4.51. Let be differentiation and multiplication by (Example 2.1.9).
- (a)Show that
. - (b)Explain why (a) does not contradict Proposition 2.4.30, even over .
- (c)Show that if is a subspace of spanned by finitely many polynomials and , then .
Uses. Example 2.1.9 (Maps of polynomials), Proposition 2.1.23 ( is a vector space), Proposition 2.1.17 (Compositions of linear maps are linear), Corollary 2.2.6 (Agreeing on a spanning list), Proposition 2.4.30 (), Definition 1.2.16 (Degree)
(a) Both and are linear (Proposition 2.1.23, Proposition 2.1.17). For ,
where for the second term is . The monomials span , so by Corollary 2.2.6. (This is the product rule .)
(b) Proposition 2.4.30 is a statement about matrices, that is, about operators on , and its proof takes the trace, a finite sum of diagonal entries. The maps and act on , which is spanned by no finite list (every finite list of polynomials has a largest degree). So they have no matrices, and there is no trace to take. Part (c) shows that we also cannot cut down to a finite-dimensional piece on which acts.
(c) Suppose
Exercise 2.4.52. Let be prime.
- (a)Let be the matrices with , for , and for , . Show that .
- (b)Show that there are with if and only if divides .
Uses. Proposition 2.4.30 (), Theorem 2.4.34 (Block multiplication), Corollary 2.2.6 (Agreeing on a spanning list), Proposition 2.3.13 (Linearity of the product)
Techniques. Block decomposition (Technique 2.4.35), Cyclicity of trace (Technique 2.4.29)
(a) We compare with for each ; by Proposition 2.3.13(c) these are the columns of the two matrices. Note that
For , , so
(b) If , then in , and Proposition 2.4.30 says that no such exist. Conversely, suppose . Let and be the block diagonal matrices with diagonal blocks, all equal to , respectively all equal to , partitioned with sizes . By Theorem 2.4.34, and are block diagonal with diagonal blocks , respectively , so is block diagonal with diagonal blocks . That is the matrix .
Uses. Proposition 2.4.28 (Cyclicity of the trace), Proposition 2.4.27 (The trace is linear), Proposition 2.4.14 (Algebra of matrices)
Techniques. Cyclicity of trace (Technique 2.4.29)
Since , induction gives for every (for , ). By distributivity and associativity (Proposition 2.4.14),
So with , Proposition 2.4.27 and Proposition 2.4.28 give
Uses. Proposition 2.4.28 (Cyclicity of the trace), Proposition 2.4.27 (The trace is linear), Proposition 2.4.23 (Transpose of a product), Proposition 2.4.8 (Four views of the product), Exercise 2.4.25
Techniques. Cyclicity of trace (Technique 2.4.29)
Let . By Exercise 2.4.25, is skew-symmetric: . Expanding,
By Proposition 2.4.28, rotating the factors gives
On the other hand , and by the entry formula the entry of is . Hence
with equality if and only if every , that is, . Combining the two expressions for gives
Exercise 2.4.55. Let , , and , and let .
- (a)Show that
for every , where . - (b)Deduce that if and , then .
Uses. Theorem 2.4.34 (Block multiplication), Proposition 2.4.14 (Algebra of matrices), Notation 2.4.16 (Powers of a matrix)
Techniques. Block decomposition (Technique 2.4.35)
(a) For , . Suppose the formula holds for . By Theorem 2.4.34,
and by distributivity
(b) If and , then , and by block multiplication
since each block of the product is a sum of terms with a zero factor. So a block upper triangular matrix whose diagonal blocks are nilpotent is nilpotent. The bound cannot be improved to in general: for , , and , has but .
Exercise 2.4.56. Let be the directed graph on with edges , , , and .
- (a)Write down its adjacency matrix and compute and .
- (b)How many walks of length go from to ? List them. How many closed walks of length are there in all?
Uses. Definition 2.4.38 (Adjacency matrix), Proposition 2.4.39 (Powers count walks)
(a)
(b) By Proposition 2.4.39 there are walks of length from to : they are (the loop three times) and (around the triangle). In all there are closed walks of length : the two above, and and .
Exercise 2.4.57. Let , let be the matrix all of whose entries are , and let , the adjacency matrix of the complete graph on vertices (every two distinct vertices are joined).
- (a)Show that .
- (b)Show that
for , where . - (c)How many walks of length are there between two distinct vertices, and how many closed walks of length are there in all?
Uses. Proposition 2.4.39 (Powers count walks), Proposition 2.4.8 (Four views of the product), Proposition 2.4.14 (Algebra of matrices), Definition 2.4.26 (Trace)
(a) By the entry formula,
(b) For , , and
It remains to show that the coefficient of is . Write
Dividing by gives
(c) By Proposition 2.4.39 and (b), for there are
For instance, the triangle () has closed walks of length , the two directions around it from each of the three vertices. As a check, is an integer, since and leave the same remainder modulo , so divides .
More practice
The practice bank has 112 exercises on this section’s topics.