Linear Algebra/Matrix Multiplication

 Linear Algebra ← Sums and Scalar Products Matrix Multiplication Mechanics of Matrix Multiplication →

After representing addition and scalar multiplication of linear maps in the prior subsection, the natural next map operation to consider is composition.

Lemma 2.1

A composition of linear maps is linear.

Proof

(This argument has appeared earlier, as part of the proof that isomorphism is an equivalence relation between spaces.) Let ${\displaystyle h:V\to W}$ and ${\displaystyle g:W\to U}$ be linear. The calculation

${\displaystyle g\circ h\,{\bigl (}c_{1}\cdot {\vec {v}}_{1}+c_{2}\cdot {\vec {v}}_{2}{\bigr )}=g{\bigl (}\,h(c_{1}\cdot {\vec {v}}_{1}+c_{2}\cdot {\vec {v}}_{2})\,{\bigr )}=g{\bigl (}\,c_{1}\cdot h({\vec {v}}_{1})+c_{2}\cdot h({\vec {v}}_{2})\,{\bigr )}}$
${\displaystyle =c_{1}\cdot g{\bigl (}h({\vec {v}}_{1}))+c_{2}\cdot g(h({\vec {v}}_{2}){\bigr )}=c_{1}\cdot (g\circ h)({\vec {v}}_{1})+c_{2}\cdot (g\circ h)({\vec {v}}_{2})}$

shows that ${\displaystyle g\circ h:V\to U}$ preserves linear combinations.

To see how the representation of the composite arises out of the representations of the two compositors, consider an example.

Example 2.2

Let ${\displaystyle h:\mathbb {R} ^{4}\to \mathbb {R} ^{2}}$ and ${\displaystyle g:\mathbb {R} ^{2}\to \mathbb {R} ^{3}}$, fix bases ${\displaystyle B\subset \mathbb {R} ^{4}}$, ${\displaystyle C\subset \mathbb {R} ^{2}}$, ${\displaystyle D\subset \mathbb {R} ^{3}}$, and let these be the representations.

${\displaystyle H={\rm {Rep}}_{B,C}(h)={\begin{pmatrix}4&6&8&2\\5&7&9&3\end{pmatrix}}_{B,C}\qquad G={\rm {Rep}}_{C,D}(g)={\begin{pmatrix}1&1\\0&1\\1&0\end{pmatrix}}_{C,D}}$

To represent the composition ${\displaystyle g\circ h:\mathbb {R} ^{4}\to \mathbb {R} ^{3}}$ we fix a ${\displaystyle {\vec {v}}}$, represent ${\displaystyle h}$ of ${\displaystyle {\vec {v}}}$, and then represent ${\displaystyle g}$ of that. The representation of ${\displaystyle h({\vec {v}})}$ is the product of ${\displaystyle h}$'s matrix and ${\displaystyle {\vec {v}}}$'s vector.

${\displaystyle {\rm {Rep}}_{C}(\,h({\vec {v}})\,)={\begin{pmatrix}4&6&8&2\\5&7&9&3\end{pmatrix}}_{B,C}{\begin{pmatrix}v_{1}\\v_{2}\\v_{3}\\v_{4}\end{pmatrix}}_{B}={\begin{pmatrix}4v_{1}+6v_{2}+8v_{3}+2v_{4}\\5v_{1}+7v_{2}+9v_{3}+3v_{4}\end{pmatrix}}_{C}}$

The representation of ${\displaystyle g(\,h({\vec {v}})\,)}$ is the product of ${\displaystyle g}$'s matrix and ${\displaystyle h({\vec {v}})}$'s vector.

${\displaystyle {\begin{array}{rl}{\rm {Rep}}_{D}(\,g(h({\vec {v}}))\,)\!&=\!{\begin{pmatrix}1&1\\0&1\\1&0\end{pmatrix}}_{C,D}{\begin{pmatrix}4v_{1}+6v_{2}+8v_{3}+2v_{4}\\5v_{1}+7v_{2}+9v_{3}+3v_{4}\end{pmatrix}}_{C}\\&=\!{\begin{pmatrix}1\cdot (4v_{1}+6v_{2}+8v_{3}+2v_{4})+1\cdot (5v_{1}+7v_{2}+9v_{3}+3v_{4})\\0\cdot (4v_{1}+6v_{2}+8v_{3}+2v_{4})+1\cdot (5v_{1}+7v_{2}+9v_{3}+3v_{4})\\1\cdot (4v_{1}+6v_{2}+8v_{3}+2v_{4})+0\cdot (5v_{1}+7v_{2}+9v_{3}+3v_{4})\end{pmatrix}}_{D}\end{array}}}$

