A Short Introduction to Metric Spaces
Section 6: Connectedness
You probably have some intuitive idea of what it means for a metric space to be "connected." For example, the real number line, $\R,$ seems to be connected, but if you remove a point from it, it becomes "disconnected." However, it is not really clear how to define connected metric spaces in general. We give a definition of connected metric space, but it might take some time for you to be convinced that the definition makes sense. Note that, similarly to compactness and continuity, connectedness is actually a topological property rather than a metric property, since it can be defined entirely in terms of open sets.
Definition 6.1: Let $(M,d)$ be a metric space. We say that $(M,d)$ is a connected metric space if and only if $M$ cannot be written as a disjoint union $M=U\cup V$ where $U$ and $V$ are both non-empty open subsets of $M.$ ("Disjoint union" means that $M=U\cup V$ and $U\cap V=\varnothing.$) A metric space that is not connected is said to be disconnected.
Theorem 6.1: A metric space $(M,d)$ is connected if and only if the only subsets of $M$ that are both open and closed are $M$ and $\varnothing.$ Equivalently, $(M,d)$ is disconnected if and only if it has a non-empty, proper subset that is both open and closed.
Proof: Suppose $(M,d)$ is a connected metric space. We must show that the only subsets of $M$ that are both open and closed are $M$ and $\varnothing.$ Suppose $X$ is a subset of $M$ that is both open and closed. Let $Y=M\smallsetminus X.$ Since a set is open if and only if its complement is closed, it follows that $Y$ is also both open and closed. Furthermore, $M$ is a disjoint union of $X$ and $Y.$ Then, by the definition of connectedness, $X$ and $Y$ cannot both be non-empty. So, one of $X$ and $Y$ is the empty set, and the other is $M.$ This means that $X$ is either $\varnothing$ or $M.$
Conversely, suppose that the only subsets of $M$ that are both open and closed are $M$ and $\varnothing.$ We must show that $M$ is connected. Suppose, for the sake of contradiction, that $M$ is not connected. So, by definition, $M$ can be written as a disjoint union of two non-empty open subsets, $U$ and $V.$ Note that $U$ is the complement of the open set $V,$ so it is closed as well as open. But then $U$ is a non-empty, proper subset of $M$ that is both open and closed, contradicting the assumption that no such set exists. This contradiction proves that $M$ must be connected. ∎
We also want to define what it means for a subset of a metric space to be connected. If $X$ is a subset of the metric space $(M,d),$ we can consider the subspace $(X,d'),$ where $d'$ is the metric inherited from $M.$
Definition 6.2: Let $(M,d)$ be a metric space, and suppose that $X$ is a subset of $M.$ We say that $X$ is a connected subset or connected subspace of $M$ if and only if the subspace $(X,d')$ is a connected metric space.
Recall from Theorem 2.1 that a set is open in a subspace $X$ of $(M,d)$ if and only if it is the intersection of an open set in $M$ with $X.$ We can use this fact to show that the subspace $X=[1,2)\cup(2,3]$ of $\R$ is disconnected. In fact, The set $[1,2)$ is the intersection of the open subset $(-\infty,2)$ of $\R$ with the subspace, so $[1,2)$ is an open set in $X.$ Similarly, $(2,3]$ is the intersection of the open set $(2,\infty)$ with the subspace, so $(2,3]$ is open in $X.$ So the subspace $[1,2)\cup(2,3]$ is a disjoint union of two non-empty open sets, which means by definition that it is not connected. A similar argument shows that if a connected subset $X$ of $\R$ contains two distinct points, then it must also contain every point that lies between those two points. This means any connected subset of $\R$ must be an interval. (Note however that we have not yet proved that all intervals are, in fact, connected. We will return to that question.)
We will finish this short introduction to metric spaces and their properties by proving a few theorems about connectedness. First, we show that connectedness, like compactness, is preserved by continuous functions. That is, the continuous image of a connected metric space is connected.
Theorem 6.2: Let $(A,\rho)$ and $(B,\tau)$ be metric spaces, and suppose that $f\colon A\to B$ is a continuous function from $A$ to $B.$ If $A$ is connected, then its image $f(A)$ is also connected.
Proof: By Exercise 3.9, $f$ is still continuous when considered as a function from $(A,\rho)$ to the subspace $(f(A),\tau')$, so we can assume that $f$ is surjective, that is, we will be done if we prove that if $f$ is a surjective function $f\colon A\to B$, and $A$ is connected, then $B$ is connected.
In fact, we will prove the contrapositive, if $B$ is disconnected, then $A$ is disconnected. So, suppose that $f\colon A\to B$ is a surjective, continuous function and that $B$ is disconnected. We must prove that $A$ is disconnected. Since $B$ is disconnected, there are open subsets $U_1$ and $U_2$ in $B$ such that $B= U_1\cup U_2$ and $U_1\cup U_2=\varnothing.$ Let $\O_1=f^{-1}(U_1)$ and $\O_2=f^{-1}(U_2)$. Since $f$ is continuous, $\O_1$ and $\O_2$ are open by Theorem 3.3. $\O_1\cup \O_2=A$ because for every $a\in A,$ $f(a)$ is in either $U_1$ or $U_2,$ which means $a$ is in either $f^{-1}(U_1)$ or $f^{-1}(U_2).$ And $\O_1$ and $\O_2$ are disjoint, because if there were an $x\in\O_1\cap \O_2$, then $f(x)$ would be in both $U_1$ and $U_2.$ So, $A$ is the disjoint union of the non-empty open sets $\O_1$ and $\O_2$, which means that $A$ is disconnected. ∎
The next theorem is often useful for proving that a set is connected. It is certainly not true that the union of connected sets is connected. (Just consider $[1,2]\cup [3,4].$) However, if a collection of connected sets have a non-empty intersection, then the union is connected.
Theorem 6.3: Let $(M,d)$ be a metric space and suppose that $\{X_\alpha\,|\,\alpha\in A\}$ is a collection of subsets of $M.$ If each $X_\alpha$ is connected and $\bigcap_{\alpha\in A}X_\alpha\not=\varnothing,$ then the union $\bigcup_{\alpha\in A}X_\alpha$ is connected.
Proof: Suppose that the hypotheses of the theorem hold. Let $C$ be the union $C=\bigcup_{\alpha\in A}X_\alpha.$ We need to show that the subspace $(C,d')$ is connected. Let $U_1$ and $U_2$ be open sets in $C$ such that $C$ is the disjoint union of $U_1$ and $U_2.$ To prove that $C$ is connected, we must prove that $C$ is actually contained entirely in one of $U_1$ or $U_2$ (and the other set is therefore empty). Choose $x\in\bigcap_{\alpha\in A}X_\alpha$. We can assume, without loss of generality, that $x\in U_1$. We will show that $C \subseteq U_1.$ Let $z\in C$. We must show $z\in U_1.$ There is an $\alpha\in A$ such that $z\in X_\alpha.$ Since $X_\alpha$ is connected and $X_\alpha$ is a disjoint union of $X_\alpha\cap U_1$ and $X_\alpha\cap U_2$, $X_\alpha$ must be entirely contained in one of $U_1$ or $U_2$. Since $x\in X_\alpha$ and $x\in U_1$, it must be $U_1$ that contains $X_\alpha.$ In particular, $z\in U_1.$ ∎
Finally, we give a complete characterization of the connected subsets of $\R.$ A subset of $\R$ is connected if and only if it is an interval. The term "interval" includes bounded intervals of the form $[a,b],$ $(a,b),$ $[a,b),$ or $(a,b],$ as well as infinite intervals of the form $(-\infty,a],$ $(-\infty,a),$ $(a,\infty),$ $[a,\infty)$ or $(-\infty,\infty).$ The empty set is also considered to be an interval.
Intervals can be defined by the property that whenever an interval includes two points, it includes all the points that lie between those two points. The fact that a set that has this property is an interval of one of the forms listed above is then a theorem. I will give only an outline of a proof: For a bounded set, $I,$ that satisfies the interval property, let $a=\text{glb}(I)$ and $b=\text{lub}(I).$ We show that $I$ must include all the points between $a$ and $b$ and is therefore of one of the forms $[a,b],$ $[a,b),$ $(a,b],$ or $(a,b)$: By the definitions of greatest lower bound and least upper bound, if $a<x<b,$ then there must be an $a' \ge a$ and a $b'\le b$ such that $a'$ and $b'$ are in $I,$ and $a'<x<b'.$ The fact that $x\in I$ then follows from the interval property. For an unbounded interval, the greatest lower bound is replaced by $-\infty,$ or the least upper bound is replaced by $\infty,$ or both.
Theorem 6.4: A subset of $\R$ is connected if and only if it is an interval.
Proof: Suppose that $C$ is a connected subset of $\R.$ To show that $C$ is an interval, suppose $a,b\in C$ with $a<b,$ and let $x$ satisfy $a<x<b.$ If $x$ were not in $C,$ then $C$ would be a disjoint union of the non-empty sets $(-\infty,x)\cap C$ and $(x,\infty)\cap C,$ which are open sets in the subspace $C,$ contradicting the fact that $C$ is connected.
To prove the converse, we need to show that any interval is connected. We show here that a closed bounded interval $[a,b]$ is connected. The remainder of the proof is left as an exercise.
Suppose for the sake of contradiction that the closed, bounded interval $[a,b]$ is not connected. Then $[a,b]$ can be written as a disjoint union, $[a,b]=U\cup V,$ where $U$ and $V$ are non-empty subsets of the subspace $[a,b]$ that are both open and closed in that subspace. Since $U$ is closed in $[a,b],$ then $U=F\cap [a,b]$ for some subset $F$ of $\R$ that is closed in $\R.$ But since $[a,b]$ is itself closed in $\R,$ and the intersection of closed sets is closed, we see that $U$ itself is a closed subset of $\R.$ Similarly, $V$ is closed in $\R.$
Since $[a,b]\subseteq U\cup V,$ we can assume, without loss of generality, that $b\in V.$ Let $c$ be the least upper bound of $U.$ Because $U$ is a closed subset of $\R,$ Exercise 1.10 implies that $c\in U.$ Since $b$ is an upper bound for $U,$ $c\le b.$ Since $V$ is open in $[a,b]$ and $b\in V,$ $V$ must contain an interval $(b-\varepsilon,b]$ for some $\varepsilon>0.$ Since $U$ and $V$ are disjoint, that interval cannot intersect $U.$ This implies that in fact, $c<b.$
Now, the facts that $U$ is open in $[a,b],$ and $c<b$ imply that $U$ contains an interval $[c,c+\delta)$ for some $\delta>0.$ But then the fact that $c+\frac12\delta\in U$ contradicts the fact that $c$ is an upper bound for $U.$ This contradiction proves that the assumption that $[a,b]$ is not connected is false. ∎
Exercises
Exercise 6.1. Consider the metric space $(\Q,d),$ where $\Q$ is the set of rational numbers, using the usual metric that $\Q$ inherits from $\R.$ Suppose that $C$ is a non-empty, connected subset of $\Q.$ Show that $C$ consists of a single point. Hint: Suppose that $C$ contains two distinct points. Let $\lambda$ be an irrational number that lies between those two points. (A metric space in which every connected subset consists of a single point is said to be totally disconnected, so this exercise shows that $\Q$ is totally disconnected.)
Exercise 6.2. Let $X$ be a set and consider the metric space $(X,\delta)$ where $\delta$ is the discrete metric as defined in Exercise 1.5. Show that $X$ is totally disconnected.
Exercise 6.3. Suppose $f\colon \R\to\Q$ is a continuous function, where $\R$ and $\Q$ have their usual metrics. Show that $f$ is a constant function. Hint: This is trivial, using Exercise 6.1 and Theorem 6.2.
Exercise 6.4. Show that the function $g\colon\Q\to\R$ defined by $g(x)=\begin{cases} 1&\text{if $x<\sqrt{2}$}\\ 2&\text{if $x>\sqrt{2}$} \end{cases}$ is continuous, in spite of the jump. Next, let $D=\{1,2\}$ and consider the metric space $(D,\delta)$ where $\delta$ is the discrete metric. (Or, equivalently, consider $D$ as a subspace of $\R$.) Show that a metric space $(M,d)$ is disconnected if and only if there is a continuous surjective function from $M$ to $D.$
Exercise 6.5. Suppose that $(M,\rho)$ is a metric space and $A$ is a subset of $M.$ Show that the function $i\colon A\to M$ given by $i(x)=x$ is continuous, when $A$ is considered as a subspace of $M.$ Now, suppose that $(M,\rho)$ and $(N,\tau)$ are metric spaces and $f\colon M\to N$ is continuous. Prove that if $A$ is a connected subset of $M,$ then $f(A)$ is a connected subset of $N.$ Hint: This is easy, using Theorem 6.2 and the fact that $i$ is continuous.
Exercise 6.6. Finish the proof of Theorem 6.4 by showing that any interval is a connected subset of $\R.$ Hint: Verify that every non-empty interval is a union of a sequence of nested bounded closed intervals, and apply Theorem 6.3.
Exercise 6.7. Use Theorem 6.2 to prove the Intermediate Value Theorem: If $f$ is a continuous function, $f\colon[a,b]\to\R,$ and if $y$ lies between $f(a)$ and $f(b),$ then there is a $c\in [a,b]$ such that $f(c)=y.$
Exercise 6.8. Take it as given that every straight line in $\R^n$ is the image of a continuous function from $\R$ to $\R^n.$ Prove that $\R^n$ is connected.
Exercise 6.9. Is the intersection of connected sets connected? This is true in $\R$ since an intersection of intervals is an interval, but is it true more generally? You can take it as given that sets in $\R^2$ that are "obviously" connected are in fact connected.