# Is the distance function in a metric space (uniformly) continuous?

Let $(X, d)$ be a metric space. Is the function $x\mapsto d(x, z)$ continuous? Is it uniformly continuous?

• If you are asking whether the distance function $d:X\times X\to\mathbb R$ is continuous when $(X,d)$ is a metric space, then aswer is yes. You should try to prove it yourself; first do it for $\mathbb R$ with its usual metric, and then generalize. – Mariano Suárez-Álvarez Oct 27 '10 at 16:32
• @MarianoSuárez-Alvarez I was also trying the same question. But how to prove it using $\epsilon - \delta$ notation.Let $(x,y) \in X$ and $(x',y') \in X$ then whenever $||(x,y)-(x',y')|| \lt \delta$ then we have $|d(x,y)-d(x',y')| \lt \epsilon$.. right?? How to go ahead with this proof – Mathy Jun 25 '13 at 11:33

As Qiaochu points out $d(x,y)$ is continuous for fixed $x$. You may like to see this as well, as this is a familiar result in Topology:

If $A$ is a non empty subset of a metric space $(X,d)$ then the function $f$ on $X$ given by $$f(x)=d(x,A):= \inf_{y\in A} d(x, y)$$ is continuous. Indeed, $$| f(x) - f(y) | = | d(x,A) - d(y,A) | \leq d(x,y),$$ and thus $f$ is uniformly continuous (use $\delta = \epsilon$ in any point).

To show this, let $x$ and $y$ be points in $X$, and $p$ any point in $A$.

Then $$d(x,p) \leq d(x,y) + d(y,p)\ \ \ \ \text{ (triangle inequality)}$$ and so $$d(x,A) \leq d(x,y) + d(y,p)$$ as $d(x,A)$ is the infimum. But then $d(y,p) \geq d(x,A) - d(x,y)$ (for all $p$, obtained by subtracting from the previous inequality), so that $d(y,A) \geq d(x,A) - d(x,y)$ (as $d(y,A)$ is the infimum). So : $d(x,A) - d(y,A) \leq d(x,y)$.

Now reverse the roles of $x$ and $y$ to get $d(y,A) - d(x,A) \leq d(x,y)$.

• where did you use the fact that A is closed? – GAJO Jan 28 '14 at 19:11
• Why are we assuming that the metric on $\mathbb{R}$ is the standard one? – The Substitute Aug 31 '14 at 0:19
• @GAJO I think $d(x,E)$ is continuous in $x$ for any nonempty subset $E$. – Fang Jing Oct 14 '14 at 20:29

Yes. The standard definition of the topology induced by a metric ensures this; in fact it's not hard to see that it's the coarsest topology such that $d(x, y)$ is continuous for fixed $x$.

• Isn't it also the coarsest one for which $d$ itself is continuous? – Mariano Suárez-Álvarez Oct 27 '10 at 16:36