0% found this document useful (0 votes)
18 views132 pages

COS1501 Notes Completed

Uploaded by

Mduduzi Nzuza
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views132 pages

COS1501 Notes Completed

Uploaded by

Mduduzi Nzuza
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 132

COS1501 Notes

September 7, 2022
Contents

1 Number Systems 7
1.1 Number Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
1.1.1 Commutativity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
1.1.2 Associativity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
1.1.3 Distributivity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
1.1.4 Multiplicative Identity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
1.1.5 Additive Identity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
1.1.6 Linearity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
1.1.7 Monotocity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
1.1.8 Transitivity of =, < and > . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
1.1.9 Absence of Zero Divisors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
1.1.10 Additive Inverses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8

2 Rational and Real Numbers 11


2.1 Rational Numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
2.1.1 Multiplicative Inverses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
2.2 Real Numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
2.3 Number Systems Heirarchy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11

3 Sets 15
3.1 Subset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
3.1.1 Proper Subset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
3.2 Creating Sets From Other Sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
3.2.1 Set Union . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
3.2.2 Set Intersection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
3.2.3 Set Difference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
3.2.4 Set Complement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
3.2.5 Symmetric Set Difference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
3.3 Other Terms Significant For Sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
3.3.1 The Empty Set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
3.3.2 Set Disjointness . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
3.3.3 Set Cardinality . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
3.3.4 Power Sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19

3
Contents CONTENTS

4 Proofs Involving Sets 23


4.1 Venn Diagrams . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
4.1.1 Set Equality . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
4.1.2 Drawing Complex Venn Diagrams . . . . . . . . . . . . . . . . . . . . . . . . . . 23
4.2 Proofs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
4.3 The Inclusion Exclusion Principle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
4.3.1 Applying the principle to Venn Diagrams . . . . . . . . . . . . . . . . . . . . . . 32
4.4 Proofs on Specific Sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37

5 Relations 45
5.1 Ordered Pairs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
5.2 Cartesian Product . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
5.3 Relation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
5.3.1 Domain, Range and Codomain . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
5.3.2 Binary Relation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
5.4 Properties of Relations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
5.4.1 Reflexivity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
5.4.2 Irreflexivity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
5.4.3 Symmetry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
5.4.4 Antisymmetry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
5.4.5 Transitivity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
5.4.6 Trichotomy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
5.4.7 Inverse Relation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
5.4.8 Relation Composition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50

6 Special Kinds of Relation 55


6.1 Order Relations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
6.1.1 Weak Partial Order . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
6.1.2 Strict Partial Order . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
6.1.3 A Total (or Linear) Order Relation . . . . . . . . . . . . . . . . . . . . . . . . . 60
6.2 Equivalence Relation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
6.2.1 Equivalence Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
6.2.2 Partitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
6.3 Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
6.3.1 Functional Relation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
6.3.2 Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74

7 More About Functions 83


7.1 The Range of a Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
7.1.1 Determining the Range of a Function . . . . . . . . . . . . . . . . . . . . . . . . 83
7.2 Surjectivity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
7.3 Injectivity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
7.3.1 Determining Whether an Abstract Function is Injective . . . . . . . . . . . . . . 87
7.4 Composition of Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
7.5 Bijective and Invertible Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
7.5.1 Bijective Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
7.5.2 Invertible Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
7.6 Identity Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93

4
CONTENTS Contents

8 Operations 97
8.1 Binary Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
8.1.1 Finite and Infinite Sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
8.1.2 Tables For Binary Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
8.2 Properties of Binary Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
8.2.1 Commutative Binary Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
8.2.2 Associative Binary Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
8.2.3 Identity Element of a Binary Operation . . . . . . . . . . . . . . . . . . . . . . . 100
8.3 Operations on Vectors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
8.3.1 Vector . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
8.3.2 Vector Sum . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
8.3.3 Scalar-Vector Product . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
8.3.4 Dot Product . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
8.4 Operations on Matrices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
8.4.1 Matrix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
8.4.2 Matrix Addition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
8.4.3 Scalar-Matrix Multiplication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
8.4.4 Matrix Multiplication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
8.4.5 Identity Matrix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107

9 Logic: Truth Tables 111


9.1 Declarative Statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
9.2 Combining Statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
9.2.1 Conjunction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
9.2.2 Disjunction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
9.2.3 Negation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
9.2.4 Biconditional . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
9.2.5 Conditional . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
9.3 Constructing Truth Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
9.4 Relationships Between Statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
9.4.1 Tautology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
9.4.2 Contradiction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
9.4.3 Logical Equivalence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117

10 Logic: Predicates and Proof Strategies 121


10.1 Quantifiers and Predicates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121
10.1.1 Universal Quantifier . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121
10.1.2 Existential Quantifier . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122
10.1.3 Predicate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123
10.1.4 Negation of Quantified Statements . . . . . . . . . . . . . . . . . . . . . . . . . 123
10.2 Proof Strategies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125
10.2.1 Direct Proof . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125
10.2.2 Proof By Contradiction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126
10.2.3 Proof By Contrapositive . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126
10.2.4 Proofs Involving Quantifiers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127
10.2.5 Vacuous Proofs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128

5
Unit 1

Number Systems

1.1 Number Properties


1.1.1 Commutativity
For all integers 𝑚 and 𝑛, addition and multiplication are commutative.

𝑚+𝑛=𝑛+𝑚 addition
𝑚𝑛 = 𝑛𝑚 multiplication

1.1.2 Associativity
For all integers 𝑚, 𝑛 and 𝑘, addition and multiplication are associaive.

𝑚 + ( 𝑛 + 𝑘 ) = ( 𝑚 + 𝑛) + 𝑘 addition
( 𝑚) ( 𝑛𝑘) = ( 𝑚𝑛) 𝑘 multiplication

1.1.3 Distributivity
For all integers 𝑚, 𝑛 and 𝑘, multiplication is distributive over addition.

𝑚 ( 𝑛 + 𝑘) = 𝑚𝑛 + 𝑚𝑘
( 𝑛 + 𝑘) 𝑚 = 𝑚 ( 𝑛 + 𝑘)
= 𝑚𝑛 + 𝑚𝑘
= 𝑛𝑚 + 𝑘𝑚

1.1.4 Multiplicative Identity


There exists an integer (1) that has the property that for every integer 𝑚, 𝑚 · 1 = 𝑚.

1.1.5 Additive Identity


There exists an integer (0) that has the property that for every integer 𝑚, 𝑚 + 0 = 𝑚.

7
1.1. Number Properties UNIT 1. NUMBER SYSTEMS

1.1.6 Linearity
For all integers 𝑚 and 𝑛, exactly one of the following is true:

𝑚<𝑛
𝑚=𝑛
𝑚>𝑛

1.1.7 Monotocity
For all integers 𝑚, 𝑛 and 𝑘,
If 𝑚 = 𝑛, then 𝑚 + 𝑘 = 𝑛 + 𝑘 and 𝑚𝑘 = 𝑛𝑘.
If 𝑚 < 𝑛, then 𝑚 + 𝑘 < 𝑛 + 𝑘.
If 𝑘 > 0, then 𝑚𝑘 < 𝑛𝑘.
If 𝑘 < 0, then 𝑚𝑘 < 𝑛𝑘.

1.1.8 Transitivity of =, < and >


For all integers 𝑚, 𝑛 and 𝑘,
If 𝑚 = 𝑛 and 𝑛 = 𝑘, then 𝑚 = 𝑘.
If 𝑚 < 𝑛 and 𝑛 < 𝑘, then 𝑚 < 𝑘.
If 𝑚 > 𝑛 and 𝑛 > 𝑘, then 𝑚 > 𝑘.

1.1.9 Absence of Zero Divisors


For all integers 𝑚 and 𝑛,
𝑚𝑛 = 0 if and only if 𝑚 = 0 or 𝑛 = 0.

1.1.10 Additive Inverses


For every integer 𝑚 there exists an integer 𝑛 such that

𝑚+𝑛=0

8
UNIT 1. NUMBER SYSTEMS 1.1. Number Properties

Self Assessment Exercise (Activity 1.11)

1. Factorise the following expressions:

(a) 𝑥 2 + 6 𝑥 + 9 = ( 𝑥 + 3) 2
(b) 𝑥 2 − 𝑥 − 2 = ( 𝑥 − 2) ( 𝑥 + 1)
(c) 𝑥 2 − 5𝑥 + 6 = ( 𝑥 − 3) ( 𝑥 − 2)
(d) 𝑥 2 + 4 𝑥 − 12 = ( 𝑥 + 6) ( 𝑥 − 2)
2. Solve 𝒙 2 − 4𝒙 + 4 = 0 by factorising:

𝑥 2 − 4𝑥 + 4 = 0
⇒ ( 𝑥 − 2) ( 𝑥 − 2) = 0
⇒ 𝑥=2

3. Complete the square to solve 𝒙 2 − 4𝒙 = 12

𝑥 2 − 4 𝑥 = 12
⇒ 𝑥 2 − 4 𝑥 + 4 = 12 + 4
⇒ ( 𝑥 − 2) 2 = 16
⇒ 𝑥 − 2 = ±4

𝑥−2=4 𝑥 − 2 = −4
⇒ 𝑥=6 or 𝑥 = −2

4. Is 21 a prime number?
No, as 3 and 7 are both factors of 21.
5. What is the value of 5! (5 factorial)?
5! = 5 × 4 × 3 × 2 × 1 = 120
Unit 2

Rational and Real Numbers

2.1 Rational Numbers


Rational Numbers
𝑝
Denoted Q, the set of all numbers in the form 𝑞
where 𝑝 and 𝑞 are integers are 𝑞 is not zero.

2.1.1 Multiplicative Inverses

Multiplicative Inverse

For every non-zero rational number 𝑥 there exists a rational number called the multiplicative
1
 1
inverse, denoted 𝑥 such that 𝑥 𝑥 = 1.
This can also be written:
For every non-zero rational number 𝑥 there exists a rational number 𝑦 such that 𝑥 𝑦 = 1.

2.2 Real Numbers


Real Numbers
Denoted R, the combination of the rational and irrational numbers.

2.3 Number Systems Heirarchy

C > R > Q ′ > Q > Z > Z ≥ > Z+

11
2.3. Number Systems Heirarchy UNIT 2. RATIONAL AND REAL NUMBERS

Self-Assessment Exercise (Activity 2.8)

1. Define the words "even" and "odd" for positive integers


An integer is even if it is a multiple of 2. An integer is odd if it is not even.
2. Is it the case that 𝒎 + (𝒏 · 𝒌) = (𝒎 + 𝒏) (𝒎 + 𝒌) for all positive integers 𝒎, 𝒏 and 𝒌?
No. In order to show this, use a counterexample.

Counterexample. Let 𝑚 = 1, 𝑛 = 2, 𝑘 = 3. Then



𝑚 + ( 𝑛 · 𝑘) = 1 + (2) (3)
=1+6
=7
( 𝑚 + 𝑛) ( 𝑚 + 𝑘) = (1 + 2) (1 + 3)
= (3) (4)
= 12
7 ≠ 12
∴ 𝑚 + ( 𝑛 · 𝑘 ) ≠ ( 𝑚 + 𝑛) ( 𝑚 + 𝑘 ) ■

3. Are there any even prime numbers besides 2?


No.

Proof. Let 𝑚 be an even number that is not 2.


Then 𝑚 = 2𝑘 where 𝑘 is some real number.
Therefore 2 and 𝑘 are factors of 𝑚.
Therefore 𝑚 is not a prime number. ■

4. If 𝒎 and 𝒏 are even, is 𝒎 + 𝒏 even?


Yes.

Proof. Let 𝑚 and 𝑛 be even numbers.


Then 𝑚 = 2 𝑗, 𝑛 = 2𝑘, where 𝑗 and 𝑘 are some real numbers.
Then

𝑚 + 𝑛 = 2 𝑗 + 2𝑘
= 2( 𝑗 + 𝑘)

As the sum of the two numbers is a multiple of 2, 𝑚 + 𝑛 is even. ■

12
UNIT 2. RATIONAL AND REAL NUMBERS 2.3. Number Systems Heirarchy

5. If 𝒎 and 𝒏 are odd, is 𝒎 · 𝒏 odd?


Yes.

Proof. Let 𝑚 and 𝑛 be odd numbers.


Then 𝑚 = 2 𝑗 + 1, 𝑛 = 2𝑘 + 1, where 𝑗 and 𝑘 are some real numbers. Then

𝑚 · 𝑛 = (2 𝑗 + 1) (2𝑘 + 1)
= 4 𝑗𝑘 + 2𝑘 + 2 𝑗 + 1
= 2(2 𝑗𝑘 + 𝑘 + 𝑗) + 1

∴ 𝑚 · 𝑛 is odd. ■
Unit 3

Sets

3.1 Subset
Subset
If 𝐴 and 𝐵 are sets from a universal set 𝑈 , then 𝐴 is a subset of 𝐵 if and only if every element of
𝐴 is also an element of 𝐵.
Can be abbreviated 𝐴 ⊆ 𝐵

3.1.1 Proper Subset

Proper Subset

If 𝐶 and 𝐷 are sets from a universal set 𝑈 , and every element of 𝐶 is an element of 𝐷, but 𝐷 has
some elements that are not in 𝐶 , then 𝐶 is a proper subset of 𝐷.
Can be abbreviated 𝐶 ⊂ 𝐷.

Confusion Between Element and Subset


Note that ∈ and ⊂ are not the same. This becomes significant when dealing with power sets.

15
3.2. Creating Sets From Other Sets UNIT 3. SETS

3.2 Creating Sets From Other Sets


For examples, the following sets will be used:

𝑈 = {1, 2, 3, 4, 5} 𝐴 = {1, 2, 3} 𝐵 = {2, 3, 4} 𝐶 = {4, 5}

3.2.1 Set Union (OR)


Set Union
The union of sets 𝐴 and 𝐵 is written 𝐴 ∪ 𝐵, and is the set of all elements that belong to 𝐴 or 𝐵
(or both).


𝐴 ∪ 𝐵 = 𝑥 | 𝑥 ∈ 𝐴 or 𝑥 ∈ 𝐵

𝐴 𝐵

Example 𝐴 ∪ 𝐵 = {1, 2, 3} ∪ {2, 3, 4}


= {1, 2, 3, 4}

3.2.2 Set Intersection (AND)


Set Intersection
The intersection of sets 𝐴 and 𝐵 is written 𝐴 ∩ 𝐵, and is the set of all elements that belong to 𝐴
and 𝐵 at the same time.


𝐴 ∩ 𝐵 = 𝑥 | 𝑥 ∈ 𝐴 and 𝑥 ∈ 𝐵

𝐴 𝐵

Example 𝐴 ∩ 𝐵 = {1, 2, 3} ∩ {2, 3, 4}


= {2, 3}

16
UNIT 3. SETS 3.2. Creating Sets From Other Sets

3.2.3 Set Difference (MINUS)

Set Difference
The difference between sets 𝐴 and 𝐵, also called the complement of 𝑩 relative to 𝑨, is written
𝐴 − 𝐵, and is the set of elements that are in 𝐴 that are not in 𝐵.


𝐴 − 𝐵 = 𝑥 | 𝑥 ∈ 𝐴 and 𝑥 ∉ 𝐵

𝐴 𝐵

Example 𝐴 − 𝐵 = {1, 2, 3} − {2, 3, 4}


= {1}

3.2.4 Set Complement (NOT)

Set Complement

Let 𝐴 be a subset of a universal set 𝑈 . Then the complement of 𝐴, written 𝐴′ is the set of all
elements that belong to 𝑈 but do not belong to 𝐴.

𝐴′ = 𝑥 | 𝑥 ∉ 𝐴


𝐴 𝐵

Example 𝐴′ = 𝑈 − 𝐴
= {1, 2, 3, 4, 5} − {1, 2, 3}
= {4, 5}

17
3.3. Other Terms Significant For Sets UNIT 3. SETS

3.2.5 Symmetric Set Difference (XOR)

Symmetric Set Difference

The symmetric difference between two sets 𝐴 and 𝐵, written 𝐴 + 𝐵, is the set of elements that
belong to 𝐴 or to 𝐵, but not to both.


𝐴 + 𝐵 = 𝑥 | 𝑥 ∈ 𝐴 or 𝑥 ∈ 𝐵, but not both

𝐴 𝐵

Example 𝐴 + 𝐵 = {1, 2, 3} + {2, 3, 4}


= {1, 4}

3.3 Other Terms Significant For Sets


3.3.1 The Empty Set

Empty Set

The set that contains no elements is called the empty set, and is written ∅.

3.3.2 Set Disjointness

Disjointness

Two sets 𝐴 and 𝐵 are called disjoint if they have no elements in common. In other words,

𝐴∩𝐵=∅

Example 𝐴 ∩ 𝐶 = {1, 2, 3} ∩ {4, 5}


=∅

18
UNIT 3. SETS 3.3. Other Terms Significant For Sets

3.3.3 Set Cardinality

Cardinality

Let 𝐴 be a set with 𝑘 distinct elements that can be counted. The number of elements 𝑘 in 𝐴 is
called the cardinality of the set. It can be written as 𝑛 ( 𝐴) or | 𝐴 |.

Example | 𝐴 | = {1, 2, 3}
=3

3.3.4 Power Sets


Power Set
Given a set 𝐴 with 𝑛 distinct elements, the power set of 𝐴, written P ( 𝐴), is the set that has as
its members all subsets of 𝐴.

Every Element of a Power Set is a Set

It is important to note that every element of a power set is a set!


That means if 𝐵 is a subset of 𝐴, then 𝐵 is an element of P ( 𝐴), i.e. 𝐵 ∈ P ( 𝐴).
However 𝐵 is not a subset of P ( 𝐴), i.e. 𝐵 ⊈ P ( 𝐴)! A set containing 𝐵, i.e. { 𝐵 } would be a subset
of P ( 𝐴).


Example P (𝐶 ) = P {4, 5}

= ∅, {4}, {5}, {4, 5}

The cardinality of a power set P ( 𝐴) is 2𝑛 where 𝑛 is the number of elements in the set 𝐴.


Example P ( 𝐴) = P {1, 2, 3}
= 23
=8

19
3.3. Other Terms Significant For Sets UNIT 3. SETS

Self Assessment Exercise 3.6

1. 𝑈 = {1, 2, 3, 4, 5} 𝐴 = {1, 2, 3} 𝐵 = {3, 4, 5}

(a) 𝐴 ∪ 𝐵 = {1, 2, 3} ∪ {3, 4, 5} (c) 𝐴 − 𝐵 = {1, 2, 3} − {3, 4, 5}


= {1, 2, 3, 4, 5} = {1, 2}
𝐵 ∪ 𝐴 = {3, 4, 5} ∪ {1, 2, 3} 𝐵 − 𝐴 = {3, 4, 5} − {1, 2, 3}
= {1, 2, 3, 4, 5} = {4, 5}
(b) 𝐴 ∩ 𝐵 = {1, 2, 3} ∩ {3, 4, 5} (d) 𝐴 + 𝐵 = {1, 2, 3} + {3, 4, 5}
= {3} = {1, 2, 4, 5}
𝐵 ∩ 𝐴 = {3, 4, 5} ∩ {1, 2, 3} 𝐵 + 𝐴 = {3, 4, 5} + {1, 2, 3}
= {3} = {1, 2, 4, 5}

2. 𝑈 = { 𝑎, 𝑒, 𝑖, 𝑜, 𝑢} 𝐴 = { 𝑖, 𝑜, 𝑢} 𝐵 = { 𝑎, 𝑒, 𝑜, 𝑢}

(a) 𝐴′ = { 𝑖, 𝑜, 𝑢} ′ (e) 𝐴 ∩ 𝐵 = { 𝑖, 𝑜, 𝑢} ∩ { 𝑎, 𝑒, 𝑜, 𝑢}
= { 𝑎, 𝑒, 𝑖, 𝑜, 𝑢} − { 𝑖, 𝑜, 𝑢} = { 𝑜, 𝑢}

= { 𝑎, 𝑒} ( 𝐴 ∩ 𝐵) = { 𝑎, 𝑒, 𝑖, 𝑜, 𝑢} − { 𝑜, 𝑢}
′ ′
( 𝐴 ) = { 𝑎, 𝑒, 𝑖, 𝑜, 𝑢} − { 𝑎, 𝑒} = { 𝑎, 𝑒, 𝑖 }
= { 𝑖, 𝑜, 𝑢} (f) 𝐴′ ∪ 𝐵′ = { 𝑎, 𝑒} ∪ { 𝑖 }
=𝐴 = { 𝑎, 𝑒, 𝑖 }
′ ′
(b) 𝐵 = { 𝑎, 𝑒, 𝑜, 𝑢} (g) 𝐴 − 𝐵 = { 𝑖, 𝑜, 𝑢} − { 𝑎, 𝑒, 𝑜, 𝑢}
= { 𝑎, 𝑒, 𝑖, 𝑜, 𝑢} − { 𝑎, 𝑒, 𝑜, 𝑢} = { 𝑖}
= { 𝑖} 𝐵 − 𝐴 = { 𝑎, 𝑒, 𝑜, 𝑢} − { 𝑖, 𝑜, 𝑢}
′ ′
( 𝐵 ) = { 𝑎, 𝑒, 𝑖, 𝑜, 𝑢} − { 𝑖 } = { 𝑎, 𝑒}
= { 𝑎, 𝑒, 𝑜, 𝑢}
(h) 𝐴 ∩ 𝐵′ = { 𝑖, 𝑜, 𝑢} ∩ { 𝑖 }
=𝐵
= { 𝑖}
(c) 𝐴 ∪ 𝐵 = { 𝑖, 𝑜, 𝑢} ∪ { 𝑎, 𝑒, 𝑜, 𝑢} ′
𝐵 ∩ 𝐴 = { 𝑎, 𝑒, 𝑜, 𝑢} ∩ { 𝑎, 𝑒}
= { 𝑎, 𝑒, 𝑖, 𝑜, 𝑢} = { 𝑎, 𝑒}

( 𝐴 ∪ 𝐵) = { 𝑎, 𝑒, 𝑖, 𝑜, 𝑢} − { 𝑎, 𝑒, 𝑖, 𝑜, 𝑢}
(i) 𝐴 + 𝐵 = { 𝑖, 𝑜, 𝑢} + { 𝑎, 𝑒, 𝑜, 𝑢}
=∅
= { 𝑎, 𝑒, 𝑖 }
′ ′
(d) 𝐴 ∩ 𝐵 = { 𝑎, 𝑒} ∩ { 𝑖 } 𝐵 + 𝐴 = { 𝑎, 𝑒, 𝑜, 𝑢} + { 𝑖, 𝑜, 𝑢}
=∅ = { 𝑎, 𝑒, 𝑖 }

3. 𝑈 = {1, 2, 3, 4, 5} 𝐴 = {3} 𝐵 = {3}, 4, 5

P ( 𝐴) = P {3}

= ∅, {3}
 
P ( 𝐵) = P {3}, 4, 5
n        o
= ∅, {3} , 4 , 5 , {3}, 4 , {3}, 5 , 4, 5 , {3}, 4, 5

20
UNIT 3. SETS 3.3. Other Terms Significant For Sets

4. 𝑈 = { 𝑎, 𝑒, 𝑖, 𝑜, 𝑢} 𝐴 = { 𝑖, 𝑜, 𝑢} 𝐵 = { 𝑎, 𝑒, 𝑜, 𝑢}

(a) P ( 𝐴) = ∅, { 𝑖 }, { 𝑜}, {𝑢}, { 𝑖, 𝑜}, { 𝑖, 𝑢}, { 𝑜, 𝑢}, { 𝑖, 𝑜, 𝑢}

P ( 𝐵) = ∅, { 𝑎}, { 𝑒}, { 𝑜}, {𝑢}, { 𝑎, 𝑒}, { 𝑎, 𝑜}, { 𝑎, 𝑢}, { 𝑒, 𝑜}, { 𝑒, 𝑢}, { 𝑜, 𝑢}, { 𝑎, 𝑒, 𝑜},
{ 𝑎, 𝑒, 𝑢}, { 𝑎, 𝑜, 𝑢}, { 𝑒, 𝑜, 𝑢}, { 𝑎, 𝑒, 𝑜, 𝑢}

(b) P ( 𝐴 ∩ 𝐵) = P { 𝑜, 𝑢}

= ∅, { 𝑜}, {𝑢}, { 𝑜, 𝑢}

P ( 𝐴) ∩ P ( 𝐵) = ∅, { 𝑜}, {𝑢}, { 𝑜, 𝑢}
P ( 𝐴′ ) = P { 𝑎, 𝑒}

(c)

= ∅, { 𝑎}, { 𝑒}, { 𝑎, 𝑒}

P (𝑈 ) = ∅, { 𝑎}, { 𝑒}, { 𝑖 }, { 𝑜}, {𝑢}, { 𝑎, 𝑒}, { 𝑎, 𝑖 }, { 𝑎, 𝑜}, { 𝑎, 𝑢},
{ 𝑒, 𝑖 }, { 𝑒, 𝑜}, { 𝑒, 𝑢}, { 𝑖, 𝑜}, { 𝑖, 𝑢}, { 𝑜, 𝑢},
{ 𝑎, 𝑒, 𝑖 }, { 𝑎, 𝑒, 𝑜}, { 𝑎, 𝑒, 𝑢}, { 𝑎, 𝑖, 𝑜}, { 𝑎, 𝑖, 𝑢}, { 𝑎, 𝑜, 𝑢},
{ 𝑒, 𝑖, 𝑜}, { 𝑒, 𝑖, 𝑢}{ 𝑒, 𝑜, 𝑢}, { 𝑖, 𝑜, 𝑢},
{ 𝑎, 𝑒, 𝑖, 𝑜}, { 𝑎, 𝑒, 𝑖, 𝑢}, { 𝑎, 𝑒, 𝑜, 𝑢}{ 𝑎, 𝑖, 𝑜, 𝑢}, { 𝑒, 𝑖, 𝑜, 𝑢}, { 𝑎, 𝑒, 𝑖, 𝑜, 𝑢}
′ 
P ( 𝐴) = { 𝑎}, { 𝑒}, { 𝑎, 𝑒}, { 𝑎, 𝑖 }, { 𝑎, 𝑜}, { 𝑎, 𝑢}, { 𝑒, 𝑖 }, { 𝑒, 𝑜}, { 𝑒, 𝑢},
{ 𝑎, 𝑒, 𝑖 }, { 𝑎, 𝑒, 𝑜}, { 𝑎, 𝑒, 𝑢}, { 𝑎, 𝑖, 𝑜}, { 𝑎, 𝑖, 𝑢}, { 𝑎, 𝑜, 𝑢},
{ 𝑒, 𝑖, 𝑜}, { 𝑒, 𝑖, 𝑢}, { 𝑒, 𝑜, 𝑢},
{ 𝑎, 𝑒, 𝑖, 𝑜}, { 𝑎, 𝑒, 𝑖, 𝑢}, { 𝑎, 𝑒, 𝑜, 𝑢}{ 𝑎, 𝑖, 𝑜, 𝑢}, { 𝑒, 𝑖, 𝑜, 𝑢}, { 𝑎, 𝑒, 𝑖, 𝑜, 𝑢}

(d) P ( 𝐴) ∪ P ( 𝐵) = ∅ , { 𝑎 } , { 𝑒 } , { 𝑖 } , { 𝑜 } , { 𝑢 } ,
{ 𝑎, 𝑒}, { 𝑎, 𝑜}, { 𝑎, 𝑢}, { 𝑒, 𝑜}, { 𝑒, 𝑢}, { 𝑖, 𝑜}, { 𝑖, 𝑢}, { 𝑜, 𝑢},
{ 𝑎, 𝑒, 𝑜}, { 𝑎, 𝑒, 𝑢}, { 𝑎, 𝑜, 𝑢}, { 𝑒, 𝑜, 𝑢}, { 𝑖, 𝑜, 𝑢}, { 𝑎, 𝑒, 𝑜, 𝑢}

P ( 𝐴 ∪ 𝐵) = P { 𝑎, 𝑒, 𝑖, 𝑜, 𝑢}
= P (𝑈 )

= ∅, { 𝑎}, { 𝑒}, { 𝑖 }, { 𝑜}, {𝑢}, { 𝑎, 𝑒}, { 𝑎, 𝑖 }, { 𝑎, 𝑜}, { 𝑎, 𝑢},
{ 𝑒, 𝑖 }, { 𝑒, 𝑜}, { 𝑒, 𝑢}, { 𝑖, 𝑜}, { 𝑖, 𝑢}, { 𝑜, 𝑢},
{ 𝑎, 𝑒, 𝑖 }, { 𝑎, 𝑒, 𝑜}, { 𝑎, 𝑒, 𝑢}, { 𝑎, 𝑖, 𝑜}, { 𝑎, 𝑖, 𝑢}, { 𝑎, 𝑜, 𝑢},
{ 𝑒, 𝑖, 𝑜}, { 𝑒, 𝑖, 𝑢}{ 𝑒, 𝑜, 𝑢}, { 𝑖, 𝑜, 𝑢},
{ 𝑎, 𝑒, 𝑖, 𝑜}, { 𝑎, 𝑒, 𝑖, 𝑢}, { 𝑎, 𝑒, 𝑜, 𝑢}{ 𝑎, 𝑖, 𝑜, 𝑢}, { 𝑒, 𝑖, 𝑜, 𝑢}, { 𝑎, 𝑒, 𝑖, 𝑜, 𝑢}
Unit 4

Proofs Involving Sets

4.1 Venn Diagrams


4.1.1 Set Equality

Set Equality

For any sets 𝐴 and 𝐵, if 𝐴 ⊆ 𝐵 and 𝐵 ⊆ 𝐴, then every element of 𝐴 is also an element of 𝐵, and
every element of 𝐵 is also an element of 𝐴, so 𝐴 = 𝐵.

4.1.2 Drawing Complex Venn Diagrams


Draw the diagram in stages, including 𝑈 , 𝐴, 𝐵 and 𝐶 in each diagram.
 
Example Let 𝐴, 𝐵, 𝐶 ⊆ 𝑈 . Draw the Venn diagram for ( 𝐴 ∪ 𝐵) − ( 𝐴 ∩ 𝐵) ∪ 𝐶

𝐴∪𝐵 𝐴∩𝐵 ( 𝐴 ∪ 𝐵) − ( 𝐴 ∩ 𝐵)

𝐴 𝐵 𝐴 𝐵 𝐴 𝐵

𝐶 𝐶 𝐶

23
4.1. Venn Diagrams UNIT 4. PROOFS INVOLVING SETS

 
𝐶 ( 𝐴 ∪ 𝐵) − ( 𝐴 ∩ 𝐵) ∪ 𝐶

𝐴 𝐵 𝐴 𝐵

𝐶 𝐶

Self-Assessment Exercise 4.4

1. (a) ( 𝑋 ∪ 𝑌 ) ′

𝑋 ∪𝑌 ( 𝑋 ∪ 𝑌 )′

𝑋 𝑌 𝑋 𝑌

(b) 𝑋 ′ ∩ 𝑌 ′
𝑋′ 𝑌′ 𝑋′ ∩ 𝑌′

𝑋 𝑌 𝑋 𝑌 𝑋 𝑌

(c) ( 𝑋 ∩ 𝑌 ) ′

𝑋 ∩𝑌 ( 𝑋 ∩ 𝑌 )′

𝑋 𝑌 𝑋 𝑌

24
UNIT 4. PROOFS INVOLVING SETS 4.1. Venn Diagrams

(d) 𝑋 ′ ∩ 𝑌 ′
𝑋′ 𝑌′ 𝑋′ ∪ 𝑌′

𝑋 𝑌 𝑋 𝑌 𝑋 𝑌

2. (a) 𝑋 − (𝑌 ∪ 𝑍 )

𝑋 𝑌 ∪𝑍 𝑋 − (𝑌 ∪ 𝑍 )

𝑋 𝑌 𝑋 𝑌 𝑋 𝑌

𝑍 𝑍 𝑍

(b) ( 𝑋 − 𝑌 ) ∪ ( 𝑋 − 𝑍 )

𝑋 −𝑌 𝑋−𝑍 ( 𝑋 − 𝑌 ) ∪ ( 𝑋 − 𝑍)

𝑋 𝑌 𝑋 𝑌 𝑋 𝑌

𝑍 𝑍 𝑍

(c) 𝑋 ∩ (𝑌 − 𝑍 )

𝑋 𝑌 −𝑍 𝑋 ∩ (𝑌 − 𝑍 )

𝑋 𝑌 𝑋 𝑌 𝑋 𝑌

𝑍 𝑍 𝑍

25
4.1. Venn Diagrams UNIT 4. PROOFS INVOLVING SETS

(d) ( 𝑋 ∩ 𝑌 ) − ( 𝑋 ∩ 𝑍 )

𝑋 ∩𝑌 𝑋∩𝑍 ( 𝑋 ∩ 𝑌 ) − ( 𝑋 ∩ 𝑍)

𝑋 𝑌 𝑋 𝑌 𝑋 𝑌

𝑍 𝑍 𝑍

(e) 𝑋 ∩ (𝑌 + 𝑍 )

𝑋 𝑌 +𝑍 𝑋 ∩ (𝑌 + 𝑍 )

𝑋 𝑌 𝑋 𝑌 𝑋 𝑌

𝑍 𝑍 𝑍

(f) ( 𝑋 ∩ 𝑌 ) + ( 𝑋 ∩ 𝑍 )

𝑋 ∩𝑌 𝑋∩𝑍 ( 𝑋 ∩ 𝑌 ) + ( 𝑋 ∩ 𝑍)

𝑋 𝑌 𝑋 𝑌 𝑋 𝑌

𝑍 𝑍 𝑍

26
UNIT 4. PROOFS INVOLVING SETS 4.2. Proofs

4.2 Proofs
For proofs with sets, one needs to prove that the sets have exactly the same elements. For this, one
needs to show that each half of the equation is equal to the other half: one needs to show both
forwards and backwards. However, this can be abbreviated using iff.

Example (Long Way:) Prove that for all subsets 𝐴 and 𝐵 of 𝑈 , 𝐴 ∪ 𝐵 = 𝐵 ∪ 𝐴

Proof. Show (i) ( 𝐴 ∪ 𝐵) ⊆ ( 𝐵 ∪ 𝐴) and (ii) ( 𝐵 ∪ 𝐴) ⊆ ( 𝐴 ∪ 𝐵)


(i) Show ( 𝐴 ∪ 𝐵) ⊆ ( 𝐵 ∪ 𝐴)

Subproof.
Let 𝑥 ∈ ( 𝐴 ∪ 𝐵)
If 𝑥 ∈ ( 𝐴 ∪ 𝐵)
then 𝑥 ∈ 𝐴 or 𝑥 ∈ 𝐵
i.e. 𝑥 ∈ 𝐵 or 𝑥 ∈ 𝐴
i.e. 𝑥 ∈ ( 𝐵 ∪ 𝐴)
∴ if 𝑥 ∈ ( 𝐴 ∪ 𝐵), then 𝑥 ∈ ( 𝐵 ∪ 𝐴),
∴ ( 𝐴 ∪ 𝐵) ⊆ ( 𝐵 ∪ 𝐴). □

