In my homework I have a Hilbert space with orthonormal basis $(e_n)_{n=1}^\infty$. Let $E=\{e_1,e_2\}^\perp$
then I have to show that: $$P_Eh=h- \langle h,e_1 \rangle_1 - \langle h,e_2 \rangle e_2$$
I know that $E$ is closed but not sure how that helps. I also know that for all $e_n$ with $n>2$ they are perpendicular to $E$.
Any hint would be appreciated
By definition $P_E(h)$ is the unique element of $E$ such that $h=P_E(h)+u_h$ where $u_h$ is orthogonal to $E$.
$\langle h-\langle h,e_1\rangle e_1-\langle h,e_2\rangle e_2,e_i\rangle=0, i=1,2$ implies that $P_E(h)\in E$ and $u_h=-\langle h,e_1\rangle e_1-\langle h,e_2\rangle e_2$ is orthogonal to $E$.