Suppose $i_1$ and $i_2$ are distinct irrational numbers with $i_1 < i_2$. Is it necessarily the case that there is a rational number $r$ in the interval $[i_1, i_2]$? How would you construct such a rational number?

[I posted this only so that the useful answers at https://math.stackexchange.com/questions/414036/rationals-and-irrationals-on-the-real-number-line/414048#414048 could be merged here before that question was deleted.]

  • 62,206
  • 36
  • 276
  • 489
  • 7
    Yes, there is. This is known as the "density of the rationals in the reals", which says in fact that between any two reals numbers there is a rational number. – Avi Steiner Jun 16 '13 at 02:24
  • 1
    Related: [Show that $\Bbb Q $ is dense in the real numbers](http://math.stackexchange.com/questions/226793/show-that-mathbbq-is-dense-in-the-real-numbers-using-supremum) – MJD Jun 16 '13 at 02:37
  • 5
    So, wait... you asked the question, pointed to another question that already answers this... and then answered this question several days before asking it? **TIME TRAVELER!!!** – BlueRaja - Danny Pflughoeft Jun 16 '13 at 05:25
  • @BlueRaja-DannyPflughoeft yeah, I thought that, then I read the [bit in brackets in the question]. – Lucas Jun 16 '13 at 05:53

5 Answers5


Let $x,y\in\mathbb{R}$, $x\neq y$. Without loss of generality, suppose $x<y$. Then there exists a positive $z$ such that $y-x=z$.

By Archimedes' axiom, there exists a natural number $n$ such that $$n > \dfrac{1}{z}$$ $$nz > 1$$ $$ny - nx > 1$$ So there exists an integer $m$ such that $$nx < m < ny$$ $$x < \frac{m}{n} < y$$ i.e. $m/n$ is a rational number between $x$ and $y$.

Since $x$ and $y$ can be any real numbers, in particular they can be irrationals.

  • 1,439
  • 2
  • 14
  • 19
  • 2
    How do you know $\exists m\in\mathbb Z:nx – Alex D Feb 18 '18 at 18:24
  • 1
    Hadn't really worked it out formally, but I think this works. Seems a bit complicated -- I'd be happy to hear an improvement. Let $a=nx, b=ny$. We want to show $b-a>1\implies\exists m\in\mathbb{Z},\ a1$ and $\lfloor b \rfloor-1>y$ is your $m$. Now assume $b\notin\mathbb{Z}$, so $\lfloor b \rfloor1\implies b>a+1\implies \lfloor b \rfloor+1>a+1$ and $\lfloor b \rfloor>y$ is your $m$. – joeA Feb 18 '18 at 23:33
  • 1
    @AlexD It seems I mixed in a $y$ in a few places where there should be an $a$. Sorry about that. Too late to edit. Hopefully it is still clear. – joeA Feb 19 '18 at 03:01
  • No worries, I was asking because I was trying to understand the proof myself for my intro to analysis class. I found the step in another proof: $nx\in\mathbb R\implies\exists w\in\mathbb Z:w\le nx – Alex D Feb 19 '18 at 03:48
  • 2
    we can specifically choose $n = \lceil \frac{1}{z} \rceil$, and $m = \lceil n \times x \rceil$ – micsthepick May 09 '18 at 01:22
  • 2
    Say that you have, $ny-nx>1$. Then you have $ny-1>nx$. Now, we know that, between $ny$ and $ny-1$ there exists a integer $m$ such that $ny>m≥ny-1$. Hence there exists a integer $m$, such that, $ny>m>nx$. – PCeltide Jul 26 '19 at 05:31
  • Even simpler: $ny - nx > 1.$ Now, the minimum difference of every two integers is $1$ (if and only if the integers are consecutive). This means that there is at least one integer point in the interval, $[nx, ny]$, call it $m$. – 1b3b Sep 06 '20 at 16:21
  • I'm late to the party, but anw why are we comparing n with 1/z necessarily? couldn't we just do n > z instead? – space Jun 28 '21 at 16:16

Let $a$ and $b$ be distinct irrationals; we lose no generality to suppose $a<b$. Assume they have equal integer parts, since otherwise there is an integer between them and the question is trivial. They have infinite decimal expansions, $.a_1a_2a_3\ldots$ and $.b_1b_2b_3\ldots$. These cannot agree in every position since otherwise $a=b$. So say they agree up to the $n-1$th position and differ at the $n$th. Then $$ x= \;.b_1b_2b_3\ldots b_n 0000000\ldots$$

is a rational number strictly between $a$ and $b$:

$$\begin{align} a &= \;.a_1a_2\ldots a_{n-1}a_n\ldots \\& <\; .a_2a_2\ldots a_{n-1}b_n000\ldots &= x \end{align}$$

because $a_n < b_n$, and

$$\begin{align} x & = \;.b_1b_2b_3\ldots b_n 0000000\ldots \\ & < \;.b_1b_2b_3\ldots b_nb_{n+1}\ldots & = b \end{align}$$

because not all of $b_{n+1}, b_{n+2}, \ldots$ can be zero.

For example, there is a rational number betwen $\sqrt2 = 1.4142\ldots$ and $\sqrt3 -\frac14 = 1.482\ldots$; this method produces the rational number $1.48000\ldots = \frac{37}{25}$. You can of course do the same thing in base 2; then you get $x = 1._20111000\ldots = \frac{23}{16}$, which also works.

It would also be fairly easy to produce a similar argument based on the continued fraction expansions of $a$ and $b$, but I think this is simpler.

Chris Brooks
  • 6,967
  • 3
  • 38
  • 61
  • 62,206
  • 36
  • 276
  • 489
  • Your proof contradicts itself by not allowing integers but allowing integers up to b_n. – Daniel Margolis Jun 07 '13 at 18:32
  • 8
    One of us is confused, and I bet it's you. $b_n$ is not an integer. It is a decimal digit. And my proof doesn't "disallow" integers; it observes that if $a$ and $b$ have different integer parts then there is no need for a proof because there is an integer between them and the question is answered. – MJD Jun 07 '13 at 18:33
  • So then extend this to n decimal places. – Daniel Margolis Jun 07 '13 at 18:47
  • 23
    I guess this shows that you can lead a horse to water, but you can't make him drink. – MJD Jun 07 '13 at 18:49
  • Irrational numbers are defined as numbers that do not contain any pattern for base representations of any kind as n goes to Infiniti. How then, can you claim that there is no two real numbers such that they are equivalent for all finite n and contain their incongruity at the infinite number place. If this is not true then I could conjecture that, due to the finite nature of the possibility range of irrationals, irrationals are countably infinite. – Daniel Margolis Jun 08 '13 at 01:30
  • 4
    @Daniel: There is no "infinite number place." Your conception of the notation "$\infty$" as a number (or occasionally a cardinality) seems to be at the root of all of your confusion. – Cameron Buie Jun 15 '13 at 03:14
  • If there is no non-discernible number place than explain how Q is not a completion of R, or how R/Q can even exist. – Daniel Margolis Jun 15 '13 at 04:12
  • @Daniel: Ah! Did you not mean "decimal place" when you said "number place"? – Cameron Buie Jun 15 '13 at 04:59
  • @CameronBuie yes that is what I meant. :) – Daniel Margolis Jun 15 '13 at 05:05
  • There is one minor error i think. if a and b are integers there doesn't have to be an integer between the. For example there is no integer between 2 and 3. Of course finding a rational number between integers is trivial. – Jens Schauder Jun 16 '13 at 05:35
  • 3
    @JensSchauder If a has integer part 2 and b has integer part 3 and *b is irrational*, then 3 is indeed between a and b. – Chris Brooks Jun 16 '13 at 05:44
  • @Joseph oh, I see. – Jens Schauder Jun 16 '13 at 05:46
  • There is another exposition of the same idea in [this post of Alex Basson](http://math.stackexchange.com/a/18977/25554). – MJD Jan 21 '14 at 05:34
  • @DanielMargolis You seem to be thinking of real numbers as hyper-real numbers. 0.999... = 1 precisely for the reason that there are no infinitely small differences between two real numbers. The difference between any two real numbers is always larger than some rational number. So, for an example, the difference between Sqrt(2) and Sqrt(3)-1/4 is larger than 1/20. Q is not the completion of R because Q is contained in R. Just because irrational numbers are approximated by real numbers doesn't mean they are rational. The expansions are not the same forever, even if they are the same for a while. – Electro-blob Dec 02 '21 at 19:26

We can construct one explicitly. Assume $0\lt a \lt b$. Let $n= \max(2,\lceil \frac 2{b-a}\rceil)$. Then let $m=\lceil na \rceil$ and $a \lt \frac m n \lt b$

Ross Millikan
  • 362,355
  • 27
  • 241
  • 432
  • Take a = pi and b = 2pi. n = 2, and m = 1. 1/2 is less than pi. – Daniel Margolis Jun 07 '13 at 23:20
  • @DanielMargolis: I had an error in both versions. The $a$ should not have been in the denominator – Ross Millikan Jun 07 '13 at 23:25
  • What of a and b infinitesimally close together? – Daniel Margolis Jun 08 '13 at 01:32
  • 3
    @DanielMargolis: in the standard reals, there are no such. You (or the problem poser) have to specify them first and the difference will not be infinitesimal. It may be small, which makes $n$ large, but that is OK. Even if $a=\sqrt 2, b=\sqrt 2 + 10^{-100}$ this works. – Ross Millikan Jun 08 '13 at 02:06
  • But then R is not complete. – Daniel Margolis Jun 08 '13 at 06:59
  • 5
    @DanielMargolis: Yes, it is. In fact, if you extend $\Bbb R$ with infinitesimals, it becomes incomplete. If you have an infinitesimal $\epsilon$, the set $\{\frac 1n|n \in \Bbb N\}$ has $0$ as a lower bound, but it has no greatest lower bound. – Ross Millikan Jun 08 '13 at 13:05
  • But the infinitesimals are all irrational and come in packets uninterrupted by rationals. Therefore rationals do not bisect or disallow contact between every 2 irrationals. – Daniel Margolis Jun 08 '13 at 13:18
  • 7
    If you are working in some number system that includes infinitesimals, you should say that. There is no indication in the question that you are, and all the answers to this and your other question are in the real numbers. I know very little about such systems. You seem to have an intuitive sense of how you want the infinitesimals to behave, but I don't think they can act that way. – Ross Millikan Jun 08 '13 at 13:33
  • Infinitesimals are included by construction of$ R$ – Daniel Margolis Jun 08 '13 at 13:44
  • @Daniel: Which construction of $R$ are you referring to? There are several. – Cameron Buie Jun 15 '13 at 03:16
  • The construction that includes all irrationals found by functions using countable infinity combined in multiplication with all rationals in union with all rationals. – Daniel Margolis Jun 15 '13 at 04:18
  • Roots of positive functions included. – Daniel Margolis Jun 15 '13 at 04:20
  • @Daniel: I'm afraid I don't understand your description of the construction. Could you provide a link? – Cameron Buie Jun 15 '13 at 14:36
  • 1
    @CameronBuie: the idea is to find $n$ large enough so that $\frac 1n \lt b-a$. Then at least one of the numbers $\frac mn$ will fit into the interval. I actually didn't need the factor $2$. Think about $a=\pi, b=\sqrt {10}$. Then $b-a \approx 0.0207, n=97, m=304, \frac mn \approx 3.134, \pi \lt 3.134 \lt \sqrt {10}$ – Ross Millikan Jun 15 '13 at 15:05
  • @Ross: I understand your answer (and upvoted it). I was wondering about the construction Daniel was referring to that includes infinitesimals. If he's working with a non-standard construction of the reals, that may explain a great deal of his confusion. – Cameron Buie Jun 15 '13 at 15:53
  • 2
    @CameronBuie: yes, he is including infinitesimals, which comes out late in this discussion, as well as another question he asks. Then he wants to lump all infinitesimals with the standard irrationals. I am not sure if it is confusion or trolling. – Ross Millikan Jun 15 '13 at 15:55
  • If irrationals do not have an infinite decimal place then there is a rational representation of every irrational number. Suppose $\pi=3.14$. Then $\pi=\frac{22}{5}$. The same holds if $irr=$ any finite list. – Daniel Margolis Jun 15 '13 at 20:04
  • Irrationals exist in packets infinitesimally close to one another. – Daniel Margolis Jun 15 '13 at 20:08
  • 1
    @Daniel: Noone is claiming that irrationals have finite decimal expansions--their definitions do indeed have infinitely many decimal places. What do you mean by "***an*** infinite decimal place," though? – Cameron Buie Jun 16 '13 at 02:32
  • @DanielMargolis I think you're getting confused. Given a real number, the NEXT real number would be infinitesimally close to it, however we do not have a notion of a NEXT real number. In any case, even if we do, we couldn't describe this difference using real numbers. – Cruncher Nov 11 '13 at 15:16

You can apply an "argument from authority" here :). As we all know, Dedekind constructed a one-to-one correspondence between the real numbers and certain sets of rational numbers, which he called "cuts". We all accept that Dedekind's construction of the real numbers is mathematically flawless. By the way these cuts are constructed (see his 1872 paper), if there would be two irrational numbers without a rational number in between, then these two irrational numbers would correspond to the same Dedekind Cut. That would imply that there is no one-to-one correspondence between the real numbers and his cuts, hence Dedekind's construction of the reals would be incorrect (--> contradiction).

  • 189
  • 1
  • 5

Be $a$ and $b$ two irrational numbers, with $a<b$. Since $a<b$, we have $b-a>0$. Now there are rational numbers arbitrary close to $0$, and therefore there's a rational number $q<b-a$. Now consider the set $M=\{qn: n\in \mathbb{Z}\}$. Now be $q_l$ the largest element of $M$ less than $a$, and $q_r$ the smallest element of $M$ greater than $b$. Clearly $q_r-q_l > b-a$. However, if there's no rational number between $a$ and $b$, then there's especially no element of $M$ between $a$ and $b$, because all elements of $M$ are rational. But then $q_r$ is the element of $M$ following $q_l$, that is, $q_r-q_l = q$. But by construction, $q<b-a$, so we have $b-a < q_l-q_r = q < b-a$ which is a contradiction. Therefore there's at least one element of $M$, which is a rational number, in between $a$ and $b$.

  • 41,315
  • 8
  • 68
  • 125
  • If you pick the right a and b, their difference is not contained, by definition, in Q, the set of all rationals. – Daniel Margolis Jun 07 '13 at 23:14
  • 5
    @DanielMargolis: I didn't claim it is. – celtschk Jun 07 '13 at 23:16
  • In what sense is b - a > 0. You claim that for every irrational epsilon > 0, there is a rational epsilon - delta > 0, for some epsilon > delta > 0. – Daniel Margolis Jun 08 '13 at 01:23
  • 4
    The real numbers are totally ordered, that means exactly one of $a-b>0$, $a-b=0$, $a-b<0$ is true. $a-b=0$ would mean $a=b$, but by assumption, $a$ and $b$ are different (were $a=b$, quite trivially there would be no rational number between $a$ and $b$). So this leaves $a-b>0$ and $a-b<0$. I further assumed that $a$ denotes the smaller of the two, i.e. $a0$. So $b-a>0$ by the initial assumption (but that's just a wlog assumption; if we had $a – celtschk Jun 08 '13 at 08:39
  • Is there always an R closer to 0 than any Q? – Daniel Margolis Jun 08 '13 at 09:11
  • 2
    @DanielMargolis: There cannot be such an $R$ because all sequences of rational numbers whose absolute value eventually stays beyond any given rational number converge to $0$. So any number that is closer to $0$ than any rational number cannot be the limit of a sequence of rational numbers, in contradiction to $\mathbb{R}$ being the completion of $\mathbb{Q}$. – celtschk Jun 08 '13 at 09:19
  • Take Q 1/n for n in N. I chose this because 1 is the smallest positive integer and we want to take q in Q as small as possible. As n goes to Infiniti q reaches epsilon > 0. Now take 1/n*irr where irr is an irrational less than 1. This is obviously an irrational number and always less than q. Since there are infinitely many irrational numbers less than 1, there are infinitely many irrationals between 0 and epsilon. – Daniel Margolis Jun 08 '13 at 09:51
  • 4
    $1/n*irr$ is not an irrational number, it is a whole *sequence* of irrational numbers. And not a single one is closer to $0$ than *all* rational numbers. Yes, for every rational number (with the exception of $0$ itself, of course), there's an irrational number that's closer to $0$. But there's no irrational number which is closer to $0$ than every rational number, because for each irrational number there's a rational number which is *even closer* to $0$. – celtschk Jun 08 '13 at 10:13
  • I just gave an example for every n in /mathbb(N) and irr between (epsilon, 1). Prove that for the same /mathbb(N) there is a /mathbb(Q) closer to 0 than Irr = /mathbb(R) / /mathbb(Q). – Daniel Margolis Jun 08 '13 at 10:21
  • 3
    You did *not* provide a *single* irrational number that is closer to $0$ than *any* rational number. Nowhere did I claim there is no irrational number arbitrary close to $0$. But there's always a rational number *even closer* to $0$. – celtschk Jun 08 '13 at 10:24
  • You are thinking finitely in terms of examples. If you could give any example, I could give you a subset of Q and Irr that conforms to your ideology, both of which are countably infinite, both of which contain an equivalent number of values that can be listed in an integer sequence. – Daniel Margolis Jun 08 '13 at 10:35
  • 3
    No, I was giving a general argument. It was *you* who gave a "counterexample". Of course when explaining why your counterexample isn't one I was talking about that example. But my arguments were all completely general. And there is no "ideology" in the real numbers. And I don't doubt that you can give me countable sets of irrational numbers. But that doesn't matter the slightest bit for the question at hand. I've given an argument why there can't be an irrational number closer to $0$ than any rational number (i.e. one where's no rational number closer to $0$ than that irrational number). If … – celtschk Jun 08 '13 at 10:49
  • 1
    … you want to claim that argument is wrong, you have to either point out a logical flaw, or give a valid counterexample to it. Neither you did. You gave a "counterexample" which wasn't one. – celtschk Jun 08 '13 at 10:50
  • If the distance from a in Q to 0 is equal to the distance from b in Irr to 0, and neither is negative. We are constructing distance in R. Then a = b and further, for every a in Q there is a b in Irr. This contradicts the definition Irr = R / Q. – Daniel Margolis Jun 08 '13 at 10:58
  • 3
    "If the distance from a in Q to 0 is equal to the distance from b in Irr to 0, and neither is negative." That situation cannot occur. I'm starting to think you're just trolling. EOD. – celtschk Jun 08 '13 at 11:05
  • "I've given an argument why there can't be an irrational number closer to 0 than any rational number (i.e. one where's no rational number closer to 0 than that irrational number)." – Daniel Margolis Jun 08 '13 at 11:14
  • 6
    Do you *really* not know the difference between "thhere is no irraltional number closer to $0$ than any rational number" (true) and "for any rational number there is no irrational number closer to it" (false)? In that case, do yourself a favour and learn elementary logic. – celtschk Jun 08 '13 at 11:17
  • "One where there's no irrational number closer to 0 than rational number [closer to zero]." – Daniel Margolis Jun 08 '13 at 11:37