# Metric (mathematics)

(Redirected from Distance function) An illustration comparing the taxicab metric to the Euclidean metric on the plane: According to the taxicab metric the red, yellow, and blue paths have the same length (12). According to the Euclidean metric, the green path has length $6{\sqrt {2}}\approx 8.49$ , and is the unique shortest path.

In mathematics, a metric or distance function is a function that gives a distance between each pair of point elements of a set. A set with a metric is a metric space. A metric induces a topology on a set, but not all topologies can be generated by a metric. A topological space whose topology can be described by a metric is a metrizable space.

One important source of metrics in differential geometry are metric tensors, bilinear forms that may be defined from the tangent vectors of a differentiable manifold onto a scalar. A metric tensor allows distances along curves to be determined through integration, and thus determines a metric.

## Definition

A metric on a set X is a function (called distance function or simply distance)

$d:X\times X\to \mathbb {R} ,$ such that for all $x,y,z\in X$ , the following three axioms hold:

 1 $d(x,y)=0\iff x=y$ identity of indiscernibles 2 $d(x,y)=d(y,x)$ symmetry 3 $d(x,z)\leq d(x,y)+d(y,z)$ triangle inequality

From these axioms the non-negativity of metrics can be derived like so:

 $d(x,y)+d(y,x)\geq d(x,x)$ by triangle inequality $d(x,y)+d(x,y)\geq d(x,x)$ by symmetry $2d(x,y)\geq 0$ by identity of indiscernibles 4. $d(x,y)\geq 0$ we have non-negativity

A metric (as defined) is a non-negative real-valued function. This, together with axiom 1, provides a separation condition, where distinct or separate points are precisely those that have a positive distance between them.

A metric is called an ultrametric if it satisfies the following stronger version of the triangle inequality for all $x,y,z\in X$ :

$d(x,y)\leq \max\{d(x,z),d(y,z)\}.$ A metric $d$ on $X$ is called intrinsic if for all $x,y\in X$ and any length $L>d(x,y)$ , there exists a curve of length less than $L$ that joins $x$ and $y$ .

A metric $d$ on a group $G$ (written multiplicatively) is said to be left-invariant (resp. right-invariant) if for all $x,y,z\in G$ $d(zx,zy)=d(x,y)$ [resp. $d(xz,yz)=d(x,y)$ ].

A metric $d$ on a commutative additive group $X$ is said to be translation invariant if for all $x,y,z\in X$ $d(x,y)=d(x+z,y+z),$ or equivalently $d(x,y)=d(x-y,0).$ Every vector space is also a commutative additive group and a metric on a real or complex vector space that is induced by a norm is always translation invariant. A metric $d$ on a real or complex vector space $V$ is induced by a norm if and only if it is translation invariant and absolutely homogeneous, where the latter means that for all scalars $s$ and all $x,y\in V$ : $d(sx,sy)=|s|d(x,y)$ holds, in which case the function ${\|x\|}:=d(x,0)$ defines a norm on $V$ and the canonical metric induced by $\|\cdot \|$ is equal to $d.$ 