Solution (source code)

= Solution

Use normalized <Fourier coefficients> and the <inner product>
$$
\widehat f(n)=\frac1{2\pi}\int_{-\pi}^{\pi}f(t)e^{-int}\,dt,\qquad
\langle f,g\rangle=\frac1{2\pi}\int_{-\pi}^{\pi}f(t)\overline{g(t)}\,dt.
$$
The functions $e_n(t)=e^{int}$ are <orthonormal>. Hence the <Fourier partial sum> $S_Nf=\sum_{|n|\leq N}\widehat f(n)e_n$ is the <orthogonal projection> onto the <trigonometric polynomials> of degree at most $N$. For any such polynomial $P$, <orthogonality> gives
$$
\|f-P\|_2^2=\|f-S_Nf\|_2^2+\|S_Nf-P\|_2^2,
$$
so $\|f-S_Nf\|_2\leq\|f-P\|_2$.

Given $\varepsilon>0$, the permitted density result supplies a <trigonometric polynomial> $P$ with $\|f-P\|_\infty<\varepsilon$. Once $N$ includes its degree,
$$
\|f-S_Nf\|_2\leq\|f-P\|_2\leq\|f-P\|_\infty<\varepsilon.
$$
Therefore \b[the <Fourier partial sums> converge to $f$ in the normalized $L^2$ norm], giving exactly the stated mean-square limit.