4

Let $d$ be a metric on $X$ and let $A$ be any arbitrary subset of $X$. Show that the function $f:X\to \mathbb R$ defined by $f(x)=d(x,A)$ is continuous.

Let $p\in X$. We want to show that for any open set $S$ containing $f(p)$, there exists an open neighbourhood of $p$, denoted by $O$, such that $f[O]\subset S$. If $p\in$ int $A$, then there exists an open set $O \subset A$ containing $p$. Clearly $f[O] \subset S$ since $O$ is a subset of $A$ and $f[O]= \{ 0 \}= \{f(p) \} \subset S$. If $p\in \partial A$ (boundary of A) or $p\in$ ext $A$, the situation is much harder. The reason for this being hard is that the function $d$ is not specific and is defined in terms of infimum.

layman
  • 20,191
pxc3110
  • 1,410
  • Tried using sequences? – zibadawa timmy Jul 17 '14 at 03:08
  • @zibadawatimmy What for? – Did Jul 19 '14 at 06:45
  • @Did For solving the problem, of course. If you didn't see it immediately, I think playing with sequences--and so individual points--would have illuminated the basic idea of the accepted answer's argument. Loosely: If $x'$ is close to $x$, $a$ is close to minimum distance from $x$, and $a'$ is close to minimum distance from $x'$, then $a'$ is close to $a$. – zibadawa timmy Jul 19 '14 at 07:02
  • @zibadawatimmy Unfortunately this is wrong, $a'$ can be very far from $a$. – Did Jul 19 '14 at 07:07
  • @Did Yes, I suppose I can construct an example using point masses in A. I think the moral of my story is salvageable, I just messed up the telling. – zibadawa timmy Jul 19 '14 at 07:13
  • @zibadawatimmy Sorry to insist but I think "your story" is deeply ("morally", if you want) flawed (and that the same misconception might be at work in the accepted answer). – Did Jul 19 '14 at 07:15
  • @Did I think I see what your hang-up is. I will think about that. – zibadawa timmy Jul 19 '14 at 07:26
  • @zibadawatimmy I see you did think about the problem... Good job. – Did Jul 19 '14 at 08:35

3 Answers3

9

For all $a\in A, x,y\in X$ $$d(x,A) \leq d(x,a) \leq d(x,y)+d(y,a).$$ Equivalently, $$d(y,a)\geq d(x,A) - d(x,y).$$

Thus $$ d(y,A)=\inf_{a\in A} d(y,a) \geq \inf_{a\in A}\left( d(x,A)-d(x,y) \right) = d(x,A)-d(x,y).$$

Therefore $d(x,A)-d(y,A)\leq d(x,y),$ and interchanging $x,y$ gives the desired result.

Did
  • 279,727
3

Don't try so hard. We have, for any $a,\in A$ and $x,x'\in X$ that $$d(x,a)-d(x',a)\leqslant d(x,x')$$ $$d(x',a)-d(x,a)\leqslant d(x',x)$$

Using the definition of $\inf$, you should get $d(x,A)-d(x',A)\leqslant d(x,x')$ and $d(x',A)-d(x,A)\leqslant d(x',x)$. In particular your function is Lipschitz, so uniformly continuous.

ADD A not so well known inequality is the quadrilateral inequality

$$|d(x,x')-d(z,z')|\leqslant d(x,z)+d(x',z')$$

Pedro
  • 122,002
  • I don't think this is right, or at least, it isn't complete. $d(x,A)$ and $d(y,A)$ needn't be $d(x,a)$ and $d(y,a')$ for any $a,a' \in A$; the infimum need not be attained if $A$ is arbitrary. More importantly, even if the infimum is attained, the resulting $a$ and $a'$ needn't be the same point. – Ian Jul 17 '14 at 03:17
  • You've cleaned up my concern now. My concern was that you need to take infima of both inequalities before you subtract. This was not clear (at least not to me) from what you wrote before. – Ian Jul 17 '14 at 03:24
  • I am not sure there is a proof here, basically because of the second concern explained by @Ian (the first concern should also be taken care of but this is routine, while for the second concern...). Maybe the poster or the upvoters or the "accepter" can explain. (Nice song.) – Did Jul 19 '14 at 07:10
  • @Did Pedro did a good job, $\forall a$,|d(x,a)-d(x'a)|$\leq$d(x,x'), so the right hand side is an upper bound, therefore from definition of the supremum, |d(x,A)-d(x',A)|$\leq$d(x,x'), where |d(x,A)-d(x',A)| is the supremum. – pxc3110 Jul 19 '14 at 08:24
  • @pxc3110 Why is |d(x,A)-d(x',A)| the supremum of |d(x,a)-d(x',a)| on a in A? – Did Jul 19 '14 at 08:26
  • @Did It follows from algebra for supremum and infimums:https://www.math.ucdavis.edu/~hunter/m125b/ch2.pdf – pxc3110 Jul 19 '14 at 08:27
  • @pxc3110 Maybe it does but this is not straightforward. In other words, the statement your comment uses may be true but it needs a proof (and to refer to the linked file in your last comment is a joke). – Did Jul 19 '14 at 08:31
  • @pxc3110 Note that the accepted answer seems to state without justification that |d(x,A)-d(x',A)| is the infimum of |d(x,a)-d(x',a)| on a in A and that you state without justification that |d(x,A)-d(x',A)| is the supremum of |d(x,a)-d(x',a)| on a in A. Gee, I am lost... :-) – Did Jul 19 '14 at 08:33
  • @Did Sure, my explanation is not straightforward as it needs some effort to explain why |d(x,A)-d(x',A)| is the supremum, the proof provided by zibadawa is easier to understand. – pxc3110 Jul 19 '14 at 08:36
  • @Did I'm sorry if I was too cryptic. Ian actually asked about it, and I answered in the comments what the other question wrote. Regards, – Pedro Jul 19 '14 at 16:04
1

Lemma: $\forall x,y \in X: f(x) - f(y) \le d(x,y)$

(Intuition: this is the triangle inequality, but with the whole of the set $A$ in place of one of the points: $d(x, A) \le d(x,y) + d(y,A)$)

Proof:

$f(x) - f(y) = d(x, A) - d(y, A) = d(x, A) - \inf_{a \in A} d(y, a) = \inf_{a \in A}(d(x, A) - d(y, a))$

$ \le \inf_{a \in A}(d(x, a) - d(y, a))$ since $d(x,A) \le d(x,a)$

$ \le \inf_{a \in A}d(x, y)$ (triangle inequality, $d(x,a) \le d(x,y) + d(y,a)$)

$ = d(x,y)$

Proving the lemma.

Then $f(y) - f(x) \le d(y, x) = d(x, y)$ since $d$ is symmetric, so:

$|f(x) - f(y)| \le d(x,y)$


Now we will show that the inverse image under $f$ of an open set is open, that is to say $f$ is continuous.

Let $U \subseteq \mathbb{R}$ be an open set.

Let $x \in f^{-1}(U)$, that is $f(x) \in U$, so there exists an open ball $B$ (of radius $r$, say), around $f(x)$ that is a subset of $U$.

Let $B'$ be the open ball around $x$ with radius $r$. Then for $y \in B'$ we have $d(x, y) < r$, so $|f(x) - f(y)| \le d(x, y) < r$, hence $f(y) \in B$. So $B' \subseteq f^{-1}(B) \subseteq f^{-1}(U)$

So every element of $f^{-1}(U)$ has an open ball around it in $f^{-1}(U)$, hence $f^{-1}(U)$ is open.

Steve Jessop
  • 4,106