Distributing and regrouping on the ${\displaystyle v}$'s gives

${\displaystyle ={\begin{pmatrix}(1\cdot 4+1\cdot 5)v_{1}+(1\cdot 6+1\cdot 7)v_{2}+(1\cdot 8+1\cdot 9)v_{3}+(1\cdot 2+1\cdot 3)v_{4}\\(0\cdot 4+1\cdot 5)v_{1}+(0\cdot 6+1\cdot 7)v_{2}+(0\cdot 8+1\cdot 9)v_{3}+(0\cdot 2+1\cdot 3)v_{4}\\(1\cdot 4+0\cdot 5)v_{1}+(1\cdot 6+0\cdot 7)v_{2}+(1\cdot 8+0\cdot 9)v_{3}+(1\cdot 2+0\cdot 3)v_{4}\end{pmatrix}}_{D}}$

which we recognizing as the result of this matrix-vector product.

${\displaystyle ={\begin{pmatrix}1\cdot 4+1\cdot 5&1\cdot 6+1\cdot 7&1\cdot 8+1\cdot 9&1\cdot 2+1\cdot 3\\0\cdot 4+1\cdot 5&0\cdot 6+1\cdot 7&0\cdot 8+1\cdot 9&0\cdot 2+1\cdot 3\\1\cdot 4+0\cdot 5&1\cdot 6+0\cdot 7&1\cdot 8+0\cdot 9&1\cdot 2+0\cdot 3\end{pmatrix}}_{B,D}{\begin{pmatrix}v_{1}\\v_{2}\\v_{3}\\v_{4}\end{pmatrix}}_{D}}$

Thus, the matrix representing ${\displaystyle g\circ h}$ has the rows of ${\displaystyle G}$ combined with the columns of ${\displaystyle H}$.

Definition 2.3

The matrix-multiplicative product of the ${\displaystyle m\!\times \!r}$ matrix ${\displaystyle G}$ and the ${\displaystyle r\!\times \!n}$ matrix ${\displaystyle H}$ is the ${\displaystyle m\!\times \!n}$ matrix ${\displaystyle P}$, where

${\displaystyle p_{i,j}=g_{i,1}h_{1,j}+g_{i,2}h_{2,j}+\dots +g_{i,r}h_{r,j}}$

that is, the ${\displaystyle i,j}$-th entry of the product is the dot product of the ${\displaystyle i}$-th row and the ${\displaystyle j}$-th column.

${\displaystyle GH={\begin{pmatrix}&\vdots \\g_{i,1}&g_{i,2}&\ldots &g_{i,r}\\&\vdots \end{pmatrix}}{\begin{pmatrix}&h_{1,j}\\\ldots &h_{2,j}&\ldots \\&\vdots \\&h_{r,j}\end{pmatrix}}={\begin{pmatrix}&\vdots \\\ldots &p_{i,j}&\ldots \\&\vdots \end{pmatrix}}}$
Example 2.4

The matrices from Example 2.2 combine in this way.

