# Prove that $\mathbb{Q}$ is dense in $\mathbb{R}$

So, I'm kinda old (26yrs) for this, but I cracked open Apostol's Vol 1, and I'm making quite slow progress!

There's a math blog that I go to for help (stumblingrobot.com), but I don't really understand their proof for this question (I 3.12 qn 6). It says, given any arbitrary real $$x$$, $$y$$, with $$x < y$$, prove that at least 1 rational number $$r$$ exists, such that $$x < r < y$$, and hence infinitely many.

In the same section qn1, we proved that for any arbitrary real $$x$$, $$y$$, with $$x < y$$, there is at least 1 real $$z$$ such that $$x < z < y$$. Since rational numbers $$\mathbb{Q}$$ are a subset of real numbers $$\mathbb{R}$$, shouldn't this be a sufficient proof?

It is true that for any real $$x$$ and $$y$$ with $$x there is a rational number between them, but we can't prove that from the fact that for any real $$x$$ and $$y$$ with $$x there is a real number between them, because that real number between them is not guaranteed to be rational.

• Your answer is good. But maybe a postscript how you would go about proving that there is a rational and which facts you can use. – fleablood Jul 11 at 17:37
• @fleablood: I would use the Archimedean property, like this web site OP goes to – J. W. Tanner Jul 11 at 19:38
• see also here, here, here, and here – J. W. Tanner Jul 11 at 22:42

