Linear Algebra – Distance from Point $(1,1,1,1)$ to Subspace of $R^4$

linear algebravector-spaces

Let $W=span\lbrace\frac{1}{√2}(1,-1,0,0),\frac{1}{√2}(0,0,1,1)\rbrace$ be a subspace of the Euclidean space $\mathbb R^4$. What must be the distance from the point $(1,1,1,1)$ to the subspace $W$?

Clearly, the subspace $W$ has dimension $2$ and the basis vectors are orthogonal too but I still dn't know how to proceed to find $W$ and then the distance?

Any hints appreciated.

Best Answer

IF
$W=span\lbrace{v_1},{ v_2}\rbrace$ where unit vectors $v_1, v_2$ are orthogonal
THEN
matrix $P=v_1{v_1}^T+v_2{v_2}^T$ is projecting point $A$ into $W$ as a point $A_W$.
Having two points finally we can calculate distance $AA_W$, because vector $r_{AA_w}$ is orthogonal to this space.

To prove this it can be noticed that $r_{A_w}=Pr_A$ so $r_{AA_w}= r_A - r_{A_w} = (1-P)r_A$ and this vector is orthogonal to $Pr_{A}$ (projection of point $A$) because $P(1-P)=0$. Distance $AA_W$ is equal to $\Vert{r_{AA_w}}\Vert$.

In this case $r_{A_W}={\begin{bmatrix} 0.5 & -0.5 & 0 & 0 \\ -0.5 & 0.5 & 0 & 0 \\ 0 & 0 & 0.5 & 0.5 \\ 0 & 0 & 0.5 & 0.5 \\ \end{bmatrix}} {\begin{bmatrix} 1 \\ 1 \\ 1 \\ 1 \\ \end{bmatrix}}={\begin{bmatrix} 0 \\ 0 \\ 1 \\ 1 \\ \end{bmatrix}}$