${\displaystyle {\begin{pmatrix}1\cdot 4+1\cdot 5&1\cdot 6+1\cdot 7&1\cdot 8+1\cdot 9&1\cdot 2+1\cdot 3\\0\cdot 4+1\cdot 5&0\cdot 6+1\cdot 7&0\cdot 8+1\cdot 9&0\cdot 2+1\cdot 3\\1\cdot 4+0\cdot 5&1\cdot 6+0\cdot 7&1\cdot 8+0\cdot 9&1\cdot 2+0\cdot 3\end{pmatrix}}={\begin{pmatrix}9&13&17&5\\5&7&9&3\\4&6&8&2\end{pmatrix}}}$
Example 2.5
${\displaystyle {\begin{pmatrix}2&0\\4&6\\8&2\end{pmatrix}}{\begin{pmatrix}1&3\\5&7\end{pmatrix}}={\begin{pmatrix}2\cdot 1+0\cdot 5&2\cdot 3+0\cdot 7\\4\cdot 1+6\cdot 5&4\cdot 3+6\cdot 7\\8\cdot 1+2\cdot 5&8\cdot 3+2\cdot 7\end{pmatrix}}={\begin{pmatrix}2&6\\34&54\\18&38\end{pmatrix}}}$
Theorem 2.6

A composition of linear maps is represented by the matrix product of the representatives.

Proof

(This argument parallels Example 2.2.) Let ${\displaystyle h:V\to W}$ and ${\displaystyle g:W\to X}$ be represented by ${\displaystyle H}$ and ${\displaystyle G}$ with respect to bases ${\displaystyle B\subset V}$, ${\displaystyle C\subset W}$, and ${\displaystyle D\subset X}$, of sizes ${\displaystyle n}$, ${\displaystyle r}$, and ${\displaystyle m}$. For any ${\displaystyle {\vec {v}}\in V}$, the ${\displaystyle k}$-th component of ${\displaystyle {\rm {Rep}}_{C}(\,h({\vec {v}})\,)}$ is

${\displaystyle h_{k,1}v_{1}+\cdots +h_{k,n}v_{n}}$

and so the ${\displaystyle i}$-th component of ${\displaystyle {\rm {Rep}}_{D}(\,g\circ h\,({\vec {v}})\,)}$ is this.

${\displaystyle g_{i,1}\cdot (h_{1,1}v_{1}+\dots +h_{1,n}v_{n})+g_{i,2}\cdot (h_{2,1}v_{1}+\dots +h_{2,n}v_{n})}$
${\displaystyle +\dots +g_{i,r}\cdot (h_{r,1}v_{1}+\dots +h_{r,n}v_{n})}$

Distribute and regroup on the ${\displaystyle v}$'s.

${\displaystyle =(g_{i,1}h_{1,1}+g_{i,2}h_{2,1}+\dots +g_{i,r}h_{r,1})\cdot v_{1}}$
${\displaystyle +\dots +(g_{i,1}h_{1,n}+g_{i,2}h_{2,n}+\dots +g_{i,r}h_{r,n})\cdot v_{n}}$

Finish by recognizing that the coefficient of each ${\displaystyle v_{j}}$

${\displaystyle g_{i,1}h_{1,j}+g_{i,2}h_{2,j}+\dots +g_{i,r}h_{r,j}}$

matches the definition of the ${\displaystyle i,j}$ entry of the product ${\displaystyle GH}$.

The theorem is an example of a result that supports a definition. We can picture what the definition and theorem together say with this arrow diagram ("wrt" abbreviates "with respect to").

Above the arrows, the maps show that the two ways of going from ${\displaystyle V}$ to ${\displaystyle X}$, straight over via the composition or else by way of ${\displaystyle W}$, have the same effect

${\displaystyle {\vec {v}}{\stackrel {g\circ h}{\longmapsto }}g(h({\vec {v}}))\qquad {\vec {v}}{\stackrel {h}{\longmapsto }}h({\vec {v}}){\stackrel {g}{\longmapsto }}g(h({\vec {v}}))}$

(this is just the definition of composition). Below the arrows, the matrices indicate that the product does the same thing— multiplying ${\displaystyle GH}$ into the column vector ${\displaystyle {\rm {Rep}}_{B}({\vec {v}})}$ has the same effect as multiplying the column first by ${\displaystyle H}$ and then multiplying the result by ${\displaystyle G}$.

${\displaystyle {\rm {Rep}}_{B,D}(g\circ h)=GH={\rm {Rep}}_{C,D}(g)\,{\rm {Rep}}_{B,C}(h)}$

The definition of the matrix-matrix product operation does not restrict us to view it as a representation of a linear map composition. We can get insight into this operation by studying it as a mechanical procedure. The striking thing is the way that rows and columns combine.

