TheoremComplete

Density of Rationals in R

The density of the rationals in the reals is one of the most important properties of R\mathbb{R}. It states that between any two distinct real numbers, no matter how close, there exists a rational number. This property has profound consequences: it means that Q\mathbb{Q} is "everywhere" in R\mathbb{R}, and every real number can be approximated arbitrarily well by rationals.


Statement

Theorem1.1Density of Q in R

For all x,y∈Rx, y \in \mathbb{R} with x<yx < y, there exists r∈Qr \in \mathbb{Q} such that

x<r<y.x < r < y.

RemarkEquivalent formulation

Equivalently: Q\mathbb{Q} is dense in R\mathbb{R} in the topological sense β€” every nonempty open interval in R\mathbb{R} contains a rational number. In metric space language, Qβ€Ύ=R\overline{\mathbb{Q}} = \mathbb{R} (the closure of Q\mathbb{Q} is all of R\mathbb{R}).


Proof

Proof

Let x,y∈Rx, y \in \mathbb{R} with x<yx < y. We seek r∈Qr \in \mathbb{Q} with x<r<yx < r < y.

Step 1: By the Archimedean property (Theorem 1.1), there exists n∈Nn \in \mathbb{N} such that

n(yβˆ’x)>1.n(y - x) > 1.

Step 2: Consider the set

S={m∈Z∣m>nx}.S = \{m \in \mathbb{Z} \mid m > nx\}.

By the Archimedean property, SS is nonempty (since Z\mathbb{Z} is unbounded above). By the well-ordering principle for N\mathbb{N}, the set SS has a least element. Let m0m_0 be the smallest integer greater than nxnx.

Step 3: By the minimality of m0m_0, we have

m0βˆ’1≀nx<m0.m_0 - 1 \leq nx < m_0.

In particular, nx<m0≀nx+1nx < m_0 \leq nx + 1. Adding n(yβˆ’x)n(y - x) to the right side and using Step 1:

m0≀nx+1<nx+n(yβˆ’x)=ny.m_0 \leq nx + 1 < nx + n(y - x) = ny.

Thus nx<m0<nynx < m_0 < ny, which gives

x<m0n<y.x < \frac{m_0}{n} < y.

Step 4: Let r=m0/n∈Qr = m_0/n \in \mathbb{Q}. Then x<r<yx < r < y, as desired.

β– 
RemarkKey ingredients

The proof uses two facts:

  1. The Archimedean property (to find nn such that 1/n<yβˆ’x1/n < y - x).
  2. The well-ordering principle (to find the least integer m0>nxm_0 > nx).

Both are consequences of the completeness axiom for R\mathbb{R}.


Corollaries and consequences

Theorem1.2Every real is a limit of rationals

For every x∈Rx \in \mathbb{R}, there exists a sequence (rn)(r_n) in Q\mathbb{Q} such that rnβ†’xr_n \to x.

Proof

For each n∈Nn \in \mathbb{N}, by density, choose rn∈Qr_n \in \mathbb{Q} with x<rn<x+1/nx < r_n < x + 1/n. Then ∣rnβˆ’x∣<1/nβ†’0|r_n - x| < 1/n \to 0, so rnβ†’xr_n \to x.

β– 
RemarkTopological closure

This corollary says Q\mathbb{Q} is dense in R\mathbb{R} in the sense that every real is a limit point of Q\mathbb{Q}. Formally, Qβ€Ύ=R\overline{\mathbb{Q}} = \mathbb{R} (the closure of Q\mathbb{Q} in the standard topology on R\mathbb{R} is all of R\mathbb{R}).

Theorem1.3Density of irrationals

The set Rβˆ–Q\mathbb{R} \setminus \mathbb{Q} of irrational numbers is also dense in R\mathbb{R}. That is, for all x<yx < y in R\mathbb{R}, there exists an irrational Ξ±\alpha with x<Ξ±<yx < \alpha < y.

Proof

By density of Q\mathbb{Q}, choose r∈Qr \in \mathbb{Q} with xβˆ’2<r<yβˆ’2x - \sqrt{2} < r < y - \sqrt{2}. Then Ξ±=r+2\alpha = r + \sqrt{2} satisfies x<Ξ±<yx < \alpha < y. Since 2\sqrt{2} is irrational and rr is rational, Ξ±\alpha is irrational.

β– 
ExampleDecimal expansions

Every real number xx has a decimal expansion x=a0.a1a2a3…x = a_0.a_1 a_2 a_3 \ldots, where a0∈Za_0 \in \mathbb{Z} and ak∈{0,1,…,9}a_k \in \{0, 1, \ldots, 9\} for kβ‰₯1k \geq 1. The truncations

rn=a0.a1a2…anr_n = a_0.a_1 a_2 \ldots a_n

are rational numbers converging to xx. This is a concrete manifestation of density: every real is the limit of its decimal approximations.

ExampleApproximating Ο€

The number Ο€=3.14159…\pi = 3.14159\ldots is irrational, but can be approximated by rationals:

3,3110,314100,31411000,3141510000,…3, \quad \frac{31}{10}, \quad \frac{314}{100}, \quad \frac{3141}{1000}, \quad \frac{31415}{10000}, \quad \ldots

