If $S, T \in B(X)$ are self-adjoint, compact, and commuting bounded linear operators on a Hilbert space $X$, they can be simultaneously diagonalized More specifically, there is an orthonormal basis of $X$ consisting of common eigenvectors. 
So far, I've approached proving this by using the spectral theorem for compact, self-adjoint operators. I know that $S$ and $T$  can separately be diagonalized. I've also seen a hint that suggests considering the compact operator $S+ iT$, but this operator isn't self-adjoint, so the spectral theorem won't apply.
Any suggestions on how to proceed with this proof would be appreciated. 
 A: You can write $S=\sum_{n=1}^{\infty}\lambda_n P_n$, where $\{ \lambda_n \}$ are the non-zero eigenvalues of $S$, and $P_n$ is the orthogonal projection onto the eigenspace of $S$ associated with $\lambda_n$, which is finite-dimensional. The projections $P_n$ commute with $T$ because $P_n$ commutes with everything that commutes with $S$. Similarly, $T=\sum_{m=1}^{\infty}\mu_m Q_m$. Every $P_n$ commutes with every $Q_m$. So $P_nQ_m=Q_mP_n$ is either $0$ or is an orthogonal projection $R_{n,m}=P_nQ_m$ such that $SR_{n,m}=\lambda_nR_{n,m}$ and $TR_{n,m}=\mu_m R_{n,m}$. It can happen that $R_{n,m}=0$; after eliminating the trivial products, you're left with orthogonal projections $P_nQ_m=Q_mP_n$ with ranges that are finite-dimensional eigenspaces of both $S$ and $T$. The orthogonal sum of all of these non-zero eigenspaces is the full space. This gives you what you want.
A: I've been informed that the trick is to note that the eigenspaces of $T$ are invariant under $S$ (or vice versa). And since, for the eigenvalues $\lambda_n$ of $T$, we can express the Hilbert space as $X = \bigoplus_{n=0}^\infty E_{\lambda_n}$, where $E_{\lambda_n}$ is the closed linear span of the eigenvectors associated with $\lambda_n$. It follows that we can express $S$ as $S = \bigoplus_{n=0}^\infty S\big|_{E_{\lambda_n}}$. The diagonalization of $S$ using eigenvectors of $T$ follows from there. 
