Proof of the orthogonal decomposition for Hilbert spaces. Let $\mathcal{H}$ be a Hilbert space. Consider $ \mathcal{A} \subseteq \mathcal{H}$, a subspace of $\mathcal{H}$. 
Prove that 
$$
\mathcal{H} = \overline{\rm \mathcal{A}} + \mathcal{A}^{\perp}.
$$
Where $\mathcal{A}^{\perp}$ is the orthogonal complement of $\mathcal{A}$, and $\overline{\rm \mathcal{A}}$ is the topological closure of $\mathcal{A}$ over $\mathcal{H}$. We interpret the sum as a direct sum of the vector spaces.
In Orthogonal decomposition of a Hilbert space it was found that $\mathcal{A}^{\perp}$ is already closed, however, the decomposition is assumed as given.
 A: This is a fundamental part of building the theory of Hilbert spaces, and any textbook on the subject should deal with this. I can go through a sketch of the proof.
Start by proving that closed non-empty subsets (or, if you prefer, linear subspaces) admit unique projections. That is, if $A$ is a closed linear subspace and $x \in \mathcal{H}$, then there exists a unique $a^* \in A$ such that $\|x - a^*\| = \inf_{a \in A} \|x - a\|$.
To prove this, use Cantor's intersection theorem for complete metric spaces. Let $r = \inf_{a \in A} \|x - a\|$. For any $\varepsilon > 0$, define
$$A_\varepsilon = B[x; r + \varepsilon] \cap A.$$
By definition of $r$, these are non-empty, nested, closed subsets of $\mathcal{H}$. The fact that they are convex, contained in $B[x; r + \varepsilon]$, but do not intersect $B(x; r)$ (as well as the geometry of the Hilbert space ball), implies that the diameter of the sets must tend to $0$. By Cantor's intersection theorem, the intersection of the $A_\varepsilon$s is unique, and this point will be the projection of $x$ onto $A$.
Next, you need to prove that this projection satisfies the orthogonality conditions we expect, when $A$ is a subspace. That is, if $p$ is this point of projection of $x$ onto a closed subspace $A$, then $\langle x - a, a \rangle = 0$. Geometrically, this is a statement about the smoothness of the Hilbert space ball. It's probably easiest to prove indirectly; if $x - a$ is not orthogonal to $a$, then you should be able to find another point in $A$ strictly closer to $x$.
That basically does it for you: you can write $x = (x - a) + a$, where $a \in A$ and $x - a \in A^\perp$. When $A$ is not closed, simply project onto $\overline{A}$, and the result follows anyway.
A: An alternative way is to use the result that any orthonormal subset of a Hilbert space can be extended to a complete orthonormal basis. To prove your result this way, note that the closure $\overline{\mathcal{A}}$ of $\mathcal{A}$ is a Hilbert space because $\mathcal{H}$ is a Hilbert space. So $\overline{\mathcal{A}}$ has a complete orthonormal basis $\{ e_{\alpha} \}_{\alpha\in A}$. And this orthonormal set can be extended to a complete orthonormal basis $\{ e_{\alpha} \}_{\alpha\in A}\cup \{ e_{\beta} \}_{\beta\in B}$ of $\mathcal{H}$. Then you have the decomposition you want:
$$
         x = \sum_{\alpha\in A}\langle x,e_{\alpha}\rangle e_{\alpha}+\sum_{\beta\in B}\langle x,e_{\beta}\rangle e_{\beta}.
$$
The first sum is in $\overline{\mathcal{A}}$ while the second is in $\mathcal{A}^{\perp}$.
