In this post, $no identity$ gives a nice formula for the distance of a vector to a subspace:
$d^2(p,L)=\frac{G(v_1,\ldots,v_m,p)}{G(v_1,\ldots,v_m)}\tag{1}$
Can anyone give me reference where I can find a proof of this formula.
In this post, $no identity$ gives a nice formula for the distance of a vector to a subspace:
$d^2(p,L)=\frac{G(v_1,\ldots,v_m,p)}{G(v_1,\ldots,v_m)}\tag{1}$
Can anyone give me reference where I can find a proof of this formula.
We show that the squared distance of a vector $v\in\mathbb{R}^{n}$ to a subspace $L\subseteq \mathbb{R}^{n}$ spanned by the linearly independent vectors $v_{1},...,v_{m}$ is given by $$d^2(v,L)=\frac{G(v_1,\ldots,v_m,v)}{G(v_1,\ldots,v_m),}$$ where $$G(x_1,\ldots,x_k)=\det \begin{pmatrix} \langle x_1,x_1 \rangle & \ldots & \langle x_1,x_k \rangle\\ \ldots & \ldots & \ldots\\ \langle x_k,x_1 \rangle & \ldots & \langle x_k,x_k \rangle \end{pmatrix}$$
is a Gram determinant.
Note that $(x_{1},...,x_{k})$ is a linear dependent family if and only if $G(x_{1},...,x_{k})=0$. Indeed, if $(x_{1},...,x_{k})$ is a linear dependent family, then there is $(\lambda_{1},...,\lambda_{k})\neq 0$ such that $\sum_{i=1}^{k}\lambda_{i}x_{i}=0$. Then $\sum_{i=1}^{k}\lambda_{i}L_{i}=0,$ where $L_{1},...,L_{k}$ are the lines of Gram matrix of $x_{1},...,x_{k}$. Conversely if $G(x_{1},...,x_{k})=0$, then there is $(\lambda_{1},...,\lambda_{k})\neq 0$ such that $\sum_{i=1}^{k}\lambda_{i}L_{i}=0,$ where $L_{1},...,L_{k}$ are the lines of the Gram matrix of $x_{1},...,x_{k}$ as previously. Then we can see that $\sum_{i=1}^{k}\lambda_{i}x_{i}=0$ is orthogonal to all $x_{i}$, and is thus 0. Linear dependence follows. \
Now let $v=u+k$, where $u\in L$ and $k\in L^{\perp}$. By using the multi-linearity of the determinant, we find that
\begin{align*} G(v_1,\ldots,v_m,v)&= G(v_1,\ldots,v_m,u)+G(v_1,\ldots,v_m,k)\\ & =G(v_1,\ldots,v_m,u)+ \det \begin{pmatrix} \langle v_1,v_1 \rangle & \ldots & \langle v_1,v_k \rangle & 0\\ \ldots & \ldots & \ldots & \ldots\\ \langle v_k,v_1 \rangle & \ldots & \langle v_k,v_k \rangle &0\\ * & * & * & ||k||^{2} \end{pmatrix} \\ & =G(v_1,\ldots,v_m,u)+ G(v_1,\ldots,v_m)||k||^{2} \end{align*} Now $G(v_1,\ldots,v_m,u)=0$, because $(v_1,\ldots,v_m,u)$ is a linear dependent family. So we get that $$||k||^{2}=d^2(v,L)=\frac{G(v_1,\ldots,v_m,v)}{G(v_1,\ldots,v_m)}.$$