I have a feeling they are neither closed nor open as the $\mathbb{R} \setminus \mathbb{Q}$ cannot be open or closed either...
-
3$ \mathbb{R}$ is the closure of $ \mathbb{Q}$ ... – The Chaz 2.0 Mar 05 '12 at 16:13
-
4If you know $\mathbb{R} \ \mathbb{Q}$ is not open or closed, then you know all you need. The complement of an open set is closed and the complement of a closed set is open. – GeoffDS Mar 05 '12 at 16:14
-
No, they are not. – Kris Harper Mar 05 '12 at 18:59
-
possible duplicate of Proving that $\mathbb{Q}$ is neither open or closed in $\mathbb{R}$ – Asaf Karagila Mar 05 '12 at 21:26
-
@AsafKaragila Why did you not vote on this one? – Rudy the Reindeer Apr 21 '12 at 21:44
-
@MattN.: I have, closing votes expire after a while. – Asaf Karagila Apr 21 '12 at 21:45
-
@AsafKaragila I sort of like the answers here. What do we do? – Rudy the Reindeer Apr 21 '12 at 21:46
-
Does this answer your question? Proving that $\mathbb{Q}$ is neither open or closed in $\mathbb{R}$ – Alex M. Jan 15 '23 at 16:31
6 Answers
In the usual topology of $\mathbb{R}$, $\mathbb{Q}$ is neither open nor closed.
The interior of $\mathbb{Q}$ is empty (any nonempty interval contains irrationals, so no nonempty open set can be contained in $\mathbb{Q}$). Since $\mathbb{Q}$ does not equal its interior, $\mathbb{Q}$ is not open.
The closure of $\mathbb{Q}$ is all of $\mathbb{R}$: every real number is the limit of a sequence of rationals, so every real number lies in the closure of $\mathbb{Q}$. Since $\mathbb{Q}$ does not equal its closure, it is not closed.
Naturally, since $\mathbb{Q}$ is not open, its complement is not closed; since $\mathbb{Q}$ is not closed, its complement is not open.
But this is in the usual topology. $\mathbb{R}$ can be endowed with lots of topologies, and it is certainly possible for $\mathbb{Q}$ to be open (or closed) in some of them. For example, in the discrete topology, where every subset of $\mathbb{R}$ is both open and closed, $\mathbb{Q}$ is both open and closed.

- 398,050
-
It seems to me that the situation is the same for any dense subset of $\mathbb{R}$ which is not equal to $\mathbb{R}$. – Smiley1000 Oct 21 '22 at 13:15
-
1@Smiley1000 there are open dense subsets that don't equal everything. – Arturo Magidin Oct 21 '22 at 13:22
-
Right. However, I think that if we require $S \subseteq \mathbb{R}$ and its complement to be dense, then neither of them will be open or closed. Since the complement is dense, any open interval will contain numbers not in $S$ and so $S$ will not be open. Since $S$ is dense, any real number is a limit of a sequence of elements of $S$, but $S$ is not everything, so it's not closed either. Is that correct? – Smiley1000 Oct 21 '22 at 18:30
-
2@Smiley1000 Correct, but harder than needed. If $S\neq\mathbb{R}$ is dense, then it is not closed, since the closure is not equal to $S$. If $\mathbb{R}\setminus S$ is also dense, then the complement is likewise not closed (it cannot equal $\mathbb{R}$, since $S$ cannot be empty). Neither $S$ nor its complement is closed, and so neither $S$ nor its complement is open. – Arturo Magidin Oct 21 '22 at 18:32
If the rationals were an open set, then each rational would be in some open interval containing only rationals. Therefore $\mathbb{Q}$ is not open.
If $\mathbb{Q}$ were closed, then its complement would be open. Then each irrational number would be in some interval containing only irrational numbers. That doesn't happen either. This one is harder to prove: showing that every interval on the line contains some rationals depends on the fact that the ordered field $\mathbb{R}$ is Archimedean.

- 60,406
They are neither open nor closed. Note that they cannot be closed since the closure of $\mathbb{Q}$ is $\mathbb{R}\ne \mathbb{Q}$, but they cannot be open either since the same holds for their complement (as you pointed out).

- 14,792
Remember that in metric spaces (those with a notion of distance), we can check if a set $A$ is closed by checking that the limits of elements in $A$ rest in $A$ (i.e., for any convergent sequence $(a_i)_{i\in\mathbb{N}}$, such that $a_i\in A$, then $\lim_{i\to +\infty} a_i \in A$ ).
$\mathbb{R}$ with the usual distance ($d(x,y)=|x-y|$) is probably the typical example of a metric space.
With that in mind, if $\mathbb{Q}$ were closed, then any sequence of rationals would converge in the rationals, which we know is false; for example:
$$(1+1/n)^n \to e.$$
On the other hand, if $\mathbb{Q}$ were open, then its complement ($\mathbb{I}$, the irrationals) would be closed, which again we can easily see that it's not. (E.g., take any sequence of rationals that converges to an irrational and subtract from each element in the sequence this irrational: where will it converge?)
But even though $\mathbb{Q}$ is neither open nor closed, it is not that complicated topologically speaking. $\mathbb{Q}$ is what we call an $F_\sigma$ set ($F$ from fermé (closed in French), and $\sigma$ from sum (meaning union)). These are sets that are countable unions of closed sets. A bunch of natural examples of sets are $F_\sigma$, such as the points of discontinuity of a function. The "dual" class is known as $G_\delta$, the countable intersections of open sets.

- 181
- 4
For the non-openness:
Open intervals are a basis of the standard topology for R.
A topoloogy T equals the collection of all unions of elments of its basis B, then each open set is a union of elements from basis B, then each open set at least contains one open intervals as an element of a basis, then each open set will contain irrational numbers. Then any set that doesn't contain irrational number won't be an open set.

- 509