Lecture 2 Predicate Logic-New 2025
Lecture 2 Predicate Logic-New 2025
• Propositional Equivalences
contradiction
A compound proposition that is always false
Lecture2
Example
Show that ¬(p ∨ q) and ¬p ∧ ¬q are logically equivalent.
Solution
The truth tables for these compound propositions are
Lecture2
Lecture2
Absorption laws
Involution law
¬(¬p ) ≡ p.
De Morgan’s laws
¬(p ∨ q ) ≡ ¬ p ∧ ¬q
¬ (p ∧ q ) ≡ ¬ p ∨ ¬ q.
Identity laws Complement laws
Lecture2
p∨f≡p
p∨¬p≡t
p∧t≡p
p∧¬p≡f
p∨t≡t
¬f ≡ t
p ∧ f ≡ f.
¬t ≡ f .
Dr. Mohamed Abdel-Aal
Discrete Mathematics
Some useful equivalences for compound propositions involving conditional
statements and biconditional statements in Tables 7 and 8, respectively. The reader is
asked to verify the equivalences in Tables 6–8 in the exercises
Lecture2
(p ∧ q) → (p ∨ q) ≡ ¬(p ∧ q) ∨ (p ∨ q)
≡ (¬p ∨¬q) ∨ (p ∨ q)
when the compound proposition is false for all assignments of truth values to its
variables, the compound proposition is unsatisfiable.
Note that (p ∨ ¬q) ∧ (q ∨ ¬r) ∧ (r ∨ ¬p) is true when the three variable p, q, and r
have the same truth value. Hence, it is satisfiable
2. (p ∨ q ∨ r) ∧ (¬p ∨ ¬q ∨ ¬r)
will see how 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.
Dr. Mohamed Abdel-Aal
Discrete Mathematics
• “x > 3,”
We can denote the statement “x is greater than 3” by P (x), where P denotes the
predicate “is greater than 3” and x is the variable.
The statement P (x) is also said to be the value of the propositional function P
at x. Once a value has been assigned to the variable x, the statement P (x)
becomes a proposition and has a truth value.
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)?
Lecture2
Solution
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.
Solution
A statement of the form P (x1, x2, . . . , xn) is the value of the propositional
function P at the n-tuple (x1, x2, . . . , xn), and P is also called an n-place
predicate or a n-ary predicate.
Example
Let P (x) be the statement “x is even.” What is the truth value of the
quantification ∀xP (x), where the domain consists of all real numbers?
Dr. Mohamed Abdel-Aal
Discrete Mathematics
∀xP (x) is false.
What is the truth value of ∀xP (x), where P (x) is the statement “𝑥 2 < 10”
and the domain consists of the positive integers not exceeding 4?
Solution
The statement ∀xP (x) is the same as the conjunction
P (1) ∧ P (2) ∧ P (3) ∧ P (4),
because the domain consists of the integers 1, 2, 3, and 4. Because P (4),
which is the statement “42 < 10,” is false, it follows that ∀xP (x) is false.
Lecture2 Solution
The statement ∀xN(x) means that for every computer x on campus, that
computer x is connected to the network. This statement can be
expressed in English as
“Every computer on campus is connected to the network.”
Dr. Mohamed Abdel-Aal
Discrete Mathematics
Example
What is the truth value of if the domain consists of all real
numbers? What is the truth value of this statement if the domain consists of
all integers?
Solution
• where the domain consists of all real numbers, is false. For
example, .
• Observe that the statement ∃xP (x) is false if and only if there is no
element x in the domain for which P (x) is true.
Example
Let P (x) be the statement “x > 0.” What is the truth value of the
quantification ∃xP (x)
• where the domain consists of all integers numbers? ∃xP (x) is true.
Lecture2
Example
What is the truth value of ∃ xP (x), where P (x) is the statement “𝑥 2 > 10”
and the domain consists of the positive integers not exceeding 4?
Lecture2
Solution
Because the domain is {1, 2, 3, 4}, the proposition ∃xP(x) is the same as the
disjunction P (1) ∨ P (2) ∨ P (3) ∨ P (4). Because P (4), which is the statement
“42 > 10,” is true, it follows that ∃xP(x) is true.
Dr. Mohamed Abdel-Aal
Discrete Mathematics
The uniqueness quantifier
the uniqueness quantifier, denoted by ∃! or ∃1.The notation ∃! xP (x)
[or ∃1xP (x)] states “There exists a unique x such that P (x) is true.”
“there is exactly one” and “there is one and only one.”) For instance,
∃!x (x − 1 = 0), where the domain is the set of real numbers,
Lecture2
The truth value of x P(x) and x P(x) depend on both the propositional
function P(x) and on the domain U.
Examples
• If U is the positive integers and P(x) is the statement “x < 2”,
then x P(x) is true, but x P(x) is false.
Example
What do the statements ∀x < 0 (𝑥 2 > 0), ∀y = 0 (𝑦 3 = 0), and ∃z > 0 (𝑧 2 = 2)
mean, where the domain in each case consists of the real numbers?
Solution
The statement ∀x < 0 (𝑥 2> 0) is the same as ∀x (x < 0 → 𝑥 2 > 0).
the statement ∃z > 0 (𝑧 2 = 2), this statement is equivalent to ∃z(z > 0 ∧ 𝑧 2 = 2).
the restriction of an existential quantification is the same as
Lecture2 the existential quantification of a conjunction.
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
Dr. Mohamed Abdel-Aal
Discrete Mathematics means (∀xP (x)) ∨ Q(x) rather than ∀x(P (x) ∨ Q(x)).
Logical Equivalences Involving Quantifiers
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. S ≡ T
Examples
Show that ∀x(P (x) ∧ Q(x)) and ∀xP (x) ∧ ∀xQ(x) are logically equivalent
we must show that they always take the same truth value, no matter
what the predicates P and Q are, and no matter which domain of discourse
is used.
Lecture2
Suppose we have particular predicates P and Q, with a common domain.
• First, we show that if ∀x(P (x) ∧ Q(x)) is true, then ∀xP (x) ∧ ∀xQ(x) is true.
• Second, we show that if ∀xP (x) ∧ ∀xQ(x) is true, then ∀x(P (x) ∧ Q(x)) is true.
Next, suppose that ∀xP (x) ∧ ∀xQ(x) is true. It follows that ∀xP (x) is true
and ∀xQ(x) is true. Hence, if a is in the domain, then P (a) is true and Q(a) is
true . It follows that for all a, P (a) ∧ Q(a) is true. It follows that ∀x(P (x) ∧
Q(x)) is true. We can now conclude that:
Lecture2
∀x(P (x) ∧ Q(x)) ≡ ∀xP (x) ∧ ∀xQ(x).
where P (x) is the statement “x has taken a course in calculus” and the domain
consists of the students in your class
The negation of this statement is
“It is not the case that every student in your class has taken a course in calculus.”
This is equivalent to
Lecture2 “There is a student in your class who has not taken a course in calculus.”
∃x ¬P (x).
This example illustrates the following logical equivalence:
¬ ∃x Q(x) ≡ ∀x ¬Q(x).
Lecture2
Solution
The negation of ∀x(𝑥 2 > x) is the statement ¬∀x(𝑥 2 > x), which is
equivalent to ∃x¬(𝑥 2 > x). This can be rewritten as ∃x(𝑥 2 ≤ x).
The negation of ∃x (𝑥 2 = 2) is the statement ¬∃x (𝑥 2 = 2), which is
equivalent to ∀x ¬ (𝑥 2 = 2). This can be rewritten as ∀x(𝑥 2 ≠ 2).
Examples
Show that ¬∀x(P (x) → Q(x)) and ∃x(P (x) ∧ ¬Q(x)) are logically equivalent.
Lecture2 ¬∀x (P (x) → Q(x)) ≡ ∃x (¬(P (x) → Q(x))) (De Morgan’s law for universal quantifiers )
≡ ∃x (P (x) ∧ ¬Q(x) ) (By the fifth logical equivalence in Table 7 )
Examples
Express the statements “Some student in this class has visited Mexico”
and “Every student in this class has visited either Canada or Mexico”
using predicates and quantifiers.
Solution
We introduce M(x), which is the statement “x has visited Mexico.” and
S(x) to represent “x is a student in this class.”
says that for every real number x there is a real number y such that x + y = 0.
Lecture2 Assume that the domain for the variables x and y consists of all real numbers.
The statement
• ∀x ∀y (x + y = y + x)
says that x + y = y + x for all real numbers x and y.
Dr. Mohamed Abdel-Aal
Discrete Mathematics
Examples
Translate into English the statement
where the domain for both variables consists of all real numbers.
Solution
this statement says that for real numbers x and y, if x is positive
and y is negative, then xy is negative.
∀x ∀y P (x, y) and ∀y ∀x P (x, y) have the same meaning, and both are true
Examples
Let Q(x, y) denote “x + y = 0.” What are the truth values of the
quantifications ∃y ∀x Q(x, y) and ∀x ∃y Q(x, y), where the domain for
all variables consists of all real numbers?
Solution
∃y ∀x Q(x, y)
Lecture2 denotes the proposition:
“There is a real number y such that for every real number x, Q(x, y).”
Because
there is no real number y such that x + y = 0 for all real numbers x, the
statement ∃y ∀x Q(x, y) is false
Dr. Mohamed Abdel-Aal
Discrete Mathematics
The quantification
∀x ∃y Q(x, y)
denotes the proposition
“For every real number x there is a real number y such that Q(x, y).”
Given a real number x, there is a real number y such that x + y = 0; namely,
y = −x. Hence, the statement ∀x∃yQ(x, y) is true
Lecture2
Define P(x,y) : x / y = 1, where the domain for all variables consists of all
real numbers. What is the truth value of the following:
Lecture2 ∀x∀y P(x,y) ………..……
∀x ∃y P(x,y) ……….…….
∃ x ∀ y P(x,y) ……………..
∃ x ∃ y P(x,y) …………….
Examples Translate the statement “The sum of two positive integers is always
positive” into a logical expression
we can express this statement as
∀x ∀y ((x > 0) ∧ (y > 0) → (x + y > 0))
where the domain for both variables consists of all integers.
Note that we could also translate this using the positive integers as
the domain. We can express this as
Lecture2 ∀x ∀y (x + y > 0).
Examples
Translate the statement “Every real number except zero
has a multiplicative inverse.”
This can be rewritten as
Dr. Mohamed Abdel-Aal
Discrete Mathematics
∀x ((x ≠ 0) → ∃y (xy = 1)).
Translating from Nested Quantifiers into English
• The first step in translating such an expression is to write out what the
quantifiers and predicates in the expression mean.
• The next step is to express this meaning in a simpler sentence.
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
Dr. Mohamed Abdel-Aal none of whose friends are also friends with each other.
Discrete Mathematics
Thinking of Nested Quantification
Nested Loops
To see if ∀x ∀y p(x,y) is true, loop through the values of x :
• At each step, loop through the values for y.
• If for some pair of x and y, P(x,y) is false, then ∀x ∀y p (x,y) is false and both the
outer and inner loop terminate.
• ∀x ∀y p (x,y) is true if the outer loop ends after stepping through each x
To see if ∀x ∃y P(x,y) is true, loop through the values of x:
• At each step, loop through the values for y.
• The inner loop ends when a pair x and y is found such that P(x, y) is true.
• If no y is found such that P(x, y) is true the outer loop terminates as ∀x ∃y P(x,y)
Lecture2 has been shown to be false.
• ∀x ∃y P(x,y) is true if the outer loop ends after stepping through each x.
If the domains of the variables are infinite, then this process can not actually
be carried out.
Solution
applying De Morgan’s laws for quantifiers, we can move the negation in
¬∀x∃y(xy = 1) inside all the quantifiers. We find that
¬∀x ∃y (xy = 1) ≡ ∃x ¬∃y (xy = 1),
≡ ∃x ∀y ¬(xy = 1).
≡ ∃x ∀y (xy ≠ 1).
we conclude that our negated
statement can be expressed as ∃x ∀y (xy ≠ 1).
Lecture2
Lecture 3
Solution
We use these steps, where a and b are two equal positive integers.
Every step is valid except for one, step 5 where we divided both sides by
a - b. The error is that a - b equals zero; division of both sides of an equation
Dr. Mohamed Abdel-Aal
Discrete Mathematics
by the same quantity is valid as long as this quantity is not zero.