\(f\) represents Cantor's pairing function for a \(\mathbb{Q^{+}}\) of the form \(\frac{p}{q}\)

Substituting \(p\) and \(q\) into \(f\) we get

The pairing sequence starts at point \((0,0)\) and traverses all points on the Cartesian plane in a zigzag pattern until reaching the indicated coordinate.

Note that to handle any value \(p \in \mathbb{Z}\), another function should be applied that maps to \(2p\) if \(p\geq 0\), otherwise to \(-2p - 1\). This is applied to \(p\) since it can take the sign of the fraction.

In set theory, this sequence is used to prove that \(\mathbb{Q}\) has the same cardinality as \(\mathbb{N}\).



Presentation