In
mathematics, a 'metric' or 'distance function' is a
function which defines a
distance between elements of a
set. A set with a metric is called a
metric space. A metric induces a
topology on a set but not all topologies can be generated by a metric. When a
topological space has a topology that can be described by a metric, we say that topological space is
metrisable.
In
differential geometry, the word "metric" is also used to refer to a structure defined only on a
vector space which is more properly termed a
metric tensor (or 'Riemannian' or '''pseudo''-Riemannian' metric).
Definition
A 'metric' on a set ''X'' is a
function (called the ''distance function'' or simply 'distance')
''d'' : ''X'' × ''X'' →
R
(where
R is the set of
real numbers). For all ''x'', ''y'', ''z'' in ''X'', this function is required to satisfy the following conditions:
# ''d''(''x'', ''y'') ≥ 0 (''
non-negativity'')
# ''d''(''x'', ''y'') = 0 if and only if ''x'' = ''y'' (''
identity of indiscernibles''. Note that condition 1 and 2 together produce ''
positive definiteness'')
# ''d''(''x'', ''y'') = ''d''(''y'', ''x'') (''
symmetry'')
# ''d''(''x'', ''z'') ≤ ''d''(''x'', ''y'') + ''d''(''y'', ''z'') (''
subadditivity'' / ''
triangle inequality'').
A metric ''d'' on ''X'' is called
intrinsic if any two points ''x'' and ''y'' in ''X'' can be joined by a
curve with
length arbitrarily close to ''d''(''x'', ''y'').
For sets on which an addition + : ''X'' × ''X'' → ''X'' is defined,
we call ''d'' a '
translation invariant metric' if
:''d''(''x'', ''y'') = ''d''(''x'' + ''a'', ''y'' + ''a'')
for all ''x'', ''y'' and ''a'' in ''X''.
If the second requirement (indiscernibility) is dropped, the function is called a
pseudometric. Dropping the second and third (symmetry) requirements results in the
hemimetric.
If the third requirement (symmetry) is dropped (keeping 1,2 and 4), then the function is called a
quasimetric.
If all but the first requirement are dropped (keeping only positivity and a zero self-distance ''d''(''x'',''x'')=0), then the function is called a
prametric.
If only the fourth requirement (triangle inequality) is dropped, then the function is called a
semimetric. A semimetric is a special case of prametric, a prametric that is symmetric and discerning.
If the triangular inequality is strengthened to
:''d''(''x'', ''z'') ≤ max( ''d''(''x'', ''y''), ''d''(''y'', ''z'') )
the metric is called
ultrametric, see below.
Notes
These conditions express intuitive notions about the concept of
distance. For example, that the distance between distinct points is positive and the distance from ''x'' to ''y'' is the same as the distance from ''y'' to ''x''. The triangle inequality means that the distance traversed directly between ''x'' and ''z'', is not larger than the distance to traverse in going first from ''x'' to ''y'', and then from ''y'' to ''z''.
Euclid in his
work stated that the shortest distance between two points is a line; that was the triangle inequality for his geometry.
Property 1 (''d''(''x'', ''y'') ≥ 0) follows from properties 2 and 4 and does not have to be required separately.
Examples
★ The
discrete metric: if ''x'' = ''y'' then ''d''(''x'',''y'') = 0. Otherwise, ''d''(''x'',''y'') = 1.
★ The
Euclidean metric is translation and rotation invariant.
★ The
Manhattan metric is translation invariant.
★ More generally, any metric induced by a
norm (see below) is translation invariant.
★ If ''(p
n)
n∈'N''' is a
sequence of
seminorms defining a (
locally convex)
topological vector space ''E'', then
:
:is a
metric defining the same
topology. (One can replace
by any
summable sequence of strictly
positive numbers.)
Equivalence of metrics
For a given set ''X'', two metrics ''d''
1 and ''d''
2 are called 'topological equivalent' ('uniformly equivalent') if the identity mapping
:id: (''X'',''d''
1) → (''X'',''d''
2)
is a
homeomorphism (
uniform isomorphism).
For example, if
is metric, then
and
are metrics equivalent to
See also .
Relation of norms and metrics
Given a
normed vector space (''X'',||.||) we can define a metric on ''X'' by
:''d''(''x'',''y''):=||''x''-''y''||.
The metric ''d'' is said to be 'induced by' the norm ||.||.
Conversely if a metric ''d'' on a
vector space ''X'' satisfies the properties
★ ''d''(''x'',''y'') = ''d''(''x''+''a'',''y''+''a'') (''translation invariance'')
★ ''d''(α''x'',α''y'') = |α|''d''(''x'',''y'') (''homogeneity'')
then we can define a
norm on ''X'' by
:||x||:=''d''(''x'',0)
Similarly, a
seminorm induces a pseudometric and a homogeneous, translation invariant pseudometric induces a seminorm.
Related concepts and alternative axiom systems
Some authors allow the distance function ''d'' to attain the value ∞, i.e. distances are non-negative numbers on the
extended real number line. Such a metric is called an ''extended metric''. Every extended metric can be transformed to a finite metric such that the metric spaces are equivalent as far as notions of
topology (such as
continuity or
convergence) are concerned. This can be done using a
subadditive monotically increasing bounded function which is zero at zero, e.g.
d'(''x'', ''y'') = ''d''(''x'', ''y'') / (1 + ''d''(''x'', ''y'')) or ''d''
''(''x'', ''y'') = min(1, ''d''(''x'', ''y''))).
A metric is called an
ultrametric if it satisfies the following stronger version of the ''triangle inequality'':
★ For all ''x'', ''y'', ''z'' in ''M'', ''d''(''x'', ''z'') ≤ max(''d''(''x'', ''y''), ''d''(''y'', ''z''))
If one drops property 2, one obtains
pseudometric spaces. Dropping property 3 instead, one obtains
quasimetric spaces. However, losing symmetry in this case, one usually changes property 2 such that both ''d''(''x'',''y'')=0 and ''d''(''y'',''x'')=0 are needed for ''x'' and ''y'' to be identified. Dropping property 4 one obtains
semimetric spaces. All combinations of the above are possible and are referred to by their according names (such as ''quasi-pseudo-ultrametric'').
From the
categorical point of view, the extended pseudometric and the extended pseudoquasimetric spaces, along with their corresponding nonexpansive maps, are the best behaved of the metric space categories. One can take arbitrary products and coproducts and form quotient objects within the given category. If one drops "extended", one can only take finite products and coproducts. If one drops "pseudo", one cannot take quotients.
Approach spaces are a generalization of metric spaces that maintain these good categorical properties.
The requirement that the metric takes values in
[0,∞) can also be relaxed to consider metrics with values in other
directed sets. The reformulation of the axioms in this case leads to the construction of
uniform spaces: topological spaces with an abstract structure enabling one to compare the local topologies of different points.
An example of a distance function that does not satisfy the
identity of indiscernibles condition 2. is the
probability metric.
In
differential geometry, one considers
metric tensors, which can be thought of as "infinitesimal" metric functions, and are defined as
inner products on the
tangent space with an appropriate
differentiability requirement. While these are not metric functions as defined in this article, they induce metric functions by
integration. A
manifold with a metric tensor is called a
Riemannian manifold. If one drops the positive definiteness requirement of inner product spaces, then one obtains a
pseudo-Riemannian metric tensor, which integrates to a pseudo-semimetric. These are used in the geometric study of the
theory of relativity, where the tensor is also called the "invariant distance".
See also
★
Distance
★
Metric space
★
Metric tensor
★
Acoustic metric
★
Complete metric