TITLE: For $F$ closed in a metric space $(X,d)$, is the map $d(x,F) = \inf\limits_{y \in F} d(x,y)$ continuous?
QUESTION [5 upvotes]: Possible Duplicate:
Continuity of the metric function 

For $F$ closed in a metric space $(X,d)$, is the map $d(x,F) = \inf\limits_{y \in F} d(x,y)$ continuous?
I think it is, but I'm having a complete mind blank (it's been a while since I did any analysis). 
Any hints would be appreciated.

REPLY [3 votes]: Let $x\in X$, and let $d(x,F)=r$. we want to show that for all $\epsilon\gt 0$ there exists $\delta\gt 0$ such that if $d(x,y)\lt \delta$, then $|d(y,F)-r|\lt\epsilon$.
Let $d(y,F)=s$. Then for every $\gamma\gt 0$ there exists $f_1\in F$ such that $d(x,F)=r\leq d(x,f_1)\lt r+\gamma$. Therefore,
$$d(y,F) \leq d(y,f_1)\leq d(y,x)+d(x,f_1) \lt d(y,x)+r+\gamma$$
so
$$d(y,F)-r \leq d(y,x)+\gamma.$$
On the other hand, $d(x,F) \leq d(x,f_1) \leq d(x,y)+d(y,f_1) \leq d(x,y)+d(y,F)$, so
$$d(y,F) \geq d(x,F)-d(x,y) \geq d(x,F)-d(x,y)-\gamma,$$
hence
$$d(y,F)-r = d(y,F)-d(x,F)\geq -d(x,y)-\gamma.$$
I hope that's sufficient?