Proof of Gram-Schmidt for countable sets Let me first state the theorem.

Theorem (Gram–Schmidt Orthogonalisation).  Let $X$ be an inner product space, and let $S=\{u_1,u_2,\dots\}\subseteq X$ be a countable subset. Define
          \begin{alignat*}{3}
        v_1 &= u_1, &   e_1 &= v_1/\|v_1\|,\\
        v_n &= u_n - \textstyle\sum\limits_{i=1}^{n-1}\langle{e_i},{u_n}\rangle e_i, \qquad & e_n & =v_n/\|v_n\|,
    \end{alignat*}
          and for any $n$, if $v_n=0$, then $u_n$ and $v_n$ are discarded, and $u_{n+1}$, $v_{n+1}$ are relabelled to $u_n$, $v_n$ respectively. 
Then the set $S' = \{e_1,e_2,\dots\}$ is an orthonormal set with $\mathop{\mathrm{span}}S' = \mathop{\mathrm{span}}S$.

The usual proof for when $S$ is finite follows quite straightforwardly by induction on $|S|$. But if $S$ is allowed to be infinite, is the proof still valid? 
 A: Your misunderstanding appears to be the following.
You believe that we are inducting on the cardinality of $S$, and therefore are understandably confused about why the statement is true when $S$ is countably infinite.
The error is that we are in fact not inducting on the cardinality of $S$.
There are two inductions here.
The first is in the construction of the map $v:\Bbb{N}_+\to X$, which indexes the orthonormal set. 
The second is to prove the following statement
$$\langle v_i,v_j\rangle = \delta_{ij}\text{, for $i,j\in\Bbb{N}_+$}.$$
Note that $i$ and $j$ are finite in this statement, and we are trying to show that the statement is true for all $i$ and $j$ in the positive natural numbers. Induction is a perfectly valid way to do this.
At no point do we induct on the cardinality of $S$.
A: Yes, it is. Notice that the statement of the theorem does not say $|S|$ is finite but rather countable. Also, see here:
Gram-Schmidt in Hilbert space?
For a helpful heuristic: if $|S|$ is countably infinite, we can always find the next element of the orthonormal basis, and so the dimension of any valid $|S|$ is unbounded. Perhaps this requires the Axiom of Choice, but this is widely accepted in my experience.
