A complex matrix commuting with all diagonalizable matrices is a scalar matrix

diagonalizationlinear algebramatrices

This question is from an old comprehensive exam

Let $A$ be an $n\times n$ complex matrix, which commutes with all diagonalizable $n\times n$ complex matrices. Prove that $A$ is a constant times the identity matrix. Hint: What matrices commute with all diagonal matrices?

The hint says to find the matrices that commute with all diagonal matrices, which should themselves be diagonal.

What I've tried: Let $A \in M_n(\mathbb{C})$, $B$ be a diagonalizable $n\times n$ complex matrix such that $P^{-1}BP = D$, a diagonal matrix.

As $AB =BA$ then $P^{-1}ABP =P^{-1}BAP$, so
$$P^{-1}APP^{-1}BP =P^{-1}BPP^{-1}AP$$
Which means that
$$(P^{-1}AP)D = D(P^{-1}AP)$$
And so $P^{-1}AP$ is diagonal, so $A$ is diagonalizable, and moreover is simultaneously diagonalizable.

But from here I'm stuck. I know that $A$ commutes with all diagonalizable matrices, so this should always work, but I don't see how to get that $A$ is a scalar matrix.

Am I missing something obvious? Thank you in advance for your help.

Best Answer

Let's assume that you can show that only a diagonal matrix commutes with all diagonal matrices (this is a triviality, by comparing matrix coefficients). Now notice that matrix that commutes with all matrices must be diagonal with respect to all bases (conjugate and repeat the previous argument). This means that every vector is an eigenvector, which, in turn, obviously means that the matrix is a multiple of the identity.