Distance from Point to Subset is Continuous Function

Theorem
Let $M = \struct {X, d}$ be a metric space.

Let $A \subseteq X$ be a non-empty subset of $X$.

Let $f: X \to \R$ be the function defined as:
 * $\forall x \in X: \map f x = \map d {x, A}$

where $\map d {x, A}$ denotes the distance from $x$ to $A$.

Then $f$ is continuous.

Proof
$\forall x, y \in X, \forall z \in A$, by the definition of the distance from $x$ to $A$, we have:
 * $\map d {x, A} \le \map d {x, z} \le \map d {x, y} + \map d {y, z}$

Taking infimum with respect to $z \in A$ to above inequality, we get:
 * $\map d {x, A} \le \map d {x, y} + \map d {y, A}$

Similarly, we have:
 * $\map d {y, A} \le \map d {x, y} + \map d {x, A}$

Therefore:
 * $\norm {\map d {x, A} - \map d {y, A} } \le \map d {x, y}$

We can conclude that $f$ is continuous.