A set \(X\) is said to be finite when either (1) \(X=\emptyset\text{;}\) or (2) there exists positive integer \(n\) and a bijection \(f:[n]\bijection X\text{.}\) When \(X\) is not finite, it is called infinite. For example, \(\{a,\emptyset,(3,2),\posints\}\) is a finite set as is \(\posints\times\emptyset\text{.}\) On the other hand, \(\posints\times \{\emptyset\}\) is infinite. Of course, \([n]\) and \(\bfn\) are finite sets for every \(n\in\posints\text{.}\)
Suppose that the set \(P\) of primes is finite. It is non-empty since \(2\in P\text{.}\) Let \(n\) be the unique positive integer for which there exists a bijection \(f:[n]\rightarrow P\text{.}\) Then let
Then \(p\) is not divisible by any of the primes in \(P\) but is larger than any element of \(P\text{.}\) Thus, either \(p\) is prime or there is a prime that does not belong to \(P\text{.}\) The contradiction completes the proof.
Let \(X\) and \(Y\) be finite sets. If there exists an injection \(f:X\injection Y\) and an injection \(g:Y \injection X\text{,}\) then there exists a bijection \(h:X \bijection Y\text{.}\)
When \(X\) is a finite non-empty set, the cardinality of \(X\text{,}\) denoted \(|X|\) is the unique positive integer \(n\) for which there is a bijection \(f:[n]\bijection X\text{.}\) Intuitively, \(|X|\) is the number of elements in \(X\text{.}\) For example,
We note that the statement in Proposition B.11 is an example of “operator overloading”, a technique featured in several programming languages. Specifically, the times sign \(\times\) is used twice but has different meanings. As part of \(X\times Y\text{,}\) it denotes the cartesian product, while as part of \(|X|\times |Y|\text{,}\) it means ordinary multiplication of positive integers. Programming languages can keep track of the data types of variables and apply the correct interpretation of an operator like \(\times\) depending on the variables to which it is applied.