Problem finding this equality Let $X$ be a metric space, $Y \subset X$ a subset, and $x \in X$ a point.
We define the distance of $x$ from $Y$ as
$$d(x, Y) = \inf d(x,y)$$
Proof that
$$\bar{Y} = \{x \in X : d(x, Y) = 0\}$$
I know that
$$\bar{Y}=Y \cup D(Y) $$
Where $D(Y)$ are $Y$ Accumulation Points. Obviously if $y \in Y$ you have $d(y,Y)=0$. My doubt is how to try that $d(y,Y)=0$ if $y \in D(Y)$. Having tried this I can say that the demonstration is over?
 A: Claim 1: $\mbox{LHS} \subseteq \mbox{RHS}$. Let $x\in\bar{Y}$,
then there exists a sequence $(x_{n})$ in $Y$ such that $x_{n}\rightarrow x$.
Note that $0\leq d(x,Y)\leq d(x,x_{n})\rightarrow0$ as $n\rightarrow\infty$.
This shows that $d(x,Y)=0$ and hence $x\in\mbox{RHS}$.
Claim 2: $\mbox{RHS}\subseteq\mbox{LHS}$. Let $x\in\mbox{RHS}$,
then $d(x,Y)=0$. For each $n\in\mathbb{N}$, $\frac{1}{n}$ is not
a lower bound of the set $\{d(x,y)\mid y\in Y\}$ (because the greatest
lower bound of that set is $0$), so there exists $x_{n}\in Y$ such
that $d(x,x_{n})<\frac{1}{n}.$ We obtain a sequence $(x_{n})$ in $Y$ (formally, we invoke the Axiom of Choice to assert the existence of such sequence). Clearly $d(x,x_{n})\rightarrow0\Rightarrow x_{n}\rightarrow x$.
Hence $x\in\bar{Y}$.
A: If $x$ obeys $d(x,Y)=0$, then either $x \in Y$ and then trivially $x \in \overline{Y}$, or $x \notin Y$. So assume we're in the latter case, and let $r>0$. Then $r$ is not a lower bound for $\{d(x,y): y \in Y\}$, or else $d(x,Y) = \inf  \{d(x,y): y \in Y\} \ge r >0$ (as inf is the largest lower bound) and we have $d(x,Y)=0$. Hence there is some $y' \in Y$ so that $d(x,y') < r$ to witness that $r$ is not such a lower bound, but then $B(x,r) \cap Y\setminus \{x\}$, as witnessed by this $y'$, so as $r>0$ was arbitrary, $X \in D(Y)$ and also $x \in \overline{Y}$. This shows one inclusion.
If $x \in \overline{Y}$, then $d(x,Y)=0$: $0$ is surely a lower bound for $\{d(x,y): y \in Y\}$ and suppose $r>0$ were a larger one. Then $B(x,r) \cap Y = \emptyset$ (or a point in the intersection would contradict immediately that $r$ were a lower bound for $\{d(x,y): y \in Y\}$). It follows that $x \notin Y$ and $x \notin D(Y)$ so $x \notin \overline{Y}$, contradiction. It follows that there can be no upperbound of $\{d(x,y): y \in Y\}$ that is $>0$ so $\inf \{d(x,y): y \in Y\} = d(x,Y)=0$ as required. This shows the other inclusion. (We could also have used the two cases for $x$ as well: $X \in Y$ then $d(x,x)=0 \in \{d(x,y): y \in Y\}$ so $d(x,Y)=0$ is a minimum; or $y \in D(Y)$ and for $r>0$ we pick
$y' \in B(x,r) \setminus \{x\}$ to show that $\inf \{d(x,y): y \in Y\} \le d(x,y') < r$ and as $r$ is arbitrary, $d(x,Y)=0$ that way too).
