Download as pdf or txt
Download as pdf or txt
You are on page 1of 6

Discrete Structures Lecture 5

CMSC 2123 1.5 Nested Quantifiers

Introduction
EXAMPLE 1 Express ∀𝑥𝑥∃𝑦𝑦(𝑥𝑥 + 𝑦𝑦 = 0) without the existential quantifier.

Solution: ∀𝑥𝑥∃𝑦𝑦(𝑥𝑥 + 𝑦𝑦 = 0) is the same as ∀𝑥𝑥𝑥𝑥(𝑥𝑥) where 𝑄𝑄(𝑥𝑥) is ∃𝑦𝑦𝑦𝑦(𝑥𝑥, 𝑦𝑦)


and 𝑃𝑃(𝑥𝑥, 𝑦𝑦) = 𝑥𝑥 + 𝑦𝑦 = 0

EXAMPLE 2 Translate ∀𝑥𝑥∀𝑦𝑦((𝑥𝑥 > 0) ∧ (𝑦𝑦 < 0) → 𝑥𝑥𝑥𝑥 < 0)) into English.

Solution: This statement says that for every real number x and for every real
number y, if 𝑥𝑥 > 0 and 𝑦𝑦 < 0, then 𝑥𝑥𝑥𝑥 < 0. That is, this statement says that
for real numbers x and y, if x is positive and y is negative, then xy is negative.
The can be stated more succinctly as “The product of a positive real number
and a negative real number is always a negative real number.

The Order of Quantifiers

EXAMPLE 3 Let 𝑃𝑃(𝑥𝑥, 𝑦𝑦) be the statement “𝑥𝑥 + 𝑦𝑦 = 𝑦𝑦 + 𝑥𝑥. " What are the truth values of
the quantifications ∀𝑥𝑥∀𝑦𝑦𝑦𝑦(𝑥𝑥, 𝑦𝑦) and ∀𝑦𝑦∀𝑥𝑥𝑥𝑥(𝑥𝑥, 𝑦𝑦) where the domain for all
variables consists of all real numbers.

Solution: The quantification


∀𝑥𝑥∀𝑦𝑦𝑦𝑦(𝑥𝑥, 𝑦𝑦)
denotes the proposition
“For all real numbers x, for all real numbers y, 𝑥𝑥 + 𝑦𝑦 = 𝑦𝑦 + 𝑥𝑥.”

Because 𝑃𝑃(𝑥𝑥, 𝑦𝑦) is true for all real numbers x and y (it is the commutative law
for addition which is an axiom for the real numbers), the proposition
∀𝑥𝑥∀𝑦𝑦𝑦𝑦(𝑥𝑥, 𝑦𝑦) is true. Note that the statement ∀𝑦𝑦∀𝑥𝑥𝑥𝑥(𝑥𝑥, 𝑦𝑦) says “For all real
numbers y, for all real numbers x, 𝑥𝑥 + 𝑦𝑦 = 𝑦𝑦 + 𝑥𝑥.” This has the same meaning
as the statement “For all real numbers x, for all real numbers y, 𝑥𝑥 + 𝑦𝑦 = 𝑦𝑦 +
𝑥𝑥.” That is, ∀𝑥𝑥∀𝑦𝑦𝑦𝑦(𝑥𝑥, 𝑦𝑦) and ∀𝑦𝑦∀𝑥𝑥𝑥𝑥(𝑥𝑥, 𝑦𝑦) have the same meaning, and both
are true.

This illustrates the principle that the order of nested universal quantifiers in
a statement without other quantifiers can be changed without changing the
meaning of the quantified statement.

1
Discrete Structures Lecture 5
CMSC 2123 1.5 Nested Quantifiers

EXAMPLE 4 Let 𝑄𝑄(𝑥𝑥, 𝑦𝑦) denote “𝑥𝑥 + 𝑦𝑦 = 0.” What are the truth values of the
quantifications ∃𝑦𝑦∀𝑥𝑥𝑥𝑥(𝑥𝑥, 𝑦𝑦), where the domain for all variables consists of all
real numbers.

Solution: The quantification

∃𝑦𝑦∀𝑥𝑥𝑥𝑥(𝑥𝑥, 𝑦𝑦)

denotes the proposition

“There is a real number y such that for every real number x, 𝑄𝑄(𝑥𝑥, 𝑦𝑦).”

No matter what value of y is chosen, there is only one value of x for which 𝑥𝑥 +
𝑦𝑦 = 0. Because there is no real number y such that 𝑥𝑥 + 𝑦𝑦 = 0 for all real
numbers x, the statement ∃𝑦𝑦∀𝑥𝑥𝑥𝑥(𝑥𝑥, 𝑦𝑦) is false.

The quantification