(ii) Show ( 𝐵 ∪ 𝐴) ⊆ ( 𝐴 ∪ 𝐵)

Subproof.
Let 𝑥 ∈ ( 𝐵 ∪ 𝐴)
If 𝑥 ∈ ( 𝐵 ∪ 𝐴)
then 𝑥 ∈ 𝐵 or 𝑥 ∈ 𝐴
i.e. 𝑥 ∈ 𝐴 or 𝑥 ∈ 𝐵
i.e. 𝑥 ∈ ( 𝐴 ∪ 𝐵)
∴ if 𝑥 ∈ ( 𝐵 ∪ 𝐴), then 𝑥 ∈ ( 𝐴 ∪ 𝐵),
∴ ( 𝐵 ∪ 𝐴) ⊆ ( 𝐴 ∪ 𝐵). □

∴ 𝐴∪𝐵= 𝐵∪𝐴 ■

Using iff can shorten this, but be careful!

Example
Proof. Proof.
𝑥 ∈ ( 𝑋 ∪ 𝑌 )′ 𝑥 ∈ ( 𝑋 ∩ 𝑌 )′
iff 𝑥 ∉ ( 𝑋 ∪ 𝑌 ) iff 𝑥 ∉ ( 𝑋 ∩ 𝑌 )
iff 𝑥 ∉ 𝑋 and 𝑥 ∉ 𝑌 iff 𝑥 ∉ 𝑋 or 𝑥 ∉ 𝑌
iff 𝑥 ∈ 𝑋 ′ and 𝑥 ∈ 𝑌 ′ iff 𝑥 ∈ 𝑋 ′ or 𝑥 ∈ 𝑌 ′
iff 𝑥 ∈ 𝑋 ′ ∩ 𝑌 ′ ■ iff 𝑥 ∈ 𝑋 ′ ∪ 𝑌 ′ ■

27
4.2. Proofs UNIT 4. PROOFS INVOLVING SETS

Self-Assessment Exercise 4.6

(a) ( 𝑋 ′ ) ′ = 𝑋 (c) 𝑋 ∩ (𝑌 ∩ 𝑊 ) = ( 𝑋 ∩ 𝑌 ) ∩ 𝑊

Proof. Let 𝑥 ∈ 𝑋 ∩ (𝑌 ∩ 𝑊 ).
Proof. Let 𝑥 ∈ ( 𝑋 ′ ) ′ .
𝑥 ∈ 𝑋 ∩ (𝑌 ∩ 𝑊 )
𝑥 ∈ ( 𝑋 ′)′ iff 𝑥 ∈ 𝑋 and 𝑥 ∈ (𝑌 ∩ 𝑊 )
iff 𝑥 ∉ 𝑋 ′ iff 𝑥 ∈ 𝑋 and 𝑥 ∈ 𝑌 and 𝑥 ∈ 𝑊
iff 𝑥 ∈ 𝑋 iff ( 𝑥 ∈ 𝑋 and 𝑥 ∈ 𝑌 ) and 𝑥 ∈ 𝑊
∴ ( 𝑋 ′)′ = 𝑋 ■ iff 𝑥 ∈ ( 𝑋 ∩ 𝑌 ) and 𝑥 ∈ 𝑊
iff 𝑥 ∈ (𝑋 ∩ 𝑌 ) ∩ 𝑊
∴ 𝑋 ∩ (𝑌 ∩ 𝑊 ) = ( 𝑋 ∩ 𝑌 ) ∩ 𝑊 ■
(b) 𝑋 − (𝑌 ∩ 𝑊 ) = ( 𝑋 − 𝑌 ) ∪ ( 𝑋 − 𝑊 )
(d) 𝑋 ∩ (𝑌 ∪ 𝑊 ) = ( 𝑋 ∩ 𝑌 ) ∪ ( 𝑋 ∩ 𝑊 )
Proof. Let 𝑥 ∈ 𝑋 − (𝑌 ∩ 𝑊 ).
Proof. Let 𝑥 ∈ 𝑋 ∩ (𝑌 ∪ 𝑊 )
𝑥 ∈ 𝑋 − (𝑌 ∩ 𝑊 )
𝑥 ∈ 𝑋 ∩ (𝑌 ∪ 𝑊 )
iff 𝑥 ∈ 𝑋 and 𝑥 ∉ (𝑌 ∩ 𝑊 )
iff 𝑥 ∈ 𝑋 and 𝑥 ∈ (𝑌 ∪ 𝑊 )
iff 𝑥 ∈ 𝑋 and 𝑥 ∈ 𝑌 ′ or 𝑥 ∈ 𝑊 ′
iff 𝑥 ∈ 𝑋 and ( 𝑥 ∈ 𝑌 or 𝑥 ∈ 𝑊 )
𝑥 ∈ 𝑋 and 𝑥 ∈ 𝑌 ′ or 𝑥 ∈ 𝑋 and 𝑥 ∈ 𝑊 ′
 
iff   iff (𝑥 ∈ 𝑋 and 𝑥 ∈ 𝑌 ) or (𝑥 ∈ 𝑋 and 𝑥 ∈ 𝑊 )
iff 𝑥 ∈ ( 𝑋 − 𝑌 ) or 𝑥 ∈ ( 𝑋 − 𝑊 )
iff (𝑥 ∈ ( 𝑋 ∩ 𝑌 )) or (𝑥 ∈ ( 𝑋 ∩ 𝑊 ))
iff 𝑥 ∈ (𝑋 − 𝑌 ) ∪ (𝑋 − 𝑊)
iff 𝑥 ∈ (𝑋 ∩ 𝑌 ) ∪ (𝑋 ∩ 𝑊)
∴ 𝑋 − (𝑌 ∩ 𝑊 ) = ( 𝑋 − 𝑌 ) ∪ ( 𝑋 − 𝑊 ) ■
∴ 𝑋 ∩ (𝑌 ∪ 𝑊 ) = ( 𝑋 ∩ 𝑌 ) ∪ ( 𝑋 ∩ 𝑊 ) ■

In order to prove that two sets are not equal, one needs to just provide a counterexample - an element
that is in one set that is not in the other.

Identity

An equation which is satisfied by every possible value of the unknown(s) is called an identity

28
UNIT 4. PROOFS INVOLVING SETS 4.2. Proofs

Self Assessment Exercise 4.8

1. Is it the case for all 𝑿 , 𝒀 , 𝒁 ⊆ 𝑼 , 𝑿 + (𝒀 ∩ 𝒁) = ( 𝑿 + 𝒀 ) ∩ ( 𝑿 + 𝒁)?

𝑋 𝑌 ∩𝑍 𝑋 + (𝑌 ∩ 𝑍 )

𝑋 𝑌 𝑋 𝑌 𝑋 𝑌

𝑍 𝑍 𝑍

𝑋 +𝑌 𝑋+𝑍 𝑋 + (𝑌 ∩ 𝑍 )

𝑋 𝑌 𝑋 𝑌 𝑋 𝑌

𝑍 𝑍 𝑍

As the venn diagrams are not the same, it is not the case.
Counterexample: Find an element that is in 𝑋 and in 𝑌 , but is not in 𝑍 .
2. Find examples of sets 𝑨 and 𝑩 such that P( 𝑨 ∪ 𝑩) is not a subset of P( 𝑨) ∪ P( 𝑩).
𝐴 and 𝐵 just need to contain different elements. For example, let 𝐴 = {1} and 𝐵 = {2}.

P ( 𝐴 ∪ 𝐵) = P {1} ∪ {2}

= P {1, 2}

= ∅, {1}, {2}, {1, 2}
 
P ( 𝐴) ∪ P ( 𝐵) = P {1} ∪ P {2}
 
= ∅, {1} ∪ ∅, {2}

= ∅, {1}, {2}

29
4.2. Proofs UNIT 4. PROOFS INVOLVING SETS

3. Is it the case that, for all 𝑿, 𝒀 ⊆ 𝑼, P( 𝑿 ) ∩ P(𝒀 ) = P( 𝑿 ∩ 𝒀 )?


Yes.

Proof. Let 𝑆 ∈ 𝑃 ( 𝑋 ) ∩ 𝑃 (𝑌 ).
𝑆 ∈ 𝑃 ( 𝑋 ) ∩ 𝑃 (𝑌 )
iff 𝑆 ∈ 𝑃 ( 𝑋 ) and 𝑆 ∈ 𝑃 (𝑌 )
iff 𝑆 ⊆ 𝑋 and 𝑆 ⊆ 𝑌
iff (The elements of 𝑆 are all in 𝑋 ) and (The elements of 𝑆 are all in 𝑌 )
iff The elements of 𝑆 are all in 𝑋 ∩ 𝑌
iff 𝑆 ⊆ 𝑋 ∩𝑌
iff 𝑆 ∈ P (𝑋 ∩ 𝑌 ) ■

4. Use Venn diagrams to investigate whether or not, for all sets 𝑿, 𝒀 , 𝒁 ⊆ 𝑼


𝑿 − (𝒀 − 𝒁) = ( 𝑿 − 𝒀 ) − 𝒁. If it is true, provide a proof. Else, provide a counterexample.

𝑋 𝑌 −𝑍 𝑋 − (𝑌 − 𝑍 )

𝑋 𝑌 𝑋 𝑌 𝑋 𝑌

𝑍 𝑍 𝑍

𝑋 −𝑌 𝑍 (𝑋 − 𝑌 ) − 𝑍

𝑋 𝑌 𝑋 𝑌 𝑋 𝑌

𝑍 𝑍 𝑍

Counterexample. Let 𝑋 = {1, 2}, 𝑌 = {4}, 𝑍 = {1, 3}.

𝑋 − (𝑌 − 𝑍 ) = {1, 2}
( 𝑋 − 𝑌 ) − 𝑍 = {2}
{1, 2} ≠ {2}
𝑋 − (𝑌 − 𝑍 ) ≠ ( 𝑋 − 𝑌 ) − 𝑍 ■

30
UNIT 4. PROOFS INVOLVING SETS 4.2. Proofs

5. Use Venn diagrams to investigate whether or not, for all sets 𝑨, 𝑩, 𝑪 ⊆ 𝑼


( 𝑨 ∩ 𝑩) + (𝑪 ∩ 𝑨) = ( 𝑨 ∩ 𝑩′ ) ∪ ( 𝑩 − 𝑪 ). If it is true, provide a proof. Else, provide a
counterexample.

𝐴∩𝐵 𝐶∩𝐴 ( 𝐴 ∩ 𝐵) + ( 𝐶 ∩ 𝐴)

𝐴 𝐵 𝐴 𝐵 𝐴 𝐵

𝐶 𝐶 𝐶

𝐵′ 𝐴 ∩ 𝐵′ 𝐵−𝐶

𝐴 𝐵 𝐴 𝐵 𝐴 𝐵

𝐶 𝐶 𝐶

( 𝐴 ∩ 𝐵′ ) ∪ ( 𝐵 − 𝐶 )

𝐴 𝐵

Counterexample. Let 𝐴 = {1, 2}, 𝐵 = {2, 3}, 𝐶 = {4}

( 𝐴 ∩ 𝐵) + ( 𝐶 ∩ 𝐴) = {2}
( 𝐴 ∩ 𝐵′ ) ∪ ( 𝐵 − 𝐶 ) = {1, 2, 3}
{2} ≠ {1, 2, 3}
( 𝐴 ∩ 𝐵) + ( 𝐶 ∩ 𝐴) ≠ ( 𝐴 ∩ 𝐵 ′ ) ∪ ( 𝐵 − 𝐶 ) ■

31
4.3. The Inclusion Exclusion Principle UNIT 4. PROOFS INVOLVING SETS

4.3 The Inclusion Exclusion Principle

Inclusion Exclusion Principle

For all finite sets 𝑋 and 𝑌 , | 𝑋 ∪ 𝑌 | = | 𝑋 | + |𝑌 | − | 𝑋 ∩ 𝑌 |

Example Let 𝑋 = { 𝑎, 𝑏, 𝑐, 1} and 𝑌 = {1, 2, 3}. Then 𝑋 ∩ 𝑌 = {1} and | 𝑋 ∩ 𝑌 | = 1.


| 𝑋 | = 4, |𝑌 | = 3, so | 𝑋 ∪ 𝑌 | = | 𝑋 | + |𝑌 | − | 𝑋 ∩ 𝑌 | = 4 + 3 − 1 = 6

Sum Rule
If 𝑋 and 𝑌 are disjoint sets ( 𝑋 ∩ 𝑌 = ∅), and | 𝑋 | = 𝑚 and |𝑌 | = 𝑛, then | 𝑋 ∪ 𝑌 | = 𝑚 + 𝑛

4.3.1 Applying the principle to Venn Diagrams

Example In a group of 50 learners, 25 play mastermind, 30 play basketball, and 10 play both.
(a) How many learners play Mastermind or basketball, (or both)?
(b) How many students do not play either Mastermind or basketball?
𝑈 is all the learners, 𝑀 is those who play Mastermind, and 𝐵 is those who play basketball.

|𝑈 | = 50 | 𝑀 | = 25 | 𝐵 | = 30 | 𝑀 ∩ 𝐵 | = 10

𝑀 𝐵

25 − 10 = 15 10 30 − 10 = 20

50 − 15 − 20 − 10 = 5

1. | 𝑀 ∪ 𝐵 | = 15 + 10 + 20 = 45.
Also by Inclusion Exclusion,

| 𝑀 ∪ 𝐵| = | 𝑀 | + | 𝐵| − | 𝑀 ∩ 𝐵|
= 25 + 30 − 10
= 45

2. |( 𝑀 ∪ 𝐵) ′ | = 50 − 45 = 5

32
UNIT 4. PROOFS INVOLVING SETS 4.3. The Inclusion Exclusion Principle

Example A questionnaire filled in by 100 subscribers to Blue Scalpel Medical Insurance who
submitted no claims during 2009 reveals that 45 jog regularly, 30 do aerobics regularly, 20 cycle
regularly, 6 jog and do aerobics, 1 jogs and cycles, 5 do aerobics and cycle, and 1 jogs, cycles
and does aerobics.
(a) How many of these healthy people do not participate regularly in any of the three activi-
ties?
(b) How many only jog?
𝑈 is the subscribers, 𝐽 is those who jog, 𝐴 is those who do aerobics, and 𝐶 is those who cycle.

|𝑈 | = 100 | 𝐽 | = 45 | 𝐴 | = 30 |𝐶 | = 20
| 𝐽 ∩ 𝐴| = 6 |𝐽 ∩ 𝐶| = 1 |𝐴 ∩ 𝐶| = 5 |𝐽 ∩ 𝐴 ∩ 𝐶| = 1

𝐽 𝐴

6−1=5
45 − 5 − 1 − 0 = 39 30 − 5 − 1 − 4 = 20

1
1−1=0 5−1=4

20 − 0 − 1 − 4 = 15

100 − 39 − 20 − 15 − 5 − 0 − 4 − 1 = 16

(a) This would be the value of the people who don’t appear in any of the circles, which is 16.
(b) This would be the value inside the circle 𝐽 , which is 39.

33
4.3. The Inclusion Exclusion Principle UNIT 4. PROOFS INVOLVING SETS

Self Assessment Exercise 4.10

1. Of 1000 first year students, 700 take Mathematics, 400 take Computer Science, and
800 take Mathematics or Computer Science.
𝑈 is the first year students, 𝑀 is those who take Mathematics, and 𝐶 is those who take
Computer Science.

|𝑈 | = 1000 | 𝑀 | = 700 | 𝐶 | = 400 | 𝑀 ∪ 𝐶 | = 800 |𝑀 ∩ 𝐶| = 𝑥

𝑀 𝐶

700 − 𝑥 𝑥 400 − 𝑥

1000 − 800 = 200

800 = (700 − 𝑥 ) + 𝑥 + (400 − 𝑥 )


⇒ 800 = 700 + 400 − 𝑥
⇒ −300 = − 𝑥
⇒ 𝑥 = 300

(a) How many students take Mathematics and Computer Science?


This would be 𝑥 , which is 300.
(b) How many students take Mathematics, but not Computer Science?

400 − 𝑥 = 400 − 300


= 100

(c) How many students do not take either of the two subjects?
The number occuring outside the circles, so 200.

34
UNIT 4. PROOFS INVOLVING SETS 4.3. The Inclusion Exclusion Principle

2. A builder has a team of 64 construction workers. 45 can use at least one of the
three equipment types. 22 can operate cranes, 26 can operate backhoes, 4 can
operate cranes and bulldozers, 6 can operate backhoes and bulldozers, 8 can operate
cranes and backhoes, and 1 can operate all three kinds of machinery. How many can
operate bulldozers?
𝑈 is the workers, 𝐶 is the workers who can operate cranes, 𝐵 is the workers who can
operate backhoes, and 𝐷 is the workers who can operate bulldozers.
|𝑈 | = 64 |𝐶 | = 22 | 𝐵 | = 26 | 𝐷| = 𝑥
|𝐶 ∩ 𝐷 | = 4 | 𝐵 ∩ 𝐷| = 6 |𝐶 ∩ 𝐵 | = 8 |𝐶 ∩ 𝐵 ∩ 𝐷 | = 1
| 𝐶 ∪ 𝐵 ∪ 𝐷 | = 45

𝐶 𝐵

8−1=7
22 − 7 − 1 − 3 = 11 26 − 7 − 1 − 5 = 13

1
4−1=3 6−1=5

𝑥−3−1−5= 𝑥−9

64 − 45 = 19

45 = 11 + 13 + ( 𝑥 − 9) + 7 + 3 + 5 + 1
⇒ 45 = 40 + 𝑥 − 9
⇒ 𝑥 = 45 − 31
⇒ 𝑥 = 14

The number of people who can only operate bulldozers is 𝑥 − 9 = 14 − 9 = 5.


The number of people who can operate bulldozers is therefore 5 + 3 + 1 + 5 = 14.

35
4.3. The Inclusion Exclusion Principle UNIT 4. PROOFS INVOLVING SETS

3. A software company employs 22 software engineers. All of them can use at least
one of the three methods. 17 of them can use a formal method (FM), 9 can use
Unified Modelling Language (UML), and 9 can use entity-relationship diagrams (ER).
5 engineers can use both an FM and UML, 4 both an FM and ER diagrams, and 7 both
UML and ER diagrams.

|𝑈 | = 22 |FM| = 17 |UML| = 9 |ER| = 9


|FM ∩ UML| = 5 |FM ∩ ER| = 4 |UML ∩ ER| = 7 |FM ∩ UML ∩ ER| = 𝑥

FM UML

5−𝑥
𝑥+8 𝑥−3

𝑥
4−𝑥 7−𝑥

𝑥−2

ER

For Only FM: 17 − (5 − 𝑥 ) − 𝑥 − (4 − 𝑥 ) = 17 − 5 + 𝑥 − 𝑥 − 4 + 𝑥


= 𝑥+8
For Only UML: 9 − (5 − 𝑥 ) − 𝑥 − (7 − 𝑥 ) = 9 − 5 + 𝑥 − 𝑥 − 7 + 𝑥
= 𝑥−3
For Only ER: 9 − (4 − 𝑥 ) − 𝑥 − (7 − 𝑥 ) = 9 − 4 + 𝑥 − 𝑥 − 7 + 𝑥
= 𝑥−2

36
UNIT 4. PROOFS INVOLVING SETS 4.4. Proofs on Specific Sets

22 = ( 𝑥 + 8) + ( 𝑥 − 3) + ( 𝑥 − 2) + (5 − 𝑥 ) + (4 − 𝑥 ) + (7 − 𝑥 ) + 𝑥
⇒ 22 = ( 𝑥 + 𝑥 + 𝑥 − 𝑥 − 𝑥 − 𝑥 + 𝑥 ) + (8 − 3 − 2 + 5 + 4 + 7)
⇒ 22 = 𝑥 + 19
⇒ 𝑥 = 22 − 19
⇒ 𝑥=3

(a) How many engineers can use all three diagrams?


As shown above, 3 engineers.
(b) How many engineers can use UML only?

𝑥−3=3−3
=0

4.4 Proofs on Specific Sets


To prove that two sets are equal, prove that each member of the lef-hand side belongs to the right
hand side, and vice versa.

Any variable can be used for a set description

Whether the variable is 𝑥 or 𝑧 does not change the members of the set.

Example Prove that {𝑤 ∈ R | 𝑤2 − 3𝑤 + 2 < 0} = { 𝑧 ∈ R | 1 < 𝑧 < 2}

Proof. Let 𝑥 ∈ {𝑤 ∈ R | 𝑤2 − 3𝑤 + 2 < 0}


𝑥 ∈ {𝑤 ∈ R | 𝑤2 − 3𝑤 + 2 < 0}
iff 𝑥 ∈ R and 𝑥 2 − 3𝑥 + 2 < 0
iff 𝑥 ∈ R and ( 𝑥 − 2) ( 𝑥 − 1) < 0
iff 𝑥 ∈ R and either ( 𝑥 − 2) < 0 and ( 𝑥 − 1) > 0 (minus times a plus is a minus) or
( 𝑥 − 2) > 0 and ( 𝑥 − 1) < 0 (plus times a minus is a minus)
iff 𝑥 ∈ R and either ( 𝑥 < 2 and 𝑥 > 1) or ( 𝑥 > 2 and 𝑥 < 1)
(there are no real numbers that meet the second option)
iff 𝑥 ∈ R and ( 𝑥 < 2 and 𝑥 > 1)
iff 𝑥 ∈ R and 1 < 𝑥 < 2
iff 𝑥 ∈ { 𝑥 ∈ R | 1 < 𝑥 < 2}
iff 𝑥 ∈ { 𝑧 ∈ R | 1 < 𝑧 < 2} ■

Using Or in Proofs

Note that if there is an “or” that is connecting the statements, then the statement is true if either
of the statements is true.

37
4.4. Proofs on Specific Sets UNIT 4. PROOFS INVOLVING SETS

Self Assessment Exercise 4.11


Prove the following

1. { 𝒚 ∈ Z+ | 𝒚 is an even prime number} = {𝒖 ∈ Z+ | 𝒖2 = 4}

Proof. Let 𝑥 ∈ { 𝑦 ∈ Z+ | 𝑦 is an even prime number}.


𝑥 ∈ { 𝑦 ∈ Z+ | 𝑦 is an even prime number}
iff 𝑥 ∈ Z+ and 𝑥 is an even prime number
iff 𝑥 ∈ Z+ and 𝑥 = 2
iff 𝑥 ∈ Z+ and 𝑥 2 = 4
iff 𝑥 ∈ { 𝑥 ∈ Z+ | 𝑥 2 = 4}
iff 𝑥 ∈ {𝑢 ∈ Z+ | 𝑢2 = 4} ■

   
2. P {0, 1} = {∅} ∪ {0} ∪ {1} ∪ {0, 1}

Proof. Let 𝑋 ∈ P {0, 1} .

𝑋 ∈P {0, 1}
iff 𝑋 ∈ ∅, {0}, {1}, {0, 1}
iff 𝑋 = ∅ or 𝑋 = {0}  or 𝑥 = {1} or
 𝑋 = {0, 1} 
iff 𝑋 ∈ {∅} or𝑋 ∈ {0} or 𝑋 ∈ {1} or 𝑋 ∈ {0, 1}
iff 𝑋 ∈ {∅} ∪ {0} ∪ {1} ∪ {0, 1} ■

3. { 𝒙 ∈ R | 𝒙 2 + 6 𝒙 + 5 < 0} = { 𝒙 ∈ R | −5 < 𝒙 < −1}

Proof. Let 𝑦 ∈ { 𝑥 ∈ R | 𝑥 2 + 6 𝑥 + 5 < 0}


𝑦 ∈ { 𝑥 ∈ R | 𝑥 2 + 6 𝑥 + 5 < 0}
iff 𝑦 ∈ R and 𝑦 2 + 6 𝑦 + 5 < 0
iff 𝑦 ∈ R and ( 𝑦 + 5) ( 𝑦 + 1) < 0
iff 𝑦 ∈ R and either ( 𝑦 + 5) < 0 and ( 𝑦 + 1) > 0 (minus times a plus is a minus) or
( 𝑦 + 5) > 0 and ( 𝑦 + 1) < 0 (plus times a minus is a minus)
iff 𝑦 ∈ R and either ( 𝑦 < −5 and 𝑦 > −1) or ( 𝑦 > −5 and 𝑦 < −1)
(no real numbers meet the first statement)
iff 𝑦 ∈ R and ( 𝑦 > −5 and 𝑦 < −1)
iff 𝑦 ∈ R and −5 < 𝑦 < −1
iff 𝑦 ∈ { 𝑥 ∈ R | −5 < 𝑥 < −1} ■

38
UNIT 4. PROOFS INVOLVING SETS 4.4. Proofs on Specific Sets

4. { 𝒙 ∈ Z | 𝒙 2 − 5𝒙 + 4 < 0} = { 𝒙 ∈ Z+ | 𝒙 is a prime factor of 6}

Proof. Let 𝑤 ∈ { 𝑥 ∈ Z | 𝑥 2 − 5 𝑥 + 4 < 0}


𝑤 ∈ { 𝑥 ∈ Z | 𝑥 2 − 5 𝑥 + 4 < 0}
iff 𝑤 ∈ Z and 𝑤2 − 5𝑤 + 4 < 0
iff 𝑤 ∈ Z and ( 𝑤 − 4) ( 𝑤 − 1) < 0
iff 𝑤 ∈ Z and either ( 𝑤 − 4) < 0 and ( 𝑤 − 1) > 0 (minus times a plus is a minus) or
( 𝑤 − 4) > 0 and ( 𝑤 − 1) < 0 (plus times a minus is a minus)
iff 𝑤 ∈ Z and either ( 𝑤 < 4 and 𝑤 > 1) or ( 𝑤 > 4 and 𝑤 < 1)
(no integers meet the second statement)
iff 𝑤 ∈ Z and ( 𝑤 < 4 and 𝑤 > 1)
iff 𝑤 ∈ Z+ and (1 < 𝑤 < 4)
(Z+ as all the numbers are positive)
iff 𝑤 ∈ Z+ and 𝑤 ∈ {2, 3}
iff 𝑤 ∈ { 𝑥 ∈ Z+ | 𝑥 ∈ {2, 3}}
iff 𝑤 ∈ { 𝑥 ∈ Z+ | 𝑥 is a prime factor of 6} ■

5. { 𝒙 ∈ R | 𝒙 2 + 𝒙 − 2 > 0} = { 𝒙 ∈ R | 𝒙 < −2 or 𝒙 > 1}

Proof. Let 𝑧 ∈ { 𝑥 ∈ R | 𝑥 2 + 𝑥 − 2 > 0}


𝑧 ∈ { 𝑥 ∈ R | 𝑥 2 + 𝑥 − 2 > 0}
iff 𝑧 ∈ R and 𝑧2 + 𝑧 − 2 > 0
iff 𝑧 ∈ R and ( 𝑧 + 2) ( 𝑧 − 1) > 0
iff 𝑧 ∈ R and either ( 𝑧 + 2) < 0 and ( 𝑧 − 1) < 0 (minus times a minus is a plus) or
( 𝑧 + 2) > 0 and ( 𝑧 − 1) > 0 (plus times a plus is a plus)
iff 𝑧 ∈ R and either ( 𝑧 < −2 and 𝑧 < 1) or ( 𝑧 > −2 and 𝑧 > 1)
iff 𝑧 ∈ R and either ( 𝑧 < −2) or ( 𝑧 > 1)
iff 𝑧 ∈ { 𝑥 ∈ R | 𝑥 < −2 or 𝑥 > 1} ■

39
4.4. Proofs on Specific Sets UNIT 4. PROOFS INVOLVING SETS

Self Assessment Exercise 4.12

1. Determine whether or not for 𝑽 , 𝑾 , 𝒁 ⊆ 𝑼 , if 𝑽 ⊆ 𝑾 , then 𝑽 ∪ 𝒁 ⊆ 𝑾 ∪ 𝒁 and


𝑽 ∩ 𝒁 ⊆ 𝑾 ∩ 𝒁. Provide either a proof or a counterexample.
Both statements are true.
Proof. Suppose 𝑉 ⊆ 𝑊
Let 𝑥 ∈𝑉∪𝑍
Then 𝑥 ∈ 𝑉 or 𝑥 ∈ 𝑍
(If 𝑥 ∈ 𝑉 , 𝑥 ∈ 𝑊 , as 𝑉 ⊆ 𝑊 )
i.e. 𝑥 ∈ 𝑊 or 𝑥 ∈ 𝑍
i.e. 𝑥 ∈𝑊∪𝑍
∴ 𝑉∪𝑍 ⊆𝑊∪𝑍 ■

Proof. Suppose 𝑉 ⊆ 𝑊
Let 𝑥 ∈𝑉∩𝑍
Then 𝑥 ∈ 𝑉 and 𝑥 ∈ 𝑍
(If 𝑥 ∈ 𝑉 , 𝑥 ∈ 𝑊 , as 𝑉 ⊆ 𝑊 )
i.e. 𝑥 ∈ 𝑊 and 𝑥 ∈ 𝑍
i.e. 𝑥 ∈𝑊∩𝑍
∴ 𝑉∩𝑍 ⊆𝑊∩𝑍 ■

2. Is it the case that, for all subsets 𝑿 , 𝒀 , 𝑾 ⊆ 𝑼 , if 𝑿 = 𝒀 and 𝒀 = 𝑾 , then 𝑿 = 𝑾 , and if


𝑿 ⊂ 𝒀 and 𝒀 ⊂ 𝑾 , then 𝑿 ⊂ 𝑾 ?
Both statements are true.
Proof. Suppose 𝑋 = 𝑌 and 𝑌 = 𝑊 .
Let 𝑥∈𝑋
Then 𝑥 ∈ 𝑌 , as 𝑋 = 𝑌
Then 𝑥 ∈ 𝑊 , as 𝑌 = 𝑊
∴ 𝑋 =𝑊 ■

Proof. Suppose 𝑋 ⊂ 𝑌 and 𝑌 ⊂ 𝑊 .


Let 𝑥∈𝑋
Then 𝑥 ∈ 𝑌 , as 𝑋 ⊂ 𝑌
Then 𝑥 ∈ 𝑊 , as 𝑌 ⊂ 𝑊
∴ 𝑋 ⊆𝑊
𝑌 has at least one element not in 𝑋 , as 𝑋 ⊂ 𝑌
𝑊 has at least one element not in 𝑌 , as 𝑌 ⊂ 𝑊
So 𝑊 has at least two elements not in 𝑋
i.e. 𝑋 ≠ 𝑊
so 𝑋 ⊂ 𝑊 ■

40
UNIT 4. PROOFS INVOLVING SETS 4.4. Proofs on Specific Sets

3. Is it the case that, for all subsets 𝑿 of 𝑼 , 𝑿 ∪ ∅ = 𝑿 ? Justify your answer.


Yes.
Proof.
Let 𝑥∈𝑋
Then 𝑥 ∈ 𝑋 or 𝑥 ∈ ∅
i.e. 𝑥 ∈ 𝑋∪∅
∴ 𝑋 ⊆ 𝑋∪∅

Let 𝑥 ∈ 𝑋 ∪ ∅
Then 𝑥 ∈ 𝑋 or 𝑥 ∈ ∅
i.e. 𝑥 ∈ 𝑋
(𝑥 cannot be in the empty set)
∴ 𝑋∪∅ ⊆ 𝑋

As ( 𝑋 ⊆ 𝑋 ∪ ∅) and ( 𝑋 ∪ ∅ ⊆ 𝑋 ), 𝑋 ∪ ∅ = 𝑋 ■

4. Is it true that for all subsets 𝑽 and 𝑾 of 𝑼 , 𝑽 ∩ 𝑾 = ∅ iff 𝑽 = ∅ or 𝑾 = ∅?


No.
Proof.
(i) If 𝑽 ∩ 𝑾 = ∅ then 𝑽 = ∅ or 𝑾 = ∅
This claim is false.
Counterexample. Let 𝑉 = {3, 4} and 𝑊 = {5, 6}.

𝑉 ∩ 𝑊 = {3, 4} ∩ {5, 6}
=∅

𝑉 ∩ 𝑊 = ∅ but 𝑉 ≠ ∅ and 𝑊 ≠ ∅. □

(ii) If 𝑽 = ∅ or 𝑾 = ∅, then 𝑽 ∩ 𝑾 = ∅
This claim is true.
Subproof. Let 𝑉 = ∅ and 𝑊 be some non-empty set.

𝑉 ∩𝑊 = ∅∩𝑊
=∅

∴ if 𝑉 = ∅, 𝑉 ∩ 𝑊 = ∅
Let 𝑊 = ∅ and 𝑉 be some non-empty set.

𝑉 ∩𝑊 =𝑉 ∩∅
=∅

∴ if 𝑊 = ∅, 𝑉 ∩ 𝑊 = ∅
∴ 𝑉 ∩ 𝑊 = ∅ if either 𝑉 = ∅ or 𝑊 = ∅ □

As the first claim is false, it is not the case that 𝑉 ∩ 𝑊 = ∅ iff 𝑉 = ∅ or 𝑊 = ∅. ■

41
4.4. Proofs on Specific Sets UNIT 4. PROOFS INVOLVING SETS

5. Is it the case that, for every subset 𝑿 of 𝑼 there exists a subset 𝒀 of 𝑼 such that
𝑿 ∪ 𝒀 = ∅? Justify your answer.
No.
Counterexample. Let 𝑋 = {1, } and 𝑈 = {1, 2}.
The possible subsets of 𝑈 are ∅ or {1} or {2} or {1, 2}.

𝑋 ∪ ∅ = {1} ∪ ∅
= {1}
𝑋 ∪ {1} = {1} ∪ {1}
= {1}
𝑋 ∪ {2} = {1} ∪ {2}
= {1, 2}
𝑋 ∪ {1, 2} = {1} ∪ {1, 2}
= {1, 2}

From the above, there is no set 𝑌 such that 𝑋 ∪ 𝑌 = ∅. ■

6. Is it the case that, for every subset 𝑿 of 𝑼 , there is some subset 𝒀 such taht 𝑿 ∩ 𝒀 = 𝑼 ?
Justify your answer.
No.
Counterexample. Let 𝑋 = {1, } and 𝑈 = {1, 2}.
The possible subsets of 𝑈 are ∅ or {1} or {2} or {1, 2}.

𝑋 ∩ ∅ = {1} ∩ ∅
=∅
𝑋 ∩ {1} = {1} ∩ {1}
= {1}
𝑋 ∩ {2} = {1} ∩ {2}
=∅
𝑋 ∩ {1, 2} = {1} ∩ {1, 2}
= {1}

