← back to real analysis

Metric Spaces

Jiří Lebl · Basic Analysis I, Ch. 8 · CC BY-SA 4.0

A metric space is a set with a distance function satisfying positivity, symmetry, and the triangle inequality. Every concept from real analysis (convergence, continuity, compactness, completeness) generalizes to metric spaces. The reals are just one example.

p r B(p, r) Open ball: all points within distance r of p.

Definition and examples

A metric d on a set X satisfies: (1) d(x, y) ≥ 0 with equality iff x = y, (2) d(x, y) = d(y, x), (3) d(x, z) ≤ d(x, y) + d(y, z). The reals with |x - y| are a metric space. So is R^n with Euclidean distance. So is the set of bounded functions with the sup metric.

Scheme

Open and closed sets

The open ball B(p, r) is the set of all x with d(x, p) < r. A set is open if every point has an open ball around it contained in the set. A set is closed if its complement is open, equivalently if it contains all its limit points.

Scheme

Compactness

A set is compact if every open cover has a finite subcover. In R^n, compact = closed and bounded (wpHeine-Borel). Compact sets are where the extreme value theorem and uniform continuity live. Compactness is the topological substitute for "closed bounded interval."

Scheme

Completeness in metric spaces

A metric space is complete if every Cauchy sequence converges. The reals are complete (Ch. 2). The rationals are not. Complete metric spaces are where the wpBanach fixed-point theorem lives: a contraction on a complete metric space has a unique fixed point.

Scheme

Notation reference

Symbol Scheme Meaning
d(x, y)(d-euclidean x y)Metric (distance function)
B(p, r)d(x, p) < rOpen ball
compactclosed + bounded (R^n)Every open cover has finite subcover
completeCauchy ⇒ convergentNo "holes" in the space
Neighbors

Translation notes

The metric space axioms are easy to verify computationally. The deep results (Heine-Borel, completeness of R, Banach fixed point) are theorems that our code illustrates but cannot prove. The contraction mapping iteration is the constructive content of the Banach theorem: it gives you the fixed point and a convergence rate.