# Show that a subset $A$ of $R$ is open iff it is countable union of open intervals

Let me prove subset $A$ of $\mathbb{R}$ is open if and only if it is a countable union of open intervals.

For all $x \in A$ there is an $\epsilon > 0$ such that $(x-\epsilon,x+\epsilon)$ is an open interval contained in $A$. Now find rationals such that $r_{x} \in (x-\epsilon,x)$ and $s_{x} \in (x,x+\epsilon)$ and $A = \bigcup_{x \in A}(r_{x},s_{x})$. Note that the intervals with rational end points is less than $\mathbb{Q} \times \mathbb{Q}$. Obviously $\mathbb{Q} \times \mathbb{Q}$ is countable.

My doubt is that instead of selecting rationals can I select irrationals.

-
I edited your question a bit and added a bit of clarification. I had to make some assumptions about what you meant, so let me know if any of them were off the mark – kahen Jan 26 '11 at 11:55
Surely you want to prove that a subset of $\mathbb{R}$ is open iff it is a countable union of disjoint intervals? – Pete L. Clark Jan 26 '11 at 12:27
@Pete.No.Need not be disjoint intervals. – Vinod Jan 26 '11 at 12:29
The point being that in any context you know in which open sets make sense, it is more or less a triviality to show that any union of open subsets is open, and any open subset is a union of even one open subset (itself). What I suggested above is a more contentful standard exercise that is particular to $\mathbb{R}$. – Pete L. Clark Jan 26 '11 at 12:31
Anyway, what I suggested above is at least a true fact that one might try to prove. – Pete L. Clark Jan 26 '11 at 12:32

$\mathbb{R}$ is locally connected, so the connected components of open sets are open. So if $O$ is open, write it as the (disjoint) union of its connected components, which are open (as said) and connected and thus intervals or segments, or $\mathbb{R}$ itself. As all of these are (at most countable) unions of intervals. Because every different component must contain a different member of $\mathbb{Q}$, there are at most countably many components, and thus countably many intervals to write $O$ as a union all together.

-

First of all, you should change your statement: instead of "open subsets" you should say "open intervals". Otherwise, as Pete L. Clark observes, every open set is the union of one open subset, namely itself.

As for your proof, I don't see how you can assure the existence of your rational numbers $r_x$ and $s_x$ such that $A = \bigcup_{x\in A} (r_x, s_x)$ and indeed there is no need for doing so.

Instead, I would proceed as Henno Brandsma, but let me write it using less results perhaps: if you have an open set $U \subset \mathbb{R}$, for every point $x\in U$ there exists an open interval $I_x$ such that $x\in I_x \subset U$, by definition of open sets of the real line (with the standard topology). Hence $U = \bigcup_{x\in U} I_x$.

Now, pick a rational number $r_x \in I_x$ for every $x\in U$. You can do this because rationals are dense in $\mathbb{R}$. Since there is only a countable number of rational numbers, you're done.

(And yes: you could also pick an irrational number for each $x$: so what?)

-

I do not think picking a rational number as the upper and lower bound is correct. Let A be your open set. Then define, for each $x \in A$, $$r_x = inf \lbrace x_0 : (x_0,x) \subset A \rbrace$$ $$s_x = sup \lbrace x_0 : (x,x_0) \subset A \rbrace$$ Then $(r_x,s_x)$ will be the maximal open interval containing $x$ that is a subset of $A$ as well. In particular, you can show that the endpoints to not belong into these intervals, and secondly, that for two points $x,y \in A$, the intervals $(r_x,s_x)$ and $(r_y,s_y)$ are either disjoint or equal (by maximality). Then note that you can only have a countable amount of disjoint open intervals in $\mathbb{R}$ (select a rational number in each...).

-