# Why does matrix multiplication represent linear transformation compositions?

I know it's probably a silly question, but I'm trying to figure out why was matrix multiplication (the standard one) defined the way it was defined.

I know that it was defined like that so we would gain invariance under change of basis: $PAP^{-1}+PBP^{-1}=P(A+B)P^{-1}$ and $(PAP^{-1})(PBP^{-1})=PABP^{-1}$ and that ofcourse the case.

But another explanation that was suggested is: "We defined matrix multiplication this way so that if $A$ is the matrix of a linear transformation $T_1$ with respect to some basis $s$ and $B$ is the matrix of a linear transformation $T_2$ with respect to the same basis $s$ then $AB$ is the matrix of $T_1$ composition with $T_2$ (I don't know the command for composition operator) with respect to basis $s$.

Again, this is a completely legitimate aspiration, but I fail to see why it follows. Why is linear transformation composition equivalent to matrix multiplication?

• A helpful perspective: if $e_i$ are the standard basis elements then $Ae_i$ is the $i$th column of $A$ (in the standard basis representation). Thus your question boils down to: why is the $i$th column of $AB$ equal to $A(Be_i)$? But the answer to that is that matrix multiplication is essentially defined columnwise: the columns of $AB$ are $A$ multiplied with each column of $B$. – Ian Oct 3 '15 at 16:50
• That perspective is very helpful indeed. It is equal because we defined multiplication so that it will be equal. – Oria Gruber Oct 3 '15 at 16:53
• Well, yes, at the end of the day the definition is bad if it doesn't have this property. Perhaps a better way of saying it is "how does the definition achieve this?" – Ian Oct 3 '15 at 16:54
• I would guess that it arose as a notational convenience rather than as a consequence of some desired property. – copper.hat Oct 3 '15 at 17:00

test that: $$A(B\vec x)=(AB) \vec x$$ Using for $\vec x$ the canonical basis. It is easy for transformations in a $2$ dimensional space and requaire a bit more work for an $n-$ dimensionale space.
Given $$A=\begin{bmatrix} a_{11}&a_{12}\\ a_{21}&a_{22} \end{bmatrix} \qquad B=\begin{bmatrix} b_{11}&b_{12}\\ b_{21}&b_{22} \end{bmatrix}$$ By row-column multiplication we have: $$A(B\vec x)= \begin{bmatrix} a_{11}&a_{12}\\ a_{21}&a_{22} \end{bmatrix} \left( \begin{bmatrix} b_{11}&b_{12}\\ b_{21}&b_{22} \end{bmatrix} \begin{bmatrix} x\\ y \end{bmatrix} \right)= \begin{bmatrix} a_{11}&a_{12}\\ a_{21}&a_{22} \end{bmatrix} \begin{bmatrix} b_{11}x+b_{12}y\\ b_{21}x+b_{22}y \end{bmatrix}=$$ $$= \begin{bmatrix} a_{11}(b_{11}x+b_{12}y)+a_{12}(b_{21}x+b_{22}y)\\ a_{21}(b_{11}x+b_{12}y)+a_{22}(b_{21}x+b_{22}y) \end{bmatrix}$$ That, reordering becomes: $$\begin{bmatrix} (a_{11}b_{11}+a_{12}b_{21})x+(a_{11}b_{12}+a_{12}b_{22})y\\ (a_{21}b_{11}+a_{22}b_{21})x+(a_{21}b_{12}+a_{22}b_{22})y \end{bmatrix}=(AB)\vec x$$
• Hmmm. This is another problem with the "intuitive definition" of multiplying entry by entry - how would you multiply an $n$ by $n$ matrix by an $n$ by $1$ vector – Oria Gruber Oct 3 '15 at 16:57
• I know I know. I'm just trying to justify in my mind why we defined matrix multiplication the way we did. I wanted to check if indeed $(AB)x=A(Bx)$ if i multiply entry by entry rather than the standard definition. But I can't. Because I cant multiply a matrix by a vector with my definition of multiplication (entrywise). – Oria Gruber Oct 3 '15 at 17:01
• I've adde the simpler $2$ dimensional case to my answer... I hope it's usefull :) – Emilio Novati Oct 3 '15 at 17:15