In mathematics, a metric space is a set together with a notion of distance between its points. The distance is measured by a function called a metric or distance function. Metric spaces are a general setting for studying many of the concepts of mathematical analysis and geometry.
The most familiar example of a metric space is 3-dimensional Euclidean space with its usual notion of distance. Other well-known examples are a sphere equipped with the angular distance and the hyperbolic plane. A metric may correspond to a metaphorical, rather than physical, notion of distance. For example, the set of 100-character Unicode strings can be equipped with the Hamming distance, which measures the number of characters that need to be changed to get from one string to another.
Metric spaces appear in many different branches of mathematics. For example, Riemannian manifolds, normed vector spaces, and graphs may be viewed as metric spaces. In abstract algebra, the field of p-adic numbers is the completion of the field of rational numbers with respect to a certain metric. Metric spaces are also studied in their own right in metric geometry and analysis on metric spaces.
Many notions of analysis, including balls, completeness, as well as uniform, Lipschitz, and Hölder continuity can be defined for metric spaces. Other notions, such as continuity, compactness, and open and closed sets can be defined for metric spaces, but also in the even more general setting of topological spaces.
Definition and illustration Motivation
To see the utility of different notions of distance, consider the surface of the Earth as a set of points. We can measure the distance between two such points by the length of the shortest path along the surface, "as the crow flies"; this is particularly useful for shipping and aviation. We can also measure the straight-line distance between two points through the Earth's interior; this notion is, for example, natural in seismology, since it roughly corresponds to the length of time it takes for seismic waves to travel between those two points.
The notion of distance encoded by the metric space axioms has relatively few requirements. This generality gives metric spaces a lot of flexibility. At the same time, the notion is strong enough to encode many intuitive facts about what distance means. This means that general results about metric spaces can be applied in many different contexts.
Like many fundamental mathematical concepts, the metric on a metric space can be interpreted in many different ways. A particular metric may not be best thought of as measuring physical distance, but, instead, as the cost of changing from one state to another (as with Wasserstein metrics on spaces of measures) or the degree of difference between two objects (for example, the Hamming distance between two strings of characters, or the Gromov–Hausdorff distance between metric spaces themselves).
Definition Formally, a metric space is an ordered pair where is a set (whose elements are called points), and is a metric on , i.e., a functionsatisfying the following axioms for all points : The distance from a point to itself is zero: (Positivity) The distance between two distinct points is always positive: (Symmetry) The distance from to is always the same as the distance from to : The triangle inequality holds: This is a natural property of both physical and metaphorical notions of distance: you can arrive at from by taking a detour through , but this will not make your journey any shorter than the direct path.
It is traditional to write as an abbreviation for when it is understood what is.
Simple examples The real numbers The real numbers with the distance function given by the absolute difference form a metric space. Many properties of metric spaces and functions between them are generalizations of concepts in real analysis and coincide with those concepts when applied to the real line.
Metrics on Euclidean spaces
The Euclidean plane can be equipped with many different metrics. The Euclidean distance familiar from school mathematics can be defined by
The taxicab or Manhattan distance is defined by
and can be thought of as the distance you need to travel along horizontal and vertical lines to get from one point to the other, as illustrated at the top of the article.
The maximum, , or Chebyshev distance is defined by
This distance does not have an easy explanation in terms of paths in the plane, but it still satisfies the metric space axioms. It can be thought of similarly to the number of moves a king would have to make on a chess board to travel from one point to another on the given space.
In fact, these three distances, while they have distinct properties, are similar in some ways. Informally, points that are close in one are close in the others, too. This observation can be quantified with the formula
which holds for every pair of points . Moreover, there exists a continuous family of distances for that interpolates between these three distances. It is defined by
A radically different distance can be defined by setting
In this discrete metric, all distinct points are 1 unit apart: none of them are close to each other, and none of them are very far away from each other either. Intuitively, the discrete metric no longer remembers that the set is a plane, but treats it just as an undifferentiated set of points.
All of these metrics can be easily extended to make sense on as well as .
Subspaces Given a metric space and a subset , we can consider to be a metric space by measuring distances the same way we would in . Formally, the induced metric on is a function defined by
For example, if we take the two-dimensional sphere as a subset of , the Euclidean metric on induces the straight-line metric on described above. Two more useful examples are the open interval and the closed interval thought of as subspaces of the real line.
History Arthur Cayley, in his article "On Distance", extended metric concepts beyond Euclidean geometry into domains bounded by a conic in a projective space. His distance was given by logarithm of a cross ratio. Any projectivity leaving the conic stable also leaves the cross ratio constant, so isometries are implicit. This method provides models for elliptic geometry and hyperbolic geometry, and Felix Klein, in several publications, established the field of non-euclidean geometry through the use of the Cayley-Klein metric.
The idea of an abstract space with metric properties was addressed in 1906 by René Maurice Fréchet and the term metric space was coined by Felix Hausdorff in 1914.F. Hausdorff (1914) Grundzuge der MengenlehreMohamed A. Khamsi & William A. Kirk (2001) Introduction to Metric Spaces and Fixed Point Theory, page 14, John Wiley & Sons
Fréchet's work laid the foundation for understanding convergence, continuity, and other key concepts in non-geometric spaces. This allowed mathematicians to study functions and sequences in a broader and more flexible way. This was important for the growing field of functional analysis. Mathematicians like Hausdorff and Stefan Banach further refined and expanded the framework of metric spaces. Hausdorff introduced topological spaces as a generalization of metric spaces. Banach's work in functional analysis heavily relied on the metric structure. Over time, metric spaces became a central part of modern mathematics. They have influenced various fields including topology, geometry, and applied mathematics. Metric spaces continue to play a crucial role in the study of abstract mathematical concepts.
Basic notions A distance function is enough to define notions of closeness and convergence that were first developed in real analysis. Properties that depend on the structure of a metric space are referred to as metric properties. Every metric space is also a topological space, and some metric properties can also be rephrased without reference to distance in the language of topology; that is, they are really topological properties.
The topology of a metric space For any point in a metric space and any real number , the open ball of radius around is defined to be the set of points that are strictly less than distance from :
This is a natural way to define a set of points that are relatively close to . Therefore, a set is a neighborhood of (informally, it contains all points "close enough" to ) if it contains an open ball of radius around for some .
An open set is a set which is a neighborhood of all its points. It follows that the open balls form a base for a topology on . In other words, the open sets of are exactly the unions of open balls. As in any topology, closed sets are the complements of open sets. Sets may be both open and closed as well as neither open nor closed.
This topology does not carry all the information about the metric space. For example, the distances , , and defined above all induce the same topology on , although they behave differently in many respects. Similarly, with the Euclidean metric and its subspace the interval with the induced metric are homeomorphic but have very different metric properties.
Conversely, not every topological space can be given a metric. Topological spaces which are compatible with a metric are called metrizable and are particularly well-behaved in many ways: in particular, they are paracompactRudin, Mary Ellen. A new proof that metric spaces are paracompact . Proceedings of the American Mathematical Society, Vol. 20, No. 2. (Feb., 1969), p. 603. Hausdorff spaces (hence normal) and first-countable. The Nagata–Smirnov metrization theorem gives a characterization of metrizability in terms of other topological properties, without reference to metrics.
Convergence Convergence of sequences in Euclidean space is defined as follows: A sequence converges to a point if for every there is an integer such that for all , . Convergence of sequences in a topological space is defined as follows: A sequence converges to a point if for every open set containing there is an integer such that for all , . In metric spaces, both of these definitions make sense and they are equivalent. This is a general pattern for topological properties of metric spaces: while they can be defined in a purely topological way, there is often a way that uses the metric which is easier to state or more familiar from real analysis.
Completeness
Informally, a metric space is complete if it has no "missing points": every sequence that looks like it should converge to something actually converges.
To make this precise: a sequence in a metric space is a Cauchy sequence if for every there is an integer such that for all , . By the triangle inequality, any convergent sequence is a Cauchy sequence: if and are both less than away from the limit, then they are less than away from each other. If the converse is true—every Cauchy sequence in converges—then is complete.
Euclidean spaces are complete, as is with the other metrics described above. Two examples of spaces which are not complete are and the rationals, each with the metric induced from . One can think of as "missing" its endpoints 0 and 1. The rationals are missing all the irrationals, since any irrational has a sequence of rationals converging to it in (for example, its successive decimal approximations). These examples show that completeness is not a topological property, since is complete but the homeomorphic space is not.
This notion of "missing points" can be made precise. In fact, every metric space has a unique completion, which is a complete space that contains the given space as a dense subset. For example, is the completion of , and the real numbers are the completion of the rationals.