You are on page 1of 75

Ch1.

Sets and Logic

School of Electronics Engineering


Prof. Jeongsik Choi
Sets and Logic
Set is a collection of objects

Logic is the study of reasoning

Example:
All mathematicians wear sandals
Anyone who wears sandals is an algebraist
Therefore, all mathematicians are algebraists

Prof. Jeongsik Choi 2


Contents
1.1 Sets

1.2 Propositions

1.3 Conditional Propositions and Logical Equivalence

1.4 Arguments and Rules of Inference

1.5 Quantifiers

1.6 Nested Quantifiers

Prof. Jeongsik Choi 3


1.1 Sets
Set is a collection of objects
Objects are referred to as elements or members

Set is described by listing the elements

𝐴 = 1, 2, 3, 4

or described by listing a property necessary for membership

𝐴 = 𝑥 𝑥 is a positive, even integer}

Prof. Jeongsik Choi 4


1.1 Sets
Set of numbers

Symbol Set Example of elements

𝐍 Natural numbers 1, 2, 3, 4

𝐙 Integers -5, -1, 0, 2, 1000

𝐐 Rational numbers -1/2, 0, 9.78

𝐑 Real numbers -3, -1.776, 2, 𝜋

𝐂 Complex numbers 1 + 𝑖, 2 − 3𝑖, 𝑖, 𝑖+3

Prof. Jeongsik Choi 5


1.1 Sets
Finite sets
Examples:
𝐴 = 1, 2, 3, 4
𝐵 = 𝑥 𝑥 is an integer, 1 ≤ 𝑥 ≤ 4}

Infinite sets
Examples:
𝑍 = integers = … , −2, −1, 0, 1, 2, …
𝑆 = 𝑥 𝑥 is real number and 1 ≤ 𝑥 ≤ 4}

Prof. Jeongsik Choi 6


1.1 Sets
Cardinality
Number of elements in a set
Cardinality of set 𝐴 is denoted by |𝐴|
Examples:
If 𝐴 = {1, 2, 3} then 𝐴 = 3
If 𝐵 = 𝑥 𝑥 is a natural number and 1 ≤ 𝑥 ≤ 9} then 𝐵 = 9

Infinity cardinality
Countable (e.g., 𝐍, 𝐙, 𝐐)
Uncountable (e.g., 𝐑, 𝐂)

Prof. Jeongsik Choi 7


1.1 Sets
Basic set notations
𝑥 ∈ 𝐴: 𝑥 is an element of set 𝐴 (c.f., 𝑥 ∉ 𝐴)
𝑋 = 𝑌: two sets 𝑋, 𝑌 are equal (c.f., 𝑋 ≠ 𝑌)
✓ 𝑋, 𝑌 have the same elements

𝜙: empty (or null or void) set


✓ Set with no elements (i.e., 𝜙 = { })
𝑈: universal set: the set of all elements

Prof. Jeongsik Choi 8


1.1 Sets
Subset
If every element in 𝑋 is an element of 𝑌, 𝑋 is a subset of 𝑌

𝑋⊆𝑌

If two sets satisfy 𝑋 ⊆ 𝑌 and 𝑌 ⊆ 𝑋, then 𝑋 = 𝑌

If 𝑋 is a subset of 𝑌 and 𝑋 ≠ 𝑌, 𝑋 is a proper subset of 𝑌

𝑋⊂𝑌

Prof. Jeongsik Choi 9


1.1 Sets
Power set
𝑃(𝑋): The set of all subsets of a set 𝑋
✓ Cardinality of 𝑃(𝑋) is 2 𝑋

Example:
✓ If 𝐴 = 𝑎, 𝑏, 𝑐 , then 𝑃 𝐴 = 𝜙, 𝑎 , 𝑏 , 𝑐 , 𝑎, 𝑏 , 𝑎, 𝑐 , 𝑏, 𝑐 , 𝑎, 𝑏, 𝑐

Prof. Jeongsik Choi 10


1.1 Sets
Set operations
Union:
𝑋 ∪ 𝑌 = 𝑥 𝑥 ∈ 𝑋 or 𝑥 ∈ 𝑌}

Intersection:
𝑋 ∩ 𝑌 = 𝑥 𝑥 ∈ 𝑋 and 𝑥 ∈ 𝑌}

Difference:
𝑋 − 𝑌 = 𝑥 𝑥 ∈ 𝑋 and 𝑥 ∉ 𝑌}

