Chapter 3 COMPACTNESS AND CONNECTEDNESS In this chapter we continue our study of metric spaces by discussing the important concepts of compactness and connectedness. Compactness is defined by means of open covers and later characterized in terms of convergence of sequences. Compactness is preserved under continuity. We characterize compact subsets of Rk . Connectedness means that the space cannot be expressed as the union of two disjoint, non-empty open subsets. Intuitively this means the space is in one piece. Connectedness is also preserved under continuity. This fact and the characterization of connected subsets of the real line yields the so called intermediate-value theorem. The chapter ends by a short discussion of connected components and arcwise connectedness. 83 84 CHAPTER 3. COMPACTNESS AND CONNECTEDNESS 3.1 Compact Sets Let E be a subset of a metric space (X, d). A collection of open sets Oi , i ∈ I, is called an open cover of E if E⊂ [ Oi . i∈I A simple example of an open cover is obtained when for each x ∈ E we take as Ox the ball B(x; 1). The collection {Ox : x ∈ E} is then an open cover of E. Note that in this case our index set is E itself. Instead of taking one as the radius of the balls, we could as well take for each x some rx > 0 and still have that {B(x; rx ) : x ∈ E} as an open cover of E. Let {Oi : i ∈ I} be an open cover of E where the collection is indexed by some set I. Let I0 be a finite subset of I such that E⊂ [ Oi . i∈I0 Then {Oi : i ∈ I0 } is called a finite subcover of E. This means from the given collection of open sets whose union contains E, if we take only those whose index is in I0 , their union still contains the set E. If every open cover of E has a finite subcover, we call E a compact subset of X. A metric space (X, d) is called compact if the set X is compact. Let us illustrate the definition of compactness by a simple example. Here (X, d) is any metric space and E = {x1 , . . . , xk } a finite subset of X. Suppose we have an open cover Oi , i ∈ I, of E. Then each xn belongs to one of these open sets. Suppose xn is in Oin for some in ∈ I. Then of course E ⊂ Oi1 ∪ Oi2 ∪ · · · ∪ Oik . That is, {Oin : n = 1, . . . , k} is an open subcover of E. Hence we have proved that any finite subset of a metric space is compact. 3.1. COMPACT SETS 85 Let us take as another example where X = R and E = N. Then, if On = (n − 1, n + 1) for each positive integer n, the open intervals On form an open cover of N, but no finite subcollection of them covers N. For, if On1 , . . . , Onk is any finite subcollection, then letting m = max{n1 , . . . , nk } we see that the integers m + 1, m + 2, . . . do not belong to any one of Oni ’s. Hence N is an example of a set which is not compact. The following proposition enables us to find many other examples of non-compact sets. Proposition 3.1.1 A compact set is bounded and closed. Proof : Let E be compact. Let us first show that it is bounded. For this purpose we take any x in X and for n ∈ N consider the balls On = B(x; n). Given y in E, we can find a positive integer n with d(x, y) < n. This means y belongs to this On . Hence {On : n ∈ N} is an open cover for E and so there is a finite subcover, say O1 , . . . , Om with E ⊂ O1 ∪ · · · ∪ Om . But the set O1 ∪ · · · ∪ Om is just Om = B(x; m). Hence E is bounded. Next we will show that the complement of E is open. For this we will show that for x ∈ X \ E we can find a number δ > 0 with B(x; δ) ∩ E = ∅. If y ∈ E, then the number δy = (d(x, y)/2) is positive. Let Oy = B(y; δy ). Since {Oy : y ∈ E} is an open cover of E, we can find a finite number of points y1 · · · yn in E with E ⊂ Oy1 ∪ · · · ∪ Oyn . Let now δ = min{δyi : i = 1, . . . , n}. We will show that B(x; δ) does not intersect E. If z ∈ E, then d(z, yi ) < (d(x, yi )/2) for some i. From the 86 CHAPTER 3. COMPACTNESS AND CONNECTEDNESS inequality 1 d(x, yi ) ≤ d(x, z) + d(z, yi ) < d(x, z) + d(x, yi ) 2 we have δ ≤ d(x, z). So z cannot be in E. The proposition we have just proved tells us that a subset E of a metric space must be closed if E is to be compact. This is sufficient if X itself is compact. Let E be a closed subset of a compact metric space X and Oi , i ∈ I, any open cover of E. To this family of open sets we add the open set X \ E and then we have that {X \ E, Oi : i ∈ I} is an open cover of X. So there is a finite subcover, which we can assume also contains X \ E. Since X = (X \ E) ∪ Oi1 ∪ · · · ∪ Oin for some i1 , . . . , in we have that E ⊂ Oi1 ∪ · · · ∪ Oin . So we have proved the following result. Proposition 3.1.2 A closed subset of a compact metric space is itself compact. In the next proposition we relate convergence and compactness in a way, which will characterize compactness of metric spaces in the next section. Proposition 3.1.3 Every sequence in a compact set E has a subsequence which converges to an element of E. Proof : Let (xn ) be a sequence in E and suppose for each y in E there is a number ry > 0 such that the set N(y) = {n ∈ N : xn ∈ B(y; ry )} 3.1. COMPACT SETS 87 is finite. Since {B(y; ry ) : y ∈ E} is an open cover of the compact set E, we can find y1 · · · yk in E with E ⊂ B(y1 ; ry1 ) ∪ · · · ∪ B(yk ; ryk ). For each n ∈ N the point xn belongs to E and so N = N(y1 ) ∪ · · · ∪ N(yk ) which is a contradiction. This means that there is a point x of E such that for every > 0 the set L() = {n ∈ N : xn ∈ B(x; )} is infinite. It is now easy to construct a subsequence which converges to this point x ∈ E. We choose k1 with d(xk1 , x) < 1. Since L(1/2) is infinite, there is a k2 in L(1/2) which is larger than k1 . Hence d(xk2 , x) < (1/2). This way, we choose a subsequence (kn ) of positive integers with kn ∈ L(1/n) and so the limit of (xkn ) will be x. As an application of this proposition we shall show the existence of what is called Lebesgue number associated to an open cover of a compact metric space. Let (X, d) be a compact metric space and {Oi : i ∈ I} an open cover of X. Suppose now for each positive integer n there is an element xn of X such that the ball B(xn ; 1/n) is not contained in any single Oi . From the previous proposition we know that some subsequence (xkn ) converges to an element x of E. This x belongs to some Oi0 . So there is a δ > 0 with B(x; δ) ⊂ Oi0 . We choose n0 with d(xkn , x) < δ 2 88 CHAPTER 3. COMPACTNESS AND CONNECTEDNESS for n ≥ n0 . Let j be a positive integer larger than n0 and kj > (2/δ). Then d(xkj , x) < (δ/2) and so we have B(xkj ; 1/kj ) ⊂ B(x; δ) ⊂ Oi0 by a standard use of the triangle inequality. This contradiction shows us that our claim is false and so its negation is true. This means that for any open cover {Oi : i ∈ I} of a compact metric space X there is a number r > 0 such that any ball B(x; r) is contained in some single Oi . This number r is called a Lebesgue number of the given covering. 3.2 Compactness and Convergence of Sequences In the previous section we studied some consequences of compactness and proved in particular that every sequence of elements of a compact set has a subsequence which converges to an element of that set. This property in fact characterizes compactness of metric spaces, as we will now prove. First we introduce another concept which is similar to compactness but somewhat weaker. We call a subset E of a metric space (X, d) precompact if for every > 0 we can find a finite number of points x1 , . . . , xk in X with E⊂ k [ B(xi ; ). i=1 Since for > 0 fixed, {B(x; ) : x ∈ X} is an open cover of E, if E is compact, then this cover has a finite subcover. This means that every compact set is precompact. It follows from the definition immediately that a subset of a precompact set is also precompact. A precompact set is also bounded, since it is contained in a union of a finite number of open balls. We summarize these results below. 3.2. COMPACTNESS AND CONVERGENCE OF SEQUENCES 89 Proposition 3.2.1 A compact set is precompact. A subset of a precompact set is also precompact. A precompact set is bounded. A compact set E is not only precompact but it is also complete. For if (xn ) is a Cauchy sequence in E, then it has a subsequence (xkn ) which converges to some x in E, as we have proved in the previous section. This implies however that the sequence itself converges to x ∈ E. This cycle of ideas is fully discussed in the following important theorem, which relates compactness and convergence of sequences. Theorem 3.2.2 The following conditions are equivalent on a metric space (X, d). (a) (X, d) is compact. (b) Every sequence in X has a subsequence which converges to an element of X. (c) (X, d) is complete and precompact. Proof : We already know that (a) implies (b) by Proposition 3.1.3. We are going to prove that (b) implies (c) and (c) in turn implies (a). To prove that (b) implies (c) we first note that (b) implies the completeness of X. For if (xn ) is a Cauchy sequence, by (b) it has a convergent subsequence and so it itself is convergent. To finish the proof of this implication we assume X is not precompact and construct a sequence which has no Cauchy subsequence. Such a sequence can have no convergent subsequence. X is not precompact means that there is a number > 0 such that for any finite set {y1 , . . . , yk } we can find a point x of X with d(x, yi ) ≥ for all i = 1, . . . , k. We choose any x1 and find x2 with d(x2 , x1 ) ≥ . By 90 CHAPTER 3. COMPACTNESS AND CONNECTEDNESS our assumption, there is a point x3 with d(x3 , x2 ) ≥ and d(x3 , x1 ) ≥ . Suppose we have chosen xn such that d(xn , xi ) ≥ for every i = 1, . . . , n − 1. Then considering the finite set {x1 , x2 , . . . , xn }, we see that there is a point xn+1 in X with d(xn+1 , xi ) ≥ for every i = 1, . . . , n. So the sequence constructed in this manner satisfies d(xn , xm ) ≥ for m 6= n and hence (xn ) can have no Cauchy subsequence. If we assume that (c) is true, then X is bounded by Proposition 3.1.1. So X = B(x0 ; r) for some x0 ∈ X and r > 0. Suppose now (a) is not true; that is there is an open cover {Oi : i ∈ I} of X which has no finite subcover. We will finish the proof by showing that this leads to a contradiction. The method used is somewhat similar to the proof of the Bolzano-Weierstrass theorem. We let n = r/2n . Since X is assumed to be precompact, it can be covered by a finite number of open balls each having radius 1 . If each of these were to be covered by a finite number of the open sets from the cover {Oi : i ∈ I}, then this open cover would have a finite subcover, which we assumed to be false. Hence there is a point x1 such that B(x1 ; 1 ) cannot be covered by a finite number of Oi ’s. As a subset of a precompact set, B(x1 ; 1 ) is also precompact. Hence B(x1 ; 1 ) is covered by a finite number of open balls of radius 2 this time. If the intersection of each of these balls of radius 2 with B(x1 ; 1 ) would be covered by a finite number of Oi ’s, the ball B(x1 ; 1 ) itself would also be covered by a finite number of Oi ’s, the ball B(x1 ; 1 ) itself would also be covered by a finite number of Oi ’s. This means that there is some x2 such that B(x1 ; 1 ) ∩ B(x2 ; 2 ) is not empty and this set (and hence B(x2 ; 2 ) also) cannot be covered by a finite number of 3.2. COMPACTNESS AND CONVERGENCE OF SEQUENCES 91 Oi ’s. Proceeding in this manner we construct a sequence (xn ) such that B(xn ; n ) ∩ B(xn+1 ; n+1 ) 6= ∅ and B(xn ; n ) cannot be covered by a finite number of Oi ’s. We want to show that (xn ) so constructed is a Cauchy sequence. If x0 is any point in the intersection of B(xn ; n ) with B(xn+1 ; n+1 ), we have d(xn , xn+1 ) ≤ d(xn , x0 ) + d(x0 , xn+1 ) < n + n+1 < 2n . Since ∞ X n=1 ∞ X 1 n = r 2n n=1 is a convergent series, by comparison test the infinite series X d(xn , xn+1 ) is also convergent. This implies that (xn ) is a Cauchy sequence (See: Problems, Chapter 2, 28). Using the assumption that the metric space (X, d) is complete, we have that lim xn exists. Let us denote this limit by x. Since {Oi : i ∈ I} is an open cover of X, we find some i0 ∈ I and δ > 0 with B(x; δ) ⊂ Oi0 . For this δ we find a positive integer n so large that d(xn , x) < δ 2 and n = (r/2n ) < (δ/2) also. If d(y, xn ) < n then from d(y, x) ≤ d(y, xn ) + d(xn , x) < δ we obtain B(xn ; n ) ⊂ B(x; δ) ⊂ Oi0 which contradicts the fact that each B(xn ; n ) cannot be covered by a finite number of Oi ’s. 92 CHAPTER 3. COMPACTNESS AND CONNECTEDNESS We will now give some applications of this important and useful charac- terization of compactness. Proposition 3.2.3 The cartesian product of a finite number of compact metric spaces is also compact. Proof : Let X be the cartesian product X1 × · · · × Xk where each Xi is a compact metric space. Let (xn ) be a sequence in X. Then the sequence of its first coordinates (xn1 ) has a subsequence which is convergent since X1 is a compact metric space. This subsequence corresponds to the first coordinates of a subsequence (x0 n ) of (xn ). Now (x0 n2 ) is a sequence in X2 and so it has a convergent subsequence which corresponds to the second coordinates of a subsequence (x00 n ) of (x0 n ). Note that (x00 n1 ) is a subsequence of (x0 n1 ) and it is therefore convergent. Continuing in this manner, we find a subsequence (y n ) of (xn ) such that for each i, (yin ) is convergent in Xi . Hence (y n ) is convergent in the cartesian product X. Therefore X is compact by our theorem. Notice that we have not specifically used any of the relevant metrics on the cartesian product X. This makes no difference, since all of them are equivalent. By now, it should be fairly easy for the reader to note that if d and ρ are two equivalent metrics on the same set X, then (X, d) is compact (or precompact) if and only if (X, ρ) is compact (or precompact). Proposition 3.2.4 Let A be a precompact subset of a complete metric space (X, d). Then the closure A is compact. Proof : For a given > 0 we find x1 , . . . , xk in X such that A⊂ k [ i=1 B(xi ; /2). 3.2. COMPACTNESS AND CONVERGENCE OF SEQUENCES 93 Since B(xi ; /2) ⊂ B[xi ; /2] and the union of a finite number of closed sets is closed we have A⊂ k [ B[xi ; /2], i=1 but B[xi ; /2] in turn is contained in the open ball B(xi ; ). So A is contained in the union of B(xi ; ), i = 1, . . . , k. Therefore A is precompact and as a closed subset of a complete metric space, it is also complete (Proposition 2.3.3). Hence A is compact by our theorem. We know that a precompact subset is bounded. An important result states that the converse is also true for subsets of Rm . We will prove this result below which is called the Heine-Borel theorem. Since Rm is complete, to prove that a subset of Rm is compact it is sufficient to show that it is closed and precompact. Theorem 3.2.5 A subset of Rm is precompact if and only if it is bounded. A subset of Rm is compact if and only if it is closed and bounded. Proof : We only need to prove that a bounded subset A of Rm is precompact. We will use the d∞ -metric on Rm . Since A is bounded we can find a positive integer r such that |xi | < r, i = 1, . . . , m, for every element x = (x1 , . . . , xm ) of A. Given > 0 let q be a positive integer larger than −1 . For x = (x1 , . . . , xm ) in A let pi be the greatest integer smaller than qxi . Since 0 ≤ qxi − pi < 1, dividing by q we obtain pi 1 − xi < < . q q (∗) We also have −rq < qxi < rq for every i = 1, . . . , m. Since −rq is an integer, we have −rq ≤ pi ≤ rq. (∗) implies that the d∞ -distance of x from the point 94 CHAPTER 3. COMPACTNESS AND CONNECTEDNESS (p1 /q, . . . , pm /q) is less than the given and pi is an integer which satisfies −rq ≤ pi ≤ rq. (∗∗) This means that the collection of open balls B(p; ) where p = (p1 /q, . . . , pm /q) and each pi satisfies (∗∗), is a cover of A. Note that there are a finite number of integers which satisfy (∗∗) and so the cover we have constructed is a finite cover. 3.3 Continuity and Compactness Let (X, d) and (Y, ρ) be any two metric spaces. Suppose f : X → Y is a continuous function. If {Oi : i ∈ I} is an open cover of the subset f (X) in Y , then {f −1 (Oi ) : i ∈ I} is an open cover of X. Suppose now the metric space (X, d) is compact. Then for some finite subset I0 of I we will have X= [ f −1 (Oi ) i∈I0 but this means {Oi : i ∈ I0 } is a finite subcover of f (X). Hence compactness is preserved by continuous functions. We state this result below. Proposition 3.3.1 If f : X → Y is continuous and X is compact, then f (X) is a compact subset of Y . In particular, a continuous function on a compact metric space takes closed subsets of the domain onto closed subsets of the range. This gives the automatic continuity of the inverse whenever it exists. Theorem 3.3.2 (Homeomorphism Theorem) Let f : X → Y be continuous and one-to-one. If X is compact, the inverse function f −1 : f (X) → X is also continuous. 3.3. CONTINUITY AND COMPACTNESS 95 Proof : Let A be a closed subset of X. Then A is compact and (f −1 )−1 (A) = f (A). By Proposition 3.3.1 f (A) is compact and so it is closed. Therefore f −1 : f (X) → X is continuous on f (X). Let f : X → R be continuous where (X, d) is a compact metric space. Since f (X) is also compact, it is a closed bounded subset of R. If m = inf {f (x) : x ∈ X} and M = sup{f (x) : x ∈ X}, then f (X) is a closed subset of the interval [m, M ]. For each n the number M − 1/n is not an upper bound for f (X) and so there is a point xn in X with M− 1 < f (xn ) ≤ M. n So lim f (xn ) = M . Since X is compact, there is a subsequence (xkn ) of (xn ) which converges to some x0 of X. By continuity of f , lim f (xkn ) = f (x0 ) and since (f (xkn )) is a subsequence of (f (xn )) we must have f (x0 ) = M . Hence the supremum M of the set f (X) is taken at some point x0 of X. With a similar argument we can show that the infimum is also taken. Proposition 3.3.3 If f : X → R is continuous and (X, d) is compact then there are points x0 and x00 with f (x0 ) = sup{f (x) : x ∈ X} f (x00 ) = inf {f (x) : x ∈ X}. Another consequence of Proposition 3.3.1 is that the set C(X) of continuous real-valued functions on a compact metric space X is a subset of the set of bounded functions B(X). We shall always write C(X) to mean the space of continuous real-valued functions on a compact space X equipped with the uniform convergence metric. Thus C(X) is a subspace of B(X). This new space is a generalization of the space C[a, b] of continuous real-valued 96 CHAPTER 3. COMPACTNESS AND CONNECTEDNESS functions on the interval [a, b]. Note that by the Heine-Borel theorem we may take any bounded and closed subset of Rm as X. Proposition 3.3.4 C(X) is a closed subspace of B(X) and hence it is complete. Proof : This generalizes Proposition 2.3.5. The same proof gives this result also if we replace the absolute-value with the metric on X. We remind the reader that a continuous function need not be uniformly continuous as we have noted in Chapter 2, §4. On compact spaces however these two notions of continuity coincide. In the proof of this result, we make use of compactness in a rather typical fashion. Proposition 3.3.5 Let (Y, ρ) be a metric space. If (X, d) is a compact metric space, then every continuous function f : X → Y is also uniformly continuous. Proof : Given > 0, we want to find a δ > 0 such that d(x, x0 ) < δ implies ρ(f (x), f (x0 )) < . Since f is continuous at each point x of X we find rx > 0 with f (B(x; rx )) ⊂ B(f (x); /2) The collection of balls B(x; (rx /2)), x ∈ X, is an open cover of the compact space X and so we can find points x1 , . . . , xn in X such that X= n [ B(xi ; (rxi /2)). i=1 We let δ to be the minimum of (rxi /2), i = 1, . . . , n. Suppose d(x, x0 ) < δ. If x ∈ B(xi ; (rxi /2)), from d(x0 , xi ) ≤ d(x0 , x) + d(x, xi ) < δ + rxi ≤ rxi 2 3.3. CONTINUITY AND COMPACTNESS 97 we have x0 ∈ B(xi ; rxi ) for the same i. So we have ρ(f (x0 ), f (xi )) < /2 and ρ(f (x), f (xi ) < /2. Hence ρ(f (x), f (x0 )) < provided d(x, x0 ) < δ. Going back to the example we had in Chapter 2, §4, we note that if a function f : R → R, is continuous, its restriction to any interval [a, b] is uniformly continuous. This is a simple consequence of the previous result. The complex plane C can be identified with the 2-dimensional euclidean space R2 as a metric space. We shall use this fact to show that any nonconstant polynomial P over C has a root. This result is known as the fundamental theorem of algebra. Theorem 3.3.6 If P (z) = a0 + a1 z + · · · + an z n , an 6= 0, is a polynomial with ai ∈ C, then P (z0 ) = 0 for some z0 ∈ C. Proof : Let m = inf{|P (z)| : z ∈ C}. We write z ∈ C in the polar form as z = reit where r ≥ 0 and t ∈ [0, 2π). From the inequality |P (z)| ≥ rn (|an | − r−1 |an−1 | − · · · − r−n |a0 |) we observe that there is an R > 0 such that |P (z)| > m + 1 for |z| > R. Let E = {reit : r ≤ R}. E is bounded and closed and hence compact by the Heine-Borel theorem. We have also seen m = inf{|P (z)| : z ∈ E}. 98 CHAPTER 3. COMPACTNESS AND CONNECTEDNESS The function f (z) = |P (z)| is continuous on E and so by Proposition 3.3.3 there is some z0 ∈ E with |P (z0 )| = m. If P (z0 ) = m = 0 we are finished. So let us assume m > 0 and let Q(z) = P (z + z0 ) P (z0 ) Q is also a polynomial of degree n and |Q(z)| ≥ 1 for all z ∈ C. Further since Q(0) = 1 we can write Q in the form Q(z) = 1 + bk z k + · · · + bn z n where k is the smallest positive integer with bk 6= 0. We determine now a t0 ∈ [0, 2π/k) such that eikt0 = − |bk | . bk For any r ≥ 0 we have Q(reit0 ) = 1 − rk |bk | + rk+1 bk+1 ei(k+1)t0 + · · · + rn bn eint0 . Let 0 < r < 1. Then n X |bk+1 |r + · · · + |bn |rn−k ≤ ! |bi | r. i=k+1 So if ( δ = min 1, |bk |/ n X ) |bi | i=k+1 we have for r < δ |bk+1 |r + · · · + |bn |rn−k < |bk |. Hence we have the inequality |Q(reit0 )| ≤ 1 − rk |bk | + rk+1 |bk+1 | + · · · + rn |bn | < 1 3.3. CONTINUITY AND COMPACTNESS 99 for all r in [0, δ). This contradicts the fact that |Q(z)| ≥ 1 for all z ∈ C. Hence m must be zero. Let (X, d) be a compact metric space and f : X → X a continuous function. From what we have proved so far we know that f is in fact uniformly continuous (Prop. 3.3.5), f (X) is compact and if f is one-to-one, the inverse f −1 : f (X) → X is also continuous (Theorem 3.3.2). We want to end this section with a result in this context. Proposition 3.3.7 Let f : X → X be continuous where (X, d) is a compact metric space. If for every x and y we have d(x, y) ≤ d(f (x), f (y)) then f is a one-to-one function from X onto X and so it has a continuous inverse f −1 : X → X. Proof : Since f (X) is compact, it is a closed subset of X. Suppose there is some z ∈ X such that z does not belong to f (X). This assumption will lead to a contradiction. If r = d(z, f (X)), then r > 0 and r ≤ d(z, f (x)), x ∈ X. In particular r ≤ d(z, f (z)). If we denote by f k the function f applied k-times consecutively, we have, since f k (z) ∈ f (X) r ≤ d(z, f k (z)). But from our assumption we also obtain r ≤ d(z, f k (z)) ≤ d(f (z), f k+1 (z)) ≤ · · · ≤ d(f i (z), f k+i (z)). 100 CHAPTER 3. COMPACTNESS AND CONNECTEDNESS So if yn = f n (z) the distance between different terms of the sequence (yn ) is greater than or equal to the positive number r. Hence (yn ) does not have a Cauchy subsequence and as such it cannot have a convergent subsequence. This contradicts Theorem 3.2.2. So we have shown f (X) = X. That f is oneto-one follows immediately from the assumption about the distance, since if f (x) = f (y) then d(x, y) = 0. 3.4 Connectedness We call a subset E of a metric space (X, d) disconnected if we can find open subsets A and B with the following properties: E ⊂ A ∪ B, E ∩ A 6= ∅, E ∩ B 6= ∅ and E ∩ A ∩ B = ∅. In case we take the space X itself, this definition simplifies slightly. Namely, X is disconnected if we can find non-empty open sets A, B such that X = A ∪ B and A ∩ B = ∅. Another way of stating this would be to say that there is a non-empty subset A of X such that, X \ A is also non-empty and A is both open and closed. In this case we simply take as B the complement X \ A of A. If the subset E or the space X itself is not disconnected, we call it connected. Hence X is connected if and only if X itself and the empty set ∅ are the only subsets which are both open and closed. Let E be a subset of R such that a ∈ E, b ∈ E but there is a c ∈ (a, b) which is not in E. If we let A = {x ∈ R : x < c} and B = {x ∈ R : c < x} then A and B are both open. Since a ∈ A and b ∈ B we have A ∩ E and B ∩ E are non-empty, but of course E ⊂ A ∪ B = R \ {c} and so A ∩ B = ∅. 3.4. CONNECTEDNESS 101 Hence E is disconnected. We have proved therefore that a subset of R which is not an interval is disconnected. The converse is also true, as we will prove below. Proposition 3.4.1 A subset of R is connected if and only if it is an interval. In particular R itself is a connected metric space. Proof : By what we have already shown, it is sufficient to prove that if E is a disconnected subset of R then we can find point a and b in E and that there is a point c between a and b which does not belong to E. Let A and B be two open subsets of R such that E is contained in their union, A ∩ E 6= ∅, B ∩ E 6= ∅ but A ∩ B ∩ E = ∅. We choose a point a from A ∩ E and another point b from B ∩ E. Without loss of generality we may assume a < b. Suppose [a, b] ⊂ E and let c be the supremum of A ∩ [a, b]. From a ≤ c ≤ b, we have that c is an element of E and as such it lies either in A or in B, but not in both. Suppose c lies in B. Then for some ρ > 0 we have that I = (c − ρ, c + ρ) is contained in the open set B. Since c − ρ is no longer an upper bound for A ∩ [a, b], the set A ∩ [a, b] ∩ I is non-empty and it is a subset of A ∩ B ∩ E which was assumed to be empty. Therefore c must lie in A. This means c < b and therefore c in fact belongs to A ∩ [a, b). We find some δ with 0 < δ < b − c so that the interval I1 = (c − δ, c + δ) is contained in the open set A. Since c + δ < b, the point c + δ/2 lies in A ∩ [a, b). This means c + δ/2 ≤ c which is non-sense. So c cannot belong to E and therefore a 6= c and b 6= c. Hence a < c < b. This contradicts the assumption that the interval [a, b] is contained in E. Let A and B be two nonempty, disjoint closed subsets of a metric space X. We can find open subsets U and V of X such that A ⊂ U, B ⊂ V