# Let $A,X,Y$ be square matrices such that $X,Y$ commute with $A$. Show: if the characteristic polynomial of $A$ splits, then $X$ and $Y$ commute

Question: Let $A,X,Y$ be real, square, $n\times n$ matrices such that $X$ and $Y$ commute with $A$. Prove:

1) If the characteristic polynomial of $A$ has distinct roots over $\mathbb C$, then $X$ and $Y$ commute with each other.

2) Find a counterexample for (1) if the hypothesis doesn't hold.

My attempt: The counterexample for (2) is easy: let $A = I_{2\times 2}$, and $$X = \left[ {\begin{array}{*{20}{c}} 1&0\\ 0&0 \end{array}} \right],\;\;\;Y = \left[ {\begin{array}{*{20}{c}} 0&1\\ 1&0 \end{array}} \right].$$ Every matrix commutes with the identity matrix, but $X$ and $Y$ do not commute with each other.

I'm struggling to show part (1). If the characteristic polynomial of $A$ has distinct roots over $\mathbb C$, then $A$ is diagonalizable over $\mathbb C$, so $A = Q^{-1}DQ$, for some $D$ and $Q$. I keep trying basic algebra tricks to get $XY = YX$, from $AX = XA$ and $AY = YA$, but I'm not coming up with anything, and that makes me think my strategy is wrong - but I'm not sure what else to try. I would really appreciate a hint in the right direction!

• There can't be any basic algebra tricks. The result is only true if the characteristic polynomial has distinct roots, but any trick would work for any matrix. You will need to use the fact that $A$ is diagonalisable, and that its eigenvalues are distinct. – Mathmo123 Mar 6 '16 at 21:20

As you've noticed, the significance of the characteristic polynomial of $A$ having distinct roots is that $A$ is diagonalisable over $\mathbb C$. This means that there is some invertible matrix $P$ and some diagonal matrix $D$ such that $$P^{-1}AP = D.$$
Moreover, since $X,Y$ commute with $A$, one can easily check that $P^{-1}XP$ and $P^{-1}YP$ commute with $D$.
What does this tell you about $P^{-1}XP$ and $P^{-1}YP$? Can you use this to deduce the result? You will need to use the fact that the diagonal elements of $D$ are distinct.
• I think I've shown it using this method, but just to be sure, would you mind checking this over? Because $X$ and $A$ commute, $PDP^{-1}X = XPDP^{-1} \implies DP^{-1}XP = P^{-1}XPD$, so $P^{-1}XP$ commutes with $D$, and similarly for $P^{-1}YP$. Now, this means that $P^{-1}XP$ and $P^{-1}YP$ are diagonal (the proof is easy, but messy, so I won't repeat it here). Diagonal matrices commute, so we have $P^{-1}XPP^{-1}YP = P^{-1}YPP^{-1}XP \implies P^{-1}XYP = P^{-1}YXP \implies XY = YX$. – poppy3345 Mar 6 '16 at 22:24
• Actually, the proof that $A$ is diagonal if $AD = DA$ and $D$ has distinct values on the diagonal is not that messy: If $i\neq j$ then$$a_{ij}d_j = \sum_ka_{ik}d_{kj} = (AD)_{ij} = (DA)_{ij} = \sum_kd_{ik}a_{kj} = d_ia_{ij}.$$So, since $d_i\neq d_j$ we must have $a_{ij}=0$. I like this approach. :o) – Friedrich Philipp Mar 7 '16 at 0:29
The (one-dimensional) eigenspaces of $A$ are invariant under $X$ and $Y$: if $z$ is an eigenvalue of $A$ and $x\in\ker(A- z)$ then $$(A - zI)Xx = X(A-zI)x = 0.$$ Hence, $X$ and $Y$ have the same eigenvectors which implies that $X$, $Y$, and $A$ are simultaneously diagonalizable. Now, the claim easily follows.