∀𝑥𝑥∃𝑦𝑦𝑦𝑦(𝑥𝑥, 𝑦𝑦)

denotes the proposition

“For every real number x there is a real number y such that 𝑄𝑄(𝑥𝑥, 𝑦𝑦).”

Given a real number x, there is a real number y such that 𝑥𝑥 + 𝑦𝑦 = 0; namely,


𝑦𝑦 = −𝑥𝑥. Hence, the statement ∀𝑥𝑥∃𝑦𝑦𝑦𝑦(𝑥𝑥, 𝑦𝑦) is true.

Example 4 illustrates that the order in which quantifiers appear makes a difference. The
statements ∃𝑦𝑦∀𝑥𝑥𝑥𝑥(𝑥𝑥, 𝑦𝑦) and ∀𝑥𝑥∃𝑦𝑦𝑦𝑦(𝑥𝑥, 𝑦𝑦) are not logically equivalent. The statement
∃𝑦𝑦∀𝑥𝑥𝑥𝑥(𝑥𝑥, 𝑦𝑦) is true if and only if there is a y that makes 𝑃𝑃(𝑥𝑥, 𝑦𝑦) true for every x. So, for this
statement to be true, there must be a particular value of y for which 𝑃𝑃(𝑥𝑥, 𝑦𝑦) is true regardless of
the choice of x. On the other hand, ∀𝑥𝑥∃𝑦𝑦𝑦𝑦(𝑥𝑥, 𝑦𝑦) is true if and only if for every value of x there is
a value of y for which 𝑃𝑃(𝑥𝑥, 𝑦𝑦) is true. So, for this statement to be true, no matter which x you
choose, there must be a value of y (possibly depending of the x you choose) for which 𝑃𝑃(𝑥𝑥, 𝑦𝑦) is
true. In other words, in the second case, y can depend on x, whereas in the first case y is a
constant independent of x.

From these observations it follows that if ∃𝑦𝑦∀𝑥𝑥𝑥𝑥(𝑥𝑥, 𝑦𝑦) is true, then ∀𝑥𝑥∃𝑦𝑦𝑦𝑦(𝑥𝑥, 𝑦𝑦) must also be
true. However, if ∀𝑥𝑥∃𝑦𝑦𝑦𝑦(𝑥𝑥, 𝑦𝑦) is true, it is not necessary for ∃𝑦𝑦∀𝑥𝑥𝑥𝑥(𝑥𝑥, 𝑦𝑦) to be true.

2
Discrete Structures Lecture 5
CMSC 2123 1.5 Nested Quantifiers

TABLE 1 Quantifications of Two Variables.


Statement When True? When False?
∀𝑥𝑥∀𝑦𝑦𝑦𝑦(𝑥𝑥, 𝑦𝑦) 𝑃𝑃(𝑥𝑥, 𝑦𝑦) is true for every pair x, y. There is a pair x, y for which 𝑃𝑃(𝑥𝑥, 𝑦𝑦) is
∀𝑦𝑦∀𝑥𝑥𝑥𝑥(𝑥𝑥, 𝑦𝑦) false.
∀𝑥𝑥∃𝑦𝑦𝑦𝑦(𝑥𝑥, 𝑦𝑦) For every 𝑥𝑥 there is a 𝑦𝑦 for which There is an x such that 𝑃𝑃(𝑥𝑥, 𝑦𝑦) is false
𝑃𝑃(𝑥𝑥, 𝑦𝑦) is true. for every y.
∃𝑥𝑥∀𝑦𝑦𝑦𝑦(𝑥𝑥, 𝑦𝑦) There is an x for which 𝑃𝑃(𝑥𝑥, 𝑦𝑦) is For every x there is a y for which 𝑃𝑃(𝑥𝑥, 𝑦𝑦)
true for every y. is false.
∃𝑥𝑥∃𝑦𝑦𝑦𝑦(𝑥𝑥, 𝑦𝑦) There is a pair 𝑥𝑥, 𝑦𝑦 for which 𝑃𝑃(𝑥𝑥, 𝑦𝑦) is false for every pair 𝑥𝑥, 𝑦𝑦.
∃𝑦𝑦∃𝑥𝑥𝑥𝑥(𝑥𝑥, 𝑦𝑦) 𝑃𝑃(𝑥𝑥, 𝑦𝑦) is true.

EXAMPLE 5 Let 𝑄𝑄(𝑥𝑥, 𝑦𝑦, 𝑧𝑧) be the statement “𝑥𝑥 + 𝑦𝑦 = 𝑧𝑧.” What are the truth values of the
statements ∀𝑥𝑥∀𝑦𝑦∃𝑧𝑧𝑧𝑧(𝑥𝑥, 𝑦𝑦, 𝑧𝑧) and ∃𝑧𝑧∀𝑥𝑥∀𝑦𝑦𝑦𝑦(𝑥𝑥, 𝑦𝑦, 𝑧𝑧), where the domain of all
variables consists of all real numbers?

