TITLE: Distance from a point in a set to a subset of that set is Lipschitz
QUESTION [5 upvotes]: The question I'm stuck on is the following: 
Let $(X,d)$ be a metric space and let $Y$ be a subset of $X$. If $x\in X$, define the distance $d(x,Y)$ as $\inf\{(d(x,y):y\in Y\}$. Show that the mapping from $X$ to $\mathbb{R}:x\rightarrow d(x,Y)$ is Lipschitz, i.e. that there exists a constant $C>0$ such that $|d(x,Y)-d(x',Y)|\le Cd(x,x'), x,x'\in X$. 
I'm quite lost as to how to approach it because there is no upper bound for $d(x,x')$ and thus the left side can easily go off to infinity. How can I relate distance between two points and the difference in their distances to $Y$ in a way that one constant works for the entire set?

REPLY [3 votes]: We have $d(x, x')+d(x', y) \ge d(x, y)\ge d(x, Y)$ for any $y\in Y$. 
So, taking infimum for $y\in Y$, we get
$$d(x, x') +d(x', Y) \ge d(x, Y)$$
So, $d(x, Y)-d(x', Y) \le d(x, x')$. 
By symmetry, we also get $d(x',Y) - d(x,Y)\le d(x, x')$.