2 Compact Metric Spaces

A metric is the least structure on which a limit can be defined: a rule giving the distance between two points, subject to four requirements. Everything in this section is an attempt to say which metric spaces behave like closed bounded intervals of \(\mathbb {R}\).

The section develops the vocabulary first — open and closed sets, limits and limit points, countability, order — and then the three descriptions of compactness: every open cover has a finite subcover, every sequence has a convergent subsequence, and totally bounded together with complete. In a metric space these three say the same thing, and the proof that they do is the centre of the section. The Heine–Borel theorem is the separate statement that in \(\mathbb {R}^n\), and only in spaces like it, compactness amounts to nothing more than being closed and bounded.

The pay-off is at the end. On a compact space a continuous function is automatically uniformly continuous and attains its bounds, which are exactly the facts that make the fixed point argument of Section 3 work.

Definition 2.1. Let \(X\) be a non-empty set, a mapping \(d:X\times X\rightarrow \mathbb {R}\) which satisfies the following for all \(x,y,z\in X\):

i
\(d(x,y)\geq 0\)
ii
\(d(x,y)=0\) if and only if \(x=y\)
iii
\(d(x,y)=d(y,x)\)
iv
\(d(x,z)\leq d(x,y)+d(y,z)\) (triangle inequality)

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

Example 2.2. The function \(d(x,y)=|x-y|\) defines a metric on \(\mathbb {R}\). This is called the usual metric on \(\mathbb {R}\).

Proof. By definition, the absolute value on \(\mathbb {R}\) is non-negative. Therefore \(\hspace {0.3cm} d(x,y)=|x-y|\geq 0\).

Now, since \(|x-y|=0\) if and only if \(x=y\). It follows that \(d(x,y)=0\) if and only if \(x=y\).

To verify the third axiom, we have \(\hspace {0.3cm} d(x,y)=|x-y|=|-(y-x)|=|y-x|=d(y,x)\).
To verify the triangle inequality, suppose that \(x,y,z\in \mathbb {R}\) then \begin {align*} d(x,z) &=|x-z|=|x-y+y-z|\\ &\leq |x-y|+|y-z|\\ &=d(x,y)+d(y,z) \end {align*}

Hence \((\mathbb {R},d)\) is a metric space. □

Example 2.3. \(\mathbb {C}\), the set of complex numbers with the function \(d(u,v)=|u-v|\) for \(u,v\in \mathbb {C}\).

Proof.

i
\begin {align*} d(u,v) &=|(u_1+iu_2)-(v_1+iv_2)| =|(u_1-v_1)+i(u_2-v_2)|\\ &=\sqrt {(u_1-v_1)^2+(u_2-v_2)^2}\geq 0 \end {align*}
ii
\(\hspace {0.2cm} d(u,v)=|u-v|=0\iff u_1-v_1=0, u_2-v_2=0\implies u_1=v_1,u_2=v_2\implies u=v\)
iii
\begin {align*} d(u,v) &=|(u_1+iu_2)-(v_1+iv_2)| =|-((v_1+iv_2)-(u_1+iu_2))|\\ &=|(v_1+iv_2)-(u_1+iu_2)|\\ &=d(v,u) \end {align*}
iv
Let \(u,v,w\in \mathbb {C}\),then \begin {align*} d(u,w) &=|(u_1+iu_2)-(w_1+iw_2)|\\ &=|(u_1+iu_2)-(v_1+iv_2)+(v_1+iv_2)-(w_1+iw_2)|\\ &\leq |(u_1+iu_2)-(v_1+iv_2)|+|(v_1+iv_2)-(w_1+iw_2)|\\ &=d(u,v)+d(v,w) \end {align*}

Hence \((\mathbb {C},d)\) is a metric space. □

Example 2.4. If \(x=(x_1,x_2),y=(y_1,y_2)\) in \(\mathbb {R}^2\) we define \(d:\mathbb {R}^2\times \mathbb {R}^2\rightarrow \mathbb {R}\) by \[d(x,y)=\max \{|x_1-y_1|,|x_2-y_2|\}\]

Proof. If \(x=(x_1,x_2),y=(y_1,y_2)\in \mathbb {R}^2\), we see that \(|x_1-y_1|\geq 0\) and \(|x_2-y_2|\geq 0\) so that \[d(x,y)=\max \{|x_1-y_1|,|x_2-y_2|\}\geq 0.\] Also, \(\max \{|x_1-y_1|,|x_2-y_2|\}=0\) if and only if \(|x_1-y_1|=0\) and \(|x_2-y_2|=0\), which means that \(\max \{|x_1-y_1|,|x_2-y_2|\}=0\) if and only if \(x_1=y_1\) and \(x_2=y_2\). Thus \(d(x,y)=0\) if and only if \(x=y\).

We show that \(d(x,y)=d(y,x)\). Since \(\max \{|x_1-y_1|,|x_2-y_2|\}=\max \{|y_1-x_1|,|y_2-x_2|\}\), we have that \(d(x,y)=d(y,x)\).

To show the triangle inequality holds, let \(x=(x_1,x_2), y=(y_1,y_2), z=(z_1,z_2)\in \mathbb {R}^2\). Then \begin {align*} d(x,z) &=\max \{|x_1-z_1|,|x_2-z_2|\}\\ &=\max \{|x_1-y_1+y_1-z_1|,|x_2-y_2+y_2-z_2|\}\\ &\leq \max \{|x_1-y_1|+|y_1-z_1|,|x_2-y_2|+|y_2-z_2|\}\\ &\leq \max \{|x_1-y_1|,|x_2-y_2|\}+\max \{|y_1-z_1|,|y_2-z_2|\}\\ &=d(x,y)+d(y,z). \end {align*}

