Open Sets in Real Number Line

Theorem
Every non-empty open set $I \subseteq \R$ can be expressed uniquely as a countable union of pairwise disjoint open intervals.

Proof
Let $x \in I$.

Since $I$ is open, there is an open interval contained in $I$ containing $x$.

Let:


 * $a(x) = \sup\{ y : (x,y) \subseteq I \} \qquad (1)$


 * $b(x) = \inf\{ z : (z,x) \subseteq I \} \qquad (2)$

In this way we associate an interval $J(x) = (a(x),b(x))$ to each $x \in I$.

Suppose for some $x$ we have $a(x) = -\infty$ or $b(x) = \infty$.

Intervals of the type $K(a) = (-\infty,a)$ or $K(a) = (a,\infty)$ are open.

Therefore, if $I$ contains such an interval $K(a)$ with $a \notin I$ then $I$ is open if and only if $I \backslash K$ is open (because the union of two open sets is open).

Therefore we assume $I$ contains no such interval without loss of generality.

Suppose there exists $b(x) > y \in J(x)$.

By the definition of the supremum there is $\epsilon > 0$ such that $b(x) - \epsilon > y$.

Now, possibly shrinking $\epsilon$, we have $y \in (a(x)+\epsilon,b(x)-\epsilon) \subseteq I$, so $y \in I$.

Therefore $J(x) \subseteq I$.

Note also that if $b(x) \in I$, then (because $I$ is open) for some $\epsilon > 0$ we have $(b(x) - \epsilon, b(x) + \epsilon) \subseteq I$.

Then $b(x)$ is not maximal as in $(2)$, a contradiction.

Define an relation $\sim$ on $I$ by $x \sim y$ if $x \in J(y)$.

Then $\sim$ is an equivalence relation on $I$.

Therefore $\sim$ partitions $I$ into open sets.

Finally notice that if $(a(x),b(x)) \neq \emptyset$, of by Rationals Dense in Reals there exists $q \in (a(x),b(x))\cap \Q$.

Therefore each set in the partition of $I$ can be labeled with a rational number.

Since the Rational Numbers are Countable the sets of the partition are countable.

Then picking an enumeration of the dijoint intervals of $I$ we have an expression:


 * $ I = \bigcup_{n \in \N} J_n $