Sie sind auf Seite 1von 61

Contents

Logic Strand
Section

Topic

Page

Introduction

Logic

Predicate Logic

19

Methods of Proof

23

Set Theory

32

Relations & Functions

45

Sample Examination Papers

Section 0.

Introduction

Discussion:
1. What do you know about Mathematics?

2. What Mathematics can you do? What ideas are important? What ideas do you understand?

There are two aspects to learning Mathematics:


1.

Intuitive
Understand the `ideas'; make sense of the concepts; `feel good' about the topic; have an idea of
what to do next.

2.

Formal
Prove why

the ideas make sense.

Lectures in Logic demonstrate the Intuitive side of Mathematics, while books help you with the Formal
side of Mathematics. Lecture notes sit somewhere in the middle, assisting in both areas.
Use everything to your advantage!

Section 1.

Logic

You are familiar with using numbers in arithmetic and symbols in algebra. You are also familiar with
the `rules' of arithmetic and algebra.
Examples.

(3 + 4) + 6 = 3 + (4 + 6)

3x

= 3 + 10

5x = (3

5)x

= 2x

= 13
In a similar way, Logic deals with statements or sentences by de ning symbols and establishing `rules'.
Roughly speaking, in arithmetic an

operation

is a rule for producing new numbers from a pair of given

numbers, like addition (+) or multiplication (). In logic, we form new statements by combining short
statements using connectives, like the words and, or.
Examples.

This room is hot and I am tired.

MATH122 lectures are fun or I am dreaming.

We will now turn our attention to more formal de nitions of the concepts in logic.

1.1 Statements
In this work, we will be interested in sentences that are either true or false, not both.

De nition 1.1.1. A

statement

or

proposition

is a declarative sentence, that is, a sentence that is

either true or false, not both.

Exercise:
Which of the following are statements?
(i) 2 + 3 = 5

(viii) Seven is?

(ii) It is raining outside.

(ix) For some real number x, x < 2.

(iii) 2 + 3 = 6

(x) x < 2

(iv) Is it raining?

(xi) 2 = =

(v) Go away!

(xii) x + y = y + x

(vi) There exists an even prime number.

(xiii) This sentence is false.

(vii) There are six people here.

Strictly speaking, as we don't know what x or y are in parts (x) and (xii), these should not be statements. In Mathematics, x and y usually represent real numbers and we will assume this is the case here.
Therefore, (x) is either true or false (even if we don't know which) and (xii) is always true, so we will
allow both.
Most of Mathematics is about whether statements are true or false. Consider the statement
\The area of a triangle is given by its base times its height."
Is the statement true or false?

TRUE:

Requires a proof.

FALSE:

Requires a demonstration.

A true statement that has been proved is frequently called a Theorem.


Example.

Is the following statement True or False?


For a real number x, if x2 = 1 then x = 1 or x = 1.
The statement is TRUE. Therefore, we must prove it:
Consider x2 = 1. Adding 1 to both sides gives x2
Factorising this equation, we have (x
Therefore, x
Case 1: x

1 = 0.

1)(x + 1) = 0.

1 = 0 or x + 1 = 0.
1 = 0. Add 1 to both sides and we have x = 1.

Case 2: x + 1 = 0. Add 1 to both sides and we have x = 1.

1.2 Logical Connectives and Compound Statements


We will let P; Q; R; : : : represent simple statements. This means that P; Q; R; : : : are each assigned exactly
one truth value, that is, either true or false.
We can form compound

sentences

or statement

forms

from P; Q; R; : : : using connectives.

There are ve connectives which are used to form `new' statements from `old' statements.
If P and Q are statements, then so are
In words

In symbols

not P

P

Formal Name

Negation of P

P or Q

_Q

Disjunction of P and Q

P and Q

^Q

Conjunction of P and Q

P implies Q
P if and only if Q

P =) Q
P

()

Conditional of P; Q
Biconditional of P; Q

We will shortly be looking at each connective in more detail and we will establish `rules' that govern their
use.
Recall that each statement must be either true or false. We will, therefore, assign to each statement a
truth value

of T for true or F for false.

The truth value of a compound statement depends only on the truth values of the simple statements and
the connectives that form it. We represent this dependence by means of truth

tables

Informally, you must know what each connective `means' and how it is `used' in Logic. Formally, a
connective is de ned by its own unique truth table. You will know all there is to know about a connective
when you `know' its truth table.
Important:

You must know the names, notation and truth tables for the ve logical connectives.

1.2.1 Negation:

P

The negation of a statement is simply the opposite of what it says.


Examples.

If P is:

It is raining outside.

then  P is:

(It is raining outside.)

or

It is not raining outside.

If Q is:
then  Q is:

x > 2 or x < 2

 (x > 2 or x < 2)
Can this be simpli ed?

Exercise:
For each statement P , write down  P .
(i) P : MATH122 is interesting.

 P:

(ii) P : x2

 P:

1=0

(iii) P : x > 0

 P:

(iv) P : x > 5 or x < 5.

 P:

Truth Table for Negation:

Let P be a statement.

P

T
F

Notes.

1. In some books 1 is used for T and 0 is used for F.


2. The truth table for  tells us that for any statement P , exactly one of P or  P is true. So, if we
want to prove P is true, we have two methods:
Direct:

Start with some facts and end up proving P in a direct step-by-step manner.

Indirect:

Don't prove P is true directly, but prove that  P is false.

This is how logic is used in `doing' Mathematics.


3. Generally, brackets are left out around ` P '. Thus,
and not  (P

 P _ Q means ( P ) _ Q

_ Q). This is similar to arithmetic where

Exercise:
For each statement P , write down  P .
(i) P : There exists a positive real number.

 P:
(ii) P : Each real number is positive.

 P:

x + y means ( x) + y and not (x + y ).

1.2.2 Disjunction: P

_Q

Disjunction is when the two statements are connected with the word `or', that is, one or the other is
considered.
Example.

If P is:

2+3=5

and Q is:

2+3=6

then P

_ Q is:
or

2 + 3 = 5 or 2 + 3 = 6
(2 + 3 = 5) _ (2 + 3 = 6)
Can this be simpli ed?

Exercise:
1. Write the following statement using the connective _.
I am catching the bus or train home.

2. For the statements P and Q, write down P


(i) P : x  0

Q: x  1

_ Q.

_ Q:

(ii) P : x is the square of an integer.

Q: x is prime.

_ Q:

Truth Table for Disjunction:

Let P and Q be statements.

_Q

Notes.

1. It is important that you notice the order of the rows in a truth table. We will always start our
truth tables with the maximum number of T's in the top left of the table.
2. \P

_ Q" stands for \P

or Q or both". The symbol

_ is the mathematical `or', which is not the

exclusive `or' frequently used in conversation. For example, compare the following statements.
I will pass or fail MATH122.
I will work hard in MATH122 or I will work hard in MATH187.
If you want the exclusive `or', that is, if you want \P or Q but not both", then you must write
(P

_ Q) ^  (P ^ Q).

Exercise:
Write down the truth value of the following statements.
(i) 2 > 1

(x + 1)2 = x2 + 2x + 1

(ii) 2 is odd _ 5 is odd


(iii) 2 < 1 _ this room is empty.

1.2.3 Conjunction: P

^Q

Conjunction is when the two statements are connected with the word `and', that is, both statements are
considered.
Example.

If P is:
and Q is:

x<2

then P

^ Q is:

x> 1

or

x < 2 and x > 1


x <2^x> 1

Can this be simpli ed?

Exercise:
1. Write the following statements using the connective ^.
(i) It is hot and sticky here.
(ii) I like rock and roll.
2. For the statements P and Q, write down P
(i) P : x  0

Q: x  1

^ Q.

^ Q:

(ii) P : x is the square of an integer.

Q: x is prime.

^ Q:

Truth Table for Conjunction:

Let P and Q be statements.

^Q

Exercise:
Write down the truth value of the following statements.
(i) 3 < 5

6>

(ii) 3 > 5

6>

(iii) 1 = 2

4=7

1.2.4 Truth Tables for Compound Statements


We will take a break from analyzing the connectives to look at how truth tables can be set up for any
compound statement. We form these tables by combining the truth tables for our basic connectives.
Examples.

(i)

(ii)

_ P

Note.

The truth value of a statement is put under its

main connective|the

that binds the statement together.

P _

main connective

is the one

(iii) Exclusive `or'


P

(P

Q) ^

 (P ^

Q)

We can `see' from the table that


(P

_ Q) ^  (P ^ Q)

is true if P is true or Q is true but not both


(as claimed earlier).

1.2.5 Conditional: P =) Q
The conditional of two statements is an \if ... then ..." statement, or an \implication". The second
statement (Q) is always true whenever the rst statement (P ) is true|be careful, however, as Q may be
true at other times also.
In this case, P is called the

antecedent

or

hypothesis

or

, while Q is the

condition

consequent

or

conclusion

The statement \P =) Q" can be read in any of the following ways.











P implies Q

If P then Q
Q if P
Q provided P

Q whenever P
P is a sucient condition for Q
Q is a necessary condition for P
P only if Q

Examples.

P:

and Q:
P =) Q:

or

I work hard.

P:

I do well.

and Q:

If I work hard then I do well.


I work hard =) I do well.

P =) Q:

or

x is 2.
x2 is 4.
x being 2 implies that x2 is 4.
x = 2 =) x2 = 4

Can the arrow go backwards?

Exercise:
1. Write the following statement using connectives.
If x2 is 4, then x is plus or minus 2.

2. For the statements P and Q, write down P =) Q.


(i) P : x2

1=0

Q: x = 1 or x = 1

(ii) P :

px > 1

Q: x > 1

P =) Q:
P =) Q:

Before we present the truth table for implication, consider the following statement.
If it rains, then I will go home.
How do we judge the truth of this statement?
The statement is of the form P =) Q where P is \It rains" and Q is \I will go home." There will be four
rows in the truth table, so we need to consider the four cases. The truth value of P =) Q will depend
on whether I stick to my statement or not.

Case 1: P is True: It rains.

Case 2: P is True: It rains.

Q is True: I go home.

Q is False: I do not go home.

Did I stick to my statement? Yes.

Did I stick to my statement? No.

The truth value of P =) Q is True.

The truth value of P =) Q is False.

Case 3: P is False: It does not rain.

Case 4: P is false: It does not rain.

Q is True: I go home.

Q is false: I do not go home.

Did I stick to my statement? Yes.

Did I stick to my statement? Yes.