These are the decimal truncations, and they converge to Ο€\pi. The density theorem guarantees such approximations exist for every real number.

ExampleApproximating √2

Similarly, 2=1.41421356…\sqrt{2} = 1.41421356\ldots is approximated by

1,1410,141100,14141000,…→2.1, \quad \frac{14}{10}, \quad \frac{141}{100}, \quad \frac{1414}{1000}, \quad \ldots \to \sqrt{2}.

Historical approximations include 75=1.4\frac{7}{5} = 1.4, 107β‰ˆ1.4286\frac{10}{7} \approx 1.4286, and the excellent 577408β‰ˆ1.41421568\frac{577}{408} \approx 1.41421568.


Density and uniform approximation

Theorem1.4Uniform approximation by rationals

Let f:[a,b]β†’Rf : [a, b] \to \mathbb{R} be continuous. For every Ο΅>0\epsilon > 0, there exists a function g:[a,b]β†’Rg : [a, b] \to \mathbb{R} taking only rational values such that

∣f(x)βˆ’g(x)∣<Ο΅forΒ allΒ x∈[a,b].|f(x) - g(x)| < \epsilon \quad \text{for all } x \in [a, b].

Proof

For each x∈[a,b]x \in [a, b], by density, choose a rational rxr_x with ∣f(x)βˆ’rx∣<Ο΅/2|f(x) - r_x| < \epsilon/2. By continuity, there exists Ξ΄x>0\delta_x > 0 such that ∣f(y)βˆ’f(x)∣<Ο΅/2|f(y) - f(x)| < \epsilon/2 for all y∈[a,b]y \in [a, b] with ∣yβˆ’x∣<Ξ΄x|y - x| < \delta_x. Then for such yy,

∣f(y)βˆ’rxβˆ£β‰€βˆ£f(y)βˆ’f(x)∣+∣f(x)βˆ’rx∣<Ο΅/2+Ο΅/2=Ο΅.|f(y) - r_x| \leq |f(y) - f(x)| + |f(x) - r_x| < \epsilon/2 + \epsilon/2 = \epsilon.

The intervals (xβˆ’Ξ΄x,x+Ξ΄x)(x - \delta_x, x + \delta_x) cover [a,b][a, b]; by compactness, finitely many suffice. Define gg piecewise using the corresponding rationals rxr_x on each subinterval (with a measurable selection for overlaps). Then ∣f(x)βˆ’g(x)∣<Ο΅|f(x) - g(x)| < \epsilon for all xx.

β– 
RemarkConnection to Stone-Weierstrass

This result is a precursor to the Stone-Weierstrass theorem, which says that polynomials (or more generally, algebras separating points) are dense in C([a,b])C([a, b]). The density of Q\mathbb{Q} in R\mathbb{R} is the "pointwise" analogue; uniform approximation requires compactness.


Countability and measure

RemarkQ is countable

Although Q\mathbb{Q} is dense in R\mathbb{R}, it is a countable set (it can be put in bijection with N\mathbb{N}). In contrast, R\mathbb{R} is uncountable. So a countable dense subset exists in R\mathbb{R} β€” this is a key property of separable metric spaces.

RemarkQ has measure zero

In terms of Lebesgue measure, Q\mathbb{Q} has measure zero: m(Q)=0m(\mathbb{Q}) = 0. Thus, even though Q\mathbb{Q} is dense, it is "negligible" in the measure-theoretic sense. Almost every real number (in the sense of Lebesgue measure) is irrational.

ExampleNowhere dense but uncountable sets

The Cantor set CβŠ†[0,1]C \subseteq [0, 1] is uncountable, has measure zero, and is nowhere dense (its interior is empty). This contrasts with Q\mathbb{Q}, which is countable, has measure zero, and is dense. Density and size (cardinality/measure) are independent properties.


Comparison with other dense sets

ExampleDyadic rationals

The set of dyadic rationals β€” rationals of the form m/2nm/2^n for m∈Zm \in \mathbb{Z}, n∈Nn \in \mathbb{N} β€” is also dense in R\mathbb{R}. This is useful in analysis because dyadic subdivisions (binary) are computationally efficient.

ExampleAlgebraic numbers

The set Qβ€Ύ\overline{\mathbb{Q}} of algebraic numbers (roots of polynomials with integer coefficients) is countable and dense in R\mathbb{R}. It properly contains Q\mathbb{Q} (including 2\sqrt{2}, 53\sqrt[3]{5}, etc.) and is the algebraic closure of Q\mathbb{Q} in R\mathbb{R}.

ExampleComputable numbers

The set of computable real numbers (numbers whose decimal expansion can be generated by a Turing machine) is countable and dense in R\mathbb{R}. Almost all reals are uncomputable, yet the computable ones are dense!


Summary

The density of Q\mathbb{Q} in R\mathbb{R} is fundamental:

  • Between any two reals, there is a rational (and an irrational).
  • Every real is the limit of a sequence of rationals.
  • Q\mathbb{Q} is countable and has measure zero, yet is dense.
  • Density is essential for approximation arguments, decimal expansions, and continuity.

This result, combined with the Archimedean Property, underpins much of real analysis. See Proof of Archimedean Property for the foundational result used in the proof.