One aspect of that combination is that the sizes of the matrices involved is significant. Briefly, ${\displaystyle m\!\times \!r{\text{ times }}r\!\times \!n{\text{ equals }}m\!\times \!n}$.

Example 2.7

This product is not defined

${\displaystyle {\begin{pmatrix}-1&2&0\\0&10&1.1\end{pmatrix}}{\begin{pmatrix}0&0\\0&2\end{pmatrix}}}$

because the number of columns on the left does not equal the number of rows on the right.

In terms of the underlying maps, the fact that the sizes must match up reflects the fact that matrix multiplication is defined only when a corresponding function composition

${\displaystyle {\text{dimension }}n{\text{ space}}\;{\stackrel {h}{\longrightarrow }}\;{\text{dimension }}r{\text{ space}}\;{\stackrel {g}{\longrightarrow }}\;{\text{dimension }}m{\text{ space}}}$

is possible.

Remark 2.8

The order in which these things are written can be confusing. In the "${\displaystyle m\!\times \!r{\text{ times }}r\!\times \!n{\text{ equals }}m\!\times \!n}$" equation, the number written first ${\displaystyle m}$ is the dimension of ${\displaystyle g}$'s codomain and is thus the number that appears last in the map dimension description above. The explanation is that while ${\displaystyle f}$ is done first and then ${\displaystyle g}$ is applied, that composition is written ${\displaystyle g\circ f}$, from the notation "${\displaystyle g(f({\vec {v}}))}$". (Some people try to lessen confusion by reading "${\displaystyle g\circ f}$" aloud as "${\displaystyle g}$ following ${\displaystyle f}$".) That order then carries over to matrices: ${\displaystyle g\circ f}$ is represented by ${\displaystyle GF}$.

Another aspect of the way that rows and columns combine in the matrix product operation is that in the definition of the ${\displaystyle i,j}$ entry

${\displaystyle p_{i,j}=g_{i,{\color {red}1}}h_{{\color {red}1},j}+g_{i,{\color {red}2}}h_{{\color {red}2},j}+\dots +g_{i,{\color {red}r}}h_{{\color {red}r},j}}$

the red subscripts on the ${\displaystyle g}$'s are column indicators while those on the ${\displaystyle h}$'s indicate rows. That is, summation takes place over the columns of ${\displaystyle G}$ but over the rows of ${\displaystyle H}$; left is treated differently than right, so ${\displaystyle GH}$ may be unequal to ${\displaystyle HG}$. Matrix multiplication is not commutative.

Example 2.9

Matrix multiplication hardly ever commutes. Test that by multiplying randomly chosen matrices both ways.

${\displaystyle {\begin{pmatrix}1&2\\3&4\end{pmatrix}}{\begin{pmatrix}5&6\\7&8\end{pmatrix}}={\begin{pmatrix}19&22\\43&50\end{pmatrix}}\qquad {\begin{pmatrix}5&6\\7&8\end{pmatrix}}{\begin{pmatrix}1&2\\3&4\end{pmatrix}}={\begin{pmatrix}23&34\\31&46\end{pmatrix}}}$
Example 2.10

Commutativity can fail more dramatically:

${\displaystyle {\begin{pmatrix}5&6\\7&8\end{pmatrix}}{\begin{pmatrix}1&2&0\\3&4&0\end{pmatrix}}={\begin{pmatrix}23&34&0\\31&46&0\end{pmatrix}}}$

while

${\displaystyle {\begin{pmatrix}1&2&0\\3&4&0\end{pmatrix}}{\begin{pmatrix}5&6\\7&8\end{pmatrix}}}$

isn't even defined.

Remark 2.11

The fact that matrix multiplication is not commutative may be puzzling at first sight, perhaps just because most algebraic operations in elementary mathematics are commutative. But on further reflection, it isn't so surprising. After all, matrix multiplication represents function composition, which is not commutative— if ${\displaystyle f(x)=2x}$ and ${\displaystyle g(x)=x+1}$ then ${\displaystyle g\circ f(x)=2x+1}$ while ${\displaystyle f\circ g(x)=2(x+1)=2x+2}$. True, this ${\displaystyle g}$ is not linear and we might have hoped that linear functions commute, but this perspective shows that the failure of commutativity for matrix multiplication fits into a larger context.

