$d(a,X) = 0 \iff X\cap U\neq \emptyset$ (distance from set equals 0 iff is adherent point) I need to prove that:
$$d(a,X) = 0 \iff X\cap U \neq \emptyset$$
for all open set $U$ that contains $a$
My idea is that if $d(a,X) = 0$, then there is a point $b\in X$ such that $d(a,b)=0$. In some way, I should be able to construct a ball that contains $a$ and $b$. Remember that $b\in X$ so the intersection should not be empty.
Any ideas on how to fill the gap I left in my proof? 
 A: "$\Rightarrow$" Suppose $d(a,X)=0$, then for any $\epsilon>0$, there exists $b_\epsilon\in X$ such that $d(a,b_\epsilon)<\epsilon$. Let $B(a,\epsilon)$ denote the open ball centered at $a$ with radius $\epsilon$, then $B(a,\epsilon)\cap X\neq \emptyset$. As $\epsilon>0$ is arbitrary, we conclude that every open ball centered at $a$ intersects $X$. Thus this direction is proved.
"$\Leftarrow$": Suppose $X\cap U\neq\emptyset$ for every open set containing $a$. Then we consider two cases:


*

*If $a\in X$, then there is nothing to prove.

*If $a\notin X$, note that for each $\epsilon>0$, we have $X\cap (B(a,\epsilon)\setminus\{a\})\neq\emptyset$, so there exists $b_\epsilon\in X\cap(B(a,\epsilon)\setminus\{a\})$, in particular $d(a,b_\epsilon)<\epsilon$. By letting $\epsilon\to 0$, the claim follows.

A: I use the following equivalence: $a$ belongs to $\operatorname{Cl} X$ iff for all nbd's $N$ of $a$, $N\cap X\not=\varnothing$
Since $0=d(a,X)=\inf\{d(a,x):x\in X\}$, we can choose $x_n$ in $X$ such that $d(a,x_n)<n^{-1}$ for all $n$. So, there is a sequence $\{x_n\}\subset X$ such that $x_n \to a$, that is, $a$ belongs to the closure of $X$. 
Conversely, if $a$ belongs to $\operatorname{Cl} X$, we can find a sequence $\{x_n\}$ of elements in $X$ such that $x_n\to a$ (only consider the nbd's $\{B(a,n^{-1})\}$ and use that $B(a,n^{-1})\cap X\not= \varnothing$) and this implies $d(a,X)=0$.
