Keywords

These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.

Sets are of fundamental importance in mathematics. The very number systems that we studied in the preceding chapter were all discussed in terms of a set of numbers. Many problems of discrete mathematics can conveniently be expressed in terms of sets, especially finite sets. For this reason, we need to discuss the properties of sets and develop language to talk about them.

Along with sets, it is appropriate to discuss elementary logic. We shall observe a parallel between the logic of propositions and set theory.

Both mathematical logic and set theory are broad areas of mathematics, and we only discuss them briefly here; moreover our interest is in the discrete case, and we emphasize finite cases. The interested reader will find that there is a wide literature on both these topics, and they contain very deep problems.

2.1 Propositions and Logic

2.1.1 Propositions and Truth Tables

We shall define a proposition to be a statement that has a well-defined truth value, that is, it is either true (T) or false (F). Some statements in English are not propositions—one example is matters of opinion, such as “I like apples”; these are not propositions. On the other hand, “it will rain on this day next year” is a proposition: it is either true or false (we are not worried about whether or not we know the truth value, or even if it is possible to know it).

Simple propositions, like “today is Tuesday” and “it is raining,” can be combined to form compound propositions, like “today is Tuesday and it is raining,” by using a connective (“and” in the example). The truth value of a compound proposition can be calculated once we know the truth values of the simple propositions from which it is formed, and the connective used to combine these simple propositions together.

The simplest connectives are “not,” “and,” “or,” denoted by ∼, ∧, ∨ respectively. If p and q denote propositions, then the proposition “not p” (denoted ∼p) is true precisely when p is false, the proposition “p and q” (denoted pq) is true precisely when p is true and q is true, and the proposition “p or q” (denoted pq) is true precisely when p is true or when q is true or when both p and q are true. (This is the meaning called “inclusive or,” the usual usage in mathematics.) The truth values of these compound propositions are shown in Table 2.1. Such tables are called truth tables.

Table 2.1 Truth tables of ∼,∧,∨

Formally, ∼p is called the negation of p, pq is the disjunction of propositions p and q, and pq is the conjunction of p and q.

Often alternate phrases are used. For example, we sometimes use “as well (as)” instead of “and.” In English, we often use “but” instead of “and” when one of the two propositions is negative. Both these connectives are represented by ∧: if p means “today is cold” and q means “today is sunny,” then pq could be translated as “today is cold and sunny,” “today is cold but sunny,” or “today is cold as well as sunny.”

Sample Problem 2.1

Let p denote the proposition “the sun is shiningand q the proposition “the wind is blowing.” Write expressions for “the sun is not shining,” “the sun is shining and the wind is blowing,” and “the sun is shining but the wind is not blowing.”

Solution

p denotes “the sun is not shining,” pq denotes “the sun is shining or the wind is blowing,” and pq denotes “the sun is shining and the wind is blowing.”

Practice Exercise

Write expressions for “the wind is not blowing,” “the sun is shining or the wind is blowing (maybe both),” and “the sun is not shining but the wind is blowing.”

Sample Problem 2.2

Suppose p, q and r mean “Joseph is here,” “Nancy is hereand “Donna is here.” Interpret p∧∼q and (pq)∧r.

Solution

p∧∼q means “Joseph is here but Nancy is not;” (pq)∧r means “Joseph, Nancy and Donna are here.”

Practice Exercise

In this situation, interpret (pr)∧∼q and qr.

We sometimes think of a truth table as showing the truth or falsity of different outcomes of an experiment or set of events, as the following sample problem shows.

Sample Problem 2.3

Suppose one card is drawn from a standard deck. Let p represent the statement “the card is a heartand q represent “the card is an honor” (ace, king, queen, jack or ten). For which draws are pq and pq true?

Solution

For pq to be true, the card must be a heart and it must be an honor. So it is true when the draw is the ace, king, queen, jack or ten of hearts (5 cases), and is false for all other cards (the other 47 cases). pq will be true for all thirteen hearts and all five honors in clubs, diamonds or spades (28 cases in all) and false in the other 24 cases.

Practice Exercise

In the same situation, which draws make p∧∼q true? Which make p∨∼q true?

To find the truth table of a statement with several connectives, we work one step at a time. For instance, to find the truth table of

$$(p \vee {\sim} q) \wedge(q \vee {\sim} p),$$

we consider ∼p, ∼q, p∨∼q, q∨∼p, and finally the whole expression, as shown in Table 2.2.

Table 2.2 Truth table of (p∨∼q)∧(q∨∼p)

Sample Problem 2.4

Find the truth table of (pq)∨(q∧∼r).

Solution

p

q

r

r

(pq)

(q∧∼r)

(pq)∨(q∧∼r)

T

T

T

F

T

F

T

T

T

F

T

T

T

T

T

F

T

F

F

F

F

T

F

F

T

F

F

F

F

T

T

F

F

F

F

F

T

F

T

F

T

T

F

F

T

F

F

F

F

F

F

F

T

F

F

F

Practice Exercise

Find the truth table of (p∨(q∨(∼p∧∼r))).

Two other connectives we use frequently are pq, meaning “if p then q,” or “p implies q,” and pq, meaning “p if and only if q,” or in other words “if p then q and if q then p.” These are called the conditional (→) and the biconditional (↔). Their truth tables are shown in Table 2.3. The interpretation of “implies” is that, if there is never a case where p is true and q is false, then we count pq as true; this explains the last two lines of the table.

Table 2.3 Truth tables of pq and pq

Sample Problem 2.5

Find the truth table for

$$(p \wedge{\sim} q) \to(q \vee p).$$

Solution

We proceed in steps as before. The result is as follows.

p

q

q

p∧∼q

qp

(p∧∼q)→(qp)

T

T

F

F

T

T

T

F

T

T

T

T

F

T

F

F

T

T

F

F

T

F

F

T

Practice Exercise

Find the truth table for

$$(p \vee{\sim} q) \leftrightarrow(q \to p).$$

2.1.2 Tautologies, Theorems and Logical Equivalence

The statement Sample Problem 2.5 is in fact a tautology. A compound statement is a tautology if it is always true, regardless of the truth values of the simple statements from which it is constructed. A statement that is always false is called a contradiction; a very simple example is p∧∼p. Other statements that do not fall into either category are called contingent.

One of the main aims of logical deduction is to establish tautologies. For example, what we call theorems in mathematics are actually tautologies. The word “theorem” usually denotes a tautology whose essential truth is not immediately obvious, so that some proof is required to establish it.

One very easy example is the fact that every integer is a rational number. This requires a proof with only one step: we need to observe that any integer x can be written as the ratio of two integers, namely x/1. The truth of the theorem does not depend on the value of the rational number x.

Sample Problem 2.6

Show that p∨∼(pq) is a tautology.

Solution

We use the following truth table.

p

q

(pq)

∼(pq)

p∨∼(pq)

T

T

T

F

T

T

F

F

T

T

F

T

F

T

T

F

F

F

T

T

Practice Exercise

Show that (pq)∧∼(pq) is a contradiction.

If pq is a tautology, we say “p implies q,” and write “pq.” If pq is a tautology, we say that “p is equivalent to q” and write “pq” or “pq.” In order to prove that pq, it is sufficient to prove that p and q have the same truth table.

2.1.3 The Laws of Logic

A number of theorems (tautologies) about propositions may be deduced from truth tables, and together they form an algebraic system that is called mathematical (or symbolic) logic. (An alternative view is to take some of the tautologies as axioms, and deduce the truth tables for the standard connectives.) Some of them are very reminiscent of the usual arithmetical laws, with ≡ taking the place of equality. Among these we have:

Commutative laws:

Associative laws:

Distributive laws:

where each statement is true for all propositions p,q,r. This reminds us of the behavior of addition and multiplication, except that only one pair of distributive laws holds for ordinary arithmetic.