Except for the lack of commutativity, matrix multiplication is algebraically well-behaved. Below are some nice properties and more are in Problem 10 and Problem 11.

Theorem 2.12

If ${\displaystyle F}$, ${\displaystyle G}$, and ${\displaystyle H}$ are matrices, and the matrix products are defined, then the product is associative ${\displaystyle (FG)H=F(GH)}$ and distributes over matrix addition ${\displaystyle F(G+H)=FG+FH}$ and ${\displaystyle (G+H)F=GF+HF}$.

Proof

Associativity holds because matrix multiplication represents function composition, which is associative: the maps ${\displaystyle (f\circ g)\circ h}$ and ${\displaystyle f\circ (g\circ h)}$ are equal as both send ${\displaystyle {\vec {v}}}$ to ${\displaystyle f(g(h({\vec {v}})))}$.

Distributivity is similar. For instance, the first one goes ${\displaystyle f\circ (g+h)\,({\vec {v}})=f{\bigl (}\,(g+h)({\vec {v}})\,{\bigr )}=f{\bigl (}\,g({\vec {v}})+h({\vec {v}})\,{\bigr )}=f(g({\vec {v}}))+f(h({\vec {v}}))=f\circ g({\vec {v}})+f\circ h({\vec {v}})}$ (the third equality uses the linearity of ${\displaystyle f}$).

Remark 2.13

We could alternatively prove that result by slogging through the indices. For example, associativity goes: the ${\displaystyle i,j}$-th entry of ${\displaystyle (FG)H}$ is

${\displaystyle {\begin{array}{rl}&(f_{i,1}g_{1,1}+f_{i,2}g_{2,1}+\dots +f_{i,r}g_{r,1})h_{1,j}\\&\quad +(f_{i,1}g_{1,2}+f_{i,2}g_{2,2}+\dots +f_{i,r}g_{r,2})h_{2,j}\\&\quad \;\;\vdots \\&\quad +(f_{i,1}g_{1,s}+f_{i,2}g_{2,s}+\dots +f_{i,r}g_{r,s})h_{s,j}\end{array}}}$

(where ${\displaystyle F}$, ${\displaystyle G}$, and ${\displaystyle H}$ are ${\displaystyle m\!\times \!r}$, ${\displaystyle r\!\times \!s}$, and ${\displaystyle s\!\times \!n}$ matrices), distribute

${\displaystyle {\begin{array}{rl}&f_{i,1}g_{1,1}h_{1,j}+f_{i,2}g_{2,1}h_{1,j}+\dots +f_{i,r}g_{r,1}h_{1,j}\\&\quad +f_{i,1}g_{1,2}h_{2,j}+f_{i,2}g_{2,2}h_{2,j}+\dots +f_{i,r}g_{r,2}h_{2,j}\\&\quad \;\;\vdots \\&\quad +f_{i,1}g_{1,s}h_{s,j}+f_{i,2}g_{2,s}h_{s,j}+\dots +f_{i,r}g_{r,s}h_{s,j}\end{array}}}$

and regroup around the ${\displaystyle f}$'s

${\displaystyle {\begin{array}{rl}&f_{i,1}(g_{1,1}h_{1,j}+g_{1,2}h_{2,j}+\dots +g_{1,s}h_{s,j})\\&\quad +f_{i,2}(g_{2,1}h_{1,j}+g_{2,2}h_{2,j}+\dots +g_{2,s}h_{s,j})\\&\quad \;\;\vdots \\&\quad +f_{i,r}(g_{r,1}h_{1,j}+g_{r,2}h_{2,j}+\dots +g_{r,s}h_{s,j})\end{array}}}$

to get the ${\displaystyle i,j}$ entry of ${\displaystyle F(GH)}$.

Contrast these two ways of verifying associativity, the one in the proof and the one just above. The argument just above is hard to understand in the sense that, while the calculations are easy to check, the arithmetic seems unconnected to any idea (it also essentially repeats the proof of Theorem 2.6 and so is inefficient). The argument in the proof is shorter, clearer, and says why this property "really" holds. This illustrates the comments made in the preamble to the chapter on vector spaces— at least some of the time an argument from higher-level constructs is clearer.

