Hilbert space with 2 subspaces

In my homework I am trying to understand the concept of Hilbert spaces with the following simple problem:

Let H be a Hilbert space and A and B be closed subspaces of H so that $$A^{\perp} = B^{\perp}$$

Determine if A=B.

My idea is no because A and B could be disjoint and still meet the condition. However I am not sure and any input would be appreciated

Since $$B$$ is a closed subspace, we have a decomposition $$H=B \oplus B^{\perp}$$. We will show that $$A\subset B$$. Let $$a\in A$$, $$a=b_1+b_2$$ with $$b_1\in B,b_2\in\ B^{\perp}$$. Now because $$A^{\perp}=B^{\perp}$$, projection of $$a$$ onto $$B^{\perp}$$ is the same as projection of a onto $$A^{\perp}$$, which is $$0$$, since $$a\in A$$. Therefore $$b_2=0$$ and thus $$a=b_1\in B$$. By symmetry $$B\subset A$$.
Since $$A$$ and $$B$$ are closed, the answer must be YES. Here's the proof:
Let $$C=A^{\perp }=B^{\perp }$$ and consider the space $$C^{\perp }$$. This is a closed subspace of $$H$$ and we can show that $$C^{\perp }=A=B$$. For any element $$a\in A$$ and $$b\in B$$, it follows that for every $$c\in C$$ we have $$\langle c,a\rangle =\langle c,b\rangle =0$$ and hence $$A\subset C^{\perp }$$ and $$B\subset C^{\perp }$$. If $$A\subsetneq C^{\perp }$$ then by Hahn-Banach theorem there's an element $$c_0\in C$$ so that $$\langle a,c_0 \rangle\neq 0$$ for some $$a\in A$$, but $$A^{\perp } =C$$, a contradiction. Therefore $$A=C^{\perp }$$ and similarly $$B=C^{\perp }$$.
• Can you explain why there is a $c_0 \in C$? I don't know Hahn-Banach and it is not in our book so it would be nice to understand the existence of $c_0$ without H-B Oct 6 '19 at 12:30