If $f \in L^2(\mathbb T)$ then $S_n(f) \to f$ in $L^2$ sense. Theorem: If $f \in L^2(\mathbb T)$, then $S_n(f) \to f$ in $L^2(\mathbb T)$ sense.
Proof: Let $f \in L^2(\mathbb T)$, then by definition $\|f\|_2^2 = \frac{1}{2\pi} \int_0^{2\pi} \vert f(x) \vert^2 \, dx < \infty$. 
We want to show that $$\lim_{n \to \infty} \|f - S_n(f)\|_2 = \lim_{n \to \infty} \frac{1}{2\pi} \int_0^{2\pi} \vert f(x) - S_n(f)(x) \vert^2 \, dx = 0.$$ 
Since $\{e_k\}$ is a complete orthonormal set where $e_k = e^{ikx}$, then we can write $$f(x) = \sum_{k = -\infty}^\infty \langle f, e_k \rangle e_k = \sum_{k = -\infty}^\infty \widehat f(k) e^{ikx}.$$ 
Notice that $\displaystyle S_n(f)(x) = \sum_{k = -n}^n \widehat f(k) e^{ikx}$, so $\vert f(x) - S_n(f)(x) \vert \to 0$ and moreover $\vert f(x) - S_n(f)(x) \vert^2 \to 0$. 
Notice that $\vert f(x) - S_n(f)(x) \vert^2 \leq \vert f(x) \vert^2$. We use the Dominated Convergence Theorem with $\vert f(x) \vert^2$ as our dominating function and conclude that $$\lim_{n \to \infty} \int_0^{2\pi} \vert f(x) - S_n(f)(x) \vert^2 \, dx = \int_0^{2\pi} \lim_{n \to \infty} \vert f(x) - S_n(f)(x) \vert^2 \, dx = \int_0^{2\pi} 0 \, dx = 0.$$ 
Conclude that $S_n(f) \to f$ in the $L^2$ sense. $\square$
Is this reasoning correct? If not, how would one prove this?
 A: There are two facts related to $L^2(\mathbb{T})$ that you will use:


*

*$(e_n)_n$ is an orthonormal system - easy

*The span of $(e_n)$ is dense in $L^2(\mathbb{T})$. This is proved using a generic result about the density of continuous functions in $L^2(\mathbb{T})$ and the Weierstrass approximation with trigonometric polynomials ( linear combinations of $e_n$'s ) for continuous functions on $\mathbb{T}$. 
There is a third very general fact that is valid for (pre)Hilbert spaces ( completeness is not required for this):


*Let $(e_n)_{n\in \mathbb{Z}}$ an orthonormal system in $H$, $I$  finite subset of indexes in  $\mathbb{Z}$ and $v$ in $H$. For every $(b_n)_{n \in I}$ a system of coefficients we have the inequality (best approximation):


$$|| v - \sum_{n \in I} \langle v, e_n \rangle  e_n||\le ||v - \sum_{i \in I} b_n e_n||$$
Indeed we have the equality: 
$$|| v - \sum_{n \in I} \langle v, e_n \rangle  e_n||^2 + || \sum_{n \in I }(\langle v, e_n \rangle - b_n) \cdot e_n ||^2 = ||v - \sum_{i \in I} b_n e_n||^2$$
by Pythagoras. 
The $L^2$ convergence ( even in generalized sense) of the Fourier series is easy now. Take any $\epsilon >0$. There exists a finite  $I_{\epsilon}  \subset \mathbb{Z}$ and  a linear combination of $(e_n)_{n\in I}$ that approximates $f$ better than $\epsilon$ (from $2$.):
$$ || f - \sum_{n \in I_{\epsilon} } b_n e_n||< \epsilon$$
Take any $I$ finite, $I \supset I_{\epsilon}$. By the $3$. above we have 
$$|| f - \sum_{i \in I} \langle f, e_n \rangle \cdot e_n|| < \epsilon$$
A: The reasoning is valid except that the pointwise convergence of $S_n(f)$ was not shown. This follows from Carleson's Theorem.
Here's a different approach.
Theorem: Suppose $\{e_k\}$ is an orthonormal set in (infinite dimensional) Hilbert space $H$. Then the following are equivalent:


*

*The span of $\{e_k\}$ is dense in $H.$

*$\{e_k\}$ is a maximal orthonormal set.

*If $\langle x,e_k\rangle=\langle y,e_k\rangle$ for all $k,$ then $x=y.$

*$x=\sum_{k=1}^{\infty}\langle x,e_k\rangle e_k$ for all $x\in H.$

*Parseval's Identity: $\sum_{k=1}^{\infty}|\langle x,e_k\rangle|^2=\|x\|^2$ for all $x\in H.$


A set $\{e_k\}$ satisfying these conditions is called a complete orthonormal set.
Theorem: If we define $e_k$ in $L^2(\mathbb T)$ by $e_k(x) = e^{ikx}$ for $k \in \mathbb Z$, then $\{e_k\}$ is a complete orthonormal set.
Theorem: If $f \in L^2(\mathbb T)$, then $S_n(f) \to f$ in $L^2(\mathbb T)$ sense.
Proof: Since $f \in L^2$ and $\{e_k\}$ is complete in $L^2$, then $f = \sum_{k = -\infty}^\infty \langle f, e_k \rangle e_k$. Observe that
$$
\begin{align*}
\|S_n(f) - f\|_2^2 &= \bigg \|\sum_{k = -n}^n \vert \langle f, e_k \rangle e_k  - \sum_{k = -\infty}^\infty \langle f, e_k \rangle e_k \bigg \|_2^2 \\
&= \bigg \| \sum_{\vert k \vert > n} \langle f, e_k \rangle e_k \bigg \|^2 \\
&\leq \sum_{\vert k \vert > n} \vert \langle f, e_k \rangle \vert^2
\end{align*}
$$
Since  $\|f\|^2 = \sum_{k = -\infty}^\infty \vert \langle f, e_k \rangle \vert^2 < \infty$, then $\sum_{\vert k \vert > n} \vert \langle f, e_k \rangle \vert^2 \to 0$.
Conclude that $S_n(f) \to f$ in the $L^2$ sense.
