Approximation theorem: from inner product space to Hilbert space I am trying to understand Fourier Analysis from an algebraic perspective. In particular, starting from the best approximation theorem in a simple inner product space, I am trying to follow the problems that arise and how they are progressively solved, leading up to the construction of a Hilbert space.
If we start with a possibly-infinite-dimensional inner product space $\mathcal{V}$ over $\mathbb{C}$ and a finite orthogonal sequence $\{\vec{e}_i \} _{i=1}^n\subset\mathcal{V}$, and $\vec{v}\in\mathcal{V}$, we know that the vector:
$$\vec{p}=\sum_{i=1}^n\frac{\langle \vec{v},\vec{e}_i\rangle}{||\vec{e}_i||^2}\vec{e}_i$$
is such that $||\vec{v}-\vec{p}||<||\vec{v}-\vec{w}||$, for any $\vec{w}\in\text{lin} \{ \vec{e}_1,\ldots,\vec{e}_n \},\; \vec{w}\neq\vec{p}$.

*

*My first question would be, What happens if the sequence becomes infinite? Would the sum to obtain $\vec{p}$ still converge? I think it would, due to Bessel's inequality. Is that right? Does any other problem arise from the sequence becoming infinite?

*Aside from that, I think the next problem appears if we wanted $||\vec{v}-\vec{p}||\to 0$. What would we need for that to be true? Would it be required for the sequence $\{\vec{e}_i \} _{i\in\mathbb{N}}$ to be a base of $\mathcal{V}$?

Thanks in advance and best regards.
CZa
 A: Let $p_n = \sum_{1\leq i \leq n} <v,e_i> e_i$ where $||e_i|| = 1$.
Let $v=p_n+q_n$, Now $<q_n,e_i> = <v-p_n,e_i> = 0, \forall i \in [n]$. Hence even if $\{e_1,...,e_n\}$ cannot be extended to a fully orthonormal basis, its still true that $||v-p_n|| < ||v-w||$ for $p_n \neq w$ for $w \in <e_1,...,e_n>$.
Now $||v||^2 = ||p_n||^2 + ||q_n||^2$ by the fact that $<p_n,q_n> = 0$. Hence we get $||p_n||^2 \leq ||v||^2$ and this is true for every $n$. Hence due to monotonicity of $||p_n||$ and the fact that $||v||^2 < \infty$ we have the convergence of $||p_n||$ answering question 1.
Note that $||v||^2 = \lim_{n \rightarrow \infty} ||p_n||^2 + \lim_{n \rightarrow \infty} ||q_n||^2 = ||p||^2 + ||q||^2$ where $\lim_n p_n = p$ and $\lim_n q_n = q$.
Now if $||q|| \neq 0$ by using the fact that $<q,e_i> = <v-p,e_i> = 0$, $\forall i$ implying that $e_i$ does not span the full space. So answer to your second question is true only when there exists a countably many orthonormal basis $\{e_i\}$ spanning the full space with an inner product linear in this infinite basis sum in which case it has to be that $q=0$.