In view of the associative laws, stated above, we can simply write pqr whenever either p∨(qr) or (pq)∨r, is intended, and similarly pqr means either p∧(qr) or (pq)∧r.

If t is a proposition that is always true, and if q is always false, then p acts like an identity element for the operation ∧ and q acts like an identity element for ∨:

$$p \wedge t \equiv p, \qquad p \vee f \equiv p,$$

for all p. This is like the behavior of 1 under multiplication or 0 for addition. There are also zero laws:

$$p \vee t \equiv t, \qquad p \wedge f \equiv f,$$

for all p. This reminds us of 0 under multiplication, but there is no corresponding element for addition. Finally, there are two laws called de Morgan’s laws:

for all p and q.

Exercises 2.1

In Exercises 1 to 12, find the truth table for the given compound statement.

  1. 1.

    pq.

  2. 2.

    ∼(pq).

  3. 3.

    p→(pq).

  4. 4.

    ∼(∼p∨∼q).

  5. 5.

    p∨(∼pq).

  6. 6.

    p∨(∼pq).

  7. 7.

    p∨∼q.

  8. 8.

    ∼(pq).

  9. 9.

    (pq)∨r.

  10. 10.

    (pr)∧(qr).

  11. 11.

    p∨(qr).

  12. 12.

    (pq)∨r.

  13. 13.

    Use the results of Exercises 7 to 12 to prove the following equivalences.

    1. (i)

      p∨∼q⇔∼(pq).

    2. (ii)

      (pq)∨r⇔(pr)∧(qr).

    3. (iii)

      p∨(qr)⇔(pq)∨r.

Prove the equivalences in Exercises 14 to 16.

  1. 14.

    (pq)⇔(∼pq).

  2. 15.

    (pq)⇔(∼p∧∼q)∨(pq).

  3. 16.

    (pq)⇔(∼q→∼p).

  4. 17.

    Prove that (qp) is not equivalent to (pq) in general.

Find the truth tables for the compound statements in Exercises 18 to 21.

  1. 18.

    (pq)→r.

  2. 19.

    p→(qr).

  3. 20.

    (pr)→(qr).

  4. 21.

    (pq)∧∼(pq).

  5. 22.

    Consider four possible definitions of a connective pq, given by the following table.

    p

    q

    Definition of ↑

    A

    B

    C

    D

    T

    T

    T

    T

    T

    T

    T

    F

    F

    F

    F

    F

    F

    T

    F

    F

    T

    T

    F

    F

    F

    T

    F

    T

    Show that definition D, and only definition D, makes the statement “ppq” a tautology. Also show that definition A is that of pq, B is that of pq, C is that of q itself, and D is pq.

  6. 23.

    Prove that the following statements are equivalent.

    1. (i)

      (pq).

    2. (ii)

      (p∧∼q)→∼p.

    3. (iii)

      (p∧∼q)→q.

  7. 24.

    Prove that (pq)→r and p→(qr) are not equivalent.

  8. 25.

    Prove the two commutative laws.

  9. 26.

    Prove the two associative laws.

  10. 27.

    Prove the two distributive laws.

  11. 28.

    Prove de Morgan’s laws.

  12. 29.

    Let pq denote the compound statement “p or q but not both,” which is often called exclusive or. Find the truth table for pq. Compare it with Table 2.2 and Exercise 21.

In Exercises 30 to 39, find the truth table for the given statement.

  1. 30.

    (pp).

  2. 31.

    (p→∼p).

  3. 32.

    p∧∼p.

  4. 33.

    (pq)→(pq).

  5. 34.

    (pq)→(pq).

  6. 35.

    ((pq)→(pq))∨(∼p).

  7. 36.

    (∼p)∧(pq)→(∼q).

  8. 37.

    q→(pq).

  9. 38.

    (pq)→(pq).

  10. 39.

    p→(qp).

  11. 40.

    Find truth tables for the following propositions. Are any of them equivalent?

    1. (i)

      (pq)∧(∼r→∼q).

    2. (ii)

      r→∼p.

    3. (iii)

      p→∼r.

    4. (iv)

      ∼((∼q→∼p) ∧(q→∼r)).

2.2 Elements of Set Theory

2.2.1 Sets

We saw sets in Section 1.1. The notations ℝ, ℚ, ℤ, ℤ+ and ℤ were introduced for the sets of real numbers, rational numbers, integers, positive integers and non-negative integers respectively.

As we noted, a set can be finite or infinite. We saw that it is often convenient to specify a finite set by listing its elements between braces, but most infinite sets must be defined by explicitly stating the membership law. The set of all objects x for which the statement S(x) is true was written {xS(x)}, or sometimes as {x:S(x)}. For example, the set Π of prime numbers could be denoted (trivially) as

$$\varPi= \{x \mid x \mbox{ is a prime}\}.$$

The definition of a set does not allow for ordering of its elements, or for repetition of its elements. Thus {1,2,3},{1,3,2} and {1,2,3,1} all represent the same set (which could be written {xx∈ℤ and x≤3}, or {x∈ℤx≤3}). To handle problems that involve ordering, we define a sequence to be an ordered set. Sequences can be denoted by parentheses; (1,3,2) is the sequence with first element 1, second element 3 and third element 2, and is different from (1,2,3). Sequences may contain repetitions, and (1,2,1,3) is quite different from (1,2,3); the two occurrences of object 1 are distinguished by the fact that they lie in different positions in the ordering.

We defined the notation

$$s \in S$$

to mean “s belongs to S” or “s is an element of S,” and ST to mean S is a subset of T. If ST we also say that T contains S or T is a superset of S, and write TS. Sets S and T are equal, S=T, if and only if ST and TS are both true. We can represent the situation where S is a subset of T but S is not equal to T—there is at least one member of T that is not a member of S—by writing ST.

An important concept is the empty set, or null set, which has no elements. This set, denoted by ∅, is a subset of every other set.

In all the discussions of sets in this book, we shall assume (usually without bothering to mention the fact) that all the sets we are dealing with are subsets of some given universal set U. U may be chosen to be as large as necessary in any problem we deal with; in most of our discussion so far we could have chosen U=ℤ or U=ℝ. U can often be chosen to be a finite set.

The power set of any set S consists of all the subsets of S (including S itself and ∅), and is denoted by \(\mathcal{P} (S)\):

$$\mathcal{P} (S) = \{T : T \subseteq S\}. $$
(2.1)

The power set is a set whose elements are themselves sets.

Sample Problem 2.7

Write down all elements of the power set of {1,2,3}. How many elements are there?

Solution

There are eight elements: {1,2,3}, {1,2}, {1,3}, {2,3}, {1}, {2}, {3}, and ∅.

Practice Exercise

Write down all elements of the power set of {x,y,z}.

2.2.2 Operations on Sets

Given sets S and T, we define three operations: the union of S and T is the set

$$S \cup T = \bigl\{x : x \in S \mbox{ or } x \in T \mbox{ (or both)}\bigr\};$$

the intersection of S and T is the set

$$S\cap T = \{x : x \in S \mbox{ and } x \in T \};$$

the relative complement of T with respect to S (or alternatively the set-theoretic difference or relative difference between S and T) is the set

$$S \backslash T = \{x : x \in S \mbox{ and } x \not\in T \}.$$

In particular, the relative complement U\T with respect to the universal set U is denoted by \(\overline{T}\) and called the complement of T. We could also write \(R \backslash S = R \cap\overline{S}\), since each of these sets consists of the elements belonging to R but not to S. Hence we see that RS if and only if R\S=∅.

Sample Problem 2.8

If \(\mathbb{E}\) is the set of all even integers, what are \(\mathbb{E}\cup\varPi\), \(\mathbb{E}\cap\varPi\), \(\mathbb{E}\backslash\varPi\), ℤ∪ℤ+, ℤ\Π?

Solution

Practice Exercise

What are ℤ\ℤ+, ℤ∩ℤ+, \((\mathbb{Z}^{+}\backslash \mathbb{E})\cup\varPi\)?

