# Vector subspace projection

I want to find the projection from $\mathbb{R}^n$ onto a vector subspace of $\mathbb{R}^n$. Can I do this by adding the projections to each basis vector, even if the basis vectors are not orthogonal? Specifically, projecting $x$ onto $V$, can I define the projection $$\operatorname{proj}_V(x) = \sum_i \frac {v_i\cdot x}{v_i\cdot v_i}v_i$$ for basis vectors $v_i$?

• – user137731
Nov 8, 2014 at 22:50

You need an orthogonal basis.

Let's make a simple counterexample with $n=2$. The subspace is $U=\langle e_1\rangle$. Consider the basis $\{v_1,v_2\}$ where $$v_1=\begin{bmatrix}1\\0\end{bmatrix}, \qquad v_2=\begin{bmatrix}1\\1\end{bmatrix}.$$ For $x=\begin{bmatrix}0\\1\end{bmatrix}$ we have $$\frac{v_1\bullet x}{v_1\bullet v_1}v_1 + \frac{v_2\bullet x}{v_2\bullet v_2}v_2 = \frac{0}{1}\begin{bmatrix}1\\0\end{bmatrix} + \frac{1}{2}\begin{bmatrix}1\\1\end{bmatrix} = \begin{bmatrix}1/2\\1/2\end{bmatrix}$$ while the orthogonal projection of $x$ on $U$ is clearly the zero vector.

You need an orthogonal basis.