Is it safe to say matrix multiplication is commutative ONLY if one matrix is the inverse of the other? The only way I could believe this was the 2 commutative type properties I know of: $$AA^{-1}=A^{-1}A=I$$ and $$adj A*A=A*adjA = |A|I$$ where $adj A$ is the adjoint of matrix A.
The first equation when expanded with $A^{-1}=\frac{adjA}{|A|}$ you end up getting the second equation. So both are the same equation. These are the only two properties that explains commutativity as far as I'm aware of(are there any more?) and my conclusion was based on these only. Also multiplication with identity matrix is also commutative but any other counter cases? So is it safe to say matrix multiplication is commutative ONLY if one matrix is the inverse of the other? Thanks!!
Any two diagonal matrices commute, because:
$$\begin{bmatrix}a_1&0&\cdots&0\\0&a_2&\cdots&0\\\vdots&\vdots&&\vdots\\0&0&\cdots&a_n\end{bmatrix}\cdot\begin{bmatrix}b_1&0&\cdots&0\\0&b_2&\cdots&0\\\vdots&\vdots&&\vdots\\0&0&\cdots&b_n\end{bmatrix}=\begin{bmatrix}a_1b_1&0&\cdots&0\\0&a_2b_2&\cdots&0\\\vdots&\vdots&&\vdots\\0&0&\cdots&a_nb_n\end{bmatrix}$$
and "ordinary" multiplication commutes.
Now, if a matrix $P$ is an arbitrary invertible matrix, and $D_1$ and $D_2$ are arbitrary diagonal matrices, this means that the matrix $P^{-1}D_1P$ will also commute with $P^{-1}D_2P$ because:
$$(P^{-1}D_1P)(P^{-1}D_2P)=P^{-1}D_1D_2P=P^{-1}D_2D_1P=(P^{-1}D_2P)(P^{-1}D_1P)$$