Metric Spaces: Completeness, Compactness, Connectedness, Baire and Contractions
1. Metric spaces and completeness
A metric d on X is positive, symmetric, zero only on the diagonal and satisfies the triangle inequality. A sequence is Cauchy if d(xₘ, xₙ) → 0 as m, n → ∞, and X is complete if every Cauchy sequence converges in X. A closed subset of a complete space is complete, and a complete subspace of any metric space is closed.
| Complete | Not complete, and a Cauchy sequence that escapes |
|---|---|
| ℝⁿ with any norm; ℤ (a Cauchy sequence is eventually constant) | ℚ: the decimal truncations of √2 |
| C[a, b] with the sup metric | C[0, 1] with d(f, g) = ∫|f − g|: continuous ramps converging to a step |
| ℓᵖ and Lᵖ for 1 ≤ p ≤ ∞ | (0, 1) with the usual metric: xₙ = 1/n |
| any closed subset of ℝⁿ | the polynomials on [0, 1] under the sup metric: Taylor partial sums of eˣ |
2. Compactness: Heine–Borel and Bolzano–Weierstrass
K is compact if every open cover has a finite subcover. In a metric space the following are equivalent: K is compact; K is sequentially compact (every sequence has a convergent subsequence with limit in K); K is complete and totally bounded (for every ε > 0, finitely many ε-balls cover K). A compact set is closed and bounded; a closed subset of a compact set is compact.
- Heine–Borel: a subset of ℝⁿ is compact if and only if it is closed and bounded.
- Bolzano–Weierstrass: every bounded sequence in ℝⁿ has a convergent subsequence; equivalently every bounded infinite subset of ℝⁿ has a limit point.
- A continuous image of a compact set is compact, so a continuous real function on a compact set is bounded and attains its maximum and minimum.
3. Connectedness
X is connected if it is not the union of two disjoint non-empty open sets; path-connected if any two points are joined by a continuous path. The connected subsets of ℝ are exactly the intervals. Continuous images of connected sets are connected — the intermediate value theorem is the case X = [a, b] — and the closure of a connected set is connected. Path-connected implies connected; open connected subsets of ℝⁿ are path-connected.
- Topologist’s sine curve: S = {(x, sin(1/x)) : 0 < x ≤ 1} ∪ ({0} × [−1, 1]) is connected (the closure of a connected graph) but not path-connected.
- ℚ and ℝ ∖ ℚ are totally disconnected: their only connected subsets are points.
- Cut points: removing a point disconnects ℝ but not ℝ², so ℝ and ℝ² are not homeomorphic; [0, 1) and (0, 1) are not homeomorphic either, since removing 0 from [0, 1) leaves it connected.
4. The Baire category theorem
A set is nowhere dense if its closure has empty interior. Baire: in a non-empty complete metric space, a countable intersection of dense open sets is dense; equivalently, the space is not a countable union of nowhere dense sets (it is of the second category in itself).
- A non-empty complete metric space with no isolated points is uncountable: otherwise it would be the countable union of its singletons, each nowhere dense. This proves ℝ is uncountable.
- ℚ is not a Gδ subset of ℝ (not a countable intersection of open sets), so no function f: ℝ → ℝ is continuous exactly on ℚ; Thomae’s function is continuous exactly on the irrationals.
- Baire is the engine of functional analysis: the uniform boundedness principle and the open mapping theorem are both proved from it.
5. Continuity and uniform continuity
f: X → Y is uniformly continuous if for every ε > 0 there is one δ > 0 with d(f(x), f(y)) < ε whenever d(x, y) < δ, the same δ for all x. Heine–Cantor: a continuous function on a compact metric space is uniformly continuous. Lipschitz ⇒ uniformly continuous ⇒ continuous, and uniformly continuous maps send Cauchy sequences to Cauchy sequences. A function on a bounded interval (a, b) is uniformly continuous exactly when it extends continuously to [a, b].
| Function and domain | Uniformly continuous? | Reason |
|---|---|---|
| x² on ℝ | no | xₙ = n, yₙ = n + 1/n: |f(yₙ) − f(xₙ)| = 2 + 1/n² ↛ 0 |
| √x on [0, ∞) | yes, but not Lipschitz | |√x − √y| ≤ √|x − y|; slope unbounded at 0 |
| sin(1/x) on (0, 1) | no | no continuous extension to 0 |
| x sin(1/x) on (0, 1) | yes | extends continuously by 0 at x = 0 |
| 1/x on (0, 1) | no | maps the Cauchy sequence 1/n to n |
6. The contraction mapping principle
Banach fixed-point theorem. Let (X, d) be a non-empty complete metric space and T: X → X with d(Tx, Ty) ≤ k d(x, y) for all x, y and a fixed k < 1. Then T has exactly one fixed point x∗, the iterates xₙ₊₁ = Txₙ converge to it from any x₀, and d(xₙ, x∗) ≤ kⁿ d(x₁, x₀)/(1 − k). On an interval, a C¹ map into itself with |T′| ≤ k < 1 is a contraction by the mean value theorem.
| Hypothesis removed | Counterexample |
|---|---|
| completeness | T(x) = x/2 on (0, 1]: a contraction with no fixed point in (0, 1] |
| a uniform k < 1 | T(x) = x + 1/x on [1, ∞): |Tx − Ty| = |x − y|(1 − 1/(xy)) < |x − y| for x ≠ y, yet Tx = x has no solution |
| T maps X into X | T(x) = x/2 + 1 on [0, 1] has fixed point 2, outside [0, 1] |
Key takeaways
- Complete means every Cauchy sequence converges; closed subsets of complete spaces are complete, and ℚ, (0, 1) and (C[0, 1], L¹ metric) are the standard incomplete spaces.
- In a metric space compact ⇔ sequentially compact ⇔ complete and totally bounded; closed and bounded suffices only in ℝⁿ.
- Connected subsets of ℝ are intervals; path-connected ⇒ connected, and the topologist’s sine curve breaks the converse.
- Baire: a complete metric space is not a countable union of nowhere dense sets, so a perfect complete space is uncountable.
- A contraction on a complete space has a unique fixed point with error ≤ kⁿd(x₁, x₀)/(1 − k); without completeness or a uniform k < 1 it can have none.
Practice questions (13)
Attempt each one before opening the answer. Every explanation names the tempting wrong option as well as the right one, because that is where marks are lost.
Which of the following metric spaces, with the metric stated, are complete?
Show answer
Answer: B — C[0, 1] with d(f, g) = sup |f(x) − g(x)|; D — ℤ with d(x, y) = |x − y|
(1) The truncations 1, 1.4, 1.41, … of √2 are Cauchy in ℚ with no limit in ℚ. (2) A uniformly Cauchy sequence of continuous functions converges uniformly, and the limit is continuous. (3) 1/n is Cauchy with limit 0 ∉ (0, 1). (4) If |xₘ − xₙ| < 1 for m, n ≥ N then the integers are equal, so a Cauchy sequence in ℤ is eventually constant.Which of the following subsets of ℝ² are compact?
Show answer
Answer: A — {(x, y) : x² + y² ≤ 1}; D — {(x, y) : x⁴ + y⁴ = 1}
Heine–Borel: compact ⇔ closed and bounded. (1) is closed and bounded. (2) is closed but unbounded (x → ∞). (3) is bounded but not closed: (0, 0) is a limit point not in the set, since sin(1/x) = 0 at x = 1/(nπ). (4) is closed (a level set of a continuous function) and bounded (|x|, |y| ≤ 1).In the Hilbert space ℓ² of square-summable real sequences, the closed unit ball {x : ‖x‖ ≤ 1} is
Show answer
Answer: A — closed and bounded but not compact
The ball is closed and bounded, but the unit vectors eₙ lie in it with ‖eₙ − eₘ‖ = √2 for n ≠ m, so (eₙ) has no Cauchy, hence no convergent, subsequence and the ball is not sequentially compact. Heine–Borel is special to ℝⁿ; the ball is complete, being closed in a complete space.Which statements hold in every metric space?
Show answer
Answer: A — every compact subset is closed and bounded; C — a sequentially compact metric space is complete; D — a complete and totally bounded metric space is compact
(1) is true in any metric space (Hausdorff, and finitely many unit balls cover a compact set). (3) A Cauchy sequence with a convergent subsequence converges. (4) is the metric characterisation of compactness. (2) fails in ℓ² (the unit ball) and in any infinite discrete space, where every set is closed and bounded.Which subset of ℝ, with the usual topology, is connected?
Show answer
Answer: A — [0, ∞)
The connected subsets of ℝ are exactly the intervals, and [0, ∞) is an interval. [0, 1] ∪ [2, 3] and ℝ ∖ {0} each split into two disjoint relatively open pieces, and ℚ is totally disconnected: (−∞, √2) and (√2, ∞) separate it.Which statements are true?
Show answer
Answer: A — a continuous image of a connected space is connected; B — the closure of a connected subset of a metric space is connected
(1) A separation of f(X) pulls back to a separation of X. (2) If cl A = U ∪ V is a separation, A lies wholly in one piece, whose closure then misses the other. (3) is false: the topologist’s sine curve is connected and not path-connected. (4) is false: ℝ minus a point is disconnected, ℝ² minus a point is not.The number of connected components of the set {x ∈ ℝ : x² − 3x + 2 ≠ 0} is ____.
Numerical answer — type the value.
Show answer
Answer: 3
x² − 3x + 2 = (x − 1)(x − 2) vanishes at 1 and 2, so the set is ℝ ∖ {1, 2} = (−∞, 1) ∪ (1, 2) ∪ (2, ∞), three disjoint open intervals, each connected. Removing k points from ℝ leaves k + 1 components.Which of the following is a consequence of the Baire category theorem?
Show answer
Answer: A — a non-empty complete metric space with no isolated points is uncountable
If such a space were countable it would be the countable union of its singletons; each singleton is closed with empty interior (no isolated points), hence nowhere dense, contradicting Baire. The other three are Bolzano–Weierstrass, Heine–Cantor and Heine–Borel, which need no category argument.Which of the following functions are uniformly continuous on the stated domain?
Show answer
Answer: B — f(x) = √x on [0, ∞); D — f(x) = x sin(1/x) on (0, 1)
(1) No: with xₙ = n and yₙ = n + 1/n, |yₙ − xₙ| → 0 but |yₙ² − xₙ²| = 2 + 1/n². (2) Yes: |√x − √y| ≤ √|x − y|. (3) No: it has no continuous extension to [0, 1]. (4) Yes: setting f(0) = 0 and f(1) = sin 1 gives a continuous function on the compact [0, 1] (Heine–Cantor).The sequence x₀ = 1, xₙ₊₁ = 1 + 1/(1 + xₙ) converges. Its limit, correct to two decimal places, is ____.
Numerical answer — type the value.
Show answer
Answer: 1.41
T(x) = 1 + 1/(1 + x) maps [1, 2] into [4/3, 3/2] and |T′(x)| = 1/(1 + x)² ≤ 1/4 there, so T is a contraction of the complete space [1, 2] and the iterates converge to its fixed point: x(1 + x) = (1 + x) + 1 gives x² = 2, x = √2 = 1.414, i.e. 1.41.Let T(x) = (1 + x²)/4 on [0, 1], x₀ = 0 and xₙ₊₁ = T(xₙ). Using the a priori estimate d(xₙ, x∗) ≤ kⁿ d(x₁, x₀)/(1 − k) with the best Lipschitz constant k of T on [0, 1], the least n that guarantees d(xₙ, x∗) ≤ 10⁻³ is ____.
Numerical answer — type the value.
Show answer
Answer: 9
T′(x) = x/2, so k = sup |T′| = 1/2 on [0, 1], and T([0, 1]) = [1/4, 1/2] ⊆ [0, 1]. x₁ = 1/4, so the bound is (1/2)ⁿ(1/4)/(1/2) = (1/2)ⁿ⁺¹. We need 2ⁿ⁺¹ ≥ 1000: 2¹⁰ = 1024 works and 2⁹ = 512 does not, so n + 1 = 10 and n = 9.Which statements about fixed points are true?
Show answer
Answer: A — T(x) = x + 1/x on [1, ∞) satisfies |Tx − Ty| < |x − y| for x ≠ y and has no fixed point; B — T(x) = x/2 on (0, 1] is a contraction with no fixed point in (0, 1]; C — every contraction of a non-empty complete metric space has exactly one fixed point
(1) Tx − Ty = (x − y)(1 − 1/(xy)) with 0 ≤ 1 − 1/(xy) < 1, and x + 1/x = x is impossible; the ratio tends to 1, so no uniform k < 1 exists. (2) (0, 1] is not complete; the fixed point 0 is missing. (3) is Banach’s theorem. (4) is false: if T²x∗ = x∗ uniquely, then T²(Tx∗) = T(T²x∗) = Tx∗, so Tx∗ = x∗ and T has a (unique) fixed point.Which statement about f(x) = x² on ℝ is correct?
Show answer
Answer: A — f is continuous but not uniformly continuous on ℝ, though it is uniformly continuous on every bounded interval
On [−M, M], |x² − y²| ≤ 2M|x − y|, so f is Lipschitz there; on ℝ the slope 2x is unbounded and xₙ = n, yₙ = n + 1/n defeat every δ. Differentiability does not give uniform continuity. Cauchy sequences in ℝ are bounded and f is uniformly continuous on bounded sets, so it maps them to Cauchy sequences.