From the above, there is no set 𝑌 such that 𝑋 ∩ 𝑌 = 𝑈 . ■

7. Using “if and only if” statements, prove the following:

(a) 𝑿 + 𝒀 = 𝒀 + 𝑿 for all 𝑿 , 𝒀 ⊆ 𝑼 .

Proof. Let 𝑥 ∈ 𝑋 + 𝑌 .
𝑥 ∈ 𝑋 +𝑌
iff ( 𝑥 ∈ 𝑋 or 𝑥 ∈ 𝑌 ) and 𝑥 ∉ 𝑋 ∩ 𝑌
iff ( 𝑥 ∈ 𝑌 or 𝑥 ∈ 𝑋 ) and 𝑥 ∉ 𝑋 ∩ 𝑌
iff 𝑥 ∈𝑌+𝑋
∴ 𝑋 +𝑌 =𝑌 + 𝑋 ■

42
UNIT 4. PROOFS INVOLVING SETS 4.4. Proofs on Specific Sets

(b) 𝑿 ∩ (𝒀 + 𝒁) = ( 𝑿 ∩ 𝒀 ) + ( 𝑿 ∩ 𝒁) for all 𝑿 , 𝒀 , 𝒁 ⊆ 𝑼 .

Proof. Let 𝑥 ∈ 𝑋 ∩ (𝑌 + 𝑍 ).
𝑥 ∈ 𝑋 ∩ (𝑌 + 𝑍 )
iff 𝑥 ∈ 𝑋 and 𝑥 ∈ (𝑌 + 𝑍 )
iff 𝑥 ∈ 𝑋 and ( 𝑥 ∈ 𝑌 or 𝑥 ∈ 𝑍 and 𝑥 ∉ 𝑌 ∩ 𝑍 )
iff ( 𝑥 ∈ 𝑋 and 𝑥 ∈ 𝑌 ) or ( 𝑥 ∈ 𝑋 and 𝑥 ∈ 𝑍 ) and 𝑥 ∉ (𝑌 ∩ 𝑍 )
iff 𝑥 ∈ ( 𝑋 ∩ 𝑌 ) or 𝑥 ∈ ( 𝑋 ∩ 𝑍 ) and 𝑥 ∉ (𝑌 ∩ 𝑍 )
iff 𝑥 ∈ ( 𝑋 ∩ 𝑌 ) + (𝑌 ∩ 𝑍 )
∴ 𝑋 ∩ (𝑌 + 𝑍 ) = ( 𝑋 ∩ 𝑌 ) + (𝑌 ∩ 𝑍 ) ■
Unit 5

Relations

5.1 Ordered Pairs


Ordered Pair
In sets the order of the elements is insignificant. If the order of the elements is significant, it is
written with an ordered pair, which is written in round brackets ().

Example An ordered pair is written ( 𝑎, 𝑏) where 𝑎 and 𝑏 are elements of the pair. ( 𝑎, 𝑏) ≠ ( 𝑏, 𝑎).

5.2 Cartesian Product


Cartesian Product
For any sets 𝐴 and 𝐵, the Cartesian product of 𝐴 and 𝐵 is written 𝐴 × 𝐵, and is equal to the set

( 𝑥, 𝑦 ) | 𝑥 ∈ 𝐴 and 𝑦 ∈ 𝐵

In other words, the Cartesian product 𝐴 × 𝐵 denotes a set of ordered pairs such that all the first
coordinates of the pairs are elements of set 𝐴, and all the second coordinates of the pairs are
elements of set 𝐵.

Example

𝐴 = {2, 3, 4} 𝐵 = {5, 6}


𝐴 × 𝐵 = (2, 5) , (2, 6) , (3, 5) , (3, 6) , (4, 5) , (4, 6)

𝐵 × 𝐴 = (5, 2) , (5, 3) , (5, 4) , (6, 2) , (6, 3) , (6, 4)

𝐵 × 𝐵 = (5, 5) , (5, 6) , (6, 5) , (6, 6)

𝐴 × 𝐴 = (2, 2) , (2, 3) , (2, 4) , (3, 2) , (3, 3) , (3, 4) , (4, 2) , (4, 3) , (4, 4)

45
5.3. Relation UNIT 5. RELATIONS

5.3 Relation
Relation
A subset of a Cartesian product from 𝐶 to 𝐷 is called a relation from 𝐶 to 𝐷.

Example 𝐴 = {2, 3, 4} and 𝐵 = {6, 7}. The following are some relations from 𝐴 to 𝐵

∅ (This is a subset, even though it has no elements)



(3, 7)

(2, 6) , (2, 7)

(2, 6) , (3, 6) , (4, 6)
𝐴×𝐵

Self-Assessment Exercise 5.4

𝐴 = {1, 2, 3, 4} 𝐵 = {2, 5} 𝐶 = {3, 4, 7}

List the following Cartesian products in list notation:



(a) 𝐴 × 𝐵 = (1, 2) , (1, 5) , (2, 2) , (2, 5) , (3, 2) , (3, 5) , (4, 2) , (4, 5)

(b) 𝐵 × 𝐴 = (2, 1) , (2, 2) , (2, 3) , (2, 4) , (5, 1) , (5, 2) , (5, 3) , (5, 4)
(c) ( 𝐴 ∪ 𝐵) × 𝐶

𝐴 ∪ 𝐵 = {1, 2, 3, 4, 5}

( 𝐴 ∪ 𝐵) × 𝐶 = (1, 3) , (1, 4) , (1, 7) , (2, 3) , (2, 4) , (2, 7) , (3, 3) , (3, 4) , (3, 7) ,
(4, 3) , (4, 4) , (4, 7) , (5, 3) , (5, 4) , (5, 7)

(d) ( 𝐴 + 𝐵) × 𝐵

𝐴 + 𝐵 = {1, 3, 4, 5}

( 𝐴 + 𝐵) × 𝐵 = (1, 2) , (1, 5) , (3, 2) , (3, 5) , (4, 2) , (4, 5) , (5, 2) , (5, 5)

46
UNIT 5. RELATIONS 5.3. Relation

5.3.1 Domain, Range and Codomain

Codomain
Suppose 𝑇 is a relation from 𝑋 to 𝑌 .
The codomain of 𝑇 is 𝑌 .
That is, all the possible elements that could appear as second coordinates.

Domain
Suppose 𝑇 is a relation from 𝑋 to 𝑌 .
The domain of 𝑇 , written dom(𝑇 ) is:

dom(𝑇 ) = { 𝑥 | for some 𝑦 ∈ 𝑌 , ( 𝑥, 𝑦 ) ∈ 𝑇 }

That is, all the elements that actually appear as first elements in the relation 𝑇 .

Range

Suppose 𝑇 is a relation from 𝑋 to 𝑌 .


The range of 𝑇 , written ran(𝑇 ) is:

ran(𝑇 ) = { 𝑦 | for some 𝑥 ∈ 𝑋, ( 𝑥, 𝑦 ) ∈ 𝑇 }

That is, all the elements that actually appear as second elements in the relation 𝑇 .

Domain and Range are not equal to 𝑋 and 𝑌

dom(𝑇 ) ⊆ 𝑋 . The domain of the relation is a subset of 𝑋 , but not necessarily equal to 𝑋 .
ran(𝑇 ) ⊆ 𝑌 . The range of the relation is a subset of 𝑌 , but not necessarily equal to 𝑌 .


Example Let 𝑆 = ( 𝑎, 1) , ( 𝑏, 1) , ( 𝑎, 2) be a relation from { 𝑎, 𝑏, 𝑐 } to {1, 2, 3}.
Then dom(𝑆) = { 𝑎, 𝑏} ⊆ { 𝑎, 𝑏, 𝑐 }.
And ran(𝑆) = {1, 2} ⊆ {1, 2, 3}.
The codomain of 𝑆 is the set {1, 2, 3}.

5.3.2 Binary Relation

Binary Relation

If 𝑅 is any subset of a Cartesian product 𝑋 × 𝑌 , then 𝑅 is called a binary relation from 𝑋 to 𝑌 ,


or between 𝑋 and 𝑌 .
A subset 𝑅 of 𝑋 × 𝑌 is called the rule for the relation.
If 𝑅 ⊆ 𝑋 × 𝑋 , 𝑅 is a binary relation on 𝑋 .

47
5.4. Properties of Relations UNIT 5. RELATIONS

5.4 Properties of Relations


5.4.1 Reflexivity

Reflexivity

A relation 𝑅 on 𝐴 (𝑅 ⊆ 𝐴 × 𝐴) is called reflexive on 𝐴 iff for every 𝑥 ∈ 𝐴, we have ( 𝑥, 𝑥 ) ∈ 𝑅.


In other words, every element needs to be related to itself (although it can also be related to
other elements).


Example Let 𝐴 = {2, 3, 5}. For a relation 𝑆 to be reflexive on 𝐴, (2, 2) , (3, 3) , (5, 5) needs to
be a subset of 𝑆.

(2, 2) , (3, 3) , (5, 5) ⊆ 𝑆.

Therefore, the relation (2, 2) , (3, 3) , (5, 5) (2, 3) would be a reflexive relation on 𝐴.

5.4.2 Irreflexivity

Irreflexivity

A relation 𝑅 on 𝐴 (𝑅 ⊆ 𝐴 × 𝐴) is called irreflexive iff there is no 𝑥 such that ( 𝑥, 𝑥 ) ∈ 𝑅. In other


words, for any 𝑥 ∈ 𝐴, ( 𝑥, 𝑥 ) ∉ 𝑅

Example Let 𝐴 = {2, 3, 5}.



𝑅 = (3, 2) , (2, 5) , (3, 5) .
 is irreflexive, as there is no element that relates to itself. i.e. None of the elements of
𝑅
(2, 2) , (3, 3) , (5, 5) are elements of 𝑅.

𝑆 = (2, 2) , (2, 5) , (3, 5) . 
𝑆 is not reflexive, as the elements (3, 3) , (5, 5) are not present. 𝑆 is also not irreflexive, as the
element (2, 2) is an element of 𝑆.

5.4.3 Symmetry

Symmetry

A relation 𝑅 on 𝐴 ( 𝑅 ⊆ 𝐴 × 𝐴) is called symmetric iff 𝑅 has the property that, for all 𝑥, 𝑦 ∈ 𝑅, if
( 𝑥, 𝑦 ) ∈ 𝑅, then ( 𝑦, 𝑥 ) ∈ 𝑅.

Example
 Let 𝐵 = {1, 2, 3}
𝑅1 =  (1, 2) , (2, 1) , (1, 3) , (3, 1) is symmetric and irreflexive.
𝑅2 =  (1, 1) , (2, 2) , (3, 3) , (2, 3) is reflexive, but not symmetric.
𝑅3 =  (1, 1) , (2, 2) , (3, 3) , (1, 2) , (2, 1) is symmetric and reflexive.
𝑅4 = (1, 1) , (2, 3) is not reflexive, irreflexive or symmetric.

48
UNIT 5. RELATIONS 5.4. Properties of Relations

5.4.4 Antisymmetry

Antisymmetry

A relation 𝑅 on 𝐴 (𝑅 ⊆ 𝐴 × 𝐴) is called antisymmetric iff 𝑅 has the property that, for all 𝑥, 𝑦 ∈ 𝑅,
if 𝑥 ≠ 𝑦 and ( 𝑥, 𝑦 ) ∈ 𝑅, then ( 𝑦, 𝑥 ) ∉ 𝑅.
Another definition:
A relation 𝑅 on 𝐴 (𝑅 ⊆ 𝐴 × 𝐴) is called antisymmetric iff 𝑅 has the property that, for all
𝑥, 𝑦 ∈ 𝑅, if ( 𝑥, 𝑦 ) ∈ 𝑅 and ( 𝑦, 𝑥 ) ∈ 𝑅, then 𝑥 = 𝑦 .

Example
 Let 𝐴 = { 𝑎, 𝑏, 𝑐 }
𝑃 = ( 𝑎, 𝑏) , ( 𝑏, 𝑏) , ( 𝑏, 𝑐) on 𝐴.
𝑎 ≠ 𝑏, ( 𝑎, 𝑏) ∈ 𝑃 , but ( 𝑏, 𝑎) ∉ 𝑃 .
𝑏 ≠ 𝑐, ( 𝑏, 𝑐) ∈ 𝑃 , but ( 𝑐, 𝑏) ∉ 𝑃 .
∴ 𝑃 is antisymmetric on 𝐴.

Antisymmetric and Not Symmetric Are Not The Same

A relation can be both not antisymmetric and symmetric at the same time. Consider the relation:
𝑅 = {(1, 2) , (2, 1) , (2, 3)} on 𝐴 = {1, 2, 3}.
This relation is not symmetric, as (2, 3) ∈ 𝑅, but (3, 2) ∉ 𝑅.
This relation is also not antisymmetric, since (1, 2) and (2, 1) are elements of 𝑅, but 1 ≠ 2.

5.4.5 Transitivity

Transitivity

A relation 𝑅 on 𝐴 ( 𝑅 ⊆ 𝐴 × 𝐴) is called transitive iff 𝑅 has the property that, for all 𝑥, 𝑦, 𝑧 ∈ 𝑅,
whenever ( 𝑥, 𝑦 ) ∈ 𝑅 and ( 𝑦, 𝑧) ∈ 𝑅, then ( 𝑥, 𝑧 ) ∈ 𝑅.

Example If (1, 2) ∈ 𝑅 and (2, 3) ∈ 𝑅, then (1, 3) must be in 𝑅.


Example Let 𝑅 = (1, 1) , (2, 2) , (1, 2) , (2, 1) be a relation on 𝐴 = {1, 2, 3}. This relation is
transitive:
(2, 1) and (1, 2) mean (2, 2) should be present.
Can be done with all possible combinations.

49
5.4. Properties of Relations UNIT 5. RELATIONS

5.4.6 Trichotomy

Trichotomy

A relation 𝑅 on 𝐴 satisfies trichotomy iff, for every 𝑥 and 𝑦 chosen from 𝐴 such that 𝑥 ≠ 𝑦 , 𝑥
and 𝑦 are comparable.
In other words, for every 𝑥 ≠ 𝑦 , every element is related to every other element. So 𝑥𝑅 𝑦 or 𝑦𝑅𝑥 .


Example Let 𝑆 = (3, 2) , (2, 1) , (3, 1) be a relation on 𝐴 = {1, 2, 3}.
𝑆 satisfies the requirements for trichotomy, since:

1 is related to 2 in (2, 1) and related to 3 in (3, 1).


2 is related to 1 in (2, 1) and related to 3 in (3, 2).
3 is related to 1 in (3, 1) and related to 2 in (3, 2).

5.4.7 Inverse Relation


Inverse Relation

Given a relation 𝑅 with domain 𝐴 and range 𝐵, the relation 𝑅 −1 with domain 𝐵 and range 𝐴 is
called the inverse of 𝑹, and is defined such that:

( 𝑥, 𝑦 ) ∈ 𝑅 iff ( 𝑦, 𝑥 ) ∈ 𝑅 −1


Example Let 𝑋 = 𝑎, 𝑏, 𝑐 and 𝑅 = ( 𝑎, 𝑏) , ( 𝑏, 𝑐) , ( 𝑎, 𝑐)
Then 𝑅 −1 = ( 𝑏, 𝑎) , ( 𝑐, 𝑏) , ( 𝑐, 𝑎)


5.4.8 Relation Composition

Relation Composition

Given relations 𝑅 from 𝐴 to 𝐵 and 𝑆 from 𝐵 to 𝐶 , the composition of 𝑅 followed by 𝑆, written


𝑆 ◦ 𝑅 or 𝑅; 𝑆 isthe relation from 𝐴 to 𝐶 defined by:
𝑆 ◦ 𝑅 = 𝑅; 𝑆 = ( 𝑎, 𝑐) | there is some 𝑏 ∈ 𝐵 such that ( 𝑎, 𝑏) ∈ 𝑅 and ( 𝑏, 𝑐) ∈ 𝑆


Example Let 𝑅 = (1, 𝑎) , (2, 𝑏) be a relation from {1, 2} to { 𝑎, 𝑏}
Let 𝑆 = ( 𝑎, 𝑠) , ( 𝑏, 𝑠) , ( 𝑏, 𝑡 ) be a relation from { 𝑎, 𝑏} to { 𝑠, 𝑡 }.
Then 𝑆 ◦ 𝑅 = 𝑅; 𝑆.
(1, 𝑎) → ( 𝑎, 𝑠) → (1, 𝑠)
(2, 𝑏) → ( 𝑏, 𝑠) → (2, 𝑠)
(2, 𝑏) → ( 𝑏, 𝑡 ) → (2, 𝑡 )

𝑆 ◦ 𝑅 = 𝑅; 𝑆 = (1, 𝑠) , (2, 𝑠) , (2, 𝑡 )

50
UNIT 5. RELATIONS 5.4. Properties of Relations

Self Assessment Activity 5.8


1. Let 𝑷 and 𝑹 be relations on 𝑨 = 1, 2, 3, {1}, {2} , where
n   o n      o
𝑷 = 1, {1} , 1, 2 and 𝑹 = 1, {1} , 1, 3 , 2, {1} , 2, {2} , {1}, 3 , {2}, {1}

(a) Is 𝑹 irreflexive?
Yes. There are no elements that are related to themselves.
(b) Is 𝑹 reflexive?
No. There are no elements that are related to themselves.
(c) Is 𝑹 symmetric?
 
No. 1, {1} ∈ 𝑅, but {1}, 1 ∉ 𝑅.
(d) Is 𝑹 antisymmetric?
Yes.  
1, {1}
 ∈ 𝑅, and {1}  , 1 ∉ 𝑅.
1, 3 ∈ 𝑅, and 3, 1 ∉ 𝑅.
2, {1}  ∈ 𝑅, and {1}, 2 ∉ 𝑅.
2, {2}  ∈ 𝑅, and {2}, 2 ∉ 𝑅.
{1}, 3 ∈ 𝑅, and 3, {1} ∉ 𝑅.
{2}, {1} ∈ 𝑅, and {1}, {2} ∉ 𝑅.
(e) Is 𝑹 transitive?
  
No. 2, {1} ∈ 𝑅, and {1}, 3 ∈ 𝑅, but 2, 3 ∉ 𝑅
(f) Does 𝑹 satisfy the requirement for trichotomy?
No. There is no pair where 1 is related to 2.
(g) Determine the relation 𝑹 ◦ 𝑹.
𝑅 ◦ 𝑅 = 𝑅; 𝑅.
  
1, {1}
 → {1} , 3 → 1, 3
1, 3 ↛   
2, {1}  → {1}, 3 →  2 ,3

2, {2}  → {2}, {1} → 2, {1}
{1}, 3 ↛   
{2}, {1} → {1}, 3 → {2}, 3
n    o
𝑅 ◦ 𝑅 = 𝑅; 𝑅 = 1, 3 , 2, 3 , 2, {1} , {2}, 3

(h) Determine the relation 𝑹 ◦ 𝑷 . 𝑅 ◦ 𝑃 = 𝑃 ; 𝑅.


  
1, {1}
 → {1} , 3 → 1, 3
 
1, 2 → 2, {1}  → 1, {1} 
1, 2 → 2, {2} → 1, {2}
n   o
𝑅 ◦ 𝑃 = 𝑅; 𝑅 = 1, 3 , 1, {1} , 1, {2}

51
5.4. Properties of Relations UNIT 5. RELATIONS

(i) Give the subset 𝑻 of 𝑹 where (𝒂, 𝑩) ∈ 𝑻 iff 𝒂 ∈ 𝑩.


n  o
𝑇 = 1, {1} , 2, {2}

2. Let 𝑨 = { 𝒂, 𝒃}. For each of the specifications given below, find suitable examples of
relations on P( 𝑨)

P ( 𝐴) = ∅, { 𝑎}, { 𝑏}, { 𝑎, 𝑏}
n    
P ( 𝐴) × P ( 𝐴) = ∅, ∅ , ∅, { 𝑎} , ∅, { 𝑏} , ∅, { 𝑎, 𝑏}
   
{ 𝑎}, ∅ , { 𝑎}, { 𝑎} , { 𝑎}, { 𝑏} , { 𝑎}, { 𝑎, 𝑏}
   
{ 𝑏}, ∅ , { 𝑏}, { 𝑎} , { 𝑏}, { 𝑏} , { 𝑏}, { 𝑎, 𝑏}
   o
{ 𝑎, 𝑏}, ∅ , { 𝑎, 𝑏}, { 𝑎} , { 𝑎, 𝑏}, { 𝑏} , { 𝑎, 𝑏}, { 𝑎.𝑏}

(a) 𝑹 is reflexive, symmetric and transitive on P( 𝑨)

Reflexivity To be reflexive, these pairs need to appear:


   
∅, ∅ , { 𝑎}, { 𝑎} , { 𝑏}, { 𝑏} , { 𝑎, 𝑏}, { 𝑎, 𝑏}

Symmetry Whichever pair is added, the pair that makes it symmetric needs to be
added too.
 
If ∅, { 𝑎} is added, then { 𝑎}, ∅ needs to be added.
Examples Two relations that meet these requirements are:
n    o
𝑅1 = ∅, ∅ , { 𝑎}, { 𝑎} , { 𝑏}, { 𝑏} , { 𝑎, 𝑏}, { 𝑎, 𝑏}
n      o
𝑅2 = ∅, ∅ , { 𝑎}, { 𝑎} , { 𝑏}, { 𝑏} , { 𝑎, 𝑏}, { 𝑎, 𝑏} , ∅, { 𝑎} , { 𝑎}, ∅

(b) 𝑹 is reflexive and symmetric, but not transitive on P( 𝑨)

Reflexivity To be reflexive, these pairs need to appear:


   
∅, ∅ , { 𝑎}, { 𝑎} , { 𝑏}, { 𝑏} , { 𝑎, 𝑏}, { 𝑎, 𝑏}

Symmetry Whichever pair is added, the pair that makes it symmetric needs to be
added too.
 
If ∅, { 𝑎} is added, then { 𝑎}, ∅ needs to be added
Transitivity In order for the relation to not be transitive, two elements need to be
added (for symmetry) where the first element is the second element of another
pair, and the second element is the first element of a different pair.
 
If { 𝑎}, { 𝑎, 𝑏} and { 𝑎, 𝑏}, { 𝑎} are added.
∅, { 𝑎} → { 𝑎}, { 𝑎, 𝑏} ↛ ∅, { 𝑎, 𝑏}
n    
Example 𝑅3 = ∅, ∅ , { 𝑎}, { 𝑎} , { 𝑏}, { 𝑏} , { 𝑎, 𝑏}, { 𝑎, 𝑏} ,
   o
∅, { 𝑎} , { 𝑎}, ∅ , { 𝑎}, { 𝑎, 𝑏} , { 𝑎, 𝑏}, { 𝑎}

52
UNIT 5. RELATIONS 5.4. Properties of Relations

(c) 𝑹 is reflexive and transitive, but not symmetric, and not antisymmetric on P( 𝑨)

Reflexivity To be reflexive, these pairs need to appear:


   
∅, ∅ , { 𝑎}, { 𝑎} , { 𝑏}, { 𝑏} , { 𝑎, 𝑏}, { 𝑎, 𝑏}

Symmetry For the relation to not be symmetric, at least one pair cannot be flipped.
 
If ∅, { 𝑎} is added, then { 𝑎}, ∅ is not added.
Adding this single element would still mean 𝑅 is transitive.
Antisymmetry For the  relation to not be antisymmetric,
 at least one pair can be
flipped. If ∅, { 𝑏} is added, then { 𝑏}, ∅ is added.
n    
Example 𝑅4 = ∅, ∅ , { 𝑎}, { 𝑎} , { 𝑏}, { 𝑏} , { 𝑎, 𝑏}, { 𝑎, 𝑏} ,
  o
∅, { 𝑎} , ∅, { 𝑏} , { 𝑏}, ∅

(d) 𝑹 is simultaneuosly symmetric and antisymmetric on P( 𝑨)

Antisymmetry If there are no elements that are not equal to each other, then 𝑅 is
vacuously antisymmetric.
Symmetry If every element is equal to each other, then every element is symmetric
with itself.
n    o
Example 𝑅5 = ∅, ∅ , { 𝑎}, { 𝑎} , { 𝑏}, { 𝑏} , { 𝑎, 𝑏}, { 𝑎, 𝑏}

(e) 𝑹 is irreflexive, antisymmetric and transitive on P( 𝑨)

Irreflexitivity None of these pairs appear in 𝑅:


   
∅, ∅ , { 𝑎}, { 𝑎} , { 𝑏}, { 𝑏} , { 𝑎, 𝑏}, { 𝑎, 𝑏}

Antisymmetry No pairs ( 𝑥, 𝑦 ) and ( 𝑦, 𝑥 ) appear in 𝑅.


Transitivity Can go from one pair to the next.
n   o
Example 𝑅6 = ∅, { 𝑎} , { 𝑎}, { 𝑎, 𝑏} , ∅, { 𝑎, 𝑏}

3. Prove that if 𝑹 is a relation on 𝑿 , then 𝑹 is transitive iff 𝑹 ◦ 𝑹 ⊆ 𝑹.

Proof.
(i) If 𝑹 is transitive, then 𝑹 ◦ 𝑹 ⊆ 𝑹

Subproof.
Assume 𝑅 is transitive.
Suppose ( 𝑥, 𝑧 ) ∈ 𝑅 ◦ 𝑅.
Then there is some 𝑦 ∈ 𝑋 such that ( 𝑥, 𝑦 ) ∈ 𝑅 and ( 𝑦, 𝑧) ∈ 𝑅
(By definition of composition)
And ( 𝑥, 𝑧 ) ∈ 𝑅
(Because 𝑅 is transitive)
∴ if 𝑅 is transitive, then 𝑅 ◦ 𝑅 ⊆ 𝑅 □

53
5.4. Properties of Relations UNIT 5. RELATIONS

(ii) If 𝑹 ◦ 𝑹 ⊆ 𝑹, then 𝑹 is transitive

Subproof.
Assume 𝑅 ◦ 𝑅 ⊆ 𝑅.
Suppose ( 𝑥, 𝑦 ) ∈ 𝑅 and ( 𝑦, 𝑧) ∈ 𝑅.
Then ( 𝑥, 𝑧 ) ∈ 𝑅 ◦ 𝑅.
(By definition of composition)
And ( 𝑥, 𝑧 ) ∈ 𝑅
(Because 𝑅 ◦ 𝑅 ⊆ 𝑅)
∴ if ( 𝑥, 𝑦 ) ∈ 𝑅 and ( 𝑦, 𝑧) ∈ 𝑅, then ( 𝑥, 𝑧 ) ∈ 𝑅
∴ if 𝑅 ◦ 𝑅 ⊆ 𝑅, then 𝑅 is transitive. □

∴ 𝑅 is transitive iff 𝑅 ◦ 𝑅 ⊆ 𝑅. ■
Unit 6

Special Kinds of Relation

6.1 Order Relations


6.1.1 Weak Partial Order
Weak Partial Order
A relation 𝑅 on a set 𝐴 is called a weak partial order iff 𝑅 is
• reflexive on 𝐴
• antisymmetric, and
• transitive


Example Let 𝐴 = { 𝑎}, { 𝑎, 𝑏} . A relation 𝑆 on 𝐴 is defined by ( 𝐵, 𝐶 ) ∈ 𝑆 iff 𝐵 ⊆ 𝐶 . (Each first
coordinate is a subset of the second coordinate.)
n   o
𝑆 = { 𝑎}, { 𝑎} , { 𝑎}, { 𝑎, 𝑏} , { 𝑎, 𝑏}, { 𝑎, 𝑏}

To prove this is a weak partial order, prove reflexivity, antisymmetry and transitivity.
Reflexivity Is it true that ( 𝐵, 𝐵) ∈ 𝑆 for all 𝐵 ∈ 𝐴? Yes.
 
{ 𝑎, 𝑎} ∈ 𝑆 { 𝑎, 𝑏}, { 𝑎, 𝑏} ∈ 𝑆

Antisymmetry Is it true that for all ( 𝐵, 𝐶 ) ∈ 𝐴, if 𝐵 ≠ 𝐶 , and ( 𝐵, 𝐶 ) ∈ 𝑆, then (𝐶, 𝐵) ∉ 𝑆? Yes.


The elements  where 𝐵 ≠ 𝐶 are {𝑎} and { 𝑎, 𝑏}.
{ 𝑎}, { 𝑎, 𝑏} ∈ 𝑆, and { 𝑎, 𝑏}, { 𝑎} ∉ 𝑆
Transitivity Is it true that for all 𝐵, 𝐶, 𝐷 ∈ 𝐴, if ( 𝐵, 𝐶 ) ∈ 𝑆, and (𝐶, 𝐷) ∈ 𝑆, then ( 𝐵, 𝐷) ∈ 𝑆? Yes.
  
{ 𝑎}, { 𝑎} ∈ 𝑆 → { 𝑎}, { 𝑎} ∈ 𝑆 → { 𝑎}, { 𝑎} ∈ 𝑆
  
{ 𝑎}, { 𝑎} ∈ 𝑆 → { 𝑎, }, { 𝑎, 𝑏} ∈ 𝑆 → { 𝑎}, { 𝑎, 𝑏} ∈ 𝑆

The above can be done for all elements.


Weak Partial Order As 𝑆 is reflexive, antisymmetric, and transitive, 𝑆 is a weak partial order.

55
6.1. Order Relations UNIT 6. SPECIAL KINDS OF RELATION

Activity 6.4

Determine whether the following relations are weak partial orders.



(a) Let 𝑨 = 𝒂, 𝒃, { 𝒂, 𝒃} . 𝑺 is the relation on 𝑨 defined by (𝒄, 𝑩) ∈ 𝑺 iff 𝒄 ∈ 𝑩.

𝑆 = ( 𝑎, { 𝑎, 𝑏}) , ( 𝑏, { 𝑎, 𝑏})

Reflexivity Is it true that ( 𝑥, 𝑥 ) ∈ 𝑆 for all 𝑥 ∈ 𝐴?


No. Using a counterexample: ( 𝑎, 𝑎) ∉ 𝑆.
Can stop here and conclude that 𝑆 is not a weak partial order, but for completeness,
checking the other two conditions as well.
Antisymmetry Is it true for all ( 𝑥, 𝑦 ) ∈ 𝐴, if 𝑥 ≠ 𝑦 , and ( 𝑥, 𝑦 ) ∈ 𝑆, then ( 𝑦, 𝑥 ) ∉ 𝑆?
Yes. If ( 𝑥, 𝑦 ) ∈ 𝑆, then 𝑥 ∈ 𝑦 . If 𝑥 ∈ 𝑦 , then 𝑦 cannot be an element of 𝑥 , so ( 𝑦, 𝑥 ) ∉ 𝑆.
Transitivity Is it true for all 𝑥, 𝑦, 𝑧 ∈ 𝐴, if ( 𝑥, 𝑦 ) ∈ 𝑆, and ( 𝑦, 𝑧) ∈ 𝑆𝑆, then ( 𝑥, 𝑧) ∈ 𝑆?
Yes. Vacuously true, as there is no element that has the same first coordinate as
another element’s second doordinate.
Weak Partial Order As 𝑆 is not reflexive, 𝑆 is not a weak partial order.
(b) 𝑹 ⊆ Z × Z such that 𝒙 𝑹 𝒚 iff 𝒙 + 𝒚 is even.
If 𝑥 + 𝑦 is even, then 𝑥 + 𝑦 = 2𝑘 for some integer 𝑘.
Reflexivity Is it true that ( 𝑥, 𝑥 ) ∈ 𝑅 for all 𝑥 ∈ Z?
Yes. 𝑥 + 𝑥 = 2 𝑥 , which would be part of 𝑅 if 𝑘 = 𝑥 . As 2𝑥 is always even, ( 𝑥, 𝑥 ) ∈ 𝑅.
Antisymmetry Is it true that for all ( 𝑥, 𝑦 ) ∈ 𝑅, if 𝑥 ≠ 𝑦 and ( 𝑥, 𝑦 ) ∈ 𝑅, then ( 𝑦, 𝑥 ) ∉ 𝑅?
No. Let ( 𝑥, 𝑦 ) ∈ 𝑅. Then 𝑥 + 𝑦 = 2𝑘. But ( 𝑦 + 𝑥 ) also equals 2𝑘. So ( 𝑦, 𝑥 ) ∈ 𝑅.
Can stop here and conclude that 𝑅 is not a weak partial order. For completeness,
checking transitivity as well.
Transitivity Is it true that for all 𝑥, 𝑦, 𝑧 ∈ Z, if ( 𝑥, 𝑦 ) ∈ 𝑅 and ( 𝑦, 𝑧) ∈ 𝑅, then ( 𝑥, 𝑧 ) ∈ 𝑅?
Yes. Let ( 𝑥, 𝑦 ) ∈ 𝑅, and ( 𝑦, 𝑧) ∈ 𝑅. Then 𝑥 + 𝑦 = 2𝑘, and 𝑦 + 𝑧 = 2𝑚, where 𝑘 and 𝑚
are integers.

𝑥 + 𝑦 = 2𝑘
𝑥 = 2𝑘 − 𝑦
𝑦 + 𝑧 = 2𝑚
𝑧 = 2𝑚 − 𝑦
𝑥 + 𝑧 = (2𝑘 − 𝑦 ) + (2𝑚 − 𝑦 )
= 2 𝑘 + 2𝑚 − 2 𝑦
= 2( 𝑘 + 𝑚 − 𝑦 )

From the above, if 𝑥 + 𝑦 is even, and 𝑦 + 𝑧 is even, then 𝑥 + 𝑧 is also even.


Weak Partial Order As 𝑅 is not antisymmetric, 𝑅 is not a weak partial order.

56
UNIT 6. SPECIAL KINDS OF RELATION 6.1. Order Relations

(c) 𝑹 on Z × Z by (𝒂, 𝒃) 𝑹 (𝒄, 𝒅 ) if either 𝒂 < 𝒄 or (𝒂 = 𝒄 and 𝒃 ≤ 𝒅 ).

Reflexivity Is it true that for all ( 𝑎, 𝑏) ∈ Z × Z, ( 𝑎, 𝑏) 𝑅 ( 𝑎, 𝑏)?


Yes. It is never the case that 𝑎 < 𝑎, but 𝑎 = 𝑎 and 𝑏 ≤ 𝑏 is true.
Antisymmetry
 Is it true that  for all ( 𝑎, 𝑏) and ( 𝑐, 𝑑 ) ∈ Z × Z, if ( 𝑎, 𝑏) ≠ ( 𝑐, 𝑑 ) and
