113. Finite sets
We begin by giving a mathematical definition of the idea that a set has $n$ elements. No doubt you have no trouble understanding a statement such as “$S$ has 5 elements” without a formal definition; however, giving a formal meaning to such statements allows us to prove theorems about the number of elements of a set that have turned out to have many applications.
In this definition we use the set $\mathbf{n} =\{i \in \mathrm{N} \mid 1\leq i \leq n\}$ (Definition 36.1, page 50).
113.1 Definition: number of elements of a finite set
Let $n$ be a nonnegative integer. The statement, “A set $S$ has $n$ elements” means there is a bijection $F\colon\mathbf{n} \to S$.
113.1.1 Example A set has 5 elements if there is a bijection from $\{ 1, 2, 3, 4, 5\}$ to the set. Thus the formal definition captures the usual meaning of number of elements: if a set has 5 elements, the process of counting them — “This is the first element, this is the second element,...” — in effect constructs a bijection from $\mathbf{n}$ to the set.
113.1.2 Exercise Give an explicit proof that the set of positive divisors of 8 has 4 elements. (Answer on page 249.)
113.2 Definition: finite
A finite set is a set with $n$ elements, where $n$ is some nonnegative integer.
113.2.1 Example The empty set is finite, since it has 0 elements, and the set $\{ 1, 3, 5, 7, 9\}$ is finite because it has 5 elements.
113.3 Definition: cardinality
The number of elements of a finite set is the cardinality of the set. For any finite set $A$, the cardinality of $A$ is denoted $|A|$.
113.3.1 Example $|\emptyset |= 0$ and $|\{ 1, 3\}|= 2$.
113.3.2 Exercise Show that if $A$ is a finite set and $\beta\colon B \to A$ is a bijection then $B$ is finite.
113.3.3 Exercise Show that a subset of a finite set is finite. Make sure you use the definition of finite in your proof.
113.4 Infinite sets
A set which is not finite is infinite. Sets such as $\mathrm{N}$, $\mathrm{Z}$ and $\mathrm{R}$ are infinite. Since “infinite” merely means “not finite”, to say that $\mathrm{R}$ (for example) is infinite means just that there is no nonnegative integer $n$ for which the statement “$\mathrm{R}$ has $n$ elements” is true. This is certainly correct in the case of $\mathrm{R}$, since if you claim (for example) that $\mathrm{R}$ has 42 elements, all I have to do is add up the absolute values of those 42 numbers to get a number which is bigger than all of them, so is a 43rd element.
We do not go into the extensive theory of infinite sets in this book, but it is important to understand the difference between “finite” and “infinite” since many theorems, such as the ones in this section, concern only finite sets.
113.4.1 Warning It is tempting when faced with proving a theorem about possibly infinite sets to talk about one set having “more elements than another”. Such arguments are often fallacious. For example: “There cannot possibly be an injective function from $\mathrm{N} \times\mathrm{N}$ to $\mathrm{N}$ since $\mathrm{N} \times\mathrm{N}$ has more elements than $\mathrm{N}$.” But there are such functions: see Exercises 93.1.8 and 113.5.3. Compare the extended hint to Exercise 92.1.8.
113.5 Exercise set
A set $S$ is countably infinite if there is a bijection $\beta\colon \mathrm{N} \to S$. Problems 113.5.1 through 113.5.4 explore this property.
113.5.1 Exercise Show that the set $\mathrm{N}^{+}$ of positive integers is countably infinite. (Answer on page 249.)
113.5.2 Exercise Show that $\mathrm{Z}$ is countably infinite.
113.5.3 Exercise Show that $\mathrm{N} \times \mathrm{N}$ is countably infinite.
113.5.4 Exercise (hard) Show that $\mathrm{Q}$ is countably infinite.
Pages 173–174 of the book (PDF).