# property of real number system

"Between every two rational numbers there exist infinite irrational numbers and between every two irrational numbers there exist infinite rational numbers.

Is this statement correct? If it is, then doesn't it contradict Thomae's function continuity at irrational numbers?

• I am not convinced about the second part of the statement "between every two irrational numbers there exist infinite rational numbers." hope somebody more in this field can tell more about this point. – Willemien Aug 23 '13 at 12:41
• @Willemien If the two irrational numbers are $x$ and $y$ consider the rational numbers with denominator $n\gt 2|x-y|$ Pick any fixed $n=N$ which satisfies thic condition. Then there are two fractions with denominator $N$ between $x$ and $y$. Between those to fractions it is easy to see that there will be an infinite number of rationals. – Mark Bennet Aug 23 '13 at 12:49
• that doesn't work because between every rational number and irrational number there is again an other irrational number so you get a into a contradiction – Willemien Aug 23 '13 at 14:28
• For example let x be the largest irrational number smaller than SquareRoot(2) and let y be smallest irrational number larger than SquareRoot(2) which rational numbers are between x and y ? – Willemien Aug 23 '13 at 16:30
• @Willemien: There is no "largest irrational number smaller that SquareRoot(2)", nor a "smallest irrational number larger than SquareRoot(2)". There are other irrational numbers (and, as is the point here, rational numbers) arbitrarily close to SquareRoot(2). – Henry Aug 23 '13 at 17:14

## 3 Answers

Between every two distinct rational/irrational numbers there are infinitely many irrational/rational numbers [respectively] - this is true.

But this does not contradict the continuity of Thomae's function at the irrational points. At an irrational number $r$ the value of the function is $0$. At nearby rational numbers the value is non-zero, but by restricting the interval $(r-\delta,r+\delta)$ by making $\delta$ sufficiently small, we can make sure that the only rationals in the interval have denominator $q\gt \frac 1{\epsilon}$ so that the value of the function at each of the infinitely many rational points in the interval is as small as we choose.

The statement is correct and it does not contradict the fact that Thomae's function is continuous precisely at the irrationals.

"Between every two rational numbers there exist infinite irrational numbers and between every two irrational numbers there exist infinite rational numbers."

This statement is true.

We know that, between any two rational numbers $\frac{a}{b}$ and $\frac{c}{d}$ with $\frac{a}{b}<\frac{c}{d}$ we can find a third rational number. One way would be to define the third rational as $$\frac{a}{b}+\frac{1}{2}\left( \frac{c}{d} - \frac{a}{b} \right) = \frac{bc+ad}{2bd}.$$ This process could be repeated to generate an infinite quantity of rational numbers between $\frac{a}{b}$ and $\frac{c}{d}$.

We can also find an irrational between any two rationals. Again using $\frac{a}{b}$ and $\frac{c}{d}$, establish a common denominator, leaving us with $\frac{ad}{bd}$ and $\frac{cb}{bd}$. Since $a$, $b$, $c$, and $d$ are integers and $ad<cb$, we know that $ad+1 \leq cb$. Let $q = \frac{\sqrt{2}}{2} <1$. It follows that $$\frac{ad}{bd} < \frac{ad+q}{bd} < \frac{cb}{bd}.$$ Thus, we can find an irrational between any two rational numbers.

Combining these two facts, we see that the first half of the statement, "between every two rational numbers there exist infinite irrational numbers", is true. The second half follows by very similar logic.

Many proofs of this fact rely on density of the rationals and irrationals in the reals. In this context, a set $S$ of numbers is dense in $\mathbb{R}$ if, for every interval $I=(a,b)$ where $a<b$, $I$ contains an element of $S$. You will run into this if you do any further reading on the subject.

As for your question about Thomae's function, your Wikipedia link already includes a clearly written informal proof of continuity at the irrationals. I don't know your current knowledge level, so if the following is too simple, please forgive me.

In order to understand the informal proof in your link, you will need to know that $\lceil x \rceil$ and $\lfloor x \rfloor$ refer to the ceiling and floor functions. You will also need the epsilon-delta definition of a limit. After that, the informal proof is quite approachable.

• sorry but I think you are mistaken, there is not always a rational number between two irrationals, For example let x be the largest irrational number smaller than SquareRoot(2) and let y be smallest irrational number larger than SquareRoot(2) which rational numbers are between x and y ? – Willemien Aug 23 '13 at 16:45
• @Willemien - There is no largest/smallest irrational number smaller than SquareRoot(2). Other posters have already pointed this out but, as a somewhat ridiculous example, consider that you can generate a rational number which is arbitrarily close to SquareRoot(2) simply by truncating the decimal representation at the required precision and dividing by 10^n where n is the number of digits after the decimal. For example, SquareRoot(2) ~= 1.4142 and thus, 14142/10^4 is a rational which is close to SquareRoot(2). Keep adding digits to get arbitrarily close. – Aaron Taylor Aug 23 '13 at 19:55