## A matrix is similar to a diagonal matrix if and only if there is a basis of eigenvectors for the associated linear transformation

Let $F$ be a field, $V$ a finite dimensional vector space over $F$, and $\varphi : V \rightarrow V$ a linear transformation.

1. Prove that if $V$ has a basis $B$ consisting of eigenvectors for $\varphi$, then the matrix $M^B_B(\varphi)$ is diagonal and moreover the diagonal entries are eigenvalues.
2. If $E$ is a basis for $V$, then $M^E_E(\varphi)$ is similar to a diagonal matrix $D$ (having nonzero diagonal entries) if and only if there is a basis $B$ for $V$ consisting of eigenvectors of $\varphi$.

1. Let $B = \{v_i\}_{i=1}^n$ be a basis of eigenvectors for $\varphi$. Suppose that for each $i$, $\lambda_i$ is the eigenvalue associated to $v_i$. That is, $\varphi(v_i) = \lambda_i v_i$. In particular, we have $M^B_B(\varphi) = [a_{i,j}]$, where $a_{i,j} = \lambda_i$ if $j = i$ and 0 otherwise. So $M^B_B(\varphi)$ is diagonal, with eigenvalues as diagonal entries.
2. Suppose $M^E_E(\varphi)$ is similar to a diagonal matrix $D$; say $P M^E_E(\varphi) P^{-1} = D$. Let $\lambda_i$ be the diagonal entries of $D$. We may take the columns of $P$ to be the coordinates (in terms of $E$) of a basis $B = \{v_i\}$ for $V$. Then $D = P M^E_E(\varphi) P^{-1} = M^B_B(\varphi)$ is the matrix of $\varphi$ with respect to the basis $B$. In particular, $\varphi(v_i) = \lambda_i v_i$, so that each $v_i$ is an eigenvector of $\varphi$.

Conversely, if there is a basis $B$ of $V$ consisting of eigenvectors, then by part 1, $M^B_B(\varphi)$ is a diagonal matrix. For any other basis $E$, we have an invertible change of basis matrix $P$ such that $P M^E_E(\varphi) P^{-1} = M^B_B(\varphi)$.