Let $A\colon H\to H$ be a compact, self-adjoint operator on a Hilbert space $H$. Then, the spectrum theorem says that for every $x\in H$
$$Ax = \sum_{k=1}^{\infty} \lambda_k\langle x,e_k \rangle e_k$$ where $\lambda_k$ are nonzero eigenvalues and $e_k$ are the corresponding orthonormal eigenvectors.
Assume that the range of A is dense.
Why does this imply that $\left\{e_k\right\}$ is a complete orthonormal System of $H$, i.e. an orthonormal Basis?
That $\left\{e_k\right\}$ is an orthonormal System is clear, but I do not see the completeness which would mean that the linear span of $\left\{e_k\right\}$ is dense in $H$.