Hence \((\mathbb {R}^2,d)\) is a metric space. □

Example 2.5. Let \(x=(x_1,x_2)\), \(y=(y_1,y_2)\in \mathbb {R}^2\) and define \(d:\mathbb {R}^2\times \mathbb {R}^2\rightarrow \mathbb {R}\) by \[d(x,y)=|x_1-y_1|+|x_2-y_2| .\] Check whether \((\mathbb {R}^2,d)\) is a metric space.

Solution. All four axioms must be checked. Write \(z=(z_1,z_2)\) for a third point.

Non-negativity

Each term is an absolute value, so \(d(x,y)\geq 0\) always.

\(d(x,y)=0\) if and only if \(x=y\)

A sum of two non-negative numbers is zero only if both are, so \(d(x,y)=0\) forces \(|x_1-y_1|=0\) and \(|x_2-y_2|=0\), that is \(x_1=y_1\) and \(x_2=y_2\), which is \(x=y\). Conversely \(d(x,x)=0+0=0\).

Symmetry

\(|a-b|=|b-a|\) for real \(a,b\), so \[d(x,y)=|x_1-y_1|+|x_2-y_2|=|y_1-x_1|+|y_2-x_2|=d(y,x).\]

Triangle inequality

Apply the triangle inequality for real numbers to each coordinate: \[|x_i-z_i|\leq |x_i-y_i|+|y_i-z_i|,\qquad i=1,2 .\] Adding the two, \[d(x,z)=\sum _{i=1}^{2}|x_i-z_i| \leq \sum _{i=1}^{2}|x_i-y_i|+\sum _{i=1}^{2}|y_i-z_i|=d(x,y)+d(y,z).\]

All four hold, so \((\mathbb {R}^2,d)\) is a metric space. This \(d\) is the taxicab metric: it measures distance as a car would travel on a square grid, and it is genuinely different from the Euclidean metric — the points at distance \(1\) from the origin form a diamond, not a circle.

Example 2.6.

1.
The set \(\mathbb {R}^2\) of ordered pairs \((x_1,x_2)\in \mathbb {R}^2\). The metric defined by \[d(x,y)=\sqrt {(x_1-y_1)^2+(x_2-y_2)^2}\] Where \(x=(x_1,x_2), y=(y_1,y_2)\in \mathbb {R}^2\). Check if \((\mathbb {R}^2,d)\) is a metric space.
2.
If \(x=(x_1,x_2,\dots ,x_n)\), \(y=(y_1,y_2,\dots ,y_n)\) are two points in \(\mathbb {R}^n\) define a metric as follows \(d:\mathbb {R}^n\times \mathbb {R}^n\rightarrow \mathbb {R}\) as \[d(x,y)=\sqrt {(x_1-y_1)^2+(x_2-y_2)^2+\cdots +(x_n-y_n)^2}=\Bigg [\sum ^n_{i=1}(x_i-y_i)^2\Bigg ]^{\frac {1}{2}}\] The space \((\mathbb {R}^n,d)\) is a metric space.
3.
If \(p\geq 1\) and \(x=(x_1,x_2,\dots ,x_n)\) and \(y=(y_1,y_2,\dots ,y_n)\) be any two elements of the space \(l_p^n\), define the metric \(d:l_p^n\times l_p^n\rightarrow \mathbb {R}\) as follows \[d(x,y)=\Bigg [\sum ^n_{i=1}|x_i-y_i|^p\Bigg ]^{\frac {1}{p}}\] Prove that \(l^n_p\) with this metric is a metric space.

Solution. In each case the first three axioms are immediate and the triangle inequality is the one that needs an argument.

1. The Euclidean metric on \(\mathbb {R}^2\)

Non-negativity holds because a square root of a sum of squares is non-negative, and \(d(x,y)=0\) forces \((x_1-y_1)^2+(x_2-y_2)^2=0\), hence \(x_1=y_1\) and \(x_2=y_2\). Symmetry holds because \((x_i-y_i)^2=(y_i-x_i)^2\). For the triangle inequality put \(u=x-y\) and \(v=y-z\); then \(x-z=u+v\) and the claim is \(||u+v||\leq ||u||+||v||\), which follows from the Cauchy–Schwarz inequality: \[||u+v||^2=||u||^2+2u\cdot v+||v||^2\leq ||u||^2+2||u||\,||v||+||v||^2 =\big (||u||+||v||\big )^2 .\] So \((\mathbb {R}^2,d)\) is a metric space.

2. The Euclidean metric on \(\mathbb {R}^n\)

Every step above is written without reference to the number of coordinates, so the same argument applies verbatim with sums running to \(n\).

3. The space \(l_p^n\)

Here the triangle inequality \[\left [\sum _{i=1}^{n}|x_i-z_i|^p\right ]^{\frac 1p}\leq \left [\sum _{i=1}^{n}|x_i-y_i|^p\right ]^{\frac 1p}+ \left [\sum _{i=1}^{n}|y_i-z_i|^p\right ]^{\frac 1p}\] is exactly Minkowski’s inequality, proved in Section 1, applied to the \(n\)-tuples \(x-y\) and \(y-z\). The other three axioms are as before. Note that \(p\geq 1\) is needed: for \(p<1\) Minkowski’s inequality reverses, and the \(l_{1/2}\) counterexample of Section 1 shows the triangle inequality genuinely fails.

Case 2 is the special case \(p=2\) of case 3, so the three examples are one theorem seen at three levels of generality.

Questions on this section

Stuck on something here? Ask below and it stays attached to this topic.