Why can matrix exponentiation be done by squaring? Matrix multiplication is not communative:
A*B != B*A
Then why can matrix exponentiation be done by squaring?
I have tried searching for special cases where this rule did not apply, but from what I've understood, none of it seemed to apply specifically to powers of two equal matrices. 
For example a matrix M is raised to a 12, then which of the following is true?
M4 * M8 = M12 OR M8 * M4 = M12 ?
Do we need to follow a particular order while calculating matrix exponentiation by squaring ? If yes then how is the order determined and why does it lead to the correct exponentiation. If not then why doesn't the fact that matrix multiplication is not communative does not affect it?
Can this be explained this to me in plain english? Thanks in advance.
 A: When squaring a matrix, the "order" in which you multiply them doesn't matter since every matrix commutes with itself. Using your example of $M^{12}$, it doesn't matter if we do
\begin{equation}
M^{12} = M^{4}M^{8}
\end{equation}
or
\begin{equation}
M^{12} = M^8M^4
\end{equation}
or any other way of grouping powers of $M$ which add up to $12$. 
Edit: For cases when the exponent is greater than $2$, consider $M^4$ (higher powers will generalize this in a simple way). We can say
\begin{equation}
M^4 = M\cdot M \cdot M \cdot M.
\end{equation}
Now, matrix multiplication is associative, so we can group this in any way we want. Then we have
\begin{equation}
M^4 = M\cdot M \cdot M \cdot M = (M^2) \cdot (M^2) = M\cdot (M^3) = (M^3) \cdot M.
\end{equation}
The key here is that the associative property of matrix multiplication lets us choose any grouping of the matrices that we'd like.
A: Suppose $A$ is a square matrix and let $B = A$ (So we have two different names for the same thing). Then $AB = AA$, by substituting $B$ by $A$. Using the same process, we also have $AA = BA$. Thus, $AB = BA$ if $A=B$.
Next, the problem you have with $M^{12}$ has nothing to do with commutativity. You can regard it as a problem of associativity. Since matrix multiplication is associative, you have
$$M^{12} = \left(M^{4}M^{4}\right)M^{4} = M^{4}\left(M^{4}M^{4}\right)$$
and therefore
$$M^{12} = \left(M^{8}\right)M^{4} = M^{4}\left(M^{8}\right)$$
A: For any matrix $M$ which is diagonalisable, we have $M^i$ and $M^j$, $i,j\in\mathbb{N}^+$, as simultaneously diagonalisable. Thus $M^i$ and $M^j$ commute.
