The annihilator $M^\perp$ of a set $M \neq \emptyset$ in an inner product space X is a closed subspace of X. I'm trying to prove the following:
Show that the annihilator $M^\perp$ of a set $M \neq \emptyset$ in an inner product space X is a closed subspace of X.
Next is the proof I have done, which indeed only proves that $M^\perp$ can't be open, from what I know, this doesn't imply it is closed, so I need to ensure $M^\perp$ is closed. I would really appreciate any corrections to this argument and if possible any orientation on how to prove the statement with basic concepts of the topic. Thanks.
Proof:
i) By definition
$$
M^\perp = \{x \in X: \langle x,y \rangle = 0 \quad \forall y \in M\}
$$
Suppose $x_1,x_2~\in M^\perp$ and $\alpha$ is a scalar. Then
$$
\langle \alpha x_1+x_2, y \rangle = \alpha \langle x_1,y \rangle +\langle x_2, y\rangle = 0
$$
This means  $~\alpha x_1 +x_2 ~\in M^\perp$, then $~M^\perp$ is a subspace of X.
ii) Note that if $M=\{\vec{0}\}$, then $M^\perp = X$ which is close and open, then in particular $M^\perp$ is closed. Suppose then that M contains at least one element $y\neq \vec{0}$. On the other hand if $M^\perp = \{\vec{0}\}$, $M^\perp$ is a singleton and therefore is closed. Suppose then that $M^\perp$ contains at least one $x\neq \vec{0}$.
If $M^\perp$ is an open subset of X and $x_0 \in M^\perp$ and $x_0\neq \vec{0}$, there exist a real number $\epsilon>0$ such that the ball with the center in $x_0$ and radius $\epsilon$ is contained in $M^\perp$
$$
B(x_0, \epsilon)=\{x\in X: ||x-x_0||<\epsilon\} \subset M^\perp
$$
Now, consider the vector $x' = x_0+\beta y~$ where $y\in M$, $y \neq \vec{0}$ and $\beta$ is a scalar, it is true that we can choose $\beta$ such that
$$
||x'-x_0||= ||x_0+\beta y-x_0||=||\beta y||=|\beta|~||y||<\epsilon \longrightarrow x' \in B(x_0,\epsilon)
$$
Since $y\in M \rightarrow \langle x_0, y\rangle = 0$, and therefore
$$
\langle x',y\rangle = \langle x_0+\beta y, y\rangle = \langle x_0, y\rangle + \beta\langle y,y \rangle = \beta \langle y,y\rangle \neq \vec{0}. ~Since ~y \neq \vec{0}. 
$$
then $x' \notin M^\perp$. In summary, we can always form $x'$ such that $x' \in B(x_0,\epsilon)$ but $x' \notin M^\perp$. This mean, $B(x_0,\epsilon) \not\subset M^\perp$, which implies $x_0$ is not an interior point of $M^\perp$, in consequence $M^\perp$ is not open.
 A: You can use a similar idea to show that the complement of $M^\perp$ is open, which proves that $M^\perp$ is closed.
Fix $x\in X\setminus M^\perp$. Then there exists $y\in M$ with $\langle x,y\rangle\ne0$. Let $\delta>0$ with $\delta<|\langle x,y\rangle|$. Let $z\in B(x,\delta/(2\|y\|))$. Then
$$
|\langle z,y\rangle|=|\langle x,y\rangle+\langle z-x,y\rangle|\geq|\langle x,y\rangle|-|\langle z-x,y\rangle
\geq\delta-\|z-x\|\,\|y\|\geq\delta-\delta/2>0.
$$
Then $z\not\in M^\perp$, implying that $B(x,\delta/(2\|y\|))\subset X\setminus M^\perp$, and so $X\setminus M^\perp$ is open.

Edit: even I'm the non-complete case one can do the following. If $\{x_n\}\subset M^\perp$ and $x_n\to x$, then for any $y\in M$
$$
\langle x,y\rangle=\lim_n\langle x_n,y\rangle=0,
$$
so $x\in M^\perp$ and $M^\perp$ is closed.
A: The map $f_x: X \to \Bbb R$ defined by $f_x(y)=\langle x, y\rangle$ is continuous, for any $x$.
So $$M^\perp = \bigcap_{x \in M} f_x^{-1}[\{0\}]$$ is closed, as an intersection of closed sets.
