Altanis

7.2Compactness in Metric Spaces

Updated 31 Aug 2026Chapter (PDF)

We have already shown a plethora of equivalences of compactness in metric spaces. Namely, being compact, sequentially compact, limit point compact, and having the finite intersection property are all equivalent in metric spaces.

Immediately, we note that compact metric spaces are complete. Indeed, compactness is equivalent with sequential compactness and so Cauchy sequences have convergent subsequences, so the space is complete. Complete metric spaces are not automatically compact, however (consider R\bR). We seek to find a condition on metric spaces that, together with completeness, is equivalent to compactness.

[7.2.1]Definition(Total Boundedness)#

A metric space (X,d)(X, d) is said to be totally bounded if, for any ε>0\epsilon > 0, there exist finitely many ε\epsilon-balls that cover XX.

[7.2.2]Remark(Total Boundedness and Boundedness)#

Note that any totally bounded space is bounded. Indeed, choose ε=1/2\epsilon = 1/2 such that {B(xk,1/2)}k=1n\{B(x_k, 1/2)\}_{k = 1}^n covers the entire space. From this, we have that 1+max{d(xi,xj)}i,j=0n1 + \max\{d(x_i, x_j)\}_{i, j = 0}^n is an upper bound on the diameter of the space, implying it is bounded. Bounded spaces are not totally bounded, though. R\bR is bounded under the standard bounded metric d(x,y)=min{1,xy}\bar{d}(x, y) = \min\{1, |x - y|\}, but is not totally bounded (a countably infinite number of balls of radius 1\le 1 would be needed to cover R\bR).

Take the metric d(x,y)=xyd(x, y) = |x - y| and the space R\bR. It is complete but not totally bounded. Now consider (1,1)(-1, 1). It is totally bounded but not complete. Finally, note that [1,1][-1, 1] is both complete and totally bounded.

The example from before illustrates an example of a crucial theorem. A metric space is compact if and only if it is complete and totally bounded. Note this resembles the theorem in R\bR that a set is compact iff closed (i.e., complete) and bounded (i.e., totally bounded).

[7.2.3]Theorem(Heine-Borel for Metric Spaces)#

A metric space is compact if and only if it is complete and totally bounded.

Proof.

()(\Longrightarrow): Suppose XX is compact. Then XX is sequentially compact, meaning any Cauchy sequence admits a convergent subsequence, making XX complete. Moreover, for any ε>0\epsilon > 0, the open cover {B(x,ε)}xX\{B(x, \epsilon)\}_{x \in X} has a finite subcover {B(xk,ε)}k=1n\{B(x_k, \epsilon)\}_{k = 1}^n, making XX totally bounded.

()(\Longleftarrow): Suppose XX is complete and totally bounded. Let (xn)X(x_n) \subseteq X be any sequence. Since XX is totally bounded, there exists a finite set of balls {B(xk,1)}k=1n\{B(x^k, 1)\}_{k = 1}^n such that xnk=1nB(xk,1)x_n \in \bigcup_{k = 1}^n B(x^k, 1) for every nZ+n \in \bZ_+. By pigeonhole, there exists some j{1,,n}j \in \{1, \dots, n\} such that infinitely many points of the sequence lie in B(xj,1)B(x^j, 1). Choose a single point in the ball from this sequence and label it xn1x_{n_1}. Now note we may partition the ball B(xj,1)B(x^j, 1) by finitely many balls of radius 1/21/2, find infinitely many points of xnx_n inside one of these balls, and label it xn2x_{n_2} (such that n2>n1n_2 > n_1). Repeat this for ball of radius 1/41/4 and choosing xn3x_{n_3} (such that n3>n2>n1n_3 > n_2 > n_1), and by induction, choose xnkx_{n_k} through the ball of radius 1/2k11/2^{k - 1} (such that nkn_k is greater than all previous choices). Since 1/2k101/2^{k - 1} \to 0, we have that there exists some NZ+N \in \bZ_+ such that d(xnj,xnk)<εd(x_{n_j}, x_{n_k}) < \epsilon for every j,kNj, k \ge N. Thus any sequence xnx_n has a Cauchy subsequence, and since XX is complete, it is convergent. Thus XX is sequentially compact and thus compact.

The goal for the rest of this section is to characterize the compact subsets of (C(X,Rn),ρ)(C(X, \bR^n), \rho), the metric space of continuous maps from a topological space XX to Rn\bR^n together with the sup metric. We use the result from before to identify compact subsets, culminating into what is known as the Arzela-Ascoli theorem. This theorem characterizes all compact subsets of C(X,Rn)C(X, \bR^n) with the sup metric as precisely the subsets that are closed, uniformly bounded, and equicontinuous.

[7.2.4]Definition(Equicontinuity)#

Suppose XX is a topological space and (Y,d)(Y, d) is a metric space. Let F\mathcal{F} be a family of functions XYX \to Y. For any x0Xx_0 \in X, we say the family F\mathcal{F} is equicontinuous at x0x_0 if, for any ε>0\epsilon > 0, there exists a single neighborhood UXU \subseteq X of x0x_0 such that, for every xXx \in X and fFf \in \mathcal{F},

d(f(x),f(x0))<ε.d(f(x), f(x_0)) < \epsilon.

If F\mathcal{F} is equicontinuous at all points in XX, we say the family is simply equicontinuous.

Recall that for ff to be continuous at x0x_0, we need that for any ε>0\epsilon > 0 there exists an open neighborhood UU of x0x_0 such that

d(f(x),f(x0))<εd(f(x), f(x_0)) < \epsilon

for every xUx \in U. Compare this to equicontinuity: for F\mathcal{F} to be equicontinuous at x0x_0, we need this relation to hold for every fFf \in \mathcal{F} for only one UU. Note that if XX is metric, then the open neighborhood UU of x0x_0 would just be a δ\delta-neighborhood.

[7.2.5]Theorem#

Suppose XX is a topological space and (Y,d)(Y, d) a metric space. If FC(X,Y)\mathcal{F} \subseteq C(X, Y) is totally bounded under the uniform metric ρ\bar{\rho}, then it is equicontinuous under the metric dd.

Proof.

Suppose F\mathcal{F} is totally bounded. Fix x0Xx_0 \in X and ε(0,1)\epsilon \in (0, 1). We seek to show there exists a neighborhood UU of x0x_0 such that d(f(x),f(x0))<εd(f(x), f(x_0)) < \epsilon for every xUx \in U and fFf \in \mathcal{F}. Since ε<1\epsilon < 1, we use dd and d\bar{d} interchangeably, for they are equivalent.

Let δ=ε/3\delta = \epsilon/3. Since F\mathcal{F} is totally bounded, note there exists finitely many open balls {Bρ(fk,δ)}k=1n\{B_{\bar{\rho}}(f_k, \delta)\}_{k = 1}^n from C(X,Y)C(X, Y) that covers F\mathcal{F}. Note that each fkf_k is continuous, and so we can choose an open neighborhood UU of x0x_0, we have that

d(fk(x),fk(x0))<εd(f_k(x), f_k(x_0)) < \epsilon

for every xUx \in U and k{1,,n}k \in \{1, \dots, n\}.

Fix any fFf \in \mathcal{F}. From the finite covering of F\mathcal{F}, choose some fkf_k such that ρ(f,fk)<δ\bar{\rho}(f, f_k) < \delta. Finally, note

d(f(x),f(x0))d(f(x),fk(x))+d(fk(x),fk(x0))+d(fk(x0),f(x0))3δ=3ε/3=ε.\begin{align*} d(f(x), f(x_0)) &\le d(f(x), f_k(x)) + d(f_k(x), f_k(x_0)) + d(f_k(x_0), f(x_0)) \\ &\le 3\delta = 3\epsilon/3 = \epsilon. \end{align*}

We get this relationship from the fact that d(f(),fk())<ρ(f,fk)<δd(f(*), f_k(*)) < \bar{\rho}(f, f_k) < \delta, as well as how we chose UU. If ε>1\epsilon > 1, then just apply the same procedure to some ε<1<ε\epsilon' < 1 < \epsilon. Thus F\mathcal{F} is equicontinuous.

[7.2.6]Theorem#

Suppose XX is a topological space and (Y,d)(Y, d) is a metric space. If FC(X,Y)\mathcal{F} \subseteq C(X, Y) is equicontinuous under dd, as well as XX and YY being compact, we have that F\mathcal{F} is totally bounded under the uniform and sup metrics.

In sum, if FC(X,Y)\mathcal{F} \subseteq C(X, Y) is totally bounded it is equicontinuous, and if it is equicontinuous (together with X,YX, Y compact) it is totally bounded.

[7.2.7]Definition(Pointwise Bounded)#

Suppose XX is a topological space and (Y,d)(Y, d) is a metric space. A family of functions FC(X,Y)\mathcal{F} \subseteq C(X, Y) is said to be pointwise bounded under dd if, for each aXa \in X, the set {f(a):fF}\{f(a): f \in \mathcal{F}\} is bounded under dd.

[7.2.8]Definition(Uniformly Bounded)#

Suppose XX is a topological space and (Y,d)(Y, d) is a metric space. A family of functions FC(X,Y)\mathcal{F} \subseteq C(X, Y) is said to be uniformly bounded under dd if there exists a point y0Yy_0 \in Y and a real number M>0M > 0 such that

d(f(x),y0)Md(f(x), y_0) \le M

for every xXx \in X and fFf \in \mathcal{F}. If YY is a normed space such as Rn\bR^n, this is equivalent to saying there is some M>0M > 0 such that f(x)M\norm{f(x)} \le M for all xXx \in X and fFf \in \mathcal{F}. Note that F\mathcal{F} is uniformly bounded under dd if and only if F\mathcal{F} is bounded as a subset of C(X,Y)C(X, Y) under the sup metric ρ\rho.

