Mathematical Immaturity

2.15 Multiplication of matrices

$\quad$ Some linear transformations can be multiplied by way of composition. We will now define multiplication of matrices in such a way that the product of two matrices corresponds to the composition of the linear transformations they represent.

$\quad$ We recall that if $T: U \to V$ and $S: V \to W$ are linear transformations, then their composition $ST: U \to W$ is a linear transformation given by \begin{align*} ST(x) &= S[T(x)] \qquad \text{for all $x$ in $U.$} \end{align*} Suppose that $U, V$ and $W$ are finite-dimensional, say \begin{align*} \dim U &= n, \quad \dim V = p, \quad \dim W = m. \end{align*} Then, choose bases for $U, V$ and $W.$ Relative to these bases, the matrix $m(S)$ is an $m \times p$ matrix, the matrix $T$ is a $p \times n$ matrix, and the matrix of $ST$ is an $m \times n$ matrix. The following definition of matrix multiplication will enable us to deduce the relation $m(ST) = m(S)m(T).$ This extends the property of isomorphism to products.

$\quad$ Definition. $\quad$ Let $A$ be any $m \times p$ matrix, and let $B$ be any $p \times n$ matrix, say: \begin{align*} A &= (a_{ij})_{i,j=1}^{m, p} \qquad \text{and} \qquad B = (a_{ij})_{i,j=1}^{p,n} \end{align*} Then, the product $AB$ is defined to be the $m \times n$ matrix $C = (c_{ij})$ whose $ij^{th}$ entry is given by \begin{align*} (2.22) \qquad c_{ij} &= \sum_{k=1}^p a_{ik}b_{kj} \end{align*} $\quad$Note: $\quad$ The product $AB$ is not defined unless the number of columns of $A$ and the number of rows of $B$ are equal.

$\quad$ If we write $A_i$ for the $i^{th}$ row of $A$ and $B^j$ for the $j^{th}$ column of $B,$ and think of these as $p$-dimensional vectors, then the sum in (2.22) is simply the dot product $A_i \cdot B^j.$ In other words, the $ij^{th}$ entry of $AB$ is the dot product of the $i^{th}$ row of $A$ with the $j^{th}$ column of $B:$ \begin{align*} AB &= (A_i \cdot B^j)_{i, j}^{m,n} \end{align*} As such, matrix multiplication can be seen as a generalization of the dot product. We will now prove that the matrix of a composition $ST$ is the product of the matrices $m(S)$ and $m(T).$

$\quad$ Theorem 2.16. $\quad$ Let $T: U \to V$ and $S: V \to W$ be linear transformations, where $U, V, W$ are finite-dimensional linear spaces. Then, for a fixed choice of bases, the matrices of $S, T,$ and $ST$ are related by the equation \begin{align*} m(ST) &= m(S)m(T) \end{align*}

$\quad$ Proof. $\quad$ Assume $\dim U = n,$ $\dim V = p,$ and $\dim w = m.$ Let $(u_1, \dots, u_n)$ be a basis for $U,$ $(v_1, \dots, v_p)$ a basis for $V,$ and $(w_1, \dots, w_m)$ a basis for $W.$ Then, the image of the basis elements of $U$ under $T$ can be expressed as: \begin{align*} T(u_k) &= \sum_{i=1}^p t_{ik} v_i \quad \text{for} \quad k= 1, \dots, n \end{align*} with the matrix of $T$ given by $m(T) = (t_{kj})_{k, j = 1}^{p, n}.$ Similarly, the image of the basis elements $v_1, \dots, v_p$ under $S$ can be expressed as: \begin{align*} S(v_k) &= \sum_{i=1}^m s_{ik} w_i \quad \text{for} \quad k= 1, \dots, p \end{align*} giving the matrix $m(S) = (s_{ik})_{i, k = 1}^{m, p}.$ Their product, $m(S)m(T)$ is the $m \times n$ matrix whose $ij$ entry is given by the sum: \begin{align*} st_{ij} &= \sum_{k = 1}^p s_{ik}t_{kj} \end{align*} Now, consider the image of the basis elements of $V$ under the transformation $ST.$ For each basis element $u_j,$ where $j = 1, \dots, p,$ we have \begin{align*} ST(u_j) &= S[T(u_j)] \\ &= S\left(\sum_{k=1}^p t_{kj} v_k \right) \\ &= \sum_{k=1}^p t_{kj}S(v_k) \\ &= \sum_{k=1}^p t_{kj} \sum_{i = 1}^m s_{ik} w_i \end{align*} Expanding the right-hand side, we get the following: \begin{align*} \sum_{k=1}^p t_{kj} \sum_{i = 1}^m s_{ik} w_i &= \sum_{k=1}^p t_{kj}(s_{1k}w_1 + \cdots + s_{mk}w_m) \\ &= t_{1j}(s_{1k}w_1 + \cdots + s_{mk}w_m) + \cdots + t_{pj}(s_{1k}w_1 + \cdots + s_{mk}w_m) \\ &= \sum_{k=1}^p (s_{1k} t_{kj}) w_1 + \cdots + \sum_{k=1}^p (s_{mk}t_{kj}) w_m \\ &= \sum_{i=1}^m\left(\sum_{k=1}^p s_{ik}t_{kj} \right)w_i \end{align*} Combining the above results, we have \begin{align*} ST(u_j) &= \sum_{i=1}^m\left(\sum_{k=1}^p s_{ik}t_{kj} \right)w_i \end{align*} and the matrix representation of $ST$ is: \begin{align*} m(ST) &= \left(\sum_{k=1}^p s_{ik}t_{kj}\right)_{i, j = 1}^{m, n} \\ \\ &= m(S)m(T). \quad \blacksquare \end{align*}

$\quad$ Theorem 2.17. $\quad$ Associative and Distributive Laws for Matrix Multiplication. $\quad$ Given matrices $A, B, C.$
$\quad$ (a) If the products A(BC) and (AB)C are meaningful, we have \begin{align*} A(BC) &= (AB)C \qquad \text{(associative law)}, \end{align*} $\quad$ (b) Assume $A$ and $B$ are of the same size. If $AC$ and $BC$ are meaningful, we have \begin{align*} (A + B)C &= AC + BC \qquad \text{(right distributive law)}, \end{align*} whereas if $CA$ and $CB$ are meaningful, we have \begin{align*} C(A + B) &= CA + CB \qquad \text{(left distributive law)}. \end{align*}

$\quad$ Definition. $\quad$ If $A$ is a square matrix, we define integral powers of $A$ inductively as follows: \begin{align*} A^0 &= I, \qquad A^n = AA^{n-1} \qquad \text{for $n \geq 1$.} \end{align*}