# Lipschitz mapping on a subset of a metric space

Let $(X,d)$ be a metric space and $Y\subset X$ be a non-empty subset. Is the map given by$$f(x)=\inf\lbrace d(x,y)\colon y\in Y\rbrace$$ a Lipschitz map? And does the equivalence $f(x)=0\iff x\in$ closure$(Y)$ hold?

yes it is Lipschitz and yes the equivalence holds for $\Leftarrow$ use continuity and for $\Rightarrow$ use the definition of closure by sequences. – t.b. Mar 19 '12 at 21:06
Let $x_1,x_2\in X$, and $y\in Y$. We have $d(x_1,y)\leq d(x_1,x_2)+d(x_2,y)$ and taking the infimum over $y\in Y$ we get $f(x_1)\leq d(x_1,x_2)+f(x_2)$ so $f(x_1)-f(x_2)\leq d(x_1,x_2)$ and by symmetry $|f(x_1)-f(x_2)|\leq d(x_1,x_2)$ so $f$ is $1$-Lipschitz.
If $x$ is in the closure of $Y$ then $\{y,d(x,y)<n^{-1}\}$ is a neighborhood of $x$ so $\{y,d(x,y)<n^{-1}\}\cap Y\neq\emptyset$. Let $y_n\in Y$ such that $d(x,y_n)\leq n^{-1}$. We get $f(x)\leq n^{-1}$ for all $n$ hence $f(x)=0$. Conversely, if $f(x)=0$, for each $n$ we can find $y_n\in Y$ such that $d(x,y_n)\leq n^{-1}$, which shows that $\{y,d(x,y)<n^{-1}\}\cap Y\neq\emptyset$ and $x$ is the closure of $Y$.