The truth value of P =) Q is True.

The truth value of P =) Q is True.

In cases 3 and 4 when P is False, I did not specify what I would do if it does not rain. Therefore,

Note.

either Q or  Q make the statement true.


Truth Table for Conditional:

Let P and Q be statements.

P =) Q

Notes.

1. There are a number of di erent ways to interpret P =) Q. Two such interpretations are
(i) P =) Q is true if there is a valid argument from P to Q;

(ii) P =) Q is true if it can't be said to be false.

2. It has been said that from a false hypothesis, \anything" can be proved to be true.
3. Although P =) Q is frequently used in common language to mean \P has caused Q", we will think

of P =) Q as a `new' statement which means `if P then Q'. Even if P and Q are not related to

one another, our truth table gives a truth value to P =) Q.

Exercise:
Write down the truth value of the following statements.
(i) 1 = 1 =) 2 = 2
(ii) 1 = 1 =) 0 = 1
(iii) 0 = 1 =) 0 = 0
(iv) 0 = 1 =) 1 = 2

10

Exercise:
Complete the truth table for the statement P =) (Q =) P ).
P

P =) (Q =) P )

What do you notice about the truth value of this statement?

1.2.6 Biconditional: P

() Q

The biconditional connective is an equivalence of statements. The statement \P

()

Q" can be read

in any of the following ways.







P if and only if Q
P implies and is implied by Q

P is equivalent to Q
P is a necessary and sucient condition for Q

