TITLE: Is it true that the whole space is the direct sum of a subspace and its orthogonal space?
QUESTION [7 upvotes]: Problem
The ground field is $K$, $\operatorname{char}K\neq2$. Suppose $W$ is a (maybe infinite dimensional) subspace of a vector space $V$ with a symmetric/symplectic form $\langle\cdot,\cdot\rangle$. The orthogonal space of $W$, denoted as $W^\perp$, is defined as $W^\perp=\{\,v\in V\,\colon\,\langle v,w\rangle=0,\forall w\in W\,\}$. If the form is nondegenerate on $W$, say $W\cap W^\perp=\{0\}$, is it true that $V=W\oplus W^\perp$? What if the form is nondegenerate on $V$?
Background
The statement is true when $W$ is finite dimensional. One can choose an orthogonal basis for $W$, then apply the projection formula to determine a orthogonal projection. However, such a process couldn't be applied in the infinite dimensional case. I'm interested in how far we can generalize our results of psuedo-Euclidean or symplectic forms on a finite dimensional vector space to the infinite-dimensional case.

REPLY [5 votes]: Let $V = C[a,b]$ be the vector space of continuous functions on $[a,b]$ with inner product $\displaystyle \langle f,g \rangle = \int_a^b f(x)g(x)dx$. 
Let $W =\{f \in V; f(a)=0\}$. Then $W^{\perp} = \{0\}$. To see why: if $h\in W^{\perp}$ then $\langle x-a,h(x) \rangle=0$ we must also have, for example, $\langle(x-a)g(x),h(x)\rangle=0$ for all $g\in V$. So $h\equiv 0$. 
So $V\neq W \oplus W^{\perp}$.
edit: Mohamed beat me to it