0 Bewertungen0% fanden dieses Dokument nützlich (0 Abstimmungen)

49 Ansichten61 Seiten© Attribution Non-Commercial (BY-NC)

PDF, TXT oder online auf Scribd lesen

Attribution Non-Commercial (BY-NC)

Als PDF, TXT **herunterladen** oder online auf Scribd lesen

0 Bewertungen0% fanden dieses Dokument nützlich (0 Abstimmungen)

49 Ansichten61 SeitenAttribution Non-Commercial (BY-NC)

Als PDF, TXT **herunterladen** oder online auf Scribd lesen

Sie sind auf Seite 1von 61

Logic Strand

Section

Topic

Page

Introduction

Logic

Predicate Logic

19

Methods of Proof

23

Set Theory

32

45

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?

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

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 dening symbols and establishing `rules'.

Roughly speaking, in arithmetic an

operation

numbers, like addition (+) or multiplication (). In logic, we form new statements by combining short

statements using connectives, like the words and, or.

Examples.

We will now turn our attention to more formal denitions 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.

Denition 1.1.1. A

statement

or

proposition

Exercise:

Which of the following are statements?

(i) 2 + 3 = 5

(iii) 2 + 3 = 6

(x) x < 2

(iv) Is it raining?

(xi) 2 = =

(v) Go away!

(xii) x + y = y + x

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.

Example.

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.

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

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

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 dened 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

Examples.

If P is:

It is raining outside.

then P is:

or

If Q is:

then Q is:

x > 2 or x < 2

(x > 2 or x < 2)

Can this be simplied?

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:

P:

Let P be a statement.

P

T

F

Notes.

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:

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

and not (P

P _ Q means ( P ) _ Q

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:

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 simplied?

Exercise:

1. Write the following statement using the connective _.

I am catching the bus or train home.

(i) P : x 0

Q: x 1

_ Q.

_ Q:

Q: x is prime.

_ Q:

_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

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

(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^x> 1

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:

Q: x is prime.

^ Q:

^Q

Exercise:

Write down the truth value of the following statements.

(i) 3 < 5

6>

(ii) 3 > 5

6>

(iii) 1 = 2

4=7

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.

main connective|the

P _

main connective

is the one

P

(P

Q) ^

(P ^

Q)

(P

_ Q) ^ (P ^ Q)

(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

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:

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

Exercise:

1. Write the following statement using connectives.

If x2 is 4, then x is plus or minus 2.

(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.

Q is True: I go home.

Q is True: I go home.

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

Note.

Truth Table for Conditional:

P =) Q

Notes.

1. There are a number of dierent ways to interpret P =) Q. Two such interpretations are

(i) P =) Q is true if there is a valid argument from P to Q;

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

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 )

1.2.6 Biconditional: P

() Q

()

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

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.

Exercise:

1. Write the following statement using connectives.

Michael is a bachelor if and only if Michael is male and never married.

(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:

()

Exercise:

Write down the truth value of the following statements.

(i) x2 = 1

()

(x = 1

()

x = 1)

it is raining.

()

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^

Q)^

(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

Denition 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

_ 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.

Denition 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

^ P.

^ P

T

F

^ P

Denition 1.3.3. Any statement that is not a tautology and not a contradiction is

intermediate

contingent

or

Example

Exercise:

Determine from its truth table whether the following statement is a tautology, contradiction or

contingent statement.

Note.

( P ^

Q)

13

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 dierent combinations of truth values (23 = 8). If you were

asked whether the statement (P

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

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)

(P

and R ^ S must be false.

(P

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

T T T F F F F

(P =) Q)

(ii)

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

W orking

Discussion

(P =) Q)

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

and the second must be false.

(P =) Q)

and R must be false.

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

T

T

F

F T F F

must be true.

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

T T

T

T F

F T F F

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

Denition 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.

()

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

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

statement, the result is still a tautology.

.

Example

_ P

Q_

Q

(P ^ Q) =)

_

every

(P

^ Q) =)

Recall:

.

Example

1

sin2 x cos2 x

=

cos x

cos x

= cos x

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

.

Examples

P _

P =) Q

P _

Q.

S _

T.

S =) T

we have the tautology

T =) ( S

T ).

16

Discussion:

Is T

_ ( S _

T ) a tautology?

Notes.

equivalent forms. This is particularly useful when nding new tautologies.

2. As with the rule of substitution, we will use Substitution of Equivalence without specic reference.

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 =)

P P

5. DeMorgan's Laws:

(P _

(P ^

Q)

Q)

( P ^ Q)

( P _ Q)

() Q) (P =) Q) ^

(P =) Q) ( P _ Q)

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

(P =) Q) (P ^ Q)

(P

(Q =) P )

R)

R)

17

Notes.

2. Each of the logical equivalences has a corresponding tautology. These will not be listed specically,

but will be used in future work.

Eg.

(P _

Q) ( P

(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 ).

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.

(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.

Exercise:

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

P

(P

()

Q)

() ( P () Q)

()

Q)

( P () Q).

Notes.

2. This result and the equivalences in Theorem 1.4.2 parts 3, 4, 5 and 6 provide the logical workings

of many dierent methods of proof. We will study these later.

19

Section 2.

Predicate Logic

Discussion:

In Maths we use variables (usually ranging over numbers) in various ways. How does x dier in what

it represents in the following statements?

(i) x2 = 0

(ii) x > 2

(iii) x + 0 = x

(iv) x2 + 1 = 0

Denition 2.1.1.

statement when specic 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 quantiers.

8x

read

or for each x

9x

read

or for some x

8 is called the Universal quantier. 9 is called the Existential quantier.

In this section of work on Logic, we are going to use these quantiers more as short hand abbre-

Note.

viations.

Returning to the statements in the Discussion, we can use the quantier 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.

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

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

the simpler notation.

20

Exercise:

1. Write each of the following statements using the universal quantier.

(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 quantier.

(i) There exists a real number whose square is negative.

(ii) Some dogs are vegetarians.

Denitions 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)".

D; Q x

Important:

A universal statement is dened to be true if and only if Q(x) is true for every x in D.

A universal statement is dened 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.

least one

x in D.

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

Aside:

Real numbers are further classied 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

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 quantiers. Determine whether each statement is true or

false.

(i) Every integer is a rational number.

(i)

8x 2 N ; px 2 N .

(ii)

9x 2 Z; x1 62 Q .

(iii)

8 person x; 9 person y;

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

Examples.

S likes y .

8 person a; 8 person b;

a is equal to b.

\Lazy" way:

(8n 2 N ;

n is even)

Discussion:

What is the denition 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)

22

Exercise:

Express the following laws of arithmetic using quantiers.

(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.

(ii) Determine whether each statement is true or false.

(iii) Is the order in which 8 and 9 appear important?

This section is covered in the Discovery Class. We will see how to nd the negation of statements that

include quantiers. We will often refer to the logical equivalences from Theorem 1.4.2.

23

Section 3.

Methods of 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 denition).

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

you want to prove

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

\If

>

0"

is even. Further, you can use the

\denition" of an even natural number, and write the assumptions as follows.

Let x 2 R , and

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

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

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

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.

, then

that if

(P =)

) =)

implies

, we can see

Discussion:

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

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

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.

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

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 =)

=)

the most common method of performing proofs of such statements. The Law of Syllogism is a kind of

transitivity that can apply to =).

until Pn =)

P1

, P1 =)

, P2 =)

P2

P3

Example.

We wish to prove that for n 2 N , if

is even, then

is even =)

Proof:

p

=)

= 2p

=)

= 4p2

=)

= 2(2p2 )

=)

; n

2

is even.

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 simplied 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!!

Before we proceed to techniques of proving statements, it is important to make the following notes about

proving statements that involve 8 and 9.

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.

Consider 14 = 7 + 7 [7 is 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

27

Most mathematical statements to be proved are

x

( ). To prove this

D; P x

(i) Method of Exhaustion

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

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?

To disprove the statement

9 2

x

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

To disprove the statement

8 2

x

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 satises

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.

P x

28

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 quantiers, 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.

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:

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 know that (x

Thus, x2

2x + 1 0

=)

2x

=)

+ 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."

By Pythagoras:

Backward Steps:

Full Proof:

XY Z

is isosceles if

30

Recall the following logical equivalence from Theorem 1.4.2.

(P =)

This equivalence indicates that if

=)

(

=) P )

=)

. For this

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 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

be even.

Assume

is an odd number.

= 2p + 1 for some p 2 N .

Thus, n2 is odd.

Show

Exercise:

Complete the following proof by contradiction that if

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

Simplifying,

Therefore, if

31

Discussion:

How would you go about proving the following statement?

If

6= 0 or 6= 0, then

y

proof by cases.

+ y 2 > 0.

(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

32

Section 4.

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

Although we accept the concepts of set and element as dened, 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

and

33

3. fx : x 2 B ^

P x

( )

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)

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 =

Denition 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 dene the empty set as

= fx 2 N : x 6= xg.

4.2 Subsets

Denition 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

34

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

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 2 f 2 N :

x

Eg

= 1g

Proof:

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

Note

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

Denition 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.

35

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 denition of set equality.

Axiom of Specication. 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

()

P x

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

).

Note

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

(i)

and

(ii)

The Axiom of Specication 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.

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 dened by equivalent statements

.

Example

() ( = 1 _ =

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

We know that x2 = 1

f 2R:

x

Note

A

= fx 2 U : x = a1

= a2

= 1g = f1; 1g.

:::

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

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 innite set is dened

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 dene 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

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

Before we dene 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 dened 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

. In other words,

()

to set equality.

A; B; C

2 P(

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

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

A

38

Notes

1.

2.

= fx 2 U : x 62 Ag.

and Ac are also used for A in some books.

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 <

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)

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

and

be subsets of a universe

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

^ 2 g.

x

A and B,

Exercise:

1. Let U = R . Write down A \ B for the following sets.

(i)

(ii)

(iii)

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

There is one further set operation which can be dened with complements and intersection, but warrants

a mention in its own accord.

Denition 4.4.4. Let A and B be subsets of a universe U . Then the dierence of A and B , denoted

A

, is given by A

= fx 2 U : x 2 A

^ 62 g.

x

39

Notes

1. The dierence of A

2. Since A U and B U , A

U

B in A.

= fx 2 U : x 2 U

^ 62 g

x

= fx 2 U : x 62 B g

= B:

4. Using Denitions 4.4.1 and 4.4.3, we can simplify the denition 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:

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

Note

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)

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 denitions we have presented so far.

The proofs of all these rules involve using the denitions 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

(A B

is as

(A B )

) =)

(B C ) =) (A C ).

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

1. Facts about Complementation:

2. Properties of and U :

A

A

A

U

=A

B

B

()

= \

B

=

=U

(A C

(A B

^

^

B

A

() ( [ )

() ( \

A

\ =

\=

\ =

U

A

A

A

[=

[ =

[ =

41

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.

).

We begin by letting x 2 A, that is, we take x to be an arbitrary element of A. Using the denitions, 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;

This method can be used to prove set equalities by using the denition

A

then showing

()

=B

(A B

Discussion:

When using a `typical element' argument to prove A B , what happens if there are no elements to