In many books, the statement `P if and only if Q' is written \P i Q" or \P

 Q".

Example.

x3 = 8.

P:

Note.

and Q:

x = 2.

x3 = 8

()

()

Q:

x3 = 8 if and only if x = 2.

or

x3 = 8

()

x = 2.

x = 2 means both x3 = 8 =) x = 2 and x = 2 =) x3 = 8.

Exercise:
1. Write the following statement using connectives.
Michael is a bachelor if and only if Michael is male and never married.

2. For the statements P and Q, write down P


(i) P : x2

1=0

Q: x = 1 or x = 1

(ii) P :

px > 1

Q: x > 1

()

Q:

()

Q:

()

Q.

11
Truth Table for Biconditional:

Let P and Q be statements.

()

Exercise:
Write down the truth value of the following statements.
(i) x2 = 1

()

(ii) I get wet

(x = 1

()

x = 1)

it is raining.

()

(iii) I will graduate next year

I pass all the subjects I am doing.

1.3 Tautologies
1.3.1 Main Connectives
Generally, when constructing compound statement, we use brackets to show what meaning is intended
and avoid confusion.
.

Example

()

Q^

 R could mean \(P ()

Q)^

 R" or it could mean \P ()

(Q ^

 R)".

When working with compound statements, we will need to identify the connective which binds or holds
the statement together. In fact, when constructing truth tables, we need to know the ranking of all
connectives in the statement.

Exercise:
Identify the main connective in the following statement. Further, rank all other connectives in order
of strength in the statement.
(i) (P

_  Q) =) (P ^

(ii) P =) Q =) (R
(iii)

(P

R)


_  R)

Q) _ ( P

Q)

12

1.3.2 Tautologies and Contradictions


De nition 1.3.1. Any statement that is true regardless of the truth values of the constituent parts is
called a tautology or tautological

statement

Examples

(i) We saw earlier that the truth value for P

_ P

is always T (page 7). Therefore, P

_ P

is a

tautology.
(ii) From the truth table for P =) (Q =) P ) (page 10), we see that this statement is also a tautology.

De nition 1.3.2. Any statement that is false for all possible truth values of the constituent parts is
called a contradiction or contradictory

statement

Example

Consider the truth table for the statement P

^  P.

^ P

T
F

^ P

As the truth value for P

is always F, the statement is a contradiction.

De nition 1.3.3. Any statement that is not a tautology and not a contradiction is
intermediate

contingent

or

Example

If P is a statement variable, then it is contingent.

Exercise:
Determine from its truth table whether the following statement is a tautology, contradiction or
contingent statement.

Note.

 ( P ^

Q)

The negation of a tautology is a contradiction and vice versa.

13

1.3.3 More Ecient Methods


Exercise:
Determine from its truth table whether the following statement is a tautology or not.
P

(P

Q) =)

 R _  (P =)

Q)

In the previous exercise, there were eight di erent combinations of truth values (23 = 8). If you were
asked whether the statement (P

^ Q) =) (R ^ S ) were a tautology, there would be 16 combinations to

consider. If we introduce another statement variable, this would increase to 32.


Is there a quicker way of deciding whether these are tautologies, other than using truth tables?

Proceed with caution!!!

We will consider one such method. However, truth tables are reliable (\safe") and are highly recommended
if the \quick" method is confusing or leading no where!
The quick method relies on the fact that if a truth value of F can occur under the main connective (for
some combination of truth values for the components), then the statement is not a tautology. If this
truth value is not possible, then we have a tautology.
Therefore, to determine whether a statement is a tautology, we place an F under the main connective
and work backwards.

14

Examples

(i) (P

Q) =) (R

S)
W orking

Discussion

Q) =) (R

S)

Q) =) (R

S)

Place an F under the main connective.

(P

For this to happen, P ^ Q must be true


and R ^ S must be false.

(P

Set P and Q true, R and S false.

(P ^ Q) =) (R ^ S )
T T T F F F F

(P =) Q)

(ii)

(Q =) R) =) (P =) R)
W orking

Discussion

Place an F under the main connective.

(P =) Q)

(Q =) R) =) (P =) R)

For this to happen, the rst part must be true


and the second must be false.

(P =) Q)

For the second part to be false, P must be true


and R must be false.

(P =) Q) ^ (Q =) R) =) (P =) R)
T
T
F
F T F F

For the rst part to be true, both implications


must be true.

(P =) Q) ^ (Q =) R) =) (P =) R)
T T
T
T F
F T F F

For the rst implication to be true, Q must.


be true. However, for the second implication
to be true, Q must be false.

(P =) Q) ^ (Q =) R) =) (P =) R)
T T T T T T F F T F F

(Q =) R) =) (P =) R)
T
F
F


It is impossible for Q to be both True and False, therefore, the statement is a tautology.

Note.

We can use either method to check whether a statement is a tautology. Use the method that you

feel most comfortable with.

1.4 Logical Equivalence


De nition 1.4.1. Two (compound) statements P and Q are said to be logically
P

, written

equivalent

 Q, if and only if they have identical truth values for each possible substitution of statements for

their variables.
Notes.

1. To say P is logically equivalent to Q is the same as saying \P

()

Q is a tautology".

2. Two statements are logically equivalent if they have identical truth tables.
3. We will see that logically equivalent statements can be substituted in statement forms without
changing their truth values.

15

1.4.1 Substitution of Equivalence


There are two di erent types of substitution into statements. The rst is relatively obvious.

Rule of Substitution. If in a tautology all occurrences of a variable are replaced by a (compound)


statement, the result is still a tautology.
.

Example

We know from our work that P

_ P

is a tautology. Then by the rule of substitution, the following

are also tautologies.


Q_

Q
(P ^ Q) =)

Note that we simply replace

_
every

(P

^ Q) =)

occurrence of P by some other (compound) statement. In future

work, we will simply apply this rule without reference.

Recall:

In algebra, we use \identities" on a regular basis to simplify expressions


.

Example

We know that cos2 x = 1

sin2 x. Therefore, we can use this identity to simplify


1

sin2 x cos2 x
=
cos x
cos x
= cos x

In logic, this type of substitution is governed by the following rule.

Rule of Substitution of Equivalence (or Biconditional Replacement). If in a tautology we replace any


part of a (compound) statement by a statement equivalent to that part, the result is another tautology.
.

Examples

(i) From our truth tables for P =) Q and

P _

Q, we see that they are logically equivalent (the

tables are identical). Therefore,


P =) Q

 P _

Q.

 S _

T.

(ii) From (i) (and which rule?), we know that


S =) T

Further, we saw earlier that P =) (Q =) P ) is a tautology.

Clearly by substitution, T =) (S =) T ) is a tautology. Therefore, by substitution of equivalence,


we have the tautology
T =) ( S

T ).

16

Discussion:
Is  T

_ ( S _

T ) a tautology?

Notes.

1. Substitution of equivalence allows us to simplify (which includes \expanding") statements to nd


equivalent forms. This is particularly useful when nding new tautologies.
2. As with the rule of substitution, we will use Substitution of Equivalence without speci c reference.

1.4.2 Some Logical Equivalences


Theorem 1.4.2. The following logical equivalences hold.
1. Commutative Laws:
(P
(P
(P

_ Q)  (Q _ P )
^ Q)  (Q ^ P )
() Q)  (Q ()

2. Associative Laws:
(P
(P
(P

P
P
P

_ Q) _ R  P _ (Q _ R)


^ Q) ^ R  P ^ (Q ^ R)

() Q) () R  P () (Q ()

3. Distributive Laws:
P

P)

R)


_ (Q ^ R)  (P _ Q) ^ (P _ R)


^ (Q _ R)  (P ^ Q) _ (P ^ R)

=) (Q _ R)  (P =) Q) _ (P =)

=) (Q ^ R)  (P =) Q) ^ (P =)

4. Double Negation Law:

 P  P
5. DeMorgan's Laws:

 (P _
 (P ^

Q)
Q)

 ( P ^  Q)
 ( P _  Q)

6. Other Implication Laws:

() Q)  (P =) Q) ^
(P =) Q)  ( P _ Q)
(P =) Q)  ( Q =)  P )
 (P =) Q)  (P ^  Q)
(P

(Q =) P )

R)

R)

17
Notes.

1. Equivalences of the form

 (: : :) allow us to simplify negations and are used frequently in Maths.

The most important of these are in 5 and 6.


2. Each of the logical equivalences has a corresponding tautology. These will not be listed speci cally,
but will be used in future work.
Eg.

 (P _

Q)  ( P

^  Q) has a corresponding tautology


 (P _ Q) () ( P ^  Q).

Exercise:
Prove DeMorgan's laws using truth tables.
(i)

(ii)

 (P _

Q)

( P

^  Q)

 (P ^

Q)

( P

_  Q)

It is a useful exercise to write down next to each equivalence the general idea. For example,

(Q

 (P _ Q) _
means the brackets are not necessary for a string of _ connectives.
P

R)

You should eventually prove all the equivalences listed in Theorem 1.4.2. Some of the equivalences are
obvious, such as Commutativity (eg. P

_ Q  Q _ P ).

Others are not immediately obvious (such as

DeMorgan's laws). You can use truth tables as we did above, however, once an equivalence is established,
we can use Substitution to prove further results.

18
Example.

Earlier we established the equivalence


(P =) Q)

 ( P _ Q).
Therefore,
( Q =)  P )  ( Q _  P )
 (Q _  P )
 ( P _ Q).
Combining the two statements, we have (P =) Q)  ( Q =)  P ).
This equivalence means that if we are trying to establish P =) Q, we can prove it indirectly,

Note.

that is, prove  Q =)  P by starting with  Q and proving  P .

Exercise:
Prove the following compound statement is a tautology using a truth table.
P

(P

()

Q)

() ( P ()  Q)

()

Q)

 ( P ()  Q).

Notes.

1. We can now say that (P

This means that negating each side of an

equivalence ( () ) produces another equivalence.

2. This result and the equivalences in Theorem 1.4.2 parts 3, 4, 5 and 6 provide the logical workings
of many di erent methods of proof. We will study these later.

19

Section 2.

Predicate Logic

2.1 Quanti ers


Discussion:
In Maths we use variables (usually ranging over numbers) in various ways. How does x di er in what
it represents in the following statements?
(i) x2 = 0
(ii) x > 2
(iii) x + 0 = x
(iv) x2 + 1 = 0

De nition 2.1.1.

A predicate is a sentence that contains one or more variables and becomes a

statement when speci c values are substituted for the variables. The domain of a predicate variable
consists of all values that may be substituted in place of the variable.
To display more of the meaning of the predicates in the previous Discussion, we introduce symbols that
are called quanti ers.

8x

read

\for all x"


or for each x

9x

read

\there exists an x"


or for some x

8 is called the Universal quanti er. 9 is called the Existential quanti er.
In this section of work on Logic, we are going to use these quanti ers more as short hand abbre-

Note.

viations.
Returning to the statements in the Discussion, we can use the quanti er notation to restate.
(i)
(ii)

9x 2 R ;
9x 2 R ;

x2 = 0.

(iii)

x > 2.

(iv)

8x 2 R ; x + 0 = x.
8x 2 R ;  (x2 + 1 = 0).

Notes.

1. The symbol 2 means \belongs to".


2. The domain of all predicate variables in the above statements is R .
3. In some literature, 9x 2 R is written as \9x(x 2 R

: : :)" and 8x 2 R as \8x(x 2 R =) : : :)".

These expressions are more complex but allow further logical analysis. In this subject we shall use
the simpler notation.

20

Quanti ers allow us to represent the meaning of language more precisely.

Exercise:
1. Write each of the following statements using the universal quanti er.
(i) All dogs are animals.
(ii) The square of any real number is positive or zero.
2. Write each of the following statements using the existential quanti er.
(i) There exists a real number whose square is negative.
(ii) Some dogs are vegetarians.

De nitions 2.1.2. Let Q(x) be a predicate and D be the domain of x. A universal statement
is a statement of the form \8x
\9x 2 D; Q(x)".

( )". An existential statement is a statement of the form

D; Q x

Important:

A universal statement is de ned to be true if and only if Q(x) is true for every x in D.
A universal statement is de ned to be false if and only if Q(x) is false for at

least one

x in D.

A value of x for which Q(x) is false is called a counterexample to the universal statement.

An existential statement is de ned to be true if and only if Q(x) is true for at

least one

x in D.

An existential statement is de ned to be false if and only if Q(x) is false for every x in D.

Aside:
Real numbers are further classi ed as natural numbers, integers, rational numbers, irrational numbers.
These sets of numbers are often used as the domain of the variable. The \standard" notation for these
categories of numbers are as follows.
1. N represents the set of all natural numbers, or positive whole numbers. N = f1; 2; 3; 4; : : :g.
2. Z represents the set of all integers or whole numbers (positive, negative and zero).

Z = f: : : ; 2; 1; 0; 1; 2; : : :g.
3. A

rational

:
number is one that can be written as a fraction. Eg. 2 = 21 ; 0:3 = 31 . The set of all

rational numbers is often denoted by Q . An

irrational

number is one that cannot be written as a

fraction, usually has a non-repeating, in nite decimal expansion. Eg.  is irrational.


4. R represents the set of all real numbers.
We will consider the relationship between these sets later in the section on Set Theory.

21

Exercise:
1. Write the following statements using quanti ers. Determine whether each statement is true or
false.
(i) Every integer is a rational number.

(ii) Some real number is rational.

(iii) No real numbers have squares equal to 1.

2. Write the following statements in words.


(i)

8x 2 N ; px 2 N .

(ii)

9x 2 Z; x1 62 Q .

(iii)

8 person x; 9 person y;

y was the mother of x.

In the last question above, we saw there can be more than one quanti er in a statement.
Examples.

1. Every student likes at least one mathematics subject.

8 student S; 9 maths subject y;

S likes y .

2. All persons are equal.

8 person a; 8 person b;

a is equal to b.

3. Not all natural numbers are even.


\Lazy" way:

 (8n 2 N ;

n is even)

Discussion:
What is the de nition of an even number?

Returning to example 3 from earlier, we can now write the expression as follows.
Not-so-lazy way:

 (8n 2 N ; 9p 2 N ;

n = 2p)

We will see how to simplify this expression shortly!

22

Exercise:
Express the following laws of arithmetic using quanti ers.
(i) Commutative law for + : If x and y are real numbers, then x + y = y + x.
(ii) Distributive law for  over + : If x, y and z are real numbers, then x(y + z ) = xy + xz .

Discussion:
Consider the following statements.

8x 2 R ; 9y 2 R ;
9y 2 R ; 8x 2 R ;

x + y = 0.
x + y = 0.

(i) Are the statements the same?


(ii) Determine whether each statement is true or false.
(iii) Is the order in which 8 and 9 appear important?

2.2 Negating Quanti ed Statements


This section is covered in the Discovery Class. We will see how to nd the negation of statements that
include quanti ers. We will often refer to the logical equivalences from Theorem 1.4.2.

23

Section 3.

Methods of Proof

3.1 What is a proof?


A proof is a sequence of statements that aim to establish a result. Each statement is an assumption, an
axiom, a previously proved theorem, or follows from previous statements by mathematical or logical rule
(or de nition).

Assumptions are the statements you assume to be true as you try to prove the result. For example, if
you want to prove

2 R and 2 N is even, then n


your proof should start with the assumptions that 2 R and 2 N
\If

>

0"
is even. Further, you can use the

\de nition" of an even natural number, and write the assumptions as follows.
Let x 2 R , and
n

2 N be even, that is, 9 2 N


p

; n

= 2p.

Assumptions are often thought to be the \given information" or information we \know" that can be used
in our proof. As in the example above, when you are proving statements of the form P =)

, then the

assumption is the statement P (which could be a list of things).

Axioms are laws in Mathematics that hold true and require no proof. For example,

= x and x + 0 = x

are axioms. Other examples of axioms in Mathematics include the property of transitivity, that is, if
x

= y and y = z , then

= z.

Mathematical Rules are known rules that are often used. For example, we all know that if
x

= y , then

+ z = y + z . Further, the Principle of Mathematical Induction is considered a rule that is \well-known"

(although some may be unfamiliar with it).

Logical Rules are rules such as Substitution and Substitution of Equivalence.

We shall present two

further rules in Logic that are used in a similar way to Substitution and Substitution of Equivalence.

3.1.1 Modus Ponens


Exercise:
Show the following statement is a tautology (any method).
P

(P =)

) =)

24

An application of the tautology in the previous exercise is the logical rule of Modus Ponens, and is
often stated as follows.

Rule of Modus Ponens. If P and P =)

are both tautologies, then so is

In other words, Modus Ponens simply says that if we know


, then

that if

to be true, and we know that

must also be true. Note that from the truth table of

(P =)

) =)

implies

, we can see

is false, Q can be either true or false.

The following exercise demonstrates how Modus Ponens works in practice.

Discussion:
1. True or False? \n 2 N is even =)

is even."

Let n = 98374. True or False? \n2 is even".


2. The Principle of Mathematical Induction says that when you have a statement, CLAIM(n),
that concerns n 2 N , if
a. CLAIM(1) is true, AND
b. CLAIM(k ) =) CLAIM(k + 1) for all

then CLAIM(n) is true for all n 2 N .

2 N,

According to Modus Ponens, what must we establish so we can apply this principle to the
following statement and be able to say \CLAIM(n) is true for all
CLAIM(n): 4n

2 N "?

1 is a multiple of 3.

(You should try to prove this for yourself.)

The use of Modus Ponens is really a matter of common sense. Now that we have studied the details, we
shall use Modus Ponens without direct reference.

25

3.1.2 Law of Syllogism


Exercise:
Show the following statement is a tautology (any method).
(P =)

(Q =)

) =) (P =)

An application of the tautology in the previous exercise is the logical law of Syllogism, and is often
stated as follows.

Law of Syllogism. If P =)

and Q =)

are both tautologies, then so is

Most results in Mathematics that require proof are of the form P =)

=)

. The Law of Syllogism provides

the most common method of performing proofs of such statements. The Law of Syllogism is a kind of
transitivity that can apply to =).

To use the Law of Syllogism, we set up a string of statements, P =)


until Pn =)

P1

, P1 =)

. Then, by successive applications of the law, we have P =)

, P2 =)

P2

P3

Example.
We wish to prove that for n 2 N , if

is even, then

is even =)

This has the form P =)

Proof:
p

=)

= 2p

=)

= 4p2

=)

= 2(2p2 )

=)

; n

is even; in logic notation, we wish to prove


2

is even.

and we note that our assumption includes

is even

9 2N

9 2N
p

; n

= 2p

(P =)

P1

= 4p2

(P1 =)

P2

= 2(2p2 )

(P2 =)

P3

is even

(P3 =)

2 N and

is even.

, etc.

26

Completing the proof is simply a matter of applying the Law of Syllogism three times to get
n

is even =)

is even.//

In our work, we shall abbreviate the proofs by applying the Law of Syllogism in a more subtle way. The
previous proof will be simpli ed to

Proof:
n

is even

=)
=)
=)
=)

9 2N
p

; n

= 2p

= 4p2

= 2(2p2 )

is even.

Therefore, if

is even, n2 is even.//

The use of Law of Syllogism is also a matter of common sense. Just as with Modus Ponens, we shall use
the Law of Syllogism without direct reference.

Note. The use of the connective =) in the previous proof seems a little repetitive, albeit valid. For
variety, the connective can be replaced by words such as therefore, thus, so we have, and hence. There is
scope for creativity here!!

3.2 Proving Quanti ed Statements


Before we proceed to techniques of proving statements, it is important to make the following notes about
proving statements that involve 8 and 9.

3.2.1 Proving 9 Statements


The statement 9x 2 D; P (x) is true if and only if P (x) is true for at least one x 2 D. To prove this kind
of statement, we need to nd one x 2 D that makes P (x) true.

Example.
Prove that there exists an even integer that can be written two ways as the sum of two primes.

Essentially, to nd the appropriate number, we have to \guess".


Consider 14 = 7 + 7 [7 is prime.];

and 14 = 3 + 11 [3 and 11 are prime.]

Therefore, there exists an even integer that can be written two ways as the sum of two primes.

Aside: What is the smallest positive even integer that can be written two ways as the sum of two
primes?

Exercise:
1. Prove 9x 2 R ;
2. Prove that if

a; b

+ 5 = 0.

2 Z, then 10

+ 8b is divisible by 2 (ie, is even).

27

3.2.2 Proving 8 Statements


Most mathematical statements to be proved are

8 statements of the form 8 2


x

( ). To prove this

D; P x

kind of statement, you have two options.


(i) Method of Exhaustion

(ii) Generalized Proof

Example.
Prove the following statement: Every even number between 2 and 16 can be written as a sum of
two prime numbers.
4=2+2

6=3+3

8=3+5

10 = 5 + 5

12 = 5 + 7

14 = 7 + 7

Therefore, by the method of exhaustion, the statement is true.


Unfortunately, in most cases this method cannot be used. For example, how long would it take to prove
the statement for all even values of

2 N?

In this case, we use the techniques presented in this section.

3.2.3 Disproving 9 Statements


To disprove the statement

9 2
x

( ), we must prove its negation, that is, we must prove

D; P x

 (9 2
x

( ))

D; P x

8 2
x

D;

( ).

P x

To prove this statement, we must use a generalized proof as mentioned in section 3.2.2, to prove that

( ) is true.

P x

3.2.4 Disproving 8 Statements


To disprove the statement

8 2
x

( ), we must prove its negation, that is, prove

D; P x

 (8 2
x

( ))

D; P x

9 2
x

D;

( ).

P x

Note that to disprove a \8" statement, we are required to prove a \9" statement. Therefore, it is enough
to nd one

counterexample.

that satis es

( ), that is, one value that makes

P x

Exercise:
Disprove the statement 8x 2 R ; (x > 0

x <

0).

Discussion:
Prove or disprove the statement 8x 2 R ; 9y 2 R ; x + y = 0.

( ) false. This is called a

P x

28

3.3 The Direct Proof


A direct proof is one in which we work in a straightforward fashion to the answer.

Exercise:
Prove that if 3x

9 = 15 then

= 8.

Handy Hint. Before proving a statement, it is of great use to write the statement using logic notation,
including quanti ers, where appropriate. Doing this means you have clearly written in front of you the
assumptions you can make AND where you are eventually trying to get.

3.3.1 Forwards and Backwards Process


In the last example in section 3.1.2, we proved that if n is even, so too is n2 . The proof presented simply
showed a direct proof, with no indication of the reason we took certain steps. This brings us to the
question of what to actually do when faced with a proof.
To develop a proof, it is often helpful to work in a forwards and backwards manner, with the hope that
the steps will \meet up" in the \middle".

WARNINGS!
Steps in your nal proof must proceed in the correct \direction" and
your nal proof must not start with what you are trying to prove.

Example.
When approaching a proof of the statement (we have seen before), \n is even =) n2 is even", it is useful
to not only consider what it means for n to be even, but also what we must show to be able to say n2 is
even.

Forward working:

is even =)

9 2N
p

;n

= 2p

Thus, n2 = 4p2 .

Backward working:

To prove n2 is even, we must have n2 = 2k for some k 2 N ;


ie,

9 2N
k

; n

= 2k =)

is even.

Now we ask ourselves if we can \match up" the two sets of working. In this case, this part is trivial. We
simply take

= 2p2 and the ideas are all complete. The nal step here is to write up the formal proof,

as we did earlier.

29

In some cases, there is more backward working than forward working. Each problem is individual and
you must approach each one prepared to work in both \directions".
Make sure you heed the warning above, and check your proof proceeds from your assumption to your
conclusion in the correct manner.

Example.
Prove that for x 2 R , (

Forward:

??

Backward:

+ 2x + 1)  2.

1 2

2x

2x + 1  0

But

=)

=)

+ 2x + 1  2

2x

1 2

1)2  0 is true.

2x + 1 = (x

We can now put the proof together:


We know that (x
Thus, x2

1)2  0 for any x 2 R :

2x + 1  0

=)

2x

=)

1  2 (subtracting 2 from both sides)

+ 2x + 1)  2 (multiplying by

Note. In the previous example, we did NOT start with the statement (

1).//
2

+ 2x + 1)

2, as we

technically do not know whether it is true or not. We started our proof with a statement we know to be
true from previous work.

Discussion:
Prove the following statement:
\If the right angled triangle X Y Z with sides of length x and y and hypotenuse length z has an area
2
of z4 , prove that the triangle is isosceles."

Forward Steps: Area of the triangle =


By Pythagoras:

Combining these statements:

Backward Steps:
Full Proof:

XY Z

is isosceles if

30

3.4 Proof by Contradiction


Recall the following logical equivalence from Theorem 1.4.2.
(P =)
This equivalence indicates that if

=)

 (

is a true statement, then so too is

=)  P )

=)

. For this

reason, we have the method of proving statements by contradiction.

Method: To prove P =)

, we prove that  Q =)

is true.

In other words, we assume the negation of what we are trying to prove ( Q), then use a logical argument
to show that we would then have a contradiction with either P or some other well-known truth.

Example:
Prove that for n 2 N , if
This is of the form

is even, then

8 2N
n

(P =)

is even.

), where

is \n2 is even" and

give a general proof and we start with the premise that

is \n is even". Thus, we must

is even.

If we try a direct proof, our next step would be to say n2 = 2p for some p 2 N ... but then we get \stuck"!
A proof by contradiction proceeds as follows.
Let

Suppose that
Then

The \usual" assumption

be even.

Assume

is an odd number.

= 2p + 1 for some p 2 N .

Now, n2 = (2p + 1)2 = 4p2 + 4p + 1 = 2(2p2 + 2p) + 1.


Thus, n2 is odd.

Show

Therefore, we have a contradiction, and so n is even.

Exercise:
Complete the following proof by contradiction that if

is irrational, then y + 7 is also irrational.

Let y be an irrational number. Suppose y + 7 is ...


Therefore, y + 7 can be written as a fraction, that is, y + 7 =
Simplifying,

Thus, y is rational, which is a contradiction.


Therefore, if

is irrational, then y + 7 is ...

31

3.5 Proof by Cases


Discussion:
How would you go about proving the following statement?
If

6= 0 or 6= 0, then
y

The method of proof discussed above is a

proof by cases.

+ y 2 > 0.

The method is used whenever you wish to

prove a statement of the form


(P

) =)

The rationale behind a proof by cases is based on a generalisation of the following logical equivalence (as
an exercise, you should prove to yourself it is indeed a tautology).
(P =)

(Q =)

(P

) =)

The only problem with this method of proof is that it is not always obvious that this is the technique
required.

Example.
To prove the statement \8m 2 N ;
is even and when

+ m + 1 is odd", we should use a proof by cases, that is, when

is odd. (You should try it.)

32

Section 4.

Set Theory

4.1 Ideas in Set Theory


Some students are familiar with set theory in terms of Venn diagrams. These diagrams can only be used
to give you a certain \intuition" about sets. They will NOT be acceptable in proving set theory results
in MATH122.
In Set Theory, we shall work within a Universe U . We consider sets A and B having elements from U
and we have the following ideas.
U

U
A

A
x
B

is an element of A:

=B

U
A

Union:

Intersection:

U
A

B
A

Complement of A:

Note.

or U nA

is a subset of B :

We will usually use small letters for elements and capital letters for sets. However, sets can be

elements of other sets.


Although we accept the concepts of set and element as de ned, all the informal ideas about sets and
the more general concepts of set theory can be built up using logic, with
Universe U , and using the following notation.

1.
2.

x
x

2
26

is read \x is an element of A".

is read \x is not an element of A".

and

ranging over the

33

3. fx : x 2 B ^

( )g is read \the set of all elements of

P x

which make the statement

( )

P x

true".
More often, this notation is more simply written fx 2 B : P (x)g.
This is called set builder notation. In using this notation, the elements of
to the Universe U and P (x) can be any predicate involving x.

must belong

could be all of U .

Examples.

(i)

:x2R

^ 0   1g
x

= fx 2 R : 0  x  1g
= [0; 1] (interval notation in Calculus)

(ii) The set of all rational numbers, Q can be written as

Q=
(iii)

f 2R:
x

na
b

: a; b 2 Z

^ 6= 0
b

= xg = f0; 1; 1g

Exercise:
Write down the elements in each of the following sets.
(i)

f 2N :

(ii)

f 2R:

(iii)

f 2 Z:

= xg =

= 9g =

= 7g =

4.1.1 A Special Set


De nition 4.1.1. The null set or the empty set, denoted by , is described as the set having no
elements.
Some books express this as  = f g. Using the set builder notation, we can de ne the empty set as
 = fx 2 N : x 6= xg.

4.2 Subsets
De nition 4.2.1. If A and B are sets, we say that A is a subset of B , denoted A  B , if

8 2
x

U;

(x 2 A =)

).

Notes

1. If A  B , then each element of A belongs to B , or for each x 2 A, it is true that x 2 B .

34

2. If A is a subset of B , then B is sometimes called a superset of A.


3. If A and B are sets, then to prove A  B , we need to prove 8x; (x 2 A =)

4. If A and B are sets, to prove  (A  B ), we need to prove

 8

x;

(x 2 A =)

).

 9  ( 2 =) 2 )

9
2 ^ ( 2 )
 9 ( 2 ^ 62 ).
x;

x;

x;

Discussion:
Decide whether the following are true or false.
(i)

f1 2g  f1 2 3g

(iv) 1 2 fx 2 N : x2 = 1g

(ii)

f0 2g  f1 2 3g

(v)

(iii)

f1g is the same as 1.

(vi) Let A be any set in a Universe U . Then   A.

f1g 2 f 2 N :
x

Sets having a single element are frequently called singleton sets.

Eg

= 1g

. f1g is read \singleton 1"

Result 4.2.2. Let A be a set in a Universe U . Then   A.


Proof:

Suppose  (  A). Then, there exists y 2  such that y 62 A (see Note 4 above). This, therefore,

means that  is not empty, which is a contradiction. Therefore,   A.


Note

. We have the following relationship between sets we met earlier.


N

 Z  Q  R.

Exercise:
Let S be a set. Determine whether the following are true or false.
(i)

(ii)

f g
S

(iv)  2 fS g
(v)

fg  f g
S

(iii)   fS g

De nition 4.2.3. If A and B are sets, we say that A is a proper subset of B if A  B but A 6= B .
This is usually denoted by A  B .
Note.

If A is a proper subset of B , there must be at least one element in B that is not in A.

35

4.3 Formal Set Theory


Formal set theory depends to a large extent on two Axioms and one Theorem. The rst axiom guarantees
the existence of sets within a Universe and forms the basis for the use of set builder notation, which we
have already seen. The second axiom leads us to the de nition of set equality.

Axiom of Speci cation. Given a universe U and any statement P (x) involving x 2 U , then there
exists a set A such that 8x 2 U; (x 2 A
Note

()

( )). Further, we write A = fx 2 U : P (x)g.

P x

. We know an element x belongs to the set A = fx 2 U : P (x)g if x satis es the condition P (x).

Axiom of Extent. If A and B are sets then A = B if and only if 8x 2 U (x 2 A ()

).

De nition 4.3.1. If A and B are sets, we will say that A = B if A  B and B  A.


Note

. To prove that two sets are equal you must show two things.
(i)

and

(ii)

The Axiom of Speci cation and the Axiom of Extent can be used to prove the following theorem, which
links logic and set theory. The proof is omitted from this course, but can be found in many discrete
Mathematics books.

Theorem 4.3.2. Let U be a universe and let P (x) be a statement. If 8x 2 U; (P (x) ()

f 2
x

Note

( )) then

Q x

: P (x)g = fx 2 U : Q(x)g.

. Theorem 4.3.2 states that subsets of the same universe U which are de ned by equivalent statements

are equal sets.


.

Example

() ( = 1 _ =
2 = 1g = f 2 R : = 1 _

We know that x2 = 1

f 2R:
x

Note

1). Thus, by Theorem 4.3.2,

. If a1 ; a2 ; a3 ; : : : ; an 2 U , then we can write


A

= fx 2 U : x = a1

= a2

= 1g = f1; 1g.

:::

= an g = fa1 ; a2 ; : : : an g.

In other words, if we know the elements of a set, we know the set.


Theorem 4.3.2 allows us to use the tautologies of logic to prove set theoretic statements.
Thus, set theory, whether developed formally or informally (as we shall), depends on the tautologies
proved in the logic of statements.

36

4.3.1 Notation
Discussion:
Are the following sets equal? Using logic, can you prove your answer?

f1 2 1 3g
;

f3 2 1g

f1 2 3g
;

In set theory duplications of elements in a set need not be listed, and the order of the elements does not
matter.
.

Example

f1 3 1 2g = f 2 R :
=f 2R:
=f 2R:
= f1 2 3g
;

=1

=1

=1

_
_
_

=3

=1

=2

_
_
_

=1

=2

= 3g

_
_

x
x

= 2g
= 3g

Technically, the listing of elements can be done only for nite sets. However, if an in nite set is de ned
by a \simple" rule, we sometimes write a few elements and then use \: : :" to mean roughly \and so on"
or \by the same rule".
.

Examples

N = f1; 2; 3; 4; : : :g.

(i)

(ii) If we want the set of all even integers, we have a few options.
E

= fn 2 Z : n is eveng

= f: : : ; 4; 2; 0; 2; 4; : : :g

= fn 2 Z : 9p 2 Z; n = 2pg

Discussion:
Can we list the elements in Q as we did in the last example? What about for R ?

Sometimes a description of the elements in a set in words can be used to de ne the set.
.

Example

f 2R:
x

Note

2 < x < 2g = ( 2; 2) is the \set of all real numbers between 2 and 2".

. \fall real numbers between 2 and 2g represents the singleton set which has the phrase \all real

numbers ... and 2" as its only element. It is NOT the same as the set of all real numbers between 2
and 2.
In other words, be careful when expressing sets. Make sure your notation is correct and you are not
\cutting corners".

37

A nal note on singleton sets: If a 2 U , then fx 2 U : x = ag = fag.

The set fag is NOT the same as a. The former is a SET containing the ELEMENT a.

Exercise:
Are the following two sets equal? Give reasons.
E

= fn 2 N : n is eveng

= fn 2 N : n2 is eveng

4.4 Set Operations


Before we de ne operations, we need to set up a \universe" in which to perform these operations. The
Discovery Class introduces the concept of a power set of X for any set X .
There are ve main set theoretic operations, one corresponding to each of the logical connectives.

Idea:

Set Operation

Name

Connective

Complement

Union

Intersection

Subset

=)

Equality

()

or

The set operations are to be de ned in terms of the corresponding logical operations. This means

that each of the tautologies proved by truth tables for the logical connectives will have a corresponding
theorem in set theory.
We have already seen how =) is related to subset and
In our discussion of set theory, we will let
C

, etc, will be subsets of

. In other words,

()

to set equality.

be a xed set and all other sets, whether denoted


A; B; C

2 P(

). Thus, each result should start with a

statement similar to \Let A, B , C be subsets of a universal set U " or \Let A, B , C be elements of P (U )".

4.4.1 Complements, Union and Intersection


De nition 4.4.1. Let U be a universal set, and let A  U . Then the complement of A, denoted by
A

or U nA, is given by A = fx 2 U :  (x 2 A)g = fx 2 U : x 62 Ag.

38

Notes

1.

2.

= fx 2 U : x 62 Ag.
and Ac are also used for A in some books.

3. If the set U is xed in a discussion, then A is sometimes written as A = fx : x 62 Ag.

Exercise:
Let U = Z. Write down A for the following sets.
(i)

(ii)

(iii)

= f1; 2; 3g

= fx 2 Z : x is eveng

= fx 2 Z : x > 0

0g

x <

De nition 4.4.2. Let A and B be subsets of a universe U . Then the union of


A

, is given by A [ B = fx 2 U : x 2 A

_ 2 g.
x

A and B, denoted

Exercise:
1. Let U = R . Write down A [ B for the following sets.
(i)

(ii)

(iii)

= f1g and B = f2g

is the set of all even integers, B is the set of all odd integers.
= fx 2 R : 0  x  2g and B = fx 2 R : 1  x  3g

2. If A  U and B  U , is it true that A [ B  U ?

De nition 4.4.3. Let

and

be subsets of a universe

denoted A \ B , is given by A \ B = fx 2 U : x 2 A

. Then the intersection of

^ 2 g.
x

A and B,

Exercise:
1. Let U = R . Write down A \ B for the following sets.
(i)

(ii)

(iii)

= f1; 2; 3; 5g and B = f1; 4; 5; 6g

is the set of all even integers, B is the set of all odd integers.
= fx 2 R : 0  x  2g and B = fx 2 R : 1  x  3g

2. If A  U and B  U , is it true that A \ B  U ?

There is one further set operation which can be de ned with complements and intersection, but warrants
a mention in its own accord.

De nition 4.4.4. Let A and B be subsets of a universe U . Then the di erence of A and B , denoted
A

, is given by A

= fx 2 U : x 2 A

^ 62 g.
x

39

Notes

1. The di erence of A

is sometimes called the relative complement of

2. Since A  U and B  U , A

3. If we let A = U , then we have


U

B in A.

= fx 2 U : x 2 U

^ 62 g
x

= fx 2 U : x 62 B g
= B:
4. Using De nitions 4.4.1 and 4.4.3, we can simplify the de nition of
A
B = fx 2 U : x 2 A ^ x 62 B g
= fx 2 U : x 2 A

as follows.

^ 2 g
x

= A \ B:

4.4.2 Disjoint Sets


De nition 4.4.5. Let A and B be sets. Then A and B are said to be disjoint if A \ B = .
Note

. Disjoint sets have no elements in common.

Exercise:
Let U = R , A = f1; 2; 3g, B = f2g, C = f2; 3; 4g and D = [0; 1] = fx 2 R : 0  x  1g.
(i) Write down
(a)

(b)

(d)

(e)

(c)

(ii) Which pairs of sets from A, B , C , D are disjoint?

4.5 Algebra of Sets


The rules governing the algebra of sets are considered to be basic facts that are `known' and `understood'
by any mathematics student. Set theory, like logic, is subtly hidden in the background of all mathematics
subjects you will study.
Set theory is not often studied as a topic in its own right. The quantity of material covered in most
subjects accounts for the lecturer adopting the attitude \I don't want to teach you about set theory, but
I want you to know it and be able to use it correctly!" We will study enough for you to do just that.
The `rules' of set theory will be included among the set theoretic results which are included in the next
few theorems. These `rules' can be proved using the axioms and de nitions we have presented so far.
The proofs of all these rules involve using the de nitions of basic set operations and proving for some
sets A and B , either A  B or A = B .

