Distance from a point in a set to a subset of that set is Lipschitz

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?

• $C=1$ works. A picture may help. – Jochen Sep 22 at 16:34

Let $$x,y \in X$$

then $$\forall z \in Y$$ we have $$d(x,Y) \leq d(x,z) \leq d(x,y)+d(y,z)$$

Thus $$d(x,Y) \leq d(x,y)+d(y,Y) \Longrightarrow d(x,Y)-d(y,Y) \leq d(x,y)$$

Now similarly

$$\forall z \in Y$$ we have $$d(y,Y) \leq d(y,z) \leq d(x,y)+d(x,z)\Longrightarrow d(x,Y) \leq d(x,y) +d(x,Y)$$

So $$d(y,Y)-d(x,Y) \leq d(x,y)$$

Combining the above we have that $$|d(y,Y)-d(x,Y) |\leq d(x,y)$$

• Thank you so much! – cruijf Sep 22 at 16:50
• You are welcome. – Marios Gretsas Sep 22 at 16:51

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')$$.