# Are segments and intervals always subsets of $\mathbb{R}$?

Which of the following is the accepted mathematical practice?

1. Any segment $(a, b)$ or interval $[a, b]$ contains only real numbers. If you want all the rational numbers between $a$ and $b$, you have to write $\{a < q < b | q \in \mathbb{Q}\}$ explicitly; saying "$(a, b)$ in $\mathbb{Q}$" is nonsense.

2. Any segment $(a, b)$ or interval $[a, b]$ contains every number between $a$ and $b$ (including $a$ and $b$ in the interval case). By convention, if nothing to the contrary is specified, then "every number" means every real number. But if you see "$(a, b)$ in $\mathbb{Q}$", you should read $\{a < q < b | q \in \mathbb{Q}\}$.

-
I have seen books write $(a,b) \cap \mathbb Q$ or $[a,b] \cap \mathbb Q$. I am unsure of either of what you write. –  user21436 Feb 16 '12 at 21:35
@Jasper: It wouldn’t be a good idea to do so. Normally A in B is understood to be the verbal equivalent of $A\in B$. –  Brian M. Scott Feb 16 '12 at 21:52

Saying ‘$(a,b)$ in $\mathbb{Q}$’ would be very poor practice; I would not understand it unless there were a context that made the intended meaning clear. The simplest way to describe the set of rationals lying strictly between $a$ and $b$ is the one given by Kannappan in the comments: $\mathbb{Q}\cap(a,b)$ or $(a,b)\cap\mathbb{Q}$. You can, of course, write this out as $$\{p\in\mathbb{Q}:a<p<b\}\;,$$ $$\{x\in(a,b):x\in\mathbb{Q}\}\;,$$ $$\{x:a<x<b\land x\in\mathbb{Q}\}\;,$$ or in even more long-winded ways, but there would rarely be a good reason to do so.
Everything that I’ve said about the open interval $(a,b)$ applies just as well to the closed interval $[a,b]$ and to the half-open intervals $[a,b)$ and $(a,b]$.