A theorem regarding Fourier series in Folland's Real Analysis says the following:
8.20 Theorem. Let $E_k(x)=e^{2\pi ik\cdot x}$. Then $\{E_k:k\in{\bf Z}^n\}$ is an orthonormal basis of $L^2({\bf T}^n)$.
A comment about this theorem is made in his book as follows:
Here is my question:
One can certainly see that the Fourier transform is a map from $L^2({\bf T}^n)$ to $\ell^2({\bf Z}^n)$. Why can Theorem 8.20 tell that it is "onto"?

If $(a_n) \in l^2$ then defining $$f_n:= \sum_{j=1}^n a_j e^{2\pi i j \cdot x}$$ by orthogonality we have for all $m \leq n$ $$\| f_n -f_m\|_{2}^2 = \sum_{j=m+1}^n |a_j|^2$$
This shows that the sequence $f_n$ is Cauchy in $L^2$.