( 𝑎, 𝑏) , ( 𝑐, 𝑑 ) ∈ 𝑅, then ( 𝑐, 𝑑 ) , ( 𝑎, 𝑏) ∉ 𝑅?
Yes. If ( 𝑎, 𝑏) 𝑅 ( 𝑐, 𝑑 ), then 𝑎 < 𝑐 or ( 𝑎 = 𝑐 and 𝑏 ≤ 𝑑 ). If the first case is matched, then
𝑎 < 𝑐, which means that 𝑐 > 𝑎. Which means that 𝑐 ≠ 𝑎, so the second condition is
not met.
If the second case is matched, then 𝑎 = 𝑐 and 𝑏 ≤ 𝑑 . If 𝑎 = 𝑐, then 𝑐 = 𝑎, and if 𝑏 ≤ 𝑑 ,
then 𝑑 ≥ 𝑏. However, if 𝑏 = 𝑑 , then ( 𝑎, 𝑏) = ( 𝑐, 𝑑 ), which would mean it would be
excluded. Therefore 𝑑 < 𝑏, which means that ( 𝑐, 𝑑 ) , ( 𝑎, 𝑏) ∉ 𝑅.
  
Transitivity If ( 𝑎, 𝑏) , ( 𝑐, 𝑑 ) ∈ 𝑅 and ( 𝑐, 𝑑 ) , ( 𝑒, 𝑓 ) ∈ 𝑅, is ( 𝑎, 𝑏) , ( 𝑒, 𝑓 ) ∈ 𝑅?
Yes.

If  ( 𝑎, 𝑏) , ( 𝑐, 𝑑 ) ∈ 𝑅, then either 𝑎 < 𝑐 or ( 𝑎 = 𝑐 and 𝑏 ≤ 𝑑 ).
If ( 𝑐, 𝑑 ) , ( 𝑒, 𝑓 ) ∈ 𝑅, then either 𝑐 < 𝑒 or ( 𝑐 =
 𝑒 and 𝑑 ≤ 𝑓 ).
If 𝑎 < 𝑐 and 𝑐 < 𝑒, then 𝑎 < 𝑒, which means ( 𝑎, 𝑏) , ( 𝑒, 𝑓 ) ∈ 𝑅.
If 𝑎 < 𝑐 and 𝑐 = 𝑒 and 𝑑 ≤ 𝑓 , then 𝑎 < 𝑒, which means  ( 𝑎, 𝑏) , ( 𝑒, 𝑓 ) ∈ 𝑅.
If 𝑎 = 𝑐 and 𝑏 ≤ 𝑑 and 𝑐 < 𝑒, then 𝑎 < 𝑒, which means ( 𝑎, 𝑏) , ( 𝑒, 𝑓 ) ∈ 𝑅.
If
 𝑎 = 𝑐 and 𝑏 ≤ 𝑑 and 𝑐 = 𝑒 and 𝑑 ≤ 𝑓 , then 𝑐 = 𝑒, and 𝑏 ≤ 𝑓 , which means
( 𝑎, 𝑏) , ( 𝑒, 𝑓 ) ∈ 𝑅.
Weak Partial Order As 𝑅 is reflexive, antisymmetric and transitive, 𝑅 is a weak partial
order.

57
6.1. Order Relations UNIT 6. SPECIAL KINDS OF RELATION

6.1.2 Strict Partial Order


Strict Partial Order
A relation 𝑅 on a set 𝐴 is called a strict partial order iff 𝑅 is
• irreflexive on 𝐴
• antisymmetric, and
• transitive


Example Let 𝐴 = {1, 2, 3} and let 𝑆 on 𝐴 be the relation 𝑆 = (1, 2) , (1, 3) , (2, 3) . (Every first
coordinate is less than the second coordinate.)
To prove this is a strict partial order, prove irreflexivity, antisymmetry and transitivity.
Irreflexivity Is it true that ( 𝑥, 𝑥 ) ∉ 𝑆 for any 𝑥 ∈ 𝐴?
Yes, no element is related to itself, i.e. the pairs (1, 1), (2, 2) and (3, 3) are not elements
of 𝑆.
Antisymmetry Is it true that for all 𝑥, 𝑦 ∈ 𝐴, if ( 𝑥, 𝑦 ) ∈ 𝑆, then ( 𝑦, 𝑥 ) ∉ 𝑆?
Yes. 1 ≠ 2 and (1, 2) ∈ 𝑆 and (2, 1) ∉ 𝑆.
1 ≠ 3 and (1, 3) ∈ 𝑆 and (3, 1) ∉ 𝑆.
2 ≠ 3 and (2, 3) ∈ 𝑆 and (3, 2) ∉ 𝑆.
Transitivity Is it true that for all 𝑥, 𝑦, 𝑧 ∈ 𝐴, if ( 𝑥, 𝑦 ) ∈ 𝑆 and ( 𝑦, 𝑧) ∈ 𝑆, then ( 𝑥, 𝑧 ) ∈ 𝑆?
Yes. (1, 2) ∈ 𝑆 and (2, 3) ∈ 𝑆 and (1, 3) ∈ 𝑆.
Strict Partial Order As 𝑆 is irreflexive, antisymmetric, and transitive, 𝑆 is a strict partial order.

Activity 6.5

Determine whether the following relations are strict partial orders.


 n  o
(a) 𝑨 = 𝒂, { 𝒂}, { 𝒃} and the relation 𝑺 on 𝑨 is 𝑺 = 𝒂, { 𝒂} , 𝒂, { 𝒃}

Irreflexivity Is it true that ( 𝑥, 𝑥 ) ∉ 𝑆 for any 𝑥 ∈ 𝐴?   


Yes, no element is related to itself, i.e. the pairs 𝑎, 𝑎 , { 𝑎}, { 𝑎} and { 𝑏}, { 𝑏} are
not elements of 𝑆.
Antisymmetry Is it true that for all 𝑥, 𝑦 ∈ 𝐴 and 𝑥 ≠ 𝑦 , if ( 𝑥, 𝑦 ) ∈ 𝑆, then ( 𝑦, 𝑥 ) ∉ 𝑆?
Yes. 𝑎 ≠ { 𝑎}. 𝑎, { 𝑎} ∈ 𝑆, and {𝑎}, 𝑎 ∉ 𝑆.
𝑎 ≠ { 𝑏}. 𝑎, { 𝑏} ∈ 𝑆, and { 𝑏}, 𝑎 ∉ 𝑆.

Transitivity Is it true that for all 𝑥, 𝑦, 𝑧 ∈ 𝐴, if ( 𝑥, 𝑦 ) ∈ 𝑆 and ( 𝑦, 𝑧) ∈ 𝑆, then ( 𝑥, 𝑧) ∈ 𝑆?


Yes. There are no ordered pairs such that ( 𝑥, 𝑦 ) ∈ 𝑅 and ( 𝑦, 𝑧) ∈ 𝑅, so 𝑅 is vacuously
transitive.
Strict Partial Order As 𝑅 is irreflexive, antisymmetric, and transitive, 𝑅 is a strict partial
order.

58
UNIT 6. SPECIAL KINDS OF RELATION 6.1. Order Relations

(b) 𝑹 ⊆ (Z × Z) × (Z × Z) such that (𝒂, 𝒃) 𝑹 (𝒄, 𝒅 ) iff 𝒂 < 𝒄.



Irreflexivity Is it true that ( 𝑎, 𝑏) , ( 𝑎, 𝑏) ∉ 𝑅 for any ( 𝑎, 𝑏) ∈ Z × Z?
Yes. For ( 𝑎, 𝑏) , ( 𝑎, 𝑏) ∈ 𝑅, it would need to satisfy the requirement 𝑎 < 𝑎, which is
never true.
Antisymmetry Is it true that for all ( 𝑎, 𝑏) , ( 𝑐, 𝑑 ) ∈ Z × Z, where ( 𝑎, 𝑏) ≠ ( 𝑐, 𝑑 ),
if (( 𝑎, 𝑏) , ( 𝑐, 𝑑 )) ∈ 𝑅, then (( 𝑐, 𝑑 ) , ( 𝑎, 𝑏)) ∉ 𝑅.
Yes. If (( 𝑎, 𝑏) , ( 𝑐, 𝑑 )) ∈ 𝑅, then 𝑎 < 𝑐. As 𝑎 < 𝑐, (( 𝑐, 𝑑 ) , ( 𝑎, 𝑏)) ∉ 𝑅.
Transitivity Is it true for all ( 𝑎, 𝑏) , ( 𝑐, 𝑑 ) , ( 𝑒, 𝑓 ) ∈ Z × Z,
if (( 𝑎, 𝑏) , ( 𝑐, 𝑑 )) ∈ 𝑅 and (( 𝑐, 𝑑 ) , ( 𝑒, 𝑓 )) ∈ 𝑅, then (( 𝑎, 𝑏) , ( 𝑒, 𝑓 )) ∈ 𝑅?
Yes. If (( 𝑎, 𝑏) , ( 𝑐, 𝑑 )) ∈ 𝑅, then 𝑎 < 𝑐. If (( 𝑐, 𝑑 ) , ( 𝑒, 𝑓 )) ∈ 𝑅, then 𝑐 < 𝑒. Therefore 𝑎 < 𝑒,
so (( 𝑎, 𝑏) , ( 𝑒, 𝑓 )) ∈ 𝑅.
Strict Partial Order As 𝑅 is irreflexive, antisymmetric, and transitive, 𝑅 is a strict partial
order.

59
6.1. Order Relations UNIT 6. SPECIAL KINDS OF RELATION

6.1.3 A Total (or Linear) Order Relation

Total Order Relation


A relation 𝑅 on a set 𝐴 is called a total or linear order if 𝑅 is a partial order on 𝐴 that also
satisfies trichotomy.

Example The example for Strict Partial Orders:



Let 𝐴 = {1, 2, 3} and let 𝑆 on 𝐴 be the relation 𝑆 = (1, 2) , (1, 3) , (2, 3) . (Every first
coordinate is less than the second coordinate.)
also satisfies trichotomy.
Trichotomy Is every element of 𝐴 related to every other element in the relation 𝑆?
Yes. 1 is related to 2 in (1, 2), and related to 3 in (1, 3).
2 is related to 1 in (1, 2), and related to 3 in (2, 3).
3 is related to 1 in (1, 3), and related to 2 in (2, 3).
Total Order Relation As this relation is a partial order relation that satisfies trichotomy, it is a
total order relation. As the relation is a strict partial order, this is a strict total order
relation.

Proof Strategies

You cannot use examples to prove a general statement, i.e, something of the from:
For all 𝑥 , or
For all pairs ( 𝑥, 𝑦 )
Instead, abstract reasoning needs to be used to produce a general proof.
However, an example can be used to show that a statement is false, which is known as a
counterexample.

Self Assesmment 6.7

1. Let 𝑿 = { 𝒂, 𝒃, 𝒄 }. Write down all strict partial orders on 𝑿 . Which of them are linear?
Strict partial orders are irreflexive, antisymmetric and transitive.
One element There are 6 relations on 𝑋 that are strict partial orders that contain only
one element:
     
( 𝑎, 𝑏) , ( 𝑎, 𝑐) , ( 𝑏, 𝑎) , ( 𝑏, 𝑐) , ( 𝑐, 𝑎) , ( 𝑐, 𝑏)
Two elements There are 6 relations on 𝑋 that are strict partial orders that contain two
elements:
    
( 𝑎, 𝑏) , ( 𝑎, 𝑐) , ( 𝑎, 𝑏) , ( 𝑐, 𝑏) , ( 𝑎, 𝑐) , ( 𝑏, 𝑐) , ( 𝑏, 𝑎) , ( 𝑏, 𝑐) , ( 𝑏, 𝑎) , ( 𝑐, 𝑎) ,
( 𝑐, 𝑎) , ( 𝑐, 𝑏)

60
UNIT 6. SPECIAL KINDS OF RELATION 6.1. Order Relations

Three elements There are 6 relations on 𝑋 that are strict partial orders that contain three
elements:
   
( 𝑎, 𝑏) , ( 𝑏, 𝑐) , ( 𝑎, 𝑐) , ( 𝑏, 𝑎) , ( 𝑎, 𝑐) , ( 𝑏, 𝑐) , ( 𝑐, 𝑏) , ( 𝑏, 𝑎) , ( 𝑐, 𝑎) , ( 𝑎, 𝑐) , ( 𝑐, 𝑏) , ( 𝑎, 𝑏) ,
( 𝑐, 𝑎) , ( 𝑎, 𝑏) , ( 𝑐, 𝑏) , ( 𝑏, 𝑐) , ( 𝑐, 𝑎) , ( 𝑏, 𝑎)
More than three elements There are no relations on 𝑋 that are strict partial orders And
contain more than three elements.
Linear For a relation to be linear, it needs to satisfy trichotomy. As there are three ele-
ments in 𝑋 the relation should contain three or more elements.
All of the strict partial relations with three elements satisfy trichotomy, and so are
linear.
2. In each of the following cases, determine whether or not 𝑹 is some sort of order
relation on the given set 𝑿 . Justify your answer.
 n  o
(a) 𝑿 = ∅, {0}, {2} and 𝑹 = ∅, {0} , ∅, {2}
𝑅 is a strict partial order.

Proof.
Reflexivity 𝑅 is not reflexive.

Counterexample. (∅, ∅) ∉ 𝑅 □

Irreflexivity 𝑅 is irreflexive.

Proof. For all 𝑥 ∈ 𝑋 , ( 𝑥, 𝑥 ) ∉ 𝑅. □

Antisymmetry 𝑅 is antisymmetric.
 
Proof.  ∅, {0} ∈ 𝑅 and  {0}, ∅ ∉ 𝑅
∅, {2} ∈ 𝑅 and {2}, ∅ ∉ 𝑅
For all elments ( 𝑥, 𝑦 ) ∈ 𝑅, ( 𝑦, 𝑥 ) ∉ 𝑅. □

Transitivity 𝑅 is transitive.

Proof. There are no elements such that the second coordinate of a pair is the
first coordinate of another pair. □

Trichotomy 𝑅 does not satisfy trichotomy.

Counterexample. There are no pairs in the relation where {0} and {2} are related
to each other. □

As 𝑅 is irreflexive, antisymmetric and transitive, but does not satisfy trichotomy, 𝑅 is


a strict partial order. ■

61
6.1. Order Relations UNIT 6. SPECIAL KINDS OF RELATION

n  o
(b) 𝑿 = ∅, {∅}, {∅} and 𝑹 =⊆. (That is, each first coordinate is a subset of the
second coordinate)
 
      
𝑅 = (∅, ∅) , {∅}, {∅} , {∅} , {∅} , ∅, {∅} , ∅, {∅}
𝑅 is a weak partial order.

Proof.
Reflexivity 𝑅 is reflexive.

Proof. For all 𝑥 in 𝑋 , ( 𝑥, 𝑥 ) ∈ 𝑅. □

Irreflexivity 𝑅 is not irreflexive.

Counterexample. (∅, ∅) ∈ 𝑅. □

Antisymmetry 𝑅 is antisymmetric.

Proof. For all elments ( 𝑥, 𝑦 ) ∈ 𝑅, ( 𝑦, 𝑥 ) ∉ 𝑅. □

Transitivity 𝑅 is transitive.

Proof. Whenever ( 𝑥, 𝑦 ) ∈ 𝑅 and ( 𝑦, 𝑧) ∈ 𝑅, ( 𝑥, 𝑧 ) ∈ 𝑅. □

Trichotomy 𝑅 does not satisfy trichotomy.



Counterexample. There are no pairs in 𝑅 where {∅} is related to {∅} . □

As 𝑅 is reflexive, antisymmetric and transitive, but does not satisfy trichotomy, 𝑅 is a


weak partial order. ■

3. 𝑿 = Z and 𝑹 =≤
𝑅 is a weak total order.

Proof.
Reflexivity 𝑅 is reflexive.

Proof. For all 𝑥 ∈ Z, 𝑥 = 𝑥 , so 𝑥 ≤ 𝑥 , so ( 𝑥, 𝑥 ) ∈ 𝑅. □

Irreflexivity 𝑅 is not irreflexive.

Counterexample. (1, 1) ∈ 𝑅 □

Antisymmetry 𝑅 is antisymmetric.

Proof. If ( 𝑥, 𝑦 ) ∈ 𝑅 and 𝑥 ≠ 𝑦 , then 𝑥 < 𝑦 .


Therefore 𝑦 ≮ 𝑥 , so ( 𝑦, 𝑥 ) ∉ 𝑅. □

62
UNIT 6. SPECIAL KINDS OF RELATION 6.1. Order Relations

Transitivity 𝑅 is transitive.

Proof. If ( 𝑥, 𝑦 ) ∈ 𝑅, then 𝑥 ≤ 𝑦 , and if ( 𝑦, 𝑧 ) ∈ 𝑅, then 𝑦 ≤ 𝑧.


If 𝑥 < 𝑦 and 𝑦 < 𝑧, then 𝑥 < 𝑧, so ( 𝑥, 𝑧 ) ∈ 𝑅.
If 𝑥 < 𝑦 and 𝑦 = 𝑧, then 𝑥 < 𝑧, so ( 𝑥, 𝑧 ) ∈ 𝑅.
If 𝑥 = 𝑦 and 𝑦 < 𝑧, then 𝑥 < 𝑧, so ( 𝑥, 𝑧 ) ∈ 𝑅.
If 𝑥 = 𝑦 and 𝑦 = 𝑧, then 𝑥 = 𝑧, so ( 𝑥, 𝑧) ∈ 𝑅.
Therefore, if ( 𝑥, 𝑦 ) ∈ 𝑅 and ( 𝑦, 𝑧) ∈ 𝑅, then ( 𝑥, 𝑧 ) ∈ 𝑅. □

Trichotomy 𝑅 satisfies trichotomy.

Proof. For all 𝑥, 𝑦 ∈ Z, either 𝑥 = 𝑦 , or 𝑥 > 𝑦 or 𝑥 < 𝑦 . If 𝑥 > 𝑦 , then 𝑦 < 𝑥 . So 𝑥 and 𝑦
are always related to each other in 𝑅. □

As 𝑅 is reflexive, antisymmetric and transitive, and satisfies trichotomy, 𝑅 is a weak total


order. ■

4. 𝑿 = Z and 𝑹 =>
𝑅 is a strict total order.

Proof.
Reflexivity 𝑅 is not reflexive.

Counterexample. (1, 1) ∉ 𝑅. □

Irreflexivity 𝑅 is irreflexive.

Proof. For all 𝑥 ∈ Z, ( 𝑥, 𝑥 ) ∉ 𝑅. That is, 𝑥 ≯ 𝑥 . □

Antisymmetry 𝑅 is antisymmetric.

Proof. If ( 𝑥, 𝑦 ) ∈ 𝑅, then 𝑥 > 𝑦 , so 𝑦 ≯ 𝑥 , so ( 𝑦, 𝑥 ) ∉ 𝑅. □

Transitivity 𝑅 is transitive.

Proof. If ( 𝑥, 𝑦 ) ∈ 𝑅, then 𝑥 > 𝑦 . If ( 𝑦, 𝑧) ∈ 𝑅, then 𝑦 > 𝑧.


Therefore 𝑥 > 𝑦 > 𝑧, i.e. 𝑥 > 𝑧, so ( 𝑥, 𝑧 ) ∈ 𝑅. □

Trichotomy 𝑅 satisfies trichotomy.

Proof. For all elements 𝑥, 𝑦 ∈ Z, if 𝑥 ≠ 𝑦 , then 𝑥 > 𝑦 or 𝑦 > 𝑥 , so either ( 𝑥, 𝑦 ) ∈ 𝑅, or


( 𝑦, 𝑥 ) ∈ 𝑅 □

As 𝑅 is irreflexive, antisymmetric and transitive, and satisfies trichotomy, 𝑅 is a strict total


order. ■

63
6.1. Order Relations UNIT 6. SPECIAL KINDS OF RELATION

5. 𝑿 ∈ Z+ and 𝒙 𝑹 𝒚 iff 𝒙 divides into 𝒚 with zero remainder. 𝒚 = 𝒌𝒙 for some 𝒌 ∈ Z+ . 𝒙


is a factor of 𝒚 and 𝒚 is a muliple of 𝒙 .
Some example elements of 𝑅 are (2, 8), (7, 21), (6, 36), (1, 1).
𝑅 is a weak partial order.

Proof.
Reflexivity 𝑅 is reflexive.

Proof. For all 𝑥 ∈ Z+ , ( 𝑥, 𝑥 ) ∈ 𝑅, as

𝑦 = 𝑘𝑥 ( 𝑘 ∈ Z+ )
= (1) 𝑥
=𝑥 □

Irreflexivity 𝑅 is not irreflexive.

Counterexample. (1, 1) ∈ 𝑅 □

Antisymmetry 𝑅 is antisymmetric.

Proof. For all 𝑥, 𝑦 ∈ Z+ , where 𝑥 ≠ 𝑦 , let 𝑦 = 𝑘𝑥 .


Let 𝑥 = 𝑚𝑦 . Then 𝑦 = 𝑘 ( 𝑚𝑦 ) = ( 𝑘𝑚) 𝑦 . So 𝑘𝑚 = 1. That means 𝑥 = 𝑦 , but that was
assumed to be false.
So, if ( 𝑥, 𝑦 ) ∈ 𝑅, then ( 𝑦, 𝑥 ) ∉ 𝑅. □

Transitive 𝑅 is transitive.

Proof. Let ( 𝑥, 𝑦 ) ∈ 𝑅 and ( 𝑦, 𝑧) ∈ 𝑅. That means that 𝑦 = 𝑘𝑥 , where 𝑘 ∈ Z+ , and


𝑧 = 𝑚𝑦 , where 𝑚 ∈ Z+ .
As 𝑧 = 𝑚𝑦 , that means 𝑧 = 𝑚 ( 𝑘𝑥 ), i.e. 𝑧 = ( 𝑘𝑚) 𝑥 . 𝑘𝑚 is also an element of Z+ , so
( 𝑥, 𝑧) ∈ 𝑅. □

Trichotomy 𝑅 does not satisfy trichotomy.

Counterexample. There are no elements of 𝑅 where 2 is related to 3. □

As 𝑅 is reflexive, antisymmetric and transitive, and does not satisfy trichotomy, 𝑅 is a weak
partial order. ■

64
UNIT 6. SPECIAL KINDS OF RELATION 6.2. Equivalence Relation

6.2 Equivalence Relation

Equivalence Relation

A relation 𝑅 on a set 𝐴 is called an equivalence relation if 𝑅 is:


• reflexive on 𝐴
• symmetric, and
• transitive

Example Let 𝐴 be the set of real numbers. A relation 𝑅 on 𝐴 is defined as ( 𝑥, 𝑦 ) ∈ 𝑅 iff 𝑥 = 𝑦 .


Reflexivity Is it true that ( 𝑥, 𝑥 ) ∈ 𝑅 for all 𝑥 ∈ 𝐴?
Yes. If 𝑥 = 𝑥 , then ( 𝑥, 𝑥 ) ∈ 𝑅, and 𝑥 = 𝑥 is always true.
Symmetry Is it true that if ( 𝑥, 𝑦 ) ∈ 𝑅, then ( 𝑦, 𝑥 ) ∈ 𝑅?
Yes. If ( 𝑥, 𝑦 ) ∈ 𝑅, then 𝑥 = 𝑦 . But if 𝑥 = 𝑦 , then 𝑦 = 𝑥 , so ( 𝑦, 𝑥 ) ∈ 𝑅.
Transitivity Is it true that is ( 𝑥, 𝑦 ) ∈ 𝑅, and ( 𝑦, 𝑧 ) ∈ 𝑅, then ( 𝑥, 𝑧 ) ∈ 𝑅?
Yes. If ( 𝑥, 𝑦 ) ∈ 𝑅, then 𝑥 = 𝑦 . And if ( 𝑦, 𝑧) ∈ 𝑅, then 𝑦 = 𝑧. So 𝑥 = 𝑦 = 𝑧, i.e. 𝑥 = 𝑧, i.e.
( 𝑥, 𝑧 ) ∈ 𝑅.
Equivalence Relation As 𝑅 is reflexive, symmetric and transitive, 𝑅 is an equivalence relation.

Equivalence relations are used to group related data together based on a specific characteristic.

Example Students get marked for an assignment using grades from A to E. All students who
get an A would be in the same equivalence class, even if their individual marks are different.

6.2.1 Equivalence Class

Equivalence Class

For each 𝑥 ∈ 𝐴, the equivalence class [ 𝑥 ] = { 𝑦 | 𝑦 ∈ 𝐴 and 𝑥 𝑅 𝑦 }

Example Let 𝑅 be the relation on Z defined by ( 𝑥, 𝑦 ) ∈ 𝑅 iff 𝑦 − 𝑥 is even.


That is, 𝑅 = { 𝑦 | 𝑦 − 𝑥 = 2𝑘 } for some 𝑘 ∈ Z. So,
[ 𝑥 ] = { 𝑦 | 𝑦 − 𝑥 = 2𝑘 }
= { 𝑦 | 𝑦 = 2𝑘 + 𝑥 }
Then substitute elements of 𝑥 until there are no more equivalence classes.
[0] = { 𝑦 = 2𝑘 }
= { . . . , −6, −4, −2, 0, 2, 4, 6, . . . } = [2] = [4] . . .
[1] = { 𝑦 = 2𝑘 + 1}
= { . . . , −5, −3, −1, 1, 3, 5, 7, . . . } = [3] = [5] . . .
[0] is the set of even integers, and [1] is the set of odd integers.
 equivalence classes would be the parts of the partition 𝑆 of the set Z on the relation
These two
𝑅: 𝑆 = [0] , [1]

65
6.2. Equivalence Relation UNIT 6. SPECIAL KINDS OF RELATION

Self-Assessment Exercise 6.10

1. Let 𝑿 = { 𝒂, 𝒃, 𝒄 }. Write down all equivalence relations on 𝑿 .


For an equivalence relation, the relation needs to be reflexive, symmetric and transitive.
Reflexivity For reflexivity, {(a, a), (b, b), (c, c)} need to be part of the relation.
Symmetry If ( 𝑎, 𝑏) is added, then ( 𝑏, 𝑎) must be added. This still satisfies transitivity.
If ( 𝑎, 𝑐) is added, then ( 𝑐, 𝑎) must be added.
If ( 𝑏, 𝑐) is added, then ( 𝑐, 𝑏) must be added.
Transitivity If ( 𝑎, 𝑏) is added, and ( 𝑏, 𝑐) is added, then ( 𝑎, 𝑐) must be added.
All equivalence relations

𝑅1 = ( 𝑎, 𝑎) , ( 𝑏, 𝑏) , ( 𝑐, 𝑐)

𝑅2 = ( 𝑎, 𝑎) , ( 𝑏, 𝑏) , ( 𝑐, 𝑐) , ( 𝑎, 𝑏) , ( 𝑏, 𝑎)

𝑅3 = ( 𝑎, 𝑎) , ( 𝑏, 𝑏) , ( 𝑐, 𝑐) , ( 𝑎, 𝑐) , ( 𝑐, 𝑎)

𝑅4 = ( 𝑎, 𝑎) , ( 𝑏, 𝑏) , ( 𝑐, 𝑐) , ( 𝑏, 𝑐) , ( 𝑐, 𝑏)

𝑅5 = ( 𝑎, 𝑎) , ( 𝑏, 𝑏) , ( 𝑐, 𝑐) , ( 𝑎, 𝑏) , ( 𝑏, 𝑎) , ( 𝑎, 𝑐) , ( 𝑐, 𝑎) , ( 𝑏, 𝑐) , ( 𝑐, 𝑏)

2. Determine whether the following relations 𝑹 on 𝑿 are equivalence relations. If they


are, describe the equivalence classes of 𝑹.

(a) 𝑿 = { 𝒂, 𝒃, 𝒄 } and 𝑹 = (𝒄, 𝒄) , (𝒃, 𝒃) , (𝒂, 𝒂)

Reflexivity Yes. For all 𝑥 in 𝑋 , ( 𝑥, 𝑥 ) ∈ 𝑅.


Symmetry Yes. Each element is symmetric with itself.
Transitivity Yes. Vacuously transitive.
Equivalence relation 𝑅 is an equivalence relation.
Equivalence classes [ 𝑥 ] = { 𝑦 | ( 𝑥, 𝑦 ) ∈ 𝑅 }
[ 𝑐] = { 𝑦 | ( 𝑐, 𝑦 ) ∈ 𝑅 }
= {𝑐}
[ 𝑏] = { 𝑦 | ( 𝑏, 𝑦 ) ∈ 𝑅 }
= { 𝑏}
[ 𝑎] = { 𝑦 | ( 𝑎, 𝑦 ) ∈ 𝑅 }
= { 𝑎}

66
UNIT 6. SPECIAL KINDS OF RELATION 6.2. Equivalence Relation

(b) 𝑿 = { 𝒂, 𝒃, 𝒄 } and 𝑹 = 𝑿 × 𝑿

𝑅 = ( 𝑎, 𝑎) , ( 𝑎, 𝑏) , ( 𝑎, 𝑐) , ( 𝑏, 𝑎) , ( 𝑏, 𝑏) , ( 𝑏, 𝑐) , ( 𝑐, 𝑎) , ( 𝑐, 𝑏) , ( 𝑐, 𝑐)

Reflexivity Yes. ( 𝑎, 𝑎), ( 𝑏, 𝑏) and ( 𝑐, 𝑐) are all in 𝑅.


Symmetry Yes. Every element in 𝑅 has its mirror image.
Transitivity Yes.
Equivalence relation 𝑅 is an equivalence relation.
Equivalence classes [ 𝑥 ] = { 𝑦 | ( 𝑥, 𝑦 ) ∈ 𝑅 }
[ 𝑎] = { 𝑎 | ( 𝑎, 𝑦 ) ∈ 𝑅 }
= { 𝑎, 𝑏, 𝑐 }
= [ 𝑏]
= [ 𝑐]
(c) 𝑿 = P(𝒀 ) where 𝒀 = {1, 2, 3} and 𝑹 consists of all pairs (𝑪, 𝑫) such that 𝑪 ∩ {2} =
𝑫 ∩ {2} 𝑋 = P (𝑌 )

= ∅, {1}, {2}, {3}, {1, 2}, {1, 3}, {2, 3}, {1, 2, 3}

𝑆 ∩ {2} = ∅ if 2 ∉ 𝑆. 𝑆 ∩ {2} = {2} if 2 ∈ 𝑆.

Sets without 2: ∅, {1}, {3}, {1, 3}


n   
𝑅1 = (∅, ∅) , ∅, {1} , ∅, {3} , ∅, {1, 3} ,
   
{1}, ∅ , {1}, {1} , {1}, {3} , {1}, {1, 3} ,
   
{3}, ∅ , {3}, {1} , {3}, {3} , {3}, {1, 3}
   o
{1, 3}, ∅ , {1, 3}, {1} , {1, 3}, {3} , {1, 3}, {1, 3}

Sets with 2: {2}, {1, 2}, {2, 3}, {1, 2, 3}


n    
𝑅2 = {2}, {2} , {2}, {1, 2} , {2}, {2, 3} , {2}, {1, 2, 3}
   
{1, 2}, {2} , {1, 2}, {1, 2} , {1, 2}, {2, 3} , {1, 2}, {1, 2, 3}
   
{2, 3}, {2} , {2, 3}, {1, 2} , {2, 3}, {2, 3} , {2, 3}, {1, 2, 3}
   o
{1, 2, 3}, {2} , {1, 2, 3}, {1, 2} , {1, 2, 3}, {2, 3} , {1, 2, 3}, {1, 2, 3}

Reflexivity Yes. All elements are related to themselves.


Symmetry Yes. All elements have their mirror image.
Transitivity Yes.
Equivalence relation 𝑅 is an equivalence relation.
Equivalence classes [ 𝑋 ] = {𝑌 | ( 𝑋, 𝑌 ) ∈ 𝑅 }

[∅] = ∅, {1}, {3}, {1, 3}
  
{2} = {2}, {1, 2}, {2, 3}, {1, 2, 3}

67
6.2. Equivalence Relation UNIT 6. SPECIAL KINDS OF RELATION

3. Let 𝑹 be the relation on Z such that ( 𝒙, 𝒚 ) ∈ 𝑹 iff 𝒙 − 𝒚 is a multiple of 4.


𝑅 = ( 𝑥, 𝑦 ) ∈ Z such that 𝑥 − 𝑦 = 4𝑘, where 𝑘 ∈ Z.

(a) Do tests on 𝑹 for all of the following properties: reflexivity, irreflexivity, sym-
metry, antisymmetry, transitivity, and trichotomy.

Reflexivity For every 𝑥 ∈ Z, is ( 𝑥, 𝑥 ) ∈ 𝑅? Yes.

Proof. For all 𝑥 , you would have 𝑥 − 𝑥 = 4𝑘, that is 0 = 4𝑘, so 𝑘 = 0. ( 𝑥, 𝑥 ) ∈ 𝑅. ■

Irreflexivity For every 𝑥 ∈ Z, is ( 𝑥, 𝑥 ) ∉ 𝑅? No.

Counterexample. (1, 1) ∈ 𝑅. ■

Symmetry For 𝑥, 𝑦 ∈ Z, if ( 𝑥, 𝑦 ) ∈ 𝑅, is ( 𝑦, 𝑥 ) ∈ 𝑅? Yes.

Proof. Suppose ( 𝑥, 𝑦 ) ∈ 𝑅. Then 𝑥 − 𝑦 = 4𝑘, where 𝑘 ∈ Z. But 𝑦 − 𝑥 = −4𝑘. That


is, 𝑦 − 𝑥 = 4(−𝑘). But 𝑘 can be any integer. Therefore ( 𝑦, 𝑥 ) ∈ 𝑅. ■

Antisymmetry For 𝑥, 𝑦 ∈ Z, if 𝑥 ≠ 𝑦 and ( 𝑥, 𝑦 ) ∈ 𝑅, is ( 𝑦, 𝑥 ) ∉ 𝑅? No.

Counterexample. (8, 4) ∈ 𝑅 and (4, 8) ∈ 𝑅 ■

Transitivity For 𝑥, 𝑦, 𝑧 ∈ Z, if ( 𝑥, 𝑦 ) ∈ 𝑅 and ( 𝑦, 𝑧) ∈ 𝑅, is ( 𝑥, 𝑧 ) ∈ 𝑅? Yes.

Proof. Suppose ( 𝑥, 𝑦 ) ∈ 𝑅 and ( 𝑦, 𝑧) ∈ 𝑅. Then 𝑥 − 𝑦 = 4𝑘 for some 𝑘 ∈ Z, and


𝑦 − 𝑧 = 4𝑚 for some 𝑚 ∈ Z.

𝑦 − 𝑧 = 4𝑚
⇒ 𝑦 = 4𝑚 + 𝑧
𝑥 − 𝑦 = 4𝑘
⇒ 𝑥 − (4𝑚 + 𝑧 ) = 4𝑘
⇒ 𝑥 − 4𝑚 − 𝑧 = 4 𝑘
⇒ 𝑥 − 𝑧 = 4 𝑘 + 4𝑚
⇒ 𝑥 − 𝑧 = 4( 𝑘 + 𝑚)