pick, ie, if A = ?

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

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

things clear.

Example.

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

2 [ .

Let 2 . (This means we \know" 2 .)

By denition, 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

Proof:

=)

=)

x

x

Therefore, A A [ B .

2 _ 2

2 [ .

A

Example.

() [

A

= B.

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

Let x 2 A [ B , then by denition,

_ 2

x

(x 2 A

_ 2

x

) =)

Case 1:

Case 2:

Thus, A [ B B .

Let x 2 B . Then we have

x

=)

=)

x

x

Therefore, B A [ B .

2 _ 2

2 [ .

A

A

= B.

Let x 2 A. Then we have

x

=)

=)

=)

Therefore, A B .

x

x

x

2 _ 2

2 [ by denition

2 as [ = .

A

A

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 dening the sets (A \ B ) and A [ B are

equivalent.

2 ( \ ) ( 2 \ ) by denition of complement

2 [ 2 _ 2 by denition of [

( 2 ) _ ( 2 )

( 2 ^ 2 ) by Logic (DeMorgan's in Theorem 1.4.2)

( 2 \ ) by denition of \

2 ( \ ).

Therefore, ( \ ) = [ .

x

.

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 denition

x

(B

= (A

A

C

) = (A

()

(x 2 A

^ 62

x

).

= (A \ B )

44

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

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 .

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 Specication, satises the statement \ 62 ", ie, 62 . This is

Now, let

clearly a contradiction.

If Z

62

, then as Z

Z

()

62

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

62

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

formally dening \classes" and stating that there is a `class' that contains all sets...but that is a matter

for another subject!

45

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

Denition 5.2.1.

A to B if

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

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 .

1R1

2:1R2:2

x = y g.

( 3; 3) 2 R

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?

46

xz = y g.

(2; 4) 2 S

(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 dierence 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 dened by a \rule". Sometimes relations are simply dened 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

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

and

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

Denition 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 ?

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

Denition 5.2.3. Let R be a relation from A to B . We dene the inverse relation, R 1, from

to A as R 1 = f(y; x) : (x; y) 2 Rg.

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 eect, for a relation R from A to B , the inverse relation R 1 can be dened by interchanging the

elements of all the ordered pairs of R. This turns out to be easier for a nite (listed) relation than

an innite (given by formula) relation.

2. Dom R 1 = Range R B .

Range R 1 = Dom R A.

Exercise:

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

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

49

5.3.1 Properties of Relations

There are three special properties of relations we must study before considering the denition of an

equivalence relation.

1. Re exivity

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

2. Symmetry

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 dened by

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

For each x

Thus, (x; x)

2 R1 and so R1 is

re exive.

itself.

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.

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

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

Denition 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; 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:

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

51

Informally, a

a b(mod n) if a

b is a multiple of n, or if a

b = nk for some k 2 Z.

6 10(mod 2).

R2 is an equivalence relation.

Proof:

Re
exive:

Symmetric:

Transitive:

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.

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

R3 is NOT re exive.

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 dened 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.

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

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

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.

Denition 5.3.3. Let R be an equivalence relation on the set A. Then for each a 2 A, we dene the

equivalence class of

a as

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

Note. In Section 10, equivalence classes are dened for congruence modulo n for n 2 N . This is the same

as the denition 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 =

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

Denition 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

(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 R3 = A and each rst element only appears once. Thus, R3 is a function.

1. Innite case: Is the domain the same as A?

Finite case: Does everything in A appear as a rst element in an ordered pair?

2. Innite 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

When we dened functions, we noted that they satised 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.

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

-4

-2

x

0

55

Example.

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

-2

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

x

0

just one element.

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 satises 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.

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,

56

When we dened 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

1

However, we can dene B = fx

Range

2 R : 0 x 1g, and a

-1

x2 g.

Domain

Denition 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

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.

1.

However, 21

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.

p

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

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.

58

5.5 Permutations

Denition 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. Dene 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! dierent 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 dened above. Write down the following.

G(1) =

G(3) =

H(0) =

H(1) =

G(H(0)) =

G(H(1)) =

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.

(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 =

(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).

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

In traditional Calculus, composition of functions is dened to be (g f )(x) = g (f (x)). We use this same

idea when discussing composition of permutations. However, we will use dierent (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) =

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,

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.

Exercise:

Let A = f0; 1; 2; 3g. Write down the following.

(i) (1 2 3) 1

(ii) (0 3 1) 1