I know it's been answered before (at least to the case with $n$ different eigenvalues) but I didn't find a proof for the general case, and I would like some help with this question.
We are given linear transforms $S,T: V\to V$ where $V$ is some vector space.
We are given that $S$ and $T$ commute, $ST=TS$, and that they are diagonalizable:
$T=PD_1P^{-1}$ and $S=KD_2K^{-1}$, where $D_1, D_2$ are diagonal and $K,P$ are invertible.
We are asked to show that $S$ and $T$ have a common eigenspace.
My solution
Maybe I understood the question wrong, but what I tried to do is show that if $v$ is an eigenvector of $S$ then it is also an eigenvector of $T$.
let $Sv=\lambda v$.
$STv=TSv=T\lambda v=\lambda Tv$ which implies that $Tv$ is an eigenvector of $S$ with eigenvalue $\lambda$.
Why does that mean that $v$ is an eigenvalue of $T$?
Another possible way to solve this question is write:
$PD_1P^{-1}KD_2K^{-1} = KD_2K^{-1}PD_1P^{-1}$ and get that $P=K$ but I don't know how to do that either.
If $S$ and $T$ commute and both are diagonalizable then there is a common transform that will simultaneously diagonalize both.
First find a transform $M$ so that $M^{-1}SM$ is diagonal. Suppose that the eigenvalues of $S$ are sorted so repeated eigenvalues of $S$ are grouped together.
Let us suppose that $\lambda_1$ has multiplicity $m$. Since the eigenspace of $S$ is invariant under $T$ we should have $$\begin{align} M^{-1} S M &= \begin{pmatrix}\lambda I_m & 0 \\ 0 & \hat{S}_{22}\end{pmatrix} \\ M^{-1} T M &= \begin{pmatrix}\hat{T}_{11} & 0 \\ 0 & \hat{T}_{22}\end{pmatrix} \end{align}$$ where $I_m$ is $m \times m$ identity matrix. Let $P$ diagonalize $\hat{T}_{11}$ i.e. $$ P^{-1} \hat{T}_{11} P = D $$ where $D$ is diagonal.
Now let $$ R= M \begin{pmatrix} P & 0 \\0 & I\end{pmatrix} $$ Then $$ R^{-1} S R = \begin{pmatrix} P^{-1} & 0 \\0 & I\end{pmatrix} \begin{pmatrix}\lambda I_m & 0 \\ 0 & \hat{S}_{22}\end{pmatrix} \begin{pmatrix} P & 0 \\0 & I\end{pmatrix} = \begin{pmatrix}\lambda I_m & 0 \\ 0 & \hat{S}_{22}\end{pmatrix} $$ $$ R^{-1} T R = \begin{pmatrix} P^{-1} & 0 \\0 & I\end{pmatrix} \begin{pmatrix}\hat{T}_{11} & 0 \\ 0 & \hat{T}_{22}\end{pmatrix} \begin{pmatrix} P & 0 \\0 & I\end{pmatrix} = \begin{pmatrix}D & 0 \\ 0 & \hat{T}_{22}\end{pmatrix} $$ Thus the $m\times m$ block is now simultaneously diagonalized.
Proceed as before for other eigenvalues of $S$.