40
Notes.

[ and \ are operations on sets, ie, [ and \ can only be put between two sets.
^ and _ are operations on statements, ie, ^ and _ can only be placed between statements.

1.
2.

For example

If A and B are sets, then the only way to interpret


(A  B

is as
(A  B )

) =)

(B  C ) =) (A  C ).

Theorem 4.5.1. Let U be a set and let A, B and C be elements of P (U ).


1. (A  B ^ B  C ) =) A  C
4. Commutative Laws:
A
A

2.

A
A
A

3.

A
A

 [
\ 
A

=B






B
B

B
B

() ( 
() [
() \
A

=)
=)

=B

=A

B
B

=B[A
=B\A

5. Associative Laws:

(A [ B ) [ C = A [ (B [ C )
(A \ B ) \ C = A \ (B \ C )

6. Distributive Laws:

[  [
\  \

[
\

[( \
\( [
B

) = ( A [ B ) \ (A [ C )
) = ( A \ B ) [ (A \ C )

7. DeMorgan's Laws:
(A [ B ) = A \ B
(A \ B ) = A [ B

Corollary 4.5.2. Let U be a set and let A, B and C be elements of P (U ).


1. Facts about Complementation:
2. Properties of  and U :


A
A
A
U

=A
B
B

() 
= \
B

=

=U

3. Subset properties of [ and \:


(A  C

(A  B

^
^

B
A




() ( [ ) 
()  ( \
A

\ =
\=
\ =
U

A
A
A

[=
[ =
[ =

41

4.5.1 Techniques for Proving Set Results


The rst technique we will use for proving set theorems is a \typical element" argument. This technique
is most frequently used and it is \expected" that students understand this method. It is the \standard"
technique for proving results about sets.

Idea 1: To prove that A  B , we must show that 8x; (x 2 A =)

).

We begin by letting x 2 A, that is, we take x to be an arbitrary element of A. Using the de nitions, we
prove that x 2 B . As long as we use no special properties of the element x, we can conclude that

(x 2 A =)

x;

which is what we wanted to prove.


This method can be used to prove set equalities by using the de nition
A

then showing

()

=B

(A  B

using the method twice. Using this de nition is sometimes called a

\double containment" proof.

Discussion:
When using a `typical element' argument to prove A  B , what happens if there are no elements to
pick, ie, if A = ?

The second technique is a direct application of Theorem 4.3.2.

Idea 2: If A can be written as A = fx 2 U : P (x)g and B = fz 2 U : Q(z )g, then we can use Theorem

4.3.2 to show that A = B by showing that P (x)  Q(x), that is , by showing that P (x)

()

( ) is a

Q x

tautology (use truth tables).


As this point some students get sets, statements, logic and set equality all mixed up. Make sure you have
things clear.
Example.

Let U be a set and let A, B and C be elements of P (U ). Prove that A  A [ B .


We will prove this directly using the rst method. That is, we must prove

2 [ .
Let 2 . (This means we \know" 2 .)
By de nition, 2 _ 2 =) 2 [
To complete the proof, we need the step 2 =) 2 _ 2 . However, considering this statement
in terms of logic, we note that
=)
_ is a tautology (check!). Therefore, we have a complete
x

Forward:

Backward:

proof as follows.

=)

42

Let x 2 A. Then we have

Proof:

=)
=)

x
x

Therefore, A  A [ B .

2 _ 2
2 [ .
A

Example.

Prove the statement A  B

() [
A

= B.

The proof is in two parts:


1.

2.


[

=)

B
B

=B

[ =
=) 
A

To prove part 1, let A  B . We must show that A [ B = B . To do this, we must prove two things
(i)

[ 
B

(ii)

 [
A

To prove part (i):


Let x 2 A [ B , then by de nition,

_ 2
x

To complete this part of the proof, we have to prove that

(x 2 A

_ 2
x

) =)

requires a proof by cases.

If x 2 B , there is nothing to show.

Case 1:

If x 2 A, we know that A  B , and so x 2 B .

Case 2:

Therefore, we have established that x 2 A [ B =) (x 2 A


Thus, A [ B  B .

To prove part (ii):


Let x 2 B . Then we have
x

=)
=)

x
x

Therefore, B  A [ B .

2 _ 2
2 [ .
A
A

Therefore, we have proven that A  B =)

= B.

To prove part 2, let A [ B = B . We must show that A  B .


Let x 2 A. Then we have
x

=)
=)
=)

Therefore, A  B .

x
x
x

2 _ 2
2 [ by de nition
2 as [ = .
A
A

Therefore, we have proven that A [ B = B =)


Therefore, A  B

() [
A

= B.

_ 2
x

) =)

B . This

43
Example

The proof in this example can be done using a `typical element' argument. However, we shall demonstrate
a proof using the second method.
Prove that (A \ B ) = A [ B .
By Theorem 4.3.2, we only need to show that the statements de ning the sets (A \ B ) and A [ B are
equivalent.

2 ( \ )   ( 2 \ ) by de nition of complement
2 [  2 _ 2 by de nition of [
 ( 2 ) _ ( 2 )
  ( 2 ^ 2 ) by Logic (DeMorgan's in Theorem 1.4.2)
  ( 2 \ ) by de nition of \
 2 ( \ ).
Therefore, ( \ ) = [ .
x

Some results can be proved from earlier ones by a step-by-step method.


.

Example

Using

(i)

prove that A
Proof:

 () [ =
(ii)  () \
 ()  .
 () \ = by part (ii)
() ( \ ) =
() [ = by part (iii)
()  by part (i).

= A and

(iii)

Exercise:
Let U be a set and let A, B and C be elements of P (U ). Recall the de nition
x

(i) Prove that (A

(ii) Disprove that A

(B

= (A

A
C

) = (A

()

(x 2 A

^ 62
x

).

. [Hint: Find a counterexample.]

= (A \ B )

44

4.6 The Russell Paradox


One of the complications in our set theoretic proofs is the need to carry along the statement \Let U be a
set and let A, B and C be elements of P (U )." It would be so much easier if we had a really big universal
set U which contains all elements. For this set U , x 2 U is always true. If such a U exists, we could leave
x

2 U from our de nitions and proofs.

Unfortunately, this idea doesn't work!

Suppose the idea worked and we had a set U that \contained all elements". Then U

2 U.

This seems like an unusual property. Consider the empty set . It's clear that  62 .

f 2 U : 62 g. By the Axiom of Speci cation, is a set. Further, as U contains


everything, 2 U . Now, we have either one of the following statements must be true.
(i)
2 or
(ii)
26 .
If 2 , then by the Axiom of Speci cation, satis es the statement \ 62 ", ie, 62 . This is
Now, let

clearly a contradiction.
If Z

62

, then as Z

2 U also, by the de nition of the set

, Z 2 Z . This is also a contradiction!!!

In other words, given this de nition for Z , we have the contradiction


Z

()

62

This contradiction is called the Russell Paradox.


If we use a Universe U which does not contain all elements, then we may have Z

62

, which doesn't lead

to a contradiction.
For the contradiction in Russell's Paradox to hold, it is enough to consider a universe
all sets. This means there is not

that contains

. Mathematicians have gotten around this diculty by

set of all sets

formally de ning \classes" and stating that there is a `class' that contains all sets...but that is a matter
for another subject!

45

Section 5. Relations & Functions


5.1 Cartesian Product

This section is covered in the Discovery Class. The Cartesian Product of two sets forms a kind of
\universe" for a relation, which is brie y introduced in the Discovery Class.

5.2 Relations
De nition 5.2.1.

Let A and B be sets. We say that R is a (binary) relation from

A to B if

R  A  B . If R  A  A, we will say that R is a relation on A. Further, if (a; b) 2 R, we will frequently


write aRb and say that \a is in the relation R to b".

Note. Every relation is a subset of a cartesian product.

Discussion:
Consider the relation R on R given by R = f(x; y ) : x; y 2 R
(i) Sketch a graph of this in R 2 .

(ii) True or False?

1R1

2:1R2:2

x = y g.

( 3; 3) 2 R

(iii) If aR100, then a =


The relation in the previous discussion is usually written as
and it is normally called the identity

R = f(x; x) : x 2 R g

relation on R .

Exercise:
1. Let X = f0; 1; 2; 3g and let the relation R on X be given by R = f(x; y ) : 9z 2 N ; x + z = y g.
(i) What is an easier way of expressing the relation R?

(ii) List all the elements of R.

(iii) Sketch X  X and circle the elements of R.

continued over ...

46

2. Let the relation on Z

f0g be given by S = f(x; y) : 9z 2 Z;

xz = y g.

(i) Describe the relation S.

(2; 4) 2 S

(ii) True or False?

(3; 5) 2 S

3S0

Further Examples.
1. Let R1 be the relation on N given by R1 = f(x; y ) : y = x2 g.
Let R2 be the relation on R given by R2 = f(x; y ) : y = x2 g.

By sketching each relation, we can see how the \input set" makes a di erence to the elements in
the relation.
y

R1

R2

2. Let A be the set of all male human beings and let B be the set of all human beings. The relation
R3 from A to B is given by R3 = f(x; y ) : x is the father of y g.
3. R4 = f(1; 2); (2; 1); (5;  )g.
Note that R4 cannot be de ned by a \rule". Sometimes relations are simply de ned by a listing of
elements.

Note. We must be careful when writing relations. As can be seen from the rst example above, we must
make very clear the sets a relation R is from and to.
Since relations are subsets of cartesian products, their unions and intersections can be calculated as for
any sets.

47

Exercise:
1. Let A = f0; 1g and B = f 1; 0; 1g. Let two relations from A to B be given by
R1 = f(0; 1); (1; 1); (1; 0)g,

and

Write down R1 \ R2 and R1 [ R2 .

2. Let R3 and R4 be relations on R de ned by


R3 = f(x; y ) : x = y g,

and

R2 = f(0; 0); (1; 1); (1; 1)g.

R4 = f(x; y ) : x = y g.

Write down an expression for R3 [ R4 and R3 \ R4 .

5.2.1 Domain and Range of Relations


De nition 5.2.2. Let R be a relation from A to B . Then the domain of R, denoted Dom R, is given by
Dom R = fx : 9y; xRy g and the range of R, denoted Range R, is given by Range R = fy : 9x; xRy g.

Exercise:
1. Let A = f0; 1; 2; 3g and let R be the relation on A given by R1 = f(0; 0); (0; 1); (0; 2); (3; 0)g.
Write down Dom R1 and Range R1 .

2. Let R2 be the relation on Z given by R2 = f(x; y ) : xy 6= 0g. What are Dom R2 and Range R2 ?

3. Let R3 be the relation from Z to Q given by R3 = (x; y ) : x 6= 0


y = x1 . Find Dom R3 and

Range R3 .

Notes.
1. Let R be a relation from A to B . Then Dom R  A and Range R  B .
2. We could say that Dom R is the set of all rst elements in the ordered pairs that belong to R.
Range R is the set of all second elements in the ordered pairs that belong to R.

48

5.2.2 Inverse Relations


De nition 5.2.3. Let R be a relation from A to B . We de ne the inverse relation, R 1, from
to A as R 1 = f(y; x) : (x; y) 2 Rg.

Example. Consider the relation R from A = fa; b; cg to B = f1; 2; 3; 4g given by


R = f(a; 1); (b; 2); (c; 3); (a; 4)g.

The inverse relation, R 1 is simply each ordered pair written \in reverse".
R 1 = f(1; a); (2; b); (3; c); (4; a)g.

Discussion:
True or False?
(i) Every relation has an inverse.

(ii) If R  A  B , then R 1  A  B .

Notes.

1. In e ect, for a relation R from A to B , the inverse relation R 1 can be de ned by interchanging the
elements of all the ordered pairs of R. This turns out to be easier for a nite (listed) relation than
an in nite (given by formula) relation.

2. Dom R 1 = Range R  B .

Range R 1 = Dom R  A.

Exercise:
1. De ne a relation R on N as R = f(x; y ) : y = 2xg.

(i) Write down three elements of R. Write down three elements of R 1 .

(ii) Sketch a graph of R and R 1 on coordinate axes.

(iii) Write down a simple de nition for R 1 .


2. Let S be the identity relation on the set of reals. What is S 1 ?

49

5.3 Equivalence Relations


5.3.1 Properties of Relations
There are three special properties of relations we must study before considering the de nition of an
equivalence relation.

De nition 5.3.1. Let R be a relation on the set A.


1. Re exivity
R is re exive on A if and only if 8x 2 A; (x; x) 2 R.

2. Symmetry

R is symmetric on A if and only if 8x; y 2 A; (x; y ) 2 R =) (y; x) 2 R .

3. Transitivity
R is transitive on A if and only if 8x; y; z 2 A;

(x; y ) 2 R

(y; z ) 2 R =) (x; z ) 2 R :

Examples.
Re exivity: Let R1 be the relation on N de ned by

R1 = f(x; y ) : x is a factor of y g.

For each x

2 N , we know that x is a factor of itself.

Thus, (x; x)

2 R1 and so R1 is

re exive.

Informally, a relation R on a set A is re exive if each element in A is in relation to


itself.

Symmetry: Let R2 be the identity relation on R .

For x; y 2 R , if x = y , then y = x, that is, if (x; y ) 2 R2 , then (y; x) 2 R2 and so R2 is


symmetric.

Informally, a relation R on a set A is symmetric if you can \swap" the ordered pairs
around and still get elements of R.

Transitivity: Let R3 be the relation on Z de ned by

R3 = f(x; y ) : x < y g.

2 R , if x < y and y < z then x < z , that is, if (x; y) 2 R3 and (y; z ) 2 R3 ,
then (x; z ) 2 R3 , and so R3 is transitive.
For x; y; z

Informally, a relation R on a set A is transitive if pairs of elements are \related via" a


third element (x and z related via y .)

50

Discussion:
Which of the three properties do the following relations satisfy?
(i) R1 on N , R1 = f(x; y ) : x is a factor of y g
(ii) R2 , the identity relation on R
(iii) R3 on Z, R3 = f(x; y ) : x < y g
(iv) R4 on R , R4 = f(x; y ) : y = x2 g
(v) R5 on A, the set of all people, R5 = f(x; y ) : x is in the family of y g
(vi) R6 on A, R6 = f(x; y ) : x loves y g

5.3.2 Equivalence Relations


De nition 5.3.2. Let R be a relation on the set A. R is an equivalence relation on A if and only if
R is re exive, symmetric, and transitive on A.

Discussion:
Which of R1 , R2 , R3 , R4 , R5 and R6 from the previous exercise are equivalence relations?

If R is a relation on a set A, you must be able to either prove or disprove the statement
\R is an equivalence relation."

Examples.
1. Let R1 be the identity relation on R . Then R1 is an equivalence relation.

Proof:
Re exive:
Symmetric:

8a 2 R , a = a, that is, (a; a) 2 R1 . Thus, R1 is re exive.


8a; b 2 R , if a = b, then b = a, that is, if (a; b) 2 R1 , then (b; a) 2 R1 .

Thus, R1 is

symmetric.

Transitive:

8a; b; c 2 R , if a = b and b = c, then a = c, that is, if (a; b) 2 R1 and (b; c) 2 R1 , then


(a; c) 2 R1 . Thus, R1 is transitive.

Therefore, R1 is an equivalence relation.

51

2. Let n 2 N . Consider the relation R2 on Z given by

R2 = f(a; b) : a  b(mod n)g:

This relation is \congruence modulo n", as presented in Section 10 on Congruence Arithmetic.


Informally, a

b(mod n) if a and b have the same remainder after dividing by n. Formally,

a  b(mod n) if a

b is a multiple of n, or if a

Eg. 32  11(mod 3); 7  12(mod 5);

b = nk for some k 2 Z.

6  10(mod 2).

R2 is an equivalence relation.

Proof:
Re exive:
Symmetric:
Transitive:

8a 2 Z, a a = 0 = n  0, which implies that a  a(mod n). Thus, R2 is re exive.


8a; b 2 Z, if a  b(mod n), then a b = nk. Therefore, b a = nk = n( k) giving
b  a(mod n). Thus, R2 is symmetric.
8a; b; c 2 Z, if a  b(mod n) and b  c(mod n), then a has the same remainder as
b after division by n and b has the same remainder as c after division by n. We

can conclude that a must have the same remainder as c after division by n, giving
a  c(mod n). Thus, R2 is transitive.

Thus, R2 is an equivalence relation.


3. Let R3 be the relation on Z given by R3 = f(a; b) : ab 6= 0g.

Re exive: We must show 8a 2 Z, a  a 6= 0. But, we note that 0 2 Z and 0  0 = 0. Therefore,


R3 is NOT re exive.

Therefore, R3 is not an equivalence relation.

Discussion:
Consider the relation R3 on Z given by R3 = f(a; b) : ab 6= 0g.
(i) Is R3 symmetric or transitive?
(ii) How can we adjust the relation so it becomes an equivalence relation?

Notes.
1. To prove a relation R is an equivalence relation, you must prove all three properties.
2. To disprove that a relation R is an equivalence relation, you must show that one of the three
properties does not hold, usually by counterexample.
3. Congruence modulo m can be de ned for any natural number, m. Eg. a
equivalence relation.

b(mod 17) is an

52

Example.
Let A = f0; 1; 2g and let R be the relation on A given by R = f(0; 0); (1; 1); (2; 2); (0; 1); (1; 0)g:
Prove R is an equivalence relation on A.

Re exive: For a = 0: (0; 0) 2 R.


For a = 1: (1; 1) 2 R.
For a = 2: (2; 2) 2 R.

So, 8a 2 A, (a; a) 2 R. Thus, R is re exive.

Symmetric: We must check each ordered pair (a; b) 2 R to see if (b; a) is also in the relation.
For (0; 0), (1; 1) and (2; 2) symmetry obviously holds.
For (0; 1), we need to check that (1; 0) 2 R, which it is.
For (1; 0), we need to check that (0; 1) 2 R, which it is.

Thus, R is symmetric.

Transitive: We must check for each pair of elements (a; b); (b; c) 2 R, that (a; c) 2 R also.
(0; 0); (0; 1) 2 R, so (0; 1) should be in R, which it is.
(1; 1); (1; 0) 2 R, so (1; 0) should be in R, which it is.
(0; 1); (1; 1) 2 R, so (0; 1) should be in R, which it is.
(0; 1); (1; 0) 2 R, so (0; 0) should be in R, which it is.
(1; 0); (0; 1) 2 R, so (1; 1) should be in R, which it is.
(1; 0); (0; 0) 2 R, so (1; 0) should be in R, which it is.
As we have checked all possible combinations, R is transitive.
Therefore, R is an equivalence relation.
The fundamental property of equivalence relations which make them important is that each one determines a partition of the set A into a family of disjoint subsets.

De nition 5.3.3. Let R be an equivalence relation on the set A. Then for each a 2 A, we de ne the
equivalence class of

a as

class(a) = fb 2 A : (a; b) 2 Rg.

Example.
Consider the relation R on A in the previous example. For each element in A, we equivalence classes as
follows.
class(0) = fb 2 A : (0; b) 2 Rg = f0; 1g

class(1) = fb 2 A : (1; b) 2 Rg = f1; 0g = class(0)

class(2) = fb 2 A : (2; b) 2 Rg = f2g.

Note. In Section 10, equivalence classes are de ned for congruence modulo n for n 2 N . This is the same
as the de nition of an equivalence class for an equivalence relation given here.

53

Exercise:
1. Let R1 be the identity relation on R . Write down the following equivalence classes.
class(1) =

class( ) =


class 12 =

For any x 2 R , class(x) =


2. Consider the relation R2 on Z given by R2 = f(a; b) : a  b(mod 3)g.
What kind of numbers are in class(2) (otherwise written as [2])?

3. Let R3 on A, the set of all people, be given by R3 = f(a; b) : a is in the family of bg. Who is in
your equivalence class?

5.4 Functions
De nition 5.4.1. If F is a relation from A to B , then we say F is a function from

A to B, if and

only if the domain of F is all of A and for each element x 2 A, there is only one value y
(x; y ) 2 F.

2 B such that

Note. A relation from A to B becomes a function if the domain is all of A and if every rst element is
related to only one second element. This last property is sometimes known as the vertical line test.

Exercise:
Which of the following relations are functions? A sketch might be handy!
(i) R1 on R , R1 = f(x; y ) : y = x2 g

(iii) R3 on A = fx 2 R : x > 0g,

(ii) R2 on R , R2 = f(x; y ) : x = y 2 g

(iv) R4 on R , R4 = f(x; y ) : y = xg

R3 = f(x; y ) : x = y 2 g

54

Most functions you are familiar with are relations on R . This is not always the case.

Examples.
Let A = f2; 4; 6g and let B = f1; 3; 5g. Consider the following relations from A to B .
1. R1 = f(x; y ) : x + 1 = y g = f(2; 3); (4; 5)g.

Dom R1 = f2; 4g 6= A. Thus, R1 is not a function.

2. R2 = f(2; 5); (4; 1); (4; 5); (6; 5)g.

Dom R2 = f2; 4; 6g = A. However, 4 is related to both 1 and 5. Thus, R2 is not a function.

3. R3 = f(2; 5); (4; 1); (6; 5)g.

Dom R3 = A and each rst element only appears once. Thus, R3 is a function.

Questions to ask when identifying functions.


1. In nite case: Is the domain the same as A?
Finite case: Does everything in A appear as a rst element in an ordered pair?
2. In nite case: Graph the relation and apply the vertical line test.
Finite case: List the ordered pairs and make sure each rst element appears only ONCE.

Exercise:
Which of the following are functions?
(i) F1 , the identity relation on A = f1; 5; 10g
(ii) F2 on R , F2 = f(x; y ) : y = 1g
(iii) F3 on Z, F3 = f(x; y ) : y = x + 1g

5.4.1 One-to-One Functions


When we de ned functions, we noted that they satis ed the \vertical line test". In other words, each
element in the domain was related to only one element in the second set B . However, the converse was
not necessarily true; that is, elements in the second position of the ordered pairs could occur more than
once (and be related to more than one element in the domain).

Example.

Consider the relation F on R given by

F = f(x; y ) : y = x2 g.

F is a function, but some of the elements in the y

position are related to two elements in the domain.


-4

-2

x
0

55

Example.

Consider the relation F on R + = fx 2 R : x > 0g given by

F = f(x; y ) : y = x2 g.

-2

In this case, any given element from the Range is related to only

one element from the Domain. We say F is a one-to-one function,

x
0

as each element in both the domain and the range is related to


just one element.

De nition 5.4.2. Let F be a function from A to B . F is one-to-one if and only if

8x1 ; x2 2 A;

(x1 ; y ) = (x2 ; y ) =) x1 = x2 .

Notes.
1. It is often the case that if a function F is one-to-one, it satis es a horizontal line test.
2. Only functions can be one-to-one. If the question is ever asked of a relation, we must rst check
that the relation is, in fact, a function. Then we check for one-to-one.

Exercise:
Which of the following are one-to-one functions?
(i) F1 on A = f1; 2; 3g, F1 = f(1; 2); (2; 3); (3; 1)g
(ii) F2 on A = f1; 2; 3g, F2 = f(1; 2); (2; 1); (3; 1)g
(iii) F3 on Z, F3 = f(x; y ) : y = 2xg
(iv) F4 from Z

f0g to R , F4 = f(x; y) : y =

x2

1g

Note. If you are asked to \give reasons" for why a function is one-to-one, you may simply demonstrate
the horizontal line test or discuss how each \second element" appears only once in an ordered pair.
If you need to show why a function is not one-to-one, all you need to give is a counterexample, that is,
nd an element of the Range that is related to two elements in the Domain.

Example. Let X = f0; 1; 2; 3g and let F be the function from P (X ) to N given by




F = (A; n) : n is the number of elements in the set A .


Then we prove that F is not one-to-one. Let A = f0; 1g and B = f1; 2g. Then (A; 2) 2 F and (B; 2) 2 F,

that is, 2 2 N appears twice. Thus, F is not one-to-one.

56

5.4.2 Onto Functions


When we de ned a function F from A to B , we noted that Dom F = A. In other words, each element
in the set A was related to at least one element in the set B . However, the converse was not necessarily
true; that is, elements in the set B need not have appeared in an ordered pair. In this case, B was not
the Range.

Example.
Let F be the function from A = fx 2 R : 1  x  1g to

R given by F = f(x; y ) : y = 1

x2 g.

Dom F =
-1

Range F =

x
0

This function is clearly not onto as Range F 6= R .


1

However, we can de ne B = fx

Range

2 R : 0  x  1g, and a

\new" function F1 from A to B , given by the same rule as

-1

F, that is, F1 = f(x; y ) : y = 1

x2 g.

The function F1 is onto, as Range F1 = B , that is, every

Domain

element in B appears in an ordered pair.

De nition 5.4.3. Let F be a function from A to B . F is onto if and only if Range F = B , that is,

8y 2 B; 9x 2 A; (x; y) 2 F.
Notes.
1. To show a function F from A to B is onto, you simply need to show that Range F = B , that is, for
each element in B , come up with an element from A that it is related to.
2. To prove that a function F from A to B is not onto, you just need to nd one element from B that
does not appear in any ordered pair.

Exercise:
Determine which of the following functions are onto. Let A = f1; 2; 3; 4; 5g and B = fa; b; c; dg.
(i) F1 from A to B , F1 = f(1; a); (2; c); (3; c); (4; d); (5; d)g

(ii) F2 from A to B , F2 = f(1; a); (2; b); (3; c); (4; d); (5; a)g
(iii) F3 on R , F3 = f(x; y ) : y = 4x

1g

(iv) F4 on Z, F4 = f(x; y ) : y = 4x

1g

57

Note. If you are asked to \give reasons" for why a function is onto, you should either give the range or
give a \formula" for x.
For example, for F3 in the previous exercise,

y+1
2 R , then (x; y) 2 F3 .
4
If you are asked to show why a function is not onto, all you need to give is a counterexample, that is, you

F3 is onto because for each y 2 R , let x =

must give a value of y 2 B for which there is no x 2 A to give (x; y ) 2 F. Sometimes showing there is no
x requires a general proof. In this course, you are only required to give a brief explanation.

For example, for F4 in the previous exercise,

F4 is not onto. For y = 1, we need x 2 Z so that 1 = 4x

1.

That is, we need 2 = 4x or x = 21 .

However, 21

62 Z, so there is no x so that (x; y) 2 F4 .

5.4.3 Inverse Functions


Earlier, we said that every relation has an inverse. This is also the case for functions. However, the
question we need to address in this case is whether the inverse of a function is also a function.

Example.
Consider the function F on the interval [ 1; 1] = fx 2 R : 1  x  1g, given by

F = f(x; y ) : y = 1

x2 g.

Since F is a relation, there is an inverse relation F 1 on [ 1; 1] given by


p
F 1 = f(x; y ) : x = 1 y 2 g.

The question we are interested in now is, \Is F 1 a function?"


In this case, the answer is no.

-1

F 1

For any function, there is an inverse relation, however, this inverse relation is not always a function.
The inverse of a function F will also be a function
when F is one-to-one and onto.

Exercise:
Sketch the function F on A = fx 2 R : x  0g given by F = f(x; y ) : y = x2 g.

Find and sketch F 1 . Is F 1 a function?

58

5.5 Permutations
De nition 5.5.1. Let A be a set and let F be a function on A. Then F is a permutation if F is
one-to-one and onto.

Example.
Let A = f0; 1; 2; 3g. De ne F = f(0; 1); (1; 2); (2; 3); (3; 0)g. F is a permutation. In this case, we can write
F(0) = 1; F(1) = 2; F(2) = 3; F(3) = 0.
We can also use \matrix" representation for permutations. In our example, we can write the function as


0 1 2 3
F=
.
1 2 3 0
There are many more permutations on the set A. For example,




0 1 2 3
0 1 2 3
I=
G=
0 1 2 3
1 0 3 2

H=

0 1 2 3
.
1 3 2 0

There are, in fact, 4! = 4  3  2  1 such permutations. I is known as the identity permutation, where
each element in A is mapped to itself.
In general, if A is a set with n elements, there are n! di erent permutations of A. The set of all
permutations on a set A with n elements is often denoted by Sn .

Exercise:
Let A = f0; 1; 2; 3g and let G, H be permutations on A de ned above. Write down the following.
G(1) =

G(3) =

H(0) =

H(1) =

G(H(0)) =

G(H(1)) =

5.5.1 Cycle Notation


Obviously, the matrix notation for permutations can be confusing when we start to combine permutations.
This notation can be mistaken for \normal" matrix multiplication. Therefore, we introduce what is called
cycle notation for permutations. When we have a permutation on A = f1; 2; 3; 4; 5g given by


1 2 3 4 5
F=
,
2 3 4 5 1
we note that
1 \goes to" 2
2 \goes to" 3
3 \goes to" 4
4 \goes to" 5
and

5 \goes to" 1.

We can write this as a cycle: (1 2 3 4 5). Diagramatically, this is interpreted as

(1 2 3 4 5)

59

The only other convention that needs to be mentioned is that if an element is mapped onto itself, then
it is left out of the cycle.

Examples.
(i) Let A = f0; 1; 2; 3g. F =

(ii) Let A = f1; 2; 3; 4; 5g. G =


(iii) Let A = f1; 2; 3g. I =

0 1 2 3
2 1 0 3


= (0 2).

1 2 3 4 5
2 1 3 5 4

1 2 3
1 2 3

= (1 2)(4 5).

= (1) or (2) or (3) or (1)(2)(3).

Exercise:
Write down the following permutations on A = f0; 1; 2; 3g, using cycle notation.


(i) F =

0 1 2 3
0 3 2 1

(ii) G =

0 1 2 3
1 3 0 2

5.5.2 Composition of Permutations


In traditional Calculus, composition of functions is de ned to be (g f )(x) = g (f (x)). We use this same
idea when discussing composition of permutations. However, we will use di erent (and easier) notation.

Exercise:
Let A = f1; 2; 3; 4g and let F = (1 2 3 4), G = (1 2)(3 4) be permutations on A. Write down the
following.
G(F(1)) =

G(F(2)) =

G(F(3))

G(F(4)) =

In the previous exercise, we can see that G F = (2 4). This result could have been achieved simply by
writing F followed by G, then following the \behaviour" of each element.
G F = FG = (1 2 3 4)(1 2)(3 4)
1 \goes to" 2 in the rst bracket, then 2 \goes to" 1 in the second. Thus, 1 \goes to" 1 overall.
2 \goes to" 3 in the rst bracket, then 3 \goes to" 4 in the third. Thus, 2 \goes to" 4 overall.
3 \goes to" 4 in the rst bracket, then 4 \goes to" 3 in the third. Thus, 3 \goes to" 3 overall.
4 \goes to" 1 in the rst bracket, then 1 \goes to" 2 in the second. Thus, 4 \goes to" 2 overall.
These calculations give G F = FG = (2 4) as in the exercise.

60

Exercise:
Calculate the following compositions of permutations on A = f0; 1; 2; 3g.
(i) (1 2)(1 0 2) =
(ii) (0 1)(2 3)(0 1 2 3) =
(iii) (1 2 3)(3 2) =

5.5.3 Inverse Permutations


As permutations are essentially relations, they have inverses. In fact, permutations are one-to-one and
onto functions, and therefore, their inverses are also functions which are one-to-one and onto. Thus, the
inverse of a permutation is also a permutation.
Recall that to nd the inverse of a relation, we simply reverse the ordered pairs. For permutations, the
idea is identical, but the work involved is trivial!

Example.
Let A = f1; 2; 3; 4g and let F = (1 2 4 3). In F,

1 \goes to" 2. Thus, in F 1 , 2 \goes to" 1.


2 \goes to" 4. Thus, in F 1 , 4 \goes to" 2.
3 \goes to" 1. Thus, in F 1 , 1 \goes to" 3.
4 \goes to" 3. Thus, in F 1 , 3 \goes to" 4.

Putting all these calculations together, we have F 1 = (1 2 4 3) 1 = (1 3 4 2) = (3 4 2 1).

Note that F 1 is just F written in the reverse order!!!

Exercise:
Let A = f0; 1; 2; 3g. Write down the following.
(i) (1 2 3) 1

(ii) (0 3 1) 1