Suppose $T$ is a compact, self-adjoint operator on a Hilbert space $\mathcal{H}$. Then there exists an orthonormal set $\{e_n\}_{n=1}^{\infty}$ of eigenvalues of $T$ such that every $x \in \mathcal{H}$ has a unique decomposition of the form $$ x = \sum_{n=1}^{\infty} c_n e_n + y, $$ where $c_n \in \mathbb{C}$ and $y \in \ker(T)$.
The proof I know of the above theorem boils down to showing that $\mathcal{H} = L \oplus \ker(T)$, where $$L = \overline{\text{span}\{e_n\}_{n=1}^{\infty}}.$$
I'm confused about the structure of $L$. How do we know that an element of $L$ (say $z$) looks like $$z = \sum_{n=1}^{\infty} c_n e_n?$$ I thought that, in general, the closure of the span of an infinite set did not coincide with the set of all infinite sums of elements from that set?