Complement:
𝑋ത = 𝑥 𝑥 ∈ 𝑈 and 𝑥 ∉ 𝑋}

Prof. Jeongsik Choi 11


1.1 Sets
Venn Diagrams
Provides pictorial view of sets
A rectangular depicts 𝑈 and subsets of 𝑈 are drawn as circles

Examples: 𝐴 ∩ 𝐵, 𝐴 ∪ 𝐵, 𝐴,ҧ 𝐴 − 𝐵

Prof. Jeongsik Choi 12


1.1 Sets
Theorem 1.1.22
Let 𝑈 be a universal set and 𝐴, 𝐵, 𝐶 be subsets of 𝑈
(a) Associative laws:
𝐴∪𝐵 ∪𝐶 =𝐴∪ 𝐵∪𝐶 , 𝐴∩𝐵 ∩𝐶 =𝐴∩ 𝐵∩𝐶
(b) Commutative laws:
𝐴 ∪ 𝐵 = 𝐵 ∪ 𝐴, 𝐴∩𝐵 =𝐵∩𝐴
(c) Distributive laws:
𝐴∩ 𝐵∪𝐶 = 𝐴∩𝐵 ∪ 𝐴∩𝐶 , 𝐴∪ 𝐵∩𝐶 = 𝐴∪𝐵 ∩ 𝐴∪𝐶
(d) Identity laws:
𝐴 ∪ 𝜙 = 𝐴, 𝐴∩𝑈 =𝐴
(e) Complement laws:
𝐴 ∪ 𝐴ҧ = 𝑈, 𝐴 ∩ 𝐴ҧ = 𝜙

Prof. Jeongsik Choi 13


1.1 Sets
Theorem 1.1.22 (Cont.)
(f) Idempotent laws:
𝐴 ∪ 𝐴 = 𝐴, 𝐴∩𝐴 =𝐴
(g) Bound laws:
𝐴 ∪ 𝑈 = 𝑈, 𝐴∩𝜙=𝜙
(h) Absorption laws:
𝐴 ∪ 𝐴 ∩ 𝐵 = 𝐴, 𝐴∩ 𝐴∪𝐵 =𝐴
(i) Involution law:

𝐴ഥ = 𝐴

( j) 0/1 laws:
𝜙ത = 𝑈, 𝑈
ഥ=𝜙

Prof. Jeongsik Choi 14


1.1 Sets
Theorem 1.1.22 (cont.)
(k) De Morgan’s laws for sets:

(𝐴 ∪ 𝐵) = 𝐴ҧ ∩ 𝐵,
ത 𝐴 ∩ 𝐵 = 𝐴ҧ ∪ 𝐵ത

Prof. Jeongsik Choi 15


1.1 Sets
Collection of sets
A set whose elements are sets are called a collection of sets

Example:
𝑆= 1, 2 , 1, 3 , 1, 7, 10

Sets 𝑋 and 𝑌 are disjoint if 𝑋 ∩ 𝑌 = 𝜙

𝑆 is said to be pairwise disjoint if 𝑋, 𝑌 ∈ 𝑆 and 𝑋 ≠ 𝑌 are disjoint

Prof. Jeongsik Choi 16


1.1 Sets
Collection of sets (cont.)
Union of a collection of sets 𝑆 is defined by

‫ 𝑋 ∈ 𝑥 𝑥 = 𝑆 ڂ‬for some 𝑋 ∈ 𝑆}

Example:

for 𝑆 = 1, 2 , 1, 3 , 1, 7, 10 , ‫{ = 𝑆 ڂ‬1, 2, 3, 7, 10}

If 𝑆 = {𝐴1 , 𝐴2 , … 𝐴𝑛 } with sets 𝐴1 , … , 𝐴𝑛

‫=𝑖𝑛ڂ = 𝑆 ڂ‬1 𝐴𝑖 , ‫=𝑖𝑛ځ = 𝑆 ځ‬1 𝐴𝑛

Prof. Jeongsik Choi 17


1.1 Sets
Partition
A collection of sets 𝑆 is said to be a partition of a set 𝑋 if every
element in 𝑋 belongs to exactly one member of 𝑆

Example:

𝑆= 1, 4, 5 , 2, 6 , 3 , 7, 8 is a partition of 𝑋 = {1, 2, 3, 4, 5, 6, 7}

Prof. Jeongsik Choi 18


1.1 Sets
Cartesian product
If 𝑋 and 𝑌 are sets, the Cartesian product of 𝑋 and 𝑌 is defined by

𝑋×𝑌 = 𝑥, 𝑦 𝑥 ∈ 𝑋, 𝑦 ∈ 𝑌}

(𝑥, 𝑦) is called ordered pair (i.e., 𝑥, 𝑦 ≠ (𝑦, 𝑥) if 𝑥 ≠ 𝑦)

Example:
If 𝑋 = 1, 2, 3 , 𝑌 = 𝑎, 𝑏 ,
then 𝑋 × 𝑌 = 1, 𝑎 , 1, 𝑏 , 2, 𝑎 , 2, 𝑏 , 3, 𝑎 , 3, 𝑏

Prof. Jeongsik Choi 19


1.1 Sets
Cartesian product (cont.)
The Cartesian product of sets 𝑋1 , 𝑋2 , … , 𝑋𝑛 is defined by

𝑋1 × 𝑋2 × ⋯ × 𝑋𝑛 = 𝑥1 , 𝑥2 , … , 𝑥𝑛 𝑥1 ∈ 𝑋1 , … , 𝑥𝑛 ∈ 𝑋𝑛 }

(𝑥1 , … , 𝑥𝑛 ) is called 𝑛-tuple

Prof. Jeongsik Choi 20


1.1 Sets
Example 1.1.28
For 𝑋 = 1, 2 , 𝑌 = {𝑎, 𝑏}, and 𝑍 = {𝛼, 𝛽}, find 𝑋 × 𝑌 × 𝑍

Prof. Jeongsik Choi 21


1.1 Sets
Cardinality of Cartesian product
If 𝑋1 , 𝑋2 , … , 𝑋𝑛 are sets, then 𝑋1 × 𝑋2 × ⋯ × 𝑋𝑛 = 𝑋1 ⋅ 𝑋2 ⋅ … ⋅ 𝑋𝑛

Prof. Jeongsik Choi 22


1.2 Propositions
Definition
A proposition is a sentence that is true or false but not both

Examples:
(a) The only positive integers that divide 7 are 1 and 7 itself
(b) Alfred Hitchcock won an Academy Award in 1940 for directing Rebecca
(c) For every positive integer 𝑛, there is a prime number larger than 𝑛
(d) Earth is the only planet in the universe that contains life
(e) Buy two tickets to the “Unhinged Universe” rock concert for Friday
(f) 𝑥 + 4 = 6

Prof. Jeongsik Choi 23


1.2 Propositions
Definition 1.2.1
Let 𝑝 and 𝑞 be propositions

Conjunction of 𝑝 and 𝑞 is denoted by 𝑝 ∧ 𝑞, meaning 𝑝 and 𝑞

Disjunction of 𝑝 and 𝑞 is denoted by 𝑝 ∨ 𝑞, meaning 𝑝 or 𝑞

Prof. Jeongsik Choi 24


1.2 Propositions
Definition 1.2.3
The truth value of the proposition 𝑝 ∧ 𝑞 is defined by the truth table

𝒑 𝒒 𝒑∧𝒒
T T T
T F F
F T F
F F F

Prof. Jeongsik Choi 25


1.2 Propositions
Example 1.2.4
If 𝑝: a decade is 10 years, and 𝑞: a millennium is 100 years, then 𝑝 is
true, 𝑞 is false, and the conjunction

𝑝 ∧ 𝑞 : a decade is 10 years and a millennium is 100 years

is false

Prof. Jeongsik Choi 26


1.2 Propositions
Definition 1.2.6
The truth value of the proposition 𝑝 ∨ 𝑞 is defined by the truth table

𝒑 𝒒 𝒑∧𝒒
T T T
T F T
F T T
F F F

Prof. Jeongsik Choi 27


1.2 Propositions
Example 1.2.7
If 𝑝: a millennium is 100 years, and 𝑞: a millennium is 1000 years,
then 𝑝 is false, 𝑞 is true, and the disjunction

𝑝 ∨ 𝑞 : a millennium is 100 years or a millennium is 100 years

is true

Prof. Jeongsik Choi 28


1.2 Propositions
Exclusive OR (XOR)
Let 𝑝 and 𝑞 be propositions. 𝑝 ⊕ 𝑞 is called the exclusive-or of 𝑝, 𝑞

