Theorem (orthogonal complement in Hilbert space)

Let $H$ be a Hilbert space.

For any closed subspace $Y$ of $H$, we have $H = Y$${}\oplus{}$$Y^\perp$.

Moreover the projection $$ \begin{align*} P: H &\to H \\ y + z &\mapsto y, &&y\in Y, z\in Y^\perp \end{align*} $$ sends $x$ to the closest point in $Y$ to $x$.

We say $H$ is the orthogonal direct sum of $Y$ and $Y^\perp$, $Y^\perp$ is the orthogonal complement of $Y$, and $P$ is the orthogonal projection onto $Y$.

Proof