# Set of rational numbers bounded between two irrationals is a closed set?

Consider the metric space $\mathbb{R}$ equipped with the standard distance metric. Let $S$ be a set of rational numbers in the open interval $(a,b)$ where $a$ and $b$ are irrational. Prove that $S$ is closed in the set of rational numbers $\mathbb{Q}$.
Attempt:

$S^c = \{x \in \mathbb{Q} : x \leq a \} \cup \{x \in \mathbb{Q} : x \geq b \}$

Let $x < a$. Choose $\epsilon = a-x$. We can find a $N$ such that $1/N < \epsilon$.
This implies that $x + 1/N$ is rational and less than $a$. A similar argument can be made for $x > b$.
So we see, that $\forall x \in S^c, \exists \epsilon > 0$ such that $B_{\epsilon}(x) \subset S^c$. So $S^c$ is open and so $S$ is closed.

Does this make sense?

• This is correct (and presumably the intended answer). – Mees de Vries May 2 '16 at 11:20
• "Closed" in which ambient space X and for which topology on X? – Did May 2 '16 at 11:39
• @MeesdeVries: It's close, but not quite there. – Cameron Buie May 2 '16 at 12:37
• Please answer the question that @Did asked and include it in your question. – zhw. May 2 '16 at 16:57
• Except that now, "Consider the metric space $\mathbb{R}$ equipped with the standard distance metric" and "Prove that $S$ is closed in the set of rational numbers $\mathbb{Q}$" are contradictory. If the ambient space is $X$ and if one is given $S\subset Y\subset X$, please explain what you mean by "$S$ is closed in $Y$". – Did May 2 '16 at 17:16

## 2 Answers

One thing that I'd adjust is this: you never used the fact that $a,b$ are irrational. In particular, that lets you conclude that $a,b\notin S^c,$ so that $$S^c=\{x\in\Bbb Q:x<a\}\cup\{x\in\Bbb Q:x>b\}.$$ (Do you see why this is important?)

Another thing I'd adjust is the part with $N$--it doesn't really help you show that $B_\epsilon(x)\subseteq S^c.$ Rather, take $\epsilon=a-x$ as you did, and take any $y\in B_\epsilon(x),$ meaning that $y\in\Bbb Q$ and $|y-x|<\epsilon.$ In particular, since $y-x\le|y-x|,$ it then follows that $y<a.$ (Do you see how?) Consequently, $y\in S^c,$ and since $y\in B_\epsilon(x)$ was arbitrary, then $B_\epsilon(x)\subseteq S^c,$ as desired.

• That's definitely a tighter proof. Thanks. – sid May 2 '16 at 13:31
• @Cameron Buie can you please provide a hind about compactness of this set? – gaurav saini Sep 23 '19 at 12:23
• @gaurav: What do you mean? This question doesn't have anything to do with compactness. – Cameron Buie Sep 23 '19 at 12:52

Here is another proof of this.

Theorem. Let $S$ be a subset of the metric space $M$. $X \subseteq S$ is closed in $S$ if and only if there is an open set $A$ in $M$ such that $X=S\cap A$.

Using this theorem for your example, $A=[a,b]$ is closed in $\mathbb{R}$. Also, $X=\{y\,|\,y\in\mathbb{Q}\,\text{and}\,y\in(a,b)\}$. We see that $X=\mathbb{Q}\cap A$ because $a$ and $b$ are irrational numbers. So $X$ is closed in $\mathbb{Q}$.