A metric adds a ruler to a set—but the important question is what that ruler lets us prove.
Metric spaces sit between elementary geometry and general topology. They retain a precise notion of distance, yet they free that notion from ordinary coordinates. Once a metric is chosen we can talk about open balls, convergence, Cauchy sequences, continuity, completeness, boundedness and approximation. At the same time, the metric automatically generates a topology, so every metric space is also a topological space.
This guide serves R22.02 · Metric spaces and examples in the BTT Mathematics Atlas. It assumes the ideas of open sets and continuity from the preceding topology guide, then rebuilds them using distance. The central discipline is to separate what depends only on the induced topology from what depends on the particular metric.
Routes: Topological Spaces and Continuity · Calculus · Vectors and coordinates · BTT Mathematics Hub.
The simple answer
A metric on a set X is a function d : X × X → R that measures distance between points and satisfies four rules: distances are nonnegative, distance is zero exactly when the points are the same, distance is symmetric, and travelling through an intermediate point cannot make the direct distance larger than the two-leg journey. That last rule is the triangle inequality.
The pair (X,d) is a metric space. For a point x and radius r>0, the open ball B(x,r) consists of all y with d(x,y)<r. A subset U of X is open when every x in U lies inside some open ball contained in U. Those open sets form the topology induced by d.
1. The metric axioms
For all x,y,z in X, a metric d satisfies:
- Nonnegativity: d(x,y) ≥ 0.
- Identity of indiscernibles: d(x,y)=0 if and only if x=y.
- Symmetry: d(x,y)=d(y,x).
- Triangle inequality: d(x,z) ≤ d(x,y)+d(y,z).
Each axiom performs a job. The first stops negative distance. The second prevents distinct points from collapsing to zero distance. The third says direction does not matter. The fourth constrains detours.
Worked example 1: the usual metric on R
On X=R, define d(x,y)=|x−y|. Nonnegativity and symmetry come from absolute value. d(x,y)=0 exactly when x=y. The triangle inequality is |x−z|≤|x−y|+|y−z|. So this is a metric.
The open ball B(x,r) is simply the interval (x−r,x+r). Therefore the metric topology is the usual topology on R.
2. Euclidean distance in Rⁿ
For x=(x₁,…,xₙ) and y=(y₁,…,yₙ), the Euclidean metric is
d₂(x,y)=√[(x₁−y₁)²+⋯+(xₙ−yₙ)²].
This is the distance inherited from ordinary Euclidean geometry. Open balls are familiar discs in R² and balls in R³. The triangle inequality is a higher-dimensional form of the geometric fact that a straight route is no longer than going via an intermediate point.
3. Other metrics on the same set
The same point set can carry different metrics.
- Taxicab metric: d₁(x,y)=Σ|xᵢ−yᵢ|.
- Sup metric: d∞(x,y)=maxᵢ|xᵢ−yᵢ|.
- Discrete metric: d(x,y)=0 when x=y and 1 otherwise.
On R², d₂-balls are circular, d₁-balls are diamond-shaped and d∞-balls are square-shaped. Yet all three metrics induce the same standard topology on finite-dimensional Rⁿ. The exact numerical distances differ; the collection of open sets does not.
This is a first major lesson: topological sameness is weaker than metric sameness. Two metrics can be different while generating the same topology.
4. Open balls generate the topology
For x∈X and r>0, define B(x,r)={y∈X:d(x,y)<r}. A set U⊆X is open when for every x∈U there exists r>0 such that B(x,r)⊆U.
The family of all open balls is a basis. The nontrivial point is the basis-intersection condition. Suppose z∈B(x,r)∩B(y,s). We want a small ball around z that remains inside both. Set
ε=min{r−d(x,z), s−d(y,z)}.
Because z lies in both balls, both quantities are positive, so ε>0. If d(z,w)<ε, the triangle inequality gives d(x,w)≤d(x,z)+d(z,w)<r, and similarly d(y,w)<s. Thus B(z,ε) lies in the intersection.
5. Closed balls are not usually open balls
The closed ball is B̄(x,r)={y:d(x,y)≤r}. In ordinary Euclidean spaces, closed balls are closed sets. But terminology can mislead: “closed ball” names the ≤ construction, not a universal theorem that the set must behave exactly as your geometric intuition predicts in every unusual metric setting.
In fact, in the discrete metric, a ball of radius r with 0<r≤1 around x is {x}, while a ball of radius r>1 is X. Since the induced topology is discrete, every subset is open and closed.
6. Convergence of sequences
A sequence (xₙ) in a metric space (X,d) converges to x if for every ε>0 there exists N such that n≥N implies d(xₙ,x)<ε.
This is the familiar ε-definition written with a general metric. Topologically, it says that eventually the sequence lies in every neighbourhood of x.
Worked example 2: convergence in R²
Let xₙ=(1/n,1/n²). Under the Euclidean metric,
d₂(xₙ,(0,0))=√(1/n²+1/n⁴)≤√2/n→0.
So xₙ→(0,0). It also converges to (0,0) under d₁ and d∞ because those metrics induce the same topology. Indeed d∞(xₙ,0)=1/n and d₁(xₙ,0)=1/n+1/n².
7. Limits are unique in metric spaces
Suppose xₙ→x and xₙ→y. If x≠y, let δ=d(x,y)>0. For large n, both d(xₙ,x)<δ/3 and d(xₙ,y)<δ/3. Then the triangle inequality gives
d(x,y)≤d(x,xₙ)+d(xₙ,y)<2δ/3,
contradicting d(x,y)=δ. Therefore x=y.
This proof uses separation built into metrics. In completely general topological spaces, a sequence can have more than one limit. Metric spaces are Hausdorff, and Hausdorff spaces have unique limits for convergent sequences.
8. Continuity in metric language
For metric spaces (X,dX) and (Y,dY), a function f:X→Y is continuous at x if for every ε>0 there exists δ>0 such that dX(x,y)<δ implies dY(f(x),f(y))<ε.
This metric ε–δ definition is equivalent to topological continuity. It also yields the sequential test: in metric spaces, f is continuous if and only if xₙ→x always implies f(xₙ)→f(x).
Worked example 3: a Lipschitz map
If there is a constant L≥0 such that dY(f(x),f(y))≤L dX(x,y) for all x,y, then f is Lipschitz. Every Lipschitz map is uniformly continuous, hence continuous.
For L>0, given ε>0 choose δ=ε/L. Then dX(x,y)<δ implies dY(f(x),f(y))<ε. This is stronger than pointwise continuity because the same δ works at every point.
9. Cauchy sequences
A sequence (xₙ) is Cauchy if for every ε>0 there exists N such that m,n≥N implies d(xₘ,xₙ)<ε.
A convergent sequence is always Cauchy: if xₙ→x, then for large m,n, each point is close to x, and the triangle inequality makes xₘ and xₙ close to each other.
The converse is not always true because the would-be limit might be missing from the space.
Worked example 4: Q is not complete
Take rational approximations to √2 inside Q, for example a sequence of decimal truncations 1, 1.4, 1.41, 1.414, …. Under the usual metric this is Cauchy, because the terms become arbitrarily close. But it has no limit in Q: its real limit is √2, which is irrational.
Therefore Q with the usual metric is not complete.
10. Completeness
A metric space is complete if every Cauchy sequence converges to a point of the space. R is complete under the usual metric; Q is not.
Completeness is central in analysis. Many existence arguments work by constructing a Cauchy sequence of approximations and then using completeness to guarantee a limit exists in the space.
But completeness is not purely topological. Two metrics can generate the same topology while one is complete and the other is not. For example, R is homeomorphic to (−π/2,π/2), and pulling the ordinary metric of that interval back through arctan gives a metric on R inducing the usual topology that is not complete. The open-set structure alone does not remember metric completeness.
11. Boundedness is metric-dependent
A subset A of a metric space is bounded if there exists M>0 and x₀∈X such that d(x,x₀)≤M for every x∈A. The whole real line is unbounded in the usual metric.
Yet define d′(x,y)=|arctan x−arctan y|. This metric induces the usual topology on R, but every distance is less than π, so R is bounded under d′. Therefore boundedness is not a topological invariant.
12. Equivalent metrics
Two metrics are topologically equivalent when they induce the same topology. A strong sufficient condition is bi-Lipschitz equivalence: if constants c,C>0 satisfy
c d₁(x,y) ≤ d₂(x,y) ≤ C d₁(x,y)
for all x,y, then the metrics induce the same topology. On finite-dimensional Rⁿ, the familiar p-norm metrics are equivalent in this sense.
Topological equivalence alone is weaker. It preserves open sets, continuity, compactness and connectedness. It need not preserve exact distances, boundedness, Cauchy sequences or completeness.
13. The discrete metric
For any set X define d(x,y)=0 if x=y and 1 otherwise. This is a metric. For radius r≤1, B(x,r)={x}; every singleton is open. Hence every subset, being a union of singletons, is open. The induced topology is discrete.
A sequence in the discrete metric converges exactly when it is eventually constant. A sequence is Cauchy exactly when it is eventually constant. Therefore every discrete metric space is complete, regardless of the size of X.
14. A metric on sequences
Let X be the set of all real sequences x=(x₁,x₂,…). One useful bounded metric is
d(x,y)=Σn=1∞ 2−n min{1,|xₙ−yₙ|}.
The weights 2−n make the series converge, and the min prevents any single coordinate from contributing too much. Convergence in this metric corresponds to coordinatewise convergence. This shows why metric spaces are not limited to points in physical space: the “points” themselves can be functions or sequences.
15. Function-space metrics
On continuous functions f,g:[0,1]→R, define the sup metric
d∞(f,g)=maxx∈[0,1]|f(x)−g(x)|.
This measures the worst vertical discrepancy between two functions. A sequence fₙ converges to f in this metric exactly when fₙ converges uniformly to f. This metric is therefore aligned with a central concept from analysis.
By choosing different metrics on the same function set, mathematicians can encode different kinds of approximation. The metric is part of the mathematical model, not decoration.
16. Distance from a point to a set
For A⊆X, define d(x,A)=inf{d(x,a):a∈A}, when A is nonempty. In R, the distance from 3 to the interval [0,1] is 2. If x lies in the closure of A, then d(x,A)=0 in any metric space.
The converse also holds: d(x,A)=0 implies x∈cl(A). To see this, every ball B(x,ε) contains some point a∈A because the infimum distance is zero. Thus every neighbourhood of x meets A.
17. Dense subsets
A subset A is dense in X when cl(A)=X. Equivalently, every nonempty open ball meets A.
Q is dense in R under the usual metric: every open interval contains a rational number. The irrational numbers are also dense. A dense set need not contain most points in any counting sense; density is about meeting every neighbourhood.
18. Separability
A metric space is separable if it has a countable dense subset. Rⁿ is separable because Qⁿ is countable and dense. Separability matters in analysis because a countable skeleton can sometimes control behaviour throughout an uncountable space.
Do not confuse separability with separation axioms such as Hausdorffness. The words sound related but concern different properties.
19. Common misconceptions
- “A metric must be Euclidean distance.” False. Many valid metrics have no ordinary geometric picture.
- “Different metrics always give different topologies.” False. d₁,d₂,d∞ on finite-dimensional Rⁿ induce the same topology.
- “Same topology means same Cauchy sequences.” False in general. Cauchy behaviour depends on more than topology.
- “Every Cauchy sequence converges.” Only in complete metric spaces.
- “Boundedness is topological.” False. Equivalent topologies can arise from metrics with different boundedness behaviour.
- “Open balls are closed under intersections.” Not necessarily as balls, though their intersection is open and contains smaller balls around each of its points.
- “Every topology comes from a metric.” False. Metrizability requires additional conditions.
20. Worked comparison: d and min{1,d}
If d is any metric, define ρ(x,y)=min{1,d(x,y)}. Then ρ is also a metric. It is bounded by 1, yet it induces the same topology as d.
Why? For every radius r<1, the ρ-ball Bρ(x,r) equals the d-ball Bd(x,r). Small neighbourhoods—the part that determines topology—are identical. Large-scale distances have been compressed, but local openness has not changed.
This example is a clean demonstration of the distinction between metric structure and topological structure.
21. Practice set
- Verify that the discrete metric satisfies the triangle inequality.
- Describe B(0,2) in R under the usual metric.
- Describe B((0,0),1) under d₁,d₂ and d∞ in R².
- Prove every metric space is Hausdorff.
- Show every convergent sequence is bounded.
- Show every convergent sequence is Cauchy.
- Give a Cauchy sequence in Q with no rational limit.
- Prove the discrete metric space on any set is complete.
- Show d′(x,y)=min{1,|x−y|} induces the usual topology on R.
- Does d(x,y)=|x−y|² define a metric on R? Test the triangle inequality.
- Show the map f(x)=2x from R to R is Lipschitz.
- Show f(x)=x² is not globally Lipschitz on R with the usual metric.
- Find d(3,[0,1]) in R.
- Show x∈cl(A) iff d(x,A)=0.
- Explain why Q is dense in R.
- Are d₁ and d∞ on R² topologically equivalent? Give inequalities.
- Can a complete metric space be bounded? Give an example.
- Can an incomplete metric space be bounded? Give an example.
22. Answers and checks
- If x≠z, d(x,z)=1 while d(x,y)+d(y,z) is at least 1; if x=z the left side is 0.
- (−2,2).
- d₁: |x|+|y|<1; d₂: x²+y²<1; d∞: max{|x|,|y|}<1.
- For x≠y choose r=d(x,y)/3. The balls B(x,r) and B(y,r) are disjoint by the triangle inequality.
- If xₙ→x, then eventually d(xₙ,x)<1; finitely many earlier terms have a finite maximum distance from x.
- Use d(xₘ,xₙ)≤d(xₘ,x)+d(x,xₙ).
- Any rational sequence converging in R to √2.
- A Cauchy sequence is eventually pairwise closer than 1; in the discrete metric this forces all sufficiently late terms to be equal.
- Balls of radius less than 1 are exactly the usual balls of the same radius.
- No. With x=0,y=1,z=2, d(0,2)=4 but d(0,1)+d(1,2)=2.
- |2x−2y|=2|x−y|, so L=2.
- If a global L existed, |x²−0|≤L|x| would give |x|≤L for all x≠0, impossible.
- 2.
- Use the definition of infimum and open balls.
- Every real open interval contains a rational number.
- Yes. d∞≤d₁≤2d∞.
- Yes: any set with the discrete metric is complete and bounded by 1.
- Yes: (0,1) with the usual metric is bounded but incomplete.
23. What to carry forward
A metric gives quantitative control. It makes neighbourhoods measurable by radii, lets sequences be tested numerically, and introduces Cauchy structure and completeness. But some properties you can see with the metric—such as boundedness and completeness—are not determined solely by the induced topology.
The next article removes the microscope and asks about whole spaces: can infinitely many local pieces be controlled by finitely many? Can a space be split into separated pieces? Those questions lead to compactness and connectedness.
