Projection of vector onto span

Let $y = \begin{bmatrix}1\\2 \\3 \\4 \end{bmatrix}$ and $S=Span\left ( \begin{bmatrix}1\\ 1\\ 1\\ 1\end{bmatrix},\begin{bmatrix}0\\1\\ -1\\ 0\end{bmatrix},\begin{bmatrix}0\\ 1\\ 1\\ 0\end{bmatrix}\right )$

Calculate the projection of $y$ onto $S$ or $proj_S(y)$

I know how to do a projection onto a subspace of defined vectors:

i.e. if $S=\left \{ \begin{bmatrix}1\\ 1\\ 1\\ 1\end{bmatrix},\begin{bmatrix}0\\1\\ -1\\ 0\end{bmatrix},\begin{bmatrix}0\\ 1\\ 1\\ 0\end{bmatrix}\right \}$.

How do I find the projection onto a span?

By finding the projection of $y$ onto $span (S)$ suppose we write $S = \{v_1, v_2, v_3\}$ where these are the vector given above. You find the components of $y$ along each of the $v_i$, call these coefficients $a_1, a_2, a_3$, then you can write $P_S(y) = a_1v_1 + a_2v_2 + a_3v_3$ thus you've written the projection of $y$ into $span (S)$
• I need the projection of $y$ onto $S$ where $S=span(\{v_1,v_2,v_3\})$ I don't think this is the same as "$span(S)$" Apr 22 '16 at 0:35
• @RobertHosking There's really not much else you need to do. Can you see that the vectors defining $S$ form a basis for a three-dimensional subspace? In that case you only need to find the projection of $y$ onto each of those vectors, then the projection of $y$ onto $S$ is simply the weighted sum of its projection along each basis vector. Apr 22 '16 at 0:38
• So since $\{v_1,v_2,v_3\}$ are linearlly independant, $span(\{v_1,v_2,v_3\})$ forms a basis and I can treat $S$ as just a basis consisting of the vectors $\{v_1,v_2,v_3\}$? Apr 22 '16 at 0:46
• @RobertHosking I think you have the right idea but I would be careful with your terminology. Technically $S$ is a subspace defined by the basis consisting of $v_1, v_2, v_3$. Finding the projection of $y$ along each basis vector leads you to finding the projection of $y$ in the subspace $S$. Apr 22 '16 at 0:48
First find the orthonormal (or just orthogonal) basis of $S$, let it be $\{u_1, u_2, u_3\}$, using the Gram-Schmidt Process.
Let $v_1$ be the projection of $y$ onto $u_1$, let $v_2$ be the projection of $y$ onto $u_2$, and let $v_3$ be the projection of $y$ onto $u_3$. After you calculate $v_1$, $v_2$ and $v_3$, the result of projection of $y$ onto $S$ would be $v_1 + v_2 + v_3$.