A Brief Review of Functions

Definition: The cardinality of a set S, denoted |S|, is the number of elements in S. If the set has an infinite number of elements, then its cardinality is $\infty $.

Example: |{1, 7, 3}| = 3

Example: |N| = $$∞

Definition: A function f from a set A to a set B, denoted f:A->B, is a binary relation R on A and B with the following property: for each a$\in $A, there is exactly one ordered pair in R with first component a. In other words, there exists a unique b$\in $B such that f(a) = b.

Definition: A function f:A->B is one-to-one if for all distinct elements a, b$\in $A, f(a)$\ne $f(b). If f is one-to-one, f is called an injection.

Definition: A function f:A->B is onto B if for all y in B, there exists a in A such that f(a) = y. If f is onto B, we call B a surjection.

Example: Show that the function f(x) = x$2$ is not one-to-one.

Example: Show that the function f:R->R$$ ,\; where\; f(x)\; =\; 3x+5,$ $is\; onto\; the\; set\; of\; real\; numbers.$$

Definition: A function f:A->B is a bijection between A and B if it is both one-to-one and onto.

Exercise: Show that f:R->R, where f(x) = 3x+5, is a bijection.

Counting: Finite and Infinite Sets

Definition: Two sets A and B have the same cardinality if there is a bijection f:A->B.

Example: The sets A={red, violet, green, yellow} and B={1, 2, 3, 4} have the same cardinality, since there is a bijection from A to B (find one). Note that it also suffices to give a bijection from B to A (why?).

Definition 1: A set A is finite (with cardinality n$\in $N) if there is a bijection from the set {0, 1, ..., n-1} to A, for some natural number n. A set A is infinite if it is not finite.

Theorem: The set N of natural numbers is infinite.

Proof: To prove that N is not finite, we must show that there is no natural number n such that a bijection exists from {0, ..., n-1} to N. Let n be any natural number and f an arbitrary function from {0, 1, ..., n-1} to N. Let k = 1 + max{f(0), f(1), ..., f(n-1)}. Then k$\in $N, but f(x)$\ne $ k for every x$\in $ {0, 1, ..., n-1}. So f is not onto, and it follows that f is not a bijection. Since we chose f and n arbitrarily, we know that N is infinite. QED.

Sometimes it is easier to show a set is infinite using the following alternate definition:

Definition 2: A set A is infinite if there exists an injection f:A->A such that f(A) is a proper subset of A. A set is finite if it is not infinite.

A second proof that N is infinite: The function f:N->N, given by f(x) = 2x, is an injection (prove!) and f(N) is the set of all even integers, which is a proper subset of N. QED.

It can be proved that Definition 1 and Definition 2 are equivalent using the Axiom of Choice. This is beyond the scope of this class (but feel free to read further on your own!).

Example: Show that {a, b}* is infinite.

Proof: Let f:{a,b}*->{a, b}* be defined by f(x) = ax. Then f is one-to-one, and the image of f is the proper subset of {a, b}* that contains all strings beginning with the letter a. QED.

Exercise: Show that the closed interval [0, 1] is infinite using definition 2.

Some Important Properties of Finite and Infinite Sets

Theorem: Let A be a subset of B. If A is infinite, then B is infinite.

Proof: Since A is infinite, there is an injection f:A->A and a proper subset X of A such that f(A) = X. To show that B is infinite, we will define an injection g:B->B such that g(B) is a proper subset of B. Define g as follows:

g(x) = f(x) if x is in A,

g(x) = x if x is in B-A.

Then g is an injection (you prove), and g(B) does not include any element of A-X, so g(B) is a proper subset of B. Therefore B is infinite. QED.

Theorem: Every subset of a finite set is finite.

Proof: This is the contrapositive of the previous theorem. QED.

Theorem: Let f:A->B be an injection, and assume that A is infinite. Then B is infinite.

Proof: exercise

Theorem: Let A and B be sets where A is infinite. Then

a) the power set of A is infinite,

b) if B is nonempty, AxB is infinite.

Proof: a) Define the function f:A->$2A$, where f(x) ={x}. Then f is obviously an injection, and so by the previous theorem, the power set of A is infinite.

b) Since B is non-empty, we choose some arbitrary element b in B, and define a function f:A->AxB by

f(x) = (x, b).

Obviously f is an injection, so it follows from the previous theorem that AxB is infinite.