We have now seen how the representation of the composition of two linear maps is derived from the representations of the two maps. We have called the combination the product of the two matrices. This operation is extremely important. Before we go on to study how to represent the inverse of a linear map, we will explore it some more in the next subsection.

Exercises

This exercise is recommended for all readers.
Problem 1

Compute, or state "not defined".

1. ${\displaystyle {\begin{pmatrix}3&1\\-4&2\end{pmatrix}}{\begin{pmatrix}0&5\\0&0.5\end{pmatrix}}}$
2. ${\displaystyle {\begin{pmatrix}1&1&-1\\4&0&3\end{pmatrix}}{\begin{pmatrix}2&-1&-1\\3&1&1\\3&1&1\end{pmatrix}}}$
3. ${\displaystyle {\begin{pmatrix}2&-7\\7&4\end{pmatrix}}{\begin{pmatrix}1&0&5\\-1&1&1\\3&8&4\end{pmatrix}}}$
4. ${\displaystyle {\begin{pmatrix}5&2\\3&1\end{pmatrix}}{\begin{pmatrix}-1&2\\3&-5\end{pmatrix}}}$
This exercise is recommended for all readers.
Problem 2

Where

${\displaystyle A={\begin{pmatrix}1&-1\\2&0\\\end{pmatrix}}\quad B={\begin{pmatrix}5&2\\4&4\\\end{pmatrix}}\quad C={\begin{pmatrix}-2&3\\-4&1\\\end{pmatrix}}}$

compute or state "not defined".

1. ${\displaystyle AB}$
2. ${\displaystyle (AB)C}$
3. ${\displaystyle BC}$
4. ${\displaystyle A(BC)}$
Problem 3

Which products are defined?

1. ${\displaystyle 3\!\times \!2}$ times ${\displaystyle 2\!\times \!3}$
2. ${\displaystyle 2\!\times \!3}$ times ${\displaystyle 3\!\times \!2}$
3. ${\displaystyle 2\!\times \!2}$ times ${\displaystyle 3\!\times \!3}$
4. ${\displaystyle 3\!\times \!3}$ times ${\displaystyle 2\!\times \!2}$
This exercise is recommended for all readers.
Problem 4

Give the size of the product or state "not defined".

1. a ${\displaystyle 2\!\times \!3}$ matrix times a ${\displaystyle 3\!\times \!1}$ matrix
2. a ${\displaystyle 1\!\times \!12}$ matrix times a ${\displaystyle 12\!\times \!1}$ matrix
3. a ${\displaystyle 2\!\times \!3}$ matrix times a ${\displaystyle 2\!\times \!1}$ matrix
4. a ${\displaystyle 2\!\times \!2}$ matrix times a ${\displaystyle 2\!\times \!2}$ matrix
This exercise is recommended for all readers.
Problem 5

Find the system of equations resulting from starting with

${\displaystyle {\begin{array}{*{3}{rc}r}h_{1,1}x_{1}&+&h_{1,2}x_{2}&+&h_{1,3}x_{3}&=&d_{1}\\h_{2,1}x_{1}&+&h_{2,2}x_{2}&+&h_{2,3}x_{3}&=&d_{2}\end{array}}}$

and making this change of variable (i.e., substitution).

${\displaystyle {\begin{array}{*{2}{rc}r}x_{1}&=&g_{1,1}y_{1}&+&g_{1,2}y_{2}\\x_{2}&=&g_{2,1}y_{1}&+&g_{2,2}y_{2}\\x_{3}&=&g_{3,1}y_{1}&+&g_{3,2}y_{2}\end{array}}}$
Problem 6

As Definition 2.3 points out, the matrix product operation generalizes the dot product. Is the dot product of a ${\displaystyle 1\!\times \!n}$ row vector and a ${\displaystyle n\!\times \!1}$ column vector the same as their matrix-multiplicative product?

This exercise is recommended for all readers.
Problem 7

Represent the derivative map on ${\displaystyle {\mathcal {P}}_{n}}$ with respect to ${\displaystyle B,B}$ where ${\displaystyle B}$ is the natural basis ${\displaystyle \langle 1,x,\ldots ,x^{n}\rangle }$. Show that the product of this matrix with itself is defined; what the map does it represent?

Problem 8

Show that composition of linear transformations on ${\displaystyle \mathbb {R} ^{1}}$ is commutative. Is this true for any one-dimensional space?

Problem 9

Why is matrix multiplication not defined as entry-wise multiplication? That would be easier, and commutative too.

This exercise is recommended for all readers.
Problem 10
1. Prove that ${\displaystyle H^{p}H^{q}=H^{p+q}}$ and ${\displaystyle (H^{p})^{q}=H^{pq}}$ for positive integers ${\displaystyle p,q}$.
2. Prove that ${\displaystyle (rH)^{p}=r^{p}\cdot H^{p}}$ for any positive integer ${\displaystyle p}$ and scalar ${\displaystyle r\in \mathbb {R} }$.
This exercise is recommended for all readers.
Problem 11
1. How does matrix multiplication interact with scalar multiplication: is ${\displaystyle r(GH)=(rG)H}$? Is ${\displaystyle G(rH)=r(GH)}$?
2. How does matrix multiplication interact with linear combinations: is ${\displaystyle F(rG+sH)=r(FG)+s(FH)}$? Is ${\displaystyle (rF+sG)H=rFH+sGH}$?
Problem 12

We can ask how the matrix product operation interacts with the transpose operation.

1. Show that ${\displaystyle {{(GH)}^{\rm {trans}}}={{H}^{\rm {trans}}}{{G}^{\rm {trans}}}}$.
2. A square matrix is symmetric if each ${\displaystyle i,j}$ entry equals the ${\displaystyle j,i}$ entry, that is, if the matrix equals its own transpose. Show that the matrices ${\displaystyle H{{H}^{\rm {trans}}}}$ and ${\displaystyle {{H}^{\rm {trans}}}H}$ are symmetric.
This exercise is recommended for all readers.
Problem 13

Rotation of vectors in ${\displaystyle \mathbb {R} ^{3}}$ about an axis is a linear map. Show that linear maps do not commute by showing geometrically that rotations do not commute.

Problem 14

In the proof of Theorem 2.12 some maps are used. What are the domains and codomains?

Problem 15

How does matrix rank interact with matrix multiplication?

1. Can the product of rank ${\displaystyle n}$ matrices have rank less than ${\displaystyle n}$? Greater?
2. Show that the rank of the product of two matrices is less than or equal to the minimum of the rank of each factor.
Problem 16

Is "commutes with" an equivalence relation among ${\displaystyle n\!\times \!n}$ matrices?

This exercise is recommended for all readers.
Problem 17

(This will be used in the Matrix Inverses exercises.) Here is another property of matrix multiplication that might be puzzling at first sight.

1. Prove that the composition of the projections ${\displaystyle \pi _{x},\pi _{y}:\mathbb {R} ^{3}\to \mathbb {R} ^{3}}$ onto the ${\displaystyle x}$ and ${\displaystyle y}$ axes is the zero map despite that neither one is itself the zero map.
2. Prove that the composition of the derivatives ${\displaystyle d^{2}/dx^{2},\,d^{3}/dx^{3}:{\mathcal {P}}_{4}\to {\mathcal {P}}_{4}}$ is the zero map despite that neither is the zero map.
3. Give a matrix equation representing the first fact.
4. Give a matrix equation representing the second.

When two things multiply to give zero despite that neither is zero, each is said to be a zero divisor.

Problem 18

Show that, for square matrices, ${\displaystyle (S+T)(S-T)}$ need not equal ${\displaystyle S^{2}-T^{2}}$.

This exercise is recommended for all readers.
Problem 19

Represent the identity transformation ${\displaystyle {\mbox{id}}:V\to V}$ with respect to ${\displaystyle B,B}$ for any basis ${\displaystyle B}$. This is the identity matrix ${\displaystyle I}$. Show that this matrix plays the role in matrix multiplication that the number ${\displaystyle 1}$ plays in real number multiplication: ${\displaystyle HI=IH=H}$ (for all matrices ${\displaystyle H}$ for which the product is defined).

