Foundations
Metric Spaces, Convergence, and Completeness
Metric space axioms, convergence of sequences, Cauchy sequences, completeness, and the Banach fixed-point theorem.
Prerequisites
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 , which appears in value iteration (reinforcement learning), iterative solvers, and fixed-point equations throughout ML.
The notation ("for all") and ("there exists") will appear in every definition below.
This page is "core" in a specific sense: not because every ML practitioner needs abstract metric topology on day one, but because the language of distance, Cauchy behavior, completeness, and contractions sits underneath the cleanest convergence arguments in optimization, RL, and function-space approximation.
What To Keep From This Page
| Idea | The question it answers | Standard failure if absent |
|---|---|---|
| Metric | what does "close" mean? | no coherent notion of continuity or convergence |
| Convergent sequence | do the iterates approach a specific point? | limit candidate may be wrong or undefined |
| Cauchy sequence | are the iterates internally stabilizing? | you may not yet know the limit |
| Complete space | does every stabilizing sequence land inside the space? | Cauchy sequences can converge "outside" the model space |
| Contraction map | do repeated updates shrink errors uniformly? | fixed-point iteration may stall, drift, or fail to exist |
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 and only if for every there exists such that the ball is contained in . A set is closed if and only 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 and only 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 and only 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 and only 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 in measure-theoretic probability.
Compactness in Metric Spaces
Compact Metric Space
A metric space is compact if and only 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 and only 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
Let be a nonempty complete metric space and a contraction with factor . Then has a unique fixed point (i.e., ), and for any starting point the iterates converge to with error bound:
Both nonemptiness and completeness are essential: without them either the fixed point fails to exist or the Cauchy iterates have no limit in .
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 of convex functions are firmly nonexpansive (a strictly stronger property than 1-Lipschitz, but weaker than being a strict contraction); they are genuine contractions only in special cases (e.g. prox of a strongly convex function with ). Convergence of plain proximal-point iteration therefore follows from Krasnoselskii–Mann or Opial-style arguments rather than directly from Banach.
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) | Yes | |
| (square-summable sequences) | Yes | |
| (rationals) | No |
Comparison Table
| Property | Sequence language | Space language | Why ML cares |
|---|---|---|---|
| Convergence | the limit point already lives in the space | iterative algorithms have a meaningful target | |
| Cauchy | tail points get arbitrarily close to each other | intrinsic notion, no limit supplied yet | useful when the fixed point or solution is not known beforehand |
| Completeness | every Cauchy sequence converges | no missing limit points | Banach fixed-point and many existence proofs go through |
| Compactness | every sequence has a convergent subsequence | stronger than completeness | guarantees minimizers for continuous objectives on compact sets |
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.
Complete does not mean compact
Completeness says Cauchy sequences converge. Compactness says every sequence has a convergent subsequence. with its usual metric is complete but not compact; the sequence has no convergent subsequence. In optimization arguments, confusing these two loses track of whether you are proving existence of a limit or existence of a minimizer.
Exercises
Problem
Show that is a metric on . Which of the three axioms is the hardest to verify?
Problem
Let . Show that is not a contraction on all of , but that restricted to is a contraction with factor . Since maps into in one step, conclude that iteration from any converges. 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), Sections 20-28
Supplementary:
- Sutherland, Introduction to Metric and Topological Spaces (2009), Chapters 3-7
- Aliprantis & Border, Infinite Dimensional Analysis (2006), Chapter 3
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 26, 2026
Canonical graph
Required before and derived from this topic
These links come from prerequisite edges in the curriculum graph. Editorial suggestions are shown here only when the target page also cites this page as a prerequisite.
Required prerequisites
1- Sets, Functions, and Relationslayer 0A · tier 1
Derived topics
8- Compactness and Heine-Borellayer 0A · tier 1
- Continuity in Rⁿlayer 0A · tier 1
- Modes of Convergence of Random Variableslayer 0B · tier 1
- Sequences and Series of Functionslayer 0A · tier 2
- Functional Analysis Corelayer 0B · tier 2
+3 more on the derived-topics page.