3 Predicate Logic
3 Predicate Logic
Introduction
• Statements involving variables are
common in natural languages and
mathematics:
– x > 50
– Book y is sold out.
– Author z has just published his new
book with the title y.
• Not propositions → neither T or F if the
variables are not specified.
2
Introduction
• 2 parts in the previous statements:
x is greater than 10.
3
Introduction
• 2 parts in the previous statements:
x is greater than 10.
5
Quantifiers
• Quantification : to create a proposition
from a propositional function.
• In English, the words all, some, many,
none, and few are used in
quantification.
• We focus on 2 types of quantification:
universal and existential quantification.
6
Universal Quantification
• assert that a property is true for all
values of a variable in the domain of
discourse.
– i.e. P(x) is true for all values of x in this
domain.
• The domain must always be specified
when a universal quantifier is used,
since a change of domain may lead to
change of truth value or unverifiable.
7
Universal Quantification
• The universal quantification of P(x) is
the statement:
“P (x) for all values of x in the domain.”
• Notation:
∀x P(x)
• ∀ is universal quantifier. Read as “for
all”, “for every”, “for each”, ...
8
Example
• Let P(x) be the statement “x + 1 > x”
for all real numbers x. Is ∀xP(x) true?
9
Example
• Let P(x) be the statement “x + 1 > x”
for all real numbers x. Is ∀xP(x) true?
10
Example
• Let Q(x) be the statement “x < 2”
where the domain consists of all real
numbers. Is ∀xQ(x) true?
11
Example
• Let Q(x) be the statement “x < 2”
where the domain consists of all real
numbers. Is ∀xQ(x) true?
12
Counterexample
• We can assert a universal quantification
is false by providing a counterexample
• Counterexample of ∀xP(x) : An element
for which P(x) is false.
• Note: Never assert a universal
quantification as true by providing an
example!
13
Example
• If the domain of discourse is all real
numbers, is ∀x, x2 ≥ x true?
14
Example
• If the domain of discourse is all real
numbers, is ∀x, x2 ≥ x true?
• False.
• Because if x = ½ ,
x2 = (½)2 = ¼ ≥ ½ is false
15
Existential Quantification
• Proposition that is true if and only if
P(x) is true for at least one value of x
in the domain.
• The existential quantification of P(x) is
the proposition:
“There exists an element x in the
domain such that P(x).”
• Notation : ∃xP(x)
16
Existential Quantification
• ∃ is called the existential quantifier, read
as “there exists,” “for some,” “for at least
one,” or “there is.”
• ∃xP(x) is read as:
“There is an x such that P(x),”
“There is at least one x such that P(x),”
or
“For some xP(x).”
17
Example
• Let Q(x) be the statement “x < 2” and x
is a real number.
19
Example
• Let P(x) be the statement “x + 1 = x”
for all real numbers x. Is ∃xP(x) true?
20
Example
• Let R(x) be the statement “x/2 = x” for
all real numbers x. Is ∃xR(x) true?
21
Example
• Let R(x) be the statement “x/2 = x” for
all real numbers x. Is ∃xR(x) true?
22
Domains of Quantifiers
• The domains of quantifiers can be
expressed in mathematical form.
• Example:
– ∀x∊ℝ, P(x)
∀x∊ℝ, x+1>x
∃x∊ℝ (x/2 = x)
25
Precedence of Quantifiers
• Precedence of ∀ and ∃ is higher than
NOT, AND, and OR.
• Example:
∀xP(x) /\ Q(x)
means:
( ∀xP(x) ) /\ Q(x)
not:
∀x ( P(x) /\ Q(x) )
26
Examples of Quantified
Statements
• “If x likes BLACKPINK then he likes K-Pop”
•
• Proposition?
27
Examples of Quantified
Statements
• “If x likes BLACKPINK then he likes K-Pop”
• B(x) → K(x)
• Proposition? No
28
Examples of Quantified
Statements
• “x is your classmate who has founded
Microsoft”
•
• Proposition?
31
Examples of Quantified
Statements
• “Every student with a smartphone uses
social media.”
• Rephrase:
“If a student x has a smartphone, x
uses social media”
– S(x) : Student x has a smartphone
– M(x) : x uses social media
– ∀x ( S(x) → M(x) )
32
Quantified Statements
Universal statements typically tie with implications
All S(x) is P(x): No S(x) is P(x):
∀x (S(x) → P(x)) ∀x (S(x) → ~P(x))
33
Negation of Quantified
Expressions
Consider P(x) as “x likes ice cream”
Everyone likes ice cream ∀xP(x)
34
Negation of Quantified
Expressions
Consider P(x) as “x likes ice cream”
Everyone likes ice cream ∀xP(x)
Negation
It is not the case that everyone ¬∀xP(x)
likes ice cream
35
Negation of Quantified
Expressions
Consider P(x) as “x likes ice cream”
Everyone likes ice cream ∀xP(x)
Negation
It is not the case that everyone ¬∀xP(x)
likes ice cream
36
Negation of Quantified
Expressions
Consider P(x) as “x likes ice cream”
Everyone likes ice cream ∀xP(x)
Negation
It is not the case that everyone ¬∀xP(x)
likes ice cream
38
Negation of Quantified
Expressions
Consider P(x) as “x is a honest politician”
There is at least one honest politician ∃xP(x)
Negation
It is not the case that there is a ¬∃xP(x)
honest politician
39
Negation of Quantified
Expressions
Consider P(x) as “x is a honest politician”
There is at least one honest politician ∃xP(x)
Negation
It is not the case that there is a ¬∃xP(x)
honest politician
40
Negation of Quantified
Expressions
Consider P(x) as “x is a honest politician”
There is at least one honest politician ∃xP(x)
Negation
It is not the case that there is a ¬∃xP(x)
honest politician
42
Example
• What is the negation of “All Malaysians
like teh tarik”?
∀xP(x)
43
Example
• What is the negation of “All Malaysians
like teh tarik”?
∀xP(x)
45
Example
• What is the negation of ∃x(x2 = 2)?
46
Example
• Show that ¬∀x(P (x) → Q(x)) is
equivalent to ∃x (P(x) /\ ¬Q(x)).
47
Example
• Show that ¬∀x(P (x) → Q(x)) is
equivalent to ∃x (P(x) /\ ¬Q(x)).
¬∀x(P(x) → Q(x))
= ∃x ¬(P(x) → Q(x))
= ∃x ¬(¬P(x) V Q(x))
= ∃x (P(x) /\ ¬Q(x))
48
Nested Quantifiers
• In many cases we have more than one
variables
• Require more than 1 quantifiers
• Examples:
– P(x,y) : Every author wrotes some
books
– Q(x,y) : f(x) = y
49
Example
• “Every author wrotes some books”
• Translate:
• “For every author x, each author wrote
his book y”
• ∀x∃y W(x,y)
50
Example
• “There is a number x that returns y
when we multiply x with y.”
• ∃x∀y M(x,y)
51
Order of quantifiers
• The order of quantifiers is important if
the quantifiers are of different types
∃x∀y M(x,y) ≠ ∀y∃x M(x,y)
• But,
∀x∀y M(x,y) is equal to ∀y∀x M(x,y)
52
53
Rule of inferences
(Quantified Statements)
• Universal instantiation: If a universal
quantification is true, ∀xP(x),
preposition for an instance in the
domain, c, written as P(c) is also true.
∀xP(x) → P(c)
• But, if ∀xP(x) is false, it doesn’t means
P(c) is false.
54
Rule of inferences
(Quantified Statements)
• Universal generalization: If we find
P(c) is true for an element c in the
domain, then further investigations find
that it is also true for all the other c in
the domain:
P(c) for every c in domain → ∀xP(x)
55
Rule of inferences
(Quantified Statements)
• Existential instantiation: If the
existential quantification ∃xP(x) is true,
then there is an element c in the
domain so that P(c) is true.
∃xP(x) → P(c) for some c
• But, it doesn’t means that P(c) holds
true for an arbitrary c.
56
Rule of inferences
(Quantified Statements)
• Existential generalization: If c, an
element in the domain let P(c) holds
true, the existential quantification is
true, ∃xP(x).
P(c) → ∃xP(x)
57
58
Example
• Let:
» D(x) : “x likes durian”
» U(x) : “x is a UM student”
• And given that the premises are
» ∀x(D(x) → U(x))
» D(Mutu)
• Find the conclusion “Mutu is a UM
student”
59
Example (cont’)
• Let:
» D(x) : “x likes durian”
» U(x) : “x is a UM student”