Definition:Metric Space

Definition
A metric on a set $X$ is a real-valued function $d: X \times X \to \R$ which satisfies the following conditions for all $x, y, z \in X$:


 * M1: $d \left({x, x}\right) = 0$
 * M2: $d \left({x, y}\right) + d \left({y, z}\right) \ge d \left({x, z}\right)$
 * M3: $d \left({x, y}\right) = d \left({y, x}\right)$
 * M4: $x \ne y \implies d \left({x, y}\right) > 0$

These are sometimes referred to as the metric space axioms.

Distance Function
The function $d: X \times X \to \R$ is also frequently called the distance function or simply distance.

Triangle Inequality
Axiom M2 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

 * Pseudometric, which is the same as a metric but does not include the condition M4.


 * Quasimetric, which is the same as a metric but does not include the condition M3.

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.

The numbering of the axioms also varies between authors. Some merge M1 and M4. Some keep the same axioms but number them differently.

Some replace M1 and M4 with:

which can be seen trivially to be equivalent to M1 and M4.
 * M1': $\forall x, y \in X: d \left({x, y}\right) = 0 \iff x = y$
 * M4': $\forall x, y \in X: d \left({x, y}\right) \ge 0$

Relation to Norms
Let $d$ be a metric on a vector space $V$ that is homogeneous and translation invariant.

Then by Metric Defines Norm iff it Preserves Linear Structure $d$ can be used to define a norm by setting $\left\| {V} \right\| = d \left({x, 0}\right)$.

Any norm can be used to define a metric $d \left({x, y}\right) = \left\| {x - y} \right\|$.