6

Let $S\subset\Bbb R$ not empty, define $f:\Bbb R\rightarrow\Bbb R$ such that $f(x)= \inf\{|x-s| ;s\in S\}$

then, prove that $|f(x)-f(y)|\le|x-y| $ for any $x,y \in \Bbb R$

Pedro
  • 122,002

1 Answers1

7

$|x - s| \le |x - y| + |y - s|$ for every $s \in S$. Hence $f(x) \le |x - y| + f(y)$.

Similarly $f(y) \le |x - y| + f(x)$.

Hence $|f(x) - f(y)| \le |x - y|$.

Makoto Kato
  • 42,602
  • 1
    Indeed, the distance function on any metric space is continuous, by the same proof that you have given. – Lubin Sep 08 '12 at 03:22
  • 1
    How do you know that the s will be the same s for both x and y? Isnt it possible the infcould involve different s for x and y? – Richard K Yu Jul 28 '20 at 02:54
  • @RichardKYu: They are not necessarily the same. However, for any $s\in S$,$$\begin{align}f(x)&\le|x-s|\tag{1a}\&\le|x-y|+|y-s|\tag{1b}\&=|x-y|+f(y)+(|y-s|-f(y))\tag{1c}\end{align}$$ For all $s\in S$, $|y-s|-f(y)\ge0$; however, we can choose an $s\in S$ so that $|y-s|-f(y)$ is as small as we wish. Thus, $$f(x)\le|x-y|+f(y)\tag2 $$ – robjohn Oct 16 '23 at 03:30