𝒑 𝒒 𝒑⊕𝒒
T T F
T F T
F T T
F F F

c.f., 𝑝 ∨ 𝑞 is called the inclusive-or

Prof. Jeongsik Choi 29


1.2 Propositions
Definition 1.2.9
The negation of 𝑝, denoted ¬𝑝, is the proposition not 𝑝

𝒑 ¬𝑝
T F
F T

Prof. Jeongsik Choi 30


1.2 Propositions
Example
If 𝑝: Paris is the capital of England, then 𝑝 is true, and the negation

¬𝑝: Paris is not the capital of England

is true

Prof. Jeongsik Choi 31


1.2 Propositions
Negative-or (NOR) and negative-and (NAND)
Let 𝑝 and 𝑞 be propositions,
Negative-or is expressed by ¬(𝑝 ∨ 𝑞)
Negative-and is expressed by ¬(𝑝 ∧ 𝑞)

Prof. Jeongsik Choi 32


1.2 Propositions
Operator precedence
In algebra, we perform ×, ÷ before +, − operations
In logic, we first evaluate ¬, ∧, and ∨

Example:
Assume 𝑝 is false, 𝑞 is true, and 𝑟 is false. What is ¬𝑝 ∨ 𝑞 ∧ 𝑟?

Prof. Jeongsik Choi 33


1.3 Conditional Propositions
Definition 1.3.1
If 𝑝 and 𝑞 are propositions, the proposition
if 𝑝 then 𝑞
is called a conditional proposition and is denoted by
𝑝→𝑞

𝑝 is called the hypothesis (or antecedent)


𝑞 is called the conclusion (or consequent)

Prof. Jeongsik Choi 34


1.3 Conditional Propositions
Example 1.3.2
If we define
𝑝: The Mathematics Department gets an additional $60,000
𝑞: The Mathematics Department will hire one new faculty member

Prof. Jeongsik Choi 35


1.3 Conditional Propositions
Definition 1.3.3
The truth value of the conditional proposition 𝑝 → 𝑞 is defined by

𝒑 𝒒 𝒑→𝒒
T T T
T F F
F T T
F F T

If hypothesis is false, the proposition is always true


✓ It is called true by default or vacuously true

Prof. Jeongsik Choi 36


1.3 Conditional Propositions
Example 1.3.4
Let 𝑝: 1 > 2, 𝑞: 4 < 8
Then what is 𝑝 → 𝑞 and 𝑞 → 𝑝?

Example 1.3.5
𝑝 is true, 𝑞 is false, and 𝑟 is true. Find truth value of each proposition
(a) 𝑝 ∧ 𝑞 → 𝑟

(b) 𝑝 ∨ 𝑞 → ¬𝑟
(c) 𝑝 ∧ 𝑞 → 𝑟
(d) 𝑝 → (𝑞 → 𝑟)

Prof. Jeongsik Choi 37


1.3 Conditional Propositions
Definition 1.3.8
If 𝑝 and 𝑞 are propositions, the proposition
𝑝 if and only if 𝑞
is called a biconditional proposition and is denoted by
𝑝↔𝑞

𝒑 𝒒 𝒑⟷𝒒
T T T
T F F
F T F
F F T

Prof. Jeongsik Choi 38


1.3 Conditional Propositions
Necessary and sufficient conditions
If 𝑟 and 𝑠 are statements:

𝑟 is a sufficient condition for 𝑠


✓ if 𝑟 then 𝑠: 𝑟 → 𝑠
𝑟 is a necessary condition for s
✓ If not 𝑟 then not 𝑠: ¬𝑟 → ¬𝑠
✓ If 𝑠 then 𝑟: 𝑠 → 𝑟
𝑟 is a necessary and sufficient condition for s
✓ 𝑟 if and only if 𝑠: 𝑠 ↔ 𝑟

Prof. Jeongsik Choi 39


1.3 Conditional Propositions
Logically equivalence
If two different propositions have the same truth values for every
conditions, these two are said to be logically equivalent

If 𝑃 and 𝑄 are logically equivalent, we denote 𝑃 ≡ 𝑄

Example: 𝑝 ⊕ 𝑞 ≡ (𝑝 ∨ 𝑞) ∧ (¬𝑝 ∨ ¬𝑞)

Prof. Jeongsik Choi 40


