At the beginning of learning the Fourier series. My teacher just told us the format but didn't prove the Completeness that why we can do it. So I'm confused.
I know $\langle\cos(nx),\cos(mx)\rangle= \pi\delta_{n,m}$ (that same with sin(nx)), which means the Orthogonality. But I can't think out why they are the basis.
Hope for someone to settle my doubts.
In the context of the Fourier serie, we can use the following inner product $$\forall f, g \in \mathscr{C}([-\pi\pi]): \quad \langle f,g \rangle =\int_{-\pi}^{\pi}f(x)g(x)dx$$ and is well-know that if $f(x),g(x)\not\equiv 0$, so $$\langle f, g \rangle =0 \implies f,g \quad \text{and independent linearly}.$$ Now, note that $$\int_{-\pi}^{\pi}\cos(nx)\cos(mx)dx=0, \quad n\not=m$$ $$\int_{-\pi}^{\pi}\sin(nx)\sin(mx)dx=0, \quad n\not=m$$ $$ \int_{-\pi}^{\pi}\sin(nx)\cos(mx)dx=0, \quad n\not=m \quad \text{or} \quad n=m.$$ so, you have that the set $$S=\{\sin(nx),\cos(mx)\}_{n,m\in \mathbb{N}}$$is a system orthogonal. It's to say $$\beta_{\mathbf{T.S}}=\left\{1,\cos(x),\sin(x),\cos(2x),\sin(2x),\ldots,\cos(mx),\sin(mx),\ldots\right\}$$is orthogonal, so in particular $\beta_{\mathbf{T.S}}$ is independent linearly.
Now, we need to prove that $\{\sin(nx),\cos(mx): n,m \in \mathbb{N}\}$ is completness, so we need to prove that any continuous function on $[-\pi,\pi]$ can be approximated uniformly by trigonometric polynomials.
Note that the uniform convergence in $[-\pi,\pi]$ implies $L^{2}-$convergence and continuos functions are dense in $L^{2}([-\pi,\pi])$, it follows that trigonometric polynomials are dense in $L^{2}([-\pi,\pi])$, so $\{\sin(nx),\cos(mx): n,m \in \mathbb{N}\}$ is a basis.
The idea behind the completness proof is to obtain a trigonometric polynomial approximation (Weierstrass approximation theorem) of a continuous function $f$ by taking the convolution of $f$ with an approximate identity that is a trigonometric polynomials.