DMGT Module1 Lecture5
DMGT Module1 Lecture5
Module - II
S. Devi Yamini
1 Motivation
1 Motivation
2 Predicates
Quantifiers
Free and bound variables
Rules of inference
Predicate logic
Predicate Logic is a logical extension of propositional logic. Also known as
First order logic.
Example
Consider the statement x is greater than 3
Subject is x
Predicate is is greater than 3
Example
Let P(x) denote x 2 is greater than x
where
P is the predicate is greater than and
x is the variable.
Example
Let P(x) denote x 2 is greater than x
where
P is the predicate is greater than and
x is the variable.
Assigning a value to x, P(x) becomes a proposition and has truth value.
Example
Let P(x) denote x 2 is greater than x
where
P is the predicate is greater than and
x is the variable.
Assigning a value to x, P(x) becomes a proposition and has truth value.
P(5) is the statement 25 is greater than 5. Hence P(5) is true.
The statements like Some students are listening, The square of any real
number is non-negative,All men are mortal - need quantifiers
The statements like Some students are listening, The square of any real
number is non-negative,All men are mortal - need quantifiers
Quantifiers
It specifies the amount or quantity from the domain.
The statements like Some students are listening, The square of any real
number is non-negative,All men are mortal - need quantifiers
Quantifiers
It specifies the amount or quantity from the domain.
Two quantifiers:
Universal quantification - for all or given any
The symbol is : ∀
The statements like Some students are listening, The square of any real
number is non-negative,All men are mortal - need quantifiers
Quantifiers
It specifies the amount or quantity from the domain.
Two quantifiers:
Universal quantification - for all or given any
The symbol is : ∀
Example: P(x) is true for every x in the domain D is equivalent to
writing ∀x ∈ D, P(x)
The statements like Some students are listening, The square of any real
number is non-negative,All men are mortal - need quantifiers
Quantifiers
It specifies the amount or quantity from the domain.
Two quantifiers:
Universal quantification - for all or given any
The symbol is : ∀
Example: P(x) is true for every x in the domain D is equivalent to
writing ∀x ∈ D, P(x)
Try this! The square of any real number is non negative
Quantifiers
Existential quantification - there exists or for some or there is at least
one
The symbol is : ∃
Quantifiers
Existential quantification - there exists or for some or there is at least
one
The symbol is : ∃
Example: P(x) is true for at least one x in D is equivalent to writing
∃x ∈ D, P(x)
Quantifiers
Existential quantification - there exists or for some or there is at least
one
The symbol is : ∃
Example: P(x) is true for at least one x in D is equivalent to writing
∃x ∈ D, P(x)
Try this! Some birds are angry
Quantifiers
Existential quantification - there exists or for some or there is at least
one
The symbol is : ∃
Example: P(x) is true for at least one x in D is equivalent to writing
∃x ∈ D, P(x)
Try this! Some birds are angry
Try!
1. All rabbits are faster than all tortoises
Quantifiers
Existential quantification - there exists or for some or there is at least
one
The symbol is : ∃
Example: P(x) is true for at least one x in D is equivalent to writing
∃x ∈ D, P(x)
Try this! Some birds are angry
Try!
1. All rabbits are faster than all tortoises
Domains: R = { Rabbits }, T = { Tortoises }
Predicate: P(x, y ) : x is faster than y where x ∈ R, y ∈ T
Quantifiers
Existential quantification - there exists or for some or there is at least
one
The symbol is : ∃
Example: P(x) is true for at least one x in D is equivalent to writing
∃x ∈ D, P(x)
Try this! Some birds are angry
Try!
1. All rabbits are faster than all tortoises
Domains: R = { Rabbits }, T = { Tortoises }
Predicate: P(x, y ) : x is faster than y where x ∈ R, y ∈ T
In symbolic notation: ∀x ∈ R, ∀y ∈ T , P(x, y )
Quantifiers
Existential quantification - there exists or for some or there is at least
one
The symbol is : ∃
Example: P(x) is true for at least one x in D is equivalent to writing
∃x ∈ D, P(x)
Try this! Some birds are angry
Try!
1. All rabbits are faster than all tortoises
Domains: R = { Rabbits }, T = { Tortoises }
Predicate: P(x, y ) : x is faster than y where x ∈ R, y ∈ T
In symbolic notation: ∀x ∈ R, ∀y ∈ T , P(x, y )
2. Every rabbit is faster than some tortoise
3. There is a rabbit which is faster than all tortoises.
Module - II July 30, 2020 8 / 35
Quantifiers
Consider P(x) : x + 2 = 2x
UOD : {1, 2, 3}
Then
∀xP(x) is the proposition
Consider P(x) : x + 2 = 2x
UOD : {1, 2, 3}
Then
∀xP(x) is the proposition “For every x such that x + 2 = 2x”
Truth value?
Consider P(x) : x + 2 = 2x
UOD : {1, 2, 3}
Then
∀xP(x) is the proposition “For every x such that x + 2 = 2x”
Truth value? False
Consider P(x) : x + 2 = 2x
UOD : {1, 2, 3}
Then
∀xP(x) is the proposition “For every x such that x + 2 = 2x”
Truth value? False
∃xP(x) is the proposition
Consider P(x) : x + 2 = 2x
UOD : {1, 2, 3}
Then
∀xP(x) is the proposition “For every x such that x + 2 = 2x”
Truth value? False
∃xP(x) is the proposition “There exists x such that x + 2 = 2x ”
Truth value?
Consider P(x) : x + 2 = 2x
UOD : {1, 2, 3}
Then
∀xP(x) is the proposition “For every x such that x + 2 = 2x”
Truth value? False
∃xP(x) is the proposition “There exists x such that x + 2 = 2x ”
Truth value? True
Solution
FALSE
Let P(x) : x is even, Q(x) : x + 1 is even.
Solution
FALSE
Let P(x) : x is even, Q(x) : x + 1 is even.
P(2) → Q(2) is false
Hence ∀x(P(x) → Q(x)) is false.
Solution
FALSE
Let P(x) : x is even, Q(x) : x + 1 is even.
P(2) → Q(2) is false
Hence ∀x(P(x) → Q(x)) is false.
On the other hand, ∀xP(x) is false (since all integers are not even)
Solution
FALSE
Let P(x) : x is even, Q(x) : x + 1 is even.
P(2) → Q(2) is false
Hence ∀x(P(x) → Q(x)) is false.
On the other hand, ∀xP(x) is false (since all integers are not even)
Hence ∀xP(x) → ∀xQ(x) is true
Consider P(x, y ) : xy = 1
UOD for x is the set of positive integers
UOD for y is the set of real numbers
Then
∀x∀yP(x, y ) :
Consider P(x, y ) : xy = 1
UOD for x is the set of positive integers
UOD for y is the set of real numbers
Then
∀x∀yP(x, y ) : For every positive integer x and for every real number
y , xy = 1.
Consider P(x, y ) : xy = 1
UOD for x is the set of positive integers
UOD for y is the set of real numbers
Then
∀x∀yP(x, y ) : For every positive integer x and for every real number
y , xy = 1.
What is the truth value of this?
Consider P(x, y ) : xy = 1
UOD for x is the set of positive integers
UOD for y is the set of real numbers
Then
∀x∀yP(x, y ) : For every positive integer x and for every real number
y , xy = 1.
What is the truth value of this? false
Consider P(x, y ) : xy = 1
UOD for x is the set of positive integers
UOD for y is the set of real numbers
Then
∀x∀yP(x, y ) : For every positive integer x and for every real number
y , xy = 1.
What is the truth value of this? false
∀x∃yP(x, y ):
Consider P(x, y ) : xy = 1
UOD for x is the set of positive integers
UOD for y is the set of real numbers
Then
∀x∀yP(x, y ) : For every positive integer x and for every real number
y , xy = 1.
What is the truth value of this? false
∀x∃yP(x, y ): For every positive integer x, there is a real number y
such that xy = 1.
Consider P(x, y ) : xy = 1
UOD for x is the set of positive integers
UOD for y is the set of real numbers
Then
∀x∀yP(x, y ) : For every positive integer x and for every real number
y , xy = 1.
What is the truth value of this? false
∀x∃yP(x, y ): For every positive integer x, there is a real number y
such that xy = 1.
What is the truth value of this?
Consider P(x, y ) : xy = 1
UOD for x is the set of positive integers
UOD for y is the set of real numbers
Then
∀x∀yP(x, y ) : For every positive integer x and for every real number
y , xy = 1.
What is the truth value of this? false
∀x∃yP(x, y ): For every positive integer x, there is a real number y
such that xy = 1.
What is the truth value of this? true
Consider P(x, y ) : xy = 1
UOD for x is the set of positive integers
UOD for y is the set of real numbers
Then
∀x∀yP(x, y ) : For every positive integer x and for every real number
y , xy = 1.
What is the truth value of this? false
∀x∃yP(x, y ): For every positive integer x, there is a real number y
such that xy = 1.
What is the truth value of this? true
∃y ∀xP(x, y ):
Consider P(x, y ) : xy = 1
UOD for x is the set of positive integers
UOD for y is the set of real numbers
Then
∀x∀yP(x, y ) : For every positive integer x and for every real number
y , xy = 1.
What is the truth value of this? false
∀x∃yP(x, y ): For every positive integer x, there is a real number y
such that xy = 1.
What is the truth value of this? true
∃y ∀xP(x, y ): There exists a real number y such that, for every
positive integer x, xy = 1.
Consider P(x, y ) : xy = 1
UOD for x is the set of positive integers
UOD for y is the set of real numbers
Then
∀x∀yP(x, y ) : For every positive integer x and for every real number
y , xy = 1.
What is the truth value of this? false
∀x∃yP(x, y ): For every positive integer x, there is a real number y
such that xy = 1.
What is the truth value of this? true
∃y ∀xP(x, y ): There exists a real number y such that, for every
positive integer x, xy = 1.
What is the truth value of this?
Consider P(x, y ) : xy = 1
UOD for x is the set of positive integers
UOD for y is the set of real numbers
Then
∀x∀yP(x, y ) : For every positive integer x and for every real number
y , xy = 1.
What is the truth value of this? false
∀x∃yP(x, y ): For every positive integer x, there is a real number y
such that xy = 1.
What is the truth value of this? true
∃y ∀xP(x, y ): There exists a real number y such that, for every
positive integer x, xy = 1.
What is the truth value of this? false
∀x∃yR(x, y )
∀x∃yR(x, y )
Everyone has someone to rely on
∀x∃yR(x, y )
Everyone has someone to rely on
∃y ∀xR(x, y )
∀x∃yR(x, y )
Everyone has someone to rely on
∃y ∀xR(x, y )
There exists a person whom everyone relies upon
∀x∃yR(x, y )
Everyone has someone to rely on
∃y ∀xR(x, y )
There exists a person whom everyone relies upon
∃x∀yR(x, y )
∀x∃yR(x, y )
Everyone has someone to rely on
∃y ∀xR(x, y )
There exists a person whom everyone relies upon
∃x∀yR(x, y )
There exists a person who relies upon everyone
∀x∃yR(x, y )
Everyone has someone to rely on
∃y ∀xR(x, y )
There exists a person whom everyone relies upon
∃x∀yR(x, y )
There exists a person who relies upon everyone
∀y ∃xR(x, y )
∀x∃yR(x, y )
Everyone has someone to rely on
∃y ∀xR(x, y )
There exists a person whom everyone relies upon
∃x∀yR(x, y )
There exists a person who relies upon everyone
∀y ∃xR(x, y )
Everyone has someone who relies upon them
1 ∀x∀yP(x, y ) ≡ ∀y ∀xP(x, y )
1 ∀x∀yP(x, y ) ≡ ∀y ∀xP(x, y )
2 ∃x∃yP(x, y ) ≡ ∃y ∃xP(x, y )
1 ∀x∀yP(x, y ) ≡ ∀y ∀xP(x, y )
2 ∃x∃yP(x, y ) ≡ ∃y ∃xP(x, y )
3 ∀x∃yP(x, y ) 6= ∃y ∀xP(x, y )
Example
∀x P(x, y ) - x is bound whereas y is a free variable
Example
∀x P(x, y ) - x is bound whereas y is a free variable
∀x(P(x) → (∃y )R(x, y )) - x, y are bound variables
Example
∀x P(x, y ) - x is bound whereas y is a free variable
∀x(P(x) → (∃y )R(x, y )) - x, y are bound variables
∃x(P(x) ∧ Q(x)) - x is a bound variable
Example
∀x P(x, y ) - x is bound whereas y is a free variable
∀x(P(x) → (∃y )R(x, y )) - x, y are bound variables
∃x(P(x) ∧ Q(x)) - x is a bound variable
(∃x)P(x) ∧ Q(x) - The x occuring in P(x) is bound. But the x
occuring in Q(x) is free.
Name Rule
Universal Specification or ∀xP(x)
Instantiation
∴ P(c)
Universal Generalization P(c) for arbitrary member c of the universe
∴ ∀xP(x)
Existential Generalization P(c) for some member c of the universe
∴ ∃xP(x)
Existential Specification or ∃xP(x)
Instantiation
∴ P(c)
Table 1: Rules of Inference
Example
Everyone who takes some fruit daily is healthy. Ramya is not healthy.
Therefore, Ramya does not take fruit daily.
Example
Everyone who takes some fruit daily is healthy. Ramya is not healthy.
Therefore, Ramya does not take fruit daily.
To check the validity of the above argument, let
P(x) : x takes fruit daily
Q(x) : x is healthy
Example
Everyone who takes some fruit daily is healthy. Ramya is not healthy.
Therefore, Ramya does not take fruit daily.
To check the validity of the above argument, let
P(x) : x takes fruit daily
Q(x) : x is healthy
Premises of the given argument are
∀x(P(x) → Q(x))
¬Q(Ramya)
Conclusion is
¬P(Ramya)
Example
Steps Logical Statement Reason
1 ¬Q(Ramya) Rule P
2 ∀x(P(x) → Q(x)) Rule P
3 P(Ramya) → Q(Ramya) Rule T, Universal specification of (2)
4 ¬P(Ramya) Rule T, Modus Tollens of (1) and (3)
Example
Every living thing is a plant or an animal. Rama’s dog is alive and it is not
a plant. All animals have hearts. Therefore, Rama’s dog has a heart.
Example
Every living thing is a plant or an animal. Rama’s dog is alive and it is not
a plant. All animals have hearts. Therefore, Rama’s dog has a heart.
To check the validity of the above argument, let
L(x) : x is alive
P(x) : x is a plant
A(x) : x is an animal
H(x) : x has a heart
Example
Every living thing is a plant or an animal. Rama’s dog is alive and it is not
a plant. All animals have hearts. Therefore, Rama’s dog has a heart.
To check the validity of the above argument, let
L(x) : x is alive
P(x) : x is a plant
A(x) : x is an animal
H(x) : x has a heart
Premises are:
∀x[L(x) → (P(x) ∨ A(x))]
L(Rd) ∧ ¬P( Rd)
∀x[A(x) → H(x)]
Conclusion is:
H( Rd ) where Rd denotes Rama’s dog
Example
Logical Statement Reason
1. L( Rd ) ∧ ¬P( Rd ) Rule P
2. L( Rd ) Rule T, Simplification of (1)
3. ¬P( Rd ) Rule T, Simplification of (1)
4. ∀x[L(x) → (P(x) ∨ A(x))] Rule P
5. L( Rd) → (P( Rd ) ∨ A( Rd )) Rule T, US of (4)
6. (P( Rd ) ∨ A( Rd )) Rule T, Modus Ponens of (2) and (5)
7. A( Rd) Rule T, Disjuctive syllogism of (3) and
8. ∀x[A(x) → H(x)] Rule P
9. A( Rd) → H( Rd ) Rule T, US of (8)
10. H( Rd ) Rule T, Modus Ponens of (7) and (9)
Prove or disprove: All doctors are college graduates. Some doctors are not
golfers. Hence, some golfers are not college graduates.
Prove or disprove: All doctors are college graduates. Some doctors are not
golfers. Hence, some golfers are not college graduates.
Solution
The premises are : ∀x(Doctor (x) → Grad(x))
∃x(Doctor (x) ∧ ¬Golf (x))
Conclusion:
∃x(Golf (x) ∧ ¬Grad(x))
This conclusion is false. (Proof by Venn diagram)
Solution
Logical Statement Reason
1. ∃x(P(x) ∧ Q(x)) Rule P
2. P(c) ∧ Q(c) for some c Rule T, ES of (1)
3. P(c) for some c Rule T, Simplification of (2)
4. Q(c) for some c Rule T, Simplification of (2)
5. ∃xP(x) Rule T, EG of (3)
6. ∃xQ(x) Rule T, EG of (4)
7. (∃xP(x)) ∧ (∃xQ(x)) Rule T, Conjunction of (5) and (6)
Show that ∃xM(x) follows logically from the premises ∀x[H(x) → M(x)]
and ∃xH(x)
Solution
Logical Statement Reason
1. ∃xH(x) Rule P
2. H(c) for some c Rule T, ES of (1)
3. ∀x[H(x) → M(x)] Rule P
4. H(c) → M(c) Rule T, US of (3)
5. M(c) for some c Rule T, Modus Ponens of (2) and (4)
6. ∃xM(x) Rule T, EG of (5)
Show that from (a) ∃x(F (x) ∧ S(x)) → [∀y (M(y ) → W (y ))] and (b)
∃y (M(y ) ∧ ¬W (y )), the conclusion ∀x(F (x) → ¬S(x)) follows.
Show that from (a) ∃x(F (x) ∧ S(x)) → [∀y (M(y ) → W (y ))] and (b)
∃y (M(y ) ∧ ¬W (y )), the conclusion ∀x(F (x) → ¬S(x)) follows.
Solution
Logical Statement Reason
1. ∃y (M(y ) ∧ ¬W (y )) Rule P
2. ∃y ¬(¬M(y ) ∨ W (y )) Rule T, logical equivalence of (1)
3. ¬∀y (M(y ) → W (y )) Rule T, logical equivalence of (2)
4. ∃x(F (x) ∧ S(x)) → Rule P
[∀y (M(y ) → W (y ))]
5. ¬∃x(F (x) ∧ S(x)) Rule T, Modus Tollens of (3) and (4)
6. ∀x(¬F (x) ∨ ¬S(x)) Rule T, Logical equivalence of (5)
7. ∀x(F (x) → ¬S(x)) Rule T, Conditional law of (6)
Solution
Logical Statement Reason
1. ∃xP(x) Rule P
2. P(c) for some c Rule T, ES of (1)
3. ∀x[P(x) → (Q(y ) ∧ R(x))] Rule P
4. P(c) → (Q(y ) ∧ R(c)) Rule T, US of (3)
5. Q(y ) ∧ R(c) for some c Rule T, Modus Ponens of (2) and (4
6. (Q(y ) ∧ R(c)) ∧ P(c) for some c Rule T, Addition of (2) and (5)
7. Q(y ) ∧ (R(c) ∧ P(c)) for some c Rule T, Associative law in (6)
8. Q(y ) ∧ ∃x(R(x) ∧ P(x)) Rule T, EG of (7)
Solution
Logical Statement Reason
11. Q(b) → R(b) Rule T,US of (6)
12. R(a) Rule T, Modus Ponens of (7) and (10)
13. R(b) Rule T, Modus Ponens of (9) and (11)
14. R(a) ∧ R(b) Rule T, Conjunction of (12) and (13)
15. ∃x∃y (R(x) ∧ R(y )) Rule T, EG of (14)
Solution
Logical Statement Reason
9. N(a, b) Rule T, Simplification of (6)
10. ¬A(b) Rule T, Disjunctive syllogism of (8) and (9)
11. ∀x(H(x) → A(x)) Rule P
12. H(b) → A(b) Rule T, US of (11)
13. ¬H(b) Rule T, Modus Tollens of (10) and (12)
14. H(b) Rule T, Simplification of (6)
15. H(b) ∧ ¬H(b) Rule T, Conjunction of (13) and (14)
16. False Contradiction