Let $S$ be a closed subspace of an inner product space $H$. Is it true that $H = S⊕S^⊥$? If $S$ is a closed subspace of a Hilbert space $H$, then $H = S\oplus S^\perp$. Is
this true in every inner product space?
An example of an inner product space where this is false?
 A: Construction
Here's a recipe to construct "bad" incomplete spaces:


*

*Start with a Hilbert space $\dim\mathcal{H}=\infty$.

*Choose a normalized vector $e_0$.

*Extend it to an ONB $\mathcal{E}\owns e_0$.

*Fix the independent vector $b_0:=e_0+\sum_{k=1}^\infty\frac{1}{k}e_k$.

*Extend this to a Hamel basis $\mathcal{B}\supseteq\mathcal{E}$ with $\mathcal{B}\owns e_0,b_0$.

*Rip it off to get an orthonormal system $\mathcal{S}:=\mathcal{E}\setminus\{e_0\}$.

*Rip it off to get a linear independent system $\mathcal{L}:=\mathcal{B}\setminus\{e_0\}$.

*Span your incomplete space $X:=\langle\mathcal{L}\rangle$.


Then the orthonormal system is maximal $\mathcal{S}^\perp=(0)$ but not an ONB $\overline{\langle\mathcal{S}\rangle}\neq X$.
Example
Now, consider the closed subspace $Z:=\overline{\langle\mathcal{S}\rangle}$. Then it is $X\neq Z\oplus Z^\perp$.
A: Let $X$ be the space of continuous functions on $[-1,1]$ with scalar product $(f,g)\mapsto \int_{-1}^1 f(x)g(x) dx$ and $S$ a subspace of all functions $f$ with $f([-1,0])=\{0\}$. $S$ is closed in $X$ (although not in $L_2$) and $S^\perp$ is the space of functions vanishing on $[0,1]$. But then every function $g$ in $S\oplus S^\perp$ satisfies $g(0)=0$, so $X\neq S\oplus S^\perp$.
