Let \(v_{1} \ldots v_{k}\) be vectors in a linear space with an inner product \(\langle,\),\(rangle . Define the\) Gram determinant by \(G\left(v_{1}, \ldots, v_{k}\right)=\operatorname{det}\left(\left\langle v_{i}, v_{j}\right\rangle\right)\).

a) If the \(v_{1} \ldots v_{k}\) are orthogonal, compute their Gram determinant.

b) Show that the \(v_{1} \ldots v_{k}\) are linearly independent if and only if their Gram determinant is not zero.

c) Better yet, if the \(v_{1} \ldots v_{k}\) are linearly independent, show that the symmetric matrix \(\left(\left\langle v_{i}, v_{j}\right\rangle\right)\) is positive definite. In particular, the inequality \(G\left(v_{1}, v_{2}\right) \geq 0\) is the Schwarz inequality.

d) Conversely, if \(A\) is any \(n \times n\) positive definite matrix, show that there are vectors \(v_{1}, \ldots, v_{n}\) so that \(A=\left(\left\langle v_{i}, v_{j}\right\rangle\right)\).

e) Let \(\mathcal{S}\) denote the subspace spanned by the linearly independent vectors \(w_{1} \ldots w_{k} .\) If \(X\) is any vector, let \(P_{\mathcal{S}} X\) be the orthogonal projection of \(X\) into \(\mathcal{S}\), prove that the distance \(\left\|X-P_{\mathcal{S}} X\right\|\) from \(X\) to \(\mathcal{S}\) is given by the formula

\[

\left\|X-Z_{\mathcal{S}} X\right\|^{2}=\frac{G\left(X, w_{1}, \ldots, w_{k}\right)}{G\left(w_{1}, \ldots, w_{k}\right)} .

\]