Let with . Commutation gives
Thus belongs to the eigenspace , with the zero vector allowed. Since has distinct eigenvalues, each eigenspace is one-dimensional. Hence for some scalar . This is the fact that commuting maps preserve eigenspaces.
The standard linear independence theorem for eigenvectors belonging to distinct eigenvalues supplies a basis of eigenvectors of . The preceding argument makes every one an eigenvector of as well. Their column matrix therefore simultaneously diagonalizes and . This is simple spectrum gives simultaneous diagonalization.
For real matrices, this conclusion always holds over ; a real common basis follows when the distinct eigenvalues of are real. Real matrix entries alone do not ensure a real eigenbasis: a quarter-turn of , with , has eigenvalues . The matrices in this question have real spectra, so their common basis is real.
Suppose has distinct eigenvalues over a field and commutes with . Each eigenspace of is one-dimensional. Since commuting maps preserve eigenspaces, acts as a scalar on each of them. The eigenvectors of give a common eigenbasis and hence simultaneous diagonalization. For real matrices, the result gives a real eigenbasis only if the eigenvalues of are real; otherwise it applies over .