As has been pointed out by now (especially in J.W. Tanner's accepted answer) if you have the fact that between any two real numbers, $$x$$ and $$y$$ there will be a real number between them, you can't use that fact to claim there will always be a rational number between them as you have no guarantee the number you proved does exist is rational.

This post is to extend how one would show a rational must exist.

The most basic aspect about the real numbers is that for every real number $$x$$, whether it is rational or irrational, the will be an infinite sequence of rational numbers $$q_i$$ that will get as close to $$x$$ "as you like".

This is subtle but it is basic. I'm not entirely certain how Apostol introduced this. But I think the must basic and comprehensible explanation would go something like this:

$$x$$ lies somewhere in the real numbers. We can divide the real numbers up into intervals of length $$\frac 1n$$ for some integer $$n$$ and $$x$$ will have but be on some interval between $$\frac a{n}$$ and $$\frac {a+1}n$$ because ... well, $$x$$ has to lie somewhere and everywhere will be in one of these intervals. We can make this intervals more and more precise by taking larger and larger values of $$n$$. If we look as these rational number endpoints and view them as a list we will have an infinite number of rational numbers "honing in" on our real number $$x$$.

So with that in mind the proof is simple. For $$x$$ and $$y$$ there will be a real number $$z$$ between them. Now $$z$$ might not be rational, but there are infinite number of rational numbers "honing in" on $$z$$. Pick one that is closer to $$z$$ than $$z$$ is to either $$x$$ or $$y$$. That rational number will be between $$x$$ and $$y$$.

If that proof seems way to casual and informal... well, probably everyone will agree with you. But we can formalize it up:

Between $$x$$ and $$y$$ so that $$x< y$$ there is a real $$z$$ so that $$x < z < y$$. $$z$$ is real so somehow Apostol must have proven or defined or declared by axiom that there are several rational $$q_n \to z$$, or in other words, for any value $$\delta > 0$$ we can find a rational $$q$$ so that $$|q-z| < \delta$$.

That might seem complicated and technical but in every textbook on real numbers, it has to have been stated somewhere in some words, maybe very different looking words, that every real number is arbitrarily close to several rational numbers. That's all this is saying. For any distance $$\delta$$ we can find a rational number that is within $$\delta$$ of $$z$$.

So, $$x < z < y$$ so $$y-z> 0$$ and $$z-x > 0$$ and so if we take $$\delta =$$ the smaller value of $$z-x$$ or $$y-z$$ there will be a rational number, $$q$$ within that distance to $$z$$. So $$z-(z-x) < q < z + (y-z)$$ or in other words $$x < q < y$$.

• Imho, your point about sequences of rationals converging to reals shows what's lacking in your and OP's posts. Neither of you have actually explicitly stated how you have defined the reals (and I'm not sure how Apostol has done it). AFAIK the property of sequences of rationals follows directly from the Cauchy sequence definition of the reals but I think your approach with $\frac1n$-length intervals fits nicely with the Dedekind cut definition since the cut lies in your interval. – Jam Jul 15 at 17:32
• That's fair enough critique. But I figure it doesn't matter how you defined the reals but some sense of the reals being "complete" and what it means. The problem with having a definition of the reals (and I do; my def is the smallest field of which the rationals are a subfield which has the least upper bound property) is that when you answer a students question who could be using a very different text and a definition will seem a massive technical stumbling block when it shouldn't. – fleablood Jul 15 at 19:32

Here's a weak, but intuitive argument.

Let $$x_1$$ and $$x_2$$ be some real numbers, such that $$x_2 > x_1$$.

Then, let $$\displaystyle q'= \left\lceil\frac{1}{x_2-x_1}\right\rceil$$.

This will give the denominator of the distance between $$x_2-x_1$$. For example, if $$x_2 \geq x_1 + 1$$, then $$q'=1$$, which makes sense, because $$\displaystyle \frac{p}{q}$$ can just be a whole number.

Now, let $$q=2q'$$. This avoids possibilities where $$x_1$$ and $$x_2$$ are of the form $$\displaystyle \frac{n}{q}$$, such as $$(x_1,x_2)=\displaystyle \left(\frac{2}{7}, \frac{3}{7}\right)$$.

Now, we can always find a $$p$$, such that $$\displaystyle x_1 < \frac{p}{q} < x_2$$.

• "Now, we can always find a p, such that x1<pq<x2" Why? Isn't that what is being asked to be proven. You have shown that $x_2 - x_1 > \frac 1q$ but how does that there is an integer $p$ so that $x_1 < \frac pq < x_2$? To prove that you must show $qx_1 < p < qx_2$ and it is true that $qx_2 - q_x1 > 1$ but how does that prove there is an integer $p$ between them? – fleablood Jul 11 at 19:36

Here, we will attempt to give a more involved, but potentially more intuitive, proof.

So first things first, we need to get the intuitive part into place, and that means thinking a little bit about what the real number line "is", and what we seek to prove in relation to that.

And this is how it goes. The real number line should, basically, be thought of as an "idealized ruler": a ruler, as you might know, has little tick marks at regularly-spaced intervals along it, like this.

You should also note that every so many marks, there is a "large" mark that is marked with a whole number. This represents a count of the ruler's fundamental unit - here it is (I presume) centimeters (cm). In the mathematical real number line, we don't care what that unit actually is, if it is anything at all, only that it exists: and we denote it with the symbol $$1$$ - this is why you may have heard "$$1$$" called "the unit" or "unit", as that is what it is: on the ruler, the tick marked "$$1$$" means $$1\ \mathrm{cm}$$.

Moreover, there are small marks. On a ruler like the above, they are millimeters, or better, tenths of centimeters: each small tick counts $$\frac{1}{10}\ \mathrm{cm}$$. We use the marks as thus: by counting - either the larger or smaller marks - from the ruler's start point, up to some desired end point, such as, perhaps, the end of a long object which the ruler is placed against, we can figure out the number of measuring units of that type (i.e. $$1\ \mathrm{cm}$$ or $$\frac{1}{10}\ \mathrm{cm}$$). For example, if we count 23 of the large marks, we know it is 23 cm. Note that the same would also be the case if we counted 230 of the small marks: that is $$\frac{230}{10}$$ cm. This shows that the ruler has two different levels of precision, and this would be a more precise measurement: if the object is not exactly 23 cm long, but its end fits between 22 and 23 cm, say, we can now get the nearest tenth, e.g. 22.7 cm.

The real number line, likewise, works the same way, only it is far more detailed. In addition to the basic unit, you can think of it also having "tick marks" at any fraction thereof:

$$\frac{1}{q}$$

for every natural number $$q > 0$$.

In particular, the rational numbers occur at every tick mark of the form

$$\frac{p}{q}$$

where $$p$$ is an integer - so it's also a double-ended ruler, with ticks going backwards from before the zero mark.

When it is said the "rationals are dense in the reals", what this means is this: Think about the ordinary ruler again. Suppose you put two points along its edge. Provided they are not closer than the smallest graduation (in the picture, $$\frac{1}{10}\ \mathrm{cm}$$), then you can tell them apart in that you can find a tick mark between them. But, if they are closer than this, you won't be able to. But now think about the real number line: this property means that you will always be able to find an intermediate tick mark.

And that also gives us the way to the formal proof. Let the two points be $$x$$ and $$y$$, with $$x < y$$ (i.e. $$x$$ is to the left of $$y$$). Choose a "tick size" that is a natural number $$q$$. The "tick mark set" is

$$\mathrm{TM}(q) := \left\{ \frac{p}{q},\ p \in \mathbb{Z} \right\}$$

Now, let us consider a little exercise. Suppose we start with $$q = 1$$, i.e. the ticks are steps of the full basic unit (centimeters, if you so desire). If a tick falls between the two points, i.e. there is a $$p$$ such that $$x < p < y$$, then we are done. If not, however, then we would say this is too coarse, and we must increase the granularity: take, say, $$q = 10$$ (now we're at $$\frac{1}{10}\ \mathrm{cm}$$, if you'd like). Do we now have a $$\frac{p}{10}$$ such that $$x < \frac{p}{10} < y$$? Yes, then we're done. No, now go to $$q = 100$$. And so forth. The proof consists, then, of showing that at some level, we eventually gain enough resolution to separate the points.

How do we do that? Well, think about the cases where there is not enough resolution. Namely, suppose $$q$$ be such that there is no $$\frac{p}{q}$$ with $$x < \frac{p}{q} < y$$, i.e. there is no tick mark between the two points. We now will find which tick marks they fall between. Consider

$$\mathrm{LeftTicks}(q, x) := \left\{ \frac{p}{q} : \frac{p}{q} < x \right\}$$

Since it is bounded above and "like" an initial segment of the integers, it is also reverse-well-ordered, and has a maximal element: the last tick before we step over $$x$$. Let its numerator be $$p_m$$. As we have assumed that $$x$$ and $$y$$ are "too close" (otherwise, we'd be done), we must have

$$\frac{p_m}{q} \le x < y \le \frac{p_m + 1}{q}$$

i.e. both $$x$$ and $$y$$ fit between the two tick marks on the ruler that are immediately adjacent.

Now, by using properties of inequalities, we can rearrange this to

$$(y - x) \le \left(\frac{p_m + 1}{q} - \frac{p_m}{q}\right)$$

or

$$(y - x) \le \frac{1}{q}$$

that is, that the distance between the two points is smaller than the tick unit, just as it should be. Note we might have been tempted to just assume this, but we have to actually show that the given tick marks exist first.

Thus, the strategy must be to show that we can now make $$\frac{1}{q}$$ suitably small - i.e. $$q$$ suitably large, such that the inequality reverses itself:

$$\frac{1}{q} < (y - x)$$

. If that holds, then it's easy to see that $$\frac{p_m + 1}{q}$$ will be the desired intermediate rational.

How do we show this? Well, that is where we need the Archimedean property, which says:

• (Archimedean Property) If $$a$$ is a real number such that $$0 \le a < \frac{1}{n}$$ for every natural number $$n > 0$$, then $$a = 0$$.

In other words, there is no number closer to $$0$$ on the real number line than any suitably-fine whole-number fraction, or tick spacing, of the unit length. Note that this inequality is just the one we already have: take $$a := y - x$$. Hence, from this property, it follows that, if we cannot ever tell the points apart no matter how large the number of divisions $$q$$ we divide the basic unit by, then

$$a = y - x = 0$$

that is, the two points were in fact identical, when we had assumed them different - contradiction.

I think you can use the Continuum Assumption(Least Upper Bound Property) of the Reals to prove this. Im remembering bits and pieces from Wade.

Given a non-empty subset of the reals with an upper bound, E, it has a least upper bound. As a corollary, any real greater than the l.u.b. is not in E.

The Archimedean Property applies in the reals. Given two reals, 0y. Let us consider set $$A={a|a\in N, ax.

We know $$1\in A$$. So A is non-empty. A is bounded above by y/x. So A has a least upper bound, call it $$n_0$$. Then $$(n_0+1)x>y$$ and $$(n_0+1)\notin A$$.

Now can this be used to find a q=m/n where $$x?

Let's first suppose we have two reals such that r1. The Archimedean Property guarantees us an integer $$n_0\cdot 1. We have $$s-n_0>1$$, so $$s>n_0+1$$. So we have $$r. So between any two reals whose difference is greater than 1, we have an integer.

We can pick n arbitrarily to satisfy $$nx and $$n(y-x)>1$$. Once we have our n, an m is guaranteed, so we have our q such that $$x with q being rational.

Rational numbers are real numbers. So given x and q, we can find a rational between them and iterate. So we have an infinite number of rationals between any two reals.

Well, one could think this proof as a generalization of the following fact:

Between any two real numbers $$x with $$y-x>1$$ there exists some $$n\in\mathbb{Z}$$ such that: $$x

This is almost evident. Consider the following cases:

• If $$y\in\mathbb{Z}$$, then take $$n=y-1$$. Evidently, $$x.
• If $$y\not\in\mathbb{Z}$$, then take $$n=\lfloor y\rfloor$$. Since $$n>y-1\Rightarrow n>x$$, again we have $$x.

Now, note that this cannot be true in $$\mathbb{R}$$, in general, since not all real numbers $$x,y$$ have a distance larger than 1. So, let $$x,y\in\mathbb{R}$$ with $$x. Then, there exists some scaling factor $$m\in\mathbb{N}$$ such that $$m(y-x)>1.$$ (The above is a direct implication of Archimedes-Eudoxus Principle.) The above may be re-writen as: $$ny-nx>1.$$ In other words, we "re-scale" the axis so as to take $$x,y$$ far enough. Then, by the previous result, there exists some $$n\in\mathbb{Z}$$ such that: $$mx Finally, dividing by $$m$$, we get: $$x<\frac{n}{m} which proves $$\mathbb{Q}$$'s density in $$\mathbb{R}$$.

So, what actually makes rationals eligible for being dense in reals is the fact that one may change the "unit" and shift to smaller margins, when compared to the naturals.

• This is an interesting answer but I feel like it's as easy to assume the Archimedean property as it is to assume that there is a rational between $x$ and $y$ so it's kinda begging the question. – Jam Jul 15 at 17:45
• Well, the Archimedean property can be seen as a corollary of the fact than $\mathbb{N}$ is not bounded from above, which is deduced by the Induction principle (or the equivalent least element principle). So, I think that the Archimedean principle is very close to calculus' axioms, hence easy to assume. However, rationals' density in reals is not as obvious (I'm not claiming that it is "far" from the axioms, just not as close as the Archimedean property). – Βασίλης Μάρκος Jul 15 at 19:55