TITLE: Every open subset of the real line can be expressed uniquely as a countable union of disjoint open intervals (Pugh Theorem 9, chapter 2)
QUESTION [0 upvotes]: In Real mathematical analysis by Pugh, Theorem 9 of chapter 2 is:

Every open set $\mathbb{U} \subset \mathbb{R}$ can be uniquely expressed as a countable union of disjoint open intervals. The endpoints of the intervals do not belong to $\mathbb{U}$.

I am not getting this theorem. Please explain through example.

REPLY [3 votes]: Because $U$ is open, we can select any point $x_1 \in U$, and we are guaranteed an open interval $I_1 = (x_1\!-\!n, \ x_1\!+\!m)$ such that $I_1 \subset U$.  Choose $n$ and $m$ to be as large as possible while still having $I_1 \subset U$.  Note that it is possible to have $n = \infty$ or $m = \infty$, as would happen with $U = (-\infty, a)$ or $(a, \infty)$ or even just $\mathbb{R}$ itself.
If every point of $U$ is contained in $I_1$, then we are done.  Otherwise, choose a point $x_2 \in U \setminus I_1$ and repeat the above.  Do this repeatedly until we have $\displaystyle \bigcup_k I_k = U$.
All that remains is to check that, if the set of intervals $\{I_k \}$ is infinite, then it is only countably infinite.  Recall that every interval contains a rational number and that $\mathbb{Q}$ is countable.

Example$^\dagger$:  Suppose $U = (0,5) \cup (7,10)$, and suppose we choose $x_1 = 2$.  The largest $n$ and $m$ such that $(2\!-\!n, \ 2\!+\!m) \subset U$ are $n = 2$ and $m=3$.  But notice $I_1 = (2\!-\!2, \ 2\!+\!3) \subsetneq U$.  So we choose a point $x_2 \in U \setminus I_1$, say $x_2 = 8$.  The maximum $n$ and $m$ possible so that $I_2 = (8\!-\!n, \ 8\!+\!m) \subset U$ are $n = 1$ and $m = 2$.  Because $I_1 \cup I_2$ accounts for all the points of $U$, we are done.
$\dagger$ Yeah, the example is kind of silly because it's already written as a union of disjoint open intervals, and we're just recovering already-known information.  Alas, this is unavoidable since all possible examples will be of that form.  Hopefully it's a good concrete illustration nevertheless.
{"set_name": "stack_exchange", "score": 0, "question_id": 2326904}