STEMviz
Mathematics · Real Analysis and Topology

Metric Spaces and the Topology of the Real Line

Introduces metric spaces, open and closed sets, limit points, closure, interior and sequential convergence, developing the topology of the real line from the distance function.

Metric Spaces and the Topology of the Real Line

Chapter 1 built R\mathbb{R} from its order and completeness. This chapter extracts a different piece of structure — distance — and studies what can be said using distance alone, in a setting general enough to include Rn\mathbb{R}^n, function spaces and the discrete two-point space on equal footing. The resulting notions of open set, closed set, limit point and convergence are the vocabulary for everything from here on: continuity (defined via open sets, not just ε\varepsilon–δ\delta), compactness (Chapter 3), and completeness in the general sense (Chapter 4).

Have to hand: the triangle inequality for ∣⋅∣|\cdot| on R\mathbb{R}, and comfort with quantifiers. We work mostly in R\mathbb{R} with its usual metric d(x,y)=∣x−y∣d(x,y)=|x-y|, but state every definition for a general metric space so that the pattern is visible from the start.

Why generalise at all? Once a theorem is proved using only the metric axioms (not the specific formula ∣x−y∣|x-y|), it is automatically true in Rn\mathbb{R}^n, in spaces of continuous functions, and anywhere else a metric is defined — without re-proving it. This is the entire payoff of the abstraction.

1. Metric Spaces: Definition and Examples

Definition. A metric on a set XX is a function d:X×X→Rd : X\times X \to \mathbb{R} satisfying, for all x,y,z∈Xx,y,z \in X:

  1. d(x,y)≥0d(x,y) \ge 0, with d(x,y)=0d(x,y) = 0 if and only if x=yx = y (positivity);
  2. d(x,y)=d(y,x)d(x,y) = d(y,x) (symmetry);
  3. d(x,z)≤d(x,y)+d(y,z)d(x,z) \le d(x,y) + d(y,z) (triangle inequality).

The pair (X,d)(X,d) is a metric space.

Examples.

  • R\mathbb{R} with d(x,y)=∣x−y∣d(x,y) = |x-y|: the triangle inequality here is the familiar ∣x−z∣≤∣x−y∣+∣y−z∣|x-z| \le |x-y|+|y-z|.
  • Rn\mathbb{R}^n with the Euclidean metric d(x⃗,y⃗)=∑i=1n(xi−yi)2d(\vec{x},\vec{y}) = \sqrt{\sum_{i=1}^n (x_i-y_i)^2}.
  • Any set XX with the discrete metric d(x,y)=0d(x,y) = 0 if x=yx=y and d(x,y)=1d(x,y)=1 otherwise. All three axioms are checked directly from the definition; this example shows a metric need carry no "geometric" content at all.

2. Open Balls and Open Sets

Definition. For x∈Xx\in X and r>0r>0, the open ball of radius rr about xx is B(x,r)={y∈X:d(x,y)<r}B(x,r) = \{y \in X : d(x,y) < r\}. A set U⊆XU \subseteq X is open if for every x∈Ux\in U there exists r>0r>0 with B(x,r)⊆UB(x,r)\subseteq U.

In R\mathbb{R}, B(x,r)=(x−r,x+r)B(x,r) = (x-r,x+r), so "open" recovers the familiar picture: every point of UU has some room around it still inside UU.

Worked example. Every open interval (a,b)(a,b) is open in R\mathbb{R}. Given x∈(a,b)x\in(a,b), let r=min⁡(x−a, b−x)>0r = \min(x-a,\,b-x) > 0. If y∈B(x,r)y\in B(x,r) then ∣y−x∣<r≤x−a|y-x|<r\le x-a gives y>x−(x−a)=ay > x - (x-a) = a, and ∣y−x∣<r≤b−x|y-x|<r\le b-x gives y<x+(b−x)=by < x+(b-x) = b; so B(x,r)⊆(a,b)B(x,r)\subseteq(a,b). Since xx was arbitrary, (a,b)(a,b) is open.

Theorem. (i) ∅\emptyset and XX are open. (ii) The union of any collection of open sets is open. (iii) The intersection of finitely many open sets is open.

Proof. (i) is immediate (∅\emptyset vacuously; XX since B(x,r)⊆XB(x,r)\subseteq X always). (ii) Let {Uα}α∈A\{U_\alpha\}_{\alpha\in A} be open and x∈⋃αUαx\in \bigcup_\alpha U_\alpha; then x∈Uα0x\in U_{\alpha_0} for some α0\alpha_0, and openness of Uα0U_{\alpha_0} gives r>0r>0 with B(x,r)⊆Uα0⊆⋃αUαB(x,r)\subseteq U_{\alpha_0}\subseteq\bigcup_\alpha U_\alpha. (iii) Let U1,…,UnU_1,\dots,U_n be open and x∈⋂i=1nUix\in\bigcap_{i=1}^n U_i. For each ii there is ri>0r_i>0 with B(x,ri)⊆UiB(x,r_i)\subseteq U_i; take r=min⁡(r1,…,rn)>0r=\min(r_1,\dots,r_n)>0 (a minimum of finitely many positive numbers is positive). Then B(x,r)⊆B(x,ri)⊆UiB(x,r)\subseteq B(x,r_i)\subseteq U_i for every ii, so B(x,r)⊆⋂iUiB(x,r)\subseteq\bigcap_i U_i. ■\blacksquare

Key distinction. Finiteness in (iii) is essential: ⋂n=1∞(−1n,1n)={0}\bigcap_{n=1}^{\infty}\left(-\frac1n,\frac1n\right) = \{0\}, an intersection of open sets that is not open (no ball around 00 fits inside {0}\{0\}). Infinite intersections of open sets can fail to be open.

3. Closed Sets

Definition. F⊆XF\subseteq X is closed if its complement X∖FX\setminus F is open.

Theorem (De Morgan dual of the open-set theorem). (i) ∅\emptyset and XX are closed. (ii) The intersection of any collection of closed sets is closed. (iii) The union of finitely many closed sets is closed.

Proof. Apply De Morgan's laws to the open-set theorem: X∖⋂αFα=⋃α(X∖Fα)X\setminus\bigcap_\alpha F_\alpha = \bigcup_\alpha(X\setminus F_\alpha) is a union of open sets, hence open, so ⋂αFα\bigcap_\alpha F_\alpha is closed; similarly X∖⋃i=1nFi=⋂i=1n(X∖Fi)X\setminus\bigcup_{i=1}^n F_i = \bigcap_{i=1}^n (X\setminus F_i) is a finite intersection of open sets, hence open. ■\blacksquare

Closed and open are not opposites in the everyday sense: a set can be both (∅\emptyset and XX always are), and a set can be neither, e.g. [0,1)⊆R[0,1)\subseteq\mathbb{R} is neither open (no ball around 00 fits inside) nor closed (its complement (−∞,0)∪[1,∞)(-\infty,0)\cup[1,\infty) is not open, since no ball around 11 fits inside the complement).

4. Limit Points and Closure

Definition. x∈Xx\in X is a limit point (accumulation point) of S⊆XS\subseteq X if every open ball B(x,r)B(x,r), r>0r>0, contains a point of SS other than xx itself. A point s∈Ss\in S that is not a limit point of SS is an isolated point of SS.

Note a limit point of SS need not belong to SS. The closure S‾=S∪{limit points of S}\overline{S} = S \cup \{\text{limit points of } S\}.

Theorem. S‾\overline S is the smallest closed set containing SS; equivalently, S‾=⋂{F:F closed, S⊆F}\overline S = \bigcap \{F : F \text{ closed},\ S\subseteq F\}.

Proof sketch. First, S‾\overline{S} is closed: if x∉S‾x\notin\overline S, then x∉Sx\notin S and xx is not a limit point of SS, so some B(x,r)B(x,r) contains no point of SS other than xx — but x∉Sx\notin S, so B(x,r)∩S=∅B(x,r)\cap S=\emptyset. For y∈B(x,r)y\in B(x,r), openness of balls gives a smaller ball around yy still inside B(x,r)B(x,r), hence still missing SS, so y∉S‾y\notin\overline S either (no point of that smaller ball lies in SS, ruling out both membership and limit-point status). Thus B(x,r)⊆X∖S‾B(x,r)\subseteq X\setminus\overline S, proving X∖S‾X\setminus \overline S open. Second, any closed F⊇SF\supseteq S must contain every limit point of SS (if xx were a limit point of SS outside FF, the open set X∖FX\setminus F would be a ball-free neighbourhood of xx missing SS entirely near xx, contradicting xx being a limit point), so F⊇S‾F \supseteq \overline S. Hence S‾\overline S is the least closed superset. ■\blacksquare

Worked example. Q‾=R\overline{\mathbb{Q}} = \mathbb{R}. Every x∈Rx\in\mathbb{R} is a limit point of Q\mathbb{Q}: given r>0r>0, density of Q\mathbb{Q} (Chapter 1) gives a rational in (x−r,x+r)∖{x}(x-r,x+r)\setminus\{x\} unless xx itself is rational, in which case density applied to (x,x+r)(x, x+r) still gives a rational distinct from xx inside B(x,r)B(x,r). So every real is in Q\mathbb{Q} or a limit point of it, giving Q‾=R\overline{\mathbb{Q}}=\mathbb{R} — a set can have closure equal to the entire space while being "small" in other senses (countable, as here).

5. Interior and Boundary

Definition. The interior S∘S^{\circ} is the set of x∈Sx\in S for which some B(x,r)⊆SB(x,r)\subseteq S. The boundary ∂S=S‾∖S∘\partial S = \overline S \setminus S^{\circ}.

SS is open iff S=S∘S = S^{\circ}; SS is closed iff S=S‾S = \overline S. For S=(a,b]S=(a,b] in R\mathbb{R}: S∘=(a,b)S^{\circ}=(a,b) (the point bb has no ball of any radius fitting inside SS, since points just above bb are excluded), S‾=[a,b]\overline S = [a,b], and ∂S={a,b}\partial S = \{a,b\}.

6. Convergence of Sequences in a Metric Space

Definition. A sequence (xn)(x_n) in (X,d)(X,d) converges to x∈Xx\in X, written xn→xx_n \to x, if for every ε>0\varepsilon>0 there exists N∈NN\in\mathbb{N} such that d(xn,x)<εd(x_n,x)<\varepsilon for all n≥Nn\ge N. Equivalently, every open ball B(x,ε)B(x,\varepsilon) contains all but finitely many terms of the sequence.

Theorem (uniqueness of limits). If xn→xx_n\to x and xn→x′x_n\to x', then x=x′x=x'.

Proof. Suppose x≠x′x\ne x'; let ε=d(x,x′)/2>0\varepsilon = d(x,x')/2 > 0 (positive by the positivity axiom, since x≠x′x\ne x'). Choose N1N_1 with d(xn,x)<εd(x_n,x)<\varepsilon for n≥N1n\ge N_1, and N2N_2 with d(xn,x′)<εd(x_n,x')<\varepsilon for n≥N2n\ge N_2. For n≥max⁡(N1,N2)n\ge\max(N_1,N_2), the triangle inequality gives d(x,x′)≤d(x,xn)+d(xn,x′)<ε+ε=d(x,x′)d(x,x') \le d(x,x_n)+d(x_n,x') < \varepsilon+\varepsilon = d(x,x'), a contradiction. ■\blacksquare

Theorem. xx is a limit point of SS if and only if there is a sequence (xn)(x_n) in S∖{x}S\setminus\{x\} with xn→xx_n\to x.

Proof sketch. (⇐\Leftarrow) If such a sequence exists, every B(x,r)B(x,r) eventually contains terms xn≠xx_n\ne x by convergence, so it contains a point of SS other than xx. (⇒\Rightarrow) If xx is a limit point, for each n∈Nn\in\mathbb{N} apply the definition with r=1/nr=1/n to choose xn∈B(x,1/n)∩Sx_n\in B(x,1/n)\cap S, xn≠xx_n\ne x; then d(xn,x)<1/n→0d(x_n,x)<1/n\to0, so xn→xx_n\to x by the Archimedean property. ■\blacksquare

This reformulation is why many topology proofs in this course can be carried out with sequences, and will be used constantly from Chapter 3 onward.

7. Equivalent Metrics

Two metrics d1,d2d_1,d_2 on XX are (topologically) equivalent if they generate the same open sets. This can happen even when d1≠d2d_1\ne d_2 as functions: on Rn\mathbb{R}^n, the Euclidean metric and the "taxicab" metric d1(x⃗,y⃗)=∑i∣xi−yi∣d_1(\vec x,\vec y)=\sum_i|x_i-y_i| generate the same open sets, because each metric ball contains and is contained in a ball of the other metric (with different radii) — a fact used freely in later multivariable chapters to pass between coordinate estimates and geometric ones without comment.

Common Exam Pitfalls

  • Writing "closed" to mean "not open". These are independent properties: [0,1)[0,1) is neither, and ∅,X\emptyset,X are both. Always check the actual definitions, never infer one from the failure of the other.
  • Forgetting finiteness in the intersection-of-opens theorem. ⋂n(−1/n,1/n)={0}\bigcap_n(-1/n,1/n)=\{0\} is the standard counterexample when infinitely many open sets are intersected.
  • Confusing limit point with element of the set. A limit point of SS need not lie in SS (e.g. every point of Q‾∖Q\overline{\mathbb Q}\setminus\mathbb Q is a limit point of Q\mathbb Q not in Q\mathbb Q); conversely an element of SS need not be a limit point (isolated points).
  • Asserting S‾=S\overline{S} = S whenever SS "looks closed". Always verify via the actual limit-point definition or by checking the complement is open; intuition about "edges" can mislead for unusual sets like Q\mathbb{Q}.
  • Treating metric equivalence as requiring d1=d2d_1=d_2. Equivalent metrics only need to produce the same open sets; the distance values themselves can differ substantially (even by unbounded ratios in general, though not in the taxicab/Euclidean example).
  • Dropping symmetry or the strict "iff" in positivity when verifying a candidate is a metric. All three axioms must be checked; a function satisfying symmetry, the triangle inequality and d(x,x)=0d(x,x)=0 (without ruling out d(x,y)=0d(x,y)=0 for x≠yx\ne y) is a pseudometric, not a metric.

Summary

  • A metric space (X,d)(X,d) satisfies positivity (d(x,y)=0  ⟺  x=yd(x,y)=0\iff x=y), symmetry, and the triangle inequality.
  • Open ball: B(x,r)={y:d(x,y)<r}B(x,r)=\{y:d(x,y)<r\}; open set: every point has a ball fitting inside it.
  • Arbitrary unions and finite intersections of open sets are open; by complementation, arbitrary intersections and finite unions of closed sets are closed.
  • Limit point of SS: every ball around it meets SS at a point other than itself; closure S‾=S∪{limit points}\overline S = S\cup\{\text{limit points}\} is the smallest closed set containing SS.
  • Interior S∘S^\circ: points with a ball entirely inside SS; boundary ∂S=S‾∖S∘\partial S = \overline S\setminus S^\circ.
  • Convergence: xn→xx_n\to x iff ∀ε>0 ∃N: n≥N⇒d(xn,x)<ε\forall\varepsilon>0\ \exists N:\ n\ge N\Rightarrow d(x_n,x)<\varepsilon; limits are unique, proved via the triangle inequality.
  • xx is a limit point of SS iff some sequence in S∖{x}S\setminus\{x\} converges to xx — the bridge between topological and sequential language used throughout the rest of the course.
  • Equivalent metrics generate the same open sets without needing to be numerically equal.