### A generalisation of Gram-Schmidt’s orthonogonalisation process

Say we have $\{b_1,b_2,\dots,b_r\}$ as an orthonormal basis for a subspace. Now let $w=a-(a,b_1)b_1-(a,b_2)b_r-\ldots-(a,b_r)b_r$ for ANY $a\in X$, where $X$ is the vector space. The set $\{b_1,b_2,\dots,b_r,\frac{w}{\|w\|}\}$ is orthonormal.
$a$ needn’t be a vector from $X\setminus S$, where $S$ is spanned by $\{b_1,b_2,\dots,b_r\}$.
We require $a$ to be from $X\setminus S$ only because we want to make the orthonormal set span a larger vector space.