TITLE: Proving that the Fourier Basis is complete for C(R/$2*\pi$ , C) with $L^2$ norm
QUESTION [7 upvotes]: Let $H$ be the inner product space = $\{f: \mathbb{R} \to \mathbb{C} \mid f \text{ is continuous and has period }2 \pi\}$ where the inner product is:
$$\langle f,g \rangle = \int_{0}^{2\pi}f(t)\overline{g(t)} dt $$ 
How do I prove that for $n \in \mathbb{Z}$ and $e_n(t)=\dfrac{1}{\sqrt{2\cdot\pi}} e^{i n  t}$, $(e_n)_{n \in N}$ is a basis of $H$ (that it is orthonormal is easy).

REPLY [5 votes]: This argument is from Rudin's Real and Complex Analysis (section 4.24 Completeness of the Trigonometric System). It considers $C(-\pi,\pi)$ instead of $C(0,2\pi)$, but this makes no difference of course.
Suppose we had trigonometric polynomials $Q_k \geq 0$ such that

$$\frac{1}{2\pi}\int_{-\pi}^{\pi} \! Q_k(t) \, dt = 1$$
$Q_k \to 0$ uniformly on $[-\pi, -\delta] \cup [\delta, \pi]$ for every $\delta >0$

(i.e. the $Q_k$ are a summation kernel). Associate to each continuous $f$ the function
$$P_k(t) = f \ast Q_k(t) = \frac{1}{2\pi}\int_{-\pi}^\pi \! f(t-s)Q_k(s) \, ds.$$
Substitution shows that also
$$P_k(t) = \frac{1}{2\pi}\int_{-\pi}^\pi \! f(s)Q_k(t-s) \, ds$$
so that each $P_k$ is a trigonometric polynomial. Now let $\epsilon > 0$. Since $f$ is uniformly continuous, there exists $\delta > 0$ such that $|f(t) - f(s)| < \epsilon$ whenever $|t-s| < \delta$. Since each $Q_k$ has average equal to one, we see that
$$P_k(t) - f(t) = \frac{1}{2\pi}\int_{-\pi}^\pi \! (f(t-s) - f(s)) Q_k(s) \, ds$$ and the positivity of $Q_k$ implies
$$|P_k(t) - f(t)| \le \frac{1}{2\pi}\int_{-\pi}^\pi \! |f(t-s) - f(s)|Q_k(s) \, ds$$
$$= \frac{1}{2\pi}\int_{|s| \le \delta} \! |f(t-s) - f(s)|Q_k(s) \, ds + \frac{1}{2\pi}\int_{|s|\geq \delta} \! |f(t-s) - f(s)|Q_k(s) \, ds$$
In the first term, the uniform continuity of $f$ shows that the integrand is smaller than $\epsilon Q_k(s)$ and the assumption on the average of $Q_k$ makes this term small. For the second the integrand converges uniformly to $0$ as $k \to \infty$ (since $f$ is bounded). Since the estimates are independent of $t$ we have shown that
$$\|P_k - f\|_\infty < \epsilon$$
for $k$ large enough and thus the trigonometric polynomials are dense. We need to now construct the $Q_k$ with the desired properties. To do this we let 
$$Q_k(t) = c_k \left(\frac{1 + \cos t}{2}\right)^k$$
where the $c_k$ is chosen in such a way as to satisfy the assumption on the averages. Since the $Q_k$ are clearly positive, we only need to show that $Q_k \to 0$ uniformly away from $0$. But $Q_k$ is even (on $(-\pi,\pi)$) and decreasing on $[0,\pi]$. Thus for any $\delta > 0$ we have
$$|Q_k(t)| \le Q_k(\delta) \le \frac{\pi(k+1)}{2}\left(\frac{1 + \cos \delta}{2} \right)^k \to 0$$
independently of $t$ as $k \to \infty$ since 
$$\frac{1 + \cos \delta}{2} < 1.$$