# “Wrapping” a matrix and its inverse around another matrix

If we have two $$n \times n$$ matrices $$M$$ and $$N$$, does this mean that I can "wrap" $$N$$ around $$M$$, i.e., $$M = N^{-1} M N$$? If so, what property allows us to do this?

I'm more confident saying that $$M = M I_n = M N N^{-1}$$, but I don't see what property would allow me to shuffle the $$N^{-1}$$ to the other side.

• It all depends on $M$. If you know big theorems like Jordan Canonical form then you can calculate the set of all $N$ that commute with $M$ in this way. But here's an easy case: if $M$ has $n$ distinct eigenvalues, then every eigenvector of $M$ is an eigenvector of $N$ – ancient mathematician Sep 28 '20 at 10:15

There are two conditions you need here:

1. Form $$N^{-1}MN$$ requires matrix $$N$$ to be invertible.

2. Multiplying both sides to the $$N$$ on the left leads to $$NM = NN^{-1}MN = MN,$$ so $$M$$ and $$N$$ should commute.

The property you are searching for is called commuting matrices. Two matrices commute if

$$\mathbf{A}\mathbf{B} = \mathbf{B}\mathbf{A}$$

See this question for more details: When is matrix multiplication commutative?. As well as this wiki: https://en.wikipedia.org/wiki/Commuting_matrices

• Right, but in general only two diagonal matrices are commutable. Presumably that means that I can't assume $M = N^{-1}M N$ if at least one of the two is not diagonal? – Migwell Sep 28 '20 at 10:18
• @Migwell that is incorrect. Generally, if both matrices have the same eigenvectors, they are commutable. – kvantour Sep 28 '20 at 10:19
• Thank you, this actually answers my core misunderstanding about the definition of commutability. – Migwell Sep 28 '20 at 10:24
• @Migwell consider matrices $\begin{pmatrix}1 & 2 \\ -2 & 0\end{pmatrix}$ and $\begin{pmatrix}-3 & 2 \\ -2 & -4\end{pmatrix}$ - they are not diagonal but commute and satisfy your condition – Anton Grudkin Sep 28 '20 at 10:26

Given that $$N$$ is invertible, we have the following sequence of equivalent statements:

$$M = N^{-1}MN$$ $$\iff N(M) = N(N^{-1}MN)$$ $$\iff NM = (NN^{-1})MN$$ $$\iff NM = IMN$$ $$\iff NM = MN$$

So if $$N$$ is invertible, then $$M = N^{-1}MN$$ if and only if $$M$$ and $$N$$ commute.