Simultaneously diagonalisable iff A,B commute

Yes, this is a repeat, however I have not seen anyone explain it fully (or such that I can comprehend it, and believe me, I have searched thoroughly for answers).

If the (linear) endomorphisms $A,B: V \to V$ are diagonalisable, show that they are simultaneously diagonalisable $\iff AB=BA$

The initial implication is trivial. I have shown the case for when all eigenvalues are distinct. It is when there are not necessarily distinct that I cannot seem to get my head around the problem. (For instance, minimal polynomials are too unfamiliar to me to be constructive). Any links, proofs, hints or explanations are deeply, deeply appreciated.

Thanks!


Let $\lambda_1,\dots,\lambda_r$ the eigenvalues of $A$ and $E_{\lambda_i}$ the corresponding eigenspace. For any eigenvector $u\in E$, we have $$A(B(u))=B(A(u))=B(\lambda u)=\lambda B(u).$$ This proves the $E_{\lambda_i}$s are stable by $B$.

Now, since $A$ is diagonalisable, the vector space $V$ decomposes as $$V=\bigoplus_{i=1}^rE_{\lambda_i}$$ In a basis of eigenvectors for $A$ the matrix A becomes a diagonal matrix, and the matrix $B$ is a block-diagonal matrix $$\begin{pmatrix} B_1\!\\ &\!\ddots\!\\ &&\!B_r \end{pmatrix}$$ Thus it is enough to observe the restriction of (the endomorphism associated with) $B$ is diagonalisable. Take in each $E_{\lambda_i}$ a basis of eigenvectors of $B_i=B\Bigl\lvert_{E_{\lambda_i}}$. The matrix of the restriction of $A$ to this eigenspace remains diagonal, since it is $\lambda_i I_{E_{\lambda_i}}$. Finally, choose as a basis for $V$ the union of the bases of the $E_{\lambda_i}$. You obtain a basis which diagonalises simultaneously $A$ and $B$.


As stated, the claim is false. $$A=B=\begin{pmatrix}0&1\\0&0\end{pmatrix} $$ clearly commute, but are not diagonalizable.