I have a question about the following proof by contradiction.
Let $(X,d)$ be a metric space. If $K \subset X$ is compact, then it is closed.
Proof. We show if $K$ is not closed, then it is not compact. If $K$ is not closed, then there is $p \in \overline{K} \setminus K$. From $p \in \overline{K}$, we know for every $r>0$, $B_{r}(p) \cap K \ne \emptyset$. Consider for $n \in \mathbb{N}$
\begin{align*} U_{n} = (\overline{B}_{\frac{1}{n}}(p))' \end{align*}
then \begin{align*} \bigcup U_{n} = \bigg(\bigcap_{n \in \mathbb{N}} \overline{B}_{\frac{1}{n}}(p)\bigg) \end{align*}
So
\begin{align*} \bigcup_{n \in \mathbb{N}} U_{n} = X \setminus \{p\} \supset K \end{align*}
and we have an open cover $(U_{n})_{n \in \mathbb{N}}$ of $K$.
If $K$ were compact, we would have a finite subcover $(U_{n})_{n \in F}$, $|F| < \infty$, and we would have $N = \max \{n: n \in F \}$ with $U_{N} = \bigcup_{n \in F} U_{n}$
We see \begin{align*} B_{\frac{1}{N}}(p) &\subset \overline{B}_{\frac{1}{N}}(p) =(U_{N})' \end{align*}
This gives us a contradiction between subcover property \begin{align*} K \subset U_{N} \end{align*}
I was wondering if the contradiction has to do with $B_{r}(p) \cap K \ne \emptyset$ since there exists at least one element of $K$ in $B_{r}(p)$, but every element in $B_{\frac{1}{N}}(p)$ is an element of $(U_{N})'$. Then this implies that an element of $K$ is in $(U_{N})'$, which is the contradiction?