∴ ( 𝑥, 𝑧 ) ∈ 𝑅 ■

Trichotomy Is every element in Z related to every other element in Z? No.

Counterexample. There is no element of 𝑅 where 1 is related to 2. (1, 2) ∉ 𝑅 and


(2, 1) ∉ 𝑅. ■

(b) What kind of relation is 𝑹?


𝑅 is an equivalence relation.

68
UNIT 6. SPECIAL KINDS OF RELATION 6.2. Equivalence Relation

(c) If 𝑹 is an equivalence relation, give the equivalence classes of 𝑹 and show some
members of each class.

[ 𝑥 ] = { 𝑦 | ( 𝑥, 𝑦 ) ∈ 𝑅 }
= { 𝑦 | 𝑥 − 𝑦 = 4𝑘 }
= { 𝑦 | 𝑦 = 𝑥 − 4𝑘 }
[0] = { 𝑦 = −4𝑘 }
= { . . . , 8, 4, 0, −4, −8, . . . }
= { . . . , −8, −4, 0, 4, 8, . . . }
[1] = {1 − 4𝑘 }
= { . . . , 9, 5, 1, −3, −7, . . . }
= { . . . , −7, −3, 1, 5, 9, . . . }
[2] = {2 − 4𝑘 }
= { . . . , 10, 6, 2, −2, −6, . . . }
= { . . . , −6, −2, 2, 6, 10, . . . }
[3] = {3 − 4𝑘 }
= { . . . , 11, 7, 3, −1, −5, . . . }
= { . . . , −5, −1, 3, 7, 11, . . . }

The equivalence classes for [4] and up have already been covered.
4. Suppose Q+ is the set of all positive quotients 𝒎𝒏 , where 𝒎, 𝒏 ∈ Z+ . That is, Q+ is
the set of positive rational numbers. Let 𝑹 be the relation on Q+ defined by the rule
( 𝒙, 𝒚 ) ∈ 𝑹 iff 𝒚 = 𝒂𝒃 𝒙 for some 𝒂, 𝒃 ∈ Z+ . Prove that 𝑹 is an equivalence relation, and


show the equivalence classes of 𝑹.


   
1 3 3 5
Some examples of elements of 𝑅: , , ,
2 5 4 6
    
3 𝑎 1 6 1 6
= = = 𝑎 = 6 and 𝑏 = 5
5 𝑏 2 5 2 10
    
5 𝑎 3 10 3 30
= = = 𝑎 = 10 and 𝑏 = 9
6 𝑏 4 9 4 36

Proof.
Reflexivity For every 𝑥 ∈ Q+ , is ( 𝑥, 𝑥 ) ∈ 𝑅? Yes.
Subproof. For ( 𝑥, 𝑥 ) to be in 𝑅, it needs to satisfy:
𝑎 
𝑥= 𝑥 for some 𝑎, 𝑏 ∈ Z+
𝑏
1 
= 𝑥 𝑎 = 1 and 𝑏 = 1
1
=𝑥

∴ ( 𝑥, 𝑥 ) ∈ 𝑅, so 𝑅 is reflexive. □

69
6.2. Equivalence Relation UNIT 6. SPECIAL KINDS OF RELATION

Symmetry For every 𝑥, 𝑦 ∈ Q+ , if ( 𝑥, 𝑦 ) ∈ 𝑅, is ( 𝑦, 𝑥 ) ∈ 𝑅? Yes.


𝑎 
Subproof. Suppose ( 𝑥, 𝑦 ) ∈ 𝑅. Then 𝑦 = 𝑥 .
𝑏
𝑎 
𝑦= 𝑥
𝑏
⇒ 𝑏𝑦 = 𝑎𝑥
𝑏 
⇒ 𝑦 =𝑎
𝑎
𝑏 
⇒ 𝑥= 𝑦
𝑎
∴ ( 𝑦, 𝑥 ) ∈ 𝑅, so 𝑅 is symmetric. □

Transitivity For every 𝑥, 𝑦, 𝑧 ∈ Q+ , if ( 𝑥, 𝑦 ) ∈ 𝑅, and ( 𝑦, 𝑧) ∈ 𝑅, is ( 𝑥, 𝑧 ) ∈ 𝑅? Yes.

Subproof. Suppose ( 𝑥, 𝑦 ) ∈ 𝑅 and ( 𝑦, 𝑧) ∈ 𝑅.


Then 𝑦 = 𝑏 𝑥 and 𝑧 = 𝑑𝑐 𝑦 , where 𝑎, 𝑏, 𝑐, 𝑑 ∈ Z+ .
𝑎


𝑐 
𝑧= 𝑦
𝑑
𝑐 𝑎 
= 𝑥
𝑑 𝑏
𝑎𝑏 
= 𝑥
𝑐𝑑
∴ ( 𝑥, 𝑧) ∈ 𝑅, so 𝑅 is transitive. □

∴ 𝑅 is an equivalence relation. ■

Equivalence classes [ 𝑥 ] = { 𝑦 | ( 𝑥, 𝑦 ) ∈ 𝑅 } for all 𝑥 ∈ Q+


n 𝑎 o
[𝑥] = 𝑦 |𝑦= 𝑥
n 𝑏
𝑎 o
[1] = 𝑦 |𝑦= 1
n 𝑏
𝑎o
= 𝑦 |𝑦=
𝑏
This is the only equivalence class, as every equivalence class is equal to every other
equivalence class.

70
UNIT 6. SPECIAL KINDS OF RELATION 6.2. Equivalence Relation

5. Prove that if 𝑹 is a relation on Z+ , then 𝑹 is symmetric iff 𝑹 = 𝑹 −1 .

Proof.
(i) If 𝑹 is symmetric, then 𝑹 = 𝑹 −1 .

Proof. Assume 𝑅 is symmetric on Z+ .


Suppose ( 𝑥, 𝑦 ) ∈ 𝑅.
Then ( 𝑦, 𝑥 ) ∈ 𝑅 because 𝑅 is symmetric.
Then ( 𝑥, 𝑦 ) ∈ 𝑅 −1 by the definition of an inverse relation.
So 𝑅 ⊆ 𝑅 −1 .

Suppose ( 𝑥, 𝑦 ) ∈ 𝑅 −1 .
Then ( 𝑦, 𝑥 ) ∈ 𝑅 by the definition of an inverse relation.
Then ( 𝑥, 𝑦 ) ∈ 𝑅 because 𝑅 is symmetric.
So 𝑅 −1 ⊆ 𝑅.

As 𝑅 ⊆ 𝑅 −1 and 𝑅 −1 ⊆ 𝑅, 𝑅 = 𝑅 −1 □

(ii) If 𝑹 = 𝑹 −1 , then 𝑹 is symmetric.

Proof. Assume 𝑅 = 𝑅 −1 .
Suppose ( 𝑥, 𝑦 ) ∈ 𝑅.
Then ( 𝑦, 𝑥 ) ∈ 𝑅 −1 by the definition of an inverse relation.
So ( 𝑦, 𝑥 ) ∈ 𝑅 because 𝑅 = 𝑅 −1
So 𝑅 is symmetric. □

If 𝑅 is symmetric, then 𝑅 = 𝑅 −1 , and if 𝑅 = 𝑅 −1 , then 𝑅 is symmetric.


∴ 𝑅 is symmetric iff 𝑅 = 𝑅 −1 . ■

71
6.2. Equivalence Relation UNIT 6. SPECIAL KINDS OF RELATION

Theorem 6.1

(i) If 𝑅 is an equivalence relation to 𝐴, then 𝑥 ∈ [ 𝑥 ] for each 𝑥 ∈ 𝐴.


In other words, every member of 𝐴 belongs to an equivalence class with respect to 𝑅.
(ii) If 𝑥 𝑅 𝑦 , then [ 𝑥 ] = [ 𝑦 ]. In other words, if two elements are equivalent with respect to 𝑅,
they belong to the same equivalence class.
(iii) If [ 𝑥 ] = [ 𝑦 ], then 𝑥 𝑅 𝑦 .
(iv) Either [ 𝑥 ] = [ 𝑦 ] or [ 𝑥 ] ∩ [ 𝑦 ] = ∅

6.2.2 Partitions
Partition
For a nonempty set 𝐴, a partition of 𝐴 is a set 𝑆 = {𝑆1 , 𝑆2 , 𝑆3 }. The members of 𝑆 are subsets of
𝐴 (called parts of 𝐴) such that:

1. for all 𝑖, 𝑆𝑖 ≠ ∅. That is, every part of the partition is not empty.
2. for all 𝑖 and 𝑗, if 𝑆𝑖 ≠ 𝑆 𝑗 , then 𝑆𝑖 ∩ 𝑆 𝑗 = ∅. That is, different parts of the partition don’t have
common elements.
3. 𝑆1 ∪ 𝑆2 ∪ 𝑆3 ∪ . . . = 𝐴. That is, every element of 𝐴 appears in one (and only one) part of
the partition.

Example
 Let 𝐴 = {5, 6, 7}. Then A can be split into two subsets, {5} and {6, 7}. Then
{5}, {6, 7} is a partition of 𝐴, as:
1. Neither of the subsets is empty.
2. There are no common elements between the subsets.
3. The union of the subsets results in 𝐴.

Going Backwards From a Partition


If one knows the original set that was partitioned, and the partitions, one can generate the original
relation, using Theorem 6.1

Example Given an original set 𝐴 = { 𝑎, 𝑏, 𝑐 } and a partition given by { 𝑎}{ 𝑏, 𝑐 } .
The subset { 𝑎} tells us that [ 𝑎] = { 𝑎}, i.e. ( 𝑎, 𝑎) ∈ 𝑅.
The subset { 𝑏, 𝑐 } tells us that [ 𝑏] = { 𝑏, 𝑐 } = [ 𝑐], which means that 𝑏 is related to 𝑏 and 𝑐,
and 𝑐 is related to 𝑏 and 𝑐, so the pairs ( 𝑏, 𝑏) , ( 𝑏, 𝑐) , ( 𝑐, 𝑏) and ( 𝑐, 𝑐) are in 𝑅.

𝑅 = ( 𝑎, 𝑎) , ( 𝑏, 𝑏) , ( 𝑏, 𝑐) , ( 𝑐, 𝑏) , ( 𝑐, 𝑐)

72
UNIT 6. SPECIAL KINDS OF RELATION 6.2. Equivalence Relation

Self Assessment Exercise 6.12


Determine whether 𝑷 is a partition of 𝑿 in each of the following cases. If it is, describe
the corresponding equivalence relation.

(a) 𝑿 = {1, 2, 3} and 𝑷 = ∅, {1}, {2, 3} .
𝑃 is not a partition of 𝑋 , as ∅ is one of the elements of the set.

(b) 𝑿 = {1, 2, 3} and 𝑷 = {1}, {2}, {1, 3} .
𝑃 is not a partition of 𝑋 , as 1 appears in two different elements.

(c) 𝑿 = {1, 2, 3} and 𝑷 = {1, 3}, {2} .
𝑃 is a partition of 𝑋 .
The part {2} means that (2, 2) ∈ 𝑅.
The part {1, 3} means that (1, 1), (3, 3), (1, 3) and (3, 3) are elements of 𝑅.
𝑅 = (1, 1) , (1, 3) , (2, 2) , (3, 1) , (3, 3)

(d) 𝑿 = {1, 2, 3} and 𝑷 = {1}, {2}
𝑃 is not a partition of 𝑋 , as not all the members of 𝑋 are included.

(e) 𝑿 = Z and 𝑷 = {0}, Z+ , Neg where Neg = { 𝒙 | 𝒙 ∈ Z and 𝒙 < 0}.




𝑃 is a partition of 𝑋 .
The equivalence relation is:

𝑅 = ( 𝑥, 𝑦 ) | ( 𝑥 = 0 and 𝑦 = 0) or ( 𝑥 ∈ Z+ and 𝑦 ∈ Z+ ) or ( 𝑥 ∈ Neg and 𝑦 ∈ Neg)





(f) 𝑿 = Z and 𝑷 = [0], [1], [2], [3], [4] , where [𝒏] = { 𝒙 | 𝒙 − 𝒏 is divisible by 5 with zero
remainder} and 𝒏 ∈ {0, 1, 2, 3, 4}.
𝑃 is a partition of 𝑋 .
The equivalence relation is:

𝑅 = ( 𝑥, 𝑦 ) | 𝑥 − 𝑦 = 5𝑘 for some 𝑘 ∈ Z

73
6.3. Functions UNIT 6. SPECIAL KINDS OF RELATION

6.3 Functions
6.3.1 Functional Relation
Functional Relation
If 𝑅 is a relation from 𝑋 to 𝑌 , then 𝑅 is functional iff any element 𝑥 in 𝑋 only appears once as a
first coordinate in an ordered pair of 𝑅.


Example Let 𝑆 be a relation from {1, 2, 3} to { 𝑎, 𝑏, 𝑐 }, where 𝑆 = (1, 𝑎) , (2, 𝑐) . 𝑆 is a func-
tional relation as 1 and 2 only appear as first coordinates in distinct pairs.

6.3.2 Function
Function
Suppose 𝑅 ⊆ 𝐴 × 𝐵 is a binary relation from a set 𝐴 to a set 𝐵. 𝑅 is a function from 𝐴 to 𝐵 if 𝑅 is
functional, and the domain of 𝑅 is exactly the set 𝐴, i.e. dom( 𝑅) = 𝐴.
This is then written 𝑅 : 𝐴 → 𝐵.

Example Using the same relation as above:



𝑆 is a relation from {1, 2, 3} to { 𝑎, 𝑏, 𝑐 }, where 𝑆 = (1, 𝑎) , (2, 𝑐)

𝑆 is functional, but not a function, as dom( 𝑆) ≠ {1, 2, 3}.

Example Prove that 𝑓 defined by ( 𝑥, 𝑦 ) ∈ 𝑓 iff 𝑦 = 5𝑥 2 + 3 is a function on R.


To prove this, determine whether 𝑓 is functional, and whether dom( 𝑓 ) = R.

Proof.
(i) 𝑓 is functional.

Proof. Suppose ( 𝑥, 𝑦 ) ∈ 𝑓 and ( 𝑥, 𝑧 ) ∈ 𝑓 . Is it the case that 𝑦 = 𝑧?


As ( 𝑥, 𝑦 ) ∈ 𝑓 , 𝑦 = 5 𝑥 2 + 3. As ( 𝑥, 𝑧 ) ∈ 𝑓 , 𝑧 = 5 𝑥 2 + 3.
Therefore 𝑦 = 5 𝑥 2 + 3 = 𝑧.
So 𝑓 is functional. □

(ii) dom( 𝑓 ) = R

Proof. dom( 𝑓 ) = { 𝑥 | for some 𝑦 ∈ R, ( 𝑥, 𝑦 ) ∈ 𝑓 }


= { 𝑥 | for some 𝑦 ∈ R, 𝑦 = 5 𝑥 2 + 3}
= { 𝑥 | 5 𝑥 2 + 3 is a real number}
=R
Therefore the domain is equal to the input set. □

As 𝑓 is functional, and the domain of 𝑓 is the same as the input set, 𝑓 is a function. ■

74
UNIT 6. SPECIAL KINDS OF RELATION 6.3. Functions

Not all functional relations are functions!


Every function is a functional relation, but a relation can be functional without being a function.
This just means that the domain of the relation is not the same as the input set.
If anything from the original set can be given to the relation to produce an output, it is a
function.

Self Assessment Exercise 6.14

1. Give 5 functions from 𝑨 = {1, 2, 3, 4} to 𝑩 = { 𝒂, 𝒃, 𝒄 }.



𝑓1 = (1, 𝑎) , (2, 𝑎) , (3, 𝑎) , (4, 𝑎)

𝑓2 = (1, 𝑏) , (2, 𝑏) , (3, 𝑏) , (4, 𝑏)

𝑓3 = (1, 𝑐) , (2, 𝑐) , (3, 𝑐) , (4, 𝑐)

𝑓4 = (1, 𝑎) , (2, 𝑏) , (3, 𝑐) , (4, 𝑏)

𝑓5 = (1, 𝑏) , (2, 𝑎) , (3, 𝑏) , (4, 𝑎)

2. Give all the functions from 𝑨 = { 𝒂, 𝒃} to 𝑩 = {5, 6, 7}.


  
𝑓1 = ( 𝑎, 5) , ( 𝑏, 5) 𝑓4 = ( 𝑎, 6) , ( 𝑏, 5) 𝑓7 = ( 𝑎, 7) , ( 𝑏, 5)
  
𝑓2 = ( 𝑎, 5) , ( 𝑏, 6) 𝑓5 = ( 𝑎, 6) , ( 𝑏, 6) 𝑓8 = ( 𝑎, 7) , ( 𝑏, 6)
  
𝑓3 = ( 𝑎, 5) , ( 𝑏, 7) 𝑓6 = ( 𝑎, 6) , ( 𝑏, 7) 𝑓9 = ( 𝑎, 7) , ( 𝑏, 7)

3. Give 3 functions from 𝑨 × 𝑨 to 𝑩 if 𝑨 = { 𝒂, 𝒃} and 𝑩 = {5, 6, 7}.



𝐴 × 𝐴 = ( 𝑎, 𝑎) , ( 𝑎, 𝑏) , ( 𝑏, 𝑎) , ( 𝑏, 𝑏)
n    o
𝑓1 = ( 𝑎, 𝑎) , 5 , ( 𝑎, 𝑏) , 5 , ( 𝑏, 𝑎) , 5 , ( 𝑏, 𝑏) , 5
n    o
𝑓2 = ( 𝑎, 𝑎) , 6 , ( 𝑎, 𝑏) , 6 , ( 𝑏, 𝑎) , 6 , ( 𝑏, 𝑏) , 6
n    o
𝑓3 = ( 𝑎, 𝑎) , 5 , ( 𝑎, 𝑏) , 6 , ( 𝑏, 𝑎) , 7 , ( 𝑏, 𝑏) , 6


4. Let 𝑹 be a relation on 𝑨 = 1, 2, 3, {1}, {2} defined by
n      o
𝑹 = 1, {1} , 1, 3 , 2, {1} , 2, {2} , {1}, 3 , {2}, {1} .

(a) Is 𝑹 a function from 𝑨 to 𝑨?



No. There are two elements with the same first coordinate: 1, {1} and (1, 3), so 𝑅
is not a functional relation, so 𝑅 is not a function.
(b) Is ran( 𝑹) equal to the codomain of 𝑹?
No. 1 ∈ codomain, but 1 ∉ ran( 𝑅).

75
6.3. Functions UNIT 6. SPECIAL KINDS OF RELATION


5. Consider the set P( 𝑨) = ∅, { 𝒂}, { 𝒃}, { 𝒄 }, { 𝒂, 𝒃}, { 𝒂, 𝒄 }, { 𝒃, 𝒄 }, { 𝒂, 𝒃, 𝒄 } . Show that the
relations 𝒇 , 𝒈 and 𝒉 described below are functional and have as domains P( 𝑨),
P( 𝑨) × P( 𝑨), and P( 𝑨) × P( 𝑨) respectively.

(a) Let 𝒇 = ( 𝒙, 𝒚 ) | 𝒙, 𝒚 ∈ P( 𝑨) and 𝒚 = 𝒙 ′ .




Functional 𝑓 is functional.

Proof. Suppose ( 𝑥, 𝑦 ) ∈ 𝑓 and ( 𝑥, 𝑧 ) ∈ 𝑓 . ( 𝑓 is functional iff 𝑦 = 𝑧.)


Then 𝑦 = 𝑥 ′ and 𝑧 = 𝑥 ′ .
So 𝑦 = 𝑥 ′ = 𝑧.
So 𝑓 is functional. ■

Domain The domain of 𝑓 is equal to the input set P ( 𝐴).

Proof. dom( 𝑓 ) = { 𝑥 | for some 𝑦 ∈ P ( 𝐴) , ( 𝑥, 𝑦 ) ∈ 𝑓 }


= { 𝑥 | for some 𝑦 ∈ P ( 𝐴) , 𝑦 = 𝑥 ′ }
= { 𝑥 | 𝑥 ′ ∈ P ( 𝐴)}
= P ( 𝐴)
Therefore dom( 𝑓 ) is equal to the input set. ■
n  o
(b) Let 𝒈 = (𝒖, 𝒗) , 𝒚 | (𝒖, 𝒗) ∈ P( 𝑨) × P( 𝑨) and 𝒚 = 𝒖 ∪ 𝒗 .

Functional 𝑔 is functional.
 
Proof. Suppose (𝑢, 𝑣) , 𝑦 ∈ 𝑔 and (𝑢, 𝑣) , 𝑧 ∈ 𝑔. (𝑔 is functional iff 𝑦 = 𝑧.)
Then 𝑦 = 𝑢 ∪ 𝑣 and 𝑧 = 𝑢 ∪ 𝑣.
So 𝑦 = 𝑢 ∪ 𝑣 = 𝑧.
So 𝑔 is functional. ■

Domain The domain of 𝑔 is equal to the input set P ( 𝐴) × P ( 𝐴).


n  o
Proof. dom( 𝑔 ) = (𝑢, 𝑣) | for some 𝑦 ∈ P ( 𝐴) , (𝑢, 𝑣) , 𝑦 ∈ 𝑔
n o
= (𝑢, 𝑣) | for some 𝑦 ∈ P ( 𝐴) , 𝑦 = 𝑢 ∪ 𝑣 ∈ 𝑔
n o
= (𝑢, 𝑣) | 𝑢 ∪ 𝑣 ∈ P ( 𝐴)
n o
= 𝑢 ∈ P ( 𝐴) and 𝑣 ∈ P ( 𝐴)
= P ( 𝐴) × P ( 𝐴)
Therefore dom( 𝑔) is equal to the input set. ■

76
UNIT 6. SPECIAL KINDS OF RELATION 6.3. Functions

n  o
(c) Let 𝒉 = (𝒖, 𝒗) , 𝒚 | (𝒖, 𝒗) ∈ P( 𝑨) × P( 𝑨) and 𝒚 = 𝒖 ∩ 𝒗 .

Functional ℎ is functional.
 
Proof. Suppose (𝑢, 𝑣) , 𝑦 ∈ ℎ and (𝑢, 𝑣) , 𝑧 ∈ ℎ. (ℎ is functional iff 𝑦 = 𝑧.)
Then 𝑦 = 𝑢 ∩ 𝑣 and 𝑧 = 𝑢 ∩ 𝑣.
So 𝑦 = 𝑢 ∩ 𝑣 = 𝑧.
So ℎ is functional. ■

Domain The domain of ℎ is equal to the input set P ( 𝐴) × P ( 𝐴).


n  o
Proof. dom( ℎ) = (𝑢, 𝑣) | for some 𝑦 ∈ P ( 𝐴) , (𝑢, 𝑣) , 𝑦 ∈ ℎ
n o
= (𝑢, 𝑣) | for some 𝑦 ∈ P ( 𝐴) , 𝑦 = 𝑢 ∩ 𝑣 ∈ ℎ
n o
= (𝑢, 𝑣) | 𝑢 ∩ 𝑣 ∈ P ( 𝐴)
n o
= 𝑢 ∈ P ( 𝐴) and 𝑣 ∈ P ( 𝐴)
= P ( 𝐴) × P ( 𝐴)
Therefore dom( ℎ) is equal to the input set. ■

6. For each of the following relations from 𝑿 to 𝒀 , determine whether or not the relation
may be regarded as a function from 𝑿 to 𝒀 .

(a) 𝑿 = 𝒀 = Z and 𝑹 = ( 𝒙, 𝒚 ) | 𝒚 = 𝒙 .
𝑅 is a function.

Proof.
Functional 𝑅 is functional.

Subproof. Suppose ( 𝑥, 𝑦 ) ∈ 𝑅 and ( 𝑥, 𝑧 ) ∈ 𝑅.


Then 𝑦 = 𝑥 and 𝑧 = 𝑥 .
So 𝑦 = 𝑥 = 𝑧.
So 𝑦 = 𝑧.
∴ 𝑅 is functional. □

Domain The domain of 𝑅 is equal to the input set: Z.



Subproof. dom( 𝑅) = 𝑥 | for some 𝑦 ∈ Z, ( 𝑥, 𝑦 ) ∈ 𝑅
= { 𝑥 | for some 𝑦 ∈ Z, 𝑦 = 𝑥 }
= { 𝑥 | 𝑥 ∈ Z}
=Z
Therefore dom( 𝑅) is equal to the input set. □

As 𝑅 is functional, and the domain of 𝑅 is equal to the input set, 𝑅 is a function. ■

77
6.3. Functions UNIT 6. SPECIAL KINDS OF RELATION


(b) 𝑿 = 𝒀 = Z and 𝑹 = ( 𝒙, 𝒚 ) | 𝒚 = 𝒙 + 1 .
𝑅 is a function.

Proof.
Functional 𝑅 is functional.

Subproof. Suppose ( 𝑥, 𝑦 ) ∈ 𝑅 and ( 𝑥, 𝑧 ) ∈ 𝑅.


Then 𝑦 = 𝑥 + 1 and 𝑧 = 𝑥 + 1.
So 𝑦 = 𝑥 + 1 = 𝑧.
So 𝑦 = 𝑧.
∴ 𝑅 is functional. □

Domain The domain of 𝑅 is equal to the input set: Z.



Subproof. dom( 𝑅) = 𝑥 | for some 𝑦 ∈ Z, ( 𝑥, 𝑦 ) ∈ 𝑅
= { 𝑥 | for some 𝑦 ∈ Z, 𝑦 = 𝑥 + 1}
= { 𝑥 | 𝑥 + 1 ∈ Z}
=Z
Therefore dom( 𝑅) is equal to the input set. □

As 𝑅 is functional, and the domain of 𝑅 is equal to the input set, 𝑅 is a function. ■



(c) 𝑿 = 𝒀 = Z and 𝑹 = ( 𝒙, 𝒚 ) | 𝒚 = 3 − 𝒙 .
𝑅 is a function.

Proof.
Functional 𝑅 is functional.

Subproof. Suppose ( 𝑥, 𝑦 ) ∈ 𝑅 and ( 𝑥, 𝑧 ) ∈ 𝑅.


Then 𝑦 = 3 − 𝑥 and 𝑧 = 3 − 𝑥 .
So 𝑦 = 3 − 𝑥 = 𝑧.
So 𝑦 = 𝑧.
∴ 𝑅 is functional. □

Domain The domain of 𝑅 is equal to the input set: Z.



Subproof. dom( 𝑅) = 𝑥 | for some 𝑦 ∈ Z, ( 𝑥, 𝑦 ) ∈ 𝑅
= { 𝑥 | for some 𝑦 ∈ Z, 𝑦 = 3 − 𝑥 }
= { 𝑥 | 3 − 𝑥 ∈ Z}
=Z
Therefore dom( 𝑅) is equal to the input set. □

As 𝑅 is functional, and the domain of 𝑅 is equal to the input set, 𝑅 is a function. ■

78
UNIT 6. SPECIAL KINDS OF RELATION 6.3. Functions

 √
(d) 𝑿 = 𝒀 = Z and 𝑹 = ( 𝒙, 𝒚 ) | 𝒚 = 𝒙 . (That is, the positive square root of 𝒙 .)
𝑅 is not a function.

Proof.
Functional 𝑅 is functional.

Subproof. Suppose ( 𝑥, 𝑦 ) ∈ 𝑅 and ( 𝑥, 𝑧 ) ∈ 𝑅.


√ √
Then 𝑦 = 𝑥 and 𝑧 = 𝑥 .

So 𝑦 = 𝑥 = 𝑧
So 𝑦 = 𝑧.
So 𝑅 is functional. □

Domain The domain of 𝑅 is not equal to the input set.



Counterexample.
√ 2 ∈ 𝑋 , but there is no integer 𝑦 (i.e. no 𝑦 ∈ 𝑌 ) where 𝑦 = 2,
because 2 is irrational. √
−1 ∈ 𝑋 , but there is no integer 𝑦 where 𝑦 = −1.
∴ dom( 𝑅) ≠ 𝑋 □

As the domain of 𝑅 is not equal to the input set, 𝑅 is not a function. ■

(e) 𝑿 = 𝒀 = Z and 𝑹 = ( 𝒙, 𝒚 ) | 𝒚 2 = 𝒙 .


𝑅 is not a function.

Proof.
Functional 𝑅 is not functional.

Subproof. Suppose ( 𝑥, 𝑦 ) ∈ 𝑅 and ( 𝑥, 𝑧 ) ∈ 𝑅.


Then 𝑦 2 = 𝑥 and 𝑧2 = 𝑥 .
√ √
So 𝑦 = ± 𝑥 and 𝑧 = ± 𝑥 .
√ √
As 𝑦 can equal 𝑥 and 𝑧 can equal − 𝑥 , 𝑦 ≠ 𝑧
So 𝑅 is not functional. □

Domain The domain of 𝑅 is not equal to the input set.

Counterexample.
√ 2 ∈ 𝑋 , but there is no integer 𝑦 (i.e. no 𝑦 in 𝑌 ) where 𝑦 2 = 2,
because 2 is irrational.
−1 ∈ 𝑋 , but there is no ineger 𝑦 where 𝑦 2 = −1.
∴ dom( 𝑅) ≠ 𝑋 □

As 𝑅 is not functional, and the domain of 𝑅 is not equal to the input set, 𝑅 is not a
function. ■

79
6.3. Functions UNIT 6. SPECIAL KINDS OF RELATION

(f) 𝑿 = 𝒀 = R and 𝑺 = ( 𝒙, 𝒚 ) | 𝒙 2 + 𝒚 2 = 1 . 𝑅 is not a function.




Proof.
Functional 𝑅 is not functional.

Subproof. Suppose ( 𝑥, 𝑦 ) ∈ 𝑆 and ( 𝑥, 𝑧 ) ∈ 𝑆.


Then 𝑥 2 + 𝑦 2 = 1 and 𝑥 2 + 𝑧2 = 1.
So 𝑦 2 = 1√− 𝑥 2 and 𝑧2 = 1 −√𝑥 2 .
So 𝑦 = ± 1 − 2 2
√ 𝑥 and 𝑧 = ± 1 − 𝑥 . √
As 𝑦 can be 1 − 𝑥 and 𝑧 can be − 1 − 𝑥 2 , 𝑦 ≠ 𝑧.
2

So 𝑅 is not functional. □

Domain The domain of 𝑆 is not equal to the input set.

Counterexample. 2 ∈ R, but there is no real number 𝑦 where 22 + 𝑦 2 = 1.


∴ dom( 𝑅) ≠ 𝑋 □

As 𝑅 is not functional, and the domain of 𝑅 is not equal to the input set, 𝑅 is not a
function. ■

7. Is the relation 𝑹 on Z+ , which consists of all pairs ( 𝒙, 𝒚 ) such that 𝒚 = 𝒙 −1, a function
from Z+ to Z+ ?
No.

Proof.
Functional 𝑅 is functional.

Subproof. Suppose ( 𝑥, 𝑦 ) ∈ 𝑅 and ( 𝑥, 𝑧 ) ∈ 𝑅.


Then 𝑦 = 𝑥 − 1 and 𝑧 = 𝑥 − 1.
So 𝑦 = 𝑥 − 1 = 𝑧.
So 𝑦 = 𝑧.
So 𝑅 is functional. □

Domain The domain of 𝑅 is not equal to the input set.

Subproof. dom( 𝑅) = 𝑥 | for some 𝑦 ∈ Z+ , ( 𝑥, 𝑦 ) ∈ 𝑅




= 𝑥 | for some 𝑦 ∈ Z+ , 𝑦 = 𝑥 − 1


= 𝑥 | 𝑥 − 1 ∈ Z+


= 𝑥 > 1 | 𝑥 ∈ Z+


≠ Z+
For example, 𝑦 = 1 − 1 = 0 cannot be an element of 𝑅 if the domain is Z+ □

As the domain of 𝑅 is not equal to the input set, 𝑅 is not a function. ■

80
UNIT 6. SPECIAL KINDS OF RELATION 6.3. Functions

8. Let 𝑨 = { 𝒂, 𝒃, 𝒄 }. Consider all the equivalence relations on 𝑨. How many relations


are also functions from 𝑨 to 𝑨?

Equivalence Relations

𝑅1 = ( 𝑎, 𝑎) , ( 𝑏, 𝑏) , ( 𝑐, 𝑐)

𝑅2 = ( 𝑎, 𝑎) , ( 𝑏, 𝑏) , ( 𝑐, 𝑐) , ( 𝑎, 𝑏) , ( 𝑏, 𝑎)

𝑅3 = ( 𝑎, 𝑎) , ( 𝑏, 𝑏) , ( 𝑐, 𝑐) , ( 𝑎, 𝑐) , ( 𝑐, 𝑎)

𝑅4 = ( 𝑎, 𝑎) , ( 𝑏, 𝑏) , ( 𝑐, 𝑐) , ( 𝑏, 𝑐) , ( 𝑐, 𝑏)

𝑅5 = ( 𝑎, 𝑎) , ( 𝑏, 𝑏) , ( 𝑐, 𝑐) , ( 𝑎, 𝑏) , ( 𝑏, 𝑎) , ( 𝑎, 𝑐) , ( 𝑐, 𝑎) , ( 𝑏, 𝑐) , ( 𝑐, 𝑏)

Functions Only 𝑅1 is a function.


Abstract Reasoning If 𝑅 is an equivalence relation, then 𝑅 is reflexive. So dom( 𝑅) = 𝐴.
But if 𝑅 is an equivalence relation where a first coordinate appears more than once,
𝑅 is not a function.
So the first coordinates need to only appear once.
In an equivalence relation,
 that means that the only function is the identity relation.
So the only function is ( 𝑎, 𝑎) , ( 𝑏, 𝑏) , ( 𝑐, 𝑐)
9. Let 𝑨 = { 𝒂, 𝒃, 𝒄 }.

(a) How many weak partial orders on 𝑨 are also functions from 𝑨 to 𝑨?
If 𝑆 is a weak partial order on 𝐴, then 𝑆 is reflexive. So dom(𝑆) = 𝐴.
That means that every element of 𝐴 appears as the first coordinate in at least one
pair.
For 𝑆 to be functional, each element of 𝐴 must only appear as the first coordinate in
one pair.
The only case for this is the identity relation. 
So the only weak partial order on 𝐴 that is a function is ( 𝑎, 𝑎) , ( 𝑏, 𝑏) , ( 𝑐, 𝑐) .
(b) How many strict partial orders on 𝑨 are also functions from 𝑨 to 𝑨?
For a strict partial order 𝑇 to be a function on 𝐴, the domain of 𝑇 needs to be 𝐴, and
𝑇 needs to be functional.
Each element of 𝐴 should appear as the first coordinate in exactly one pair. For
the relation to be a strict partial order, it needs to be antisymmetric, irreflexive and
transitive.
There is no combination of pairs that satisfies all three requirements for a strict
partial order that is also a function.
Unit 7

