The denumerability of the rational numbers
ProvedFamousTheorems.denumerable_ratmathlibset-theory
The rationals are countable.
There is a bijection .
Cantor's 1874 result, and a genuine surprise: is dense in — between any two rationals lies another — yet it has exactly as many elements as the sparse, discrete . Density and cardinality are unrelated.
The standard enumeration lists the fractions in a grid by anti-diagonals, skipping non-reduced entries; the Stern–Brocot tree and the Calkin–Wilf sequence give explicit bijections with no skipping at all.
Paired with the uncountability of , this is what shows the irrationals — indeed the transcendentals — form the overwhelming majority of the reals.
Preamble
import Mathlib
Formal statement
namespace FamousTheorems theorem denumerable_rat : Nonempty (ℕ ≃ ℚ) := by sorry end FamousTheorems
Source
One of Freek Wiedijk's "100 theorems"; formalized in Mathlib. Proof here reduces to the corresponding Mathlib result.