# Why is the complement of any perfect totally disconnected subset of $\mathbb{R}$ a countable union of disjoint intervals?

The cantor set $$C$$ is obtained by repeatedly removing the middle $$1/3$$, starting from the interval $$[0,1]$$. Since the number of intervals removed in each step of construction is finite, $$[0,1] \backslash C$$ is the union of only countable many disjoint intervals.

In a topology book, there is a proof of the fact that a perfect totally disconnected subset on $$\Bbb{R}$$ is homeomorphic to $$C$$. In the proof, it is claimed that if a set $$A$$ is perfect and totally disconnected, then $$R\backslash A$$ is consisted of countably many disjoint intervals. This is true if $$A=C$$, but I don't know why it is true for such $$A$$ in general. Is there a simple explanation for this claim? Can't there be uncountably many intervals in $$R\backslash A$$?

• That's confusing. Every open subset of reals is a union of countably many disjoint intervals. This follows because connected components are open intervals and every connected component is a connected component of some rational. – freakish Jan 7 at 13:08
• @freakish Presumably "countable" is used in the sense of "countably infinite". – Robert Israel Jan 7 at 13:11

So first of all every open subset of $$\mathbb{R}$$ is a countable union of disjoint intervals. I leave this as an exercise.
If you ask why $$\mathbb{R}\backslash A$$ is not a finite union of intervals then the argument goes as follows: assume that $$U=\mathbb{R}\backslash A$$ is a finite union of open intervals. Then $$A$$ is a finite union of closed intervals. Here I treat singletons $$\{x\}$$ as closed intervals as well. So write down $$A=\bigcup_{i=1}^n C_i$$ where each $$C_i$$ is a closed interval and they are pairwise disjoint.
If any of $$C_j$$ is a singleton then $$A$$ cannot be perfect. Indeed, let $$C_j=\{x\}$$. Since there are only finitely many $$C_i$$'s then some small neighbourhood $$V$$ of $$x$$ cannot intersect any of $$C_i$$ except for $$C_j$$. Otherewise either $$x$$ belongs to some bigger interval (contradiction with $$C_j$$ being a singleton) or there are infinitely many $$C_i$$ "converging" to $$x$$ (contradiction with finite number of $$C_i$$). Therefore $$x$$ is isolated and so $$A$$ is not perfect. Contradiction.
It follows that all $$C_i$$ are proper intervals. But each $$C_i$$ is a connected component of $$A$$. That contradicts $$A$$ being totally disconnected.