More About Functions

7.1 The Range of a Function

Range of a Function

Given a function 𝑓 : 𝐴 → 𝐵, the range or image set of 𝑓 is the subset

{ 𝑓 ( 𝑥 ) | 𝑥 ∈ 𝐴}

of 𝐵, written ran( 𝑓 ) or 𝑓 [ 𝐴].


In other words, it is a subset of 𝐵 where and element 𝑏 of 𝐵 can be reached by calling the
function with a specific element 𝑎 of 𝐴.

Example Let 𝐴 = { 𝑎, 𝑏, 𝑐 } and 𝐵 = {1, 2, 3}. Let a function 𝑓 : 𝐴 → 𝐵 be defined as

𝑓 ( 𝑎) = 1 𝑓 ( 𝑏) = 2 𝑓 ( 𝑐) = 1

Then ran( 𝑓 ) = {1, 2}.

7.1.1 Determining the Range of a Function


In order to find the range, you follow these steps:

1. Write the defintion of the function 𝑓 ( 𝑥 ) , and the domain.
2. Substitute the definition with the value of 𝑓 ( 𝑥 )
3. Calculate the first coordinate in terms of the second.
4. Substitute the second coordinate and that formula for it into the definition.
5. Simplify.

83
7.2. Surjectivity UNIT 7. MORE ABOUT FUNCTIONS

Easier to show with an example:

Example Let 𝑔 : Z → Z be defined by 𝑦 = 2 𝑥 .

ran( 𝑔 ) = { 𝑔 ( 𝑥 ) | 𝑥 ∈ Z} (1)
= {2 𝑥 | 𝑥 ∈ Z} (2)

Calculate 𝑥 in terms of 𝑦 (Step 3):

𝑦 = 2𝑥
𝑦
⇒ =𝑥
2
𝑦
⇒ 𝑥=
2

𝑦
ran( 𝑔 ) = { 𝑦 | ∈ Z} (4)
2
𝑦
= {𝑦 | is an integer} (5)
2
= { 𝑦 | 𝑦 is an even integer}

7.2 Surjectivity (MAPPING)

Surjectivity

Given a function 𝑓 : 𝐴 → 𝐵, the function 𝑓 would be surjective iff the range of 𝑓 is equal to the
codomain of 𝑓 .
As 𝐵 is the codomain of 𝑓 above, that would mean that ran( 𝑓 ) (also written 𝑓 [ 𝐴]) is equal to 𝐵.

Example Let 𝐴 = {1, 2, 3}. Let 𝐵 = {4, 5, 6}.


Surjective Function For a surjective function, every element of 𝐴 needs to be present, and
every element of 𝐵. So an example of a function ℎ : 𝐴 → 𝐵 would be:
n o
ℎ = (1, 6) , (2, 4) , (3, 5)

ran( ℎ) = {4, 5, 6} = 𝐵.
Non-Surjective Function For a function, every element of 𝐴 needs to be present. For it to not
be surjective, that means that at least one element of 𝐵 is not in the range of the function.
An example function ℎ : 𝐴 → 𝐵 would be:
n o
ℎ = (1, 4) , (2, 4) , (3, 5)

ran( ℎ) = {4, 5} ≠ 𝐵.

84
UNIT 7. MORE ABOUT FUNCTIONS 7.2. Surjectivity

Self Assessment Exercise 7.4

1. In each of the following cases, write down the possible surjective functions from 𝑿
to 𝒀 .

(a) 𝑿 = { 𝒂, 𝒃} and 𝒀 = { 𝒄 }.
For a surjective function, make sure each element of 𝑋 appears as a first coordinate,
and every element of 𝑌 is used.

𝑓1 = ( 𝑎, 𝑐) , ( 𝑏, 𝑐)

(b) 𝑿 = { 𝒂, 𝒃} and 𝒀 = { 𝒄, 𝒅 }.

𝑓1 = ( 𝑎, 𝑐) , ( 𝑏, 𝑑 )

𝑓2 = ( 𝑎, 𝑑 ) , ( 𝑏, 𝑐)

(c) 𝑿 = { 𝒂, 𝒃} and 𝒀 = { 𝒄, 𝒅, 𝒆}.


There are no possible surjective functions, as there are more 𝑦 elements than 𝑥 ele-
ments. Either an 𝑥 element appears twice, in which case it is not a function, or a 𝑦
element doesn’t appear, in which case it is not surjective.
2. Let 𝒇 : Z → Z be defined by 𝒇 ( 𝒙 ) = 𝒙 + 1.

(a) Determine 𝒇 [Z] (or ran( 𝒇 )).

𝑓 [Z] = { 𝑓 ( 𝑥 ) | 𝑥 ∈ Z}
= { 𝑥 + 1 | 𝑥 ∈ Z} ( 𝑦 = 𝑥 + 1 ⇒ 𝑥 = 𝑦 − 1)
= { 𝑦 | 𝑦 − 1 ∈ Z}
= { 𝑦 | 𝑦 − 1 is an integer}
=Z

(b) Is 𝒇 surjective? If 𝒇 is not surjective, provide a counterexample to show why it


is not surjective.
𝑓 is surjective, as 𝑓 [Z] = Z.

85
7.2. Surjectivity UNIT 7. MORE ABOUT FUNCTIONS

3. Let 𝒇 : Z → Z be defined by 𝒇 ( 𝒙 ) = 4𝒙 + 8.

(a) Determine 𝒇 [Z] (or ran( 𝒇 )).

𝑓 [Z] = { 𝑓 ( 𝑥 ) | 𝑥 ∈ Z}
𝑦
= {4𝑥 + 8 | 𝑥 ∈ Z} ( 𝑦 = 4𝑥 + 8 ⇒ 𝑥 = 4 − 2)
𝑦
= {𝑦 | − 2 ∈ Z}
4
𝑦
= {𝑦 | is an integer}
4
= { 𝑦 | 𝑦 is an integer divisible by 4}

(b) Is 𝒇 surjective? If 𝒇 is not surjective, provide a counterexample to show why it


is not surjective.
𝑓 is not surjective, as the range of 𝑓 is not equal to the codomain.

Counterexample. 3 ∈ Z, which is the codomain, but there is no 𝑥 ∈ Z such that


4 𝑥 + 8 = 3. □

86
UNIT 7. MORE ABOUT FUNCTIONS 7.3. Injectivity

7.3 Injectivity (ONE TO ONE)

Injectivity

A function 𝑓 : 𝐴 → 𝐵 is injective iff 𝑓 has the property that whenever 𝑓 ( 𝑎1 ) = 𝑓 ( 𝑎2 ), then


𝑎1 = 𝑎2 .
In other words, every unique first coordinate is related to a unique second coordinate.
Another definition (contrapositive) A function 𝑓 : 𝐴 → 𝐵 is injective iff 𝑓 has the property
that whenever 𝑎1 ≠ 𝑎2 , 𝑓 ( 𝑎1 ) ≠ 𝑓 ( 𝑎2 ).

Example Let 𝐴 = {1, 2, 3}. Let 𝐵 = {4, 5, 6, 7}.


Injective Function For an injective function, every element of 𝐴 should be related to a different
element of 𝐵. An example function 𝑔 : 𝐴 → 𝐵 would be:
n o
𝑔 = (1, 5) , (2, 7) , (3, 6)

Non-Injective Function For a function to not be injective, two or more elements of 𝐴 should
be related to the same element of 𝐵. An example function 𝑔 : 𝐴 → 𝐵 would be:
n o
𝑔 = (1, 4) , (2, 5) , (3, 4)

7.3.1 Determining Whether an Abstract Function is Injective


For functions defined on all elements of an infinite set such as Z, use logic to prove the function is
injective:
1. Assume that the function being applied to two different elements results in the same value.
2. Apply the function to the values.
3. Simplify using algebra.

Example
Prove Injectivity Let 𝑓 : Z → Z be defined by 𝑦 = 4𝑥 .
Assume 𝑓 ( 𝑢) = 𝑓 ( 𝑣) (1)
Then 4𝑢 = 4𝑣 (2)
i.e. 𝑢=𝑣 (3)

Non Injective Function Let 𝑓 : Z → Z be defined by 𝑦 = 𝑥 2 .


Assume 𝑓 ( 𝑢) = 𝑓 ( 𝑣)
Then 𝑢2 = 𝑣2
±𝑢 = ±𝑣
𝑢≠𝑣

𝑢 is not necessarily equal to 𝑣. 𝑢 could be 1, and 𝑣 could be −1, and 𝑓 ( 𝑢) would be equal
to 𝑓 ( 𝑣) = 1. Therefore, 𝑓 is not injective.

87
7.3. Injectivity UNIT 7. MORE ABOUT FUNCTIONS

Self Assessment Exercise 7.5

1. In each of the following cases, write down the injective functions from 𝑿 to 𝒀 .

(a) 𝑿 = {2, 4} and 𝒀 = {1}


There is no possible injective function, as 𝑌 has only one member, but 𝑋 has two
members. Either one of the members of 𝑋 is excluded, in which case it is not a
function, or the two members point to the same member of 𝑌 , in which case it is not
injective.
(b) 𝑿 = {2, 4} and 𝒀 = {1, 3}

𝑓1 = (2, 1) , (4, 3)

𝑓2 = (2, 3) , (4, 1)

(c) 𝑿 = {2, 4} and 𝒀 = {1, 3, 5}



𝑓1 = (2, 1) , (4, 3)

𝑓2 = (2, 3) , (4, 1)

𝑓3 = (2, 1) , (4, 5)

𝑓4 = (2, 3) , (4, 5)

𝑓5 = (2, 5) , (4, 1)

𝑓6 = (2, 5) , (4, 3)

2. Consider 𝒉 : Z → Z defined by 𝒉 ( 𝒙 ) = 2𝒙 − 5. Determine whether or not 𝒉 is injective.


ℎ is injective.

Proof. Assume ℎ ( 𝑢) = ℎ ( 𝑣)
Then 2𝑢 − 5 = 2 𝑣 − 5
2𝑢 = 2 𝑣
𝑢=𝑣
∴ ℎ is injective, because when ℎ (𝑢) = ℎ ( 𝑣), 𝑢 = 𝑣. ■

88
UNIT 7. MORE ABOUT FUNCTIONS 7.4. Composition of Functions

7.4 Composition of Functions

The composition of two functions is also a function

For any two functions 𝑓 : 𝐴 → 𝐵 and 𝑔 : 𝐵 → 𝐶 , the composition of the two functions
𝑔 ◦ 𝑓 : 𝐴 → 𝐶 is also a function.

Proof. Let 𝑓 : 𝐴 → 𝐵 and 𝑔 : 𝐵 → 𝐶 be two functions.


As 𝑓 is a function, for every 𝑎 ∈ 𝐴, there is exactly one 𝑏 ∈ 𝐵 such that ( 𝑎, 𝑏) ∈ 𝑓 .
As 𝑔 is a function, for every 𝑏 ∈ 𝐵, there is exactly one 𝑐 ∈ 𝐶 such that ( 𝑏, 𝑐) ∈ 𝑔 .
As there is exactly one pair from 𝑎 to 𝑏, and from 𝑏 to 𝑐, there is exactly one pair in the composite
function from 𝑎 to 𝑐. ■

Composite Function

Given the functions 𝑓 : 𝐴 → 𝐵 and 𝑔 : 𝐵 → 𝐶 , the composite function 𝑔 ◦ 𝑓 : 𝐴 → 𝐶 is defined by


𝑔 ◦ 𝑓 : 𝐴 → 𝐶 = 𝑔 ◦ 𝑓 (𝑥)

= 𝑔 𝑓 (𝑥)

Example Let 𝑓 : Z → Z be defined by 𝑓 ( 𝑥 ) = 4𝑥 + 2.


Let 𝑔 : Z → Z+ be defined by 𝑓 ( 𝑥 ) = 𝑥 2 + 1.
Then 𝑔 ◦ 𝑓 : Z → Z+ .

(𝑔 ◦ 𝑓 ) (𝑥) = 𝑔 𝑓 (𝑥)
= 𝑔 (4𝑥 + 2)
= (4 𝑥 + 2) 2 + 1
 
= 16𝑥 2 + 16𝑥 + 4 + 1
= 16 𝑥 2 + 16𝑥 + 5

( 𝑔 ◦ 𝑓 ) ( 𝑥 ) is called the image of 𝒙 under 𝒈 ◦ 𝒇 .

The composition of two surjective functions is surjective

For any two surjective functions 𝑓 : 𝐴 → 𝐵 and 𝑔 : 𝐵 → 𝐶 , the composition of the two functions
𝑔 ◦ 𝑓 : 𝐴 → 𝐶 is also a surjective function.

Proof. Let 𝑓 : 𝐴 → 𝐵 and 𝑔 : 𝐵 → 𝐶 be two surjective functions.


As 𝑔 is surjective, every 𝑐 ∈ 𝐶 appears as a second coordinate in 𝑔 .
As 𝑓 is surjective, every 𝑏 ∈ 𝐵 appears as a second coordinate in 𝑓 .
As 𝑓 is a function, every 𝑎 appears as a first coordinate in 𝑓 .
As 𝑔 is a function, every 𝑏 appears as a first coordinate in 𝑔.
Therefore every 𝑎 maps to every 𝑏 which maps to every 𝑐.
So every 𝑎 maps to every 𝑐.
So the composite function is surjective. ■

89
7.4. Composition of Functions UNIT 7. MORE ABOUT FUNCTIONS

The composition of two injective functions is injective

For any two injective functions 𝑓 : 𝐴 → 𝐵 and 𝑔 : 𝐵 → 𝐶 , the composition of the two functions
𝑔 ◦ 𝑓 : 𝐴 → 𝐶 is also a injective function.

Proof. Let 𝑓 : 𝐴 → 𝐵 and 𝑔 : 𝐵 → 𝐶 be two injective functions.


As 𝑓 is injective, every 𝑎 ∈ 𝐴 maps to a unique 𝑏 ∈ 𝐵.
As 𝑔 is injective, every 𝑏 ∈ 𝐵 maps to a unique 𝑐 ∈ 𝐶 .
As every 𝑎 maps to a unique 𝑏, and every 𝑏 maps to a unique 𝑐, in the composite function, every
𝑎 maps to a unique 𝑐.
So the composite function is injective. ■

Self Assessment Exercise 7.9


Determine 𝒇 ◦ 𝒇 , 𝒈 ◦ 𝒈 , 𝒈 ◦ 𝒇 and 𝒇 ◦ 𝒈 in each of the following cases.

(a) 𝒇 : Z → Z is defined by 𝒇 ( 𝒙 ) = 𝒙 + 1 and 𝒈 : Z → Z is defined by 𝒈 ( 𝒙 ) = 𝒙 − 1.


All these composite functions are defined on Z → Z.
 
( 𝑓 ◦ 𝑓 ) (𝑥) = 𝑓 𝑓 (𝑥) ( 𝑔 ◦ 𝑔) ( 𝑥 ) = 𝑔 𝑔 ( 𝑥 )
= 𝑓 ( 𝑥 + 1) = 𝑔 ( 𝑥 − 1)
= ( 𝑥 + 1) + 1 = ( 𝑥 − 1) − 1
= 𝑥+2 = 𝑥−2
 
(𝑔 ◦ 𝑓 ) (𝑥) = 𝑔 𝑓 (𝑥) ( 𝑓 ◦ 𝑔) ( 𝑥 ) = 𝑓 𝑔 ( 𝑥 )
= 𝑔 ( 𝑥 + 1) = 𝑓 ( 𝑥 − 1)
= ( 𝑥 + 1) − 1 = ( 𝑥 − 1) + 1
=𝑥 =𝑥

(b) 𝒇 : R → R is defined by 𝒇 ( 𝒙 ) = 3 𝒙 − 2 and 𝒈 : R → R is defined by 𝒈 ( 𝒙 ) = 𝒙 2 + 𝒙 .


All these composite functions are defined on R → R.
 
( 𝑓 ◦ 𝑓 ) (𝑥) = 𝑓 𝑓 (𝑥) ( 𝑔 ◦ 𝑔) ( 𝑥 ) = 𝑔 𝑔 ( 𝑥 )
 
= 𝑓 (3 𝑥 − 2) = 𝑔 𝑥2 + 𝑥
 2  
= 3(3𝑥 − 2) − 2 = 𝑥2 + 𝑥 + 𝑥2 + 𝑥
= 9𝑥 − 6 − 2 = 𝑥 4 + 2𝑥 3 + 𝑥 2 + 𝑥 2 + 𝑥
= 9𝑥 − 8 = 𝑥 4 + 2𝑥 3 + 2𝑥 2 + 𝑥
 
(𝑔 ◦ 𝑓 ) (𝑥) = 𝑔 𝑓 (𝑥) ( 𝑓 ◦ 𝑔) ( 𝑥 ) = 𝑓 𝑔 ( 𝑥 )
 
= 𝑔 (3𝑥 − 2) = 𝑓 𝑥2 + 𝑥
 
= (3 𝑥 − 2) 2 + (3 𝑥 − 2) = 3 𝑥2 + 𝑥 − 2
= 9 𝑥 2 − 12𝑥 + 4 + 3 𝑥 − 2 = 3𝑥 2 + 3𝑥 − 2
= 9𝑥 2 − 9𝑥 + 2

90
UNIT 7. MORE ABOUT FUNCTIONS 7.5. Bijective and Invertible Functions

(c) 𝒇 : Z ≥ → Z ≥ is defined by 𝒇 ( 𝒙 ) = 113 and 𝒈 : Z ≥ → Z ≥ is defined by 𝒈 (𝒙 ) = 𝒙 + 1.


All these composite functions are defined on Z ≥ → Z ≥ .
 
( 𝑓 ◦ 𝑓 ) (𝑥) = 𝑓 𝑓 (𝑥) ( 𝑔 ◦ 𝑔) ( 𝑥 ) = 𝑔 𝑔 ( 𝑥 )
= 𝑓 (113) = 𝑔 ( 𝑥 + 1)
= 113 = ( 𝑥 + 1) + 1
= 𝑥+2

 
(𝑔 ◦ 𝑓 ) (𝑥) = 𝑔 𝑓 (𝑥) ( 𝑓 ◦ 𝑔) ( 𝑥 ) = 𝑓 𝑔 ( 𝑥 )
= 𝑔 (113) = 𝑓 ( 𝑥 + 1)
= 113 + 1 = 113
= 114

7.5 Bijective and Invertible Functions


7.5.1 Bijective Function

Bijective Function

A function 𝑓 : 𝐴 → 𝐵 is bijective iff 𝑓 is both surjective and injective.

Example Let 𝑓 : Z → Z be defined by 𝑦 = 𝑥 + 2.


Surjectivity Determine the range of 𝑓 .

ran( 𝑓 ) = { 𝑓 ( 𝑥 ) | 𝑥 ∈ Z}
= { 𝑥 + 2 | 𝑥 ∈ Z}
= { 𝑦 | 𝑦 − 2 ∈ Z} 𝑥 = 𝑦−2
= { 𝑦 | 𝑦 ∈ Z}
=Z

Therefore, 𝑓 is surjective.
Injectivity

Assume 𝑓 ( 𝑢) = 𝑓 ( 𝑣)
Then 𝑢+2= 𝑣+2
i.e. 𝑢=𝑣

Therefore 𝑓 is injective.
Bijectivity As 𝑓 is both surjective and injective, 𝑓 is bijective.

91
7.5. Bijective and Invertible Functions UNIT 7. MORE ABOUT FUNCTIONS

7.5.2 Invertible Functions


Invertible Function

A function 𝑓 : 𝐴 → 𝐵 is invertible iff the inverse relation 𝑓 −1 is a function from 𝐵 to 𝐴.


This occurs iff the function 𝑓 is bijective.

A function 𝑓 is invertible iff 𝑓 is bijective

Proof.
Subproof. Suppose that 𝑓 : 𝐴 → 𝐵 is an invertible function.
Then 𝑓 −1 = ( 𝑦, 𝑥 ) | ( 𝑥, 𝑦 ) ∈ 𝑓 is a function from 𝐵 to 𝐴.


So the domain of 𝑓 −1 is 𝐵. But the domain of 𝑓 −1 is also the set of 𝑦 ’s such that ( 𝑥, 𝑦 ) ∈ 𝑓
for some 𝑥 i.e. the domain of 𝑓 −1 is the range of 𝑓 . So the range of 𝑓 is 𝐵.
So 𝑓 : 𝐴 → 𝐵 is surjective.
Ao 𝑓 −1 is a function, an element 𝑦 ∈ 𝐵 appears only once as the first coordinate in an
ordered pair in 𝑓 −1 . That is, if ( 𝑦, 𝑥1 ) and ( 𝑦, 𝑥2 ) are both in 𝑓 −1 , then 𝑥1 = 𝑥2 .
So 𝑓 : 𝐴 → 𝐵 is injective.
If 𝑓 is an invertible function, then 𝑓 is surjective and injective, so 𝑓 is bijective. □

Subproof. Suppose that 𝑓 : 𝐴 → 𝐵 is bijective.


As 𝑓 is surjective, every element of 𝐵 appears as the second coordinate in an ordered pair
of 𝑓 . Therefore every 𝑏 ∈ 𝐵 appears as the first coordinate in an ordered pair of 𝑓 −1 .
Therefore the domain of 𝑓 −1 is 𝐵.
As 𝑓 is injective, every element of 𝐵 appears only once as the second coordinate in an
ordered pair of 𝑓 . Therefore every 𝑏 ∈ 𝐵 appears only once in an ordered pair of 𝑓 −1 .
Therefore 𝑓 −1 is functional.
If 𝑓 is bijective, then 𝑓 −1 is functional. dom( 𝑓 −1 ) equals the codomain of 𝑓 , so 𝑓 −1 is a
function. Therefore 𝑓 is invertible. □

If a function is invertible, it is bijective. If a function is bijective, it is invertible. ■

Example Let 𝑓 : Z → Z be defined by 𝑦 = 𝑥 + 2.


As was shown in the previous example, this function is bijective. As it is bijective, it is invertible.
The inverse function of 𝑓 , 𝑓 −1 is a function from Z to Z.
( 𝑦, 𝑥 ) ∈ 𝑓 −1 iff ( 𝑥, 𝑦 ) ∈ 𝑓
iff 𝑦 = 𝑥 + 2
−1
( 𝑥, 𝑦 ) ∈ 𝑓 iff 𝑥 = 𝑦 + 2 (swap variables)
iff 𝑥 − 2 = 𝑦 (solve for 𝑦 )
iff 𝑦 = 𝑥 − 2
( 𝑦, 𝑥 ) ∈ 𝑓 −1 iff 𝑥 = 𝑦 − 2 (swap variables back)
𝑓 −1 : Z → Z is defined by 𝑓 −1 ( 𝑦 ) = 𝑦 − 2

92
UNIT 7. MORE ABOUT FUNCTIONS 7.6. Identity Function

7.6 Identity Function

Identity Function

For any set 𝐴, the function 𝑖 𝐴 : 𝐴 → 𝐴 is the function such that 𝑖 𝐴 ( 𝑥 ) = 𝑥 for all 𝑥 ∈ 𝐴. This
function is called the identity function.

Example Let 𝐵 = {2, 4, 6, 8}. The identity function 𝑖 𝐵 : 𝐵 → 𝐵 would be:



𝑖 𝐵 = (2, 2) , (4, 4) , (6, 6) , (8, 8)

Self Assessment Exercise 7.11

1. In each of the following cases, write down the bijective functions from 𝑿 to 𝒀 (if
possible).
 
(a) 𝑿 = ∅, {113} and 𝒀 = {1} .
There are no possible bijective functions, as there are more elements in 𝑋 than in 𝑌 .
That means that there cannot be an injective function, so there cannot be a bijective
function.
 
(b) 𝑿 = ∅, {113} and 𝒀 = {1}, {2} .
n  o
𝑓1 = ∅, {1} , {113}, {2}
n  o
𝑓2 = ∅, {2} , {113}, {1}

 
(c) 𝑿 = ∅, {113} and 𝒀 = {1}, {2}, {7} .
There are no possible bijective functions, as there are more elements in 𝑌 than in 𝑋 .
That means that there cannot be a surjective function, so there cannot be a bijective
function.
2. Check the following functions for injectivity, surjectivity and bijectivity, and give the
inverse relation of each:

(a) 𝒇 : Z → Z is defined by 𝒇 ( 𝒙 ) = 𝒙 + 1.

Injectivity This function is injective.

Proof. Assume 𝑓 ( 𝑢) = 𝑓 ( 𝑣)
Then 𝑢+1= 𝑣+1
i.e. 𝑢=𝑣
Therefore 𝑓 is injective. ■

93
7.6. Identity Function UNIT 7. MORE ABOUT FUNCTIONS

Surjectivity This function is surjective.

Proof. 𝑓 [Z] = { 𝑓 ( 𝑥 ) | 𝑥 ∈ Z}
= { 𝑥 + 1 | 𝑥 ∈ Z}
= { 𝑦 | 𝑦 − 1 ∈ Z}
= { 𝑦 | 𝑦 ∈ Z}
=Z
Therefore 𝑓 is surjective. ■

Bijectivity As 𝑓 is injective and surjective, 𝑓 is bijective.


Inverse Function ( 𝑦, 𝑥 ) ∈ 𝑓 −1 iff ( 𝑥, 𝑦 ) ∈ 𝑓
iff 𝑦 = 𝑥 + 1
−1
( 𝑥, 𝑦 ) ∈ 𝑓 iff 𝑥 = 𝑦 + 1
iff 𝑥 − 1 = 𝑦
iff 𝑦 = 𝑥 − 1
−1
( 𝑦, 𝑥 ) ∈ 𝑓 iff 𝑥 = 𝑦 − 1
𝑓 −1 ( 𝑦 ) = 𝑦−1
(b) 𝒇 : Z → Z is defined by 𝒇 ( 𝒙 ) = 𝒙 2 .

Injectivity This function is not injective.

Proof. Assume 𝑓 ( 𝑢) = 𝑓 ( 𝑣)
Then 𝑢2 = 𝑣2
i.e. ±𝑢 = ± 𝑣
Therefore 𝑓 is not injective. ■

Surjectivity This function is not surjective.

Proof. 𝑓 [Z] = { 𝑓 ( 𝑥 ) | 𝑥 ∈ Z}
= { 𝑥 2 | 𝑥 ∈ Z}

= { 𝑦 | ± 𝑦 ∈ Z}
≠Z

Counterexample. Suppose 𝑦 = −1, as −1 ∈ Z. There is no 𝑥 ∈ Z such that 𝑥 2 = −1,


so the range of 𝑓 is not equal to the codomain. □

Therefore 𝑓 is not surjective. ■

Bijectivity As 𝑓 is neither injective nor surjective, 𝑓 is not bijective.


Inverse Function As 𝑓 is not bijective, 𝑓 −1 is not defined.

94
UNIT 7. MORE ABOUT FUNCTIONS 7.6. Identity Function

(c) 𝒇 : Z → Z is defined by 𝒇 ( 𝒙 ) = 3 − 𝒙 .

Injectivity This function is injective.


Proof. Assume 𝑓 ( 𝑢) = 𝑓 ( 𝑣)
Then 3−𝑢 = 3−𝑣
i.e. 𝑢=𝑣
Therefore 𝑓 is injective. ■

Surjectivity This function is surjective.


Proof. 𝑓 [Z] = { 𝑓 ( 𝑥 ) | 𝑥 ∈ Z}
= {3 − 𝑥 | 𝑥 ∈ Z}
= { 𝑦 | 3 − 𝑦 ∈ Z}
=Z
Therefore 𝑓 is surjective. ■

Bijectivity As this function is injective and surjective, this function is bijective.


Inverse Function ( 𝑦, 𝑥 ) ∈ 𝑓 −1 iff ( 𝑥, 𝑦 ) ∈ 𝑓
iff 𝑦 = 3 − 𝑥
−1
( 𝑥, 𝑦 ) ∈ 𝑓 iff 𝑥 = 3 − 𝑦
iff 𝑥 + 𝑦 = 3
iff 𝑦 = 3 − 𝑥
( 𝑦, 𝑥 ) ∈ 𝑓 −1 iff 𝑥 = 3 − 𝑦
𝑓 −1 ( 𝑦 ) = 3 − 𝑦

(d) 𝒇 : Z → Z is defined by 𝒇 ( 𝒙 ) = 4𝒙 + 5.

Injectivity This function is injective.


Proof. Assume 𝑓 ( 𝑢) = 𝑓 ( 𝑣)
Then 4𝑢 + 5 = 4 𝑣 + 5
4𝑢 = 4 𝑣
i.e. 𝑢=𝑣
Therefore 𝑓 is injective. ■

Surjectivity This function is not surjective.


Proof. 𝑓 [Z] = { 𝑓 ( 𝑥 ) | 𝑥 ∈ Z}
= {4 𝑥 + 5 | 𝑥 ∈ Z}
𝑦−5
= {𝑦 | ∈ Z}
4
≠Z
Therefore 𝑓 is not surjective. ■

Bijectivity As 𝑓 is not surjective, 𝑓 is not bijective.


Inverse Function As 𝑓 is not bijective, 𝑓 −1 is not defined.

95
7.6. Identity Function UNIT 7. MORE ABOUT FUNCTIONS

3. Consider an identity function 𝒊𝑪 : 𝑪 → 𝑪 .

(a) Prove that 𝒊𝑪 : 𝑪 → 𝑪 is bijective.

Proof.

Injectivity. Assume 𝑖𝐶 ( 𝑢) = 𝑖𝐶 ( 𝑣)
Then 𝑢=𝑣
Therefore 𝑖𝐶 is injective. □

Surjectivity. 𝑖𝐶 [𝐶 ] = { 𝑖𝑐 | 𝑐 ∈ 𝐶 }
= {𝑐 | 𝑐 ∈ 𝐶 }
=𝐶
Therefore 𝑖𝐶 is surjective. □

As 𝑖𝐶 is both injective and surjective, 𝑖𝐶 is bijective. ■

(b) Prove that 𝒊𝑪 is an equivalence relation on 𝑪 .

Proof. Reflexivity. For every 𝑐 ∈ 𝐶 , is ( 𝑐, 𝑐) ∈ 𝑖𝐶 ? Yes.


For any 𝑐 ∈ 𝐶 , 𝑐 = 𝑐.
So ( 𝑐, 𝑐) ∈ 𝑖𝐶 .
Therefore 𝑖𝐶 is reflexive. □

Symmetry. For every 𝑐, 𝑑 ∈ 𝐶 , if ( 𝑐, 𝑑 ) ∈ 𝑖𝐶 , is ( 𝑑, 𝑐) ∈ 𝑖𝐶 ? Yes.


Suppose ( 𝑐, 𝑑 ) ∈ 𝐶 . Then 𝑐 = 𝑑 . So 𝑑 = 𝑐.
Therefore ( 𝑑, 𝑐) ∈ 𝑖𝐶 .
Therefore 𝑖𝐶 is symmetric. □

Transitivity. If ( 𝑐, 𝑑 ) ∈ 𝑖𝐶 and ( 𝑑, 𝑒) ∈ 𝑖𝐶 , is ( 𝑐, 𝑒) ∈ 𝑖𝐶 ? Yes.


Assume ( 𝑐, 𝑑 ) ∈ 𝑖𝐶 and ( 𝑑, 𝑒) ∈ 𝑖𝐶 .
Then 𝑐 = 𝑑 and 𝑑 = 𝑒.
So 𝑐 = 𝑑 = 𝑒.
So 𝑐 = 𝑒.
Therefore ( 𝑐, 𝑒) ∈ 𝑖𝐶 . □

As 𝑖𝐶 is reflexive, symmetric and transitive, 𝑖𝐶 is an equivalence relation. ■


Unit 8

Operations

8.1 Binary Operation

Binary Operation

If 𝑓 : 𝑋 × 𝑋 → 𝑋 , then 𝑓 is called a binary operation on 𝑋 .


In other words, a binary operation takes in a pair, and returns a single value.

Operations Notation

An operation is just a function, which means it can be written in normal function prefix notation:
𝑓 ( 𝑥, 𝑦 ). However, it is more conventional to write it in infix notation: 𝑥 𝑓 𝑦 .

Example Addition of numbers is a binary operation. If ( 𝑥, 𝑦 ) = (3, 4), then it could be


written +(3, 4), but it is more conventional to write 3 + 4.

By convention, the elements of a binary operation are all the same set.

8.1.1 Finite and Infinite Sets (Informal Definition)


Finite Set
A set whose cardinality is a non-negative number. Meaning one can count
the number of elements in the set.

Example 𝐴 = {1, 2, 3, 4}, where | 𝐴 | = 4

Infinite Set
A set that is not finite. Meaning one cannot count the number of elements
in the set.

Example The set of real numbers R is an infinite set.

97
8.1. Binary Operation UNIT 8. OPERATIONS

8.1.2 Tables For Binary Operations


A way to describe a binary operation is to use a table, where the rows are based on the first element,
and the columns on the second. The operator (the symbol used to describe the operation) is written in
the top left corner.

Example Let 𝐴 = { 𝑎, 𝑏, 𝑐, 𝑑 }.
A binary operation called + (NB: This is not addition) could be written as follows:
+ a b c d
a a b c d
b b c d a
c c d a b
d d a b c
This would be read (row, column). +(b, d) = a.
+ a b c d
a a b c d
b b c d a
c c d a b
d d a b c

Extra Notes for this operation

Applying concepts from later to the operation:


Identity This operation has an identity element, which is a.
Commutativity This operation is commutative.
Associativity This operation is associative.

Another binary operation, called • could be written as follows:


• a b c d
a a b c d
b b a d c
c c d a b
d d c b a

Extra Notes for this operation

Applying concepts from later to the operation:


Identity This operation has an identity element, which is a.
Commutativity This operation is commutative.
Associativity This operation is associative.

98
UNIT 8. OPERATIONS 8.2. Properties of Binary Operations

8.2 Properties of Binary Operations


For examples below, the following binary operation has been used:
∗ : {1, 2} × {1, 2} → {1, 2} is defined by:
n    o
(1, 1) , 1 , (1, 2) , 2 , (2, 1) , 2 , (2, 2) , 1

In table form this would be:


∗ 1 2
1 1 2
2 2 1

8.2.1 Commutative Binary Operation

Commutativity

A binary operation ^ : 𝑋 × 𝑋 → 𝑋 is commutative iff 𝑥 ^ 𝑦 = 𝑦 ^ 𝑥 for all 𝑥, 𝑦 ∈ 𝑋 .

The easiest way to check this is it will be commutative if it is symmetrical across the diagonal from the
top left to the bottom right.

Example 1 ∗ 1 = 1 ∗ 1 = 1
1∗2=2∗1=2
2∗2=2∗2=1
Therefore ∗ is commutative.

8.2.2 Associative Binary Operation

Associativity