Solution: Suppose that 𝑥𝑥 and 𝑦𝑦 are assigned values. Then, there exists a real
number 𝑧𝑧 such that 𝑥𝑥 + 𝑦𝑦 = 𝑧𝑧. Consequently, the quantification
∀𝑥𝑥∀𝑦𝑦∃𝑧𝑧𝑧𝑧(𝑥𝑥, 𝑦𝑦, 𝑧𝑧)
which is the statement

“For all real numbers x and for all real numbers y there is a real
number z such that 𝑥𝑥 + 𝑦𝑦 = 𝑧𝑧. "
is true. The order of the quantification is important, because the
quantification
∃𝑧𝑧∀𝑥𝑥∀𝑦𝑦𝑦𝑦(𝑥𝑥, 𝑦𝑦, 𝑧𝑧)
which is the statement
“There is a real number z such that for all real numbers x and for all
real numbers y it is true that 𝑥𝑥 + 𝑦𝑦 = 𝑧𝑧.”
is false, because there is no value of z that satisfies the equation 𝑥𝑥 + 𝑦𝑦 = 𝑧𝑧 for
all values of x and y.

3
Discrete Structures Lecture 5
CMSC 2123 1.5 Nested Quantifiers

Translating Mathematical Statements into Statements Involving Nested Quantifiers

EXAMPLE 6 Translate the statement “The sum of two positive integers is always positive”
into a logical expression.

Solution:
1. To translate this statement into a logical expression, we first rewrite
it so that the implied quantifiers and a domain are shown.

“For every two integers, if these integers are both positive, then the
sum of these integers is positive.”

2. Next, we introduce the variables x and y to obtain

“For all positive integers x and y, 𝑥𝑥 + 𝑦𝑦 is positive.”

3. We can express the foregoing as

∀𝑥𝑥∀𝑦𝑦((𝑥𝑥 > 0) ∧ (𝑦𝑦 > 0) → (𝑥𝑥 + 𝑦𝑦 > 0))

where the domain for both variables consists of all integers.

4. Note that we could also translate this using the positive integers as
the domain. Then the statement “The sum of two positive integers is
always positive” becomes “For every two positive integers, the sum
of these integers is positive. We can express this as

∀𝑥𝑥∀𝑦𝑦(𝑥𝑥 + 𝑦𝑦 > 0).

4
Discrete Structures Lecture 5
CMSC 2123 1.5 Nested Quantifiers

Translating from Nested Quantifiers into English

EXAMPLE 9 Translate the statement

∀𝑥𝑥(𝐶𝐶(𝑥𝑥) ∨ ∃𝑦𝑦𝑦𝑦(𝑦𝑦) ∧ 𝐹𝐹(𝑥𝑥, 𝑦𝑦)))

into English, where 𝐶𝐶(𝑥𝑥) is the “x has a computer,” 𝐹𝐹(𝑥𝑥, 𝑦𝑦) is “x and y are
friends,” and the domain for both x and y consists of all students in your
school.

Solution: The statement says that for every student x in your school, x has a
computer or there is a student y such that y has a computer and x and y are
friends. In other words, every student in your school has a computer or has a
friend who has a computer.

Translating English Sentences into Logical Expressions

EXAMPLE 11 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:
1. 𝐹𝐹(𝑥𝑥) “x is female.”
2. 𝑃𝑃(𝑥𝑥) “x is a parent.”
3. 𝑀𝑀(𝑥𝑥, 𝑦𝑦) “x is the mother of y.”
∀𝑥𝑥(�𝐹𝐹(𝑥𝑥) ∧ 𝑃𝑃(𝑥𝑥)� → ∃𝑦𝑦𝑦𝑦(𝑥𝑥, 𝑦𝑦))

or
∀𝑥𝑥∃𝑦𝑦(�𝐹𝐹(𝑥𝑥) ∧ 𝑃𝑃(𝑥𝑥)� → 𝑀𝑀(𝑥𝑥, 𝑦𝑦))

EXAMPLE 13 Use quantifiers to express the statement “There is a woman who has taken a
flight on every airline in the world.

Solution: Let 𝑃𝑃(𝑤𝑤, 𝑓𝑓) be “w has taken f” and 𝑄𝑄(𝑓𝑓, 𝑎𝑎) 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.

5
Discrete Structures Lecture 5
CMSC 2123 1.5 Nested Quantifiers

Negating Nested Quantifiers

TABLE 2 De Morgan’s Laws for Quantifiers (from section 1.3)


