Solution (source code)

= Solution

The <characteristic polynomial> has only the <eigenvalue> $\mu$. If $A$ is <diagonalizable>, there is an invertible <matrix> $P$ and a diagonal <matrix> $D$ with $A=PDP^{-1}$. Every diagonal entry of $D$ is an <eigenvalue>, hence equals $\mu$. Thus $D=\mu I$ and $A=P(\mu I)P^{-1}=\mu I$. Conversely, $\mu I$ is already diagonal in every <basis>. Hence
$$
\boxed{A\text{ is diagonalizable}\quad\Longleftrightarrow\quad A=\mu I}.
$$
This argument uses the existence of an <eigenvector> <basis> rather than merely the repeated root of the polynomial; repeated <eigenvalues> alone do not imply diagonalizability.