# Union of two compact totally disconnected sets in $\mathbb{R}$ is totally disconnected

I'm so stuck with the next problem. First, the definition that I have are the next:

$X$ is totally disconnected if for all $x\in X$ we have that $C_x=\{x\}$ where $C_x$ is the connected component.

Let $A,B\subseteq\mathbb{R}$ be a compact and totally disconnected sets. Prove that $A\cup B$ is also totally disconnected.

We have two cases:

1) If $A\cap B=\emptyset$ then, take $x\in A\cup B$ and $C_x$ the connected component of $x$. Because $\mathbb{R}$ is normal and $A,B$ are two disjoint closed sets (they are compacts) then there exists $U,V\subseteq\mathbb{R}$ disjoint open sets such that $A\subseteq U$ and $B\subseteq V$. Therefore, without loss of generality, because $C_x$ is connected, $C_x\subseteq U$ and thus $C_x\subseteq A$. We conclude that $C_x=\{x\}$.

2) $A\cap B\neq\emptyset$. Here is where I'm stuck. Take $x\in A\cup B$ and suppose by contradiction that $|C_x|\geq 2$. Then, $C_x\not\subseteq A$ and $C_x\not\subseteq B$ (because the connected sets in $A$ and $B$ have only one point) but $C_x\cap A\neq\emptyset$ and $C_x\cap B\neq\emptyset$. I don't know how can I conclude the proof. Any hint? I really appreciate any help you can provide.

• Wouldn't any connected component of $x$ be some interval? If you had an interval contained in $A\cup B$, then by compactness.... Commented Apr 9, 2018 at 3:39
• The compactness is essential, as witnessed by $A =\mathbb{Q}$, $B= \mathbb{P}$ (the irrationals). Commented Apr 9, 2018 at 7:24
• @mathworker21: Why would a connected component be an interval? Commented Apr 9, 2018 at 13:09
• @tomasz Every connected subset of $\mathbb{R}$ is an interval. An interval is a subset such that if $a, b\in I$ and $c\in\mathbb{R}$ is such that $a<c<b$ then $c\in I$. If $I$ is not an interval then this $c$ divides $I$ into two nonempty, open and disjoint subsets, namely $(-\infty, c)\cap I$ and $(c, \infty)\cap I$ Commented Apr 9, 2018 at 13:13

First of all recall that a subset of $\mathbb{R}$ is connected if and only if it is an interval. The same holds for intervals as well: a subset of an interval is connected if and only if it is again an interval. Here by interval I understand a subset $I\subseteq\mathbb{R}$ such that if $a,b\in I$ and $a<c<b$ for some $c\in \mathbb{R}$ then $c\in I$.
Assume that $A\cup B$ is not totally disconnected. Then $[a,b]\subseteq A\cup B$ for some $a,b\in A\cup B$, $a<b$. Let $I=[a,b]$.
Since both $A,B$ are compact (actually closed in $\mathbb{R}$ is enough) then $I\cap A$ and $I\cap B$ are closed. Both are nonempty and their union is $I$ and thus we can rephrase the problem:
Show that a closed interval $I=[a,b]$, $a<b$ cannot be written as a union of two non-empty, closed and totally disconnected subsets.
Let $I=A\cup B$. Both subsets have to be proper otherwise they wouldn't be totally disconnected. Since $A$ is closed then $I\backslash A$ is open in $I$. Thus $I\backslash A\subseteq B$ and so $B$ is not totally disconnected because it contains an open subset of $I$ (which contains an interval by definition). Contradiction.