Metric (mathematics)
In mathematics, a metric or distance function is a function that defines a distance between each pair of point 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. A topological space whose topology can be described by a metric is called metrizable.
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 is a functionwhere is the set of non-negative real numbers and for all, the following three axioms are satisfied:
These axioms also imply the non-negativity or separation condition:
Namely, applying axioms 1, 3, and 2 in that order yields which implies.
Non-negativity and axiom 2 together define what is called a positive-definite function.
A metric is called an ultrametric if it satisfies the following stronger version of the triangle inequality where points can never fall 'between' other points:
for all
A metric on is called intrinsic if any two points and in can be joined by a curve with length arbitrarily close to.
A metric d on a group G is said to be left-invariant if we have
for all x, y, and z in G.
Examples
- The discrete metric: if x = y then d = 0. Otherwise, d = 1.
- The Euclidean metric is translation and rotation invariant.
- The taxicab metric is translation invariant.
- More generally, any metric induced by a norm is translation invariant.
- If is a sequence of seminorms defining a topological vector space E, then
- Graph metric, a metric defined in terms of distances in a certain graph.
- The Hamming distance in coding theory.
- Riemannian metric, a type of metric function that is appropriate to impose on any differentiable manifold. For any such manifold, one chooses at each point p a symmetric, positive definite, bilinear form L: Tp × Tp → ℝ on the tangent space Tp at p, doing so in a smooth manner. This form determines the length of any tangent vector v on the manifold, via the definition ||v|| = . Then for any differentiable path on the manifold, its length is defined as the integral of the length of the tangent vector to the path at any point, where the integration is done with respect to the path parameter. Finally, to get a metric defined on any pair of points of the manifold, one takes the infimum, over all paths from x to y, of the set of path lengths. A smooth manifold equipped with a Riemannian metric is called a Riemannian manifold.
- The Fubini–Study metric on complex projective space. This is an example of a Riemannian metric.
- String metrics, such as Levenshtein distance and other string edit distances, define a metric over strings.
- Graph edit distance defines a distance function between graphs.
- The Wasserstein metric is a distance function defined between two probability distributions.
- The Finsler metric is a continuous nonnegative function F:TM→0,+∞) defined on the [tangent bundle.
Equivalence of metrics
is a homeomorphism.
For example, if is a metric, then and are metrics equivalent to
See also notions of metric space equivalence.
Metrics on vector spaces
Norms on vector spaces are equivalent to certain metrics, namely homogeneous, translation-invariant ones. In other words, every norm determines a metric, and some metrics determine a norm.Given a normed vector space we can define a metric on X by
The metric d is said to be induced by the norm.
Conversely if a metric d on a vector space X satisfies the properties
Similarly, a seminorm induces a pseudometric, and a homogeneous, translation invariant pseudometric induces a seminorm.
Metrics on multisets
We can generalize the notion of a metric from a distance between two elements to a distance between two nonempty finite multisets of elements. A multiset is a generalization of the notion of a set such that an element can occur more than once. Define ifis the multiset consisting of the elements of the multisets and, that is, if occurs once in and once in then it occurs twice in.
A distance function
on the set of nonempty finite multisets is a metric if
- if all elements of are equal and otherwise, that is,
- is invariant under all permutations of
A simple example is the set of all nonempty finite multisets of integers with. More complex examples are information distance in multisets; and normalized compression distance in multisets.
Generalized metrics
There are numerous ways of relaxing the axioms of metrics, giving rise to various notions of generalized metric spaces. These generalizations can also be combined. The terminology used to describe them is not completely standardized. Most notably, in functional analysis pseudometrics often come from seminorms on vector spaces, and so it is natural to call them "semimetrics". This conflicts with the use of the term in topology.Extended metrics
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 function is called an extended metric or "∞-metric".
Every extended metric can be transformed to a finite metric such that the metric spaces are equivalent as far as notions of topology are concerned. This can be done using a subadditive monotonically increasing bounded function which is zero at zero, e.g. d′ = d / or d′′ = min.
The requirement that the metric take values in
Pseudometrics
A pseudometric on X is a function d : X × X → R which satisfies the axioms for a metric, except that instead of the second only d=0 for all x is required. In other words, the axioms for a pseudometric are:- d ≥ 0
- d = 0
- d = d
- d ≤ d + d.
Quasimetrics
Occasionally, a quasimetric is defined as a function that satisfies all axioms for a metric with the possible exception of symmetry:. The name of this generalisation is not entirely standardized.- d ≥ 0
- d = 0 if and only if x = y
-
d = d - d ≤ d + d
A quasimetric on the reals can be defined by setting
The topological space underlying this quasimetric space is the Sorgenfrey line. This space describes the process of filing down a metal stick: it is easy to reduce its size, but it is difficult or impossible to grow it.
If d is a quasimetric on X, a metric d
Metametrics
In a metametric, all the axioms of a metric are satisfied except that the distance between identical points is not necessarily zero. In other words, the axioms for a metametric are:- d ≥ 0
- d = 0 implies x = y
- d = d
- d ≤ d + d.
Semimetrics
A semimetric on X is a function d : X × X → R that satisfies the first three axioms, but not necessarily the triangle inequality:- d ≥ 0
- d = 0 if and only if x = y
- d = d
The ρ-inframetric inequality implies the ρ-relaxed triangle inequality, and the ρ-relaxed triangle inequality implies the 2ρ-inframetric inequality. Semimetrics satisfying these equivalent conditions have sometimes been referred to as "quasimetrics", "nearmetrics" or inframetrics.
The ρ-inframetric inequalities were introduced to model round-trip delay times in the internet. The triangle inequality implies the 2-inframetric inequality, and the ultrametric inequality is exactly the 1-inframetric inequality.
Premetrics
Relaxing the last three axioms leads to the notion of a premetric, i.e. a function satisfying the following conditions:- d ≥ 0
- d = 0
- d = d
Any premetric gives rise to a topology as follows. For a positive real r, the r-ball centered at a point p is defined as
A set is called open if for any point p in the set there is an r-ball centered at p which is contained in the set. Every premetric space is a topological space, and in fact a sequential space.
In general, the r-balls themselves need not be open sets with respect to this topology.
As for metrics, the distance between two sets A and B, is defined as
This defines a premetric on the power set of a premetric space. If we start with a metric space, we get a pseudosemimetric, i.e. a symmetric premetric.
Any premetric gives rise to a preclosure operator cl as follows:
Pseudoquasimetrics
The prefixes pseudo-, quasi- and semi- can also be combined, e.g., a pseudoquasimetric relaxes both the indiscernibility axiom and the symmetry axiom and is simply a premetric satisfying the triangle inequality. For pseudoquasimetric spaces the open r-balls form a basis of open sets. A very basic example of a pseudoquasimetric space is the set with the premetric given by d = 1 and d = 0. The associated topological space is the Sierpiński space.Sets equipped with an extended pseudoquasimetric were studied by William Lawvere as "generalized metric spaces". From a categorical point of view, the extended pseudometric spaces 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 maintains these good categorical properties.
Important cases of generalized metrics
In differential geometry, one considers a metric tensor, which can be thought of as an "infinitesimal" quadratic metric function. This is defined as a nondegenerate symmetric bilinear form on the tangent space of a manifold with an appropriate differentiability requirement. While these are not metric functions as defined in this article, they induce what is called a pseudo-semimetric function by integration of its square root along a path through the manifold. If one imposes the positive-definiteness requirement of an inner product on the metric tensor, this restricts to the case of a Riemannian manifold, and the path integration yields a metric.In general relativity the related concept is a metric tensor which expresses the structure of a pseudo-Riemannian manifold. Though the term "metric" is used, the fundamental idea is different because there are non-zero null vectors in the tangent space of these manifolds, and vectors can have negative squared norms. This generalized view of "metrics", in which zero distance does not imply identity, has crept into some mathematical writing too: