본문으로 건너뛰기

레슨 8 · The Real Numbers

Density of the Rationals and Irrationals

Prove that between any two real numbers lie both a rational and an irrational number, and learn what dense means with a runnable search.

Between any two distinct real numbers, no matter how close, there is a fraction. There is also an irrational number. Both sets are woven through the real line, even though one is countable and the other is not. This property is called density, and it lets us approximate any real number as closely as we like by rationals, which is how computers represent reals.

Density of ℚ in ℝ

Theorem. If a < b are real numbers, there is a rational q with a < q < b.

Proof. Since b - a > 0, the Archimedean property gives n ∈ ℕ with 1/n < b - a, that is na + 1 < nb. Let m be the smallest integer greater than na. (It exists: the integers greater than na form a set bounded below that is nonempty, and by the well-ordering of the integers it has a least element.) Then m - 1 ≤ na < m, so

na < m ≤ na + 1 < nb.

Divide by n: a < m/n < b. So q = m/n works. ∎

The proof is constructive: pick a denominator n large enough that the grid spacing 1/n is smaller than the interval, then pick the first grid point above a.

Python Find a rational between two numbers

Press Run (or Ctrl + Enter) to see the result here.

Program input · what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Density of the irrationals

Theorem. If a < b, there is an irrational r with a < r < b.

Proof. Apply the previous theorem to a/√2 < b/√2 to get a rational q with a/√2 < q < b/√2. Then a < q√2 < b. We may choose q ≠ 0 (apply the theorem again if needed). The number q√2 is irrational: if it were a rational p, then √2 = p/q would be rational, which is false. ∎

So both ℚ and ℝ \ ℚ are dense in ℝ: every open interval contains points of each.

Dense does not mean "equally many". ℚ is countable and the irrationals are uncountable. A countable set can still be dense, as ℚ shows.

Python An irrational between any two numbers

Press Run (or Ctrl + Enter) to see the result here.

Program input · what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Approximating a real number by rationals

Density implies that every real x is a limit of rationals: for each n, choose a rational q_n with x < q_n < x + 1/n. The decimal truncations 3, 3.1, 3.14, 3.141, ... of π do exactly this.

A practical version: for a real x and a bound N on the denominator, which fraction p/q with q ≤ N is closest? Continued fractions give famous answers: 22/7 and 355/113 for π.

Python Best rational approximations to pi

Press Run (or Ctrl + Enter) to see the result here.

Program input · what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Using density in proofs

A classic application: if x ≤ y + ε for every ε > 0, then x ≤ y. Another: to show two real numbers a, b are equal, it is enough to show no rational lies strictly between them, because if a < b density would supply one.

Example. Suppose f: ℝ → ℝ satisfies f(x + y) = f(x) + f(y) and is increasing. Knowing f on the rationals determines it on all of ℝ, because any real is squeezed between rationals. That is the kind of argument density makes possible.

Check your understanding

Quick check · 4 questions

of 4 answered You scored / 4 · perfect!

  1. 1. What does 'ℚ is dense in ℝ' mean?

    Between any two reals there is a rational number.
  2. 2. Which tool is used to choose the denominator n in the proof of density of ℚ?

    The Archimedean property gives n with 1/n < b - a.
  3. 3. Why is q·√2 irrational when q is a nonzero rational?

    A quotient of rationals is rational, which would contradict irrationality of √2.
  4. 4. ℚ is countable and dense. What does that tell you?

    Density is about position on the line, not about cardinality.

Summary

  • Between any two reals there is a rational (density of ℚ) and an irrational (density of ℝ \ ℚ).
  • The proof uses the Archimedean property to pick a fine grid 1/n.
  • Every real is a limit of rationals; decimals and continued fractions give approximations.
  • Density has nothing to do with size: ℚ is dense yet countable.

Next: Absolute Value, Intervals and Nested Intervals

진행 상황 기록

무료 계정을 만들면 레슨을 체크하고, 어떤 기기에서든 하던 곳부터 이어 학습할 수 있어요.