Matrix multiplication as composition

Notes from Matrix multiplication as composition by 3Blue1Brown from the Essence of linear algebra series

Sometimes we want to describe the effects of applying one Matrix Transformation than another. For example, we may rotate then apply a shear.

We call this a "composition" of 2 transformations.

One way to think of this, is that we first apply the rotation, then apply the shear:

[1101]([0110][xy])\begin{bmatrix}1 && 1 \\ 0 && 1\end{bmatrix} \left( \begin{bmatrix}0 && -1 \\ 1 && 0\end{bmatrix}\begin{bmatrix}x \\ y\end{bmatrix} \right)

It turns out to be the same as taking the 2 Matrix Transformation product, then applying that to a vector.

We can think of multiplying two matrices, like applying one transformation then another.

We read transformations from right to left, mirroring function notation. For example, f(g(x))f(g(x)) we first apply g to x, then f to that result.

[1101][0110]\begin{bmatrix}1 && 1 \\ 0 && 1\end{bmatrix} \begin{bmatrix}0 && -1 \\ 1 && 0\end{bmatrix} - apply the right matrix, then the left.

Another example:

[0210]M2[1210]M1\overbrace{\begin{bmatrix}0 && 2 \\ 1 && 0\end{bmatrix}}^{M2} \overbrace{\begin{bmatrix}1 && -2 \\ 1 && 0\end{bmatrix}}^{M1}

The total effect of applying M1M1 and then M2M2 gives us a new matrix: [2012]\begin{bmatrix}2 && 0 \\ 1 && -2\end{bmatrix}

Note that Matrix Multiplication is not commutative: M1M2M1 \ne M2. Order matters.

It is however associative: (AB)C=A(BC)(AB)C = A(BC)