A binary operation ^ : 𝑋 × 𝑋 → 𝑋 is associative iff ( 𝑥 ^ 𝑦 )^ 𝑧 = 𝑥 ^( 𝑦 ^ 𝑧) for all 𝑥, 𝑦, 𝑧 ∈ 𝑋 .

Unfortunately, for this one, you have to check each instance.

Example (1 ∗ 1) ∗ 1 = 1 ∗ 1 = 1 and 1 ∗ (1 ∗ 1) = 1 ∗ 1 = 1
(1 ∗ 1) ∗ 2 = 1 ∗ 2 = 2 and 1 ∗ (1 ∗ 2) = 1 ∗ 2 = 2
(1 ∗ 2) ∗ 1 = 2 ∗ 1 = 2 and 1 ∗ (2 ∗ 1) = 2 ∗ 1 = 2
(1 ∗ 2) ∗ 2 = 2 ∗ 2 = 1 and 1 ∗ (2 ∗ 2) = 1 ∗ 1 = 1
(2 ∗ 1) ∗ 1 = 2 ∗ 1 = 2 and 2 ∗ (1 ∗ 1) = 2 ∗ 1 = 2
(2 ∗ 1) ∗ 2 = 2 ∗ 2 = 1 and 2 ∗ (1 ∗ 2) = 2 ∗ 2 = 1
(2 ∗ 2) ∗ 1 = 1 ∗ 1 = 1 and 2 ∗ (2 ∗ 1) = 2 ∗ 2 = 1
(2 ∗ 2) ∗ 2 = 1 ∗ 2 = 2 and 2 ∗ (2 ∗ 2) = 2 ∗ 1 = 2
Therefore ∗ is associative.

99
8.2. Properties of Binary Operations UNIT 8. OPERATIONS

8.2.3 Identity Element of a Binary Operation

Identity Element

An element 𝑒 of 𝑋 is an identity element in respect of the binary operation ^ : 𝑋 × 𝑋 → 𝑋 iff


𝑒 ^ 𝑥 = 𝑥 ^ 𝑒 = 𝑥 for all 𝑥 ∈ 𝑋 .

The easiest way to check this is if there is a row and column in the table that is identical to the header.
(NB: It needs to be both row and column, which contain the same element.)

Example 1 ∗ 1 = 1 and 1 ∗ 1 = 1
1 ∗ 2 = 2 and 2 ∗ 1 = 2

Self Assessment Exercise 8.3

1. Let 𝑿 be {2, 7}.

(a) Provide 3 binary operations on 𝑿 , both in list notation and in tabular form.
n    o
△= (2, 2) , 2 , (2, 7) , 2 , (7, 2) , 2 , (7, 7) , 7

△ 2 7
2 2 2
7 2 7

n    o
▽= (2, 2) , 2 , (2, 7) , 7 , (7, 2) , 7 , (7, 7) , 7

▽ 2 7
2 2 7
7 7 7

n    o
□= (2, 2) , 2 , (2, 7) , 2 , (7, 2) , 7 , (7, 7) , 7

□ 2 7
2 2 2
7 7 7
(b) Check the three operations for commutativity and associativity.

Commutativity △ is commutative, as it is symmetric about the diagonal.


▽ is commutative, as it is symmetric about the diagonal.
□ is not commutative.

100
UNIT 8. OPERATIONS 8.2. Properties of Binary Operations

Associativity △ is associative.

𝑥 = 2, 𝑦 = 2, 𝑧 = 2 (2△2)△2= 2 2△(2△2)= 2
𝑥 = 2, 𝑦 = 2, 𝑧 = 7 (2△2)△7= 2 2△(2△7)= 2
𝑥 = 2, 𝑦 = 7, 𝑧 = 2 (2△7)△2= 2 2△(7△2)= 2
𝑥 = 2, 𝑦 = 7, 𝑧 = 7 (2△7)△7= 2 2△(7△7)= 2
𝑥 = 7, 𝑦 = 2, 𝑧 = 2 (7△2)△2= 2 7△(2△2)= 2
𝑥 = 7, 𝑦 = 2, 𝑧 = 7 (7△2)△7= 2 7△(2△7)= 2
𝑥 = 7, 𝑦 = 7, 𝑧 = 2 (7△7)△2= 2 7△(7△2)= 2
𝑥 = 7, 𝑦 = 7, 𝑧 = 7 (7△7)△7= 7 7△(7△7)= 7

Doing the same for ▽ and □. Both are associative as well.


(c) Provide 2 binary operations on 𝑿 = { 𝒂, 𝒃, 𝒄 } and check them for commutativity
and associativity.

⋆ a b c ♥ a b c
a a a a a a a a
b b b b b a a a
c c c c c a a a
Commutativity ⋆ is not commutative.
♥ is not commutative.
Associativity ⋆ is associative.
♥ is associative.
2. Consider the • operation defined in the example above on 𝑨 = { 𝒂, 𝒃, 𝒄, 𝒅 }

(a) Examine 𝒚 • 𝒙 and 𝒙 • 𝒚 for each 𝒙, 𝒚 ∈ 𝑨. Is • commutative?


Yes, as it is symmetric about the diagonal.
(b) Does 𝑨 have an identity element for •?
Yes, as the row and column for 𝑎 matches the headers. So 𝑎 is an identity element.

101
8.3. Operations on Vectors UNIT 8. OPERATIONS

8.3 Operations on Vectors


8.3.1 Vector
Vector
In this course, a vector is considered to be an ordered n-tuple of numbers.
A vector is represented by an n-tuple 𝑢 in the following way:

𝑢 = ( 𝑢1 , 𝑢2 , 𝑢3 , . . . , 𝑢𝑛 ) for some 𝑛 ≥ 2

8.3.2 Vector Sum


Vector Sum
If 𝑢 and 𝑣 are vectors with the same number of coordinates, then their sum, written 𝑢 + 𝑣 is the
vector obtained by adding the corresponding coordinates of 𝑢 and 𝑣.

𝑢 + 𝑣 = ( 𝑢1 , 𝑢2 , . . . , 𝑢𝑛 ) + ( 𝑣1 , 𝑣2 , . . . , 𝑣𝑛 )
= (𝑢1 + 𝑣2 , 𝑢2 + 𝑣2 , . . . , 𝑢𝑛 + 𝑣𝑛 )

Example Let 𝑢 = (1, 2, 3) and 𝑣 = (4, 5, 6).


Then

𝑢 + 𝑣 = (1, 2, 3) + (4, 5, 6)
= (1 + 4, 2 + 5, 3 + 6)
= (5, 7, 9)

Vector addition is not defined for vectors of different sizes


If two vectors have a different number of coordinates, you cannot add those two vectors to-
gether.

102
UNIT 8. OPERATIONS 8.3. Operations on Vectors

8.3.3 Scalar-Vector Product


Scalar-Vector Product
If 𝑢 is a vector and 𝑟 is some scalar number, then the product of the number 𝑟 and the vector 𝑢
is the vector 𝑟 · 𝑢 obtained by multiplying each coordinate of 𝑢 by 𝑟 .

𝑟 · 𝑢 = 𝑟 ( 𝑢 1 , 𝑢2 , . . . , 𝑢 𝑛 )
= ( 𝑟𝑢1 , 𝑟𝑢2 , . . . , 𝑟𝑢𝑛 )

Example Let 𝑢 = (7, 8, 9) and 𝑟 = 2.


Then

𝑟 · 𝑢 = 2(7, 8, 9)
= (14, 16, 18)

Self Assessment Exercise 8.6


If 𝒖 = (3, 1), 𝒗 = (−4, −4) and 𝒘 = (0, −1), determine

(a) 2𝒖 + 𝒗 2𝑢 + 𝑣 = 2(3, 1) + (−4, −4)


= (6, 2) + (−4, −4)
= (2, −2)

(b) 𝒖 − 3𝒗 𝑢 − 3 𝑣 = (3, 1) − 3(−4, −4)


= (3, 1) + (12, 12)
= (15, 13)

(c) −3(𝒗 + 𝒘) −3( 𝑣 + 𝑤) = −3 (−4, −4) + (0, −1)
= −3(−4, −5)
= (12, 15)

103
8.3. Operations on Vectors UNIT 8. OPERATIONS

8.3.4 Dot Product


Dot Product
The dot product (also called the inner product) of vectors 𝑢 = (𝑢1 , 𝑢2 , . . . , 𝑢𝑛 ) and
𝑣 = ( 𝑣1 , 𝑣2 , . . . , 𝑣𝑛 ) is written 𝑢 · 𝑣 and defined by:

𝑢 · 𝑣 = 𝑢1 𝑣1 + 𝑢2 𝑣2 + . . . + 𝑢𝑛 𝑣𝑛

The result of the dot product is a number

Unlike the other operations, which result in vectors, the dot product produces a single number.

Example Let 𝑢 = (2, 4, 6) and 𝑣 = (1, 3, 5). Then

𝑢 · 𝑣 = (2, 4, 6) (1, 3, 5)
= (2 · 1) + (4 · 3) + (6 · 5)
= 2 + 12 + 30
= 44

The dot product is not defined for vectors of different sizes

As with addition, if two vectors have a different number of coordinates, you cannot calculate
the dot product.

Self Assessment Exercise 8.7


If 𝒖 = (1, 2, 5) and 𝒗 = (2, 3, 5), determine

(a) 𝒖 · 𝒗 𝑢 · 𝑣 = (1, 2, 5) · (2, 3, 5)


= (1 · 2) + (2 · 3) + (5 · 5)
= 2 + 6 + 25
= 33

(b) 𝒗 (2𝒖) 𝑣 (2𝑢) = (2, 3, 5) 2(1, 2, 5)
= (2, 3, 5) · (2, 4, 10)
= (2 · 2) + (3 · 4) + (5 · 10)
= 4 + 12 + 50
= 66

104
UNIT 8. OPERATIONS 8.4. Operations on Matrices

8.4 Operations on Matrices


8.4.1 Matrix
Matrix
A matrix is an array of numbers organised into rows and columns, and encolsed within brackets.
The number of rows is written with the letter 𝑚 and the number of columns with the letter 𝑛.
So a matrix is said to have the size 𝑚 × 𝑛.

  −1 3 0 5 
3 2 
0

Example is a 2 × 2 matrix, and 2 0 6  is a 3 × 4 matrix.
1 5 
 1 −1 0 13

 

Matrices (pronounced may-trisseez) have the form


 𝑎11 𝑎12 · · · 𝑎1𝑛 
 
 𝑎21 𝑎22 · · · 𝑎2𝑛 
 
 .. .. .. 
 . . . 

𝑎𝑚1 𝑎𝑚2 · · · 𝑎𝑚𝑛 
 

8.4.2 Matrix Addition


Matrix Addition
Let 𝐴 and 𝐵 be two matrices of the same size. Then the matrix 𝑨 + 𝑩 is:
 𝑎11 𝑎12
 ··· 𝑎1𝑛   𝑏11 𝑏12 ··· 𝑏1𝑛 
 𝑎21 𝑎22 ··· 𝑎2𝑛   𝑏21 𝑏22 ··· 𝑏2𝑛 
𝐴+𝐵=  . ..  +  ..

.. .. .. 
 .. . .   . . . 

 𝑎𝑚1 𝑎𝑚2
 ··· 𝑎𝑚𝑛  𝑏𝑚1 𝑏𝑚2 ··· 𝑏𝑚𝑛 
 𝑎11 + 𝑏11 𝑎12 + 𝑏12 · · · 𝑎1𝑛 + 𝑏1𝑛 

 𝑎21 + 𝑏21 𝑎22 + 𝑏22 · · · 𝑎2𝑛 + 𝑏2𝑛 
=

.. .. .. 

 . . . 

 𝑎𝑚1 + 𝑏𝑚1 𝑎𝑚2 + 𝑏𝑚2 · · · 𝑎𝑚𝑛 + 𝑏𝑚𝑛 

   
1 2 5 6
Example Let 𝐴 = and 𝐵 =
3 4 7 8
   
1 2 5 6
𝐴+𝐵= +
3 4 7 8
 
1+5 2+6
=
3+7 4+8
 
6 8
=
10 12

105
8.4. Operations on Matrices UNIT 8. OPERATIONS

Self Assessment Exercise 8.8


For each pair 𝑨 and 𝑩 determine 𝑨 + 𝑩 (if possible):
       
−1 0 5 5 2 0 3 1 1 −2
(a) 𝑨 = and 𝑩 = (c) 𝑨 = and 𝑩 =
0 1 4 −1 0 7 1 2 0 6
       
−1 0 5 5 2 0 3 1 1 −2
𝐴+𝐵= + 𝐴+𝐵= +
0 1 4 −1 0 7 1 2 0 6
   
4 5 3 1 1
= =
4 0 2 7 7
       
−1 0 3 2 0 3 1 1 2 0
(b) 𝑨 = and 𝑩 = (d) 𝑨 = and 𝑩 =
0 1 1 0 0 −2 −5 2 5 1
This operation is not defined, as the ma- This operation is not defined, as the ma-
trices are different sizes. trices are different sizes.

8.4.3 Scalar-Matrix Multiplication

Scalar-Matrix Multiplication

Let 𝐴 be a matrix, and 𝑟 be some scalar number.


Then the product 𝒓 𝑨 is defined as:
 𝑎11 𝑎12 · · · 𝑎1𝑛   𝑟𝑎11 𝑟𝑎12 · · · 𝑟𝑎1𝑛 
   
 𝑎21 𝑎22 · · · 𝑎2𝑛   𝑟𝑎21 𝑟𝑎22 · · · 𝑟𝑎2𝑛 
𝑟𝐴 = 𝑟  . ..  =  ..
   
. .. .. .. 
 . . .   . . . 

𝑎𝑚1 𝑎𝑚2 · · · 𝑎𝑚𝑛  𝑟𝑎𝑚1 𝑟𝑎𝑚2 · · · 𝑟𝑎𝑚𝑛 
   

 
1 2
Example Let 𝑟 = 3 and 𝐴 =
3 4
   
1 2 3 6
𝑟𝐴 = 3 =
3 4 9 12

Self Assessment Exercise 8.9


Perform the indicated operation:

−1 2 2 −2 −6  8   0 


             
2  2  − 3 1 + 4 1 =  4  + −3 +  4  =  5 
   
3 0 5  6   0  20 26
             

106
UNIT 8. OPERATIONS 8.4. Operations on Matrices

8.4.4 Matrix Multiplication

Matrix Multiplication

Let 𝐴 and 𝐵 both be matrices. In order for the product 𝑨𝑩 to be defined,


• The number of columns of 𝐴 needs to be equal to the number of rows of 𝐵, i.e. 𝐴𝑛 = 𝐵𝑚 .
If the product is defined, then it will result in a matrix that is the size 𝐴𝑚 × 𝐵𝑛 .
𝐴𝑚 × 𝐴𝑛 · 𝐵𝑚 × 𝐵𝑛 = 𝐴𝑚 × 𝐵𝑛

When multiplying matrics, it is row of first multiplied by column of second.

−1 3     (−1 · 6) + (3 · −8) (−1 · 9) + (3 · 1) 


  6 9 
Example 4 2  =  (4 · 6) + (2 · −8) (4 · 9) + (2 · 1) 
 5 −7 −8 1
  
 (5 · 6) + (−7 · −8) (5 · 9) + (−7 · 1) 
  
−6 − 24 −9 + 3
 
=  24 − 16 36 + 2 
 30 + 56 45 − 7
 
−30 −6
 
=  8 38 
 86 38 
 

8.4.5 Identity Matrix

Identity Matrix

If 𝐴 is matrix, then an identity matrix 𝐼 with respect to 𝐴 is a matrix such that 𝐼 𝐴 = 𝐴𝐼 = 𝐴.


For the identity matrix to be defined,
• 𝐴 must be a square matrix, because matrix multiplication is not commutative.
• 𝐼 must therefore also be a square matrix with the same number of rows and columns as
𝐴.

Then the identity matrix would have 1’s for the main diagonal, and 0’s elsewhere.

Example For a 2 × 2 matrix, the identity matrix would be:


 
1 0
𝐼=
0 1

107
8.4. Operations on Matrices UNIT 8. OPERATIONS

Self Assessment Exercise 8.10

1. Perform the indicated matrix operations (if possible)


31 −3 2 0  (31 · 0) + (−3 · 1) + (2 · 5)  0 − 3 + 10  7 
        
(a)  2 5 1 1 =  (2 · 0) + (5 · 1) + (1 · 5)  =  0 + 5 + 5  = 10
3 0 0 5  (3 · 0) + (0 · 1) + (0 · 5)   0 + 0 + 0   0 

9 3  1 0 
  
(b) 1 5 2 4
3 0  5 1 
  
This operation is not defined.
1 −3 2  0 −1 3
  
(c) 0 6 4  1 13 1
3 0 3   1 5 0 
  2    
1 1
 (1 · 0) + (−3 · 1) + 2 · 2 (1 · −1) + −3 · 3 + (2 · 5) (1 · 3) + (−3 · 1) + (2 · 0) 
 
     
1
=  (0 · 0) + (6 · 1) + 4 · 2 (0 · −1) + 6 · 31 + (4 · 5) (0 · 3) + (6 · 1) + (4 · 0) 
 
     
 (3 · 0) + (0 · 1) + 3 · 12 (3 · −1) + 0 · 31 + (3 · 5) (3 · 3) + (0 · 1) + (3 · 0) 
 
 
 (0 − 3 + 1) (−1 − 1 + 10) (3 − 3 + 0) 
 
=  (0 + 6 + 2) (0 + 2 + 20) (0 + 6 + 0) 
 
 0 + 0 + 32 (−3 + 0 + 15) (9 + 0 + 0) 
 
 
−2 8 0
 
=  8 22 6
 3 12 9
2 
2. Provide examples of matrices 𝑿 and 𝒀 such that 𝑿𝒀 is a 3 × 3 matrix, but 𝒀 𝑿 is a
2 × 2 matrix.
Any matrices 𝑋 and 𝑌 such that 𝑋 is a 2 × 3 matrix, and 𝑌 is a 3 × 2 matrix.
  1 2
1 2 3  
Two examples: 𝐴1 = and 𝐵1 = 3 4
4 5 6 5 6
 
  3 6
2 4 6  
𝐴2 = and 𝐵2 = 9 6
8 6 4 3 0
 
3. Provide examples of matrices 𝑿 and 𝒀 such that both 𝑿 and 𝒀 have at least some
nonzero entries, but 𝑿𝒀 is the 2 × 2 zero matrix.
Any matrix 𝐴 that has a zero column, where matrix 𝐵 has a zero row that are at different
indexes.    
0 4 6 8
Example: 𝐴 = and 𝐵 =
0 5 0 0

108
UNIT 8. OPERATIONS 8.4. Operations on Matrices

4. Prove that addition is a commutative operation on the set of 2 × 2 matrices, and that
there is a 2 × 2 matrix that acts as an identity element in respect of addition.
   
𝑎 𝑏 𝑒 𝑓
Proof. Let 𝐴 and 𝐵 be two 2 × 2 matrices, where 𝐴 = and 𝐵 = .
𝑐 𝑑 𝑔 ℎ
   
𝑎 𝑏 𝑒 𝑓
Commutativity. Then: 𝐴 + 𝐵 = +
𝑐 𝑑 𝑔 ℎ
 
𝑎+𝑒 𝑏+ 𝑓
=
𝑐+𝑔 𝑑+ℎ
   
𝑒 𝑓 𝑎 𝑏
𝐵+𝐴= +
𝑔 ℎ 𝑐 𝑑
   
𝑒+𝑎 𝑓 +𝑏 𝑎+𝑒 𝑏+ 𝑓
= =
𝑔+𝑐 ℎ+𝑑 𝑐+𝑔 𝑑+ℎ
As 𝐴 + 𝐵 = 𝐵 + 𝐴, matrix addition is commutative. □
 
0 0
Identity. The identity element for matrix addition on 2 × 2 matrices is □
0 0

So, matrix addition is commutative, and an identity element exists for matrix addition. ■

5. Prove that multiplication is not a commutative operation on the set of 2 × 2 matri-


ces, and that there is a 2 × 2 matrix that acts as an identity element in respect of
multiplication.

Proof.
   
1 2 4 3
Commutativity Counterexample. Let 𝐴 = and 𝐵 =
3 4 2 1
         
1 2 4 3 (1 · 4) + (2 · 2) (1 · 3) + (2 · 1) 4+4 3+2 8 5
𝐴𝐵 = = = =
3 4 2 1 (3 · 4) + (4 · 2) (3 · 3) + (4 · 1) 12 + 8 9+4 20 13
         
4 3 1 2 (4 · 1) + (3 · 3) (4 · 2) + (3 · 4) 4+9 8 + 12 13 20
𝐵𝐴 = = = =
2 1 3 4 (2 · 1) + (1 · 3) (2 · 2) + (1 · 4) 2+3 4+4 5 8

As 𝐴𝐵 ≠ 𝐵𝐴, matrix multiplication is not commutative. □

Identity. The identity


  element for matrix multiplication is the identity matrix. For a 2 × 2
1 0
matrix, that is □
0 1

So, matrix multiplication is not commutative, and an identity element exists for matrix
multiplication. ■
Unit 9

Logic: Truth Tables

9.1 Declarative Statements


A declarative statement is a statement that conveys information.
Declarative Statements Some examples are:
• The capital of France is Paris
• 3 is an even integer
• This sentence is false
Non-Declarative Statements Some examples are:
• Is 3 an even integer? (Question: acquire information, not convey information)
• Add 3 to 5! (Command: induce behaviour, not convey information)

Not all declarative statements are usable


A declarative statement is not necessarily true or false, as there can be a contradiction in the
statement.
However, when dealing with proofs, declarative statements are restricted to those that can be
either true or false.

A declarative statement can either be


• atomic, (or simple) meaning they convey a single fact.
• compound, meaning they combine multiple atomic statements.

9.2 Combining Statements


Statements can be combined together using different logical connectives. Below is a list of the
possible connectives.
and ∧ conjunction
or ∨ disjunction
not ¬ negation
if and only if ↔ biconditional
if . . . , then . . . → conditional/implication

111
9.2. Combining Statements UNIT 9. LOGIC: TRUTH TABLES

9.2.1 Conjunction (AND)

Conjunction

If 𝑝 and 𝑞 represent declarative statements, then 𝑝 ∧ 𝑞 represents the statement “ 𝑝 and 𝑞”, and
is called the conjunction of 𝑝 and 𝑞.

p q p∧q
T T T
T F F
F T F
F F F

9.2.2 Disjunction (OR)

Disjunction

If 𝑝 and 𝑞 represent declarative statements, then 𝑝 ∨ 𝑞 represents the statement “ 𝑝 or 𝑞”, and is
called the disjunction of 𝑝 and 𝑞.

p q p∨q
T T T
T F T
F T T
F F F

9.2.3 Negation

Negation

If 𝑝 is some declarative statement, then ¬ 𝑝 represents the statement “not 𝑝”. This is called the
negation of a given statement.

p ¬p
T F
F T

9.2.4 Biconditional
Biconditional
If 𝑝 and 𝑞 represent declarative statements, then 𝑝 ↔ 𝑞 represents the statement 𝑝 if and only
if 𝑞, which can also be written 𝑝 iff 𝑞. This is called the biconditional.

p q p↔q
T T T
T F F
F T F
F F T

112
UNIT 9. LOGIC: TRUTH TABLES 9.3. Constructing Truth Tables

9.2.5 Conditional/Implication

Implication

If 𝑝 and 𝑞 represent declarative statements, then 𝑝 → 𝑞 represents the statement “If 𝑝, then
𝑞”, and is called a conditional statement or implication. 𝑝 is called the hypothesis or the
antecedent and 𝑞 is called the conclusion or consequent.

p q p→q
T T T
T F F
F T T
F F T

If the hypothesis is false, then the statement is true

This can be quite confusing. The idea is that if the original statement is false, we can’t say that
the next statement is not true.

Example Consider a statement “If you read books, you are smart”.
If someone reads books and is smart, this is true.
If someone reads books and is not smart, this is false.
If someone does not read books, we cannot say the statement is false, but we also
cannot say it is true. So the statement would be vacuously true.

9.3 Constructing Truth Tables


1. List the statements at the top.
2. For the first column, fill half of the rows with T and half with F.
3. For the second column, for the rows that have T, write T for the upper half, and F for the lower
half. Do the same for F.
4. Continue doing that until the base statements are filled.
5. Then apply the rules to the columns left to right.

Example Construct a truth table for 𝑝 ∧ (¬𝑞).


p q p q ¬q p q ¬q p ∧ (¬q)
T T T T F T T F F
T F T F T T F T T
F T F T F F T F F
F F F F T F F T F

113
9.3. Constructing Truth Tables UNIT 9. LOGIC: TRUTH TABLES

Activity 9.4
 
Construct a truth table for ¬ 𝒑 → (𝒒 ∧ 𝒓 ) ∨ 𝒓

𝒑 𝒒 𝒓 ¬𝒑 𝒒∧𝒓 ¬ 𝒑 → (𝒒 ∧ 𝒓 ) [¬ 𝒑 → (𝒒 ∧ 𝒓 )] ∨ 𝒓
T T T F T T T
T T F F F T T
T F T F F T T
T F F F F T T
F T T T T T T
F T F T F F F
F F T T F F T
F F F T F F F

Self Assessment Exercise 9.5

1. Suppose that 𝒑 represents the statement “It is sunny”, and 𝒒 represents the state-
ment “It is humid”. Write each of the following in abbreviated form.

(a) It is sunny and it is not humid 𝑝 ∧ ¬𝑞

(b) It is humid or it is sunny 𝑝 ∨ 𝑞

(c) It is false that it is humid ¬𝑞

(d) It is false that it is sunny and humid ¬( 𝑝 ∧ 𝑞)

(e) It is neither sunny nor humid ¬ 𝑝 ∧ ¬𝑞

(f) It is not the case that if it is sunny then it is humid ¬( 𝑝 → 𝑞)

(g) It is humid if it is sunny 𝑝 → 𝑞

(h) It is humid only if it is sunny 𝑞 → 𝑝

(i) It is sunny if and only if it is humid 𝑝 ↔ 𝑞

(j) If it is false that it is either sunny or humid (but not both), then it is not sunny
 
¬ ( 𝑝 ∨ 𝑞) ∧ ¬( 𝑝 ∧ 𝑞) → ¬ 𝑝

114
UNIT 9. LOGIC: TRUTH TABLES 9.3. Constructing Truth Tables

2. Construct truth tables for the following compound statements:

(a) [(¬𝒒) → (¬ 𝒑)] → ( 𝒑 → 𝒒)


 
𝒑 𝒒 ¬𝒑 ¬𝒒 (¬𝒒) → (¬ 𝒑) 𝒑→𝒒 (¬𝒒) → (¬ 𝒑) → ( 𝒑 → 𝒒)
T T F F T T T
T F F T F F T
F T T F T T T
F F T T T T T
h i
(b) ¬ 𝒑 → 𝒒 ∧ (¬𝒒) → 𝒑

𝒑 𝒒 ¬𝒑 ¬𝒒 𝒒 ∧ ¬𝒒 ¬ 𝒑 → (𝒒 ∧ ¬𝒒) [¬ 𝒑 → (𝒒 ∧ ¬𝒒)] → 𝒑
T T F F F T T
T F F T F T T
F T T F F F T
F F T T F F T
(c) 𝒑 ∨ (¬ 𝒑)

𝒑 ¬𝒑 𝒑 ∨ ¬𝒑
T F T
F T T
 
(d) 𝒑 ∧ ( 𝒑 → 𝒒) → 𝒒

𝒑 𝒒 𝒑→𝒒 𝒑 ∧ ( 𝒑 → 𝒒) [ 𝒑 ∧ ( 𝒑 → 𝒒)] → 𝒒
T T T T T
T F F F T
F T T F T
F F T F T
(e) ( 𝒑 ∨ 𝒒) ∧ (¬ 𝒑 ∨ ¬𝒒)

𝒑 𝒒 ¬𝒑 ¬𝒒 𝒑∨𝒒 ¬ 𝒑 ∨ ¬𝒒 ( 𝒑 ∨ 𝒒) ∧ (¬ 𝒑 ∨ ¬𝒒)
T T F F T F F
T F F T T T T
F T T F T T T
F F T T F T F

115
9.3. Constructing Truth Tables UNIT 9. LOGIC: TRUTH TABLES


(f) ¬ 𝒑 → [𝒒 ∧ 𝒓 ] ∨ 𝒓

𝒑 𝒒 𝒓 ¬𝒑 𝒒∧𝒓 ¬ 𝒑 → (𝒒 ∧ 𝒓 ) [¬ 𝒑 → (𝒒 ∧ 𝒓 )] ∨ 𝒓
T T T F T T T
T T F F F T T
T F T F F T T
T F F F F T T
F T T T T T T
F T F T F F F
F F T T F F T
F F F T F F F
 
(g) 𝒑 → [𝒒 ∧ 𝒓 ] ↔ [ 𝒑 → 𝒒] ∨ [ 𝒑 → 𝒓 ]

𝒑 𝒒 𝒓 𝒒∧𝒓 𝒑→𝒒 𝒑→𝒓 𝒑 → (𝒒 ∧ 𝒓 ) ( 𝒑 → 𝒒) ∨ ( 𝒑 → 𝒓 ) 𝑺


T T T T T T T T T
T T F F T F F T F
T F T F F T F T F
T F F F F F F F T
F T T T T T T T T
F T F F T T T T T
F F T F T T T T T
F F F F T T T T T
𝑆 is the statement.

116
UNIT 9. LOGIC: TRUTH TABLES 9.4. Relationships Between Statements

9.4 Relationships Between Statements


9.4.1 Tautology

Tautology

A compound statement that is always true is called a tautology.

Example The statement 𝑝 ∨ ¬ 𝑝 is always true.


p ¬p p ∨ ¬p
T F T
F T T

9.4.2 Contradiction
Contradiction
A compound statement that is always false is called a contradiction.

Example The statement 𝑝 ∧ ¬ 𝑝 is always false.


p ¬p p ∧ ¬p
T F F
F T F

9.4.3 Logical Equivalence

Logical Equivalence

Two declarative statements 𝑎 and 𝑏 are logically equivalent, written 𝑎 ≡ 𝑏, if and only if the
statement 𝑎 → 𝑏 is a tautology.

Example Take the declarative statement ( 𝑝 ∨ 𝑞) ↔ ( 𝑞 ∨ 𝑝).


p q p∨q q∨p (p ∨ q) ↔ (q ∨ p)
T T T T T
T F T T T
F T T T T
F F F F T
As ( 𝑝 ∨ 𝑞) ↔ ( 𝑞 ∨ 𝑝) is a tautology, the statements are logically equivalent.
That is:

𝑝∨𝑞≡𝑞∨ 𝑝

117
9.4. Relationships Between Statements UNIT 9. LOGIC: TRUTH TABLES

Important Logical Equivalences (Identities)

Let 𝑇0 be a tautology, and 𝐹0 be a contradiction.


(a) 𝑝∨𝑞≡𝑞∨ 𝑝
𝑝∧𝑞≡𝑞∧ 𝑝 (commutative laws)
(b) 𝑝 ∨ ( 𝑞 ∨ 𝑟 ) ≡ ( 𝑝 ∨ 𝑞) ∨ 𝑟
𝑝 ∧ ( 𝑞 ∧ 𝑟 ) ≡ ( 𝑝 ∧ 𝑞) ∧ 𝑟 (associative laws)
(c) 𝑝 ∧ ( 𝑞 ∨ 𝑟 ) ≡ ( 𝑝 ∧ 𝑞) ∨ ( 𝑝 ∧ 𝑟 )
𝑝 ∨ ( 𝑞 ∧ 𝑟 ) ≡ ( 𝑝 ∨ 𝑞) ∧ ( 𝑝 ∨ 𝑟 ) (distributive laws)
(d) 𝑝∨ 𝑝≡ 𝑝
𝑝∧ 𝑝≡ 𝑝 (idempotent laws)
(e) ¬(¬ 𝑝) ≡ 𝑝 (double negation laws)
(f) ¬( 𝑝 ∨ 𝑞) ≡ ¬ 𝑝 ∧ ¬𝑞
¬( 𝑝 ∧ 𝑞) ≡ ¬ 𝑝 ∨ ¬𝑞 (De Morgan’s laws)
(g) 𝑝 ∨ ¬ 𝑝 ≡ 𝑇0
𝑝 ∧ ¬ 𝑝 ≡ 𝐹0 (inverse laws)
(h) ¬𝐹0 ≡ 𝑇0
¬𝑇0 ≡ 𝐹0 (negation laws)
(i) 𝑝 ∨ 𝐹0 ≡ 𝑝
𝑝 ∧ 𝑇0 ≡ 𝑝 (identity laws)
(j) 𝑝 ∨ 𝑇0 ≡ 𝑇0
𝑝 ∧ 𝐹0 ≡ 𝐹0 (domination laws/universal bound)

Other Useful Logical Eqiuivalences

(a) ( 𝑝 → 𝑞) ≡ (¬𝑞 → ¬ 𝑝) (contrapositive equivalence)


(b) 𝑝 → 𝑞 ≡ ¬𝑝 ∨ 𝑞 (implication equivalence)
(c) 𝑝 ↔ 𝑞 ≡ ( 𝑝 → 𝑞) ∧ ( 𝑞 → 𝑝) (biconditional equivalence)
(d) ¬( 𝑝 → 𝑞) ≡ 𝑝 ∧ ¬𝑞 (negation of implication)

118
UNIT 9. LOGIC: TRUTH TABLES 9.4. Relationships Between Statements

Self Assessment Exercise 9.9

1. Rewrite 𝒑 ↔ 𝒒 as a statement built up using only ¬, ∨ and ∧.

𝑝 ↔ 𝑞 ≡ ( 𝑝 → 𝑞) ∧ ( 𝑞 → 𝑝)
≡ (¬ 𝑝 ∨ 𝑞) ∧ (¬𝑞 ∨ 𝑝)

2. Show that ≡ is an equivalence relation on statements.

Proof. For ≡ to be an equivalence relation, ≡ needs to be reflexive, symmetric and transi-


