Definition: Let X be a metric space, and E $\subseteq X$, E is closed if it is equal to its closure.

Definition: A metric subset U of X is open if for every point in U there exists an open ball centered around the point that is contained within U.

Theorem: Let X be a metric space. A Subset $Y \subseteq X$ is closed iff $Y^c$ is open.

Proof:

Assume Y is closed so $Y= \bar{Y}$ (so it is equal to is closure). Which means that $y\in Y \iff \forall$ $r>0 B(y,r) \cap Y \neq \emptyset$.

Let $a \in Y^c$ be arbitrary. Since Y is closed $\exists r>0 : B(a,r) \cap Y = \emptyset$. This means that $B(a,r) \subseteq Y^c$. Since a was arbitrary, $Y^c$ is open.

Suppose $Y^c$ is open. So $y\in Y^c$ $\iff$ $\exists r>0$ : $B(y,r) \subseteq Y^c$. Let x $\in \bar{Y}$ be arbitrary. Note that it suffices to show that $\bar{Y} \subseteq Y$. So for any possible $r>0$ we have $B(x,r) \cap Y \neq \emptyset$. Since $Y^c$ is open, it follows that $x \in Y$.

Is the proof correct? I would very much love feedback, I'd be very very thankful.