Logic Teacher
Logic Teacher
Discrete Mathematics
Logic
1. Logic
2. Predicate Logic
3. Proofs
4. Set Theory
WUCT121 Logic 1
Section 1. Logic
1.1. Introduction.
Examples:
(3 + 4) + 6 = 3 + (4 + 6) Associativity
• = 3 + 10
= 13
3 x − 5 x = (3 − 5)x Distributivity
•
= −2 x
WUCT121 Logic 2
In a similar way, Logic deals with statements or sentences
by defining symbols and establishing ‘rules’.
Examples:
• x < 1 or x > 7 .
1.2. Statements
1.2.1. Definition
WUCT121 Logic 3
A statement which is true requires a proof.
Examples:
Consider x 2 = 1.
Therefore, x − 1 = 0 or x + 1 = 0 .
Case 1: x −1 = 0.
Case 2: x +1 = 0.
WUCT121 Logic 4
A statement which is false requires a demonstration.
Example:
5 − (3 − 2) = (5 − 3) − 2
5 − (3 − 2) = 5 − 1
=4
(5 − 3) − 2 = 2 − 2
=0
∴ 5 − (3 − 2) ≠ (5 − 3) − 2
WUCT121 Logic 5
Exercise:
WUCT121 Logic 6
Strictly speaking, as we don’t know what x or y are, in parts
(ix) and (x), these should not be statements. In
Mathematics, x and y usually represent real numbers and
we will assume this is the case here.
Examples:
• p:2+3= 6
p is a simple statement
WUCT121 Logic 7
1.2.3. Compound Statements
Examples:
• P: 2 + 3 = 6 or 5 − (3 − 2) = (5 − 3) − 2 .
Is a compound statement.
p: 2 + 3 = 6
q: 5 − (3 − 2) = (5 − 3) − 2
Operation: or
WUCT121 Logic 8
• P: If it is not raining then I will go outside and eat my
lunch.
Is a compound statement
p: It is raining
q: I will go outside
r: I will eat my lunch
Negation of p
Operations: If … then, and
WUCT121 Logic 9
Exercises:
(iii) 2 + 3 ≠ 6 p: 2 + 3 = 6 negation
(iv) x ≤ 2 p: x < 2 or
q: x = 2
WUCT121 Logic 10
1.3. Truth Tables
Note: Some books may use “1” for true and “0” for false.
WUCT121 Logic 11
Once all possible truth values for the simple statements are
inserted, determine the truth vales of the compound
statements following the rules for the operations.
Example:
P Q R Compound Statement
T T T
T T F
T F T
T F F
F T T
F T F
F F T
F F F
WUCT121 Logic 12
1.4. Logical Operations
WUCT121 Logic 13
Examples:
• P: It is raining outside.
~P: ~(It is raining outside.)
It is not raining outside.
• Q: x > 2 or x < 2
~Q: ~( x > 2 or x < 2 )
Simplified: x = 2 .
Exercises:
• P x2 −1 = 0
~ P: (
~ x 2 −1 = 0 )
x2 −1 ≠ 0
WUCT121 Logic 14
1.4.1.1 Truth Table for Negation
P ~P
P ~P
• 2+5= 7 2+5≠ 7
T F
F T
WUCT121 Logic 15
Exercise:
P ~P
• 1∈ 1∉
T F
• Division is a closed Division is not a closed
operation on operation on
F T
Note:
• The truth table for negation tells us that for any
statement P, exactly one of P or ~P is true. So, to prove P
is true, we have two methods:
WUCT121 Logic 16
1.4.2. Disjunction, “or”
Definition: Disjunction.
Examples:
• Write P : x ≤ 5 using “ ∨ ”.
( x < 5) ∨ ( x = 5)
Exercises:
WUCT121 Logic 17
• For the statements P and Q, write down P ∨ Q .
∗ P: x >0 Q: x =0
P ∨ Q : ( x > 0) ∨ ( x = 0)
simplified : x≥0
P Q P∨Q
T T T
T F T
F T T
F F F
WUCT121 Logic 18
Example:
P Q P∨Q
• 2+3=5 2+3=6
T F T
• 1∉ 0∈
F F F
Exercise:
P Q P∨Q
• 2 >1 ( x + 1) 2 = x 2 + 2 x + 1
T T T
• 2 is odd 5 is odd
F T T
F F F
WUCT121 Logic 19
1.4.3. Conjunction, “and”
Definition: Conjunction.
Examples:
Exercises:
WUCT121 Logic 20
• For the statements P and Q, write down P ∧ Q .
∗ P: x >0 Q : x <1
P ∧ Q : ( x > 0 ) ∧ ( x < 1)
simplified : 0 < x <1
P Q P∧Q
T T T
T F F
F T F
F F F
WUCT121 Logic 21
Example:
P Q P∧Q
• 2+3=5 2+3=6
T F F
• 1∉ 0∈
F F F
Exercise:
P Q P∧Q
• 2 >1 6 >π
T T T
• 2 is odd 5 is odd
F T F
• 2 <1 4 = 23
F F F
WUCT121 Logic 22
1.4.4. Conditional, “If … then”, “implies”
Definition: Conditional.
Examples:
x is even ⇒ x 2 is even
Exercises:
WUCT121 Logic 23
• For the statements P and Q, write down P ⇒ Q .
∗ P : x > −1 Q: x >0
P ⇒ Q : ( x > −1) ⇒ ( x > 0 )
“If you arrive for the lecture on time, then I will mark you
present.
WUCT121 Logic 24
It is false when you show up on time and are not marked
present.
P Q P⇒Q
T T T
T F F
F T T
F F T
WUCT121 Logic 25
Example:
P Q P⇒Q
• 2+3=5 2+3=6
T F F
• 1∉ 0∈
F F T
Exercise:
P Q P⇒Q
• 2 >1 2 >1
T T T
• 2 is even 5 is even
T F F
• 2 <1 4 <1
F F T
WUCT121 Logic 26
Alternative wording for P ⇒ Q can be:
• If P then Q.
• P implies Q.
• Q if P.
• Q provided P.
• Q whenever P.
• P only if Q.
WUCT121 Logic 27
1.4.5. Biconditional, “If and only if”
Definition: Biconditional.
Examples:
Exercises:
WUCT121 Logic 28
∗ x is a natural number if, and only if, x is an
integer.
(x is a natural number) ⇔ (x is an integer)
∗ P : x ∈ Q: x >0
P ⇔ Q : ( x ∈ ) ⇔ ( x > 0 )
P Q P⇔Q
T T T
T F F
F T F
F F T
WUCT121 Logic 29
Example:
P Q P⇔Q
• 2+3=5 2+3=6
T F F
• 1∉ 0∈
F F T
Exercise:
P Q P⇔Q
• 2 >1 2 >1
T T T
• 2 is odd 5 is odd
F T F
• 2 <1 4 <1
F F T
WUCT121 Logic 30
Alternative wording for P ⇔ Q can be:
• P iff Q.
• P is equivalent to Q.
WUCT121 Logic 31
1.4.6. Order of Operation for Logical Operators.
• { p∧
~ {q • { p∧
~ {( q∨
{r)
1 2 1 3 2
• • { p⇒
{q∧
~
{ ( p∧
{q) ~ {r
2 1 1 3 2
Exercises:
Indicate the order of operations in the following:
• { p⇒
(~ { q )∧
{r • { p⇒
~ { q∨
{r
1 2 3 1 3 2
• ~
{ ( p∨
{q) • { p⇔
~ { q∧
{r
2 1 1 3 2
WUCT121 Logic 32
1.4.7. Main Connective
Examples:
• { p∧
~ {q • { p∧
~ { ( q∨
{r)
1 2* 1 3* 2
• ~
{ ( p∧
{q) • { p⇒
~ {q∧
{r
2* 1 1 3* 2
Exercises:
• { p⇒
(~ {q)∧
{r • { p⇒
~ { q∨
{r
1 2 3* 1 3* 2
• ~
{ ( p∨
{q) • { p⇔
~ { q∧
{r
2* 1 1 3* 2
WUCT121 Logic 33
Example:
p q ~ (p ∧ ~ q)
T T T F F
T F F T T
F T T F F
F F T F T
Step: 3* 2 1
Exercises:
p q ~ p ⇒ ~ q ∧ p
T T F T F F
T F F T T T
F T T F F F
F F T F T F
Step: 1 3* 1 2
WUCT121 Logic 34
• Construct a truth table for ( p ∨ q ) ∧ (r ∨ q ), indicating
order of operations and the main connective
p q r (p ∨ q) ∧ (r ∨ q)
T T T T T T
T T F T T T
T F T T T T
T F F T F F
F T T T T T
F T F T T T
F F T F F T
F F F F F F
Step: 1 2* 1
p q r (~ q ∧ r) ∨ ~ (p ∧ r)
T T T F F F F T
T T F F F T T F
T F T T T T F T
T F F T F T T F
F T T F F T T F
F T F F F T T F
F F T T T T T F
F F F T F T T F
Step: 1 2 3* 2 1
WUCT121 Logic 35
1.5. Tautologies and Contradictions
1.5.1. Tautology
Definition: Tautology.
Examples:
P Q P ⇒ (Q ⇒ P)
T T T T
T F T T
F T T F
F F T T
Step: 2* 1
WUCT121 Logic 36
Exercises:
P Q ((P ⇒ Q) ∧ P) ⇒ Q
T T T T T
T F F F T
F T T F T
F F T F T
Step: 1 2 3*
P Q ((P ⇒ Q) ∧ ~Q) ⇒ ~ P
T T T F F T F
T F F F T T F
F T T F F T T
F F T T T T T
Step: 2 3 1 4* 1
WUCT121 Logic 37
1.5.1.1 Quick Method for Showing a
Tautology
WUCT121 Logic 38
Examples:
P ⇒ (Q ⇒ P)
Step 2* 1
WUCT121 Logic 39
• Determine if ( P ∧ Q) ⇒ (R ∧ S ) is a tautology, using
the quick method
(P ∧ Q) ⇒ (R ∧ S)
Step 1 3* 2
WUCT121 Logic 40
Exercises:
((P ⇒ Q) ∧ P) ⇒ Q
Step 1 2 3*
WUCT121 Logic 41
• Determine if the statement (( P ⇒ Q ) ∧ ~ Q ) ⇒ ~ P is
a tautology, using the “quick” method.
((P ⇒ Q) ∧ ~Q) ⇒ ~P
Step: 2 3 1 4* 1
1.Place “F” under main F
connective
WUCT121 Logic 42
1.5.2. Contradiction
Definition: Contradiction.
Examples:
P Q ~ (P ∧ Q) ⇔ (Q ∧ P)
T T F T F T
T F T F F F
F T T F F F
F F T F F F
Step: 2 1 4* 3
WUCT121 Logic 43
Exercises:
P Q ~(P ∨ Q) ∧ P
T T F T F
T F F T F
F T F T F
F F T F F
Step: 2 1 3*
P Q (P ∧ Q) ∧ ~Q)
T T T F F
T F F F T
F T F F F
F F F T T
Step: 2 3* 1
WUCT121 Logic 44
1.5.2.1 Quick Method for Showing a
Contradiction
WUCT121 Logic 45
Example:
~ (P ∨ Q) ∧ P
Step: 2 1 3*
1.Place “T” under main T
connective
WUCT121 Logic 46
Exercise:
(P ∧ Q) ∧ ~Q
Step: 2 3* 1
1.Place “T” under main T
connective.
WUCT121 Logic 47
1.5.3. Contingent
Definition: Contingent.
Examples:
P Q Q ∨ (Q ⇒ P)
T T T T
T F T T
F T F F
F F T T
Step: 2* 1
WUCT121 Logic 48
Exercises:
p q r ~( (p ∧ ~ q) ∨ r) ⇔ (r ⇒ q)
T T T F F F T F T
T T F T F F F T T
T F T F T T T T F
T F F F T T T F T
F T T F F F T F T
F T F T F F F T T
F F T F F T T T F
F F F T F T F T T
Step: 4 2 1 3 6* 5
WUCT121 Logic 49
1.6. Logical Equivalence
Two statements are logically equivalent if, and only if, they
have identical truth values for each possible substitution of
statements for their statements variables.
WUCT121 Logic 50
Examples:
p q p ⇒ q ~p ∨ q
T T T F T
T F F F F
F T T T T
F F T T T
Step: 1* 1 2*
Since the main connectives * are identical, the statements P
and Q are equivalent. Thus P ≡ Q i.e. p ⇒ q ≡ ~ p ∨ q
p q ~( p ∧ q) ~p ∧ ~q
T T F T F F F
T F T F F F T
F T T F T F F
F F T F T T T
Step: 2* 1 1 2* 1
Since the main connectives * are not identical, the
statements P and Q are not equivalent.
WUCT121 Logic 51
Exercises:
p q ~( p ∨ q) ~p ∧ ~q
T T F T F F F
T F F T F F T
F T F T T F F
F F T F T T T
Step: 2* 1 1 2* 1
Since the main connectives are identical, the statements P
and Q are equivalent. Thus P ≡ Q i.e. ~ ( p ∨ q ) ≡~ p ∧ ~ q
p q ~( p ∧ q) ⇔ ~p ∨ ~q
T T F T T F F F
T F T F T F T T
F T T F T T T F
F F T F T T T T
Step: 2* 1 3* 1 2* 1
Since the main connective is all T, the statement
~ ( p ∧ q ) ⇔ ~ p ∨ ~ q is a tautology, and hence
~ ( p ∧ q ) ≡~ p ∨ ~ q .
WUCT121 Logic 52
1.6.2. Substitution
Examples:
• We know P ∨ ~ P is a tautology.
Thus, by the rule of substitution, so too are:
∗ Q ∨ ~ Q , by letting Q = P .
∗ (( p ∧ q ) ⇒ r )∨ ~ (( p ∧ q ) ⇒ r ) , by letting
( p ∧ q) ⇒ r = P .
WUCT121 Logic 53
Rule of Substitution of Equivalence: If in a tautology we
replace any part of a statement by a statement equivalent to
that part, the result is still a tautology.
Example:
• Determine if P ⇒ (~ Q ∨ P ) is a tautology.
Exercise:
• ~ T ∨ (~ S ∨ T ) a tautology? Yes.
We know ( P ⇒ Q ) ≡~ P ∨ Q . So, ( S ⇒ T ) ≡~ S ∨ T and
T ⇒ (~ S ∨ T ) ≡ ~ T ∨ (~ S ∨ T ) (by RoS).
Hence, ~ T ∨ (~ S ∨ T ) ≡ T ⇒ ( S ⇒ T ) (by SoE).
P ⇒ (Q ⇒ P ) is a known tautology, thus (by (SoE)
T ⇒ ( S ⇒ T ) is a tautology, and since
~ T ∨ (~ S ∨ T ) ≡ T ⇒ ( S ⇒ T ) , ~ T ∨ (~ S ∨ T ) is a
tautology.
WUCT121 Logic 54
1.6.3. Laws
1. Commutative Laws:
• ( P ∨ Q ) ≡ (Q ∨ P )
• ( P ∧ Q ) ≡ (Q ∧ P )
• ( P ⇔ Q ) ≡ (Q ⇔ P )
2. Associative Laws:
• (( P ∨ Q ) ∨ R ) ≡ (P ∨ (Q ∨ R ))
• (( P ∧ Q ) ∧ R ) ≡ (P ∧ (Q ∧ R ))
• (( P ⇔ Q ) ⇔ R ) ≡ (P ⇔ (Q ⇔ R ))
3. Distributive Laws:
• (P ∨ (Q ∧ R) ) ≡ (( P ∨ Q) ∧ ( P ∨ R) )
• (P ∧ (Q ∨ R) ) ≡ (( P ∧ Q) ∨ ( P ∧ R) )
5. De Morgan’s Laws:
• ~ ( P ∨ Q ) ≡ (~ P ∧ ~ Q )
• ~ ( P ∧ Q ) ≡ (~ P ∨ ~ Q )
WUCT121 Logic 55
6. Implication Laws:
• ( P ⇒ Q ) ≡ (~ P ∨ Q ) ( Implication )
• ( P ⇔ Q ) ≡ (( P ⇒ Q ) ∧ (Q ⇒ P ) ) ( Biconditional)
7. Identity Laws:
• (P ∨ F ) ≡ P
• (P ∧ T ) ≡ P
9. Dominance Laws:
• (P ∨ T ) ≡ T
• (P ∧ F ) ≡ F
WUCT121 Logic 56
Example:
P Q ~( P ∨ Q) ~P ∧ ~Q
T T F T F F F
T F F T F F T
F T F T T F F
F F T F T T T
Step: 2* 1 1 2* 1
Since the main connectives are identical, the statements are
equivalent., and first of De Morgan’s Laws is true.
Exercise:
P Q ~( P ∧ Q) ~P ∨ ~Q
T T F T F F F
T F T F F T T
F T T F T T F
F F T F T T T
Step: 2* 1 1 2* 1
Since the main connectives are identical, the statements are
equivalent, and second of De Morgan’s Laws is true.
WUCT121 Logic 57
Example:
~ (~ p ∧ q ) ∧ ( p ∨ q ) ≡ (~ (~ p ) ∨ ~ q ) ∧ ( p ∨ q ) (De Morgan )
≡ ( p ∨ ~ q ) ∧ ( p ∨ q ) (Double Negation)
≡ p ∨ (~ q ∧ q ) (Distributivity)
≡ p ∨ (q ∧ ~ q ) (Commutativity)
≡ p∨F (Negation)
≡ p (Identity)
Exercises:
• ~ ( p ⇔ q ) ≡ ( p ∧ ~ q ) ∨ (q ∧ ~ p )
~ ( p ⇔ q ) ≡ ~ (( p ⇒ q ) ∧ (q ⇒ p )) (Biconditional )
≡ ~ ( p ⇒ q ) ∨ ~ (q ⇒ p ) (De Morgan )
≡ ~ (~ p ∨ q ) ∨ ~ (~ q ∨ p ) (Implication )
≡ (~ ~ p ∧ ~ q ) ∨ (~ ~ q ∧ ~ p ) (De Morgan )
≡ ( p ∧ ~ q ) ∨ (q ∧ ~ p ) (Double Negation)
WUCT121 Logic 58
• ( p ⇒ q ) ≡ (~ q ⇒~ p )
( p ⇒ q ) ≡ (~ p ∨ q ) (Implication )
≡ (q ∨ ~ p ) (Commutativity )
≡ (~ (~ q )∨ ~ p ) (Double Negation)
≡ (~ q ⇒ ~ p ) (Implication )
p ⇒ (q ∧ r ) ≡ ~ p ∨ (q ∧ r ) (Implication )
≡ (~ p ∨ q ) ∧ (~ p ∨ r ) (Distributive)
≡ ( p ⇒ q) ∧ ( p ⇒ r ) (Implication )
WUCT121 Logic 59
Section 2. Predicate Logic
Discussion:
Definition: Predicate
Definition: Domain
WUCT121 Logic 60
Definition: Truth Set
Examples:
8 = ±1 × ±8, 8 = ±2 × ±4
∴{n ∈ + :" n is a factor of 8"} = {1, 2, 4, 8}
WUCT121 Logic 61
Exercises:
{ x ∈ : x 3 > x} = { x ∈ : x > 1}
6 = ±1 × ±6, 6 = ±2 × ±3
∴ {n ∈ :" n is a factor of 6" } = {±1, ± 2, ± 3, ± 6}
WUCT121 Logic 62
2.1. Quantifiers
Examples:
WUCT121 Logic 63
• Consider A = { x1 , x2 , x3 } . With ∀x ∈ A, P( x ) , the
Exercises:
WUCT121 Logic 64
Exercises:
• ∀x ∈ , x ∈
The square root of any natural number is a natural number.
False. Consider x = 2 ∈ , x = 2 ∉ . Hence the
statement is false by counterexample.
• ∀x ∈ , x 2 ≠ −1.
The square of any real number does not equal –1. True.
WUCT121 Logic 65
2.1.2. Existential Quantifier
Examples:
WUCT121 Logic 66
Exercises:
WUCT121 Logic 67
Exercises:
• ∃m ∈ , m 2 = m
There is an integer whose square is equal to itself.
True. Consider m = 1 ∈ , m 2 = 12 = 1 = m .
Hence the statement is true.
• ∃x ∈ , x 2 = −1.
There is a real number whose square is –1.
False.
1
• ∃ x ∈ , ∉
x
The reciprocal of some integer is not rational.
1 1
True. Consider x = 0 ∈ , = ∉ .
x 0
Hence the statement is true.
WUCT121 Logic 68
2.1.3. Negation of Universal Statements
Symbolically ~ (∀x ∈ D , P( x )) ≡ ∃x ∈ D , ~ P( x )
Example:
∀x ∈ , x 2 + 1 ≥ 2 x
Negation:
~ (∀x ∈ , x 2 + 1 ≥ 2 x )
≡ ∃x ∈ , ~ ( x 2 + 1 ≥ 2 x )
≡ ∃x ∈ , x 2 + 1 < 2 x
False.
WUCT121 Logic 69
Exercises:
∀x ∈ , x 2 ≥ 0
Negation:
~ (∀x ∈ , x 2 ≥ 0)
≡ ∃x ∈ , ~ ( x 2 ≥ 0) False.
≡ ∃x ∈ , x 2 < 0
WUCT121 Logic 70
Example:
WUCT121 Logic 71
Exercises:
Statement: ∀x ∈ , x 2 > 0
Negation:
~ ( ∀x ∈ , x 2 > 0 )
≡ ∃ x ∈ , ~ ( x 2 > 0 )
≡ ∃ x ∈ , x 2 ≤ 0
There is an integer whose square is not positive. The
negation is true, choose x = 0.
WUCT121 Logic 72
2.1.4. Negation of Existential Quantifiers
Symbolically ~ (∃x ∈ D, P( x )) ≡ ∀x ∈ D , ~ P( x )
Example:
∃x ∈ , x 2 = 2
Negation:
~ (∃x ∈ , x 2 = 2)
≡ ∀x ∈ , ~ ( x 2 = 2)
≡ ∀x ∈ , x 2 ≠ 2
The negation is true.
WUCT121 Logic 73
Exercises:
WUCT121 Logic 74
Example:
Exercises:
WUCT121 Logic 75
• Write the following statement using quantifiers. Find
the negation.
P(p): Some computer hackers are over 40.
Let C be the set of computer hackers.
P( p ) : ∃p ∈ C , p is over 40
~ P( p ) :
~ (∃p ∈ C , p is over 40)
≡ ∀p ∈ C , ~ ( p is over 40)
≡ ∀p ∈ C , p is not over 40
≡ ∀p ∈ C , p is 40 or under
All computer hackers are 40 or under
False
WUCT121 Logic 76
2.1.5. Multiple Quantifiers
Examples:
WUCT121 Logic 77
Exercises:
WUCT121 Logic 78
Examples:
• ∀x ∈ ,, ∃y ∈ , x + y = 0
Statement: Given any real number, you can find a real
number so that the sum of the two is zero. Alternatively:
Every real number has an additive inverse.
• ∃x ∈ ,, ∀y ∈ , x + y = y
Statement: There is a real number, which added to any
other real number results in the other number.
Alternatively: Every real number has an additive identity.
Exercises:
WUCT121 Logic 79
2.1.6. Interpreting Statements with Multiple
Quantifiers
predicate P( x, y ) .
WUCT121 Logic 80
• For ∀x ∈ A, ∃y ∈ B, P( x, y ) to be true, the following
must hold:
P( x1 , y1 ) ∨ P( x1 , y 2 )
∧ P( x 2 , y1 ) ∨ P( x 2 , y 2 )
∧ P( x3 , y1 ) ∨ P( x3 , y 2 )
WUCT121 Logic 81
• For ∃x ∈ A, ∃y ∈ B, P( x, y ) to be true, the following
must hold:
P( x1 , y1 ) ∨ P( x1 , y 2 )
∨ P( x 2 , y1 ) ∨ P( x 2 , y 2 )
∨ P( x3 , y1 ) ∨ P( x3 , y 2 )
Summary:
WUCT121 Logic 82
2.1.7. Negation of Statements with Multiple
Quantifiers.
• To negate ∀x ∈ A, ∀y ∈ B, P( x, y )
~ (∀x ∈ A, ∀y ∈ B, P( x, y ) ) ≡ ∃x ∈ A, ∃y ∈ B, ~ P( x, y )
• To negate ∀x ∈ A, ∃y ∈ B, P( x, y )
~ (∀x ∈ A, ∃y ∈ B, P( x, y ) ) ≡ ∃x ∈ A, ∀y ∈ B, ~ P( x, y )
• To negate ∃x ∈ A, ∀y ∈ B, P( x, y )
~ (∃x ∈ A, ∀y ∈ B, P( x, y ) ) ≡ ∀x ∈ A, ∃y ∈ B, ~ P( x, y )
• To negate ∃x ∈ A, ∃y ∈ B, P( x, y )
~ (∃x ∈ A, ∃y ∈ B, P( x, y ) ) ≡ ∀x ∈ A, ∀y ∈ B, ~ P( x, y )
Examples:
• Statement: ∀x ∈ ,, ∃y ∈ , x + y = 0
Negation:
~ (∀x ∈ ,, ∃y ∈ , x + y = 0 )
≡ ∃x ∈ ,, ∀y ∈ , x + y ≠ 0
False: Take y = − x , then x + y = x − x = 0
WUCT121 Logic 83
• Statement: ∃x ∈ ,, ∀y ∈ , xy = 1
Negation:
~ (∃x ∈ ,, ∀y ∈ , xy = 1)
≡ ∀x ∈ ,, ∃y ∈ , xy ≠ 1
True : Take y = − x, then xy = − x 2 ≠ 1
Exercises:
WUCT121 Logic 84
Section 3. Proofs
3.1. Introduction.
3.1.1. Assumptions.
Example:
WUCT121 Logic 85
Assumptions are often thought to be the “given
information” or information we “know” that can be used in
our proof. As in the example above, when you are proving
statements of the form P ⇒ Q , then the assumption is the
statement P.
Exercise:
[( x ∈ ) ∧ ( n ∈ : ∃p ∈ , n = 2 p )] ⇒ x n > 0
3.1.2. Axioms.
Examples:
• x=x
• x+0 = x
• ∀x, y , z ∈ , [ ( x = y ) ∧ ( y = z )] ⇒ ( x = z )
WUCT121 Logic 86
3.1.3. Mathematical Rules.
∀x, y , z ∈ , ( x = y ) ⇒ ( x + z = y + z )
Exercise:
WUCT121 Logic 87
• Show, using the quick method that the Law of
Syllogism is a tautology.
((P ⇒ Q) ∧ (Q ⇒ R)) ⇒ (P ⇒ R)
Step: 1 3 2 5* 4
1. F
2. T F
3. T F
4. T T
5. T T F F
WUCT121 Logic 88
Examples:
• s is a square ⇒ s is a rectangle
s is a rectangle ⇒ s is a parallelogram
s is a parallelogram ⇒ s is a quadrilateral
∴ s is a square ⇒ s is a quadrilateral.
x 2 ≥ 0 ⇒ ( x − 3) 2 ≥ 0
( x − 3) 2 ≥ 0 ⇒ ( x 2 − 6 x + 9) ≥ 0
( x 2 − 6 x + 9) ≥ 0 ⇒ x 2 − 6 x ≥ −9
∴ x 2 ≥ 0 ⇒ x 2 − 6 x ≥ −9
Exercise:
•
x ∈ ⇒ x ∈
x ∈ ⇒ x ∈
x ∈ ⇒ x ∈
∴ x ∈ ⇒ x ∈
WUCT121 Logic 89
Most results in Mathematics that require proofs are of the
form P ⇒ Q . The Law of Syllogism provides the most
common method of performing proofs of such statements.
The Law of Syllogism is a kind of transitivity that can
apply to ⇒ .
Example.
WUCT121 Logic 90
Proof:
n is even ⇒ ∃p ∈ , n = 2 p K( P ⇒ P1 )
∃p ∈ , n = 2 p ⇒ n 2 = 4 p 2 K( P1 ⇒ P2 )
n 2 = 4 p 2 ⇒ n 2 = 2( 2 p 2 ) K( P2 ⇒ P3 )
n 2 = 2( 2 p 2 ) ⇒ n 2 is even K( P3 ⇒ Q )
WUCT121 Logic 91
3.3. Modus Ponens
Exercise:
( P ∧ ( P ⇒ Q )) ⇒ Q
WUCT121 Logic 92
• Show, using the quick method that the rule of Modus
Ponens is a tautology.
(P ∧ (P ⇒ Q)) ⇒ Q
Step 2 1 3*
WUCT121 Logic 93
Examples:
Exercise:
WUCT121 Logic 94
3.3.2. Universal Rule of Modus Ponens:
Examples:
WUCT121 Logic 95
Exercise:
• Claim(n): 4 n − 1 is a multiple of 3.
We must show that Claim(n) satisfies P.
So we need to establish two things:
WUCT121 Logic 96
3.4. Modus Tollens
Exercise:
WUCT121 Logic 97
• Show, using the quick method that the rule of Modus
Tollens is a tautology.
((P ⇒ Q) ∧ ~Q ⇒ ~P
Step: 2 3 1 4* 5
1.Place “F” under main F
connective
WUCT121 Logic 98
Examples:
Exercise:
WUCT121 Logic 99
3.4.2. Universal Rule of Modus Tollens:
Example:
a
• If x ∈ , then ∃a , b ∈ , b ≠ 0, x =
b
x= 2
Therefore 2 ∉ .
Exercise:
• If x ∈ , then x ≥ 1
x = −1
Therefore − 1 ∉ .
Examples:
Exercises:
• Prove ∃x ∈ , x + 5 = 0 .
Let x = −5 ∈ , then x + 5 = −5 + 5 = 0 .
P(1) = 12 − 1 + 11 P( 2) = 2 2 − 2 + 11
= 11 is prime = 13 is prime
P(3) = 32 − 3 + 11 P( 4) = 4 2 − 4 + 11
= 17 is prime = 23 is prime
P(5) = 5 2 − 5 + 11 P(6) = 6 2 − 6 + 11
= 31 is prime = 41 is prime
P(7) = 7 2 − 7 + 11 P(8) = 8 2 − 8 + 11
= 53 is prime = 67 is prime
P(9) = 9 2 − 9 + 11 P(10) = 10 2 − 10 + 11
= 89 is prime = 101 is prime
Thus by the method of exhaustion for each integer n with
1 ≤ n ≤ 10 , n 2 − n + 11 is prime.
Step Result
Pick a number x
Add 3 x+3
Multiply by 4 ( x + 3) × 4 = 4 x + 12
Subtract 6 4 x + 12 − 6 = 4 x + 6
Divide by 2 ( 4 x + 6) ÷ 2 = 2 x + 3
Example:
n 2 + 3n + 2 is prime.
Proving the given statement is false is equivalent to proving
its negation is true. That is proving that for all numbers n ,
Example:
• Disprove: ∀a , b ∈ , ( a 2 = b 2 ) ⇒ ( a = b ).
Let P( a , b ) : ( a 2 = b 2 ) ⇒ ( a = b ) .
We need to show ∃a , b ∈ , ~ P( a , b )
Counterexample:
z −1
• Disprove ∀z ∈ , ( z is odd ) ⇒ ( is odd ).
2
5 −1 4
Let z = 5 ∈ , ( z is odd ) , ( = = 2 is even).
2 2
Example:
∀n ∈ , n is odd ⇒ n 2 is odd
Example:
3 x − 9 = 15 ⇒ 3 x − 9 + 9 = 15 + 9
⇒ 3 x = 24
3 x 24
⇒ =
3 3
⇒ x=8
∀n ∈ , n is odd ⇒ n 2 is odd
Example:
• ( )
Prove that for x ∈ , − x 2 + 2 x + 1 ≤ 2 .
(Do not start with this!)
Exercise:
z
y
Y x Z
z2
• Area of the triangle: A = , (1)
4
z so by Pythagoras: z 2 = x 2 + y 2 . (3)
Proof:
⇒x= y
Example:
If n is both even and odd then equation (1) and (2) gives:
2k = 2l + 1
⇒ 2k − 2l = 1
⇒ 2( k − l ) = 1
1
⇒ k −l = ∉
2
Now since k and l are integers, the difference k – l must be
1
an integer. However k − l = ∉ . Thus k – l is an integer
2
and k – l is not an integer, which is a contradiction.
Thus the supposition is false and hence the statement
“There is no integer that is both even and odd” is true.
∀n ∈ , n 2 is even ⇒ n is even.
∀n ∈ , n is odd ⇒ n 2 is odd.
To prove the contrapositive:
Let n be any odd integer.
Then n = 2k + 1, k ∈ K(1)
n 2 = ( 2k + 1)2 by (1)
= 4k 2 + 4k + 1
= 2( 2k 2 + 2k ) + 1
= 2l + 1 l = 2k 2 + 2k ∈
So n 2 is odd, and the contrapositive is true.
∀n ∈ , 5 /| n 2 ⇒ 5 /| n.
n 2 = (5k ) 2 by (1)
= 25k 2
= 5(5k 2 )
= 5l l = 5k 2 ∈
So 5 | n 2 , and the contrapositive is true.
1. Prove P ⇒ R
2. Prove Q ⇒ R.
3. Conclude ( P ∨ Q ) ⇒ R.
( x ≠ 0) ∨ ( y ≠ 0) ⇒ x 2 + y 2 > 0
We assume x, y ∈ , thus x 2 ≥ 0, y 2 ≥ 0.
Proof:
Thus x 2 + y 2 > 0 .
Thus x 2 + y 2 > 0 .
• Prove: If x ≤ −2 or x ≥ 2 , then x 2 − 4 ≥ 0 .
( x ≤ −2) ∨ ( x ≥ 2) ⇒ x 2 − 4 ≥ 0
Proof:
Case 1: Prove x ≤ −2 ⇒ x 2 − 4 ≥ 0
x ≤ −2
⇒ x2 ≥ 4
⇒ x2 − 4 ≥ 0
Therefore x ≤ −2 ⇒ x 2 − 4 ≥ 0
Case 2: Prove ( x ≥ 2 ⇒ x 2 − 4 ≥ 0
x≥2
⇒ x2 ≥ 4
⇒ x2 − 4 ≥ 0
Therefore x ≥ 2 ⇒ x 2 − 4 ≥ 0
Thus if x ≤ −2 or x ≥ 2 , then x 2 − 4 ≥ 0 .
Example.
• Prove: ∀m ∈ , m 2 + m + 1 is odd.
m 2 + m + 1 = (2 p )2 + 2 p + 1 by (1)
= 4 p2 + 2 p +1
(
= 2 2 p2 + p +1)
( )
= 2k + 1, where k = 2 p 2 + p ∈
m 2 + m + 1 = (2q + 1)2 + 2q + 1 + 1 by ( 2)
= 4q 2 + 4q + 1 + 2q + 1 + 1
= 4q 2 + 6q + 2 + 1
( )
= 2 2q 2 + 3q + 1 + 1
( )
= 2l + 1, where l = 2q 2 + 3q + 1 ∈
Therefore, ∀m ∈ , m 2 + m + 1 is odd.
• Prove: ∀n ∈ , n 2 − n + 3 is odd.
n 2 − n + 3 = (2 p )2 − 2 p + 3 by (1)
= 4 p2 − 2 p + 2 +1
(
= 2 2 p2 − p +1 +1 )
( )
= 2k + 1, where k = 2 p 2 − p + 1 ∈
Therefore, ∀n ∈ , n 2 − n + 3 is odd.
4.1. Definitions
Examples:
Exercises:
Examples:
Exercises:
C = {z ∈ : ( z is even ∧ 10 ≤ z ≤ 20)}
D = {n ∈ : 3 | n}
Example:
Notes:
Examples:
• { x ∈ : x 3 = x} = {0, 1, − 1} .
Exercises:
• { x ∈ : x 3 = x} = {1}
• { x ∈ : x 2 = 9} = {−3, 3}
• { x ∈ : x 2 = 7} = { }
Example:
• If a ∈U , then { x ∈U : x = a} = {a}
Note: The singleton set {a} is NOT the same as the element
a.
Examples:
• {1, 2} ⊆ {1, 2, 3}
Exercises:
A ⊆ B ⇔ (∀x ∈ U , x ∈ A ⇒ x ∈ B )
Examples:
• {1, 2} ⊂ {1, 2, 3}
Exercises:
• Is {a , b, c} ⊂ {c, b, a}? No
Proof:
Suppose ~ ( ∆ ⊆ A) . Then, there exists x ∈ ∆ such that
x ∉ A . This, therefore, means that ∆ is not empty, which is
a contradiction. Therefore, ∆ ⊆ A .
Examples:
• 2 ∈ {1, 2, 3} , 2⊄{1, 2, 3}
• 1 ∈ { x ∈ : x 2 = 1}, {1} ⊆ { x ∈ : x 2 = 1}
Exercises:
• S ∈S • S ⊆ {S }
False False
• S ∈ {S } • ∆ ⊆ {S }
True True
Note: To prove that two sets are equal two things must be
shown:: A ⊆ B and B ⊆ A .
Examples:
Examples:
• {1, 2} = {1, 2}
• {a , b, c} = {c, b, a}
Exercises:
• Is {a , b, c, d } = {b, d , a , c} Yes
If ∀x ∈U , ( P( x ) ⇔ Q( x )) , that is ∀x ∈U , ( P( x ) ≡ Q ( x ))
then { x ∈ U : P( x )} = { x ∈ U : Q ( x )}
Example:
{ x ∈ : x 2 = 1} = {( x = 1 ∨ x = −1)} = {1,−1}
• A = {x ∈ : x = 1 ∨ x = 2 ∨ x = 3} = {1, 2, 3}
{1, 3,1, 2} = { x ∈ : x = 1 ∨ x = 3 ∨ x = 1 ∨ x = 2}
= { x ∈ : x = 1 ∨ x = 1 ∨ x = 3 ∨ x = 2}
= { x ∈ : x = 1 ∨ x = 3 ∨ x = 2}
= { x ∈ : x = 1 ∨ x = 2 ∨ x = 3}
= {1, 2, 3}
Examples:
• Let X = {1, 2, 3} .
o Is ∆ ∈ ( X ) ? Yes
o Is ∆ ⊆ ( X ) ? Yes
o Is 1 ∈ ( X ) ? No
o Is {1} ∈ ( X ) ? Yes
o Is {2} ⊆ ( X ) ? No
Example:
{1} {2}
ø
WUCT121 Logic 147
4.8. Set Operations
A Complement ~ P Negation
Notes.
Example:
Exercises:
• A = {1, 2, 3}
A = {x ∈ : x ≠ 1 ∧ x ≠ 2 ∧ x ≠ 3}
• A = {x ∈ : x is even}
A = {x ∈ : x is odd}
• A = {x ∈ : x > 0 ∨ x < 0}
A = {0}
Example:
Exercises:
Example:
o A = {x ∈ : 0 ≤ x ≤ 2} and B = {x ∈ : 1 ≤ x ≤ 3}
A ∩ B = { x ∈ : 1 ≤ x ≤ 2} = [1, 2]
Notes.
o A = {x ∈ : 0 ≤ x ≤ 2} and B = {x ∈ : 1 ≤ x ≤ 3}
A − B = { x ∈ : 0 ≤ x < 1} = [0, 1)
o A − C = {1} o D − A = {x ∈ : 0 ≤ x < 1}
o B−C =
o A − D = {2, 3}
o D−B=D
Example:
Exercises:
• A∩ B
{{ • A∩( B ∪
{{ {C )
12 13 2
• • A⊆{ B∩
( A∩
{ B) { {C
12 13 13 2
2
• A⊆
({ { B )∩
{C • A⊆
{ { B∪
{C
12 3 13 2
• ( A∪
{ B) • A{
{ = B∩
{C
12 13 1 3 2
2
Notes.
Example:
• ( A ⊆ B ∧ B ⊆ C ) ≡/ ( A ⊆ ( B ∧ B ) ⊆ C )
1. Commutative Laws:
• ( A ∪ B ) = ( B ∪ A)
• ( A ∩ B ) = ( B ∩ A)
• ( A = B ) = ( B = A)
2. Associative Laws:
• (( A ∪ B ) ∪ C ) = ( A ∪ ( B ∪ C ))
• (( A ∩ B ) ∩ C ) = ( A ∩ ( B ∩ C ))
• (( A = B ) = C ) = ( A = ( B = C ))
3. Distributive Laws:
• ( A ∪ ( B ∩ C )) = (( A ∪ B ) ∩ ( A ∪ C ))
• ( A ∩ ( B ∪ C )) = (( A ∩ B ) ∪ ( A ∩ C ))
• ( A) = A
5. De Morgan’s Laws:
• ( A ∪ B) = ( A ∩ B)
• ( A ∩ B) = ( A ∪ B)
8. Dominance Laws:
• (A ∪U ) =U
• ( A ∩ ) =
9. Idempotent Laws:
• ( A ∪ A) = A
• ( A ∩ A) = A
Example:
Now A ∪ B = {1, 2, 3, 4}
1 ∈ A, 1 ∈ A ∪ B
2 ∈ A, 2 ∈ A ∪ B
Now A ∩ B = {1, 2}
1 ∈ A and 1 ∈ A ∩ B
2 ∈ A and 2 ∈ A ∩ B
Exercise:
1 ∈ C and 1 ∈ A ∩ B
Example:
• Disprove A ⊆ A ∩ B .
Exercise:
• Disprove A ⊆ A − B .
Exercise:
Examples:
• Let A = { x ∈ : x 2 ≤ 1} and B = { x ∈ : −1 ≤ x ≤ 1} .
Prove A = B
x 2 ≤ 1 ⇔ −1 ≤ x ≤ 1
∴ P( x ) ⇔ Q( x )
∴A= B
Exercise:
Examples:
Examples:
Notes:
2 (1, 2)
1
(2, 1)
x
-4 -3 -2 -1 0 1 2 3 4
(-2, -1) -1
-2
(-1, -2)
-3
Example:
• × = {( x, y ) : x ∈ : ∧ y ∈ }.
x
-6 -4 -2 0 2 4 6
-2
-4
a graph of A × B in 2 .
(3, 3)
2
(3, 2)
x
-6 -4 -2 0 2 4 6
-2
-4
-6
C × D = {( x, y ) : −1 ≤ x ≤ 1 ∧ y ∈ (1, 2)}
y
4
x
-4 -3 -2 -1 0 1 2 3 4
-2
-4
Notes:
Examples:
x
-2 -1 0 1 2
Exercise:
x
-2 -1 0 1 2
x
-4 -3 -2 -1 0 1 2 3 4
-2
-4
o 1R1 True
o 1R2.2 False
o ( −3, 3) ∈ R False
x
0 1 2 3 4
by S = {( x, y ) : y = x 2 }.
x
-4 -3 -2 -1 0 1 2 3 4
x
-3 -2 -1 0 1 2 3
-1
S is a continuous curve.
o R 1 ∩ R 2 = {(1,−1)}.
o
R3 ∪ R4 = {( x, y ) : x = y ∨ x = − y}
= {( x, y ) : x = ± y}
= {( x, y ) : x = y }
o R3 ∩ R4 = {(0, 0 )}
Notes:
Notes:
o Dom R1 = {0, 3}
o Range R1 = {0, 1, 2}
Exercises:
o Dom R2 = − {0}
o Range R2 = − {0}.
{
R3 = ( x, y ) : x ≠ 0 ∧ y = 1 .
x
}
Determine:
o Dom R3 = − {0}
o {
Range R3 = 1 : n ∈ ∧ n ≠ 0
n
}
R −1 = {( y , x ) : ( x, y ) ∈ R}.
Notes:
Range R −1 = Dom R ⊆ A .
Examples:
circle elements of R −1 .
y
6
1
x
-1 0 1 2 3 4 5 6 7
-1
R −1 = {( y , x ) : y = 2 x}
= {( x, y ) : x = 2 y}
{
= ( x, y ) : y = 12 x }
Exercise:
is S −1?
S = {( x, x ) : x ∈ }
S −1 = {( x, x ) : x ∈ }
=S
Example:
0 1
2
3
0
2
Reflexivity:
R is reflexive on A if and only if ∀x ∈ A, ( x, x ) ∈ R .
Example:
Example:
Example:
Notes:
• R1 on , given by R1 = {( x, y ) : x | y}.
∀x ∈ , x | x. ∴ ( x, x ) ∈ R1 Thus R1 is reflexive.
Consider ( 2, 4) ∈ R1 , since 2 | 4 , however ( 4, 2) ∉ R1 , as
4 F 2, so R1 is not symmetric.
∀x, y , z ∈ , x | y ∧ y | z ⇒ x | z.
∴ ( x, y ) ∈ R1 ∧ ∴ ( y , z ) ∈ R1 ⇒∴ ( x, z ) ∈ R1, thus R1 is
transitive.
• R3 on given by R3 = {( x, y ) : x < y}
Reflexive: No
Symmetric: No
Transitive: Yes
Example:
Notes:
Recall: a ≡ b(mod n ) ⇔ ∃k ∈ , a − b = nk .
Proof:
Reflexive:
∀a ∈ , a − a = 0 = n × 0 , which implies that
a ≡ a(mod n ) , ∴ (a , a ) ∈ R2 Thus R2 is reflexive.
Symmetric:
∀a , b ∈ , if a ≡ b(mod n ), then a − b = nk
∴ b − a = − nk = n(− k ), giving b ≡ a (mod n ). Thus
(a , b ) ∈ R2 ⇒ (b, a ) ∈ R2 . So R2 is symmetric.
Transitive:
∀a, b, c ∈ , if a ≡ b(mod n ) and b ≡ c(mod n ), then
( a − b = nk ) ∧ (b − c = nl ) , ∴ a − c = n( k + l ) = np ,
so a ≡ c (mod n ) . That is
(( a , b ) ∈ R2 ∧ (b, c ) ∈ R2 ) ⇒ ( a , c ) ∈ R2 . Thus R2 is
transitive.
Since R2 is reflexive, symmetric and transitive, R2 is an
equivalence relation.
o Is R3 symmetric or transitive?
ab ≠ 0 ⇒ ba ≠ 0 ∴ symmetric
ab ≠ 0 ∧ bc ≠ 0 ⇒ ac ≠ 0 ∴ transitive
Reflexive:
For a = 0 : (0, 0 ) ∈ R . For a = 1 : (1, 1) ∈ R .
For a = 2 : (2, 2 ) ∈ R .
So, ∀a ∈ A, (a , a ) ∈ R . Thus R is reflexive.
Symmetric:
For (0, 0 ), (1, 1) and (2, 2 ) symmetry obviously holds.
(0, 1) ∈ R ⇒ (1, 0 ) ∈ R , (1, 0 ) ∈ R ⇒ (1, 0 ) ∈ R ,
So, ∀(a , b ) ∈ R ⇒ (b, a ) ∈ R , thus R is symmetric.
Transitive:
(0, 0 ), (0, 1) ∈ R ⇒ (0, 1) ∈ R , (1, 1), (1, 0 ) ∈ R ⇒ (1, 0 ) ∈ R ,
(0, 1), (1, 1) ∈ R ⇒ (0, 1) ∈ R , (0, 1), (1, 0 ) ∈ R ⇒ (0, 0 ) ∈ R
(1, 0 ), (0, 1) ∈ R ⇒ (1, 1) ∈ R , (1, 0 ), (0, 0 ) ∈ R ⇒ (1, 0 ) ∈ R ,
So ∀(a , b ) ∧ (b, c ) ∈ R ⇒ (a , c ) ∈ R , thus R is transitive.
Therefore, since R is reflexive, symmetric and transitive, R
is an equivalence relation.
0 1
Solution:
2 3
7 9
Definition:
Let R be an equivalence relation on the set A. Then for each
a ∈ A , we define the equivalence class of a as
class( a ) = {b ∈ A : (a , b ) ∈ R}.
Example:
o class(1) = {1}
o class(π ) = {π }
( ) {}
o class 12 = 12
5.3.1. Definition
Note:
A relation from A to B becomes a function if the domain is
all of A and if every first element is related to only one
second element. This last property is sometimes known as
the vertical line test.
Examples:
• Is R1 on , R1 = {( x, y ) : y = x 2 } a function?
y
x
-3 -2 -1 0 1 2 3
-1
x
-1 0 1 2 3
-1
-2
-3
Exercises:
• Is R3 on A = {x ∈ : x ≥ 0}, R3 = {( x, y ) : x = y 2 }
a function?
y
x
-1 0 1 2 3
-1
x
-1 0 1 2 3
-1
Notes:
o F2 on , F2 = {( x, y ) : y = 1}.
y
x
-3 -2 -1 0 1 2 3
-1
1
x
-3 -2 -1 0 1 2 3
-1
-2
Notes:
F1 = {( x, y ) : y = x 2 } . Is F1 a one-to-one function?
y
x
-3 -2 -1 0 1 2 3
-1
given by F2 = {( x, y ) : y = x 2 }. Is F2 a one-to-one
function?
y
x
-3 -2 -1 0 1 2 3
-1
x
0 1 2 3
-1
-2
x
0 1 2 3
-1
-2
1
x
-3 -2 -1 0 1 2 3
-1
-2
-3
-4
• F4 from − {0} to , F4 = ( x, y ) : y = { }
x2 −1 .
y
x
-3 -2 -1 0 1 2 3
-1
Notes:
F1 = {( x, y ) : y = 1 − x 2 }. Is F1 an onto function?
y
x
-2 -1 0 1 2
F2 = {( x, y ) : y = 1 − x 2 }.
Now Range F2 = { y ∈ : 0 ≤ y ≤ 1} = B , thus the function
F2 is an onto function
• F1 from A = {1, 2, 3, 4, 5} to B = {a , b, c, d } ,
F1 = {(1, a ), ( 2, c ), (3, c ), ( 4, d ), (5, d )}
Range F1 = {a , c, d } ≠ B . Therefore F1 is not an onto
function.
• F2 from A = {1, 2, 3, 4, 5} to B = {a , b, c, d } ,
F2 = {(1, a ), ( 2, b ), (3, c ), ( 4, d ), (5, a )}.
Range F2 = {a , b, c, d } = B . Therefore F2 is an onto
function.
• F3 on , F3 = {( x, y ) : y = 4 x − 1}.
y +1
For each y ∈ , let x = ∈ , then
4
∀y ∈ , ∃x ∈ , ( x, y ) ∈ F3 . Thus Range F3 = . Therefore
F3 is an onto function.
• F4 on , F4 = {( x, y ) : y = 4 x − 1} .
Consider y = 0 ∈ , then for ( x, 0) ∈ F4 requires
0 +1
x= ∉ . Thus Range F4 ≠ . Therefore F4 is not an
4
onto function
Example:
F = {( x, y ) : y = 1 − x 2 } .
x
-2 -1 0 1 2
−1 −1
• Sketch F . Is F a function?
F −1 = {( x, y ) : x = 1 − y 2 } .
y
x
-2 -1 0 1 2
F = {( x, y ) : y = x 2 } .
x
0 1 2
• Sketch F −1 . Is F −1 a function?
y
x
0 1 2
5.4.1. Definition
Example:
Let A = {0,1, 2, 3}. Define F = {(0,1), (1, 2), ( 2, 3), (3, 0)}.
⎛ 0 1 2 3⎞
F =⎜ ⎟
⎝ 1 2 3 0 ⎠
⎛ 0 1 2 3⎞ ⎛0 1 2 3⎞ ⎛ 0 1 2 3⎞
I =⎜ ⎟ ,G = ⎜ ⎟, H = ⎜ ⎟
⎝ 0 1 2 3 ⎠ ⎝ 1 0 3 2 ⎠ ⎝ 1 3 2 0 ⎠
Notes:
Exercises:
⎛0 1 2 3⎞
Let A = {0,1, 2, 3}and let G = ⎜ ⎟ and
⎝ 1 0 3 2 ⎠
⎛ 0 1 2 3⎞
H =⎜ ⎟ be permutation on A.
⎝1 3 2 0⎠
Write down the following.
• G (1) = 0 • H (1) = 3
• G (3) = 2 • G ( H (0)) = 0
• H (0 ) = 1 • G ( H (1)) = 2
Example:
⎛ 1 2 3 4 5⎞
by F = ⎜ ⎟
⎝ 2 3 4 5 1 ⎠
we note that:
1 “goes to” 2
2 “goes to” 3
3 “goes to” 4
4 “goes to” 5
5 “goes to” 1.
This can be written as a cycle: (1 2 3 4 5) .
(1 2 3 4 5)
Examples:
• Let A = {0,1, 2, 3}
⎛ 0 1 2 3⎞
F =⎜ ⎟ = (0 2 )
⎝ 2 1 0 3 ⎠
• A = {1, 2, 3, 4, 5}
⎛1 2 3 4 5⎞
G=⎜ ⎟ = (1 2 )(4 5)
⎝ 2 1 3 5 4 ⎠
• A = {1, 2, 3}
⎛1 2 3 ⎞
I =⎜ ⎟ = (1) or (2 ) or (3) or (1)(2 )(3)
⎝1 2 3 ⎠
⎛ 0 1 2 3⎞
• F =⎜ ⎟ = (1 3)
⎝ 0 3 2 1 ⎠
⎛0 1 2 3⎞
• G =⎜ ⎟ = (0 1 3 2 )
⎝ 1 3 0 2 ⎠
⎛0 1 2 3⎞
• H =⎜ ⎟ = (0 1)(2 3)
⎝ 1 0 3 2 ⎠
Examples:
• G ( F (1)) = G (2) = 3
• G ( F (2)) = G (3) = 4
• G ( F (3)) = G (4) = 3
• G ( F (4)) = G (1) = 2
G o F = FG = (1 2 3 4)(1 2)(3 4)
⎛ 0 1 2 3⎞
• (1 2)(1 0 2) = ⎜ ⎟ = (0 2 )
⎝ 2 1 0 3 ⎠
⎛ 0 1 2 3⎞
• (0 1)(2 3)(0 1 2 3) = ⎜ ⎟ = (0 2 )
⎝ 2 1 0 3 ⎠
⎛ 0 1 2 3⎞
• (1 2 3)(3 2) = ⎜ ⎟ = (1 3)
⎝ 0 3 2 1⎠
In F:
F −1 = (1 2 4 3) −1
= (1 3 4 2)
= (3 4 2 1)
Exercises:
• (1 2 3)−1 = (3 2 1)
• (0 3 1)−1 = (1 3 0 )