tive.
Let 𝑝 and 𝑞 be two statements, where 𝑝 ≡ 𝑞.
(i) Reflexivity. Is it the case that 𝑝 ≡ 𝑝 for all statements? Yes.
If 𝑝 is a statement, then 𝑝 ↔ 𝑝 is always true. So 𝑝 ↔ 𝑝 is a tautology.
So 𝑝 ↔ 𝑝 is logically equivalent.
So 𝑝 ≡ 𝑝 is part of the relation for all statements 𝑝.
So ≡ is a reflexive relation. □
(ii) Symmetry. Is it the case that, if 𝑝 ≡ 𝑞, then 𝑞 ≡ 𝑝 for all statements 𝑝 and 𝑞? Yes.
Suppose 𝑝 ≡ 𝑞. Then that means that 𝑝 ↔ 𝑞 is always true.
If 𝑝 ↔ 𝑞 is always true, that means that 𝑝 → 𝑞 is always true, and 𝑞 → 𝑝 is always
true.
If 𝑞 → 𝑝 is always true, and 𝑝 → 𝑞 is always true, then 𝑞 ↔ 𝑝 is always true.
If 𝑞 ↔ 𝑝 is always true, then 𝑞 ↔ 𝑝 is a tautology.
So 𝑞 ≡ 𝑝.
So ≡ is a symmetric relation. □
(iii) Transitivity. Is it the case that, if 𝑝 ≡ 𝑞 and 𝑞 ≡ 𝑟 , then 𝑝 ≡ 𝑟 for all statements 𝑝, 𝑞
and 𝑟 ? Yes.
Suppose 𝑝 ≡ 𝑞 and 𝑞 ≡ 𝑟 .
Then 𝑝 ↔ 𝑞 is always true, and 𝑞 ↔ 𝑟 is always true.
So 𝑝 → 𝑞 and 𝑞 → 𝑟 are both always true. So 𝑝 → 𝑟 is always true.
And 𝑟 → 𝑞 and 𝑞 → 𝑝 are both always true. So 𝑟 → 𝑝 is always true.
So 𝑝 ↔ 𝑟 is always true.
So 𝑝 ≡ 𝑟
So ≡ is a transitive relation. □
As ≡ is reflexive, symmetric, and transitive, ≡ is an equivalence relation. ■

3. Suppose we want to define a new connective, the exclusive disjunction, also called
the “exclusive or”, which will be written +. By 𝒑 + 𝒒, we denote “ 𝒑 or 𝒒, but not both”.
Construct a truth table for this connective.

𝒑 𝒒 𝒑+𝒒
T T F
T F T
F T T
F F F

119
9.4. Relationships Between Statements UNIT 9. LOGIC: TRUTH TABLES

4. Find a statement that is logically equivalent to ¬( 𝒑 ∨ ¬𝒒)

¬( 𝑝 ∨ ¬𝑞) ≡ ¬ 𝑝 ∧ ¬(¬𝑞) De Morgan’s law


≡ ¬𝑝 ∧ 𝑞 Double Negation

5. Use the law of double negation and De Morgan’s laws to rewrite the following state-
ments so that the not symbol (¬) does not appear outside parentheses.
 
(a) ¬ ( 𝒑 ∨ 𝒒 ∨ ¬𝒒) ∧ (𝒒 ∧ ¬ 𝒑)
 
¬ ( 𝑝 ∨ 𝑞 ∨ ¬𝑞) ∧ ( 𝑞 ∧ ¬ 𝑝) ≡ ¬( 𝑝 ∨ 𝑞 ∨ ¬𝑞) ∨ ¬( 𝑞 ∧ ¬ 𝑝) De Morgan’s law
 
≡ ¬ 𝑝 ∧ ¬𝑞 ∧ ¬(¬𝑞) ∨ ¬𝑞 ∨ ¬(¬ 𝑝) De Morgan’s law
≡ (¬ 𝑝 ∧ ¬𝑞 ∧ 𝑞) ∨ (¬𝑞 ∨ 𝑝) Double Negation

h  i
(b) ¬ 𝒑 ∨ ( 𝒑 → 𝒒) ∨ ( 𝒑 ∧ 𝒒)

h  i h  i
¬ 𝑝 ∨ ( 𝑝 → 𝑞) ∨ ( 𝑝 ∧ 𝑞) ≡ ¬ 𝑝 ∨ (¬ 𝑝 ∨ 𝑞) ∨ ( 𝑝 ∧ 𝑞) Implication

≡ ¬ 𝑝 ∨ (¬ 𝑝 ∨ 𝑞) ∧ ¬( 𝑝 ∧ 𝑞) De Morgan’s law

≡ ¬ 𝑝 ∧ ¬(¬ 𝑝 ∨ 𝑞) ∧ (¬ 𝑝 ∨ ¬𝑞) De Morgan’s law

≡ ¬ 𝑝 ∧ (¬¬ 𝑝 ∧ ¬𝑞) ∧ (¬ 𝑝 ∨ ¬𝑞) De Morgan’s law

≡ ¬ 𝑝 ∧ ( 𝑝 ∧ ¬𝑞) ∧ (¬ 𝑝 ∨ ¬𝑞) Double Negation

6. Determine whether or not the following


 statements are equivalent:
¬ 𝒑 ∧ ( 𝒑 ∧ ¬𝒒) and ¬ 𝒑 ∨ ( 𝒑 → 𝒒)
 
¬ 𝑝 ∨ ( 𝑝 → 𝑞) ≡ ¬ 𝑝 ∨ (¬ 𝑝 ∨ 𝑞) Implication
≡ ¬ 𝑝 ∧ ¬(¬ 𝑝 ∨ 𝑞) De Morgan’s law
≡ ¬ 𝑝 ∧ (¬¬ 𝑝 ∧ ¬𝑞) De Morgan’s law
≡ ¬ 𝑝 ∧ ( 𝑝 ∧ ¬𝑞) Double Negation

Therefore the two expressions are equivalent.


Unit 10

Logic: Quantifiers, predicates and proof


strategies

10.1 Quantifiers and Predicates


10.1.1 Universal Quantifier (FOR ALL)

Universal Quantifier

A universal quantifier is written with the symbol ∀, meaning “for all”.

Example Examples would be:


“For all 𝑥 ∈ R . . . ” (written ∀ 𝑥 ∈ R)
“For every 𝑥 ∈ Z . . . ” (written ∀ 𝑥 ∈ Z)
The variable 𝑥 above is called a quantified variable.

This can be considered a generalisation of conjunction (AND).

Example Let 𝐴 = {1, 2, 3}. A declarative statement can then be made for the set:

∀ 𝑥 ∈ 𝐴, 𝑥 > 0

This means the same thing as

(1 > 0) ∧ (2 > 0) ∧ (3 > 0)

This statement is true.

121
10.1. Quantifiers and Predicates UNIT 10. LOGIC: PREDICATES AND PROOF STRATEGIES

10.1.2 Existential Quantifier (THERE EXISTS)

Existential Quantifier

An existential quantifier is written with the symbol ∃, meaning “there exists”.

Example Examples would be:


“There exists an 𝑥 ∈ R such that. . . ” (written ∃ 𝑥 ∈ R)
“For some 𝑥 ∈ Z . . . ” (written ∃ 𝑥 ∈ Z)

A quantified variable is a dummy variable

Any quantified variable can be replaced (everywhere it occurs) with another variable without
changing the meaning.

Example ∀ 𝑥 ∈ Z+ , ( 𝑥 > 0) ≡ ∀ 𝑦 ∈ Z+ , ( 𝑦 > 0)

This can be considered a generalisation of disjunction (OR).

Example Let 𝐴 = {1, 2, 3}. A declarative statement can then be made for the set:

∃ 𝑥 ∈ 𝐴, 𝑥 > 4

This means the same thing as

(1 > 4) ∨ (2 > 4) ∨ (3 > 4)

This statement is false.

Self Assessment Exercise 10.3


Write down the English equivalent of each of the following statements, and give an opin-
ion on whether or not the statement is true.

(a) ∃ 𝒚 ∈ Q, 𝒚 = 2
There
√ exists some rational number that is the square root of 2. This statement is false, as
2 is an irrational number.
(b) ∀𝒙 ∈ R, 2𝒙 < 𝒙 2
For all real numbers 𝑥 , 2𝑥 is less than 𝑥 2 . This statement is false, as 2(0) ≮ 02
(c) ∀𝒙 ∈ Z, 𝒙 > 0
Every integer is greater than 0. This statement is false, as −1 and 0 are both integers.
(d) ∃ 𝒙 ∈ Z+ , 𝒙 = 0
There exists a positive integer that is equal to 0. This statement is false, as 0 is not a
positive integer.

122
UNIT 10. LOGIC: PREDICATES AND PROOF STRATEGIES 10.1. Quantifiers and Predicates

Self Assessment Exercise 10.4


Prove by means of truth tables that
¬( 𝒑 ∧ 𝒒) ≡ (¬ 𝒑) ∨ (¬𝒒)

𝒑 𝒒 ¬𝒑 ¬𝒒 𝒑∧𝒒 ¬( 𝒑 ∧ 𝒒) (¬ 𝒑) ∨ (¬𝒒) ¬( 𝒑 ∧ 𝒒) ↔ (¬ 𝒑) ∨ (¬𝒒)


T T F F T F F T
T F F T F T T T
F T T F F T T T
F F T T F T T T

Self Assessment Exercise 10.5


Prove by means of truth tables that
¬( 𝒑 ∨ 𝒒) ≡ (¬ 𝒑) ∧ (¬𝒒)

𝒑 𝒒 ¬𝒑 ¬𝒒 𝒑∨𝒒 ¬( 𝒑 ∨ 𝒒) (¬ 𝒑) ∧ (¬𝒒) ¬( 𝒑 ∨ 𝒒) ↔ (¬ 𝒑) ∧ (¬𝒒)


T T F F T F F T
T F F T T F F T
F T T F T F F T
F F T T F T T T

10.1.3 Predicate
Predicate
A statement 𝑃 ( 𝑥 ) is called a predicate if it expresses some property of a variable 𝑥 ∈ 𝐴, and
returns either true or false depending on the value of 𝑥 . 𝑃 ( 𝑥 ) is true for any variable 𝑥 ∈ 𝐴 that
has the property, and 𝑃 ( 𝑥 ) is false if 𝑥 does not have that property.

A predicate is a boolean function

A predicate takes in a value, and either returns true or false.

10.1.4 Negation of Quantified Statements


If 𝑃 ( 𝑥 ) is a predicate containing some variable 𝑥 , then:

1. ¬ ∀ 𝑥 ∈ 𝐴, 𝑃 ( 𝑥 ) ≡ ∃ 𝑥 ∈ 𝐴, ¬ 𝑃 ( 𝑥 )

2. ¬ ∃ 𝑥 ∈ 𝐴, 𝑃 ( 𝑥 ) ≡ ∀ 𝑥 ∈ 𝐴, ¬ 𝑃 ( 𝑥 )

Example Determine the negation of the quantified statement “∀𝑥 ∈ 𝐴, 𝑃 ( 𝑥 ) ∨ 𝑄 ( 𝑋 )”.


 
¬ ∀𝑥 ∈ 𝐴, 𝑃 ( 𝑥 ) ∨ 𝑄 ( 𝑋 ) ≡ ∃ 𝑥 ∈ 𝐴, ¬ 𝑃 ( 𝑥 ) ∨ 𝑄 ( 𝑥 )
≡ ∃ ∈ 𝐴, ¬ 𝑃 ( 𝑥 ) ∧ ¬𝑄 ( 𝑥 )

123
10.1. Quantifiers and Predicates UNIT 10. LOGIC: PREDICATES AND PROOF STRATEGIES

Self Assessment Exercise 10.6


Determine the negations of the following quantified statements: (Show all steps.)

(a) ∀𝒙 ∈ Z+ , 𝒙 > 3

¬(∀𝑥 ∈ Z+ , 𝑥 > 3) ≡ ∃ 𝑥 ∈ Z+ , ¬( 𝑥 > 3)


≡ ∃ 𝑥 ∈ Z+ , 𝑥 ≤ 3

(b) ∃ 𝒙 ∈ R, 2 𝒙 = 𝒙 2

¬(∃ 𝑥 ∈ R, 2 𝑥 = 𝑥 2 ) ≡ ∀𝑥 ∈ R, ¬(2 𝑥 = 𝑥 2 )
≡ ∀𝑥 ∈ R, 2𝑥 ≠ 𝑥 2

(c) ∀𝒙 ∈ Z, ( 𝒙 > 0) ∨ ( 𝒙 2 > 0)

¬ ∀𝑥 ∈ Z, ( 𝑥 > 0) ∨ ( 𝑥 2 > 0) ≡ ∃ 𝑥 ∈ Z, ¬ ( 𝑥 > 0) ∨ ( 𝑥 2 > 0)


 

≡ ∃ 𝑥 ∈ Z, ¬( 𝑥 > 0) ∧ ¬( 𝑥 2 > 0)
≡ ∃ 𝑥 ∈ Z, ( 𝑥 ≤ 0) ∧ ( 𝑥 2 ≤ 0)

(d) ∃ 𝒚 ∈ Z+ , ( 𝒚 ≤ 10) ∧ ( 𝒚 ≠ 0)

¬ ∃ 𝑦 ∈ Z+ , ( 𝑦 ≤ 10) ∧ ( 𝑦 ≠ 0) ≡ ∀ 𝑦 ∈ Z+ , ¬ ( 𝑦 ≤ 10) ∧ ( 𝑦 ≠ 0)
 

≡ ∀ 𝑦 ∈ Z+ , ¬( 𝑦 ≤ 10) ∨ ¬( 𝑦 ≠ 0)
≡ ∀ 𝑦 ∈ Z+ , ( 𝑦 > 10) ∨ ( 𝑦 = 0)

(e) ∃ 𝒙 ∈ 𝑨, 𝑷 ( 𝒙 ) ∧ 𝑸 ( 𝒙 )
 
¬ ∃ 𝑥 ∈ 𝐴, 𝑃 ( 𝑥 ) ∨ 𝑄 ( 𝑥 ) ≡ ∀𝑥 ∈ 𝐴, ¬ 𝑃 ( 𝑥 ) ∨ 𝑄 ( 𝑥 )
≡ ∀𝑥 ∈ 𝐴, ¬ 𝑃 ( 𝑥 ) ∧ ¬𝑄 ( 𝑥 )

(f) ∀𝒙 ∈ Z+ , ( 𝒙 ≤ 3) → (𝒙 3 ≥ 1)

¬ ∀𝑥 ∈ Z+ ( 𝑥 ≤ 3) → ( 𝑥 3 ≥ 1) ≡ ¬ ∀𝑥 ∈ Z+ , ¬( 𝑥 ≤ 3) ∨ ( 𝑥 3 ≥ 1)
 

≡ ∃ 𝑥 ∈ Z+ , ¬ ¬( 𝑥 ≤ 3) ∨ ( 𝑥 3 ≥ 1)


≡ ∃ 𝑥 ∈ Z+ , ¬¬( 𝑥 ≤ 3) ∧ ¬( 𝑥 3 ≥ 1)
≡ ∃ 𝑥 ∈ Z+ , ( 𝑥 ≤ 3) ∧ ¬( 𝑥 3 ≥ 1)
≡ ∃ 𝑥 ∈ Z+ , ( 𝑥 ≤ 3) ∧ ( 𝑥 3 < 1)

124
UNIT 10. LOGIC: PREDICATES AND PROOF STRATEGIES 10.2. Proof Strategies

Self Assessment Exercise 10.7


For each of (a) to (d) in the previous exercise, determine whether the original statement
is true, whether the negation is true, or if neither of the two is true.

(a) The original statement is false, as 1, 2 and 3 are positive integers. The negation is true.
(b) The original statement is true, as when 𝑥 = 2, 2(2) = (2) 2 . The negation is false, as there
is an element.
(c) The original statement is false, as 0 ≯ 0 and 02 ≯ 0. The negation is true, if 𝑥 = 0.
(d) The original statement is true for any positive integer less than 10. The negation is false,
as not all positive integers are greater than 10.

10.2 Proof Strategies


Given some statement “if 𝑝, then 𝑞”, there are different ways to prove it.

10.2.1 Direct Proof


Assume that 𝑝 is true, and then reason step-by-step to show that 𝑞 is true.

Example Prove that the following statement is true for all 𝑥 ∈ R:

If 𝑥 2 − 4 𝑥 + 3 < 0, then 𝑥 > 0

Start by assuming that 𝑥 2 − 4 𝑥 + 3 < 0 is true.

Proof. Assume 𝑥 2 − 4 𝑥 + 3 < 0. That is:

𝑥 2 − 4𝑥 + 3 < 0
( 𝑥 − 3) ( 𝑥 − 1) < 0 (by factorisation)

That means either


(i) ( 𝑥 − 3) > 0 and ( 𝑥 − 1) < 0 (plus times minus gives minus), or
(ii) ( 𝑥 − 3) < 0 and ( 𝑥 − 1) > 0 (minus times plus gives minus)
For (i): ( 𝑥 − 3) > 0 and ( 𝑥 − 1) < 0
⇒ 𝑥>3 and 𝑥 <1
There is no 𝑥 that this can be true for.
For (ii): ( 𝑥 − 3) < 0 and ( 𝑥 − 1) > 0
⇒ 𝑥<3 and 𝑥 >1
This shows 1 < 𝑥 < 3, or 𝑥 ∈ (1, 3).
Therefore 𝑥 < 0 ■

125
10.2. Proof Strategies UNIT 10. LOGIC: PREDICATES AND PROOF STRATEGIES

10.2.2 Proof By Contradiction (Reductio Ad Absurdum)


Assume that 𝑝 is true. Then assume that 𝑞 is false, and use step-by-step reasoning until there is a
contradiction. If there is a contradiction, that means that 𝑞 must be true.

Example Prove that the following statement is true for all 𝑥 ∈ R:

If 𝑥 2 − 4 𝑥 + 3 < 0, then 𝑥 > 0

Start by assuming that 𝑥 2 − 4 𝑥 + 3 < 0 is true.

Proof. Assume 𝑥 2 − 4 𝑥 + 3 < 0.


If the antecedent is true, then either the consequent is true or the consequent is false.
Assume that the consequent is false, i.e. assume that 𝑥 ≯ 0, that is 𝑥 ≤ 0.
If 𝑥 ≤ 0,
Then −4𝑥 ≥ 0 (minus times minus gives plus)
And 𝑥 2 + 3 > 0
So 𝑥 2 − 4𝑥 + 3 > 0

However, this contradicts the original assumption. Therefore 𝑥 ≤ 0 cannot be true.


Therefore 𝑥 > 0. ■

10.2.3 Proof By Contrapositive

Contrapositive

The contrapositive of 𝑝 → 𝑞 is ¬𝑞 → ¬ 𝑝. These two statements are logically equivalent to each


other.

Example Prove that the following statement is true for all 𝑥 ∈ R:

If 𝑥 2 − 4 𝑥 + 3 < 0, then 𝑥 > 0

To use the contrapositive, swap the two statements around, and negate them:

Proof. To use the contrapositive, prove:

If ¬( 𝑥 > 0), then ¬( 𝑥 2 − 4𝑥 + 3 < 0) .

Assume ¬( 𝑥 > 0) is true, i.e. 𝑥 ≤ 0.


Factorise the consequent:

𝑥 2 − 4 𝑥 + 3 = ( 𝑥 − 3) ( 𝑥 − 1)

As 𝑥 ≤ 0, ( 𝑥 − 3) ≤ 0 and ( 𝑥 − 1) ≤ 0.
If ( 𝑥 − 3) ≤ 0 and ( 𝑥 − 1) ≤ 0,
Then ( 𝑥 − 3) ( 𝑥 − 1) ≥ 0 (minus times minus gives plus)
i.e. 𝑥 2 − 4𝑥 + 3 ≥ 0
i.e. ¬( 𝑥 2 − 4 𝑥 + 3 < 0) ■

126
UNIT 10. LOGIC: PREDICATES AND PROOF STRATEGIES 10.2. Proof Strategies

The contrapositive is not the same as the converse

The converse of a statement just swaps them around. This is not the same
as the contrapositive.

Example Given a statement, 𝑝 → 𝑞.


Converse 𝑞 → 𝑝
Contrapositive ¬𝑞 → ¬ 𝑝

10.2.4 Proofs Involving Quantifiers


In order to apply a proof to a quantified statement over an infinite set 𝐴, for example ∀ 𝑥 ∈ 𝐴, 𝑃 ( 𝑥 ),
think of the statement as 𝑥 ∈ 𝐴 → 𝑃 ( 𝑥 ).

Example Prove the statement

∀ 𝑥 ∈ R, 𝑥 2 + 1 > 0 .

Proof.
If 𝑥 ∈ R,
Then 𝑥 2 ≥ 0,
So 𝑥2 + 1 ≥ 1
i.e. 𝑥2 + 1 > 0 ■

To disprove a statement, prove that its negation is true. If this is a statement such as ∀ 𝑥 ∈ 𝐴, 𝑃 ( 𝑥 ), the
negation is ∃ 𝑥 ∈ 𝐴, ¬ 𝑃 ( 𝑥 ). This shows that in order to disprove the statement, one needs to simply
find a counterexample.

Example Show using a counterexample that this statement is not true:

∀ 𝑥 ∈ R, 𝑥 2 − 4 𝑥 > 0

Proof. To disprove ∀ 𝑥 ∈ R, 𝑥 2 − 4 𝑥 > 0, one needs to prove that:

∃ 𝑥 ∈ R, 𝑥 2 − 4 𝑥 ≥ 0

One could choose 𝑥 = 0.


Then

𝑥 2 − 4 𝑥 = (0) 2 − 4(0)
=0
≯0 ■

127
10.2. Proof Strategies UNIT 10. LOGIC: PREDICATES AND PROOF STRATEGIES

10.2.5 Vacuous Proofs


The truth table for an implication shows that if the antecedent is false, then the statement is always
true.
Using the above, if you can show that the conditional statement is false, then the statement is vacu-
ously true.

Example Prove that:

∅⊆𝑋

To prove the above statement, we need to show that:

If 𝑥 ∈ ∅, then 𝑥 ∈ 𝑋

Proof.
∅ is an empty set,
so “𝑥 ∈ ∅” is false,
therefore “if 𝑥 ∈ ∅, then 𝑥 ∈ 𝑋 ” is vacuously true. ■


Example Let 𝑆 be a relation on { 𝑎, 𝑏, 𝑐, 𝑑 }, where 𝑆 = ( 𝑎, 𝑏) , ( 𝑎, 𝑑 ) . Prove that 𝑆 is transitive.

Proof. For a set 𝑆 to be transitive, whenever ( 𝑥, 𝑦 ) ∈ 𝑆 and ( 𝑦, 𝑧 ) ∈ 𝑆, then ( 𝑥, 𝑧 ) ∈ 𝑆.


There are no two paits of the form ( 𝑥, 𝑦 ) and ( 𝑦, 𝑧) in 𝑆,
so it is vacuously true that 𝑆 is transitive. ■

Self Assessment Exercise 10.10

1. Prove each of the following statements by direct proof, contrapositive and contra-
diction respectively.

(a) If 𝒙 2 − 3𝒙 + 2 < 0, then 𝒙 > 0.

Direct Proof. Assume that 𝑥 2 − 3 𝑥 + 2 < 0 is true. That is ( 𝑥 − 1) ( 𝑥 − 2) < 0, by


factorisation.
So either
(i) ( 𝑥 − 1) < 0 and ( 𝑥 − 2) > 0
⇒ 𝑥<1 and 𝑥 >2
There is no 𝑥 that this can be true for.
(ii) ( 𝑥 − 1) > 0 and ( 𝑥 − 2) < 0
⇒ 𝑥>1 and 𝑥 <2
So 1 < 𝑥 < 2.
As 1 < 𝑥 < 2, 𝑥 > 0. ■

128
UNIT 10. LOGIC: PREDICATES AND PROOF STRATEGIES 10.2. Proof Strategies

Contrapositive. To show: If 𝑥 ≤ 0, then 𝑥 2 − 3 𝑥 + 2 ≥ 0.


Suppose 𝑥 ≤ 0. Then −3𝑥 ≥ 0. And 𝑥 2 + 2 > 0.
So 𝑥 2 − 3𝑥 + 2 ≥ 0 ■

Contradiction. Assume that 𝑥 2 − 3𝑥 + 2 < 0. Suppose that 𝑥 ≤ 0.


If 𝑥 ≤ 0, then −3 𝑥 ≥ 0. And 𝑥 2 + 2 ≥ 0.
So 𝑥 2 − 3𝑥 + 2 ≥ 0.
But that contradicts the original assumption.
So it must be the case that 𝑥 > 0 ■

(b) If 𝒙 2 − 𝒙 − 6 > 0, then 𝒙 ≠ 1.

Direct Proof. Assume that 𝑥 2 − 𝑥 − 6 > 0. That is, ( 𝑥 − 3) ( 𝑥 + 2) > 0.


So either
(i) ( 𝑥 − 3) > 0 and ( 𝑥 + 2) > 0
⇒ 𝑥>3 and 𝑥 > −2
So 𝑥 > 3.
(ii) ( 𝑥 − 3) < 0 and ( 𝑥 + 2) < 0
⇒ 𝑥<3 and 𝑥 < −2
So 𝑥 < −2.
So either 𝑥 > 3 or 𝑥 < −2.
So 𝑥 ≠ 1. ■

Contrapositive. To show: If 𝑥 = 1, then 𝑥 2 − 𝑥 − 6 ≤ 0.


Suppose 𝑥 = 1. Then 𝑥 2 − 𝑥 − 6 = (1) 2 − 1 − 6
=1−1−6
= −6
As −6 < 0, 𝑥2 − 𝑥 − 6 ≤ 0. ■

Contradiction. Assume that 𝑥 2 − 𝑥 − 6 > 0.


Suppose that 𝑥 = 1. Then 𝑥 2 − 𝑥 − 6 = (1) 2 − 1 − 6
=1−1−6
= −6
𝑥2
So − 𝑥 − 6 < 0.
But that contradicts the original assumption.
So it must be the case that 𝑥 ≠ 1. ■

129
10.2. Proof Strategies UNIT 10. LOGIC: PREDICATES AND PROOF STRATEGIES

(c) For all 𝒂, 𝒃 ∈ Z, if 𝒂 + 𝒃 is odd, then exactly one of 𝒂 or 𝒃 is odd.

Direct Proof. Assume that 𝑎 + 𝑏 is odd (where 𝑎, 𝑏 ∈ Z).


Then 𝑎 + 𝑏 = 2𝑛 + 1 for some integer 𝑛. Then either
(i) 𝑎 is even.
Suppose 𝑎 is even. Then 𝑎 = 2𝑘 for some integer 𝑘.

𝑎 + 𝑏 = 2𝑘 + 𝑏
2 𝑘 + 𝑏 = 2𝑛 + 1
⇒ 𝑏 = 2𝑛 + 1 − 2 𝑘
⇒ 𝑏 = 2( 𝑛 − 𝑘) + 1

So 𝑏 is odd.
(ii) 𝑎 is odd.
Suppose 𝑎 is odd. Then 𝑎 = 2𝑘 + 1 for some integer 𝑘.

𝑎 + 𝑏 = 2𝑘 + 1 + 𝑏
2 𝑘 + 1 + 𝑏 = 2𝑛 + 1
⇒ 𝑏 = 2𝑛 + 1 − 2 𝑘 − 1
⇒ 𝑏 = 2( 𝑛 − 𝑘)

So 𝑏 is even.
So if 𝑎 is even, then 𝑏 is odd. If 𝑎 is odd, then 𝑏 is even.
So exactly one of 𝑎 or 𝑏 is odd. ■

Contrapositive. To show: If both 𝑎 and 𝑏 are odd, or both 𝑎 and 𝑏 are even, then 𝑎 + 𝑏
is not odd.
There are two cases:
(i) Suppose 𝑎 and 𝑏 are both odd. Then 𝑎 = 2𝑛 + 1 for some integer 𝑛, and 𝑏 = 2𝑘 + 1
for some integer 𝑘.
So 𝑎 + 𝑏 = (2𝑛 + 1) + (2𝑘 + 1)
= 2𝑛 + 2 𝑘 + 2
= 2( 𝑛 + 𝑘 + 1)
So 𝑎 + 𝑏 is even, i.e. 𝑎 + 𝑏 is not odd.
(ii) Suppose 𝑎 and 𝑏 are both even. Then 𝑎 = 2𝑛 for some integer 𝑛 and 𝑏 = 2𝑘 for
some integer 𝑘.
So 𝑎 + 𝑏 = 2𝑛 + 2𝑘
= 2( 𝑛 + 𝑘)
So 𝑎 + 𝑏 is even, i.e. 𝑎 + 𝑏 is not odd.
So, if it is not the case that exactly one of 𝑎 or 𝑏 is odd, then 𝑎 + 𝑏 is not odd. ■

130
UNIT 10. LOGIC: PREDICATES AND PROOF STRATEGIES 10.2. Proof Strategies

Contradiction. Assume that 𝑎 + 𝑏 is odd (where 𝑎, 𝑏 ∈ Z).


Then either exactly one of 𝑎 and 𝑏 is odd, or that is not the case.
If it is not the case, then either 𝑎 and 𝑏 are both odd, or 𝑎 and 𝑏 are both even.
(i) Suppose 𝑎 and 𝑏 are both odd. Then 𝑎 = 2𝑛 + 1 for some integer 𝑛, and 𝑏 = 2𝑘 + 1
for some integer 𝑘.
So 𝑎 + 𝑏 = (2𝑛 + 1) + (2𝑘 + 1)
= 2𝑛 + 2 𝑘 + 2
= 2( 𝑛 + 𝑘 + 1)
So 𝑎 + 𝑏 is even, which contradicts the original assumption.
(ii) Suppose 𝑎 and 𝑏 are both even. Then 𝑎 = 2𝑛 for some integer 𝑛 and 𝑏 = 2𝑘 for
some integer 𝑘.
So 𝑎 + 𝑏 = 2𝑛 + 2𝑘
= 2( 𝑛 + 𝑘)
So 𝑎 + 𝑏 is even, which contradicts the original assumption.
Therefore it must be the case that exactly one of 𝑎 and 𝑏 is odd. ■

(d) For all 𝒙 ∈ Z, if 𝒙 is even, then 𝒙 2 + 4 𝒙 + 2 is even.

Direct Proof. Assume that 𝑥 is even, where 𝑥 ∈ Z. If 𝑥 is even, then 𝑥 = 2𝑘 for some
integer 𝑘.
So 𝑥 2 + 4 𝑥 + 2 = (2𝑘) 2 + 4(2𝑘) + 2
= 4 𝑘2 + 8 𝑘 + 2
= 2(2𝑘2 + 4𝑘 + 1)
So 𝑥 2 + 4 𝑥 + 2 is even. ■

Contrapositive. To show: If 𝑥 2 + 4 𝑥 + 2 is odd, then 𝑥 is odd.


Suppose 𝑥 2 + 4 𝑥 + 2 is odd. Then 𝑥 2 + 4 𝑥 + 2 = 2𝑘 + 1 for some integer 𝑘
So 𝑥 2 + 4 𝑥 + 2 = 2𝑘 + 1
⇒ 𝑥 2 + 4 𝑥 + 4 = 2𝑘 + 1 + 2 (Complete the square)
⇒ ( 𝑥 + 2) ( 𝑥 + 2) = 2𝑘 + 2 + 1
⇒ ( 𝑥 + 2) ( 𝑥 + 2) = 2( 𝑘 + 1) + 1
So, as ( 𝑥 + 2) ( 𝑥 + 2) is odd, that means that 𝑥 + 2 must be odd, as the product of the
integers is odd iff both integers are odd.
So 𝑥 + 2 = 2𝑛 + 1 for some integer 𝑛.
So 𝑥 = 2𝑛 + 1 − 2, so 𝑥 = 2𝑛 − 1.
So 𝑥 is odd.
So, if 𝑥 2 + 4𝑥 + 2 is odd, then 𝑥 is odd.
So, if 𝑥 is even, then 𝑥 2 + 4 𝑥 + 2 is even. ■

131
10.2. Proof Strategies UNIT 10. LOGIC: PREDICATES AND PROOF STRATEGIES

Contradiction. Assume 𝑥 is even. Then either 𝑥 2 + 4𝑥 + 2 is even, or odd.


Suppose that 𝑥 2 + 4𝑥 + 2 is odd. Then 𝑥 2 + 4 𝑥 + 2 = 2𝑘 + 1 for some integer 𝑘
So 𝑥 2 + 4 𝑥 + 2 = 2𝑘 + 1
⇒ 𝑥 2 + 4 𝑥 + 4 = 2𝑘 + 1 + 2 (Complete the square)
⇒ ( 𝑥 + 2) ( 𝑥 + 2) = 2𝑘 + 2 + 1
⇒ ( 𝑥 + 2) ( 𝑥 + 2) = 2( 𝑘 + 1) + 1
So, as ( 𝑥 + 2) ( 𝑥 + 2) is odd, that means that 𝑥 + 2 must be odd, as the product of the
integers is odd iff both integers are odd.
So 𝑥 + 2 = 2𝑛 + 1 for some integer 𝑛.
So 𝑥 = 2𝑛 + 1 − 2, so 𝑥 = 2𝑛 − 1.
So 𝑥 is odd.
But this contradicts the original assumption, so it must be the case that 𝑥 2 + 4𝑥 + 2 is
even. ■

(e) If 𝒏 is a multiple of 3, then 𝒏3 + 𝒏2 is a multiple of 3

Direct Proof. Assume that 𝑛 is a multiple of 3. Then 𝑛 = 3𝑘 for some integer 𝑘.


So 𝑛3 + 𝑛2 = (3𝑘) 3 + (3𝑘) 2
= 27𝑘3 + 9𝑘2
= 3(9𝑘3 + 3𝑘2 )
Therefore 𝑛3 + 𝑛2 is a multiple of 3. ■

Contrapositive. To show: If 𝑛3 + 𝑛2 is not a multiple of 3, then 𝑛 is not a multiple of


3.
Suppose that 𝑛3 + 𝑛2 is not a multiple of 3. Then 𝑛3 + 𝑛2 = 3𝑘 + 1 for some integer 𝑘.
If 𝑛3 + 𝑛2 = 3𝑘 + 1, then 𝑛 ( 𝑛2 + 𝑛) = 3𝑘 + 1.
So neither 𝑛, nor 𝑛2 + 𝑛 are multiples of 3.
So 𝑛 is not a multiple of 3.
Therefore if 𝑛 is a multiple of 3, then 𝑛3 + 𝑛2 is a multiple of 3. ■

Proof. Suppose 𝑛 is a multiple of 3. Then either 𝑛3 + 𝑛2 is a multiple of 3, or not.


If 𝑛3 + 𝑛2 is not a multiple of 3, then 𝑛3 + 𝑛2 = 3𝑘 + 1 for some integer 𝑘.
If 𝑛3 + 𝑛2 = 3𝑘 + 1, then 𝑛 ( 𝑛2 + 𝑛) = 3𝑘 + 1.
So neither 𝑛, nor 𝑛2 + 𝑛 are multiples of 3.
So 𝑛 is not a multiple of 3.
But this contradicts the original assumption.
So, if 𝑛 is a multiple of 3, then 𝑛3 + 𝑛2 is a multiple of 3. ■

2. Provide a counterexample to show that the statement


“If 𝒙 > 0, then 𝒙 2 − 3 𝒙 + 1 < 0” is not true for all integers 𝒙 > 0.
Let 𝑥 = 4. Then 𝑥 2 − 3 𝑥 + 1 = (4) 2 − 3(4) + 1
= 16 − 12 + 1
=5≮0

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy