In mathematics, a metric space is a set where a notion of distance (called a metric) between elements of the set is defined.
The metric space which most closely corresponds to our intuitive understanding of space is the 3-dimensional Euclidean space. In fact, the notion of "metric" is a generalization of the Euclidean metric arising from the four long known properties of the Euclidean distance. The Euclidean metric defines the distance between two points as the length of the straight line connecting them.
The geometric properties of the space depends on the metric chosen, and by using a different metric we can construct interesting non-Euclidean geometries such as those used in the theory of general relativity.
A metric space also induces topological properties like open and closed sets which leads to the study of even more abstract topological spaces.
Maurice Fréchet introduced metric spaces in his work Sur quelques points du calcul fonctionnel, Rendic. Circ. Mat. Palermo 22 (1906) 1–74.
A metric space is an ordered pair (M,d) where M is a set and d is a metric on M, that is, a function
such that for any x, y and z in M
The function d is also called distance function or simply distance. Often d is omitted and one just writes M for a metric space if it is clear from the context what metric is used. Relaxing the second requirement, or removing the third or fourth, leads to the concepts of a pseudometric space, a quasimetric space, or a semimetric space. If the function takes values in the extended real number line, but otherwise satisfies above conditions, then it is called an extended metric; the corresponding space is then called an -metric space.
The first of these four conditions actually follows from the other three, since:
Some authors require the set M to be non-empty.
The treatment of a metric space as a topological space is so consistent that it is almost a part of the definition.
About any point x in a metric space M we define the open ball of radius r (>0) about x as the set
These open balls generate a topology on M, making it a topological space. Explicitly, a subset of M is called open if it is a union of (finitely or infinitely many) open balls. (The null set is an open set, and may be thought of as the union of zero balls.) The complement of an open set is called closed. The metric topology on M is the coarsest topology on M relative to which the metric d is a continuous map from the product of M with itself to the non-negative real numbers. A topological space which can arise in this way from a metric space is called a metrizable space; see the article on metrization theorems for further details.
Since metric spaces are topological spaces, one has a notion of continuous function between metric spaces. This definition is equivalent to the usual epsilon-delta definition of continuity (which does not refer to the topology), and can also be directly defined using limits of sequences.
Every metric space is:
Other topological properties become equivalent in metric spaces. In particular,
Every compact metric space is second countable,[1] and is a continuous image of a Cantor set. (The latter result is due to Alexandroff and Urysohn.)
Comparing two metric spaces one can distinguish various degrees of equivalence. To preserve at least the topological structure induced by the metric, these require at least the existence of a continuous function between them (morphism preserving the topology of the metric spaces).
Given two metric spaces (M1, d1) and (M2, d2):
In case of Euclidean space with usual metric the two notions of similarity are equivalent.
A metric space M is called bounded if there exists some number r, such that d(x,y) ≤ r for all x and y in M. The smallest possible such r is called the diameter of M. The space M is called precompact or totally bounded if for every r > 0 there exist finitely many open balls of radius r whose union covers M. Since the set of the centres of these balls is finite, it has finite diameter, from which it follows (using the triangle inequality) that every totally bounded space is bounded. The converse does not hold, since any infinite set can be given the discrete metric (the first example above) under which it is bounded and yet not totally bounded. A useful characterisation of compactness for metric spaces is that a metric space is compact if and only if it is complete and totally bounded. This is known as Heine–Borel theorem. Note that compactness depends only on the topology, while boundedness depends on the metric.
Note that in the context of intervals in the space of real numbers and occasionally regions in a Euclidean space Rn a bounded set is referred to as "a finite interval" or "finite region". However boundedness should not in general be confused with "finite", which refers to the number of elements, not to how far the set extends; finiteness implies boundedness, but not conversely.
In a metric space, sequential compactness, countable compactness and compactness are all equivalent.
By restricting the metric, any subset of a metric space is a metric space itself (a subspace) with a topology restricted to that set. We call such a subset complete, bounded, totally bounded or compact if it, considered as a metric space, has the corresponding property. Every closed subspace of a complete metric space is complete, and every complete subspace of a metric space is closed. A closed subspace of a metric space, however, need not be complete.
Metric spaces are paracompact[2] Hausdorff spaces[3] and hence normal (indeed they are perfectly normal). An important consequence is that every metric space admits partitions of unity and that every continuous real-valued function defined on a closed subset of a metric space can be extended to a continuous map on the whole space (Tietze extension theorem). It is also true that every real-valued Lipschitz-continuous map defined on a subset of a metric space can be extended to a Lipschitz-continuous map on the whole space.
A simple way to construct a function separating a point from a closed set (as required for a completely regular space) is to consider the distance between the point and the set . If (M,d) is a metric space, S is a subset of M and x is a point of M, we define the distance from x to S as
Then d(x, S) = 0 if and only if x belongs to the closure of S. Furthermore, we have the following generalization of the triangle inequality:
which in particular shows that the map is continuous.
If are metric spaces, and N is the Euclidean norm on Rn, then
is a metric space, where the product metric is defined by
and the induced topology agrees with the product topology. By the equivalence of norms in finite dimensions, an equivalent metric is obtained if N is the taxicab norm, a p-norm, the max norm, or any other norm which is non-decreasing as the coordinates of a positive n-tuple increase (yielding the triangle inequality).
Similarly, a countable product of metric spaces can be obtained using the following metric
An uncountable product of metric spaces is, in general, not metrizable. For example, is not first-countable space (thus cannot be metrizable).
It is worth noting that in the case of a single space , the distance map
(from the definition) is uniformly continuous with respect to any of the above product metrics
(and in particular, continuous with respect to the product topology of
).
If M is a metric space with metric d, and ~ is an equivalence relation on M, then we can endow the quotient set M/~ with the following (pseudo)metric. Given two equivalence classes [x] and [y], we define
where the infimum is taken over all finite sequences and
with
,
,
. In general this will only define a pseudometric, i.e.
does not necessarily imply that [x]=[y]. However for nice equivalence relations (e.g., those given by gluing together polyhedra along faces), it is a metric. Moreover if M is a compact space, then the induced topology on M/~ is the quotient topology.
The quotient metric d is characterized by the following universal property. If is a metric map between metric spaces (that is,
for all x, y) satisfying f(x)=f(y) whenever
then the induced function
, given by
, is a metric map
A topological space is sequential if and only if it is a quotient of a metric space.[4]