Reconstruction formula and projection of a vector onto a subspace Why does reconstruction formula have the same formula as the projection of a vector onto a subspace?
$$v = \sum_{i=1}^{n} {\langle v | e_i\rangle\, e_i}$$ where ${e_1, ..., e_n}$ is an orthonormal basis and v is in an inner product space$(V,\langle\,\cdot\,|\,\cdot\,\rangle)$. $V$ can be any vector space such as $\mathbb R^n$
 A: Let $U\subseteq V$ be a subspace of a vector space $U$. To define a projection onto $U$, one needs to choose a complement $W$. Here a complement is a second subspace $W\subseteq V$ such that $V=U\oplus W$, which means $V=U+W$ and $U\cap W=\{0\}$. In this situation, every $v\in V$ has a unique decomposition as $v=u+w$ with $u\in U$ and $w\in W$. Hence, we can define the projection onto $U$ along $W$ by $p(u+w)=u$.
Now we consider the case of a finite dimensional euclidean space and orthogonal projections. For a subspace $U\subseteq V$, the orthogonal projection is the projection onto $U$ along $U^\perp$, the orthogonal complement of $U$. This works since $V=U\oplus U^\perp$. Now to obtain the formula you are referring to, let $(u_1,\dots,u_k)$ be an orthonormal basis of $U$ and $(w_1,\dots,w_l)$ be an orthonormal basis of $U^T$. Together these form an orthonormal basis $(u_1,\dots,u_k,w_1,\dots,w_l)$ of the whole space $V$.
Given any vector $v\in V$ we can write it uniquely as a linear combination $$v = \sum_{i=1}^k \lambda_i u_i + \sum_{i=1}^l \mu_i w_i.$$
Furthermore, since we have an orthonormal basis, the coefficients are given by $\lambda_i = \langle v, u_i\rangle$ and $\mu_i = \langle v, w_i\rangle$. So we have the unique decomposition
$$
v = \underbrace{\sum_{i=1}^k \langle v, u_i\rangle\, u_i}_{\in U} + \underbrace{\sum_{i=1}^l \langle v,w_i\rangle w_i}_{\in U^\perp}.
$$
But this means that the projection of $V$ onto $U$ along $U^\perp$ is given by
$$
p(v) = p\left(\underbrace{\sum_{i=1}^k \langle v, u_i\rangle\, u_i}_{\in U} + \underbrace{\sum_{i=1}^l \langle v,w_i\rangle w_i}_{\in U^\perp}\right) = \sum_{i=1}^k \langle v, u_i\rangle\, u_i.
$$
