logoalt Hacker News

krackerstoday at 7:54 PM0 repliesview on HN

The cantor pairing function is a bijection though between (N, N) -> N so it does establish a bijection in cardinality between positive rationals and N.

The approach you mentioned would be if you used a non-bijective function to map from (N, N) to N like 2^a 3^b which can show that the cardinality of positive rationals is a subset of the cardinality of the naturals, and then you get your version of the proof.

Edit: Wait unless the objection was that actually the bijection from (N, N) -> N is not sufficient since e.g. (1,1) and (2,2) all map to the same rational. You could probably skip duplicates when enumerating, but if you insist on a explicit constructive version I have no idea how you'd find the inversion formula for that.