Compactness and Connectedness

1. Compactness and Heine-Borel

Recall that a set \(E\) is called compact when every open cover of \(E\) admits a finite subcover. In the real line, it is possible to very cleanly identify exactly which sets are compact and which aren't.
Theorem (Heine-Borel)
A set \(E \subset {\mathbb R}\) is compact if and only if it is both closed and bounded.
Proof Direction 1: Compact Sets are Bounded Suppose \(E \subset {\mathbb R}\) is compact. Consider the collection of open intervals \((-N,N)\) as \(N\) ranges over all natural numbers. We know that
\[ \bigcup_{N = 1}^\infty (-N,N) = {\mathbb R}. \]
(If this were not so, there would be an \(x \in {\mathbb R}\) which does not belong to \((-N,N)\) for any natural number \(N\), i.e., \(x \geq N\) or \(x \leq -N\) for each \(N\). If, for example, \(x \geq 0\), it would have to be the case that \(x \geq N\) for each \(N\) because \(x \geq 0 > -N\). But then this \(x\) would be an upper bound for the set of natural numbers.)

This makes \(\{(-N,N)\}_{n=1}^\infty\) an open cover of \(E\) (because it covers \({\mathbb R}\) and \(E \subset {\mathbb R}\)). By compactness, it has a finite subcover: \(E \subset (-N_1,N_1) \cup \cdots \cup (-N_k,N_k)\). Now take \(N = \max\{N_1,\ldots,N_k\}\). This gives \(E \subset (-N,N)\) because \((-N_i,N_i) \subset (-N,N)\) for each \(i = 1,\ldots,k\). Thus \(E\) must be bounded.

Proof Direction 1: Compact Sets are Closed Let \(E\) be compact and let \(x \in E^c\) (because compact sets are closed, we know that \(E^c\) happens never to be empty.) It suffices to show that there is some neighborhood of \(x\) which belongs to the complement of \(E\). Now consider the collection of open sets
\[ U_\epsilon := (-\infty,x-\epsilon) \cup (x+\epsilon,\infty) \]
as \(\epsilon\) ranges over all positive real numbers. Now
\[ \bigcup_{\epsilon > 0} U_\epsilon = {\mathbb R} \setminus \{x\}\]
because \(x\) does not belong to any \(U_\epsilon\) and any \(y \neq x\) belongs to \(U_\epsilon\) when \(\epsilon = |x-y|/2\) (for example). Since \(E \subset {\mathbb R} \setminus \{x\}\), this collection \(\{U_\epsilon\}_{\epsilon > 0}\) is an open cover of \(E\) and so
\[ E \subset U_{\epsilon_1} \cup \cdots \cup U_{\epsilon_k}\]
for some choice of \(\epsilon_1,\ldots,\epsilon_k > 0\). But if \(\epsilon = \min \{\epsilon_1,\ldots,\epsilon_k\}\), then
\[ U_{\epsilon_1} \cup \cdots \cup U_{\epsilon_k} = U_\epsilon\]
and in particular, none of the points \([x-\epsilon,x+\epsilon]\) can belong to \(E\) because they do not belong to \(U_\epsilon\). In particular, the open interval \((x-\epsilon,x+\epsilon) \subset E^c\).

Interlude: Closed and Bounded Intervals We need an intermediate result:
Proposition
All closed and bounded intervals are compact.
To prove the result, suppose that \(\{U_\lambda\}_{\lambda \in \Lambda}\) is an open cover of a closed interval \([a,b]\). Now let \(T\) be the subset of \([a,b]\) consisting of all points \(x\) for which \([a,b] \cap (-\infty,x]\) can be covered by finitely many elements of the open cover.

The set \(T\) is nonempty because it must contain \(a\): \([a,b] \cap (-\infty,a] = \{a\}\) and \(\{a\}\) belongs to some \(U_\lambda\). The set \(T\) is also bounded because it is a subset of \([a,b]\). Thus it has a nontrivial supremum \(s\). Because \(b\) is an upper bound for \(T\), \(s \leq b\). And because \(a \in T\), \(a \leq s\). Thus \(s \in [a,b]\) as well.

We claim that \(T\) must contain its supremum. Suppose not. Because \(s \in [a,b]\), it belongs to \(U_{\lambda}\) for some \(\lambda\), and because \(U_{\lambda}\) is open, \((s-\epsilon,s+\epsilon) \subset U_{\lambda}\) for some positive \(\epsilon\). But now if there is any point \(t \in T \cap (s-\epsilon,s+\epsilon)\), then taking a collection \(U_{\lambda_1} \cup \cdots \cup U_{\lambda_k}\) covering \([a,b] \cap (-\infty,t]\) and adding \(U_{\lambda}\) to this union gives a collection of sets which overs at least \([a,b] \cap ((-\infty,t] \cup (s-\epsilon,s+\epsilon))\), which is at least as big as \([a,b] \cap (-\infty,s]\). So if \((s-\epsilon,s+\epsilon)\) were to contain any point \(t \in T\), this would contradict the assumption that \(s \not \in T\). But this is clearly impossible because \(s\) is the supremum of \(T\) and therefore must be arbitrarily close to elements of \(T\).

To conclude, notice that we have proved something slightly stronger than merely \(s \in T\). If \(s < b\), then our argument above shows that \([a,b] \cap (-\infty,s+\epsilon)\) can be covered by a finite union of elements \(U_{\lambda_i}\). In particular, if \(\epsilon'\) is positive and less than both \(\epsilon\) and \(|b-s|\), it would follow that \([a,b] \cap (-\infty,s+\epsilon']\) is covered by finitely many \(U_{\lambda_i}\) and consequently \(s + \epsilon' \in T\). This contradicts the fact that \(s\) is a supremum. Thus not only must \(s\) belong to \(T\), it must be the case that \(s = b\). In other words, \([a,b] \cap (-\infty,b]\) must be covered by some finite union of \(U_{\lambda_i}\)'s. This finishes the claim that \([a,b]\) is compact because \([a,b] = [a,b] \cap (-\infty,b]\).

Proof Direction 2: Closed Subsets of Compact Sets are Compact Suppose \(E\) is closed and bounded. In particular, there must be some \(N > 0\) such that \(E \subset [-N,N]\), and we already know that \([-N,N]\) is compact. Thus it suffices to show that every closed subset of a compact set is itself compact.

Let \(\{U_\lambda\}_{\lambda \in \Lambda}\) be any open covering of \(E\). Let's form a new collection of open sets by adjoining the open set \(E^c\) if it doesn't already belong. This new open covering covers all of \({\mathbb R}\) and so covers \([-N,N]\). Thus some finite subcover covers all of \([-N,N]\) and therefore all of \(E\). If all the elements of this subcover belonged to the original cover, we are done. So suppose the finite subcover obtained has the form \(U_{\lambda_1} \cup \cdots \cup U_{\lambda_k} \cup E^c\). Since this union contains all of \([-N,N]\), the union \(U_{\lambda_1} \cup \cdots \cup U_{\lambda_k}\) must cover all of \(E\) because the only points missing (if any) in this pruned cover relative to the full finite cover are points that belong to \(E^c\).

2. Connectedness in \({\mathbb R}\)

Definition
We say that a set \(E \subset {\mathbb R}\) is convex when it has the property that for any two points \(x,y \in E\) with \(x < y\), the interval \([x,y]\) is contained in \(E\).
Observe that if \(E\) is nonempty, convex, and not a singleton set, the interval \((\inf E,\sup E)\), interpreted in the sense of extended real numbers, must be contained in \(E\). The reason for this is that for any number \(t\) strictly between the supremum and the infimum (which cannot be equal because \(E\) contains at least two points), there must be some points \(x,y \in E\) such that \(x < t < y\) (as nonexistence of \(x\) would imply \(t \leq \inf E\) and nonexistence of \(y\) would imply \(t \geq \sup E\)), and then convexity implies that \(t \in E\). But the set \((\inf E,\sup E)\) necessarily differs from \(E\) by at most the endpoints (and possibly does not differ at all) since any point \(t > \sup E\) or \(t < \inf E\) cannot possibly belong to \(E\).
Theorem
A nonempty set \(E \subset {\mathbb R}\) is connected if and only if it is either a singleton set or an interval.
Direction 1: Intervals are Connected Any singleton set \(E\) is automatically connected, so suppose that \(E\) is an interval; equivalently, suppose that \(E\) contains at least two points and is convex. Suppose that \(E\) is disconnected, i.e., that there exist open sets \(A\) and \(B\) such that \(E \cap A\) and \(E \cap B\) are both nonempty, have no points in common, and have union \(E\). Let \(x_1 \in E \cap A\) and \(y_1 \in E \cap B\). Without loss of generality, assume \(x_1 < y_1\) (otherwise we can just swap the sets \(A\) and \(B\)). We can run a bisection argument to derive a contradiction. Suppose that \(x_1,\ldots,x_k\) and \(y_1,\ldots,y_k\) have been defined so that each \(x_i \in E \cap A\), each \(y_i \in E \cap B\), the \(x_i\)'s are nondecreasing, the \(y_i\)'s are nonincreasing, and \(y_i - x_i = 2^{-i+1} (y_1 - x_1)\) for each \(i > 1\). Let \(z_{k+1} = (x_k + y_k)/2\). Because \(E\) is convex, \(z_{k+1} \in E\). Moreover \(z_{k+1}\) must belong to either \(A\) or \(B\). If \(z_{k+1} \in A\), let \(x_{k+1} := z_{k+1}\) and \(y_{k+1} := y_k\). Otherwise, take \(x_{k+1} := x_k\) and \(y_{k+1} := z_{k+1}\). It's easy to check that the extended sequences \(x_1,\ldots,x_{k+1}\) and \(y_1,\ldots,y_{k+1}\) satisfy the same montonicity and distance conditions. In particular, we know from previous proofs that when defined inductively for all \(i\), the sequences \(\{x_i\}_{i=1}^\infty\) and \(\{y_i\}_{i=1}^\infty\) both converge and have the same limit \(z\). Because \(x_i \leq z \leq y_i\) for each \(i\) and because \(E\) is convex, \(z \in E\). Like before, this means that either \(z \in A\) or \(z \in B\). In the former case, since \(A\) is an open neighborhood of \(z\), every sequence converging to \(A\) evenually belongs to \(A\). Thus \(y_i \in A\) for all \(i\) sufficiently large. This contradicts the fact that \(E \cap A\) and \(E \cap B\) are disjoint. Similarly if \(z \in B\), this would imply that \(x_i \in B\) for all \(i\) sufficiently large, again contradicting disjointness of \(E \cap A\) and \(E \cap B\).

Direction 2: Connected Sets in \({\mathbb R}\) are Convex Suppose not; then there would have to exist a set \(E \subset {\mathbb R}\) which is connected but not a singleton set and not convex. In particular, there would be points \(x,y \in E\) such that \(x < y\) but \([x,y] \not \subset E\). Let \(z\) be any point of \([x,y]\) not belonging to \(E\). Clearly \(z\) is not \(x\) or \(y\) because those points are known to belong to \(E\). Then taking \(A := (-\infty,z)\) and \(B := (z,\infty)\) gives a separation of \(E\): \(A \cap E\) is nonempty (it contains \(x\)), \(B \cap E\) is nonempty (containing \(y\)), the sets \(A \cap E\) and \(B \cap E\) are disjoint (because \(A\) and \(B\) are disjoint), and the union is \(E\) (because \((A \cap E) \cup (B \cap E) = (A \cup B) \cap E = E\)).