Problem 20

In real number algebra, quadratic equations have at most two solutions. That is not so with matrix algebra. Show that the ${\displaystyle 2\!\times \!2}$ matrix equation ${\displaystyle T^{2}=I}$ has more than two solutions, where ${\displaystyle I}$ is the identity matrix (this matrix has ones in its ${\displaystyle 1,1}$ and ${\displaystyle 2,2}$ entries and zeroes elsewhere; see Problem 19).

Problem 21
1. Prove that for any ${\displaystyle 2\!\times \!2}$ matrix ${\displaystyle T}$ there are scalars ${\displaystyle c_{0},\dots ,c_{4}}$ that are not all ${\displaystyle 0}$ such that the combination ${\displaystyle c_{4}T^{4}+c_{3}T^{3}+c_{2}T^{2}+c_{1}T+c_{0}I}$ is the zero matrix (where ${\displaystyle I}$ is the ${\displaystyle 2\!\times \!2}$ identity matrix, with ${\displaystyle 1}$'s in its ${\displaystyle 1,1}$ and ${\displaystyle 2,2}$ entries and zeroes elsewhere; see Problem 19).
2. Let ${\displaystyle p(x)}$ be a polynomial ${\displaystyle p(x)=c_{n}x^{n}+\dots +c_{1}x+c_{0}}$. If ${\displaystyle T}$ is a square matrix we define ${\displaystyle p(T)}$ to be the matrix ${\displaystyle c_{n}T^{n}+\dots +c_{1}T+I}$ (where ${\displaystyle I}$ is the appropriately-sized identity matrix). Prove that for any square matrix there is a polynomial such that ${\displaystyle p(T)}$ is the zero matrix.
3. The minimal polynomial ${\displaystyle m(x)}$ of a square matrix is the polynomial of least degree, and with leading coefficient ${\displaystyle 1}$, such that ${\displaystyle m(T)}$ is the zero matrix. Find the minimal polynomial of this matrix.
${\displaystyle {\begin{pmatrix}{\sqrt {3}}/2&-1/2\\1/2&{\sqrt {3}}/2\end{pmatrix}}}$
(This is the representation with respect to ${\displaystyle {\mathcal {E}}_{2},{\mathcal {E}}_{2}}$, the standard basis, of a rotation through ${\displaystyle \pi /6}$ radians counterclockwise.)
Problem 22

The infinite-dimensional space ${\displaystyle {\mathcal {P}}}$ of all finite-degree polynomials gives a memorable example of the non-commutativity of linear maps. Let ${\displaystyle d/dx:{\mathcal {P}}\to {\mathcal {P}}}$ be the usual derivative and let ${\displaystyle s:{\mathcal {P}}\to {\mathcal {P}}}$ be the shift map.

${\displaystyle a_{0}+a_{1}x+\dots +a_{n}x^{n}\;{\stackrel {s}{\longmapsto }}\;0+a_{0}x+a_{1}x^{2}+\dots +a_{n}x^{n+1}}$

Show that the two maps don't commute ${\displaystyle d/dx\circ s\neq s\circ d/dx}$; in fact, not only is ${\displaystyle (d/dx\circ s)-(s\circ d/dx)}$ not the zero map, it is the identity map.

Problem 23

Recall the notation for the sum of the sequence of numbers ${\displaystyle a_{1},a_{2},\dots ,a_{n}}$.

${\displaystyle \sum _{i=1}^{n}a_{i}=a_{1}+a_{2}+\dots +a_{n}}$

In this notation, the ${\displaystyle i,j}$ entry of the product of ${\displaystyle G}$ and ${\displaystyle H}$ is this.

${\displaystyle p_{i,j}=\sum _{k=1}^{r}g_{i,k}h_{k,j}}$

Using this notation,

1. reprove that matrix multiplication is associative;
2. reprove Theorem 2.6.
 Linear Algebra ← Sums and Scalar Products Matrix Multiplication Mechanics of Matrix Multiplication →