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
We know that $\R$ is a complete metric space.

Let $x \in I$.

Since $I$ is open, there is an open interval $I_x$, contained in $I$, that contains $x$.

Define the following:

The existence of $I_x$ assures us that we have $a\left({x}\right) < x < b\left({x}\right)$.

In this way we associate a non-empty open interval $J\left({x}\right) = \left({ a\left({x}\right)\,.\,.\,b\left({x}\right) }\right)$ to $x \in I$.

From the definitions of infimum and supremum, we conclude that both $\left({{ a\left({x}\right) }\,.\,.\,{x}}\right) \subseteq I$ and $\left({{x}\,.\,.\,{ b\left({x}\right) }}\right) \subseteq I$. Therefore, as we have:


 * $J\left({x}\right) = \left({{ a\left({x}\right) }\,.\,.\,{x}}\right) \cup \left\{ {x}\right\} \cup \left({{x}\,.\,.\,{ b\left({x}\right) }}\right)$

we conclude that $J\left({x}\right) \subseteq I$.

Suppose now that we have $a\left({x}\right) = -\infty$ or $b\left({x}\right) = \infty$.

If both are the case, it must be that $I = \R$, and hence $I$ is open. It can then also be written uniquely as the pairwise disjoint union of the single open interval $\R$.

In other cases, we observe that intervals of the type $K_-\left({a}\right) = \left({ -\infty\,.\,.\,a }\right)$ or $K_+\left({a}\right) = \left({ a\,.\,.\,\infty }\right)$ are open.

Assume $I$ contains such an interval $K_\pm\left({a}\right)$ with $a \notin I$. Then we have:
 * $\displaystyle I = \left({I \cap K_-\left({a}\right)}\right) \cup \left({I \cap K_+\left({a}\right)}\right)$

Thus $I$ is open iff $I \setminus K_\pm\left({a}\right)$ is open, since the $K_\pm\left({a}\right)$ are disjoint, open sets.

It is also clear that a unique decomposition of $I \setminus K_\pm\left({a}\right)$ into disjoint open intervals will give rise to such a decomposition for $I$.

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

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

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

Therefore, by the Fundamental Theorem on Equivalence Relations, $\sim$ partitions $I$.

In fact, the equivalence classes are open intervals.

Finally, as $\left({{ a\left({x}\right) }\,.\,.\,{ b\left({x}\right) }}\right) \neq \emptyset$, of by Rationals Dense in Reals there exists $q \in \left({{ a\left({x}\right) }\,.\,.\,{ b\left({x}\right) }}\right) \cap \Q$.

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

Since the Rational Numbers are Countable the partition is countable.

Then enumerating the disjoint intervals of $I$, we have an expression:


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