Let $E \subset \mathbb{R}^{n}$ a subspace, $(e_{1}, \ldots, e_{k})$ an orthonormal basis of $E$ and $a \in \mathbb{R}^{n}$ an arbitrary vector. Define $a_{0} = \langle a, e_{1}\rangle e_{1} + \ldots + \langle a, e_{k}\rangle e_{k}$, show that $a - a_{0}$ is perpendicular to all vectors of $E$.
I couldn't get a good idea. I would like a hint, but I don't want the solution.
Simply note that, by direct check, since $e_i\cdot e_j =\delta_{ij}$
$$(a-a_0)\cdot e_i=a\cdot e_i-a\cdot e_i=0$$