Let the input \(V_{1},V_{2},\cdots ,V_{n}\) be a set of \(n\) linearly independent vectors. We want to use Grame-Schmidt to obtain set of \(n\) orthonormal vectors, called \(v_{1},v_{2},\cdots ,v_{n}\). The notation \(\langle V_{1},V_{2}\rangle \) is used to mean the inner product between any two vectors. The first vector \(v_{1}\) is easy to find777\begin {equation} v_{1}=\frac {V_{1}}{\sqrt {\langle V_{1},V_{1}\rangle }} \tag {1} \end {equation} The second \[ v_{2}^{\prime }=V_{2}-v_{1}\langle v_{1},V_{2}\rangle \] Where \(v_{2}^{\prime }\) means \(v_{2}\) but not yet normalized. Before we normalize \(v_{2}^{\prime }\), we need to show that \(\langle v_{1},v_{2}^{\prime }\rangle =0\). But \[ \langle v_{1},v_{2}^{\prime }\rangle =\langle v_{1},\left (V_{2}-v_{1}\langle v_{1},V_{2}\rangle \right ) \rangle \] Expanding the above gives\[ \langle v_{1},v_{2}^{\prime }\rangle =\langle v_{1},V_{2}\rangle -\langle v_{1},v_{1}\langle v_{1},V_{2}\rangle \rangle \] But \(\langle v_{1},V_{2}\rangle \) above is just a number. We can take it out of the second inner product term above. The above becomes\[ \langle v_{1},v_{2}^{\prime }\rangle =\langle v_{1},V_{2}\rangle -\langle v_{1},V_{2}\rangle \langle v_{1},v_{1}\rangle \] But \(\langle v_{1},v_{1}\rangle =1\), since \(v_{1}\) is normalized vector. The above becomes\begin {align*} \langle v_{1},v_{2}^{\prime }\rangle & =\langle v_{1},V_{2}\rangle -\langle v_{1},V_{2}\rangle \\ & =0 \end {align*}
Now we normalized \(v_{2}^{\prime }\) \[ v_{2}=\frac {v_{2}^{\prime }}{\sqrt {\langle v_{2}^{\prime },v_{2}^{\prime }\rangle }}\] Now we find \(v_{3}\)\begin {align*} v_{3}^{\prime } & =V_{3}-\left (v_{1}\langle v_{1},V_{3}\rangle +v_{2}\langle v_{2},V_{3}\rangle \right ) \\ v_{3} & =\frac {v_{3}^{\prime }}{\sqrt {\langle v_{3}^{\prime },v_{3}^{\prime }\rangle }} \end {align*}
And so on.