Hello everyone


I would like to have a detailed reference to the statement bellow:


Let $A,B\in \mathbb{R}^{n\times n}$ such that $AB=BA$. Suppose $A$ has real eigenvalues only and $B$ is diagonalizable. Then, there exists a nonsingular matrix $P$ such that $P^{-1}AP$ is of Jordan canonical form and $P^{-1}BP$ is diagonale. Precisely
\begin{equation\*}
 P^{-1}AP=\mathrm{diag}(J\_{1},\cdots,J\_{r}) \quad\text{and}\quad P^{-1}BP=\mathrm{diag}(\underset{p\_{1}}{\underbrace{\mu\_{1},\cdots,\mu\_{1}}},\cdots,\underset{p\_{r}}{\underbrace{\mu\_{r},\cdots,\mu\_{r}}})
\end{equation\*}
where $J\_{k}$ is a Jordan block of size $p\_{k}$.



Simultaneous Jordanization
Let $\lambda$ be an eigenvalue of $B$, and $V\_\lambda$ the corresponding eigenspace
(the set of all eigenvectors of $B$ corresponding to $\lambda$ and the zero vector).
Then the whole space is the direct sum of those $V\_\lambda$. (This is your condition that
$B$ is diagonalizable). 


Claim. $A$ maps each $V\_\lambda$ into itself. Proof. Let $x\in V\_\lambda$ this means that
$Bx=\lambda x$. Now let $Ax=y$. We have $By=BAx=ABx=\lambda Ax=\lambda y$. So $y\in V\_\lambda$.
This proves the claim. 


Now by the Jordan theorem, each $V\_\lambda$ contains a Jordan basis for $A$. This basis
(as the whole $V\_\lambda$) consists of eigenvectors of $B$. Taking all these bases together
we obtain a basis of the whole space, which is a Jordan basis for $A$ and each vector is an
eigenvector of $B$. Take this basis as columns of your $P$.


