Foundations
Metric Spaces, Convergence, and Completeness
Metric space axioms, convergence of sequences, Cauchy sequences, completeness, and the Banach fixed-point theorem.
Why This Matters
Convergence guarantees for optimization algorithms (gradient descent, EM, iterative methods) require a precise notion of distance and completeness. The Banach fixed-point theorem gives convergence of contraction mappings, which appears in value iteration (reinforcement learning), iterative solvers, and fixed-point equations throughout ML.
Core Definitions
Metric Space
A metric space is a set with a function satisfying:
- Identity of indiscernibles:
- Symmetry:
- Triangle inequality:
Key Examples
Euclidean space with . More generally, any norm on induces a metric . The norms () all give valid metrics.
Discrete metric. On any set , define if and . Every subset is open, every sequence that converges is eventually constant, and the space is always complete. This is useful as a degenerate case to test whether a theorem's hypotheses are too weak.
Function spaces. , the continuous functions on , with the supremum metric . This is a complete metric space (a Banach space). Convergence in this metric is uniform convergence, which preserves continuity. The weaker pointwise convergence does not come from a metric on and does not preserve continuity.
sequence spaces. Sequences with , using . Complete for . These spaces appear in functional analysis and approximation theory.
Open and Closed Sets
A set is open if for every there exists such that the ball is contained in . A set is closed if its complement is open, equivalently if it contains all its limit points.
Convergence and Cauchy Sequences
Convergence of Sequences
A sequence in converges to if for every there exists such that for all . The limit is unique in a metric space.
Uniqueness follows from the triangle inequality: if and , then , so and .
Cauchy Sequence
A sequence is Cauchy if for every there exists such that for all . Every convergent sequence is Cauchy, but the converse requires completeness.
The Cauchy condition is an intrinsic property: it refers only to distances between terms of the sequence, not to a candidate limit. This is critical because in many spaces (e.g., incomplete spaces, or when proving existence of a limit), the limit is unknown.
Every convergent sequence is Cauchy. If , then for large enough.
The converse fails without completeness. In with the usual metric, the sequence of rational approximations to (e.g., via Newton's method) is Cauchy but does not converge in .
Completeness
Complete Metric Space
A metric space is complete if every Cauchy sequence in converges to a point in .
Completeness is a property of the space, not of individual sequences. It guarantees that "sequences that should converge" actually do converge within the space.
Completeness is preserved by closure. Any closed subset of a complete metric space is itself complete. Conversely, a complete subspace of a metric space is closed.
Completion. Every metric space can be embedded isometrically into a complete metric space (its completion). is the completion of . This is analogous to how the Lebesgue integral completes the Riemann integral.
Compactness in Metric Spaces
Compact Metric Space
A metric space is compact if every open cover has a finite subcover. In metric spaces, this is equivalent to: every sequence has a convergent subsequence (sequential compactness).
In , the Heine-Borel theorem characterizes compact sets as those that are closed and bounded. In infinite-dimensional spaces, closed and bounded does not imply compact. The closed unit ball in is closed and bounded but not compact.
Why compactness matters for ML. Compactness guarantees that continuous functions attain their extrema (extreme value theorem). Many existence proofs in optimization require compactness of the feasible set. If you are minimizing a continuous loss over a compact parameter space, a minimizer exists. Without compactness, you need additional arguments (coercivity, lower semicontinuity) to guarantee existence.
Contraction Mappings
Contraction Mapping
A function is a contraction if there exists such that for all . The constant is the contraction factor.
A contraction is automatically uniformly continuous (and hence continuous). The contraction factor controls the convergence rate: the error after iterations decays as , giving geometric (linear) convergence.
Main Theorems
Banach Fixed-Point Theorem (Contraction Mapping Theorem)
Statement
has a unique fixed point (i.e., ). For any starting point , the iterates converge to , with error bound:
Intuition
A contraction shrinks distances. Iterating it produces a Cauchy sequence (consecutive terms get geometrically closer). Completeness guarantees this sequence converges. Uniqueness follows because two fixed points would have to be distance zero apart.
Proof Sketch
For : . This shows is Cauchy. By completeness, . Continuity of gives . For uniqueness: if , then , so .
Why It Matters
This theorem gives both existence and a constructive algorithm (iterate ) with a convergence rate. In RL, the Bellman operator is a contraction in the sup-norm with factor (the discount factor), so value iteration converges. In optimization, proximal operators are often contractions.
Failure Mode
Fails if (the map is merely non-expansive, not a contraction). Example: on preserves distances but has no fixed point. Fails if the space is not complete: on is a contraction but the fixed point is not in the space.
Standard Metrics
| Space | Metric | Complete? |
|---|---|---|
| Yes | ||
| (continuous functions) | $d(f,g) = \sup_t | f(t) - g(t) |
| (square-summable sequences) | Yes | |
| (rationals) | $d(x,y) = | x - y |
Common Confusions
Cauchy does not imply convergent without completeness
The sequence in is Cauchy but does not converge in because the limit is not in the space. Completeness is exactly the property that rules out this pathology.
Contraction factor must be strictly less than 1
The map on satisfies for but is not a contraction (no uniform ). It still has a fixed point (), but the Banach theorem does not apply, and convergence may be arbitrarily slow.
Closed and bounded does not imply compact in infinite dimensions
In , closed plus bounded equals compact (Heine-Borel). In infinite-dimensional spaces this fails. The closed unit ball in is closed and bounded but not compact: the sequence of standard basis vectors has no convergent subsequence (all pairwise distances are ). Compactness in infinite dimensions requires additional conditions such as total boundedness.
Exercises
Problem
Show that is a metric on . Which of the three axioms is the hardest to verify?
Problem
Let be defined by . Show that is a contraction on and find the contraction factor. What is the fixed point?
References
Canonical:
- Rudin, Principles of Mathematical Analysis (1976), Chapters 2-3
- Kreyszig, Introductory Functional Analysis with Applications (1989), Chapters 1-2
- Munkres, Topology (2000), Chapter 2 (metric spaces, compactness, completeness)
Supplementary:
- Sutherland, Introduction to Metric and Topological Spaces (2009), Chapters 3-7
- Aliprantis & Border, Infinite Dimensional Analysis (2006), Chapter 3 (metric spaces in economics and optimization)
For ML context:
- Bertsekas, Dynamic Programming and Optimal Control (2012), Chapter 1 (contraction mappings in RL)
- Puterman, Markov Decision Processes (2005), Chapter 6.2 (contraction operators for value iteration)
Last reviewed: April 2026
Builds on This
- Compactness and Heine-BorelLayer 0A
- Continuity in R^nLayer 0A
- Sequences and Series of FunctionsLayer 0A