Lably
Skip to content

Metric space

Mathematical space with a notion of distance

  • 33 min read
  • 8 chapters

Related on Lably

Through Mathematics, Distance and Point (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 (M, d) where M is a set (whose elements are called points), and d is a metric on M, i.e., a functiond:M×M→Rsatisfying the following axioms for all points x,y,z∈M:

  1. The distance from a point to itself is zero: d(x,x)=0
  2. (Positivity) The distance between two distinct points is always positive: If x≠y, then d(x,y)>0
  3. (Symmetry) The distance from x to y is always the same as the distance from y to x: d(x,y)=d(y,x)
  4. The triangle inequality holds: d(x,z)≤d(x,y)+d(y,z)This is a natural property of both physical and metaphorical notions of distance: you can arrive at z from x by taking a detour through y, but this will not make your journey any shorter than the direct path.

It is traditional to write M as an abbreviation for (M, d) when it is understood what d is.

Simple examples

The real numbers

The real numbers with the distance function d(x,y)=|y−x| 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 R2 can be equipped with many different metrics. The Euclidean distance familiar from school mathematics can be defined by d2((x1,y1),(x2,y2))=(x2−x1)2+(y2−y1)2.

The taxicab or Manhattan distance is defined by d1((x1,y1),(x2,y2))=|x2−x1|+|y2−y1| 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, L∞, or Chebyshev distance is defined by d∞((x1,y1),(x2,y2))=max{|x2−x1|,|y2−y1|}. 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 d∞(p,q)≤d2(p,q)≤d1(p,q)≤2d∞(p,q), which holds for every pair of points p,q∈R2. Moreover, there exists a continuous family of distances dα for α∈(1,∞) that interpolates between these three distances. It is defined bydα((x1,y1),(x2,y2))=(|x2−x1|α+|y2−y1|α)1/α.

A radically different distance can be defined by setting d(p,q)={0,if p=q,1,otherwise. 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 Rn as well as R2.

Subspaces

Given a metric space (M, d) and a subset A⊆M, we can consider A to be a metric space by measuring distances the same way we would in M. Formally, the induced metric on A is a function dA:A×A→R defined by dA(x,y)=d(x,y). For example, if we take the two-dimensional sphere S2 as a subset of R3, the Euclidean metric on R3 induces the straight-line metric on S2 described above. Two more useful examples are the open interval (0, 1) and the closed interval [0, 1] thought of as subspaces of the real line.

Sign in to keep reading

7 more chapters are free with a Lably account.

More in Geometry