The set of rational numbers is countable

Written by Patrick Stevens last updated

The set of rational numbers is countable: that is, there is a bijection between and the set of natural numbers.

Proof

By the Schröder-Bernstein theorem, it is enough to find an injection and an injection .

The former is easy, because is a subset of so the identity injection works.

For the latter, we may define a function as follows. Take any rational in its lowest terms, as , say. [1] At most one of and is negative (if both are negative, we may just cancel from the top and bottom of the fraction); by multiplying by if necessary, assume without loss of generality that is positive. If then take .

Define to be if is positive, and if is negative.

Then produce the natural number .

The function is injective, because prime factorisations are unique so if (with both fractions in their lowest terms, and positive) then and the sign of is equal to the sign of . Hence the two fractions were the same after all.

  1. ^︎

    That is, the GCD of the numerator and denominator is .

Parents: