46

I have a feeling they are neither closed nor open as the $\mathbb{R} \setminus \mathbb{Q}$ cannot be open or closed either...

6 Answers6

77

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.

Arturo Magidin
  • 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
24

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.

J. W. Tanner
  • 60,406
9

Neither. Their interior is empty and their closure is the entire line.

ncmathsadist
  • 49,383
6

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).

6

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.

Rafa
  • 181
  • 4
0

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.

jw_
  • 509