# Compact subsets of the real numbers

Let $C\subset \mathbb{R}$ be compact. I am wondering if

$$C=\bigcup_{i=1}^n[a_i,b_i]$$

then for some $a_i,b_i\in\mathbb{R}$, $a_1\le b_1 < a_2 \le b_2 \dots < a_n \le b_n$. By Heine-Borel, $C$ does indeed lie in some interval $[a,b]$, but is it the finite disjoint union of such intervals?

Could not find a proof for myself yet. Perhaps this is even wrong?

-
What about the set $\{0\}\cup\bigcup_{n=1}^{\infty}[1/(2n+1),1/(2n)]$? I think it is compact (because I've explicitly added the accumulation point $0$), but it definitely not an union of finitely many intervals) – celtschk Jul 3 '12 at 17:14
It seems to me that as written the thing on the right is just $[a_1, a_{n+1}]$. – Dylan Moreland Jul 3 '12 at 17:18
Of course - I didn't mean this. Thanks for the hint, I've edited the question. – Sh4pe Jul 3 '12 at 23:48

Note that the interval $[x,y]$ has an interior, that is an open set contained in it, whenever $x<y$.

We know that there are compact sets whose interior is empty and cannot be written as such unions.

One example is $\{0\}\cup\{\frac1n\mid n\in\mathbb N\}$. It is bounded in $[0,1]$ and closed since it is really just a convergent sequence and its limit point.

-
Perfect - thank you. That is a simple, easy to understand counterexample. Makes me sort of wonder how I could not come up with it by myself. One more reason to like math.stackexcange.com :) – Sh4pe Jul 3 '12 at 23:52
@Sh4pe: Thank you. About counterexamples, it is often that you see in mathematics simple counterexamples but it takes quite some time before you can produce them on your own. First you need to know a lot of them, then you need to also know a lot about how to do mathematics in order to pinpoint the reason for the counterexample and then you need to have enough knowledge in order to construct a simple counterexample. These things take time... – Asaf Karagila Jul 4 '12 at 6:18

There are many compact subsets of $\Bbb R$ that are not the union of finitely many closed intervals. A very simple example is the set $$C=\{0\}\cup\left\{\frac1n:n\in\Bbb Z^+\right\}\;;$$ any other convergent sequence with its limit point would do just as well. A more interesting example is the middle-thirds Cantor set, every point of which is a limit point of the set.

-
I didn't know that $\left\{\frac1n\right\}$ is a real number! – Asaf Karagila Jul 3 '12 at 17:24
@Asaf: It must be an extrareal number! (I changed notation in midstream but did so incompletely.) – Brian M. Scott Jul 3 '12 at 17:32
I also want to point out that it is very amusing that essentially you answer is the union of Arturo's answer and my answer; and the vote count of your answer is the sum of votes on both our answers (at time of commented). – Asaf Karagila Jul 3 '12 at 17:34
@Asaf: Well, given that $\{x\} = x-\lfloor x\rfloor$ is not an uncomon notation, maybe you should have known (-: – Arturo Magidin Jul 3 '12 at 23:56
@Arturo: But that would mean that the set Brian wrote is $\{0,1\}$, and I was pretty sure this was not what he meant! :-) – Asaf Karagila Jul 4 '12 at 6:16

The Cantor set is closed and bounded, hence compact. But it is not a finite union of intervals.

-