## A Matrix Commuting With a Diagonal Matrix with Distinct Entries is Diagonal

## Problem 492

Let

\[D=\begin{bmatrix}

d_1 & 0 & \dots & 0 \\

0 &d_2 & \dots & 0 \\

\vdots & & \ddots & \vdots \\

0 & 0 & \dots & d_n

\end{bmatrix}\]
be a diagonal matrix with distinct diagonal entries: $d_i\neq d_j$ if $i\neq j$.

Let $A=(a_{ij})$ be an $n\times n$ matrix such that $A$ commutes with $D$, that is,

\[AD=DA.\]
Then prove that $A$ is a diagonal matrix.