Definition:Distance

Real Numbers
Let $$x, y \in \mathbb{R}$$ be real numbers.

Let $$\left|{x - y}\right|$$ be the absolute value of $$x - y$$.

Then the function $$d \left({x, y}\right) = \left|{x - y}\right|$$ is called the distance between $$x$$ and $$y$$.

It is easy to show that distance as defined here is a metric.

Subset of Real Numbers
Let $$S$$ be a subset of the set of real numbers $$\mathbb{R}$$.

Let $$x \in \mathbb{R}$$ be a real number.

The distance between $$x$$ and $$S$$ is defined and annotated $$d \left({x, S}\right) = \inf_{y \in S} \left({d \left({x, y}\right)}\right)$$, where $$d \left({x, y}\right)$$ is the distance between $x$ and $y$.