Proof that the closure of $S$ is the set of all limits of convergent sequences in $S$ I'd like to validate my proof of: the closure of $S$ in a metric space $X$ is the set of the limits of all convergent sequences in $S$.
The definition of $\bar{S}$ that I am adopting is that it is the intersection of all the closed sets containing $S$.
Let $L$ be the set of the limits of all convergent sequences in $S$.
We'd like to prove:

*

*$L \subseteq \bar{S}$, i.e., $x \in L \Rightarrow x \in \bar{S}$

*$\bar{S} \subseteq L$, i.e., $x \in \bar{S} \Rightarrow x \in L$
We prove both sides using contrapositives.
To prove $L \subseteq \bar{S}$, suppose $x \notin \bar{S}$.
Then there exists an open ball $B(x,r)$ which is not in $\bar{S}$. Since $\bar{S}$ contains $S$, there is no $x_n \in S$ such that $x_n \in B(x,r)$. Thus, the $r$-neighbourhood of $x$ does not contain any $x_n \in S$, and is thus not a limit point of $S$. Thus, $x \notin L$, thus proving the contrapositive.
To prove that $\bar{S} \subseteq L$, suppose that $x \notin L$.
Thus, $x$ is not a limit point of $S$, implying that there exists an open ball $B(x,r_0)$ such that it contains no $x_n \in S$.
Thus $B'(x,r)$ (the complement of the open ball $B(x,r)$) contains $S$. Since $B(x,r_0)$ is open, $B'(x,r_0)$ is closed. Denote $B'(x,r)=P_r$.
Similarly, all balls $B(x,r):r<r_0$ do not contain $x_n \in S$. Thus all $B'(x,r)=P_r$ are closed and contain $S$. It follows that $x \in P_r'$.
Thus, we write:
$x \in \displaystyle\bigcup_{i \in (0,r)} P_i' \\
\Rightarrow x \in \left(\displaystyle\bigcap_{i \in (0,r)} P_i\right)' \\
\Rightarrow x \in (\bar{S})' \\
\Rightarrow x \notin \bar{S} \\
$
thus proving the contrapositive.
I'd like feedback on the correctness of this proof, please.
 A: The first part needs clarification: you want to show $x \in L$ implies $x \in \overline{S}$, so start by picking a sequence $(x_n)$ from $S$ so that $x_n \to x$ (witnessing $x \in L$) and then you start a proof by contradiction that $x \in \overline{S}$. (So now the $x_n$ don't come out of nothing later on). It is indeed true that $x \notin \overline{S}$ implies the existence of some $r>0$ so that $B(x,r) \cap S = \emptyset$ and this follows from the fact that $X\setminus \overline{S}$ is open and has $x$ as an (interior) point. You should maybe clarify that better, because now the claim stands without any justification (unless it's a lemma in your text or notes already?). Then the final part is a valid contradiction, now that the sequence already has been introduced.
As to the proof that $\overline{S} \subseteq L$, I think that's rather muddled in your write-up. You assume $x \notin L$ (but it's unclear how to use that negative fact) and want $x \notin \overline{S}$ somehow. I think it's invalid as written.
Why not go the more direct route? Take $x \in \overline{S}$. Note that for each $n \in \Bbb N$, $B(x,\frac1n) \cap S \neq \emptyset$ (that needs a little argument from the definition of $\overline{S}$ but is true), and pick $x_n$ in that intersection and show that in the end $x_n \to x$ witnessing directly that $x \in L$. Much better, IMO.
The basic lemma that you're in need of here (and often used as an alternative definition of the closure), for all $x \in (X,d)$ and $S \subseteq X$ we know:
$$x \in \overline{S} \iff \forall r>0: B(x,r) \cap S \neq \emptyset$$
A: For the first contrapositive you proved, you've written a sentence

Thus, the $r$-neighbourhood of $x$ does not contain any $x_n \in S$, and and is thus not a limit point of $S$, thus, $ x \notin L $

The part that I made bold is actually a restatement of what you had aimed to prove. But it's still correct. In order to prove rigorously that $x \notin L$ you must show that $x$ is not a limit point for any sequence in $S$, which is not done here. So I would say some argument like the following is needed to be added for the proof of the first part,

Let $\{s_n\}$ be a sequence in $S$. Since no point of $S$ is in $B(x,r)$, for all $ i \in \mathbb{N} $ we have $ s_i \notin B(x,r) $ and so $ d(x,s_i) > r $. So $x$ is not the limit of $\{s_n\}$. Since we didn't use any property of $\{s_n\}$ we may say that $x$ is not the limit of any sequence in $S$. Therefore $ x \notin L $.

For the second contrapositive, it is correct that there is some $r_0$ such that it contains no $ x_n \in S$; But a proof is required if it's not a first course, stating that otherwise a sequence could have been constructed (how?) which would have converged to $x$, contradicting $ x \notin L$.
From there on, also, your proof is correct; but I think using the $P_i$s has contributed to the complication of your proof. Note that actually $$ \bigcup_{i \in (0,r)} P_i' = \bigcup_{i \in (0,r)} B(x,i) = B(x,r)$$
So the second implication, $x \in \Big(\bigcap_{i \in (0,r)} P_i\Big)'$, is that $ x \in B(x,r) $. And you could have said that $ B(x,r)' $ is a closed set containing $S$ but not $x$, therefore $ x \notin \overline{S}$.
But overall your proof is fine.