Negation Equivalent Statement When Is Negation True? When False?
¬∃𝑥𝑥𝑥𝑥(𝑥𝑥) ∀𝑥𝑥¬𝑃𝑃(𝑥𝑥) For every x, 𝑃𝑃(𝑥𝑥) is false There is an 𝑥𝑥, for
which 𝑃𝑃(𝑥𝑥) is true.
¬∀𝑥𝑥𝑥𝑥(𝑥𝑥) ∃𝑥𝑥¬𝑃𝑃(𝑥𝑥) There is an 𝑥𝑥, for which 𝑃𝑃(𝑥𝑥) is 𝑃𝑃(𝑥𝑥) is true for every
false. x.

EXAMPLE 14 Express the negation of the statement ∀𝑥𝑥∃𝑦𝑦(𝑥𝑥𝑥𝑥 = 1) so that no negation


precedes a quantifier.

Solution: By successively applying De Morgan’s laws for quantifiers in Table 2


of Section 1.3, we can move the negation in ¬∀𝑥𝑥∃𝑥𝑥(𝑥𝑥𝑥𝑥 = 1) inside all the
quantifiers. We find that ¬∀𝑥𝑥∃𝑦𝑦(𝑥𝑥𝑥𝑥 = 1) is equivalent to ∃𝑥𝑥¬∃𝑦𝑦(𝑥𝑥𝑥𝑥 = 1),
which is equivalent to ∃𝑥𝑥∀𝑦𝑦¬(𝑥𝑥𝑥𝑥 = 1). Because ¬(𝑥𝑥𝑥𝑥 = 1) can be
expressed more simply as 𝑥𝑥𝑥𝑥 ≠ 1, we conclude that our negated statement
can be expressed as ∃𝑥𝑥∀𝑦𝑦(𝑥𝑥𝑥𝑥 ≠ 1)

EXAMPLE 15 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: This statement is the negation of the statement “There is a woman


who has taken a flight on every airline in the world.” from Example 13. By
Example 13, our statement can be expressed as ¬∃𝑤𝑤∀𝑎𝑎∃𝑓𝑓�𝑃𝑃(𝑤𝑤, 𝑓𝑓) ∧
𝑄𝑄(𝑓𝑓, 𝑎𝑎)�, where 𝑃𝑃(𝑤𝑤, 𝑓𝑓) be “w has taken f” and 𝑄𝑄(𝑓𝑓, 𝑎𝑎) be “f is a flight on a.”
By successively applying De Morgan’s laws for quantifiers in Table 2 of Section
1.3 to move the negation inside successive quantifiers and by applying De
Morgan’s low for negating a conjunction in the last step, we find that our
statement is equivalent to each of the sequence of statements:
Statement Justification
¬∃𝑤𝑤∀𝑎𝑎∃𝑓𝑓�𝑃𝑃(𝑤𝑤, 𝑓𝑓) ∧ 𝑄𝑄(𝑓𝑓, 𝑎𝑎)� Original statement
∀𝑤𝑤¬∀𝑎𝑎∃𝑓𝑓�𝑃𝑃(𝑤𝑤, 𝑓𝑓) ∧ 𝑄𝑄(𝑓𝑓, 𝑎𝑎)� Table 2 Section 1.3 ¬∃𝑥𝑥𝑥𝑥(𝑥𝑥) ≡ ∀𝑥𝑥¬𝑃𝑃(𝑥𝑥)
∀𝑤𝑤∃𝑎𝑎¬∃𝑓𝑓�𝑃𝑃(𝑤𝑤, 𝑓𝑓) ∧ 𝑄𝑄(𝑓𝑓, 𝑎𝑎)� Table 2 Section 1.3 ¬∀𝑥𝑥𝑥𝑥(𝑥𝑥) ≡ ∃𝑥𝑥¬𝑃𝑃(𝑥𝑥)
∀𝑤𝑤∃𝑎𝑎∀𝑓𝑓¬�𝑃𝑃(𝑤𝑤, 𝑓𝑓) ∧ 𝑄𝑄(𝑓𝑓, 𝑎𝑎)� Table 2 Section 1.3 ¬∃𝑥𝑥𝑥𝑥(𝑥𝑥) ≡ ∀𝑥𝑥¬𝑃𝑃(𝑥𝑥)
∀𝑤𝑤∃𝑎𝑎∀𝑓𝑓�¬𝑃𝑃(𝑤𝑤, 𝑓𝑓) ∨ ¬𝑄𝑄(𝑓𝑓, 𝑎𝑎)� Table 2 Section 1.2 ¬(𝒑𝒑 ∧ 𝒒𝒒) ≡ ¬𝒑𝒑 ∨ ¬𝒒𝒒
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.”

You might also like