Let $X$ be a metric space with metric $d$. Let $x\in X$ and let $A$ be a subset of $X$ and define
$$d(x,A)=\inf\{d(x,a)\mid a\in A\}.$$
Prove that $d(x,A)=d(x,\mathrm{cl}(A))$ where $\mathrm{cl}(A)$ is the closure of $A$.
First of all, one direction is obvious: $d(x,\mathrm{cl}(A))\leq d(x,A)$, but I have a hard time proving the reverse direction.
Best Answer
I will be using the notation $\overline{A}$ to mean the closure of set $A$.
Let $y\in \overline{A}$. Using the result found in here, we get $d(y,A)=0$. Let $\epsilon>0$. Then $\epsilon >d(y,A)$. Thus, there exits $a\in A$ such that $d(y,a)<\epsilon$. Thus $$d(x,A)\leq d(x,a)\leq d(x,y)+d(y,a)<d(x,y)+\epsilon.$$
Hence, $$d(x,A)< d(x,y)+\epsilon\quad \text{for all }\epsilon>0.$$
Hence,
$$d(x,A)\leq d(x,y).$$
Thus, $$d(x,A)\leq d(x,y)\quad \text{for all }y\in\overline{A}.$$
Hence, $$d(x,\overline{A})=\inf\{d(x,y):y\in\overline{A}\}\geq d(x,A).$$
You already said that $d(x,\overline{A})\leq d(x,A)$ is obvious.
Hope this help.