COS1501 Notes Completed
COS1501 Notes Completed
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
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
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
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
5
Unit 1
Number Systems
𝑚+𝑛=𝑛+𝑚 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.
𝑚 ( 𝑛 + 𝑘) = 𝑚𝑛 + 𝑚𝑘
( 𝑛 + 𝑘) 𝑚 = 𝑚 ( 𝑛 + 𝑘)
= 𝑚𝑛 + 𝑚𝑘
= 𝑛𝑚 + 𝑘𝑚
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 𝑚𝑘 < 𝑛𝑘.
𝑚+𝑛=0
8
UNIT 1. NUMBER SYSTEMS 1.1. Number Properties
(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
𝑥 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
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.
11
2.3. Number Systems Heirarchy UNIT 2. RATIONAL AND REAL NUMBERS
𝑚 + 𝑛 = 2 𝑗 + 2𝑘
= 2( 𝑗 + 𝑘)
12
UNIT 2. RATIONAL AND REAL NUMBERS 2.3. Number Systems Heirarchy
𝑚 · 𝑛 = (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 𝐴 ⊆ 𝐵
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 𝐶 ⊂ 𝐷.
15
3.2. Creating Sets From Other Sets UNIT 3. SETS
𝐴 ∪ 𝐵 = 𝑥 | 𝑥 ∈ 𝐴 or 𝑥 ∈ 𝐵
𝐴 𝐵
𝐴 ∩ 𝐵 = 𝑥 | 𝑥 ∈ 𝐴 and 𝑥 ∈ 𝐵
𝐴 𝐵
16
UNIT 3. SETS 3.2. Creating Sets From Other Sets
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 𝑥 ∉ 𝐵
𝐴 𝐵
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
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
𝐴 𝐵
Empty Set
The set that contains no elements is called the empty set, and is written ∅.
Disjointness
Two sets 𝐴 and 𝐵 are called disjoint if they have no elements in common. In other words,
𝐴∩𝐵=∅
18
UNIT 3. SETS 3.3. Other Terms Significant For Sets
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
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
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
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 𝐴 = 𝐵.
𝐴∪𝐵 𝐴∩𝐵 ( 𝐴 ∪ 𝐵) − ( 𝐴 ∩ 𝐵)
𝐴 𝐵 𝐴 𝐵 𝐴 𝐵
𝐶 𝐶 𝐶
23
4.1. Venn Diagrams UNIT 4. PROOFS INVOLVING SETS
𝐶 ( 𝐴 ∪ 𝐵) − ( 𝐴 ∩ 𝐵) ∪ 𝐶
𝐴 𝐵 𝐴 𝐵
𝐶 𝐶
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.
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 𝑥 ∈ ( 𝐴 ∪ 𝐵),
∴ ( 𝐵 ∪ 𝐴) ⊆ ( 𝐴 ∪ 𝐵). □
∴ 𝐴∪𝐵= 𝐵∪𝐴 ■
Example
Proof. Proof.
𝑥 ∈ ( 𝑋 ∪ 𝑌 )′ 𝑥 ∈ ( 𝑋 ∩ 𝑌 )′
iff 𝑥 ∉ ( 𝑋 ∪ 𝑌 ) iff 𝑥 ∉ ( 𝑋 ∩ 𝑌 )
iff 𝑥 ∉ 𝑋 and 𝑥 ∉ 𝑌 iff 𝑥 ∉ 𝑋 or 𝑥 ∉ 𝑌
iff 𝑥 ∈ 𝑋 ′ and 𝑥 ∈ 𝑌 ′ iff 𝑥 ∈ 𝑋 ′ or 𝑥 ∈ 𝑌 ′
iff 𝑥 ∈ 𝑋 ′ ∩ 𝑌 ′ ■ iff 𝑥 ∈ 𝑋 ′ ∪ 𝑌 ′ ■
27
4.2. Proofs UNIT 4. PROOFS INVOLVING SETS
(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
𝑋 𝑌 ∩𝑍 𝑋 + (𝑌 ∩ 𝑍 )
𝑋 𝑌 𝑋 𝑌 𝑋 𝑌
𝑍 𝑍 𝑍
𝑋 +𝑌 𝑋+𝑍 𝑋 + (𝑌 ∩ 𝑍 )
𝑋 𝑌 𝑋 𝑌 𝑋 𝑌
𝑍 𝑍 𝑍
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
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 (𝑋 ∩ 𝑌 ) ■
𝑋 𝑌 −𝑍 𝑋 − (𝑌 − 𝑍 )
𝑋 𝑌 𝑋 𝑌 𝑋 𝑌
𝑍 𝑍 𝑍
𝑋 −𝑌 𝑍 (𝑋 − 𝑌 ) − 𝑍
𝑋 𝑌 𝑋 𝑌 𝑋 𝑌
𝑍 𝑍 𝑍
𝑋 − (𝑌 − 𝑍 ) = {1, 2}
( 𝑋 − 𝑌 ) − 𝑍 = {2}
{1, 2} ≠ {2}
𝑋 − (𝑌 − 𝑍 ) ≠ ( 𝑋 − 𝑌 ) − 𝑍 ■
30
UNIT 4. PROOFS INVOLVING SETS 4.2. Proofs
𝐴∩𝐵 𝐶∩𝐴 ( 𝐴 ∩ 𝐵) + ( 𝐶 ∩ 𝐴)
𝐴 𝐵 𝐴 𝐵 𝐴 𝐵
𝐶 𝐶 𝐶
𝐵′ 𝐴 ∩ 𝐵′ 𝐵−𝐶
𝐴 𝐵 𝐴 𝐵 𝐴 𝐵
𝐶 𝐶 𝐶
( 𝐴 ∩ 𝐵′ ) ∪ ( 𝐵 − 𝐶 )
𝐴 𝐵
( 𝐴 ∩ 𝐵) + ( 𝐶 ∩ 𝐴) = {2}
( 𝐴 ∩ 𝐵′ ) ∪ ( 𝐵 − 𝐶 ) = {1, 2, 3}
{2} ≠ {1, 2, 3}
( 𝐴 ∩ 𝐵) + ( 𝐶 ∩ 𝐴) ≠ ( 𝐴 ∩ 𝐵 ′ ) ∪ ( 𝐵 − 𝐶 ) ■
31
4.3. The Inclusion Exclusion Principle UNIT 4. PROOFS INVOLVING SETS
Sum Rule
If 𝑋 and 𝑌 are disjoint sets ( 𝑋 ∩ 𝑌 = ∅), and | 𝑋 | = 𝑚 and |𝑌 | = 𝑛, then | 𝑋 ∪ 𝑌 | = 𝑚 + 𝑛
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
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.
𝑀 𝐶
700 − 𝑥 𝑥 400 − 𝑥
(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
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.
FM UML
5−𝑥
𝑥+8 𝑥−3
𝑥
4−𝑥 7−𝑥
𝑥−2
ER
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
𝑥−3=3−3
=0
Whether the variable is 𝑥 or 𝑧 does not change the members of the set.
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
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} ■
38
UNIT 4. PROOFS INVOLVING SETS 4.4. Proofs on Specific Sets
39
4.4. Proofs on Specific Sets UNIT 4. PROOFS INVOLVING SETS
Proof. Suppose 𝑉 ⊆ 𝑊
Let 𝑥 ∈𝑉∩𝑍
Then 𝑥 ∈ 𝑉 and 𝑥 ∈ 𝑍
(If 𝑥 ∈ 𝑉 , 𝑥 ∈ 𝑊 , as 𝑉 ⊆ 𝑊 )
i.e. 𝑥 ∈ 𝑊 and 𝑥 ∈ 𝑍
i.e. 𝑥 ∈𝑊∩𝑍
∴ 𝑉∩𝑍 ⊆𝑊∩𝑍 ■
40
UNIT 4. PROOFS INVOLVING SETS 4.4. Proofs on Specific Sets
Let 𝑥 ∈ 𝑋 ∪ ∅
Then 𝑥 ∈ 𝑋 or 𝑥 ∈ ∅
i.e. 𝑥 ∈ 𝑋
(𝑥 cannot be in the empty set)
∴ 𝑋∪∅ ⊆ 𝑋
As ( 𝑋 ⊆ 𝑋 ∪ ∅) and ( 𝑋 ∪ ∅ ⊆ 𝑋 ), 𝑋 ∪ ∅ = 𝑋 ■
𝑉 ∩ 𝑊 = {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 𝑊 = ∅ □
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}
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}
Proof. Let 𝑥 ∈ 𝑋 + 𝑌 .
𝑥 ∈ 𝑋 +𝑌
iff ( 𝑥 ∈ 𝑋 or 𝑥 ∈ 𝑌 ) and 𝑥 ∉ 𝑋 ∩ 𝑌
iff ( 𝑥 ∈ 𝑌 or 𝑥 ∈ 𝑋 ) and 𝑥 ∉ 𝑋 ∩ 𝑌
iff 𝑥 ∈𝑌+𝑋
∴ 𝑋 +𝑌 =𝑌 + 𝑋 ■
42
UNIT 4. PROOFS INVOLVING SETS 4.4. Proofs on Specific Sets
Proof. Let 𝑥 ∈ 𝑋 ∩ (𝑌 + 𝑍 ).
𝑥 ∈ 𝑋 ∩ (𝑌 + 𝑍 )
iff 𝑥 ∈ 𝑋 and 𝑥 ∈ (𝑌 + 𝑍 )
iff 𝑥 ∈ 𝑋 and ( 𝑥 ∈ 𝑌 or 𝑥 ∈ 𝑍 and 𝑥 ∉ 𝑌 ∩ 𝑍 )
iff ( 𝑥 ∈ 𝑋 and 𝑥 ∈ 𝑌 ) or ( 𝑥 ∈ 𝑋 and 𝑥 ∈ 𝑍 ) and 𝑥 ∉ (𝑌 ∩ 𝑍 )
iff 𝑥 ∈ ( 𝑋 ∩ 𝑌 ) or 𝑥 ∈ ( 𝑋 ∩ 𝑍 ) and 𝑥 ∉ (𝑌 ∩ 𝑍 )
iff 𝑥 ∈ ( 𝑋 ∩ 𝑌 ) + (𝑌 ∩ 𝑍 )
∴ 𝑋 ∩ (𝑌 + 𝑍 ) = ( 𝑋 ∩ 𝑌 ) + (𝑌 ∩ 𝑍 ) ■
Unit 5
Relations
Example An ordered pair is written ( 𝑎, 𝑏) where 𝑎 and 𝑏 are elements of the pair. ( 𝑎, 𝑏) ≠ ( 𝑏, 𝑎).
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 𝐵
𝐴 ∪ 𝐵 = {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
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:
That is, all the elements that actually appear as first elements in the relation 𝑇 .
Range
That is, all the elements that actually appear as second elements in the relation 𝑇 .
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}.
Binary Relation
47
5.4. Properties of Relations UNIT 5. RELATIONS
Reflexivity
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
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 𝐴.
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 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:
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 = ( 𝑏, 𝑎) , ( 𝑐, 𝑏) , ( 𝑐, 𝑎)
Relation Composition
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
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
51
5.4. Properties of Relations UNIT 5. RELATIONS
2. Let 𝑨 = { 𝒂, 𝒃}. For each of the specifications given below, find suitable examples of
relations on P( 𝑨)
P ( 𝐴) = ∅, { 𝑎}, { 𝑏}, { 𝑎, 𝑏}
n
P ( 𝐴) × P ( 𝐴) = ∅, ∅ , ∅, { 𝑎} , ∅, { 𝑏} , ∅, { 𝑎, 𝑏}
{ 𝑎}, ∅ , { 𝑎}, { 𝑎} , { 𝑎}, { 𝑏} , { 𝑎}, { 𝑎, 𝑏}
{ 𝑏}, ∅ , { 𝑏}, { 𝑎} , { 𝑏}, { 𝑏} , { 𝑏}, { 𝑎, 𝑏}
o
{ 𝑎, 𝑏}, ∅ , { 𝑎, 𝑏}, { 𝑎} , { 𝑎, 𝑏}, { 𝑏} , { 𝑎, 𝑏}, { 𝑎.𝑏}
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 = ∅, ∅ , { 𝑎}, { 𝑎} , { 𝑏}, { 𝑏} , { 𝑎, 𝑏}, { 𝑎, 𝑏} , ∅, { 𝑎} , { 𝑎}, ∅
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( 𝑨)
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
∅, { 𝑎} , ∅, { 𝑏} , { 𝑏}, ∅
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 = ∅, ∅ , { 𝑎}, { 𝑎} , { 𝑏}, { 𝑏} , { 𝑎, 𝑏}, { 𝑎, 𝑏}
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
Subproof.
Assume 𝑅 ◦ 𝑅 ⊆ 𝑅.
Suppose ( 𝑥, 𝑦 ) ∈ 𝑅 and ( 𝑦, 𝑧) ∈ 𝑅.
Then ( 𝑥, 𝑧 ) ∈ 𝑅 ◦ 𝑅.
(By definition of composition)
And ( 𝑥, 𝑧 ) ∈ 𝑅
(Because 𝑅 ◦ 𝑅 ⊆ 𝑅)
∴ if ( 𝑥, 𝑦 ) ∈ 𝑅 and ( 𝑦, 𝑧) ∈ 𝑅, then ( 𝑥, 𝑧 ) ∈ 𝑅
∴ if 𝑅 ◦ 𝑅 ⊆ 𝑅, then 𝑅 is transitive. □
∴ 𝑅 is transitive iff 𝑅 ◦ 𝑅 ⊆ 𝑅. ■
Unit 6
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.
{ 𝑎, 𝑎} ∈ 𝑆 { 𝑎, 𝑏}, { 𝑎, 𝑏} ∈ 𝑆
55
6.1. Order Relations UNIT 6. SPECIAL KINDS OF RELATION
Activity 6.4
𝑥 + 𝑦 = 2𝑘
𝑥 = 2𝑘 − 𝑦
𝑦 + 𝑧 = 2𝑚
𝑧 = 2𝑚 − 𝑦
𝑥 + 𝑧 = (2𝑘 − 𝑦 ) + (2𝑚 − 𝑦 )
= 2 𝑘 + 2𝑚 − 2 𝑦
= 2( 𝑘 + 𝑚 − 𝑦 )
56
UNIT 6. SPECIAL KINDS OF RELATION 6.1. Order Relations
57
6.1. Order Relations UNIT 6. SPECIAL KINDS OF RELATION
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
58
UNIT 6. SPECIAL KINDS OF RELATION 6.1. Order Relations
59
6.1. Order Relations UNIT 6. SPECIAL KINDS OF 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.
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.
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. □
Counterexample. There are no pairs in the relation where {0} and {2} are related
to each other. □
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.
Counterexample. (∅, ∅) ∈ 𝑅. □
Antisymmetry 𝑅 is antisymmetric.
Transitivity 𝑅 is transitive.
3. 𝑿 = Z and 𝑹 =≤
𝑅 is a weak total order.
Proof.
Reflexivity 𝑅 is reflexive.
Counterexample. (1, 1) ∈ 𝑅 □
Antisymmetry 𝑅 is antisymmetric.
62
UNIT 6. SPECIAL KINDS OF RELATION 6.1. Order Relations
Transitivity 𝑅 is transitive.
Proof. For all 𝑥, 𝑦 ∈ Z, either 𝑥 = 𝑦 , or 𝑥 > 𝑦 or 𝑥 < 𝑦 . If 𝑥 > 𝑦 , then 𝑦 < 𝑥 . So 𝑥 and 𝑦
are always related to each other in 𝑅. □
4. 𝑿 = Z and 𝑹 =>
𝑅 is a strict total order.
Proof.
Reflexivity 𝑅 is not reflexive.
Counterexample. (1, 1) ∉ 𝑅. □
Irreflexivity 𝑅 is irreflexive.
Antisymmetry 𝑅 is antisymmetric.
Transitivity 𝑅 is transitive.
63
6.1. Order Relations UNIT 6. SPECIAL KINDS OF RELATION
Proof.
Reflexivity 𝑅 is reflexive.
𝑦 = 𝑘𝑥 ( 𝑘 ∈ Z+ )
= (1) 𝑥
=𝑥 □
Counterexample. (1, 1) ∈ 𝑅 □
Antisymmetry 𝑅 is antisymmetric.
Transitive 𝑅 is transitive.
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
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.
Equivalence Class
65
6.2. Equivalence Relation UNIT 6. SPECIAL KINDS OF RELATION
66
UNIT 6. SPECIAL KINDS OF RELATION 6.2. Equivalence Relation
(b) 𝑿 = { 𝒂, 𝒃, 𝒄 } and 𝑹 = 𝑿 × 𝑿
𝑅 = ( 𝑎, 𝑎) , ( 𝑎, 𝑏) , ( 𝑎, 𝑐) , ( 𝑏, 𝑎) , ( 𝑏, 𝑏) , ( 𝑏, 𝑐) , ( 𝑐, 𝑎) , ( 𝑐, 𝑏) , ( 𝑐, 𝑐)
67
6.2. Equivalence Relation UNIT 6. SPECIAL KINDS OF RELATION
(a) Do tests on 𝑹 for all of the following properties: reflexivity, irreflexivity, sym-
metry, antisymmetry, transitivity, and trichotomy.
Counterexample. (1, 1) ∈ 𝑅. ■
𝑦 − 𝑧 = 4𝑚
⇒ 𝑦 = 4𝑚 + 𝑧
𝑥 − 𝑦 = 4𝑘
⇒ 𝑥 − (4𝑚 + 𝑧 ) = 4𝑘
⇒ 𝑥 − 4𝑚 − 𝑧 = 4 𝑘
⇒ 𝑥 − 𝑧 = 4 𝑘 + 4𝑚
⇒ 𝑥 − 𝑧 = 4( 𝑘 + 𝑚)
∴ ( 𝑥, 𝑧 ) ∈ 𝑅 ■
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
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
𝑐
𝑧= 𝑦
𝑑
𝑐 𝑎
= 𝑥
𝑑 𝑏
𝑎𝑏
= 𝑥
𝑐𝑑
∴ ( 𝑥, 𝑧) ∈ 𝑅, so 𝑅 is transitive. □
∴ 𝑅 is an equivalence relation. ■
70
UNIT 6. SPECIAL KINDS OF RELATION 6.2. Equivalence Relation
Proof.
(i) If 𝑹 is symmetric, then 𝑹 = 𝑹 −1 .
Suppose ( 𝑥, 𝑦 ) ∈ 𝑅 −1 .
Then ( 𝑦, 𝑥 ) ∈ 𝑅 by the definition of an inverse relation.
Then ( 𝑥, 𝑦 ) ∈ 𝑅 because 𝑅 is symmetric.
So 𝑅 −1 ⊆ 𝑅.
As 𝑅 ⊆ 𝑅 −1 and 𝑅 −1 ⊆ 𝑅, 𝑅 = 𝑅 −1 □
Proof. Assume 𝑅 = 𝑅 −1 .
Suppose ( 𝑥, 𝑦 ) ∈ 𝑅.
Then ( 𝑦, 𝑥 ) ∈ 𝑅 −1 by the definition of an inverse relation.
So ( 𝑦, 𝑥 ) ∈ 𝑅 because 𝑅 = 𝑅 −1
So 𝑅 is symmetric. □
71
6.2. Equivalence Relation UNIT 6. SPECIAL KINDS OF RELATION
Theorem 6.1
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 𝐴.
72
UNIT 6. SPECIAL KINDS OF RELATION 6.2. Equivalence Relation
𝑃 is a partition of 𝑋 .
The equivalence relation is:
(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 𝑅 : 𝐴 → 𝐵.
Proof.
(i) 𝑓 is functional.
(ii) dom( 𝑓 ) = R
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
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} .
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.
Functional 𝑓 is functional.
Functional 𝑔 is functional.
Proof. Suppose (𝑢, 𝑣) , 𝑦 ∈ 𝑔 and (𝑢, 𝑣) , 𝑧 ∈ 𝑔. (𝑔 is functional iff 𝑦 = 𝑧.)
Then 𝑦 = 𝑢 ∪ 𝑣 and 𝑧 = 𝑢 ∪ 𝑣.
So 𝑦 = 𝑢 ∪ 𝑣 = 𝑧.
So 𝑔 is functional. ■
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. ■
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.
77
6.3. Functions UNIT 6. SPECIAL KINDS OF RELATION
(b) 𝑿 = 𝒀 = Z and 𝑹 = ( 𝒙, 𝒚 ) | 𝒚 = 𝒙 + 1 .
𝑅 is a function.
Proof.
Functional 𝑅 is functional.
Proof.
Functional 𝑅 is functional.
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.
(e) 𝑿 = 𝒀 = Z and 𝑹 = ( 𝒙, 𝒚 ) | 𝒚 2 = 𝒙 .
𝑅 is not a function.
Proof.
Functional 𝑅 is not functional.
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
Proof.
Functional 𝑅 is not functional.
So 𝑅 is not functional. □
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.
= 𝑥 | for some 𝑦 ∈ Z+ , 𝑦 = 𝑥 − 1
= 𝑥 | 𝑥 − 1 ∈ Z+
= 𝑥 > 1 | 𝑥 ∈ Z+
≠ Z+
For example, 𝑦 = 1 − 1 = 0 cannot be an element of 𝑅 if the domain is Z+ □
80
UNIT 6. SPECIAL KINDS OF RELATION 6.3. Functions
Equivalence Relations
𝑅1 = ( 𝑎, 𝑎) , ( 𝑏, 𝑏) , ( 𝑐, 𝑐)
𝑅2 = ( 𝑎, 𝑎) , ( 𝑏, 𝑏) , ( 𝑐, 𝑐) , ( 𝑎, 𝑏) , ( 𝑏, 𝑎)
𝑅3 = ( 𝑎, 𝑎) , ( 𝑏, 𝑏) , ( 𝑐, 𝑐) , ( 𝑎, 𝑐) , ( 𝑐, 𝑎)
𝑅4 = ( 𝑎, 𝑎) , ( 𝑏, 𝑏) , ( 𝑐, 𝑐) , ( 𝑏, 𝑐) , ( 𝑐, 𝑏)
𝑅5 = ( 𝑎, 𝑎) , ( 𝑏, 𝑏) , ( 𝑐, 𝑐) , ( 𝑎, 𝑏) , ( 𝑏, 𝑎) , ( 𝑎, 𝑐) , ( 𝑐, 𝑎) , ( 𝑏, 𝑐) , ( 𝑐, 𝑏)
(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
Range of a Function
{ 𝑓 ( 𝑥 ) | 𝑥 ∈ 𝐴}
𝑓 ( 𝑎) = 1 𝑓 ( 𝑏) = 2 𝑓 ( 𝑐) = 1
83
7.2. Surjectivity UNIT 7. MORE ABOUT FUNCTIONS
ran( 𝑔 ) = { 𝑔 ( 𝑥 ) | 𝑥 ∈ Z} (1)
= {2 𝑥 | 𝑥 ∈ Z} (2)
𝑦 = 2𝑥
𝑦
⇒ =𝑥
2
𝑦
⇒ 𝑥=
2
𝑦
ran( 𝑔 ) = { 𝑦 | ∈ Z} (4)
2
𝑦
= {𝑦 | is an integer} (5)
2
= { 𝑦 | 𝑦 is an even integer}
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 𝐵.
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
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 = ( 𝑎, 𝑑 ) , ( 𝑏, 𝑐)
𝑓 [Z] = { 𝑓 ( 𝑥 ) | 𝑥 ∈ Z}
= { 𝑥 + 1 | 𝑥 ∈ Z} ( 𝑦 = 𝑥 + 1 ⇒ 𝑥 = 𝑦 − 1)
= { 𝑦 | 𝑦 − 1 ∈ Z}
= { 𝑦 | 𝑦 − 1 is an integer}
=Z
85
7.2. Surjectivity UNIT 7. MORE ABOUT FUNCTIONS
3. Let 𝒇 : Z → Z be defined by 𝒇 ( 𝒙 ) = 4𝒙 + 8.
𝑓 [Z] = { 𝑓 ( 𝑥 ) | 𝑥 ∈ Z}
𝑦
= {4𝑥 + 8 | 𝑥 ∈ Z} ( 𝑦 = 4𝑥 + 8 ⇒ 𝑥 = 4 − 2)
𝑦
= {𝑦 | − 2 ∈ Z}
4
𝑦
= {𝑦 | is an integer}
4
= { 𝑦 | 𝑦 is an integer divisible by 4}
86
UNIT 7. MORE ABOUT FUNCTIONS 7.3. Injectivity
Injectivity
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)
Example
Prove Injectivity Let 𝑓 : Z → Z be defined by 𝑦 = 4𝑥 .
Assume 𝑓 ( 𝑢) = 𝑓 ( 𝑣) (1)
Then 4𝑢 = 4𝑣 (2)
i.e. 𝑢=𝑣 (3)
𝑢 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
1. In each of the following cases, write down the injective functions from 𝑿 to 𝒀 .
Proof. Assume ℎ ( 𝑢) = ℎ ( 𝑣)
Then 2𝑢 − 5 = 2 𝑣 − 5
2𝑢 = 2 𝑣
𝑢=𝑣
∴ ℎ is injective, because when ℎ (𝑢) = ℎ ( 𝑣), 𝑢 = 𝑣. ■
88
UNIT 7. MORE ABOUT FUNCTIONS 7.4. Composition of Functions
For any two functions 𝑓 : 𝐴 → 𝐵 and 𝑔 : 𝐵 → 𝐶 , the composition of the two functions
𝑔 ◦ 𝑓 : 𝐴 → 𝐶 is also a function.
Composite Function
For any two surjective functions 𝑓 : 𝐴 → 𝐵 and 𝑔 : 𝐵 → 𝐶 , the composition of the two functions
𝑔 ◦ 𝑓 : 𝐴 → 𝐶 is also a surjective function.
89
7.4. Composition of Functions UNIT 7. MORE ABOUT FUNCTIONS
For any two injective functions 𝑓 : 𝐴 → 𝐵 and 𝑔 : 𝐵 → 𝐶 , the composition of the two functions
𝑔 ◦ 𝑓 : 𝐴 → 𝐶 is also a injective function.
90
UNIT 7. MORE ABOUT FUNCTIONS 7.5. Bijective and Invertible Functions
(𝑔 ◦ 𝑓 ) (𝑥) = 𝑔 𝑓 (𝑥) ( 𝑓 ◦ 𝑔) ( 𝑥 ) = 𝑓 𝑔 ( 𝑥 )
= 𝑔 (113) = 𝑓 ( 𝑥 + 1)
= 113 + 1 = 113
= 114
Bijective Function
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
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. □
92
UNIT 7. MORE ABOUT FUNCTIONS 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.
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.
Proof. Assume 𝑓 ( 𝑢) = 𝑓 ( 𝑣)
Then 𝑢+1= 𝑣+1
i.e. 𝑢=𝑣
Therefore 𝑓 is injective. ■
93
7.6. Identity Function UNIT 7. MORE ABOUT FUNCTIONS
Proof. 𝑓 [Z] = { 𝑓 ( 𝑥 ) | 𝑥 ∈ Z}
= { 𝑥 + 1 | 𝑥 ∈ Z}
= { 𝑦 | 𝑦 − 1 ∈ Z}
= { 𝑦 | 𝑦 ∈ Z}
=Z
Therefore 𝑓 is surjective. ■
Proof. Assume 𝑓 ( 𝑢) = 𝑓 ( 𝑣)
Then 𝑢2 = 𝑣2
i.e. ±𝑢 = ± 𝑣
Therefore 𝑓 is not injective. ■
Proof. 𝑓 [Z] = { 𝑓 ( 𝑥 ) | 𝑥 ∈ Z}
= { 𝑥 2 | 𝑥 ∈ Z}
√
= { 𝑦 | ± 𝑦 ∈ Z}
≠Z
94
UNIT 7. MORE ABOUT FUNCTIONS 7.6. Identity Function
(c) 𝒇 : Z → Z is defined by 𝒇 ( 𝒙 ) = 3 − 𝒙 .
(d) 𝒇 : Z → Z is defined by 𝒇 ( 𝒙 ) = 4𝒙 + 5.
95
7.6. Identity Function UNIT 7. MORE ABOUT FUNCTIONS
Proof.
Injectivity. Assume 𝑖𝐶 ( 𝑢) = 𝑖𝐶 ( 𝑣)
Then 𝑢=𝑣
Therefore 𝑖𝐶 is injective. □
Surjectivity. 𝑖𝐶 [𝐶 ] = { 𝑖𝑐 | 𝑐 ∈ 𝐶 }
= {𝑐 | 𝑐 ∈ 𝐶 }
=𝐶
Therefore 𝑖𝐶 is surjective. □
Operations
Binary Operation
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: 𝑥 𝑓 𝑦 .
By convention, the elements of a binary operation are all the same set.
Infinite Set
A set that is not finite. Meaning one cannot count the number of elements
in the set.
97
8.1. Binary Operation UNIT 8. OPERATIONS
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
98
UNIT 8. OPERATIONS 8.2. Properties of Binary Operations
Commutativity
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.
Associativity
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
Identity Element
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
(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.
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
⋆ 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 𝑨 = { 𝒂, 𝒃, 𝒄, 𝒅 }
101
8.3. Operations on Vectors UNIT 8. OPERATIONS
𝑢 = ( 𝑢1 , 𝑢2 , 𝑢3 , . . . , 𝑢𝑛 ) for some 𝑛 ≥ 2
𝑢 + 𝑣 = ( 𝑢1 , 𝑢2 , . . . , 𝑢𝑛 ) + ( 𝑣1 , 𝑣2 , . . . , 𝑣𝑛 )
= (𝑢1 + 𝑣2 , 𝑢2 + 𝑣2 , . . . , 𝑢𝑛 + 𝑣𝑛 )
𝑢 + 𝑣 = (1, 2, 3) + (4, 5, 6)
= (1 + 4, 2 + 5, 3 + 6)
= (5, 7, 9)
102
UNIT 8. OPERATIONS 8.3. Operations on Vectors
𝑟 · 𝑢 = 𝑟 ( 𝑢 1 , 𝑢2 , . . . , 𝑢 𝑛 )
= ( 𝑟𝑢1 , 𝑟𝑢2 , . . . , 𝑟𝑢𝑛 )
𝑟 · 𝑢 = 2(7, 8, 9)
= (14, 16, 18)
103
8.3. Operations on Vectors UNIT 8. OPERATIONS
𝑢 · 𝑣 = 𝑢1 𝑣1 + 𝑢2 𝑣2 + . . . + 𝑢𝑛 𝑣𝑛
Unlike the other operations, which result in vectors, the dot product produces a single number.
𝑢 · 𝑣 = (2, 4, 6) (1, 3, 5)
= (2 · 1) + (4 · 3) + (6 · 5)
= 2 + 12 + 30
= 44
As with addition, if two vectors have a different number of coordinates, you cannot calculate
the dot product.
104
UNIT 8. OPERATIONS 8.4. Operations on Matrices
−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
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
Scalar-Matrix Multiplication
1 2
Example Let 𝑟 = 3 and 𝐴 =
3 4
1 2 3 6
𝑟𝐴 = 3 =
3 4 9 12
106
UNIT 8. OPERATIONS 8.4. Operations on Matrices
Matrix Multiplication
Identity Matrix
Then the identity matrix would have 1’s for the main diagonal, and 0’s elsewhere.
107
8.4. Operations on Matrices UNIT 8. OPERATIONS
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. ■
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
So, matrix multiplication is not commutative, and an identity element exists for matrix
multiplication. ■
Unit 9
111
9.2. Combining Statements UNIT 9. LOGIC: TRUTH TABLES
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
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
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.
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
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.
(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
𝒑 𝒒 ¬𝒑 ¬𝒒 𝒒 ∧ ¬𝒒 ¬ 𝒑 → (𝒒 ∧ ¬𝒒) [¬ 𝒑 → (𝒒 ∧ ¬𝒒)] → 𝒑
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) 𝒑 → [𝒒 ∧ 𝒓 ] ↔ [ 𝒑 → 𝒒] ∨ [ 𝒑 → 𝒓 ]
116
UNIT 9. LOGIC: TRUTH TABLES 9.4. Relationships Between Statements
Tautology
9.4.2 Contradiction
Contradiction
A compound statement that is always false is called a contradiction.
Logical Equivalence
Two declarative statements 𝑎 and 𝑏 are logically equivalent, written 𝑎 ≡ 𝑏, if and only if the
statement 𝑎 → 𝑏 is a tautology.
𝑝∨𝑞≡𝑞∨ 𝑝
117
9.4. Relationships Between Statements UNIT 9. LOGIC: TRUTH TABLES
118
UNIT 9. LOGIC: TRUTH TABLES 9.4. Relationships Between Statements
𝑝 ↔ 𝑞 ≡ ( 𝑝 → 𝑞) ∧ ( 𝑞 → 𝑝)
≡ (¬ 𝑝 ∨ 𝑞) ∧ (¬𝑞 ∨ 𝑝)
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
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
Universal Quantifier
Example Let 𝐴 = {1, 2, 3}. A declarative statement can then be made for the set:
∀ 𝑥 ∈ 𝐴, 𝑥 > 0
121
10.1. Quantifiers and Predicates UNIT 10. LOGIC: PREDICATES AND PROOF STRATEGIES
Existential Quantifier
Any quantified variable can be replaced (everywhere it occurs) with another variable without
changing the meaning.
Example Let 𝐴 = {1, 2, 3}. A declarative statement can then be made for the set:
∃ 𝑥 ∈ 𝐴, 𝑥 > 4
122
UNIT 10. LOGIC: PREDICATES AND PROOF STRATEGIES 10.1. Quantifiers and Predicates
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.
123
10.1. Quantifiers and Predicates UNIT 10. LOGIC: PREDICATES AND PROOF STRATEGIES
(a) ∀𝒙 ∈ Z+ , 𝒙 > 3
(b) ∃ 𝒙 ∈ R, 2 𝒙 = 𝒙 2
¬(∃ 𝑥 ∈ R, 2 𝑥 = 𝑥 2 ) ≡ ∀𝑥 ∈ R, ¬(2 𝑥 = 𝑥 2 )
≡ ∀𝑥 ∈ R, 2𝑥 ≠ 𝑥 2
≡ ∃ 𝑥 ∈ 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
(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.
𝑥 2 − 4𝑥 + 3 < 0
( 𝑥 − 3) ( 𝑥 − 1) < 0 (by factorisation)
125
10.2. Proof Strategies UNIT 10. LOGIC: PREDICATES AND PROOF STRATEGIES
Contrapositive
To use the contrapositive, swap the two statements around, and negate them:
𝑥 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 converse of a statement just swaps them around. This is not the same
as the contrapositive.
∀ 𝑥 ∈ 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.
∀ 𝑥 ∈ R, 𝑥 2 − 4 𝑥 > 0
∃ 𝑥 ∈ R, 𝑥 2 − 4 𝑥 ≥ 0
𝑥 2 − 4 𝑥 = (0) 2 − 4(0)
=0
≯0 ■
127
10.2. Proof Strategies UNIT 10. LOGIC: PREDICATES AND PROOF STRATEGIES
∅⊆𝑋
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.
1. Prove each of the following statements by direct proof, contrapositive and contra-
diction respectively.
128
UNIT 10. LOGIC: PREDICATES AND PROOF STRATEGIES 10.2. Proof Strategies
129
10.2. Proof Strategies UNIT 10. LOGIC: PREDICATES AND PROOF STRATEGIES
𝑎 + 𝑏 = 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
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. ■
131
10.2. Proof Strategies UNIT 10. LOGIC: PREDICATES AND PROOF STRATEGIES