# Constructing a Homeomorphism with the Cantor Set

This question is about a blog post by Terrence Tao showing that the real line $$\mathbb{R}$$ cannot be expressed as a disjoint union of countably many closed intervals. There are many proofs for this result, but I'm interested in one particular method. We suppose that $$\mathbb{R} = \bigsqcup_{n=1}^\infty [a_n,b_n]$$, and let $$E := \bigsqcup_{n=1}^\infty \{a_n, b_n\}$$ be the set of endpoints of the intervals. From here Tao shows that $$E$$ is closed and perfect, and thus uncountable by a weaker form of the Baire Category Theorem. This is a contradiction.

At the end of the post, Tao mentions that we could alternatively show that $$E$$ has the topological structure of a Cantor set to conclude that $$E$$ is uncountable. I would like to formalize this by constructing a homeomorphism $$f : C \to E$$, where $$C \subseteq [0,1]$$ is the middle-thirds Cantor set; but I'm not sure how to do this. $$E$$ certainly "looks" like $$C$$ from an intuitive standpoint, but has some key differences. Most notably, $$C$$ has a largest and a smallest element, whereas $$E$$ does not. Thus we can't hope to make $$f$$ order-preserving, which was my original plan of attack. Maybe $$E$$ isn't actually homeomorphic to $$C$$, but rather to $$C \setminus \{0,1\}$$? This feels plausible, but again I'm not sure. How should I proceed?

Edit: I realize now that $$E$$ and $$C$$ can't possibly be homeomorphic, since $$C$$ is compact while $$E$$ is not. So maybe the homeomorphism is in fact between $$C \setminus \{0,1\}$$ and $$E$$?

The way we construct it is quite similar: define $$A_0=\mathbb{R}$$ and $$A_n=A_{n-1}\backslash (a_n,b_n)$$. Note that intervals are open. Then define $$C=\bigcap_{i=1}^\infty A_n$$. So, if all $$[a_n,b_n]$$ cover $$\mathbb{R}$$ then we have to have $$C=E$$.
This $$C$$ space is a variant of Cantor set, except non-compact and with non-equal pieces at each step of the construction. It deifnitely is uncountable by the same argument why the Cantor set is. And it goes as follows:
Given a function $$f:\mathbb{N}\to\{-1,1\}$$ we can associate it with a point in $$C$$. First define a sequence $$I_n$$ of subsets as follows: $$I_0=\mathbb{R}$$, while $$I_n$$ is the intersection of $$I_{n-1}$$ with either $$(-\infty,a_m)$$ if $$f(n)=-1$$ or with $$(b_{m'},\infty)$$ if $$f(n)=1$$. Those $$m,m'$$ are the smallest $$m,m'$$ making the intersection nonempty (if you draw how those intervals may distribute you will know why it is so). So in other words the $$f$$ sequence gives us a binary walk in the Cantor set construction: $$-1$$ tells us to go left, while $$1$$ to go right at the next $$[a_m,b_m]$$ interval we see. Then define a sequence $$x_n$$ as an arbitrary point of $$I_n$$. As long as $$f$$ changes sign at least once it will give us a bounded sequence, and in fact convergent. Then the limit has to belong to $$C$$, and it is a matter of calculation that the association $$f\mapsto\lim x_n$$ has to be injective. Of course we need to get rid of the two problematic constant functions $$f\equiv 1$$ and $$f\equiv -1$$ (which in the normal Cantor set would yield endpoints).
And so since there are uncountable many functions $$\mathbb{N}\to\{-1,1\}$$ we must have that $$C$$ is uncountable. The association $$f\mapsto\lim x_n$$ is also surjective. And it is likely that it is continuous (with the infinite product of discrete spaces as topology for $$\{-1,1\}^\mathbb{N}$$), which leads to the conclusion that $$E$$ has to be homeomorphic to the standard Cantor set minus two endpoints. Although honestly I did not check continuity, and can't guarantee that.