A metric space is a set together with a function measuring "distance" between its elements, subject to four axioms: distance is always non-negative; the distance from a point to itself is zero; distance is symmetric; and the triangle inequality holds. This simple, abstract framework unifies the geometry of the Euclidean plane, the analysis of functions, the study of sequences, and the topology of curved surfaces โ making metric spaces one of the most widely applicable structures in all of modern mathematics.
You already have an intuitive sense of distance: London is farther from Mumbai than Paris is. But what makes something a valid notion of "distance"? A metric space captures the essential properties that any reasonable distance function must have โ and then applies them to settings far beyond ordinary geography.
The power is that the same theorems โ about convergence, continuity, limits, open sets, compactness โ apply to any metric space automatically, no matter how unusual the "distance" function is. You prove a theorem once in the abstract setting, and get it for free in Euclidean space, in the space of continuous functions, in the space of DNA sequences, and anywhere else you can define a metric.
The "discrete metric" on any set assigns distance 0 if two points are the same and 1 if they're different โ satisfying all four axioms despite having nothing to do with geometry. The space of continuous functions on [0,1] becomes a metric space using d(f,g) = max|f(x)โg(x)| as the distance between functions. Even the set of all English words can be metrised by the "edit distance" โ the number of insertions, deletions, or substitutions needed to turn one word into another โ which is exactly how spell-checkers find the closest correct word to a misspelling.
In a metric space (X, d), the open ball of radius r around point x is B(x,r) = {y โ X : d(x,y) < r} โ all points within distance r of x. A set U โ X is open if every point in U has some open ball around it that stays entirely within U. This definition of "open set" โ derived purely from the metric โ is the foundation of topology in metric spaces, and it makes precise the informal notion of a neighbourhood.
A sequence (xโ) in a metric space converges to a limit x if d(xโ, x) โ 0 as n โ โ โ the points get arbitrarily close to x in the metric sense. A function f: X โ Y between metric spaces is continuous at x if for every ฮต > 0 there exists ฮด > 0 such that d(x,y) < ฮด implies d(f(x),f(y)) < ฮต โ the familiar ฮต-ฮด definition from calculus, now stated purely in terms of metrics and therefore valid in any metric space.
A metric space is complete if every Cauchy sequence (a sequence where the terms get arbitrarily close to each other) converges to a limit within the space. The real numbers โ are complete; the rationals โ are not (the sequence 3, 3.1, 3.14, 3.141, 3.1415, ... is Cauchy in โ but converges to ฯ, which is not rational). Completeness is essential for analysis: the Baire category theorem, the Banach fixed-point theorem, and most existence theorems in analysis require completeness. The process of "completing" a metric space โ filling in missing limits โ is how the real numbers can be constructed from the rationals (Cantor's construction).
In metric spaces, compactness is equivalent to being both complete and totally bounded (the space can be covered by finitely many balls of any given radius). Compact metric spaces have the "extreme value property": any continuous function on them achieves its maximum and minimum. The Heine-Borel theorem characterises compact subsets of โโฟ as exactly the closed and bounded ones โ a result that fails in infinite-dimensional metric spaces.
Every metric space generates a topological space (see that entry) by declaring a set open if it contains an open ball around each of its points. But not every topological space comes from a metric โ a topological space that does is called metrizable. Urysohn's metrization theorem (1925) gives conditions under which a topological space is metrizable: it must be second-countable and regular (T3). The distinction between metric and non-metric topological spaces is important in functional analysis, where natural topologies on infinite-dimensional spaces are often not metrizable.
A normed vector space is a vector space with a notion of length (norm) โvโ, inducing a metric d(u,v) = โuโvโ. A complete normed vector space is a Banach space โ the correct setting for most of functional analysis. A Banach space with an inner product (a dot product generalisation) is a Hilbert space โ the mathematical setting for quantum mechanics, where states are vectors in a Hilbert space and observables are operators on it. These are metric spaces, but equipped with additional algebraic structure (the vector space and inner product) that makes the geometry far richer.
An ultrametric space satisfies a strengthened triangle inequality: d(x,z) โค max(d(x,y), d(y,z)) โ the distance from x to z is at most the maximum (not the sum) of the other two distances. This seemingly small strengthening produces profoundly different geometry: in an ultrametric space, every triangle is isoceles (any two sides are equal), and every point inside a ball is its centre. The p-adic numbers (a central object in modern number theory) carry a natural ultrametric, and the study of ultrametric spaces connects to the Birch and Swinnerton-Dyer Conjecture (see the Clay Millennium Problems entry) through p-adic analysis.