Matrix multiplication as composition — interesting finding I was watching 3Blue1Brown's series on linear algebra and I noticed something interesting.
$$\begin{bmatrix}1&1\\0&1\end{bmatrix} \begin{bmatrix}0&-1\\1&0\end{bmatrix} =
\begin{bmatrix}1&-1\\1&0\end{bmatrix}$$
And if we switch the order of multiplication we get
$$\begin{bmatrix}0&-1\\1&0\end{bmatrix} \begin{bmatrix}1&1\\0&1\end{bmatrix} = 
\begin{bmatrix}0&-1\\1&1\end{bmatrix}$$
I noticed something strange while playing around with these. Let's look at the first multiplication. What I'm about to say is not how you determine the multiplication of matrices but it gives an interesting result.
First, do the inside matrix. $i$ goes to $(0,1)$, $j$ goes to $(-1,0)$. Now the wrong part. Look at the outside matrix. Move $i$ to $(1,0)$ in the new coordinates, which is $(0,1)$ in the original coordinates. Move $j$ to $(1,1)$, which is $(-1,1)$ in the original coordinates. What we got is
$$\begin{bmatrix}0&-1\\1&1\end{bmatrix}$$
which is exactly the matrix you get if you switch the order of multiplication. Is this just a coincidence or does this have any meaning?

Yes, this fact has a meaning. Let's denote the first matrix $A$ and the second $B$. The reason why this operation is not equal to the multiplication is that matrix $B$ is a linear transformation in another basis.
Let's denote original basis as $\begin{pmatrix}i&j\end{pmatrix}$ and $\begin{pmatrix}i'&j'\end{pmatrix} = \begin{pmatrix}i&j\end{pmatrix} A$. So, let's take a vector and see how it's coordinates in original basis are connected to coordinates in the second one.
$$\overline{v} = \begin{pmatrix}i&j\end{pmatrix} \begin{pmatrix}v_x\\v_y\end{pmatrix} = \begin{pmatrix}i'&j'\end{pmatrix} \begin{pmatrix}v_x'\\v_y'\end{pmatrix} = \begin{pmatrix}i&j\end{pmatrix} A \begin{pmatrix}v_x'\\v_y'\end{pmatrix}$$
So, if $\begin{pmatrix}i&j\end{pmatrix}$ is invertible, then $\begin{pmatrix}v_x\\v_y\end{pmatrix} = A\begin{pmatrix}v_x'\\v_y'\end{pmatrix}$.
Now let's see that the operation that you call "wrong part" is equal to $A^{-1}BA$. Let's denote this operation $C$. It changes your basis to original, applies transformation $B$ and then returns to the second basis.  As we have already seen $A$ changes a vector that is passed into it from second basis to the original, and it's easy to notice that $A^{-1}$ should do the opposite of this. That's why $C = A^{-1}BA$
And finally, $AC = A\cdot A^{-1}BA = BA$.
