# Simple question: equality of two matrix equations

Given the following two equations, for square diagonal ($N\times N$) matrices $L$ and $M$ and square or rectangular ($M\times N$) $A$ and $B$ of equal size:

$X = ALA^{-1}$, and $Y = BMB^{-1}$

If I know that $X=Y$, does it automatically follow that $A=B$ and $L=M$, or can there be another nontrivial solution?

-

## 2 Answers

No, there is a whole class of similar matrices. You are given that $X$ is similar to $L$ and $Y$ is similar to $M$. If $X=Y$, then $X=ALA^{-1}=Y=BMB^{-1}$, so $L=A^{-1}BMB^{-1}A=(A^{-1}B)M(A^{-1}B)^{-1}$. Similarity is an equivalence relation.

-

$ALA^{-1}=X=Y=BMB^{-1}$

$L=A^{-1}BMB^{-1}A=\left(B^{-1}A\right)^{-1}M\left(B^{-1}A\right)$

From this, it's fairly obvious that the answer is no. We just need to take $B^{-1}A$ so that it doesn't commute with $M$.

Let's take $A=\begin{pmatrix}1&0\\0&1\end{pmatrix}=A^{-1}$

$L=X=Y=BMB^{-1}$

We just need $M$ that doesn't commute with $B$.

$M=\begin{pmatrix}0&1\\1&0\end{pmatrix}$

$B=\begin{pmatrix}1&0\\0&-1\end{pmatrix} = B^{-1}$

The idea here is that we scale differetly the first and second coordinates with $B$ so since $M$ swaps them, we won't get the same result if we swap them before or after. So they don't commute.

Then you can just compute $L=BMB^{-1}=-M\not=M$ (you're working in $\Bbb R$ or $\Bbb C$, aren't you?)

-