PPT2-PredicateLogic
PPT2-PredicateLogic
Joy Mukherjee
Example
Let P(x) denote the statement “x > 3”. What are the truth values of P(4)
and P(2)?
Solution: We obtain the statement P(4) by setting x = 4 in the statement
“x > 3”. Hence, P(4), which is the statement “4 > 3”, is true. However,
P(2), which is the statement “2 > 3”, is false.
Example
Let Q(x, y) denote the statement “x = y + 3”. What are the truth values
of the propositions Q(1, 2) and Q(3, 0)?
Solution: To obtain Q(1, 2), set x = 1 and y = 2 in the statement Q(x,
y). Hence, Q(1, 2) is the statement “1 = 2 + 3”, which is false. The
statement Q(3, 0) is the proposition “3 = 0 + 3”, which is true.
Example
What is the truth value of ∀x(x 2 ≥ x) if the domain consists of all real
numbers? What is the truth value of this statement if the domain consists
of all positive integers?
Solution: The universal quantification ∀x(x 2 ≥ x), where the domain
consists of all real numbers, is false for all real numbers x with 0 < x < 1.
Note that x 2 ≥ x if and only if x 2 ≥ x = x(x − 1) ≥ 0. Consequently,
x 2 ≥ x if and only if x ≤ 0 or x ≥ 1. It follows that ∀x(x 2 ≥ x) is false if
the domain consists of all real numbers.
However, if the domain consists of the positive integers, ∀x(x 2 ≥ x) is
true, because there are no integers x with 0 < x < 1.
Example
Let P(x) denote the statement “x > 3”. What is the truth value of the
quantification ∃xP(x), where the domain consists of all real numbers?
Solution: Because “x > 3” is sometimes true - for instance, when x = 4 -
the existential quantification of P(x), which is ∃xP(x), is true.
Example
Let Q(x) denote the statement “x = x + 1”. What is the truth value of the
quantification ∃xQ(x), where the domain consists of all real numbers?
Solution: Because Q(x) is false for every real number x, the existential
quantification of Q(x), which is ∃xQ(x), is false.
The area of logic that deals with predicates and quantifiers is called the
predicate logic or predicate calculus.
Precedence of Quantifiers: The quantifiers ∀ and ∃ have higher
precedence than all logical operators from propositional calculus. For
example, ∀xP(x) ∨ Q(x) is the disjunction of ∀xP(x) and Q(x). In other
words, it means (∀xP(x)) ∨ Q(x) rather than ∀x(P(x) ∨ Q(x)).
When the domain of a quantifier is finite, that is, when all its elements can
be listed, quantified statements can be expressed using propositional logic.
In particular, when the elements of the domain are x1 , x2 , . . ., xn , where n
is a positive integer, the universal quantification ∀xP(x) = P(x1 ) ∧ P(x2 )
∧ . . . ∧ P(xn ), because this conjunction is true if and only if P(x1 ), P(x2 ),
. . ., P(xn ) are all true.
Similarly, when the elements of the domain are x1 , x2 , . . ., xn , where n is a
positive integer, the existential quantification ∃xP(x) = P(x1 ) ∨ P(x2 ) ∨
. . . ∨ P(xn ), because this disjunction is true if and only if at least one of
P(x1 ), P(x2 ), . . ., P(xn ) is true.
Example
Express the statement “Some student in this class has visited Mexico” using
predicates and quantifiers.
Solution: We introduce M(x), which is the statement “x has visited
Mexico”. If the domain for x consists of the students in this class, we can
translate this first statement as ∃ xM(x).
If the domain for the variable x consists of all people. We introduce S(x) to
represent “x is a student in this class”. Our solution becomes ∃ x(S(x) ∧
M(x)) because the statement is that there is a person x who is a student in
this class and who has visited Mexico.
Caution: Our statement cannot be expressed as ∃ x(S(x) → M(x)), which
is true when there is someone not in the class because, in that case, for
such a person x, S(x) → M(x) becomes either F → T or F → F, both of
which are true.
Example
Express the statement “Every student in this class has visited either Canada
or Mexico” using predicates and quantifiers.
Solution: “For every person x, if x is a student in this class, then x has
visited Mexico or x has visited Canada”. In this case, the statement can be
expressed as ∀ x(S(x) → (C(x) ∨ M(x))).
Example
Express the statement “Every student in your school has a computer or has
a friend who has a computer” using predicates and quantifiers.
Solution: C(x) is “x has a computer”, F(x, y) is “x and y are friends”, and
the domain for both x and y consists of all students in your school. In this
case, the statement can be expressed as ∀ x(C (x) ∨ ∃ y (C (y ) ∧ F (x, y )))
Example
Translate the statement
∃ x∀ y ∀ z((F (x, y ) ∧ F (x, z) ∧ (y 6= z)) → ¬F (y , z)) into English, where
F(a, b) means a and b are friends and the domain for x, y, and z consists of
all students in your school.
Solution: This expression says that if students x and y are friends, and
students x and z are friends, and furthermore, if y and z are not the same
student, then y and z are not friends. It follows that the original statement,
which is triply quantified, says that there is a student x such that for all
students y and all students z other than y, if x and y are friends and x and
z are friends, then y and z are not friends. In other words, there is a
student none of whose friends are also friends with each other.
Example
Express the statement “If a person is female and is a parent, then this
person is someone’s mother” as a logical expression involving predicates,
quantifiers with a domain consisting of all people, and logical connectives.
Solution: The statement “If a person is female and is a parent, then this
person is someone’s mother” can be expressed as “For every person x, if
person x is female and person x is a parent, then there exists a person y
such that person x is the mother of person y”. We introduce the
propositional functions F(x) to represent “x is female”, P(x) to represent “x
is a parent”, and M(x, y) to represent “x is the mother of y”. The original
statement can be represented as ∀ x((F (x) ∧ P(x)) → ∃ yM(x, y )), or
∀ x∃ y ((F (x) ∧ P(x)) → M(x, y )).
Example
Express the statement “Everyone has exactly one best friend” as a logical
expression involving predicates, quantifiers with a domain consisting of all
people, and logical connectives.
Solution: The statement “Everyone has exactly one best friend” can be
expressed as “For every person x, person x has exactly one best friend”.
Introducing the universal quantifier, we see that this statement is the same
as “∀ x(person x has exactly one best friend)”, where the domain consists
of all people. To say that x has exactly one best friend means that there is
a person y who is the best friend of x, and furthermore, that for every
person z, if person z is not person y, then z is not the best friend of x.
When we introduce the predicate B(x, y) to be the statement “y is the best
friend of x”. Consequently, our original statement can be expressed as
∀ x∃ y (B(x, y ) ∧ ∀ z((z 6= y ) → ¬B(x, z))).
Example
Express the statement “There is a woman who has taken a flight on every
airline in the world”. using predicates and quantifiers.
Solution: Let P(w, f) be “w has taken f ” and Q(f, a) be “f is a flight on
a”. We can express the statement as
, where the domains of discourse for w, f, and a consist of all the women in
the world, all airplane flights, and all airlines, respectively.
Example
Use quantifiers to express the statement that “There does not exist a
woman who has taken a flight on every airline in the world.”
Solution:
∀ w ∃ a∀ f (¬P(w , f ) ∨ ¬Q(f , a))
This last statement states “For every woman there is an airline such that
for all flights, this woman has not taken that flight or that flight is not on
this airline.”
Example
Translate the statement “The sum of two positive integers is always
positive” into a logical expression.
Solution: ∀x∀y ((x > 0) ∧ (y > 0) → (x + y > 0)), where the domain for
both variables consists of all integers.
∀x∀y (x + y > 0), where the domain for both variables consists of all
positive integers.
Example
A multiplicative inverse of a real number x is a real number y such that
xy = 1. Translate the statement “Every real number except zero has a
multiplicative inverse.”
Solution: We first rewrite this as “For every real number x except zero, x
has a multiplicative inverse.” We can rewrite this as “For every real number
x, if x 6= 0, then there exists a real number y such that xy = 1.” This can
be rewritten as ∀x((x 6= 0) → ∃y (xy = 1)).
lim f (x) = L
x→a
is: For every real number > 0 there exists a real number δ > 0 such that
|f (x) − L| < whenever 0 < |x − a| < δ.
Use quantifiers to express the definition of the limit of a real-valued
function f (x) of a real variable x at a point a in its domain.
Solution: This definition of a limit can be phrased in terms of quantifiers
by
∀ ∃δ ∀x (0 < |x − a| < δ → |f (x) − L| < )
, where the domain for the variables and δ consists of all positive real
numbers and for x consists of all real numbers.
This definition can also be expressed as
lim f (x) 6= L
x→a
Use quantifiers and predicates to express the fact that limx→a f (x) does
not exist, where f(x) is a real-valued function of a real variable x and a
belongs to the domain of f.
Solution: This definition of a limit can be expressed as
where the domain for the variables , δ and x consists of all real numbers,
rather than just the positive real numbers. Here, restricted quantifiers have
been used. Recall that ∀x >0 P(x) means that for all x with x > 0, P(x) is
true.
Joy Mukherjee (Indian Institute of Technology Bhubaneswar)
Predicate Logic 36 / 50
Expressing System Specifications
Example
Use predicates and quantifiers to express the system specification “Every
mail message larger than one megabyte will be compressed”.
Solution: Let M(x, y) be “Mail message x is larger than y megabytes”,
where the variable x has the domain of all mail messages and the variable y
is a positive real number, and let C(x) denote “Mail message x will be
compressed”. Then the specification can be represented as ∀ x (M(x, 1) →
C(x)).
Example
Use predicates and quantifiers to express the system specification “If a user
is active, at least one network link will be available.”
Solution: ∀ x (A(x) → ∃ y (N(y) ∧ V(y)))
is the rule of inference to conclude that ∀ xP(x) is true, given the premise
that P(c) is true for all elements c in the domain. Universal generalization
is used when we show that ∀ xP(x) is true by taking an arbitrary element c
from the domain and showing that P(c) is true. We have no control over c
and cannot make any other assumptions about c other than it comes from
the domain.
is the rule of inference that is used to conclude that ∃ xP(x) is true when a
particular element c with P(c) true is known. That is, if we know one
element c in the domain for which P(c) is true, then we know that ∃ xP(x)
is true.