TITLE: Distance is (uniformly) continuous
QUESTION [8 upvotes]: I've been told that $$d(x,A) = \inf_{y \in A} |x-y|$$ is uniformly continuous, but I don't understand why? Is there a short proof of this statement or is this a slightly deeper result? This was a result discussed in my analysis lecture.

REPLY [7 votes]: The reason $d(x,A)$ is a uniformly continuous function is that $|d(x,A) - d(y,A)| \le |x -y|$ for all $x$ and $y$. Let $x$ and $y$ be given. For every $z\in A$, $$d(x,A) \le |x-z| \le |x-y| + |y-z|.$$ Thus $d(x,A) - |x-y|$ is a lower bound for the set $\{|y-z|:z\in A\}$. Hence $d(x,A) - |x - y| \le d(y,A)$, i.e., $d(x,A) - d(y,A) \le |x - y|$. A similar argument shows that $d(y,A) - d(x,A) \le |x - y|$. Hence $|d(x,A) - d(y,A)| \le |x - y|$.