TITLE: Why does a diagonalization of a matrix B with the basis of a commuting matrix A give a block diagonal matrix?
QUESTION [13 upvotes]: I am trying to understand a proof concerning commuting matrices and simultaneous diagonalization of these.
It seems to be a well known result that when you take the eigenvectors of $A$ as a basis and diagonalize $B$ with it then you get a block diagonal matrix:
$$B=
 \begin{pmatrix}
  B_{1} & 0 & \cdots & 0 \\
  0 & B_{2} & \cdots & 0 \\
  \vdots  & \vdots  & \ddots & \vdots  \\
  0 & 0 & \cdots & B_{m}
 \end{pmatrix},$$
where each $B_{i}$ is an $m_{g}(\lambda_{i}) \times m_{g}(\lambda_{i})$ block ($m_{g}(\lambda_{i})$ being the geometric multiplicity of $\lambda_{i}$).
My questionWhy is this so? I calculated an example and, lo and behold, it really works :-) But I don't understand how it works out so neatly.
Can you please explain this result to me in an intuitive and step-by-step manner - Thank you!

REPLY [4 votes]: Getting a block diagonal matrix expressing$~B$ just means that each eigenspace for$~A$ (whose direct sum fills the entire space since $A$ is supposed diagonalisable) is $B$-stable. And a useful fact that applies here is that when two linear operators commute, then every subspace that is the kernel or image of a polynomial in one of the operators is automatically stable for the other operator. A polynomial in the first operator is just another operator$~\psi$ that commutes with the second operator$~\phi$, so it suffices to show that for the kernel and the image of $\psi$ are $\phi$-stable when $\psi$ and $\phi$ commute:

Kernel: if $v\in\ker\psi$ then $\psi(\phi(v))=\phi(\psi(v))=\phi(0)=0$, so indeed $\phi(v)\in\ker\psi$.
Image: if $v=\psi(w)$ then $\phi(v)=\phi(\psi(w))=\psi(\phi(w))$, which indeed is in the image of $\psi$.

The eigenspace of$~A$ for $\lambda$ is of course just the special case of the kernel of the polynomial $A-\lambda I$ in$~A$.