This document discusses predicates and quantifiers in predicate logic. Predicate logic can express statements about objects and their properties, while propositional logic cannot. Predicates assign properties to variables, and quantifiers specify whether a predicate applies to all or some variables in a domain. There are two types of quantifiers: universal quantification with ∀ and existential quantification with ∃. Quantified statements involve predicates, variables ranging over a domain, and quantifiers to specify the scope of the predicate.
2. Propositional logic cannot adequately express the
meaning of all statements in mathematics and in
natural language.
Predicate logic can be used to express the meaning of a
wide range of statements in mathematics and
computer science in ways that permit us to reason and
explore relationships between objects.
Predicate Logic
4. “x is greater than 10.”
Variable x is the subject of the statement.
Predicates
5. “x is greater than 10.”
Variable x is the subject of the statement.
“is greater than 10” is the predicate. It refers to a
property that the subject of the statement can have.
Predicates
6. “x is greater than 10.”
can be denoted by P(x), where P denotes the predicate
“is greater than 10” and x is the variable.
The statement P(x) is also said to be the value of the
propositional function P at x.
Predicates
7. Let P(x) denote the statement “x > 3.” What are the truth
values of P(4) and P(2)?
Example
8. Let P(x) denote the statement “x > 3.” What are the truth
values of P(4) and P(2)?
We obtain the statement P(4) by setting x = 4 in the
statement “x > 3.”
Solution
9. Let P(x) denote the statement “x > 3.” What are the truth
values of P(4) and P(2)?
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.
Solution
10. Let P(x) denote the statement “x > 3.” What are the truth
values of P(4) and P(2)?
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.
Solution
11. Let A(x) denote the statement “Computer x is under
attack by an intruder.”
Example
12. Let A(x) denote the statement “Computer x is under
attack by an intruder.”
Suppose that of the computers on campus, only CS2 and
MATH1 are currently under attack by intruders. What are
truth values of A(CS1), A(CS2), and A(MATH1)?
Solution
13. Let A(x) denote the statement “Computer x is under
attack by an intruder.”
Suppose that of the computers on campus, only CS2 and
MATH1 are currently under attack by intruders. What are
truth values of A(CS1), A(CS2), and A(MATH1)?
Ans: A(CS1) is false.
A(CS2) is true.
A(MATH1) is true.
Solution
14. 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)?
Example
15. 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)?
Ans: Q(1,2) is the statement “1 = 2 + 3,” which is false.
Q(3,0) is the proposition “3 = 0 + 3,” which is true.
Solution
17. Preconditions
- statements that describe valid input
Postconditions
- the conditions that the output should satisfy when
the program has run
Preconditions and Postconditions
18. Consider the following program, designed to interchange
the values of two variables x and y:
temp := x
x := y
y := temp
Find predicates that we can use as the precondition and
the postcondition to verify the correctness of this program.
Example
19. temp := x
x := y
y := temp
Precondition:
P(x,y), where P(x,y) is the statement “x = a and y = b,”
where a and b are the values of x and y before we run the
program.
Solution
20. temp := x
x := y
y := temp
Postcondition:
Q(x,y), where Q(x,y) is the statement “x = b and y = a.”
Solution
22. - Create a proposition from a propositional function
- Expresses the extent to which a predicate is true over a
range of elements
- In English we use the terms all, some, many, none, and few.
Quantification
23. - Create a proposition from a propositional function
- Expresses the extent to which a predicate is true over a
range of elements
- In English we use the terms all, some, many, none, and few.
Predicate Calculus
- area of logic that deals with predicates and quantifiers
Quantification
24. 1. Universal Quantification
- tells us that a predicate is true for every element
under consideration.
2. Existential Quantification
- tells us that there is one or more element under
consideration for which the predicate is true.
Two Types of Quantification
25. Definition 1
The universal quantification of P(x) is the statement
“P(x) for all values of x in the domain.”
The notation ∀xP(x) denotes the universal quantification of P(x).
Here ∀ is called the universal quantifier.
We read ∀xP(x) as “for all xP(x)” or “for every xP(x).” An element
for which P(x) is false is called a counterexample of ∀xP(x).
The Universal Quantifier
26. Domain
• also called the domain of discourse (or the universe of
discourse)
• specifies the possible values of the variable x in P(x)
• the truth value of ∀xP(x) depends on the domain
27. Let P(x) be the statement “x + 1 > x.”
What is the truth value of the quantification ∀xP(x),
where the domain consists of all real numbers?
Example
28. Let P(x) be the statement “x + 1 > x.”
What is the truth value of the quantification ∀xP(x),
where the domain consists of all real numbers?
∀xP(x) is true.
Solution
29. Let Q(x) be the statement “x < 2.”
What is the truth value of the quantification ∀xQ(x),
where the domain consists of all real numbers?
Example
30. Q(x) is the statement “x < 2”.
Q(x) is not true for every real number x, because, for
instance, Q(3) is false.
That is, x = 3 is a counterexample for the statement
∀xQ(x). Thus ∀xQ(x) is false.
Solution
31. Suppose that P(x) is “x2 > 0.”
What is the truth value of the quantification ∀xP(x),
where the domain consists of all integers?
Example
32. Suppose that P(x) is “x2 > 0.”
∀xP(x) is false.
Counterexample: x2 = 0 when x = 0
Solution
33. What is the truth value of ∀xP(x), where P(x) is the
statement “x2 < 10” and the domain consists of the positive
integers not exceeding 4?
Example
34. P(x) is the statement “x2 < 10” and the domain consists
of the positive integers not exceeding 4:
The statement ∀xP(x) is the same as the conjunction
P(1) ∧ P(2) ∧ P(3) ∧ P(4)
P(1) =
P(2) =
P(3) =
P(4) =
Solution
35. P(x) is the statement “x2 < 10” and the domain consists
of the positive integers not exceeding 4:
The statement ∀xP(x) is the same as the conjunction
P(1) ∧ P(2) ∧ P(3) ∧ P(4)
P(1) = 12 < 10 =
P(2) = 22 < 10 =
P(3) = 32 < 10 =
P(4) = 42 < 10 =
Solution
36. P(x) is the statement “x2 < 10” and the domain consists
of the positive integers not exceeding 4:
The statement ∀xP(x) is the same as the conjunction
P(1) ∧ P(2) ∧ P(3) ∧ P(4)
P(1) = 12 < 10 = 1 < 10
P(2) = 22 < 10 = 4 < 10
P(3) = 32 < 10 = 9 < 10
P(4) = 42 < 10 = 16 < 10
Solution
Because P(4) is false, it
follows that ∀xP(x) is false.
37. Definition 2
The existential quantification of P(x) is the statement
“There exists an element x in the domain such that P(x).”
We use the notation ∃xP(x) for the existential
quantification of P(x). Here ∃ is called the existential quantifier.
The Existential Quantifier
38. 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?
Example
39. Let P(x) denote the statement “x > 3.”
P(4) = 4 > 3
Because “x > 3” is sometimes true, the existential
quantification of P(x), which is ∃xP(x), is true.
Solution
40. What is the truth value of the quantification ∃xP(x),
where P(x) is the statement “x2 > 10” and the universe of
discourse consists of positive integers not exceeding 4?
Example
41. P(x) is the statement “x2 > 10” and the domain consists
of positive integers not exceeding 4?
The statement ∃xP(x) is the same as the disjunction
P(1) ∨ P(2) ∨ P(3) ∨ P(4)
P(1) =
P(2) =
P(3) =
P(4) =
Solution
42. P(x) is the statement “x2 > 10” and the domain consists
of positive integers not exceeding 4?
The statement ∃xP(x) is the same as the disjunction
P(1) ∨ P(2) ∨ P(3) ∨ P(4)
P(1) = 12 > 10 =
P(2) = 22 > 10 =
P(3) = 32 > 10 =
P(4) = 42 > 10 =
Solution
43. P(x) is the statement “x2 > 10” and the domain consists
of positive integers not exceeding 4?
The statement ∃xP(x) is the same as the disjunction
P(1) ∨ P(2) ∨ P(3) ∨ P(4)
P(1) = 12 > 10 = 1 > 10
P(2) = 22 > 10 = 4 > 10
P(3) = 32 > 10 = 9 > 10
P(4) = 42 > 10 = 16 > 10
Solution
Because P(4) is true, it
follows that ∃ xP(x) is true.
44. • Denoted by ∃! or ∃1
• The notation ∃!xP(x) or ∃1xP(x) states:
“There exists a unique x such that P(x) is true.”
• Other phrases:
“there is exactly one”
“there is one and only one.”
The Uniqueness Quantifier
45. For instance, ∃!x (x − 1 = 0), where the domain is the set
of real numbers, states that there is a unique real number x
such that x – 1 = 0.
Example
46. For instance, ∃!x (x − 1 = 0), where the domain is the set
of real numbers, states that there is a unique real number x
such that x – 1 = 0.
x = 1 is unique real number such that x – 1 = 0.
Solution
47. Truth values of Quantifiers
Table 1 Quantifiers.
Statement When True? When False?
∀xP(x)
∃xP(x)
P(x) is true for every x.
There is an x for which P(x) is true
There is an x for which P(x) is false.
P(x) is false for every x.
49. What do the statements ∀x < 0 (x2 > 0), ∀y ≠ 0 (y3 ≠ 0),
and ∃z > 0 (z2 = 2) mean, where the domain in each case
consists of the real numbers?
Example
50. The statement ∀x < 0 (x2 > 0) states that for every real
number x with x < 0, x2 > 0.
That is, it states “The square of a negative real number is
positive.“
The statement is the same as ∀x(x < 0 → x2 > 0).
Solution
51. The statement ∀y ≠ 0 (y3 ≠ 0) states that for every real
number y with y ≠ 0, we have y3 ≠ 0.
That is, it states “The cube of every nonzero real number
is nonzero.”
The statement is equivalent to ∀y(y ≠ 0 → y3 ≠ 0).
Solution
52. Finally, the statement ∃z > 0 (z2 = 2) states thatthere
exists a real number z with z > 0 such that z2 = 2.
That is, it states “There is a positive square root of 2.”
The statement is equivalent to ∃z(z > 0 ∧ z2 = 2).
Solution
53. The quantifiers ∀ and ∃ have higher precedence than all
logical operators from propositional calculus.
For example,
∀xP(x) ∨ Q(x) = (∀xP(x)) ∨ Q(x)
rather than ∀x(P(x) ∨ Q(x)).
Precedence of Quantifiers
54. Definition 3
Statements involving predicates and quantifiers are
logically equivalent if and only if they have the same truth
value no matter which predicates are substituted into these
statements and which domain of discourse is used for the
variables in these propositional functions.
We use the notation S ≡ T to indicate that two statements S
and T involving predicates and quantifiers are logically
equivalent.
Logical Equivalences Involving
Quantifiers
55. Show that ∀x(P(x) ∧ Q(x)) and ∀xP(x) ∧ ∀xQ(x) are
logically equivalent.
Example
56. We can show that ∀x(P(x) ∧ Q(x)) and ∀xP(x) ∧ ∀xQ(x)
are logically equivalent by doing two things:
1. First, we show that if ∀x(P(x) ∧ Q(x)) is true,
then ∀xP(x) ∧ ∀xQ(x) is true.
2. Second, we show that if ∀xP(x) ∧ ∀xQ(x) is true,
then ∀x(P(x) ∧ Q(x)) is true.
Solution
57. 1. First, we show that if ∀x(P(x) ∧ Q(x)) is true, then
∀xP(x) ∧ ∀xQ(x) is true.
Answer:
Suppose that ∀x(P(x) ∧ Q(x)) is true.
If a is in the domain, then P(a) ∧ Q(a) is true.
If P(a) is true and Q(a) is true, ∀xP(x) and ∀xQ(x) are
both true.
∀xP(x) ∧ ∀xQ(x) is true.
Solution
58. 2. Second, we show that if ∀xP(x) ∧ ∀xQ(x) is true, then
∀x(P(x) ∧ Q(x)) is true.
Answer:
Suppose that ∀xP(x) ∧ ∀xQ(x) is true.
It follows that ∀xP(x) is true and ∀xQ(x) is true.
If a is in the domain, P(a) is true and Q(a) is true.
If P(a) ∧ Q(a) is true. It follows that ∀x(P(x) ∧ Q(x)) is true.
Solution
59. We can conclude that
∀x(P(x) ∧ Q(x)) ≡ ∀xP(x) ∧ ∀xQ(x).
Solution
60. Consider the negation of the statement
“Every student in your class has taken a course in calculus.”
This statement is a universal quantification, namely,
∀xP(x), where P(x) is the statement “x has taken a course in
calculus” and the domain consists of the students in your class.
Negating Quantified Expressions
61. “Every student in your class has taken a course in calculus.”
¬∀xP(x)
Negating Quantified Expressions
62. “Every student in your class has taken a course in calculus.”
¬∀xP(x)
“It is not the case that every student in your class has taken a
course in calculus.”
Negating Quantified Expressions
63. “Every student in your class has taken a course in calculus.”
¬∀xP(x) ≡ ∃x ¬P(x)
“It is not the case that every student in your class has taken a
course in calculus.”
Which is the same as
“There is a student in your class who has not taken a course in
calculus.”
Negating Quantified Expressions
64. Consider the negation of the statement
“There is a student in this class who has taken a course in
calculus.”
This is the existential quantification, namely, ∃xQ(x),
where Q(x) is the statement “x has taken a course in calculus.”
Negating Quantified Expressions
65. “There is a student in this class who has taken a course in
calculus.”
¬∃xQ(x)
Negating Quantified Expressions
66. “There is a student in this class who has taken a course in
calculus.”
¬∃xQ(x)
“It is not the case that there is a student in this class who has
taken a course in calculus.”
Negating Quantified Expressions
67. “There is a student in this class who has taken a course in
calculus.”
¬∃xQ(x) ≡ ∀x¬Q(x)
“It is not the case that there is a student in this class who has
taken a course in calculus.”
This is equivalent to
“Every student in this class has not taken calculus,”
Negating Quantified Expressions
68. Negating Quantified Expressions
Table 1 Quantifiers.
Statement When True? When False?
∀xP(x)
∃xP(x)
P(x) is true for every x.
There is an x for which P(x) is true
There is an x for which P(x) is false.
P(x) is false for every x.
Table 2 De Morgan’s Laws for Quantifiers.
Negation Equivalent Statement When is Negation True? When False?
¬∃xP(x)
¬∀xP(x)
∀x ¬P(x)
∃x ¬P(x)
For every x, P(x) is false.
There is an x for which
P(x) is false.
There is an x for which P(x)
is true.
P(x) is true for every x.
69. Negating Quantified Expressions
Table 1 Quantifiers.
Statement When True? When False?
∀xP(x)
∃xP(x)
P(x) is true for every x.
There is an x for which P(x) is true
There is an x for which P(x) is false.
P(x) is false for every x.
Table 2 De Morgan’s Laws for Quantifiers.
Negation Equivalent Statement When is Negation True? When False?
¬∃xP(x)
¬∀xP(x)
∀x ¬P(x)
∃x ¬P(x)
For every x, P(x) is false.
There is an x for which
P(x) is false.
There is an x for which P(x)
is true.
P(x) is true for every x.
70. Negating Quantified Expressions
Table 1 Quantifiers.
Statement When True? When False?
∀xP(x)
∃xP(x)
P(x) is true for every x.
There is an x for which P(x) is true
There is an x for which P(x) is false.
P(x) is false for every x.
Table 2 De Morgan’s Laws for Quantifiers.
Negation Equivalent Statement When is Negation True? When False?
¬∃xP(x)
¬∀xP(x)
∀x ¬P(x)
∃x ¬P(x)
For every x, P(x) is false.
There is an x for which
P(x) is false.
There is an x for which P(x)
is true.
P(x) is true for every x.
71. Negating Quantified Expressions
Table 1 Quantifiers.
Statement When True? When False?
∀xP(x)
∃xP(x)
P(x) is true for every x.
There is an x for which P(x) is true
There is an x for which P(x) is false.
P(x) is false for every x.
Table 2 De Morgan’s Laws for Quantifiers.
Negation Equivalent Statement When is Negation True? When False?
¬∃xP(x)
¬∀xP(x)
∀x ¬P(x)
∃x ¬P(x)
For every x, P(x) is false.
There is an x for which
P(x) is false.
There is an x for which P(x)
is true.
P(x) is true for every x.
72. Negating Quantified Expressions
Table 1 Quantifiers.
Statement When True? When False?
∀xP(x)
∃xP(x)
P(x) is true for every x.
There is an x for which P(x) is true
There is an x for which P(x) is false.
P(x) is false for every x.
Table 2 De Morgan’s Laws for Quantifiers.
Negation Equivalent Statement When is Negation True? When False?
¬∃xP(x)
¬∀xP(x)
∀x ¬P(x)
∃x ¬P(x)
For every x, P(x) is false.
There is an x for which
P(x) is false.
There is an x for which P(x)
is true.
P(x) is true for every x.
74. Express the statement using predicates and quantifiers:
“Every student in class has studied calculus.”
Example
75. “Every student in class has studied calculus.”
First, rewrite the statement:
“For every student in this class, that student has studied
calculus.”
Solution
76. “Every student in class has studied calculus.”
First, rewrite the statement:
“For every student in this class, that student has studied
calculus.”
Next, introduce a variable x:
“For every student x in this class, x has studied calculus.”
Solution
77. “Every student in class has studied calculus.”
We introduce C(x), which is the statement “x has studied
calculus.”
Consequently, if the domain for x consists of the students
in the class, we can translate our statement as ∀xC(x).
Solution
78. “Every student in class has studied calculus.”
What if we change the domain to consist of all people?
Solution
79. “Every student in class has studied calculus.”
What if we change the domain to consist of all people?
“For every person x, if person x is a student in this class
then x has studied calculus.”
2nd Solution
80. “Every student in class has studied calculus.”
What if we change the domain to consist of all people?
“For every person x, if person x is a student in this class
then x has studied calculus.”
If S(x) represents the statement that person x is in this
class: ∀x(S(x) → C(x))
[Note: not ∀x(S(x) ∧ C(x)) because this statement says that all
people are students in this class and have studied calculus!]
2nd Solution
81. “Every student in class has studied calculus.”
Use the two-variable quantifier Q(x, y) for the statement
“student x has studied subject y.”
Then we would replace C(x) by Q(x, calculus) in both
approaches to obtain ∀xQ(x, calculus)
or ∀x(S(x) → Q(x, calculus)).
3rd Solution
83. A. Let P(x) be the statement “x spends more than five hours every
weekday in class,” where the domain for x consists of all students.
Express each of these quantifications in English
1.) ∃xP(x) 3.) ∃x ¬P(x)
2.) ∀xP(x) 4.) ∀x ¬P(x)
B. Let P(x) be the statement “x = x2”. If the domain consists of the
integers, what are these truth values?
1.) P(0) 3.) P(2) 5.) ∃xP(x)
2.) P(1) 4.) P(-1) 6.) ∀xP(x)
Seatwork
Editor's Notes
In English, what is predicate?
1. Let R(x,y,z) denote the statement “x + y = z”. What are the truth values of the propositions R(1,2,3) and R(0,0,1)?
2.
For every real number x with x < 0, x2 > 0… For every real number y with y ≠ 0 (y3 ≠ 0)… There exists a real number z with z > 0 (z2 = 2)