Math 2.0

Mathematical logic and foundations Proof

Proof that the rationals are countable

Builds on Countably infinite setRational numbersInjective functionWell-ordering principleThe integers are countableBijective iff it has a two-sided inverseCountable setProduct of countable sets is countableComposition of injections is injectiveSchröder–Bernstein theorem

Proof

We find injections in both directions and apply the Schröder–Bernstein theorem.

  1. Let x∈ℚx \in \Q be a rational number. Then x=p/qx = p/q for some p∈ℤp \in \Z and some integer q≥1q \ge 1.
  2. So the set Dx={q∈ℕ:q≥1, qx∈ℤ}D_x = \{q \in \N : q \ge 1,\ qx \in \Z\} is nonempty. By the well-ordering principle, it has a least element qxq_x.
  3. Define r ⁣:ℚ→ℤ×ℕr \colon \Q \to \Z \times \N by r(x)=(qxx, qx)r(x) = (q_x x,\ q_x). Its first entry is an integer by the choice of qxq_x.
  4. The map rr is injective. If r(x)=r(y)r(x) = r(y), then qx=qyq_x = q_y and qxx=qyyq_x x = q_y y. Dividing by qx≥1q_x \ge 1 gives x=yx = y.
  5. By the integers are countable, there is a bijection f ⁣:ℕ→ℤf \colon \N \to \Z. Its inverse f−1 ⁣:ℤ→ℕf^{-1} \colon \Z \to \N is a bijection, so it is injective. Hence ℤ\Z is countable.
  6. The set ℕ\N is countable, through the identity map. By the product of countable sets is countable, there is an injection s ⁣:ℤ×ℕ→ℕs \colon \Z \times \N \to \N.
  7. The composite s∘r ⁣:ℚ→ℕs \circ r \colon \Q \to \N is injective.
  8. The inclusion ℕ→ℚ\N \to \Q, n↦nn \mapsto n, is injective.
  9. By the Schröder–Bernstein theorem, steps 7 and 8 give a bijection ℕ→ℚ\N \to \Q. So ℚ\Q is countably infinite.

Idea

Code each rational by its smallest positive denominator and the matching numerator. This gives an injection into the countable set ℤ×ℕ\Z \times \N, so ℚ\Q is countable. Since ℚ\Q also contains a copy of ℕ\N, the Schröder–Bernstein theorem upgrades this to a bijection with ℕ\N.

Reading path

To understand this page from the ground up, read these 59 pages in order. The foundations come first. The path takes the proofs Proof of the commutativity of addition by induction, Proof that a composition of injections is injective, Proof that a function is bijective iff it has a two-sided inverse, Proof that the product of countable sets is countable, Proof of the Schröder–Bernstein theorem, Proof that the integers are countable, Proof of strong induction from ordinary induction, Proof of the well-ordering principle from strong induction, Proof of the division algorithm.

  1. Definition by recursion concept
  2. Divisibility definition
  3. Element definition
  4. Mathematical induction concept
  5. Natural numbers object
  6. Peano axioms concept
  7. Proposition concept
  8. Rational numbers object
  9. Set definition
  10. Successor function definition
  11. Disjunction definition
  12. Implication definition
  13. Predicate definition
  14. Family of sets definition
  15. Ordered pair definition
  16. Union definition
  17. Addition of natural numbers definition
  18. The successor function is injective statement
  19. Zero is not a successor statement
  20. Existential quantifier definition
  21. Universal quantifier definition
  22. Cartesian product definition
  23. Proof of the commutativity of addition by induction proof
  24. Union of a family of sets definition
  25. Subset definition
  26. Order on the natural numbers definition
  27. Uniqueness quantifier definition
  28. Binary relation definition
  29. Commutativity of addition statement
  30. Proof of strong induction from ordinary induction proof
  31. Function definition
  32. Strong induction statement
  33. Codomain definition
  34. Function composition definition
  35. Identity function definition
  36. Injective function definition
  37. Image of a set definition
  38. Proof of the well-ordering principle from strong induction proof
  39. Surjective function definition
  40. Left inverse definition
  41. Right inverse definition
  42. Proof that a composition of injections is injective proof
  43. Countable set definition
  44. Well-ordering principle statement
  45. Bijective function definition
  46. Composition of injections is injective statement
  47. Proof of the division algorithm proof
  48. Cantor pairing function example
  49. Countably infinite set definition
  50. Proof that a function is bijective iff it has a two-sided inverse proof
  51. Division algorithm statement
  52. Proof of the Schröder–Bernstein theorem proof
  53. Bijective iff it has a two-sided inverse statement
  54. Proof that the integers are countable proof
  55. Proof that the product of countable sets is countable proof
  56. Schröder–Bernstein theorem statement
  57. The integers are countable statement
  58. Product of countable sets is countable statement
  59. Proof that the rationals are countable proof

Where this leads

7 pages build on this one.

Further reading

  1. Web https://proofwiki.org/wiki/Rational_Numbers_are_Countably_Infinite, Proof 2
About this page
TagNZS3WREM6K
URIm2://NZS3WREM6K
Kindproof
WritingW0 stub
MSC03E10
ProvesThe rationals are countable
UsesCountably infinite set, Rational numbers, Injective function, Well-ordering principle, The integers are countable, Bijective iff it has a two-sided inverse, Countable set, Product of countable sets is countable, Composition of injections is injective, Schröder–Bernstein theorem
Changed4 November 2026

Markdown · JSON · Edit on GitHub

What this page needs for W1

  • an inventory row: the row of the inventory that the node accounts for (0 of 1)

The writing levels say how complete the text of a page is. They do not measure its truth.

What links here

No page links to this page yet.