TITLE: Do commuting matrices share the same eigenvectors?
QUESTION [51 upvotes]: In one of my exams I'm asked to prove the following 

Suppose $A,B\in \mathbb R^{n\times n}$, and $AB=BA$, then $A,B$ share the same eigenvectors. 

My attempt is let $\xi$ be an eigenvector corresponding to $\lambda$ of $A$, then $A\xi=\lambda\xi$, then I want to show $\xi$ is also some eigenvector of $B$ but I get stuck.

REPLY [6 votes]: They will share an eigenvector: suppose $Ax = ax$, then $BAx = Bax$ and by commutativity $A(Bx) = a(Bx)$, so if $x$ is an eigenvector of $A$ then $Bx$ is an eigenvector of $A$ with the same eigenvalue. Now look at the subspace $V$ generated by $x, Bx, B^2 x,...$, which are all eigenvectors of $A$. Then $V$ is invariant under $B$, so $V$ also contains an eigenvector of $B$.
In fact, more is true. If $A : V \to V$ then we can write $V$ as a direct sum of subspaces $V_\lambda$ of generalised eigenvectors associated to each eigenvalue $\lambda$ of $A$. The $V_\lambda$ are $B$-invariant. So we can split up $V_\lambda$ further into a direct sum of $V_{\lambda\mu}$ corresponding to the different eigenvalues $\mu$ of $B$. We could continue doing this if we have more matrices $C,D$, and so on. This way we split $V$ as a direct sum, and each term of the sum is a generalised eigenspace of all the matrices.
So we can write the matrices as block diagonal matrices where the shape of the blocks is the same for all the matrices, and all the eigenvalues on the diagonal of each block are the same in all matrices. Furthermore, each block may be put in upper triangular form.