[7.2.9]Theorem(Arzela-Ascoli Theorem)#

Let XX be a compact space and Rn\bR^n Euclidean space together with either the Euclidean or square metric. Give C(X,Rn)C(X, \bR^n) the corresponding sup metric. A subspace FC(X,Rn)\mathcal{F} \subseteq C(X, \bR^n) has compact closure if and only if it is equicontinuous and pointwise bounded under Rn\bR^n's metric.

[7.2.10]Theorem(Arzela-Ascoli Theorem)#

Let XX be a compact space and Rn\bR^n Euclidean space together with either the Euclidean or square metric. Give C(X,Rn)C(X, \bR^n) the corresponding sup metric. A subspace FC(X,Rn)\mathcal{F} \subseteq C(X, \bR^n) is compact if and only if it is closed, bounded under the sup metric, and equicontinuous under Rn\bR^n's metric.

[7.2.11]Remark#

The entirety of this section is dedicated to answering one question: what does a compact set look like in an infinite-dimensional function space? In finite dimensions (Rn\bR^n), Heine-Borel tells us that a set is compact if and only if it is closed and bounded. In infinite dimensions, this fails; a sequence of functions bounded between 1-1 and 11 can oscillate infinitely fast, never converging to anything.

To fix this, we look to metric spaces in general: a space is compact if and only if it is complete and totally bounded. We simply translate these two topological conditions into analytic conditions for functions. Because the uniform metric space C(X,Rn)C(X, \bR^n) is already complete, demanding that a subspace F\mathcal{F} be complete is exactly equivalent to demanding that F\mathcal{F} be closed. Thus our task boils down to finding an analytic condition on functions that is equivalent to total boundedness. Indeed, we proved lemmas that if a family of functions can be covered by finitely many ε\epsilon-balls (total boundedness), it is forced to be equicontinuous, which prevents the functions from oscillating wildly. This is an equivalence (i.e., the converse is true) if the domain and codomain of these functions are compact.

We are not done yet, however. To characterize the compact subsets of C(X,Rn)C(X, \bR^n), we cannot directly use this equivalence between total boundedness and equicontinuity. Indeed, the codomain Rn\bR^n is not compact. This is why pointwise boundedness is introduced.

Suppose F\mathcal{F} is pointwise bounded and equicontinuous and XX is compact. We show these conditions force the family to be uniformly bounded. For each aXa \in X, equicontinuity gives an open neighborhood UaU_a of aa such that d(f(x),f(a))<1d(f(x), f(a)) < 1 for every xUax \in U_a and fFf \in \mathcal{F}. Since F\mathcal{F} is pointwise bounded, we have that d(f(a),0)Mad(f(a), \vb{0}) \le M_a for each aXa \in X. Then for any xUax \in U_a and any fFf \in \mathcal{F}, note that

d(f(x),0)d(f(x),f(a))+d(f(a),0)<1+Ma.d(f(x), \vb{0}) \le d(f(x), f(a)) + d(f(a), \vb{0}) < 1 + M_a.

Thus each fFf \in \mathcal{F} is bounded in each UaU_a. Since {Ua}aX\{U_a\}_{a \in X} is an open cover for XX and XX is compact, there is a finite subcover {Ua1,,Uak}\{U_{a_1}, \dots, U_{a_k}\}. Simply choose the maximum of the upper bounds (Maj+1)(M_{a_j} + 1) from this finite collection, and this is what every function is bounded above by on all of XX. Thus F\mathcal{F} is uniformly bounded.

This guarantees that the images of all functions in F\mathcal{F} lie inside a finite-radius closed ball in Rn\bR^n. By the standard Heine-Borel theorem for Euclidean space, this closed ball is compact. Thus, enforcing F\mathcal{F} to be pointwise bounded gives us an easy route to equate total boundedness and equicontinuity, since the images of these functions all lie in a compact codomain. Assembling the pieces: F\mathcal{F} is equicontinuous and pointwise bounded if and only if it is totally bounded, which together with the completeness of C(X,Rn)C(X, \bR^n) characterizes the subspaces with compact closure. This is the first version of the theorem.

The two versions of the Arzela-Ascoli theorem state the exact same mathematical fact. Note that in any metric space, a set AA is compact if and only if it is closed and its closure A\bar{A} is compact.

The first version tells us exactly when the closure F\bar{\mathcal{F}} is compact (when F\mathcal{F} is equicontinuous and pointwise bounded). The second version simply adds the “closed” requirement to the checklist so that F=F\mathcal{F} = \bar{\mathcal{F}}, meaning F\mathcal{F} itself is compact.

Furthermore, the first version requires the weaker condition of pointwise boundedness, while the second version requires boundedness under the sup metric, i.e.uniform boundedness. This is a free upgrade: if a family of functions is equicontinuous and pointwise bounded on a compact domain, it is automatically uniformly bounded, as shown above. The first version is often preferred in practice because checking pointwise bounds is algebraically much easier than proving uniform bounds.