The first function, , gives us more information about the set than the second function, . Since clearly has four elements, tells us that contains at least four elements since each element of is mapped onto a different element of . The properties that has, and does not have, are the most basic properties that we look for in a function. The following definitions summarize the basic vocabulary for function properties.
Let be the set of students who are sitting in a classroom, let be the set of seats in the classroom, and let be the function which maps each student into the chair he or she is sitting in. When is one to one? When is it onto? Under normal circumstances, would always be injective since no two different students would be in the same seat. In order for to be surjective, we need all seats to be used, so is a surjection if the classroom is filled to capacity.
Functions can also be used for counting the elements in large finite sets or in infinite sets. Let’s say we wished to count the occupants in an auditorium containing 1,500 seats. If each seat is occupied, the answer is obvious, 1,500 people. What we have done is to set up a one-to-one correspondence, or bijection, from seats to people. We formalize in a definition.
Two sets are said to have the same cardinality if there exists a bijection between them. If a set has the same cardinality as the set , then we say its cardinality is .
The function that opened this section serves to show that the two sets and have the same cardinality. Notice in applying the definition of cardinality, we don’t actually appear to count either set, we just match up the elements. However, matching the letters in with the numbers 1, 2, 3, and 4 is precisely how we count the letters.
Example7.2.10.As many evens as all positive integers.
Recall that for some . Paradoxically, has the same cardinality as the set of positive integers. To prove this, we must find a bijection from to . Such a function isn’t unique, but this one is the simplest: where . Two statements must be proven to justify our claim that is a bijection:
Proof: Let . We want to show that there exists an element such that . If , for some by the definition of . So we have . Hence, each element of 2 is the image of some element of .
Another way to look at any function with as its domain is creating a list of the form . In the previous example, the list is . This infinite list clearly has no duplicate entries and every even positive integer appears in the list eventually.
A function is a bijection if the infinite list contains no duplicates, and every element of appears once in the list. In this case, we say the is countably infinite, or simply countable.
When studying infinity, paradoxes abound. One of the first instances of this is when we observe that the set of even positive integers, in spite of the fact that they make up only half of the positive integers, has the same cardinality as the whole set of positive integers. This follows from our definition of cardinality with the function , which is a bijection from the positive integers to the even positive integers. We can make a similar observation that the seemingly smaller set of powers of ,, also has the same cardinality as the positive integer. Here, the function serves as our justification.
Going in the opposite direction, there are seemingly larger sets than the positive integer that are countably infinite. One such example is the Cartesian product of the positive integers with itself, . A function that justifies this claim doesn’t have such a neat formula, but it would start like this:
Readers who have studied real analysis should recall that the set of rational numbers is a countable set, while the set of real numbers is not a countable set. See the exercises at the end of this section for an another example of such a set.
We close this section with a theorem called the Pigeonhole Principle, which has numerous applications even though it is an obvious, common-sense statement. Never underestimate the importance of simple ideas. The Pigeonhole Principle states that if there are more pigeons than pigeonholes, then two or more pigeons must share the same pigeonhole. A more rigorous mathematical statement of the principle follows.
Assume that a room contains four students with the first names John, James, and Mary. Prove that two students have the same first name. We can visualize a mapping from the set of students to the set of first names; each student has a first name. The pigeonhole principle applies with , and we can conclude that at least two of the students have the same first name.
Suppose that pairs of socks are mixed up in your sock drawer. Use the Pigeonhole Principle to explain why, if you pick socks at random, at least two will make up a matching pair.
Let socks selected and pairs of socks and define where the pair of socks that belongs to . By the Pigeonhole principle, there exist two socks that were selected from the same pair.
Let and be finite sets where . Is it possible to define a function that is one-to-one but not onto? Is it possible to find a function that is onto but not one-to-one?
The proof is due to Georg Cantor (1845-1918), and involves listing the rationals through a definite procedure so that none are omitted and duplications are avoided. In the first row list all nonnegative rationals with denominator 1, in the second all nonnegative rationals with denominator 2, etc. In this listing, of course, there are duplications, for example, ,,, etc. To obtain a list without duplications follow the arrows in Figure 7.2.15, listing only the circled numbers.
We obtain: Each nonnegative rational appears in this list exactly once. We now must insert in this list the negative rationals, and follow the same scheme to obtain:
Use the Pigeonhole Principle to prove that an injection cannot exist between a finite set and a finite set if the cardinality of is greater than the cardinality of .
Let be any function from into . By the Pigeonhole principle with , there exists an element of that is the image of at least two elements of . Therefore, is not an injection.
The important properties of relations are not generally of interest for functions. Most functions are not reflexive, symmetric, antisymmetric, or transitive. Can you give examples of functions that do have these properties?
The proof is indirect and follows a technique called the Cantor diagonal process. Assume to the contrary that the set is countable, then the elements can be listed: where each is an infinite sequence of 0s and 1s. Consider the array: