The Spectral Theorem and Dynamical Systems