If two sets, S and T, have no common element, so that ST=∅, then we say that S and T are disjoint. Observe that S\T and T must be disjoint sets; in particular, T and \(\overline{T}\) are disjoint. If n sets S 1,S 2,…,S n are such that each pair of them are disjoint, so that

$$S_i \cap S_j \quad \mbox{for } 1 \le i, j \le n \mbox{ and } i \ne j,$$

then we say that these n sets are pairwise disjoint or mutually disjoint. By a partition of a set S we mean a collection of pairwise disjoint non-empty sets S 1,S 2,…,S n whose union is S.

In general, to prove that the set S is a subset of the set T, we start with the statement, “suppose x is any element of S,” and finish with “therefore x is an element of T.” To show that S and T are equal, prove both ST and ST. Another method of proving S=T is to work as follows. Find an exact description of the elements of S—something of the form “S is precisely the set of all elements x with the following properties …,” and prove that this description is also precisely the description of elements of T.

Sometimes proofs of the form “suppose x is any element of S” are simpler if the argument is broken into two parts: first consider all elements x with a certain property, then all those without that property. For example, to prove that (R\S)∪S=RS, for any two sets R and S, first observe that if x is a member of S, then it belongs to both (R\S)∪S and RS. So we need only discuss x not in S. The elements of (R\S)∪S not in S are precisely the elements of R\S, while the elements of RS not in S are the members of R not in S—precisely the same elements. So (R\S)∪S=RS.

2.2.3 Properties of the Operations

We now investigate some of the easier properties of the operations ∪, ∩ and \; for the more difficult problems, we shall introduce some techniques in the next section.

Union and intersection both satisfy idempotence laws: for any set S,

$$S \cup S = S \cap S = S.$$

Both operations satisfy commutative laws; in other words

$$S \cup T = T \cup S$$

and

$$S \cap T = T \cap S,$$

for any sets S and T. Similarly, the associative laws

$$R\cup(S \cup T) = (R \cup S) \cup T$$

and

$$R \cap(S \cap T) = (R \cap S) \cap T$$

are always satisfied. The associative law means that we can omit brackets in a string of unions (or a string of intersections); expressions like (AB)∪(CD), ((AB)∪C)∪D and (A∪(BC))∪D, are all equal, and we usually omit all the parentheses and simply write ABCD. But be careful not to mix operations. (AB)∩C and A∪(BC) are quite different. Combining the commutative and associative laws, we see that any string of unions can be rewritten in any order: for example,

$$(D \cup B) \cup(C \cup A) = C \cup\bigl(B \cup(A \cup D)\bigr) = (A \cup B\cup C \cup D).$$

Sample Problem 2.9

Prove that (AB)∩C=A∪(BC) is not always true.

Solution

To prove that a general rule is not true, it suffices to find just one case in which it is false. This is called a counterexample. As an example we take the case A=ℝ, B=ℤ, C={0}. Then (AB)∩C={0}, while A∪(BC)=ℝ.

The following distributive laws hold:

(2.2)
(2.3)
(2.4)

Sample Problem 2.10

Prove the distributive law (2.2).

Solution

Suppose xR∪(ST). It may be that xR; in that case, both x∈(R ∪ S) and x∈(R ∪ T) are true (in fact, x∈(R ∪ A) is true for any set A), so x∈(RS) ∩ (RT). On the other hand, if \(x \not\in R\), then x∈(S ∩ T), and x belongs both to S and to T. Now xSx∈(RS), and xTx∈(RT), so x∈(ST)⇒x∈(RS)∩(RT). So in either case,

$$x \in R \cup(S \cap T) \quad\Rightarrow\quad x \in(R \cup S) \cap (R \cup T) ,$$

and R∪(ST)⊆(RS)∩(RT).

Conversely, suppose x∈(RS)∩(RT). If xR, then certainly xR∪(ST). If \(x \not\in R\), then x∈(RS)⇒xS, and x∈(RT)⇒xT. So

$$x \in(R \cup S) \cap(R \cup T) \quad\Rightarrow\quad x \in(S \cap T)\quad\Rightarrow\quad x\in R \cup(S \cap T)$$

and (RS)∩(RT)⊆R∪(ST). So the two sets are equal.

Practice Exercise

Prove the distributive law (2.3).

We have also the equation

$$R \backslash(S \cup T) = (R \backslash S) \cap(R \backslash T), $$
(2.5)

and the analogous

$$R \backslash(S \cap T) = (R \backslash S) \cup(R \backslash T). $$
(2.6)

Sample Problem 2.11

Prove (2.5) from the definition.

Solution

R\(S ∪ T) consists of precisely those members of R that are not members of ST, in other words those elements of R that do not belong to S or to T. That is,

$$R \backslash(S \cup T) = \{x \mid x \in R \mbox{ and } x \not\in S\mbox{ and } x \not\in T\}.$$

On the other hand, (R\S) consists of all the things in R that are not in S, and (R\S)∩(R\T) consists of all the things in R that are not in T; the common elements of these sets are all the things in R but not in S and not in T, which is the same as the description of R\(ST).

Equation (2.5) can also be verified using the idempotence, associative and commutative laws. From

$$R \backslash(S \cup T) = \{x \mid x \in R \mbox{ and } x \not\in S\mbox{ and } x \not\in T\}$$

we have

When we take the particular case where R is the universal set in (2.5) and (2.6), those two equations become de Morgan’s laws:

(2.7)
(2.8)

Exercises 2.2

  1. 1.

    Suppose A={a,b,c,d,e}, B={a,c,e,g,i}, C={c,f,i,e,o}. Write down the elements of

    1. (i)

      AB.

    2. (ii)

      AC.

    3. (iii)

      A\B.

    4. (iv)

      A∪(B\C).

  2. 2.

    Suppose A={2,3,5,6,8,9}, B={1,2,3,4,5}, C={5,6,7,8,9}. Write down the elements of

    1. (i)

      AB.

    2. (ii)

      AC.

    3. (iii)

      A\(BC).

    4. (iv)

      (AB)\C.

  3. 3.

    Suppose A={1,2,4,5,6,7}, B={1,3,5,7,9}, C={2,4,6,7,8,9}. Write down the elements of

    1. (i)

      ABC.

    2. (ii)

      A∪(BC).

    3. (iii)

      A\C.

    4. (iv)

      A∩(B\C).

  4. 4.

    Suppose A=ℤ+, B={−4,−2,1,3,5,7}, C={xx 2=1}. Write down the elements of

    1. (i)

      (AB)∪C.

    2. (ii)

      ABC.

    3. (iii)

      C\A.

    4. (iv)

      A∩(B\C).

  5. 5.

    Consider the sets

    For which i and j, if any, is S i S j ? For which i and j, if any, is S i =S j ?

  6. 6.

    In each case, are the sets S and T disjoint? If not, what is their intersection?

    1. (i)

      S is the set of perfect squares 1,4,9,…; T is the set of cubes 1,8,27,… of positive integers.

    2. (ii)

      S is the set of perfect squares; T=ℝ\ℝ+.

    3. (iii)

      S is the set of perfect squares 1,4,9,…; T is the set Π of primes.

  7. 7.

    In each case, are the sets S and T disjoint? If not, what is their intersection?

    1. (i)

      S is the set of all multiples of 5; T is the set of all perfect squares.

    2. (ii)

      S is the set of all students in your class; T is the set of all students in your college.

  8. 8.

    Prove the commutative and associative laws for ∪.

  9. 9.

    Prove the commutative and associative laws for ∩.

In Exercises 10 to 20, U is a universal set and S and T are any sets. Prove the given result.

  1. 10.

    S∪∅=S.

  2. 11.

    SU=U.

  3. 12.

    SS=S.

  4. 13.

    \(S \cup\overline{S} = U\).

  5. 14.

    SU=S.

  6. 15.

    S∩∅=∅.

  7. 16.

    SS=S.

  8. 17.

    \(S \cap\overline{S} = \emptyset\).

  9. 18.

    (ST)⊆S.

  10. 19.

    S⊆(ST).

  11. 20.

    If ST=U and ST=∅, then \(T= \overline{S}\).

  12. 21.

    Prove the distributive law in (2.4).

  13. 22.

    Prove de Morgan’s laws.

  14. 23.

    Suppose the sets A, B, C, D, S are defined in terms of ∅ as follows.

    Show that:

    1. (i)

      {xxS and xD}=S;

    2. (ii)

      {xxS and xD}=D.

In Exercises 24 to 30, R, S and T are any sets, and U is the universal set.

  1. 24.

    Prove: if RS and RT, then R⊆(ST).

  2. 25.

    Prove: if RT and ST, then (RS)⊆T.

  3. 26.

    Prove: if RS, then RTST and RTST.

  4. 27.

    Show that RS if and only if \(R \cap\overline{S}=\emptyset\).

  5. 28.

    Show that if ST=∅, then S=T=∅ and that if ST=U, then S=T=U.

  6. 29.

    Prove that R\(S\T) contains all members of RT, and hence prove that

    $$(R \backslash S) \backslash T = R \backslash(S \backslash T)$$

    is not a general law (in other words, relative difference is not associative).

  7. 30.

    Show that the following three statements are equivalent: ST,ST=T, ST=S.

In Exercises 31 to 42, the sets A,B,C,D are defined as follows: A={∅}, B={A}, C={∅,A}, D={B}. Determine whether the given statement is true or false.

  1. 31.

    ∅⊆A.

  2. 32.

    ∅∈A.

  3. 33.

    ∅∈B.

  4. 34.

    ∅⊆B.

  5. 35.

    AB.

  6. 36.

    AB.

  7. 37.

    AC.

  8. 38.

    AC.

  9. 39.

    BC.

  10. 40.

    BC.

  11. 41.

    BD.

  12. 42.

    BD.

2.3 Proof Methods in Set Theory

2.3.1 Method of Truth Tables

Set-theoretic propositions can often be proved using truth tables. The reasoning is as follows. To prove that sets S and T are equal, it suffices to show that, for any element x of the universal set, the statement “xSsT” is a tautology. This can be proved (or disproved) using a truth table.

To illustrate this, consider the distributive law

$${DL1}R \cup(S \cap T) = (R \cup S) \cap(R \cup T).$$
(2.2)

The truth table might look like the following

R

S

T

ST

RS

RT

R∪(ST)

(RS)∩(RT)

T

T

T

T

T

T

T

T

T

T

F

F

T

T

T

T

T

F

T

F

T

T

T

T

T

F

F

F

T

T

T

T

F

T

T

T

T

T

T

T

F

T

F

F

T

F

F

F

F

F

T

F

F

T

F

F

F

F

F

F

F

F

F

F

In writing the table, it is implicitly assumed that a general element x is being considered; the notation T (or F) under the name of a set means that the statement that x is a member of that set is true (or false). For example, the third line of the table could be interpreted as saying, “in all cases where xR is true, xS is false, and xT is true, it is always false that xST, true that xRS, true that xRT, true that xR∪(ST) and true that x∈(RS)∩(RT).”

The statement (2.2) is a tautology provided the last two columns are equal, which is seen to be true.

Compare this proof with the proof given in Sample Problem 2.2.2.10.

In order to apply the truth table method, it is necessary to know the truth tables of the main binary operations. The truth tables for complement, union, intersection and relative complement are shown in Table 2.4.

Table 2.4 Truth tables for RS, RS and (R\S)

The method of truth tables can also be used to prove that one set is a subset of another. If you need to prove that RS, then the last two columns will be labeled R and S, and it is required that no row has T in the R column and F in the S column.

Sample Problem 2.12

Prove that \(A \cap C \subseteq(\,\overline{A}\cap B) \cup C\).

Solution

The truth value of \(x \in\overline{A}\) is opposite that of xA, so the table is as follows.

A

B

C

\(\overline{A}\)

\(\overline{A} \cap B\)

AC

\((\overline{A}\cap B) \cup C\)

T

T

T

F

F

T

T

T

T

F

F

F

F

T

T

F

T

F

F

T

T

T

F

F

F

F

F

T

F

T

T

T

T

F

T

F

T

F

T

T

F

T

F

F

T

T

F

F

T

F

F

F

T

F

F

F

There is no line with T in the second-last column and F in the last, so inclusion is proved.

Practice Exercise

Prove that ABCB∩(AC).

2.3.2 Venn Diagrams

It is common, and useful, to illustrate sets and operations on sets by diagrams. A set A is represented by a circle, and it is assumed that the elements of A correspond to the points (or some of the points) inside the circle. The universal set is usually shown as a rectangle enclosing all the other sets; if it is not needed, the universal set is often omitted. Such an illustration is called a Venn diagram.

Here are Venn diagrams representing AB, AB, \(\overline {A}\) and A\B; in each case, the set represented is shown by the shaded area. The universal set is shown in each case.

Two sets are equal if and only if they have the same Venn diagram. In order to illustrate this, we again consider the distributive law

$${DL1}R \cup(S \cap T) = (R \cup S) \cap(R \cup T).$$
(2.2)

The Venn diagram for R∪(ST) is constructed in the upper half of Figure 2.1, and that for (RS)∩(RT) is constructed in the lower half. The two are obviously identical.

Fig. 2.1
figure 1

R∪(ST)=(RS)∩(RT)

In the first part of this section, we applied the method of truth tables (developed for use with propositions) to set identities. We can also apply the methods of set theory to the analysis of propositions. If s is any proposition, we define S to be the set of all sets of circumstances in which proposition s is true; similarly we make proposition t correspond to set T. Then st is equivalent to S=T, and the Venn diagram that shows the set equality also indicates the proposition equivalence.

For example, the preceding Venn diagram illustration that

$$R \cup(S \cap T) = (R \cup S) \cap(R \cup T)$$

for all sets R,S and T may also be used to construct a proof of the distributive law for propositions,

$$r \vee(s \wedge t) \leftrightarrow(r \vee s) \wedge(r \vee t).$$

Sample Problem 2.13

Write down a statement involving propositions that can be proven by establishing the set-theoretic identity

$$(R \backslash S) \backslash T = R \backslash(S \backslash T).$$

Solution

We let r correspond to set R, and so on. As R\S corresponds to the proposition r∧∼s, the answer is

$$\bigl((r \wedge{\sim} s) \wedge{\sim} t\bigr) \leftrightarrow\bigl(r\wedge{\sim}(s\wedge{\sim} t)\bigr).$$

To prove AB, it is sufficient to show that the diagram for A contains no shaded area that is not shaded in B. We illustrate this idea with the problems from Sample Problem 2.12 and its associated Practice Exercise (but in reverse order).

Sample Problem 2.14

Use Venn diagrams to illustrate that

$$A \cap B \cap C \subseteq B \cap(A \cup C).$$

Solution

Practice Exercise

Use Venn diagrams to illustrate that

$$A \cap C \subseteq(\,\overline{A} \cap B) \cup C.$$

In many cases, you may not be sure whether or not two expressions represent the same set. Often the best response is to construct the corresponding Venn diagrams. If the diagrams are different, this disproves the equality; if they are the same, the identity will be provable.

As before, this type of set-theoretic proof can be applied to propositions. A proof that RS serves as a proof that rs. Sample Problem 2.14 can be interpreted as a proof that

$$a \wedge b \wedge c \to b \wedge(a \vee c)$$

is true for any propositions a,b and c.

2.3.3 Syllogisms and Venn Diagrams

Sometimes we draw a Venn diagram in order to represent some properties of sets. For example, if A and B are disjoint sets, the diagram can be drawn with A and B shown as disjoint circles. If AB, the circle for A is entirely inside the circle for B.

In the classical study of logic, an argument is given in the form of a syllogism, a set of statements (the premises, or data) and a conclusion drawn from them. For example, consider the argument

All big cities are near water; Alamagordo, NM is not near water; therefore Alamagordo is not a big city.

 To examine this, suppose B is the set of all big cities, W is the set of all cities near water, and a represents Alamagordo. Since the premises tell us that BW, we can draw the sets as shown. As aW, it must lie somewhere in the outside region, so it is certainly not in B. Therefore the argument is valid.

Some arguments that look logical at first sight turn out not to be valid. For example,

All big cities are near water; Carbondale, IL is near water; therefore Carbondale is a big city.

 We label the sets as before. In the diagram shown, Carbondale could be represented either by x or by y, so you can’t draw any conclusion. The argument is not valid. (In fact, x is nearer the mark.)

Sample Problem 2.15

Examine the argument: no students in this class are lazy; John is a math major; all math majors are lazy; so John is not a student in this class.

Solution

Write L,C and M for the sets of lazy students, students in this class and math majors. The premises are represented in the following diagram.

John is a member of M, which is disjoint from C. So John is not in this class, and the conclusion is valid.

Practice Exercise

Examine the argument: some students in this class are lazy; all males are lazy; so some students in this class are males.

Observe from the above example that the validity of an argument does not depend on the truth of the premises or conclusion. Not all math majors are lazy, and I wouldn’t venture to guess how many students in your class are lazy! Another example, where the premises and conclusion are all false but the argument is valid, appears in Exercise 2.3.26.

Exercises 2.3

In Exercises 1 to 8, represent the set in a Venn diagram.

  1. 1.

    RST.

  2. 2.

    \(\overline{R \cup S \cup T}\).

  3. 3.

    \(R \cup(S \cap\overline{T})\).

  4. 4.

    (RS)∩T.

  5. 5.

    (R\S)∩T.

  6. 6.

    R∩(S\T).

  7. 7.

    (RS)\(ST).

  8. 8.

    (RT)\(ST).

  9. 9.

    Prove: \(R = (\,\overline{\overline{R} \cup S}) \cup(R \cap S)\).

  10. 10.

    Find a simpler expression for \(S \cup(\,\overline{(\overline{R}\cup S) \cap R})\).

In Exercises 11 to 15, prove the rule using truth tables and illustrate it using Venn diagrams.

  1. 11.

    \(S \cap\overline{S} = \emptyset\).

  2. 12.

    \(\overline{S \cup T} = \overline{S} \cap\overline{T}\).

  3. 13.

    \(\overline{S \cap T} = \overline{S} \cup\overline{T}\).

  4. 14.

    (ST)⊆S.

  5. 15.

    S⊆(ST).

  6. 16.

    Use truth tables to represent the commutative and associative laws for ∪.

  7. 17.

    Use Venn diagrams to represent the commutative and associative laws for ∩.

  8. 18.

    For any sets R and S, prove R∩(RS)=R.

  9. 19.

    Prove, using Venn diagrams, that (R\S)\T=R\(S\T) does not hold for all choices of sets R,S and T.

  10. 20.
    1. 1)

      Prove, without using truth tables or Venn diagrams, that union is not distributive over relative difference: in other words, prove that the following statement is not always true:

      $$(R \backslash S) \cup T = (R \cup T) \backslash(S \cup T).$$

      (Hint: use the fact (R\S)∪S=RS.)

    2. 2)

      Now prove this using Venn diagrams.

  11. 21.

    Draw Venn diagrams for use in the following circumstances:

    1. (i)

      All my goldfish are tropical fish.

    2. (ii)

      None of my goldfish are tropical fish.

In Exercises 22 to 25, test the validity of the argument by drawing the appropriate Venn diagram.

  1. 22.

    All men are mortal; Socrates is a man. Therefore Socrates is mortal.

  2. 23.

    All my friends are students; none of my neighbors are students; Ruth is my friend. Therefore Ruth is not my neighbor.

  3. 24.

    Boston is a big city; all big cities have department stores; Shirley lives in a city with no department store. Therefore Shirley does not live in Boston.

  4. 25.

    All businessmen are wealthy; all mathematicians are cheerful; David is a businessman; no cheerful people are wealthy. Therefore David is not a mathematician.

  5. 26.

    Show that the following argument is valid, although its premises and conclusion are all false: All expensive food contains cholesterol; steak contains no cholesterol. Therefore steak is not expensive.

  6. 27.

    Show that the following argument is not valid, although its premises and conclusion are all true: Some animals walk on two legs; human beings are animals; therefore human beings walk on two legs.

  7. 28.

    Consider the data: All authors are solitary people; all physicians are rich; no solitary people are rich. Which of the following conclusions can be drawn?

    1. (i)

      No authors are rich.

    2. (ii)

      All physicians are solitary.

    3. (iii)

      No one can be both an author and a physician.

  8. 29.

    Consider the data: I sold back all my expensive textbooks last year; all my science textbooks are green; I did not sell back any green books last year. Which of the following conclusions can be drawn?

    1. (i)

      None of my science textbooks are expensive.

    2. (ii)

      All of my science textbooks were sold back last year.

    3. (iii)

      Some of my science textbooks were sold back last year.

    4. (iv)

      None of my science textbooks were sold back last year.

    5. (v)

      No green textbooks were sold back last year.

  9. 30.

    Consider the data: All topcoats are expensive; none of my clothes are expensive; all expensive clothes are well made. Which of the following conclusions can be drawn?

    1. (i)

      I do not own a topcoat.

    2. (ii)

      All topcoats are well made.

    3. (iii)

      None of my clothes are well made.

2.4 Some Further Set Operations

2.4.1 Symmetric Difference

Another important set operation is symmetric difference. The symmetric difference of A and B is the set

$$A + B = \{x : x \in A \mbox{ or } x \in B \mbox{ but } x \not\in A\cap B\}. $$
(2.9)

Sample Problem 2.16

What is the truth table for A+B?

Solution

$$\begin{array}{l@{\quad}l@{\qquad}l}\hline A & B & A + B \\\hline T & T & F \\T & F & T \\F & T & T \\F & F & F \\\hline \end{array}$$

Practice Exercise

What is the Venn diagram for A+B?

This definition could be stated as

(2.10)

using (2.7). By the symmetry of the relation in (2.10), it follows that

$$\overline{A} + \overline{B} = A + B.$$

From the definition, we may consider A+B to be the union of the difference between A and B with the difference between B and A. This implies that

$$A + B = (A \backslash B) \cup(B \backslash A),$$

and hence that

$$A + B = (A\cap\overline{B}\,) \cup(A\cap\overline{B}\,). $$
(2.11)

If a and b denote the propositions “xA” and “xB” respectively, then the proposition “xA+B” is denoted by ab. (For the definition of , see Exercise 2.1.29) Then

$$a \,\underline{\vee}\, b \Leftrightarrow\bigl((a \vee b) \vee{\sim}(a \wedge b)\bigr)\Leftrightarrow\bigl((a \vee b) \wedge({\sim} a\vee{\sim} b)\bigr) $$
(2.12)

is a restatement of (2.10), and similarly we see that

$$( a \,\underline{\vee}\, b) \Leftrightarrow({\sim} a \,\underline{\vee}\,{\sim} b)$$

while (2.11) yields

$$(a\, \underline{\vee}\, b) \Leftrightarrow(a \wedge{\sim} b) \vee({\sim} a \wedge b). $$
(2.13)

It is easy to see that symmetric difference satisfies the commutative law

$$A + B = B + A. $$
(2.14)

The associative law is also true, but it is harder to prove, so we state it as a theorem.

Theorem 7

Symmetric difference satisfies the associative law

$$A + (B + C) = (A + B) + C.$$

Proof

We start from (2.10),

$$A + B = (A \cup B) \cap(\,\overline{A} \cup\overline{B}\,).$$

Then

(2.15)

From (2.11),

In exactly the same way we may prove that

Since union and intersection are commutative and associative operations, the right-hand sides of the last two equations are equal, so

$$(B + C) + A = (A + B) + C;$$

on applying the commutative law in (2.14) to the left-hand side, we obtain

$$A + (B + C) = (A + B) + C.$$

 □

In view of Theorem 7, we can write A+B+C instead of (A+B)+C. In the expression

$$\{A\cap\overline{B} \cap\overline{C} \} \cup\{\overline{A} \cap B\cap\overline{C} \} \cup \{\overline{A} \cap\overline{B} \cap C \} \cup\{A \cap B \cap C\}$$

the first three terms are the sets of all elements belonging to exactly one of A,B and C, while the fourth term is the intersection of all three. So A+B+C consists of all those elements which belong to an odd number of the sets A,B and C; see Figure 2.2, where A+B+C is represented by the shaded area.

Fig. 2.2
figure 2

Associativity of symmetric difference

The proof of Theorem 7 using truth tables or Venn diagrams is left as an exercise.

2.4.2 Cartesian Product

We define the Cartesian product (or cross product) S×T of sets S and T to be the set of all ordered pairs (s,t) where sS and tT:

$$S \times T = \bigl\{(s, t) : s \in S, t \in T \bigr\}.$$

There is no requirement that S and T be disjoint; in fact, it is often useful to consider S×S.

The number of elements of S×T is |S|×|T|. (This is one reason why the symbol × was chosen for cartesian product.)

Sample Problem 2.17

Suppose S={0,1} and T={1,2}. What is S×T?

Solution

S×T={(0,1),(0,2),(1,1),(1,2)}, the set of all four of the possible ordered pairs.

Practice Exercise

What is S×T if S={1,2} and T={1,4,5}?

The sets (R×ST and R×(S×T) are not equal; one consists of an ordered pair whose first element is itself an ordered pair, and the other of pairs in which the second is an ordered pair. So there is no associative law, and no natural meaning for R×S×T. On the other hand, it is sometimes natural to talk about ordered triples of elements, so we define

$$R \times S \times T = \bigl\{(r, s, t) : r \in R, s \in S, t \in T\bigr\}.$$

This notation can be extended to ordered sets of any length.

There are several distributive laws involving the cartesian product:

Theorem 8

If R,S and T are any sets, then

  1. (i)

    R×(ST)=(R×S)∪(R×T).

  2. (ii)

    R×(ST)=(R×S)∩(R×T).

Proof

(i) We prove that every element of R×(ST) is a member of (R×S)∪(R×T), and conversely.

First observe that

On the other hand,

where the last equality follows from the distributive law for propositions, applied to the propositions rR, sS and sT.

It is now clear that (r,s)∈R×(ST) and (r,s)∈(R×S)∪(R×T) are equivalent.

The proof of part (ii) is left as an exercise.  □

Exercises 2.4

  1. 1.

    Prove Theorem 7

    1. (i)

      Using truth tables;

    2. (ii)

      Using Venn diagrams.

  2. 2.

    Prove the two distributive laws

    1. (i)

      Using truth tables.

    2. (ii)

      Using Venn diagrams.

  3. 3.

    Show that union is not distributive over symmetric difference. (Hint: consider the set S∪(S+T).)

  4. 4.

    Show that S+T=∅ if and only if S=T.

In Exercises 5 to 14, decide whether the given statement is true or false. Prove each of the statements that you think is true: give a counterexample for each statement that you think is false.

  1. 5.

    R+(ST)=(R+S)∩(R+T).

  2. 6.

    R+(S\T)=(R+S) (R+T).

  3. 7.

    R\(ST)=(R\S)∪(R\T).

  4. 8.

    R∩(S+T)=(RS)+(RT).

  5. 9.

    R∪(S\T)=(RS)\(RT).

  6. 10.

    R+(ST)=(R+S)∪(R+T).

  7. 11.

    R\(ST)=(R\S)∩(R\T).

  8. 12.

    R\(S+T)=(R\S)+(R\T).

  9. 13.

    R∩(S\T)=(RS)\(RT).

  10. 14.

    R∪(S+T)=(RS)+(RT).

  11. 15.

    In each case, list all elements of S×T.

    1. (i)

      S={1,2,3}; T={1,4,5}.

    2. (ii)

      S={xx 2=1}; T={yy 2=4}.

    3. (iii)

      S={1,3,5,7}; T={1,2,3}.

  12. 16.

    In each case, list all elements of R×S×T.

    1. (i)

      R={1,2}; S={3,4}; T={5,6}.

    2. (ii)

      R={12,13,14}; S={1}; T={1,2,3}.

  13. 17.
    1. (i)

      If S=∅,T≠∅, what is S×T?

    2. (ii)

      If S×T=T×S, what can you say about S and T?

  14. 18.

    Prove the distributive law R×(ST)=(R×S)∩(R×T);

  15. 19.
    1. (i)

      If AS,BT, show that A×BS×T.

    2. (ii)

      Find an example of sets A,B,S,T, such that A×BS×T and BT, but \(A \not\subseteq S\).

2.5 Mathematical Induction

2.5.1 The Principle of Mathematical Induction

In working with finite sets or with the sets of positive integers and of integers, one repeatedly uses a technique of proof known as the method of mathematical induction. The general idea is as follows: suppose we want to prove that every positive integer n has a property P(n). We first prove P(1) to be true. Then we prove that, for any n, the truth of P(n) implies that of P(n+1); in symbols:

$$P(n) \mbox{ true} \quad\Rightarrow\quad P(n+1) \mbox{ true}. $$
(2.16)

Intuitively, we would like to say:

$$\begin{array}{llll}& P(1) \mbox{ true,} & & \\& P(1) \mbox{ true} & \quad\! \Rightarrow\quad\!& P(2) \quad\mbox {true,\quad by (2.16),} \\\therefore& P(2) \mbox{ true;} & & \\& P(2) \mbox{ true} & & \\& P(2) \mbox{ true} & \quad\!\Rightarrow\quad\!& P(3) \quad\mbox {true,\quad by (2.16),} \\\therefore& P(3) \mbox{ true;} & & \\\end{array}$$

and so on. There is a difficulty, however: given any positive integer k, we can select an integer n such that the proof of P(n) requires at least k steps, so the proof can be arbitrarily long. As “unbounded” proofs present logical difficulties in mathematics—who could ever finish writing one down?—we need an axiom or theorem that states that induction is a valid procedure. This is the principle of mathematical induction, and may be stated as follows.

Principle of mathematical induction Suppose the proposition P(n) satisfies

  1. (i)

    P(1) is true; and

  2. (ii)

    for every positive integer n, whenever P(n) is true, then P(n+1) is true.

Then P(n) is true for all positive integers n.

This principle is sometimes called weak induction. Another form is as follows.

Strong induction Suppose the proposition P(n) satisfies

  1. (i)

    P(1) is true; and

  2. (ii)

    for every positive integer n, if P(k) is true whenever 1≤k<n, then P(n) is true.

Then P(n) is true for all positive integers n.

At first sight, the second statement looks as though we have assumed more than in the first statement. However these two forms are equivalent; a detailed proof can be found in more advanced books.

In the above formulations, the case n=1—the case of P(1)—is called the base case. There is in fact nothing special about 1; any integer could be used to define the base case. For example, weak induction could be stated as

Suppose the proposition P(n) satisfies

  1. (i)

    P(t) is true for some specified integer t; and

  2. (ii)

    for every positive integer nt, whenever P(n) is true, then P(n+1) is true.

Then P(n) is true for all integers nt.

Induction can also be stated in strictly set-theoretic form. Suppose S is the set of integers n such that P(n) is true. Then the principle of mathematical induction (weak induction form) is:

Let S be a subset of+ such that

  1. (i)

    1∈S; and

  2. (ii)

    whenever nS, then n+1∈S.

Then S=ℤ+ .

One could equally well state the principle in terms of non-negative integers, instead of positive integers, by changing the case P(0) to P(1), and converting references from “positive integers” to “non-negative integers.” It can in fact be stated in terms of any starting point: if S is a set of integers for which

(i) tS,

where t is any integer, and

(ii) for every integer nt, if nS, then n+1∈S,

then the principle can be used to prove that S contains all integers equal to or greater than t. This form is sometimes called “induction from t.”

2.5.2 The Well-Ordering Principle

Another principle that is very useful in proving results about sets of positive integers is:

The well-ordering principle Suppose S is any non-empty set of positive integers. Then S has a smallest member.

Any set with the property that every non-empty subset has a least member is called being well-ordered; so the principle says “the positive integers are well-ordered.” Many number-sets, such as the real numbers, are not well-ordered.

At first the result seems obvious. If S is not empty, then it must contain some member, x say. In order to find the smallest member of S, one need only check to see whether or not x−1, x−2,…,1 are members of S, and this requires only a finite number of steps. However, this “proof” contains the same problem as the “proof” of the principle of mathematical induction: the starting value, x, can be arbitrarily large.

In fact, the induction principle can be proved from the well-ordering principle. To see this, let us assume the well-ordering principle is true and suppose P is any proposition about positive integers such that P(1) is true, and for every positive integer n, whenever P(n) is true, then P(n+1) is true. (These are the requirements for induction.) Write S for the set of positive integers n such that P(n) is not true. In order to prove that induction works, we need to show that S is empty.

If S is not empty, then by well-ordering S has a smallest member, x say. So P(x) is false. We know that P(1) is true, so x≠1. But x is a positive integer. So x−1 is a positive integer, and P(x) must be true—otherwise x−1 would be a member of S, and smaller than x. But this means P((x−1)+1) is true: that is, P(x) is both true and false! This can’t happen, so our original assumption, that S is not empty, must have been wrong. So induction is proved.

We can also work the other way. If you assume induction is true, you can show that the positive integers are well-ordered.

However, there is no absolute proof here. It is necessary to assume that either induction or well-ordering is a property of the positive integers. So we assume these as axioms about numbers.

2.5.3 Some Applications

We start by looking at some properties of sets and prove them by induction.

Theorem 9

Let A be a set with |A|=n. Then \(|\mathcal{P} (A)| = 2^{n}\).

Proof

To apply induction, we can rephrase the statement as: Let P(n) be the statement “ \(|\mathcal{P} (A)|= 2^{n}\) for any n-element set A;” then P(n) is true for all positive integers n. Since the elements of A do not matter, we may as well assume A={a−1,a 2,…,a n }.

First we consider the case n=1, so A={a 1}. Then \(\mathcal{P}(A) = \{\emptyset,A\}\), so \(|\mathcal{P} (A)| = 2^{1}\) and in this case the theorem is true. Now suppose the result has been proved for n=k−1 and assume n=k; we might as well say A=A′∪{a k } where A′={a−1,a 2,…,a k−1}. By the induction hypothesis \(|\mathcal{P}(A^{\prime})| = 2^{k-1}\). Any subset of A is either a subset of A′ or a subset of A′ with the element s k adjoined to it, so to each subset of A′ there correspond two subsets of A. Hence \(|\mathcal{P} (A)| = 2^{k-1} \cdot2\) and the theorem is proved.  □

We consider next the cardinality of a cartesian product of two finite sets.

Theorem 10

If |S|=m and |T|=n, then |S×T|=mn.

Proof

We proceed by induction on m. If m=1, then S={s 1} and an ordered pair with s 1 as its first element may be constructed in n ways, giving (s 1,t 1),(s 1,t 2),…, (s 1,t n ), so the theorem is true for m=1. Now suppose the statement is true for m=k−1, and consider the case m=k.

Let S′={s 1,s 2,…,s k−1}, so |S′×T|=(k−1)n. Also, |{s k T|=n. But S×T=(S′×T)∪({s k T) and since the two products on the right-hand side of this equation are disjoint, we know that |S×T|=(k−1)n+n, proving the theorem.  □

Mathematical induction is very often used in proving general algebraic formulas.

Sample Problem 2.18

Prove by induction that the sum of the first n positive integers is

$$1 + 2 + \cdots+ n = \frac{1}{2}n (n+1).$$

Solution

The case n=1 is \(\frac{1}{2}\cdot1 (1+1) = 1\), which is obviously true, so the formula gives the correct answer when n=1. Suppose it is true when n=k−1; therefore

$$1 +2 + \cdots+ (k-1) = \frac{1}{2}(k-1)k.$$

Then

and the formula is proved correct when n=k. So, by induction, we have the required result.

Practice Exercise

Prove that the sum of the first n odd positive integers is

$$1 + 3 + \cdots+ (2n-1) = n^2.$$

The following example looks geometrical, but it also yields to induction.

Sample Problem 2.19

Suppose n straight lines are drawn in two-dimensional space, in such a way that no three lines have a common point and no two lines are parallel. Prove that the lines divide the plane into \(\frac{1}{2}(n^{2}+n+2)\) regions.

Solution

It will probably help if we first look at a small example. The left-hand diagram in Figure 2.3 shows the plane divided into seven regions A,B,…,G by three lines. When a fourth line is introduced, it passes through four regions: it starts in D, which it divides into two regions B 1 and B 2; it then crosses a line into B, which it divides into two; then it crosses into C, and E. Each time it crosses a line, it divided a region into two.

Fig. 2.3
figure 3

How lines divide the plane

Now for the formal induction. If n=1, the formula yields \(\frac{1}{2}(1+1+2) = 2\), and one line does indeed partition the plane into two regions. Now assume that the formula works for n=k−1. Consider k−1 lines drawn in the plane. From the induction hypothesis, the plane is divided into \(\frac{1}{2}((k-1)^{2} + (k-1) + 2) = \frac{1}{2}(k^{2}-k+2)\) regions.

Now insert a kth line. It must cross every other line exactly once, so it crosses (k−1) lines, and lies in k regions (the one in which it started, and another after it crosses each line). It divides each of these regions into two parts, so the k regions are replaced by 2k new regions; the total is

and the result is true by induction.

Here is an example that uses induction from the starting point 4, rather than from 0 or 1.

Sample Problem 2.20

Prove that n!≥2n whenever n≥4.

Solution

Suppose the proposition P(n) means n!≥2n. Then P(4) means 4!≥24, or 24≥16, which is true. Now suppose k is an integer greater than or equal to 4, and P(k) is true: k!≥2k. Multiplying by k+1, we have (k+1)1≥(2k(k+1)≥2k2=2k+1, so P(k) implies P(k+1), and the result follows by induction.

Practice Exercise

Prove that n 2≥2n+1 whenever n≥3.

Sample Problem 2.21

Prove by induction that 5n−2n is divisible by 3 whenever n is a positive integer.

Solution

Suppose P(n) means 3 divides 5n−2n. Then P(1) is true because 51−21=3. Now suppose k is any positive integer, and P(k) is true: say 5k−2k=3x, where x is an integer. Then 5k+1−2k+1= 5⋅5k−2⋅2k= 3⋅5k+2⋅5k−2⋅2k= 3⋅5k+2⋅3x, which is divisible by 3. So the result follows by induction.

Practice Exercise

Prove that 32n−2n is divisible by 7 whenever n is a positive integer.

The Fibonacci numbers f 1,f 2,f 3,… are defined as follows. f 1=f 2=1, and if n is any integer greater than 2, f n =f n−1+f n−2. This famous sequence is the solution to a problem posed by Leonardo of Pisa, or Leonardo Fibonacci (Fibonacci means son of Bonacci) in 1202:

A newly born pair of rabbits of opposite sexes is placed in an enclosure at the beginning of the year. Beginning with the second month, the female gives birth to a pair of rabbits of opposite sexes each month. Each new pair also gives birth to a pair of rabbits of opposite sexes each month, beginning with their second month.

The number of pairs of rabbits in the enclosure at the beginning of month n is f n .

Some interesting properties of the Fibonacci numbers involve the idea of congruence modulo a positive integer. We say a is congruent to b modulo n, written “\(a \equiv b\ (\hspace*{-1pt} \mathrm{mod}\,\, n)\),” if and only if a and b leave the same remainder on division by n. In other words n is a divisor of ab, or in symbols n∣(ab). As an example, both 15 and 39 leave remainder 3 on division by 12, so \(15 \equiv39\ (\hspace*{-1pt} \mathrm{mod}\,\, 12)\); and 39−15=24=2×12, so 12 is a divisor of 39−15. This idea will be explored further in Sample Problem 4.6 and in Section 9.2.

Sample Problem 2.22

Prove by induction that the Fibonacci number f n is even if and only if n is divisible by 3.

Solution

Assume n is at least 4. f n =f n−1+f n−2=(f n−2+f n−3)+f n−2=f n−3+2f n−2, so \(f_{n} \equiv f_{n-3}\ (\hspace*{-1pt} \mathrm{mod}\,\, 2)\).

We first prove that, for k>0,f 3k is even. Call this proposition P(k). Then P(1) is true because f 3=3. Now suppose k is any positive integer, and P(k) is true: \(f_{3k}\equiv0\ (\hspace*{-1pt} \mathrm{mod}\,\, 2)\). Then (putting n=3k+3) \(f_{3(k+1)} \equiv f_{3k}\ (\hspace*{-1pt} \mathrm{mod}\,\, 2)\equiv0\ (\hspace*{-1pt} \mathrm{mod}\,\, 2)\) by the induction hypothesis. So P(k+1) is true; the result follows by induction. To prove that, for k>0,f 3k−1 is odd—call this proposition Q(k)—we note that Q(1) is true because f 1=1 is odd, and if Q(k) is true, then f 3k−1 is odd, and \(f{3(k+1)-1} \equiv f_{3k-2}\ (\hspace*{-1pt} \mathrm{mod}\,\, 2) \equiv1\ (\hspace*{-1pt} \mathrm{mod}\,\, 2)\). We have Q(k+1) and again the result follows by induction. The proof for \(k \equiv1\ (\hspace*{-1pt} \mathrm{mod}\,\, 3)\) is similar.

Practice Exercise

Prove by induction that the f n is divisible by 3 if and only if n is divisible by 4.

Some further properties of Fibonacci numbers appear among the Exercises.

Exercises 2.5

In Exercises 1 to 6, prove the given proposition by induction.

  1. 1.

    \(\sum_{r=1}^{n} r^{2} = \frac{1}{6}n(n+1)(2n+1)\).

  2. 2.

    \(\sum_{k=1}^{n} k^{3} = \left[ \sum_{k=1}^{n} k \right]^{2}= \frac{1}{4}n^{2}(n+1)^{2}\).

  3. 3.

    \(1+4+7+ \cdots+ (3n-2) = \frac{1}{2}n(3n-1)\).

  4. 4.

    \(2 + 6 + 12 + \cdots+ n(n+1) = \sum_{k=1}^{n} k(k+1)= \frac{1}{3}n(n+1)(n+2)\).

  5. 5.

    \({\frac{1}{1 \cdot3} + \frac{1}{3 \cdot5} + \frac {1}{5 \cdot7} + \cdots+\frac{1}{(2n-1)(2n+1)} = \frac{n}{2n+1}.}\)

  6. 6.

    \(1 + 3 + 3^{2} + \cdots+ 3^{n} = \frac{1}{2}(3^{n+1} - 1)\).

  7. 7.

    Write down the first twelve Fibonacci numbers.

In Exercises 8 to 11, prove the given result about the Fibonacci numbers, for all positive integers n.

  1. 8.

    f n is divisible by 4 if and only if n is divisible by 6.

  2. 9.

    f 1+f 2+⋯+f n =f n+2−1.

  3. 10.

    f 1+f 3+⋯+f 2n−1=f 2n .

  4. 11.

    \(f_{n}^{2} + f_{n+1}^{2} = f_{2n+1}\).

  5. 12.

    The numbers a 0,a 1,a 2,… are defined by \(a_{0} =\frac{1}{4}\) and a n+1=2a n (1−a n ) when n>0. Prove that

    $$a_n = \frac{1}{2} \biggl(1 - \frac{1}{2^{2^n}}\biggr) .$$
  6. 13.

    The numbers a 0,a 1,a 2,… are defined by a 0=3 and

    $$a_{n+1} = 2a_n -a_n^2 \quad\mbox{when } n > 0.$$

    Prove that \(a_{n} = 1 - 2^{2^{n}} \) when n>0, although this formula does not apply when n=0.

  7. 14.

    Show by induction that 2nn 2 for n≥4.

In Exercises 15 to 18, prove the divisibility result for all positive integers n.

  1. 15.

    2 divides 3n−1.

  2. 16.

    6 divides n 3n.

  3. 17.

    5 divides 22n−1+32n−1.

  4. 18.

    24 divides n 4−6n 3+23n 2−18n.

  5. 19.

    Prove that the sum of the cubes of any three consecutive integers is a multiple of 9.

  6. 20.

    The numbers x 1,x 2,… are defined as follows. x 1=1, x 2=1, and if n≥2 then x n+1=x n +2x n−1. Prove that x n is divisible by 3 if and only if n is divisible by 3.

  7. 21.

    Prove by induction: if n people stand in line at a counter, and if the person at the front is a woman and the person at the back is a man, then somewhere in the line there is a man standing directly behind a woman.

  8. 22.

    Assume that the sum of the angles of a triangle is π radians. Prove by induction that the sum of the angles of a convex polygon with n sides is (n−2)π radians when n≥3.

  9. 23.

    Consider the set of real numbers: {x:x 2<1}. Show that this set has no least member. Use this to prove that the real numbers are not well-ordered.

  10. 24.

    Let ℝ0 be the set of non-negative real numbers, {x:x∈ℝ,x≥0}. Is ℝ0 well-ordered?

  11. 25.

    Assuming the principle of mathematical induction, show that the positive integers are well-ordered.

  12. 26.

    Find the errors in the following “proofs”:

    1. 1)

      Theorem.All computer programs contain the same number of bugs.

      Proof. If we show that in any set of n programs, all the programs contain the same number of bugs, then we have proved the theorem. We proceed by induction on n.

      First, let n=1. Certainly, in a set consisting of one program, all the programs contain the same number of bugs, so the statement is true for n=1.

      Now suppose that for every set containing fewer than n programs, all the programs in the set contain the same number of bugs, and consider a set D of n programs, D={p 1,p 2,…,p n }. Remove the first program and consider D 1={p 2,p 3,…,p n }, a set of n−1 programs. By the induction hypothesis, all the programs p 2,…,p n contain the same number of bugs. Now replace the first program and remove the last, forming D 2={p 1,p 2,…,p n−1}, another set of n−1 programs. By the induction hypothesis, all of p 1,…,p n−1 have the same number of bugs. Hence p 1 and p n each have the same number of bugs as the other programs in the set, so all the programs contain the same number of bugs. The theorem follows by induction.

    2. 2)

      Theorem.All computer programs contain the same number of bugs.

      Proof. Any program must have a non-negative number of bugs, so the possible numbers are {0,1,…,N} for some large (but finite) number N. Choose any two programs and compare the number of bugs, say r and s, contained in them. If max{r,s}=0, then r=s=0. Now suppose that if max{r,s}≤n−1, then r=s, and consider the case where max {r,s}=n. This implies that max{r−1,s−1}=n−1 and hence r−1=s−1 by the induction hypothesis. Hence r=s. Since any two programs have the same number of bugs, all programs must have the same number of bugs, and the theorem is proved.