1.3 Conditional Propositions
Example 1.3.11 (De Morgan’s Laws for Logic)
¬ 𝑝 ∨ 𝑞 ≡ ¬𝑝 ∧ ¬𝑞, ¬ 𝑝 ∨ 𝑞 ≡ ¬𝑝 ∧ ¬𝑞

Prof. Jeongsik Choi 41


1.3 Conditional Propositions
Converse, inverse and contrapositive
The converse of the conditional proposition 𝑝 → 𝑞 is
𝑞→𝑝

The inverse of the conditional proposition 𝑝 → 𝑞 is


¬𝑝 → ¬𝑞

The contrapositive of the conditional proposition 𝑝 → 𝑞 is


¬𝑞 → ¬𝑝

Prof. Jeongsik Choi 42


1.3 Conditional Propositions
Example 1.3.16
If the network is down, then Dale cannot access the internet

Prof. Jeongsik Choi 43


1.3 Conditional Propositions
Theorem 1.3.18
The conditional proposition 𝑝 → 𝑞 and its contrapositive ¬𝑞 → ¬𝑝
are logically equivalent

Prof. Jeongsik Choi 44


1.4 Arguments and Rules of Inference
Deductive reasoning
Process of drawing a conclusion from a sequence of propositions

Example:
The bug is either in module 17 or in module 81
The bug is a numerical error Hypotheses
or premises
Module 81 has no numerical error

∴ The bug is in module 17 Conclusion

Prof. Jeongsik Choi 45


1.4 Arguments and Rules of Inference
Definition 1.4.1
An argument is a sequence of propositions written
𝑝1
𝑝2

𝑝𝑛
――
∴𝑞
Hypothesis: 𝑝1 , … , 𝑝𝑛
Conclusion: 𝑞
The argument is valid if all hypothesis are true

Prof. Jeongsik Choi 46


1.4 Arguments and Rules of Inference
Example 1.4.2
Determine whether the argument below is valid
𝑝→𝑞
𝑝
―――
∴𝑞

Prof. Jeongsik Choi 47


1.4 Arguments and Rules of Inference
Rules of Inference for Propositions

Rule of Inference Name Rule of Inference Name


𝑝→𝑞 𝑝
𝑝 Modus ponens 𝑞 Conjunction
――― (긍정논법) ――― (논리곱)
∴𝑞 ∴𝑝∧𝑞
𝑝→𝑞 𝑝→𝑞 Hypothetical
¬𝑞 Modus tollens 𝑞→𝑟
syllogism
――― (부정논법) ―――
∴ ¬𝑝 ∴𝑝→𝑟 (가설적 삼단논법)

𝑝
𝑝∨𝑞 Disjunctive
Addition ¬𝑝
――― syllogism
(추가법) ―――
∴𝑝∨𝑞 (논리합 삼단논법)
∴𝑞
𝑝∧𝑞 Simplification
―――
∴𝑝 (단순화)

Prof. Jeongsik Choi 48


1.4 Arguments and Rules of Inference
Example 1.4.4
Represent the argument below symbolically

If 2=3, then I ate my hat


I ate my hat
――――――――――――
∴2=3

Determine whether the argument is valid

Prof. Jeongsik Choi 49


1.4 Arguments and Rules of Inference
Example 1.4.5
Represent the argument symbolically and show that is valid

The bug is either in module 17 or module 81


The bug is a numerical error
Module 81 has no numerical error
――――――――――――――――――――
∴ The bug is in module 17

Prof. Jeongsik Choi 50


1.5 Quantifiers
Remind
Proposition is a statement that is either true of false

Consider the statement:


𝑝: 𝑛 is an odd integer

Prof. Jeongsik Choi 51


1.5 Quantifiers
Definition 1.5.1
Let 𝑃(𝑥) be a statement involving the variable 𝑥 and let 𝐷 be a set.
We call 𝑃 a propositional function or predicate (with respect to 𝐷) if
for 𝑥 ∈ 𝐷, 𝑃(𝑥) is a proposition.

(𝐷 is called domain of discourse of 𝑃)

Prof. Jeongsik Choi 52


1.5 Quantifiers
Example 1.5.3
Explain why the following are propositional functions
(a) 𝑛2 + 2𝑛 is an odd integer (domain of discourse=𝐙 + )
(b) 𝑥 2 − 𝑥 − 6 = 0 (domain of discourse=𝐑)
(c) The baseball player hit over .300 in 2015
(domain of discourse=set of baseball players)
(d) The film rated over 20% by Rotten Tomatoes
(domain of discourse=set of films rated by Rotten Tomatoes)

