10b. Compact sets
Moving ahead now, at a more subtle level, again in analogy with what we know about [math]X=\mathbb R,\mathbb C[/math], we can talk about compact sets, and about connected sets. Again things here are quite tricky, in the general metric space framework, actually substantially deviating from what we know, and we will do this in detail. Let us start with:
A set [math]K\subset X[/math] is called compact if any cover with open sets
This definition might seem overly abstract, and perhaps even sound like a joke, but our claim is that this is the correct definition, and that there is no way of doing otherwise. Let us start with some examples, with [math]X=\mathbb R[/math]. The situation here is as follows:
(1) A point is obviously compact, and we can choose that finite subcover with [math]n=1[/math]. Similarly, 2 points are compact, and we can choose the subcover with [math]n=2[/math]. More generally, [math]N[/math] points are compact, and we can choose the subcover with [math]n=N[/math].
(2) In contrast, the set [math]\mathbb N\subset\mathbb R[/math] is not compact, because the following open cover of it obviously has no finite subcover:
Similarly, the set [math]\{1/n|n\in\mathbb N\}[/math] is not compact either, with a similar cover, consisting of a suitable union of open intervals around each point, doing the job.
(3) However, and here comes an interesting point, the following set is compact:
Indeed, any open cover of it [math]\cup_iE_i[/math] has to cover 0, and by selecting an open set [math]E_i[/math] covering 0, this set [math]E_i[/math] will cover the whole [math]K[/math], except for finitely many points, due to [math]1/n\to0[/math]. But these finitely points left, say [math]N[/math] of them, can be covered by suitable sets [math]E_{i_1},\ldots,E_{i_N}[/math], and by adding to this family the set [math]E_i[/math], we have our finite subcover.
As a conclusion to this, Definition 10.11 seems to be in tune with what we know about the compact subsets [math]K\subset\mathbb R[/math], namely that these are the sets which are closed and bounded. However, and here comes our point, such things are wrong in general, due to:
Given an infinite set [math]X[/math] with the discrete distance on it, namely [math]d(p,q)=1-\delta_{pq}[/math], this can be modeled as the basis of a suitable Hilbert space,
Here the first part, regarding the modeling of [math]X[/math], that we will actually not really need, is something that we already know. Regarding now the second part:
(1) [math]X[/math] being the total space, it is by definition closed. As a remark here, that we will need later, since the points of [math]X[/math] are obviously open, any subset [math]E\subset X[/math] is open, and by taking complements, any set [math]E\subset X[/math] is closed as well.
(2) [math]X[/math] is also bounded, because all distances are smaller than [math]1[/math].
(3) However, our set [math]X[/math] is not compact, because its points being open, as noted above, [math]X=\cup_{x\in X}\{x\}[/math] is an open cover, having no finite subcover.
The above result is quite interesting, and is the source of many troubles with compactness, in general, and can be subject to some further meditation. First, you might argue that by declaring [math]X[/math] to be the total space, we have “cheated” with its closedness, which came like this for free, without computations. But, when using the modeling [math]X\subset l^2(X)[/math] mentioned above, [math]X[/math] still remains closed, this time with no cheating involved.
As a second thought that you might have, you might perhaps say okay, but why not changing our definition of compactness as to include the above set [math]X[/math], which looks quite nice, being both closed and bounded, into our class of compact sets. But this does not work, because after some thinking, the above set [math]X[/math] is in fact not nice at all, and all sorts of things that you can try with it, for “confirming” its compactness, will simply fail.
So, this is the situation, and as a conclusion, Definition 10.11 is both in tune with what we know about the compact sets [math]K\subset\mathbb R[/math], which must be closed and bounded, and with what we learned from Theorem 10.12, telling us that being closed and bounded is worth nothing, or almost, in general. Thus, Definition 10.11 is the correct definition.
Moving away now from these philosophical thoughts, or rather with the promise to come back to them later, when we will know more, let us develop the theory of compact sets, as axiomatized in Definition 10.11, and see what we get. We first have the following elementary result, confirming that we are on the good way, with our Definition 10.11:
The following hold:
- Compact implies closed.
- Closed inside compact is compact.
- Compact intersected with closed is compact.
These assertions are all clear from definitions, as follows:
(1) Assume that [math]K\subset X[/math] is compact, and let us prove that [math]K[/math] is closed. For this purpose, we will prove that [math]K^c[/math] is open. So, pick [math]p\in K^c[/math]. For any [math]q\in K[/math] we set [math]r=d(p,q)/3[/math], and we consider the following balls, separating [math]p[/math] and [math]q[/math]:
We have then [math]K\subset\cup_{q\in K}V_q[/math], so we can pick a finite subcover, as follows:
With this done, consider the following intersection:
This intersection is then a ball around [math]p[/math], and since this ball avoids [math]V_{q_1},\ldots,V_{q_n}[/math], it avoids the whole [math]K[/math]. Thus, we have proved that [math]K^c[/math] is open at [math]p[/math], as desired.
(2) Assume that [math]F\subset K[/math] is closed, with [math]K\subset X[/math] being compact. For proving our result, we can assume, by replacing [math]X[/math] with [math]K[/math], that we have [math]X=K[/math]. In order to prove now that [math]F[/math] is compact, consider an open cover of it, as follows:
By adding the set [math]F^c[/math], which is open, to this cover, we obtain a cover of [math]K[/math]. Now since [math]K[/math] is compact, we can extract from this a finite subcover [math]\Omega[/math], and there are two cases:
-- If [math]F^c\in\Omega[/math], by removing [math]F^c[/math] from [math]\Omega[/math] we obtain a finite cover of [math]F[/math], as desired.
-- If [math]F^c\notin\Omega[/math], we are done too, because in this case [math]\Omega[/math] is a finite cover of [math]F[/math].
(3) This follows from (1) and (2), because if [math]K\subset X[/math] is compact, and [math]F\subset X[/math] is closed, then [math]K\cap F\subset K[/math] is closed inside a compact, so it is compact.
As a second batch of results, which are useful as well, we have:
The following hold:
- If [math]K_i\subset X[/math] are compact, satisfying [math]K_{i_1}\cap\ldots\cap K_{i_n}\neq\emptyset[/math], then [math]\cap_iK_i\neq\emptyset[/math].
- If [math]K_1\supset K_2\supset K_3\supset\ldots[/math] are non-empty compacts, then [math]\cap_iK_i\neq\emptyset[/math].
- If [math]K[/math] is compact, and [math]E\subset K[/math] is infinite, then [math]E[/math] has a limit point in [math]K[/math].
- If [math]K[/math] is compact, any sequence [math]\{x_n\}\subset K[/math] has a limit point in [math]K[/math].
- If [math]K[/math] is compact, any [math]\{x_n\}\subset K[/math] has a subsequence which converges in [math]K[/math].
Again, these are elementary results, which can be proved as follows:
(1) Assume by contradiction [math]\cap_iK_i=\emptyset[/math], and let us pick [math]K_1\in\{K_i\}[/math]. Since any [math]x\in K_1[/math] is not in [math]\cap_iK_i[/math], there is an index [math]i[/math] such that [math]x\in K_i^c[/math], and we conclude that we have:
But this can be regarded as being an open cover of [math]K_1[/math], that we know to be compact, so we can extract from it a finite subcover, as follows:
Now observe that this latter subcover tells us that we have:
But this contradicts our intersection assumption in the statement, and we are done.
(2) This is a particular case of (1), proved above.
(3) We prove this by contradiction. So, assume that [math]E[/math] has no limit point in [math]K[/math]. This means that any [math]p\in K[/math] can be isolated from the rest of [math]E[/math] by a certain open ball [math]V_p=B_p(r)[/math], and in both the cases that can appear, [math]p\in E[/math] or [math]p\notin E[/math], we have:
Now observe that these sets [math]V_p[/math] form an open cover of [math]K[/math], and so of [math]E[/math]. But due to [math]|V_p\cap E|=0,1[/math] and to [math]|E|=\infty[/math], this open cover of [math]E[/math] has no finite subcover. Thus the same cover, regarded now as cover of [math]K[/math], has no finite subcover either, contradiction.
(4) This follows from (3) that we just proved, with [math]E=\{x_n\}[/math].
(5) This is a reformulation of (4), that we just proved.
Getting now to some more exciting theory, here is a key result about compactness, which is less trivial, and that we will need on a regular basis, in what follows:
For a subset [math]K\subset\mathbb R^N[/math], the following are equivalent:
- [math]K[/math] is closed and bounded.
- [math]K[/math] is compact.
- Any infinite subset [math]E\subset K[/math] has a limiting point in [math]K[/math].
This is something quite tricky, the idea being as follows:
[math](1)\implies(2)[/math] As a first task, in order to establish this implication, let us prove that any product of closed intervals, as follows, is indeed compact:
We can assume by linearity that we are dealing with the unit cube:
In order to prove that [math]C_1[/math] is compact, we proceed by contradiction. So, assume that we have an open cover as follows, having no finite subcover:
Now let us cut [math]C_1[/math] into [math]2^N[/math] small cubes, in the obvious way, over the [math]N[/math] coordinate axes. Then at least one of these small cubes, which are all covered by [math]\cup_iE_i[/math] too, has no finite subcover. So, let us call [math]C_2\subset C_1[/math] one of these small cubes, having no finite subcover:
We can then cut [math]C_2[/math] into [math]2^N[/math] small cubes, and by the same reasoning, we obtain a smaller cube [math]C_3\subset C_2[/math] having no finite subcover. And so on by recurrence, and we end up with a decreasing sequence of cubes, as follows, having no finite subcover:
Now since these decreasing cubes have edge size [math]1,1/2,1/4,\ldots\,[/math], their intersection must be a point. So, let us call [math]p[/math] this point, defined by the following formula:
But this point [math]p[/math] must be covered by [math]\cup_iE_i[/math], so we can find an index [math]i[/math] such that:
Now observe that [math]E_i[/math] must contain a whole ball around [math]p[/math], and so starting from a certain [math]K\in\mathbb N[/math], all the cubes [math]C_k[/math] will be contained in this ball, and so in [math]E_i[/math]:
But this is a contradiction, because [math]C_K[/math], and in fact the smaller cubes [math]C_k[/math] with [math]k \gt K[/math] as well, were assumed to have no finite subcover. Thus, we have proved our claim.
[math](1)\implies(2)[/math], continuation. But with this claim in hand, the result is now clear. Indeed, assume that [math]K\subset\mathbb R^N[/math] is closed and bounded. Then, since [math]K[/math] is bounded, we can view it as a subset as a suitable big cube, of the following form:
But, what we have here is a closed subset inside a compact set, that follows to be compact, as desired.
[math](2)\implies(3)[/math] This is something that we already know, not needing [math]K\subset\mathbb R^N[/math].
[math](3)\implies(1)[/math] We have to prove that [math]K[/math] as in the statement is both closed and bounded, and we will do both these things by contradiction, as follows:
-- Assume first that [math]K[/math] is not closed. But this means that we can find a point [math]x\notin K[/math] which is a limiting point of [math]K[/math]. Now let us pick [math]x_n\in K[/math], with [math]x_n\to x[/math], and consider the set [math]E=\{x_n\}[/math]. According to our assumption, [math]E[/math] must have a limiting point in [math]K[/math]. But this limiting point can only be [math]x[/math], which is not in [math]K[/math], contradiction.
-- Assume now that [math]K[/math] is not bounded. But this means that we can find points [math]x_n\in K[/math] satisfying [math]||x_n||\to\infty[/math], and if we consider the set [math]E=\{x_n\}[/math], then again this set must have a limiting point in [math]K[/math], which is impossible, so we have our contradiction, as desired.
So long for compactness. As a last piece of general topology, in our metric space framework, we can talk as well about connectedness, as follows:
We can talk about connected sets [math]E\subset X[/math], as follows:
- We say that [math]E[/math] is connected if it cannot be separated as [math]E=E_1\cup E_2[/math], with the components [math]E_1,E_2[/math] satisfying [math]E_1\cap\bar{E}_2=\bar{E}_1\cap E_2=\emptyset[/math].
- We say that [math]E[/math] is path connected if any two points [math]p,q\in E[/math] can be joined by a path, meaning a continuous [math]f:[0,1]\to X[/math], with [math]f(0)=p[/math], [math]f(1)=q[/math].
All this looks a bit technical, and indeed it is. To start with, (1) is something quite natural, but the separation condition there [math]E_1\cap\bar{E}_2=\bar{E}_1\cap E_2=\emptyset[/math] can be weakened into [math]E_1\cap E_2=\emptyset[/math], or strengthened into [math]\bar{E}_1\cap\bar{E}_2=\emptyset[/math], depeding on purposes, and with our (1) as formulated above being the good compromise, for most purposes.
As for (2), this condition is obviously something stronger, and we have in fact the following implications, which are both clear:
To be more precise, the first implication is clear, by taking as path as in Definition 10.16 (2) the segment joining [math]p,q[/math], and for the second implication, the idea is that a separation of [math]E[/math] as in Definition 10.16 (1) will produce a separation of the path joining [math]p,q[/math], and so ultimately, a separation of the interval [math][0,1][/math], which is impossible.
The problem, however, is that connected does not imply path connected, and there are as well various counterexamples in relation with the various versions of (1) that can be formulated, as explained above. Anyway, leaving aside the discussion here, which is something quite technical, once all these questions clarified, the idea is that any set [math]E[/math] can be written as a disjoint union of connected components, as follows:
However, the story is not over here, because when looking at the connected components [math]E_i[/math], or simply at the connected sets [math]E[/math], if you prefer, there are many things that can happen, in relation with the “holes” that [math]E[/math] can have or not. Thus, the classification of connected sets runs into the question of deciding how many holes can have such a set [math]E[/math], and this is something quite subtle, that we will discuss in chapter 11 below.
Getting back now to more concrete things, remember that we are here in this book for studying functions, and doing calculus. And, regarding functions, we have:
Assuming that [math]f:X\to Y[/math] is continuous, the following happen:
- If [math]O[/math] is open, then [math]f^{-1}(O)[/math] is open.
- If [math]C[/math] is closed, then [math]f^{-1}(C)[/math] is closed.
- If [math]K[/math] is compact, then [math]f(K)[/math] is compact.
- If [math]E[/math] is connected, then [math]f(E)[/math] is connected.
This is something fundamental, which can be proved as follows:
(1) This is clear from the definition of continuity, written with [math]\varepsilon,\delta[/math]. In fact, the converse holds too, in the sense that if [math]f^{-1}({\rm open})={\rm open}[/math], then [math]f[/math] must be continuous.
(2) This follows from (1), by taking complements. And again, the converse holds too, in the sense that if [math]f^{-1}({\rm closed})={\rm closed}[/math], then [math]f[/math] must be continuous.
(3) This is something that took us some time to prove for the functions [math]f:\mathbb R\to\mathbb R[/math], earlier in this book, with our compactness technology there, but which is now clear, by using our definition of compactness with open covers. Indeed, given an open cover [math]f(K)\subset\cup_iE_i[/math], we have by using (1) an open cover [math]K\subset\cup_if^{-1}(E_i)[/math], and so by compactness of [math]K[/math], a finite subcover [math]K\subset f^{-1}(E_{i_1})\cup\ldots\cup f^{-1}(E_{i_n})[/math], and so finally a finite subcover [math]f(K)\subset E_{i_1}\cup\ldots\cup E_{i_n}[/math], as desired. And isn't this smart, hope you agree with me.
(4) This can be proved via the same trick as for (3). Indeed, any separation of [math]f(E)[/math] into two parts can be returned via [math]f^{-1}[/math] into a separation of [math]E[/math] into two parts, contradiction.
As a comment here, Theorem 10.17 generalizes, and in a clever way, many things that we know from one-variable calculus. Of particular interest is (3), which shows in particular that any continuous function on a compact space [math]f:X\to\mathbb R[/math] attains its minimum and its maximum, and then (4), which can be regarded as being a general mean value theorem. As for (1) and (2), these are useful in everyday life, and we will see examples of this.
In addition to this, all useful things, there are a few other things that can be said about the continuity of the functions [math]f:\mathbb R^N\to\mathbb R^M[/math]. We will be back to this.
General references
Banica, Teo (2024). "Calculus and applications". arXiv:2401.00911 [math.CO].