Are these sequences total sequences? DEFINITIONS/CONCEPTS THAT I USE

*

*When I refer to $\mathbb{K}$ (field), I am only referring to $\mathbb{K}=\mathbb{R}$ or $\mathbb{C}$.


*I am using, for $a,b\in\mathbb{R}$, $a<b$, $C[a,b]=\{f:[a,b]\to \mathbb{K}\space\space |\space\space f  \textrm{ is continuous} \}$ with a dot product $<\cdot,\cdot>$ defined for $f,g\in C[a,b]$ as:
$$ 
<f,g>=\int_{a}^{b} f(t)\overline{g(t)} dt
$$
i.e, $(C[a,b],<\cdot,\cdot>)$ is a preHilbert space.


*A sequence $(x_{n})_{n}$ in a preHilbert space is called total if $x$ is orthogonal to $x_{n}$, $\forall n\in\mathbb{N}$, only in the case that $x=0$.
Now, let's start with the exercise; I will list the questions and then give my attempt below.
I am asked to prove the following:

In $C[-1,1]$,  $(1,t,t^2,t^3,...)$ (here I am working with $\mathbb{K}=\mathbb{R}$) is a total sequence:

Let's just take the definition; take $z=z(t)\in C[-1,1]$ such that $z\perp t^{n}$, $\forall n\in\mathbb{N}$; i.e, $\int_{-1}^{1} z(t)t^{n} dt=0$, $\forall n\in\mathbb{N}$. With this last thing, I must conclude that $z(t)=0$, $\forall t\in [-1,1]$... And being honest, I am lost.

In $C[-\pi,\pi]$,  $(1,\sin(t),\cos(t),\sin(2t),\cos(2t),...)$ (here I am working with $\mathbb{K}=\mathbb{R}$) is a total sequence:

(I am also lost here)

In $C[-\pi,\pi]$,  $(e^{int})_{n\in\mathbb{Z}}$ (here I am working with $\mathbb{K}=\mathbb{C}$) is a total sequence:

Here, following similar arguments, I will need to prove that if there is $z=z(t)\in C[-\pi,\pi]$ such that $\int_{-\pi}^{\pi} z(t)\overline{e^{int}} dt=\int_{-\pi}^{\pi} z(t)e^{-int} dt=0$, $\forall n\in\mathbb{N}$, then $z(t)=0$, $\forall t\in [-\pi,\pi]$; in this case, I will have to take into account that if $\tilde{z}\in C[-\pi,\pi]$ has not null imaginary part, $\int_{-\pi}^{\pi} \tilde{z}(t) dt = \int_{-\pi}^{\pi} Re\tilde{z}(t) dt + i\int_{-\pi}^{\pi} Im\tilde{z}(t) dt$, but I am also lost...
I would really appreciate some hint/help on it... Thanks a lot!
 A: I think the key result you are missing is the Stone Weierstrass theorem.

$\boxed{1}$ Assume that $$\int_{-1}^1 z(t) t^n dt = 0.$$
Then, by linearity of the integral
$$\int_{-1}^1 z(t)p(t) dt = 0$$
for all polynomial functions $p: [-1,1]\to \mathbb{C}$. By the Stone-Weierstrass theorem, these functions are uniformly dense in $[-1,1]$, so there is a sequence of polynomial functions $\{p_n\}_{n=1}^\infty$ such that
$$ p_n \to \overline{z}$$
where the convergence is uniform. Hence, since we can switch an integral and a uniform limit, we get
$$\int_{-1}^1 |z(t)|^2 dt = \int_{-1}^1 z(t)\overline{z}(t) dt = \lim_n \int_{-1}^1 z(t)p_n(t)dt = 0$$
from which it follows that $z=0$.

$\boxed{2}$ I leave this as an exercise for you after you understand the third subquestion, which I will now explain.

$\boxed{3}$ Proceed as follows:
(1) Use the Stone-Weierstrass theorem to prove that the span of $\{e^{int}\}_{n \in \mathbb{Z}}$ is uniformly dense in $C([-\pi, \pi])$. It may be useful to note that the relations
$$e^{int}e^{imt}= e^{i(m+n)t}, \quad \overline{e^{int}}= e^{-int}$$
hold.
(2) Proceed as in exercise $\boxed{1}$.
