Solution (source code)

= Solution

Construct the vectors inductively by the <Gram-Schmidt process>, proving its needed properties directly. Suppose $w_1,\ldots,w_{j-1}$ form an <orthonormal basis> of $U_{j-1}$, and put
$$
r_j=u_j-\sum_{k<j}\langle u_j,w_k\rangle w_k.
$$
For every $i<j$, taking an <inner product> with $w_i$ gives $\langle r_j,w_i\rangle=0$. Also $r_j\ne0$, because otherwise $u_j$ would lie in the <linear span> of its predecessors, contrary to <linear independence>. Define
$$
\boxed{w_j=r_j/\|r_j\|.}
$$
It lies in $U_j$, has unit <norm>, and is orthogonal to every $u_i$ with $i<j$, since those vectors lie in $U_{j-1}$. Writing $u_j=r_j+\sum_{k<j}\langle u_j,w_k\rangle w_k$ gives $\langle w_j,u_j\rangle=\|r_j\|>0$. The same identity shows that $w_1,\ldots,w_j$ span $U_j$, completing the induction, including the empty sum at $j=1$.

For uniqueness, any candidate $w\in U_j$ expands in the basis $w_1,\ldots,w_{j-1},r_j$. Orthogonality to every earlier $u_i$, hence to every earlier $w_i$, makes its first $j-1$ coefficients zero. Thus $w=tr_j$. Unit norm forces $t=\pm1/\|r_j\|$, and $\langle w,u_j\rangle>0$ forces the positive sign. This proves <uniqueness in the Gram-Schmidt process with positive normalization> without assuming a projection theorem or any other major orthogonalization result.