Metric space
In mathematics, a metric space is a set together with a metric on the set. The metric is a function that defines a concept of distance between any two members of the set, which are usually called points. The metric satisfies a few simple properties. Informally:
- the distance from a point to itself is zero,
- the distance between two distinct points is positive,
- the distance from A to B is the same as the distance from B to A, and
- the distance from A to B is less than or equal to the distance from A to B via any third point C.
The most familiar metric space is 3-dimensional Euclidean space. In fact, a "metric" is the 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 segment connecting them. Other metric spaces occur for example in elliptic geometry and hyperbolic geometry, where distance on a sphere measured by angle is a metric, and the hyperboloid model of hyperbolic geometry is used by special relativity as a metric space of velocities.
History
In 1906 Maurice Fréchet introduced metric spaces in his work Sur quelques points du calcul fonctionnel. However the name is due to Felix Hausdorff.Definition
A metric space is an ordered pair where is a set and is a metric on, i.e., a functionsuch that for any, the following holds:
Given the above three axioms, we also have that for any. This is deduced as follows:
The function is also called distance function or simply distance. Often, is omitted and one just writes for a metric space if it is clear from the context what metric is used.
Ignoring mathematical details, for any system of roads and terrains the distance between two locations can be defined as the length of the shortest route connecting those locations. To be a metric there shouldn't be any one-way roads. The triangle inequality expresses the fact that detours aren't shortcuts. If the distance between two points is zero, the two points are indistinguishable from one-another. Many of the examples below can be seen as concrete versions of this general idea.
Examples of metric spaces
- The real numbers with the distance function given by the absolute difference, and, more generally, Euclidean -space with the Euclidean distance, are complete metric spaces. The rational numbers with the same distance function also form a metric space, but not a complete one.
- The positive real numbers with distance function is a complete metric space.
- Any normed vector space is a metric space by defining, see also metrics on vector spaces. Examples:
- * The Manhattan norm gives rise to the Manhattan distance, where the distance between any two points, or vectors, is the sum of the differences between corresponding coordinates.
- * The maximum norm gives rise to the Chebyshev distance or chessboard distance, the minimal number of moves a chess king would take to travel from to.
- The British Rail metric on a normed vector space is given by for distinct points and, and. More generally can be replaced with a function taking an arbitrary set to non-negative reals and taking the value at most once: then the metric is defined on by for distinct points and, and. The name alludes to the tendency of railway journeys to proceed via London irrespective of their final destination.
- If is a metric space and is a subset of, then becomes a metric space by restricting the domain of to.
- The discrete metric, where if and otherwise, is a simple but important example, and can be applied to all sets. This, in particular, shows that for any set, there is always a metric space associated to it. Using this metric, any point is an open ball, and therefore every subset is open and the space has the discrete topology.
- A finite metric space is a metric space having a finite number of points. Not every finite metric space can be isometrically embedded in a Euclidean space.
- The hyperbolic plane is a metric space. More generally:
- * If is any connected Riemannian manifold, then we can turn into a metric space by defining the distance of two points as the infimum of the lengths of the paths connecting them.
- * If is some set and is a metric space, then, the set of all bounded functions can be turned into a metric space by defining for any two bounded functions and . This metric is called the uniform metric or supremum metric, and If is complete, then this function space is complete as well. If X is also a topological space, then the set of all bounded continuous functions from to , will also be a complete metric if M is.
- * If is an undirected connected graph, then the set of vertices of can be turned into a metric space by defining to be the length of the shortest path connecting the vertices and. In geometric group theory this is applied to the Cayley graph of a group, yielding the word metric.
- Graph edit distance is a measure of dissimilarity between two graphs, defined as the minimal number of graph edit operations required to transform one graph into another.
- The Levenshtein distance is a measure of the dissimilarity between two strings and, defined as the minimal number of character deletions, insertions, or substitutions required to transform into. This can be thought of as a special case of the shortest path metric in a graph and is one example of an edit distance.
- Given a metric space and an increasing concave function such that if and only if, then is also a metric on.
- Given an injective function from any set to a metric space, defines a metric on.
- Using T-theory, the tight span of a metric space is also a metric space. The tight span is useful in several types of analysis.
- The set of all by matrices over some field is a metric space with respect to the rank distance.
- The Helly metric is used in game theory.
Open and closed sets, topology and convergence
About any point in a metric space we define the open ball of radius about as the set
These open balls form the base for a topology on M, making it a topological space.
Explicitly, a subset of is called open if for every in there exists an such that is contained in. The complement of an open set is called closed. A neighborhood of the point is any subset of that contains an open ball about as a subset.
A topological space which can arise in this way from a metric space is called a metrizable space.
A sequence in a metric space is said to converge to the limit if and only if for every, there exists a natural number N such that for all. Equivalently, one can use the general definition of convergence available in all topological spaces.
A subset of the metric space is closed if and only if every sequence in that converges to a limit in has its limit in.
Types of metric spaces
Complete spaces
A metric space is said to be complete if every Cauchy sequence converges in. That is to say: if as both and independently go to infinity, then there is some with.Every Euclidean space is complete, as is every closed subset of a complete space. The rational numbers, using the absolute value metric, are not complete.
Every metric space has a unique completion, which is a complete space that contains the given space as a dense subset. For example, the real numbers are the completion of the rationals.
If is a complete subset of the metric space, then is closed in. Indeed, a space is complete if and only if it is closed in any containing metric space.
Every complete metric space is a Baire space.
Bounded and totally bounded spaces
A metric space M is called bounded if there exists some number r, such that 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 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 that every totally bounded space is bounded. The converse does not hold, since any infinite set can be given the discrete metric under which it is bounded and yet not totally bounded.Note that in the context of intervals in the space of real numbers and occasionally regions in a Euclidean space 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. Also note that an unbounded subset of may have a finite volume.
Compact spaces
A metric space M is compact if every sequence in M has a subsequence that converges to a point in M. This is known as sequential compactness and, in metric spaces, is equivalent to the topological notions of countable compactness and compactness defined via open covers.Examples of compact metric spaces include the closed interval with the absolute value metric, all metric spaces with finitely many points, and the Cantor set. Every closed subset of a compact space is itself compact.
A metric space is compact if and only if it is complete and totally bounded. This is known as the Heine–Borel theorem. Note that compactness depends only on the topology, while boundedness depends on the metric.
Lebesgue's number lemma states that for every open cover of a compact metric space M, there exists a "Lebesgue number" δ such that every subset of M of diameter < δ is contained in some member of the cover.
Every compact metric space is second countable, and is a continuous image of the Cantor set.
Locally compact and proper spaces
A metric space is said to be locally compact if every point has a compact neighborhood. Euclidean spaces are locally compact, but infinite-dimensional Banach spaces are not.A space is proper if every closed ball is compact. Proper spaces are locally compact, but the converse is not true in general.
Connectedness
A metric space is connected if the only subsets that are both open and closed are the empty set and itself.A metric space is path connected if for any two points there exists a continuous map with and.
Every path connected space is connected, but the converse is not true in general.
There are also local versions of these definitions: locally connected spaces and locally path connected spaces.
Simply connected spaces are those that, in a certain sense, do not have "holes".
Separable spaces
A metric space is separable space if it has a countable dense subset. Typical examples are the real numbers or any Euclidean space. For metric spaces separability is equivalent to second-countability and also to the Lindelöf property.Pointed metric spaces
If is a nonempty metric space and then is called a pointed metric space, and is called a distinguished point. Note that a pointed metric space is just a nonempty metric space with attention drawn to its distinguished point, and that any nonempty metric space can be viewed as a pointed metric space. The distinguished point is sometimes denoted due to its similar behavior to zero in certain contexts.Types of maps between metric spaces
Suppose and are two metric spaces.Continuous maps
The map f:M1→M2 is continuousif it has one of the following equivalent properties:
;General topological continuity: for every open set U in M2, the preimage f -1 is open in M1
;Sequential continuity: if is a sequence in M1 that converges to x in M1, then the sequence converges to f in M2.
;ε-δ definition: for every x in M1 and every ε>0 there exists δ>0 such that for all y in M1 we have
Moreover, f is continuous if and only if it is continuous on every compact subset of M1.
The image of every compact set under a continuous function is compact, and the image of every connected set under a continuous function is connected.
Uniformly continuous maps
The map ƒ : M1 → M2 is uniformly continuous if for every ε > 0 there exists δ > 0 such thatEvery uniformly continuous map ƒ : M1 → M2 is continuous. The converse is true if M1 is compact.
Uniformly continuous maps turn Cauchy sequences in M1 into Cauchy sequences in M2. For continuous maps this is generally wrong; for example, a continuous map
from the open interval onto the real line turns some Cauchy sequences into unbounded sequences.
Lipschitz-continuous maps and contractions
Given a real number K > 0, the map ƒ : M1 → M2 is K-Lipschitz continuous ifEvery Lipschitz-continuous map is uniformly continuous, but the converse is not true in general.
If K < 1, then ƒ is called a contraction. Suppose M2 = M1 and M1 is complete. If ƒ is a contraction, then ƒ admits a unique fixed point. If M1 is compact, the condition can be weakened a bit: ƒ admits a unique fixed point if
Isometries
The map f:M1→M2 is an isometry ifIsometries are always injective; the image of a compact or complete set under an isometry is compact or complete, respectively. However, if the isometry is not surjective, then the image of a closed set need not be closed.
Quasi-isometries
The map f : M1 → M2 is a quasi-isometry if there exist constants A ≥ 1 and B ≥ 0 such thatand a constant C ≥ 0 such that every point in M2 has a distance at most C from some point in the image f.
Note that a quasi-isometry is not required to be continuous. Quasi-isometries compare the "large-scale structure" of metric spaces; they find use in geometric group theory in relation to the word metric.
Notions of metric space equivalence
Given two metric spaces and :- They are called homeomorphic if there exists a homeomorphism between them.
- They are called uniformic if there exists a uniform isomorphism between them.
- They are called isometric if there exists a bijective isometry between them. In this case, the two metric spaces are essentially identical.
- They are called quasi-isometric if there exists a quasi-isometry between them.
Topological properties
Metric spaces are first countable since one can use balls with rational radius as a neighborhood base.
The metric topology on a metric space 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.
Distance between points and sets; Hausdorff distance and Gromov metric
A simple way to construct a function separating a point from a closed set is to consider the distance between the point and the set. If 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 asThen d = 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.
Given two subsets S and T of M, we define their Hausdorff distance to be
In general, the Hausdorff distance dH can be infinite. Two sets are close to each other in the Hausdorff distance if every element of either set is close to some element of the other set.
The Hausdorff distance dH turns the set K of all non-empty compact subsets of M into a metric space. One can show that K is complete if M is complete.
One can then define the Gromov–Hausdorff distance between any two metric spaces by considering the minimal Hausdorff distance of isometrically embedded versions of the two spaces. Using this distance, the class of all compact metric spaces becomes a metric space in its own right.
Product metric spaces
If are metric spaces, and N is the Euclidean norm on Rn, then is a metric space, where the product metric is defined byand 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 maximum norm, or any other norm which is non-decreasing as the coordinates of a positive n-tuple increase.
Similarly, a countable product of metric spaces can be obtained using the following metric
An uncountable product of metric spaces need not be metrizable. For example, is not first-countable and thus isn't metrizable.
Continuity of distance
In the case of a single space, the distance map is uniformly continuous with respect to any of the above product metrics, and in particular is continuous with respect to the product topology of.Quotient metric spaces
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 a pseudometric. Given two equivalence classes and , we definewhere 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. However, for some equivalence relations, d' is a metric.
The quotient metric d is characterized by the following universal property. If is a metric map between metric spaces satisfying f=f 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.
Generalizations of metric spaces
- Every metric space is a uniform space in a natural manner, and every uniform space is naturally a topological space. Uniform and topological spaces can therefore be regarded as generalizations of metric spaces.
- If we consider the first definition of a metric space [|given above] and relax the second requirement, we arrive at the concepts of a pseudometric space or a dislocated metric space. If we remove the third or fourth, we arrive at a quasimetric space, or a semimetric space.
- If the distance function takes values in the extended real number line R∪, but otherwise satisfies all four conditions, then it is called an extended metric and the corresponding space is called an -metric space. If the distance function takes values in some ordered set, then we arrive at the notion of generalized ultrametric.
- Approach spaces are a generalization of metric spaces, based on point-to-set distances, instead of point-to-point distances.
- A continuity space is a generalization of metric spaces and posets, that can be used to unify the notions of metric spaces and domains.
- A partial metric space is intended to be the least generalisation of the notion of a metric space, such that the distance of each point from itself is no longer necessarily zero.
Metric spaces as enriched categories
Every metric space can now be viewed as a category enriched over :
- Set
- For each set
- The composition morphism will be the unique morphism in given from the triangle inequality
- The identity morphism will be the unique morphism given from the fact that.
- Since is a poset, all diagrams that are required for an enriched category commute automatically.