Prof. Jeongsik Choi 53


1.5 Quantifiers
Definition 1.5.4
Let 𝑃 be propositional function with domain of discourse 𝐷. The
statement
for every 𝑥, 𝑃(𝑥)
is said to be a universally quantified statement

It can be written by ∀𝑥 𝑃(𝑥) as well

The statement is true if 𝑃(𝑥) is true for every 𝑥 ∈ 𝐷


✓ An element 𝑥 ∈ 𝐷 that makes 𝑃(𝑥) false is called a counterexample

Prof. Jeongsik Choi 54


1.5 Quantifiers
Example 1.5.6
Determine whether the statement ∀𝑥 𝑥 2 − 1 > 0 is true or false.
The domain of discourse is 𝑹.

Prof. Jeongsik Choi 55


1.5 Quantifiers
Example 1.5.7
Suppose that 𝑃 is a propositional function whose domain of
discourse is the set {𝑑1 , … , 𝑑𝑛 }. The following pseudocode
determines whether ∀𝑥 𝑃(𝑥) is true or false:

for 𝑖 = 1 to 𝑛
if ¬𝑃 𝑑𝑖
return false
return true

Prof. Jeongsik Choi 56


1.5 Quantifiers
Definition 1.5.9
Let 𝑃 be propositional function with domain of discourse 𝐷. The
statement
there exist 𝑥, 𝑃(𝑥)
is said to be an existentially quantified statement

It can be written by ∃𝑥 𝑃(𝑥) as well

The statement is true if 𝑃(𝑥) is true for at least one 𝑥 ∈ 𝐷

Prof. Jeongsik Choi 57


1.5 Quantifiers
Example 1.5.10
Determine if the following statement is true or false
𝑥 2
∃𝑥 =
𝑥2 + 1 5

Prof. Jeongsik Choi 58


1.5 Quantifiers
Example 1.5.12
Suppose that 𝑃 is a propositional function whose domain of
discourse is the set {𝑑1 , … , 𝑑𝑛 }. The following pseudocode
determines whether ∃𝑥 𝑃(𝑥) is true or false:

for 𝑖 = 1 to 𝑛
if 𝑃 𝑑𝑖
return true
return false

Prof. Jeongsik Choi 59


1.5 Quantifiers
Example 1.5.13
Consider the existentially quantified statement

for some 𝑛, if 𝑛 is a prime, then 𝑛 + 1, 𝑛 + 2, 𝑛 + 3, and 𝑛 + 4


are not prime

Prof. Jeongsik Choi 60


1.5 Quantifiers
Theorem 1.5.14 (Generalized De Morgan’s Laws for Logic)
If 𝑃 is a propositional function, each pair of propositions in (a), (b)
has the same truth value
(a) ¬ ∀𝑥 𝑃 𝑥 ≡ ∃¬𝑃 𝑥

(b) ¬ ∃𝑥 𝑃 𝑥 ≡ ∀𝑥 ¬𝑃(𝑥)

Prof. Jeongsik Choi 61


1.5 Quantifiers
Rules of Inference for Quantified Statements

Rule of Inference Name

∀𝑥 𝑃(𝑥)
――――――― Universal instantiation
∴ 𝑃 𝑑 if 𝑑 ∈ 𝐷

𝑃(𝑑) for every 𝑑 ∈ 𝐷


――――――― Universal generalization
∴ ∀𝑥 𝑃(𝑥)

∃𝑥 𝑃(𝑥)
――――――― Existential instantiation
∴ 𝑃 𝑑 for some 𝑑 ∈ 𝐷

𝑃 𝑑 for some 𝑑 ∈ 𝐷
――――――― Existential generalization
∴ ∃𝑥 𝑃 𝑥

Prof. Jeongsik Choi 62


1.6 Nested Quantifiers
Nested (=multiple) quantifiers
Example:
The sum of any two positive real numbers is positive

Prof. Jeongsik Choi 63


1.6 Nested Quantifiers
Example 1.6.2
Write the assertion below symbolically using the statement 𝐿(𝑥, 𝑦)
that means ‘𝑥 loves 𝑦′

Everybody loves somebody

Prof. Jeongsik Choi 64


1.6 Nested Quantifiers
Statement in the form of ∀𝑥∀𝑦 𝑃 𝑥, 𝑦
The domain of discourse 𝑋 × 𝑌

It is true if, for every 𝑥 ∈ 𝑋 and for every 𝑦 ∈ 𝑌, 𝑃 𝑥, 𝑦 is true

It is false if there exists at least one 𝑥 ∈ 𝑋 and at least one 𝑦 ∈ 𝑌


such that 𝑃(𝑥, 𝑦) is false

Prof. Jeongsik Choi 65


1.6 Nested Quantifiers
Example 1.6.3
Consider the statement

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

With the domain of discourse 𝐑 × 𝐑

Prof. Jeongsik Choi 66


1.6 Nested Quantifiers
Example 1.6.4
Consider the statement

∀𝑥∀𝑦 𝑥 >0 ∧ 𝑦<0 → 𝑥+𝑦≠0

With the domain of discourse 𝐑 × 𝐑

Prof. Jeongsik Choi 67


1.6 Nested Quantifiers
Example 1.6.5
Suppose that 𝑃 is a proportional function with domain of discourse
𝑑1 , … , 𝑑𝑛 × {𝑑1 , … , 𝑑𝑛 }. The following pseudocode determines
whether ∀𝑥∀𝑦 𝑃(𝑥, 𝑦) is true or false:

for 𝑖 = 1 to 𝑛
for 𝑗 = 1 to 𝑛
if ¬𝑃 𝑑𝑖 , 𝑑𝑗
return false
return true

Prof. Jeongsik Choi 68


1.6 Nested Quantifiers
Statement in the form of ∀𝑥∃𝑦 𝑃 𝑥, 𝑦
The domain of discourse 𝑋 × 𝑌

It is true if, for every 𝑥 ∈ 𝑋, there exists at least one 𝑦 ∈ 𝑌 for which
𝑃 𝑥, 𝑦 is true

It is false if there exists at least one 𝑥 ∈ 𝑋 such that 𝑃(𝑥, 𝑦) is false


for every 𝑦 ∈ 𝑌

Prof. Jeongsik Choi 69


1.6 Nested Quantifiers
Example 1.6.6
Consider the statement

∀𝑥∃𝑦 (𝑥 + 𝑦 = 0)

With the domain of discourse 𝐑 × 𝐑

Prof. Jeongsik Choi 70


1.6 Nested Quantifiers
Example 1.6.7
Consider the statement

∀𝑥∃𝑦 (𝑥 > 𝑦)

With the domain of discourse 𝐙 + × 𝐙 +

Prof. Jeongsik Choi 71


1.6 Nested Quantifiers
Statement in the form of ∃𝑥∃𝑦 𝑃 𝑥, 𝑦
The domain of discourse 𝑋 × 𝑌

It is true if, there is at least one 𝑥 ∈ 𝑋 and at least one 𝑦 ∈ 𝑌 such


that 𝑃 𝑥, 𝑦 is true

It is false if, for every 𝑥 ∈ 𝑋 and for every 𝑦 ∈ 𝑌, 𝑃(𝑥, 𝑦) is false

Prof. Jeongsik Choi 72


1.6 Nested Quantifiers
Example 1.6.11
Consider the statement

∃𝑥∃𝑦 𝑥 > 1 ∧ 𝑦 > 1 ∧ (𝑥𝑦 = 6)

With the domain of discourse 𝐙 + × 𝐙 +

Prof. Jeongsik Choi 73


1.6 Nested Quantifiers
Example 1.6.12
Consider the statement

∃𝑥∃𝑦 𝑥 > 1 ∧ 𝑦 > 1 ∧ (𝑥𝑦 = 7)

With the domain of discourse 𝐙 + × 𝐙 +

Prof. Jeongsik Choi 74


1.6 Nested Quantifiers
Example 1.6.13
Using the generalized De Morgan’s laws of logic, we find that the
negation of ∀𝑥∃𝑦 𝑃(𝑥, 𝑦) is

¬ ∀𝑥∃𝑦 𝑃 𝑥, 𝑦 ≡ ∃𝑥 ¬ ∃𝑦 𝑃 𝑥, 𝑦 ≡ ∃𝑥∀𝑥 ¬𝑃(𝑥, 𝑦)

Prof. Jeongsik Choi 75

You might also like