any vector as a linear combination of other vectors plus a perpendicular vector? Is it true that given a vector $v \in R^m$ we can write $v=Bw+z,$ where $B$ is a $m \times n$ matrix, $w \in R^n$, and $z\in R^m$ and orthogonal to the space spanned by the columns of $B$. 
I was reading a proof and the above was used with no explanation. So I am assuming it is true but I do not see it. 
 A: Yes, this is true, and something even more general is true: for any subspace $\mathcal{V} \subset \mathbb{R}^m$,  any vector $\vec{v} \in \mathbb{R}^m$ can be represented as $\vec{u} + \vec{z}$, where $\vec{u} \in \mathcal{V}$ and $\vec{z} \in \mathcal{V}^\perp$.
In fact, $\vec{u}$ will be the orthogonal projection of $\vec{v}$ onto $\mathcal{V}$, and $\vec{z} = \vec{v} - \vec{u}$ will be the component of $\vec{v}$ orthogonal to $\mathcal{V}$.
A: If $W$ is a subspace of the inner product space $V$, then $V=W\oplus W^\perp$. That is, any $v\in V$ can be written as a sum of a vector in $W$ and one on $W^\perp$. Now, if $W$ is the column space of the matrix $B$, then by definition any $w\in W$ can be written as a linear combination $\sum_i a_iB_i$ of the columns $B_i$ of $B$. Note that we don’t require that they be linearly independent. If they’re not, that just means that this linear combination isn’t unique. That sum, however, can be written as the matrix product $$B\begin{bmatrix}a_i\\\vdots\\a_n\end{bmatrix}.$$
