Definition:Metric Space

Distance Function
A metric on a set $$X$$ is a real-valued function (called the distance function or simply distance) $$d: X \times X \to \R$$ which satisfies:


 * M0: $$\forall x, y \in X: d \left({x, y}\right) \ge 0$$
 * M1: $$\forall x, y \in X: d \left({x, y}\right) = 0 \iff x = y$$
 * M2: $$\forall x, y \in X: d \left({x, y}\right) = d \left({y, x}\right)$$
 * M3: $$\forall x, y, z \in X: d \left({x, y}\right) + d \left({y, z}\right) \ge d \left({x, z}\right)$$

These are sometimes referred to as the metric space axioms.

Triangle Inequality
Axiom M3 is often referred to as the triangle inequality, as it is a generalization of the Triangle Inequality which holds on the real number line and complex plane.

Also see Reverse Triangle Inequality: $$\forall x, y, z \in X: \left|{d \left({x, z}\right) - d \left({y, z}\right)}\right| \le d \left({x, y}\right)$$.

Metric Space
A metric space $$M = \left({A, d}\right)$$ is an ordered pair consisting of a set $$A \ne \varnothing$$ followed by a metric $$d: A \times A \to \R$$ which acts on that set.

The elements of $$A$$ are called the points of the space.

Also see
Compare pseudo-metric, which is the same as a metric but does not include the condition M1, that is, distinct points may have a zero distance between them.

Notation
Some authors use a variant of $$d$$ for a metric, for example $$\eth$$. Others use, for example, $$\rho$$.

Some authors use the suboptimal $$M = \left\{{A, d}\right\}$$, which leaves it conceptually unclear as to which is the set and which the metric. This adds unnecessary complexity to the underlying axiomatic justification for the existence of the very object that is being defined.

The notation $$M = \left[\!\left[{A, \rho}\right]\!\right]$$ can also be found.