Matrix Operations
Table of Contents
1. Matrix Addition
If we think of two matrices as linear transformations, matrix addition will only be defined if their codomain and domain are the same; in other words, \(A+B\) is only defined if \(A\) and \(B\) are the same size.
If \(A = \begin{bmatrix} a_{ij} \end{bmatrix}\) and \(B = \begin{bmatrix} b_{ij}\end{bmatrix}\),
\begin{align} \boxed{A + B = \begin{bmatrix} a_{ij} + b_{ij} \end{bmatrix}} \end{align}2. Matrix Multiplication
If \(A\) and \(B\) are matrices, then we can consider their associated linear transformations \(T\) and \(S\). We define matrix multiplication to be analogous to the composition of two transformations, i.e. \(T \circ S\).
This requires the codomain of \(S\) to be the domain of \(T\). In other words, if \(A\) is an \(m\times n\) matrix, B must be \(n\times p\).
We know that multiplying a matrix by a column vector is done by forming a new matrix where each entry in each row is the dot product between the corresponding row in the matrix and the column vector. For matrix-matrix multiplication, we extend that by considering \(B\) to be a matrix of columns \(b_1, b_2, \dots, b_p\). Then,
\begin{align} \boxed{AB = \begin{bmatrix} Ab_1 & Ab_2 & \cdots & Ab_p \end{bmatrix}} \end{align}2.1. Multiplication Properties
Matrix multiplication is associative:
\begin{align} A(BC) = (AB)C \end{align}However, matrix multiplication is not commutative:
\begin{align} AB \neq BA \end{align}We can understand this through the analogue of the composition of two transformation functions. It can be seen that given two functions \(f\) and \(g\), \(f \circ g \neq g \circ f\).
2.2. Identity
The \(n \times n\) identity matrix \(I_n\) is the matrix that implements the identity transformation:
\begin{align} I_n = \begin{bmatrix} 1 & 0 & \cdots & 0 \\ 0 & 1 & & 0 \\ \vdots \\ 0 & & & 1 \end{bmatrix} \notag \end{align}The identity matrix has 1s on the diagonal and 0s everywhere else. It satisfies the following equality for any \(n \times n\) matrix \(A\):
\begin{align} A \cdot I_n = I_n \cdot A = A \end{align}3. Matrix Transposition
The transpose \(A^T\) of a matrix \(A\) is \(A\) with the rows and columns switched. Thus, if \(A\) was a \(m \times n\) matrix, then \(A^T\) would be a \(n \times m\) matrix:
\begin{align} \boxed{A = \begin{bmatrix} a_{11} & a_{12} & \cdots & a_{1n} \\ \vdots \\ a_{m1} & a_{m2} & \cdots & a_{mn} \end{bmatrix} \quad A^T = \begin{bmatrix} a_{11} & \cdots & a_{m1} \\ a_{12} & \cdots & a_{m2} \\ \vdots \\ a_{1n} & \cdots & a_{mn} \end{bmatrix}} \end{align}3.1. Transposition Properties
Two useful properties of transpose:
\begin{align} (A+B)^T &= A^T + B^T \\ (AB)^T &= B^TA^T \end{align}