Discrete Structures
Predicate Logic 2
Dr. Muhammad Humayoun
Assistant Professor
COMSATS Institute of Computer Science, Lahore. mhumayoun@ciitlahore.edu.pk
https://sites.google.com/a/ciitlahore.edu.pk/dstruct/
Negation of Quantifiers
•
¬∀𝑥 𝑃 𝑥 ≡ ∃¬𝑃 𝑥
•
¬∃𝑥 𝑃 𝑥 ≡ ∀¬𝑃 𝑥
•
¬∀𝑥 (𝑃 𝑥 ∧ 𝑄 𝑥 ) ≡
???
Negation of Quantifiers
•
¬∀𝑥 𝑃 𝑥 ≡ ∃¬𝑃 𝑥
•
¬∃𝑥 𝑃 𝑥 ≡ ∀¬𝑃 𝑥
•
¬∀𝑥 (𝑃 𝑥 ∧ 𝑄 𝑥 ) ≡
???
Negation of Quantifiers
•
¬∀𝑥 𝑃 𝑥 ≡ ∃¬𝑃 𝑥
•
¬∃𝑥 𝑃 𝑥 ≡ ∀¬𝑃 𝑥
•
¬∀𝑥 (𝑃 𝑥 ∧ 𝑄 𝑥 ) ≡
???
Exercise
B(x): “x is a baby”
ignorant(x): “x is ignorant”
vain(x): “x is vain”
Universe: The set of all people.
• Babies are ignorant.
Exercise
B(x): “x is a baby”
ignorant(x): “x is ignorant”
vain(x): “x is vain”
Universe: The set of all people.
• Babies are ignorant. (Ambiguous)
• All/Some babies are ignorant
Exercise
B(x): “x is a baby”
ignorant(x): “x is ignorant”
vain(x): “x is vain”
Universe: The set of all people.
• Babies are ignorant. (Ambiguous)
• All babies are ignorant
• ∀𝒙 (𝑩 𝒙 → 𝒊𝒈𝒏𝒐𝒓𝒂𝒏𝒕 𝒙 )
Exercise
professor(x): “x is a professor”
ignorant(x): “x is ignorant”
vain(x): “x is vain”
Universe: The set of all people.
• No professors are ignorant.
• It is not the case that there exists an x such that x is a professor and x is ignorant.
• ¬∃𝑥(𝑝𝑟𝑜𝑓𝑒𝑠𝑠𝑜𝑟 𝑥 ∧ 𝑖𝑔𝑛𝑜𝑟𝑎𝑛𝑡 𝑥 )
• It is not the case that all professors are ignorant.
Exercise
professor(x): “x is a professor”
ignorant(x): “x is ignorant”
vain(x): “x is vain”
Universe: The set of all people.
• No professors are ignorant.
• [There is no such professor who is ignorant]
• [It is not the case that there is an x such that x is a professor and x is ignorant.]
• ¬∃𝑥(𝑝𝑟𝑜𝑓𝑒𝑠𝑠𝑜𝑟 𝑥 ∧ 𝑖𝑔𝑛𝑜𝑟𝑎𝑛𝑡 𝑥 )
• It is not the case that all professors are ignorant.
Exercise
professor(x): “x is a professor”
ignorant(x): “x is ignorant”
vain(x): “x is vain”
Universe: The set of all people.
• No professors are ignorant.
• [There is no such professor who is ignorant]
• [It is not the case that there is an x such that x is a professor and x is ignorant.]
• ¬∃𝑥(𝑝𝑟𝑜𝑓𝑒𝑠𝑠𝑜𝑟 𝑥 ∧ 𝑖𝑔𝑛𝑜𝑟𝑎𝑛𝑡 𝑥 )
professors are ignorant.
Exercise
professor(x): “x is a professor”
ignorant(x): “x is ignorant”
vain(x): “x is vain”
Universe: The set of all people.
• No professors are ignorant.
• [There is no such professor who is ignorant]
• [It is not the case that there is an x such that x is a professor and x is ignorant.]
• ¬∃𝑥(𝑝𝑟𝑜𝑓𝑒𝑠𝑠𝑜𝑟 𝑥 ∧ 𝑖𝑔𝑛𝑜𝑟𝑎𝑛𝑡 𝑥 ) • All professors are not ignorant
Exercise
professor(x): “x is a professor”
ignorant(x): “x is ignorant”
vain(x): “x is vain”
Universe: The set of all people.
• No professors are ignorant.
• ¬∃𝑥(𝑝𝑟𝑜𝑓𝑒𝑠𝑠𝑜𝑟 𝑥 ∧ 𝑖𝑔𝑛𝑜𝑟𝑎𝑛𝑡 𝑥 )
• All (and all of them) professors are not ignorant.
• ∀𝑥 𝑝𝑟𝑜𝑓𝑒𝑠𝑠𝑜𝑟 𝑥 → ¬𝑖𝑔𝑛𝑜𝑟𝑎𝑛𝑡 𝑥
Exercise
professor(x): “x is a professor” ignorant(x): “x is ignorant”
vain(x): “x is vain”
Universe: The set of all people.
• All ignorant people are vain.
• For all people x, if x is ignorant then x is vain. • ∀𝑥(𝑖𝑔𝑜𝑟𝑎𝑛𝑡 𝑥 → 𝑣𝑎𝑖𝑛 𝑥 )
• It is logically equivalent to ¬[¬(∀𝑥 𝑖𝑔𝑜𝑟𝑎𝑛𝑡 𝑥 → 𝑣𝑎𝑖𝑛 𝑥 ) ]
• ≡ ¬[¬(∀𝑥 ¬𝑖𝑔𝑜𝑟𝑎𝑛𝑡 𝑥 ∨ 𝑣𝑎𝑖𝑛 𝑥 ]
• ≡ ¬ ∃𝑥 ¬¬𝑖𝑔𝑜𝑟𝑎𝑛𝑡 𝑥 ∧ ¬𝑣𝑎𝑖𝑛 𝑥
• ≡ ¬ ∃𝑥 𝑖𝑔𝑜𝑟𝑎𝑛𝑡 𝑥 ∧ ¬𝑣𝑎𝑖𝑛 𝑥
Exercise
professor(x): “x is a professor” ignorant(x): “x is ignorant”
vain(x): “x is vain”
Universe: The set of all people.
• All ignorant people are vain.
• For all people x, if x is ignorant then x is vain.
• ∀𝑥(𝑖𝑔𝑜𝑟𝑎𝑛𝑡 𝑥 → 𝑣𝑎𝑖𝑛 𝑥 )
• It is logically equivalent to ¬[¬(∀𝑥 𝑖𝑔𝑜𝑟𝑎𝑛𝑡 𝑥 → 𝑣𝑎𝑖𝑛 𝑥 ) ]
• ≡ ¬[¬(∀𝑥 ¬𝑖𝑔𝑜𝑟𝑎𝑛𝑡 𝑥 ∨ 𝑣𝑎𝑖𝑛 𝑥 ]
• ≡ ¬ ∃𝑥 ¬¬𝑖𝑔𝑜𝑟𝑎𝑛𝑡 𝑥 ∧ ¬𝑣𝑎𝑖𝑛 𝑥
• ≡ ¬ ∃𝑥 𝑖𝑔𝑜𝑟𝑎𝑛𝑡 𝑥 ∧ ¬𝑣𝑎𝑖𝑛 𝑥
Exercise
professor(x): “x is a professor” ignorant(x): “x is ignorant”
vain(x): “x is vain”
Universe: The set of all people.
• All ignorant people are vain.
• For all people x, if x is ignorant then x is vain.
• ∀𝑥(𝑖𝑔𝑜𝑟𝑎𝑛𝑡 𝑥 → 𝑣𝑎𝑖𝑛 𝑥 )
• It is logically equivalent to ¬[¬(∀𝑥 𝑖𝑔𝑜𝑟𝑎𝑛𝑡 𝑥 → 𝑣𝑎𝑖𝑛 𝑥 ) ]
• ≡ ¬[¬(∀𝑥 ¬𝑖𝑔𝑜𝑟𝑎𝑛𝑡 𝑥 ∨ 𝑣𝑎𝑖𝑛 𝑥 ]
• ≡ ¬ ∃𝑥 ¬¬𝑖𝑔𝑜𝑟𝑎𝑛𝑡 𝑥 ∧ ¬𝑣𝑎𝑖𝑛 𝑥
• ≡ ¬ ∃𝑥 𝑖𝑔𝑜𝑟𝑎𝑛𝑡 𝑥 ∧ ¬𝑣𝑎𝑖𝑛 𝑥
Exercise
professor(x): “x is a professor” ignorant(x): “x is ignorant”
vain(x): “x is vain”
Universe: The set of all people.
• All ignorant people are vain.
• For all people x, if x is ignorant then x is vain.
• ∀𝑥(𝑖𝑔𝑜𝑟𝑎𝑛𝑡 𝑥 → 𝑣𝑎𝑖𝑛 𝑥 )
• It is logically equivalent to ¬[¬(∀𝑥 𝑖𝑔𝑜𝑟𝑎𝑛𝑡 𝑥 → 𝑣𝑎𝑖𝑛 𝑥 ) ]
• ≡ ¬[¬(∀𝑥 ¬𝑖𝑔𝑜𝑟𝑎𝑛𝑡 𝑥 ∨ 𝑣𝑎𝑖𝑛 𝑥 ]
• ≡ ¬ ∃𝑥 ¬¬𝑖𝑔𝑜𝑟𝑎𝑛𝑡 𝑥 ∧ ¬𝑣𝑎𝑖𝑛 𝑥
• ≡ ¬ ∃𝑥 𝑖𝑔𝑜𝑟𝑎𝑛𝑡 𝑥 ∧ ¬𝑣𝑎𝑖𝑛 𝑥
Exercise
professor(x): “x is a professor” ignorant(x): “x is ignorant”
vain(x): “x is vain”
Universe: The set of all people.
• All ignorant people are vain.
• For all people x, if x is ignorant then x is vain.
• ∀𝑥(𝑖𝑔𝑜𝑟𝑎𝑛𝑡 𝑥 → 𝑣𝑎𝑖𝑛 𝑥 )
• It is logically equivalent to ¬[¬(∀𝑥 𝑖𝑔𝑜𝑟𝑎𝑛𝑡 𝑥 → 𝑣𝑎𝑖𝑛 𝑥 ) ]
• ≡ ¬[¬(∀𝑥 ¬𝑖𝑔𝑜𝑟𝑎𝑛𝑡 𝑥 ∨ 𝑣𝑎𝑖𝑛 𝑥 ]
• ≡ ¬ ∃𝑥 ¬¬𝑖𝑔𝑜𝑟𝑎𝑛𝑡 𝑥 ∧ ¬𝑣𝑎𝑖𝑛 𝑥
• ≡ ¬ ∃𝑥 𝑖𝑔𝑜𝑟𝑎𝑛𝑡 𝑥 ∧ ¬𝑣𝑎𝑖𝑛 𝑥
Exercise
professor(x): “x is a professor” ignorant(x): “x is ignorant”
vain(x): “x is vain”
Universe: The set of all people.
• No professors are vain
• It is not the case that there is an x such that x is professor and x is vain.
• ¬[∃𝑥(𝑝𝑟𝑜𝑓𝑒𝑠𝑠𝑜𝑟 𝑥 ∧ 𝑣𝑎𝑖𝑛(𝑥))]
• [∀𝑥(¬𝑝𝑟𝑜𝑓𝑒𝑠𝑠𝑜𝑟 𝑥 ∨ ¬𝑣𝑎𝑖𝑛(𝑥))]
• ∀𝑥 𝑝𝑟𝑜𝑓𝑒𝑠𝑠𝑜𝑟 𝑥 → ¬𝑣𝑎𝑖𝑛 𝑥
• For all people x, if x is a professor then x not vain.
Exercise
professor(x): “x is a professor” ignorant(x): “x is ignorant”
vain(x): “x is vain”
Universe: The set of all people.
• No professors are vain
• It is not the case that there is an x such that x is professor and x is vain.
• ¬[∃𝑥(𝑝𝑟𝑜𝑓𝑒𝑠𝑠𝑜𝑟 𝑥 ∧ 𝑣𝑎𝑖𝑛(𝑥))]
• [∀𝑥(¬𝑝𝑟𝑜𝑓𝑒𝑠𝑠𝑜𝑟 𝑥 ∨ ¬𝑣𝑎𝑖𝑛(𝑥))]
• ∀𝑥 𝑝𝑟𝑜𝑓𝑒𝑠𝑠𝑜𝑟 𝑥 → ¬𝑣𝑎𝑖𝑛 𝑥
• For all people x, if x is a professor then x not vain.
Exercise
professor(x): “x is a professor” ignorant(x): “x is ignorant”
vain(x): “x is vain”
Universe: The set of all people.
• No professors are vain
• It is not the case that there is an x such that x is professor and x is vain.
• ¬[∃𝑥(𝑝𝑟𝑜𝑓𝑒𝑠𝑠𝑜𝑟 𝑥 ∧ 𝑣𝑎𝑖𝑛(𝑥))]
• [∀𝑥(¬𝑝𝑟𝑜𝑓𝑒𝑠𝑠𝑜𝑟 𝑥 ∨ ¬𝑣𝑎𝑖𝑛(𝑥))]
• ∀𝑥 𝑝𝑟𝑜𝑓𝑒𝑠𝑠𝑜𝑟 𝑥 → ¬𝑣𝑎𝑖𝑛 𝑥
• For all people x, if x is a professor then x not vain.
Precedence of Quantifiers
•
The quantifiers
∀
and
∃
have higher
precedence then all logical operators from
propositional calculus.
•
e.g.
∀𝒙 (𝑷 𝒙 ∨ 𝑸 𝒙 )
is the disjunction
of
∀𝒙 𝑷 𝒙
and
∀𝒙 𝑸(𝒙)
.
Quantifiers with Restricted Domain
• ∀𝑥 𝑥2 > 0
– ∀ 𝑥 < 0 𝑥2 > 0
– ≡ ∀𝑥 (𝑥 < 0) → (𝑥2> 0)
• ∀𝑦 𝑦3 ≠ 0
– ∀ 𝑦 ≠ 0 𝑦3 ≠ 0
– ≡ ∀ 𝑦 ≠ 0 → 𝑦3 ≠ 0
• ∃𝑧 (𝑧2 = 2)
– ∃𝑧 > 0 (𝑧2 = 2)
– ≡ ∃𝑧(𝑧 > 0 → 𝑧2 = 2)
Quantifiers with Restricted Domain
• ∀𝑥 𝑥2 > 0
– ∀ 𝑥 < 0 𝑥2 > 0
– ≡ ∀𝑥 (𝑥 < 0) → (𝑥2> 0)
• ∀𝑦 𝑦3 ≠ 0
– ∀ 𝑦 ≠ 0 𝑦3 ≠ 0
– ≡ ∀ 𝑦 ≠ 0 → 𝑦3 ≠ 0
• ∃𝑧 (𝑧2 = 2)
– ∃𝑧 > 0 (𝑧2 = 2)
– ≡ ∃𝑧(𝑧 > 0 → 𝑧2 = 2)
Quantifiers with Restricted Domain
• ∀𝑥 𝑥2 > 0
– ∀ 𝑥 < 0 𝑥2 > 0
– ≡ ∀𝑥 (𝑥 < 0) → (𝑥2> 0)
• ∀𝑦 𝑦3 ≠ 0
– ∀ 𝑦 ≠ 0 𝑦3 ≠ 0
– ≡ ∀ 𝑦 ≠ 0 → 𝑦3 ≠ 0
• ∃𝑧 (𝑧2 = 2)
– ∃𝑧 > 0 (𝑧2 = 2)
– ≡ ∃𝑧(𝑧 > 0 → 𝑧2 = 2)
Quantifiers with Restricted Domain
• ∀𝑥 𝑥2 > 0
– ∀ 𝑥 < 0 𝑥2 > 0
– ≡ ∀𝑥 (𝑥 < 0) → (𝑥2> 0)
• ∀𝑦 𝑦3 ≠ 0
– ∀ 𝑦 ≠ 0 𝑦3 ≠ 0
– ≡ ∀ 𝑦 ≠ 0 → 𝑦3 ≠ 0
• ∃𝑧 (𝑧2 = 2)
– ∃𝑧 > 0 (𝑧2 = 2)
– ≡ ∃𝑧(𝑧 > 0 → 𝑧2 = 2)
Nested Quantifiers
∀𝑥∃𝑦 𝑃(𝑥, 𝑦)
“For all 𝑥, there exists a 𝑦 such that 𝑃(𝑥, 𝑦)”.
Example:
∀𝑥∃𝑦 (𝑥 + 𝑦 = 0) where 𝑥 and 𝑦 are integers
Nested Quantifiers
∀𝑥∃𝑦 𝑃(𝑥, 𝑦)
“For all 𝑥, there exists a 𝑦 such that 𝑃(𝑥, 𝑦)”.
Example:
∀𝑥∃𝑦 (𝑥 + 𝑦 = 0) where 𝑥 and 𝑦 are integers
𝑥𝑦 𝑃(𝑥, 𝑦)
There exists an x such that for all 𝑦, 𝑃(𝑥, 𝑦) is true”
Example: 𝑥𝑦 (𝑥 × 𝑦 = 0)
•
∀𝑥∀𝑦∀𝑧 𝑥 + 𝑦 + 𝑧 = 𝑥 + 𝑦 + 𝑧
• THINK QUANTIFICATION AS LOOPS
Meanings of multiple quantifiers
Suppose 𝑷(𝒙, 𝒚) = “x likes y.”
Domain of x: {St1, St2}; Domain of y: {DS, Calculus}
• 𝒙𝒚 𝑷(𝒙, 𝒚)
– 𝑃(𝑥, 𝑦) true for all x, y pairs. • 𝒙𝒚 𝑷(𝒙, 𝒚)
– 𝑃(𝑥, 𝑦) true for at least one x, y pair. • 𝒙𝒚 𝑷(𝒙, 𝒚)
– For every value of x we can find a (possibly different) y so that P(x,y) is true.
• 𝒙𝒚 𝑷(𝒙, 𝒚)
Meanings of multiple quantifiers
Suppose 𝑷(𝒙, 𝒚) = “x likes y.”
Domain of x: {St1, St2}; Domain of y: {DS, Calculus}
• 𝒙𝒚 𝑷(𝒙, 𝒚)
– 𝑃(𝑥, 𝑦) true for all x, y pairs.
• 𝒙𝒚 𝑷(𝒙, 𝒚)
– 𝑃(𝑥, 𝑦) true for at least one x, y pair. • 𝒙𝒚 𝑷(𝒙, 𝒚)
– For every value of x we can find a (possibly different) y so that P(x,y) is true.
• 𝒙𝒚 𝑷(𝒙, 𝒚)
Meanings of multiple quantifiers
Suppose 𝑷(𝒙, 𝒚) = “x likes y.”
Domain of x: {St1, St2}; Domain of y: {DS, Calculus}
• 𝒙𝒚 𝑷(𝒙, 𝒚)
– 𝑃(𝑥, 𝑦) true for all x, y pairs.
• 𝒙𝒚 𝑷(𝒙, 𝒚)
– 𝑃(𝑥, 𝑦) true for at least one x, y pair.
• 𝒙𝒚 𝑷(𝒙, 𝒚)
– For every value of x we can find a (possibly different) y so that P(x,y) is true.
• 𝒙𝒚 𝑷(𝒙, 𝒚)
Meanings of multiple quantifiers
Suppose 𝑷(𝒙, 𝒚) = “x likes y.”
Domain of x: {St1, St2}; Domain of y: {DS, Calculus}
• 𝒙𝒚 𝑷(𝒙, 𝒚)
– 𝑃(𝑥, 𝑦) true for all x, y pairs.
• 𝒙𝒚 𝑷(𝒙, 𝒚)
– 𝑃(𝑥, 𝑦) true for at least one x, y pair.
• 𝒙𝒚 𝑷(𝒙, 𝒚)
– For every value of x we can find a (possibly different) y so that P(x,y) is true.
• 𝒙𝒚 𝑷(𝒙, 𝒚)
• Quantification order is not commutative
𝒙𝒚 𝑷 𝒙, 𝒚 ≠ 𝒙𝒚 𝑷(𝒙, 𝒚)
Example
𝑄 (𝑥 , 𝑦, 𝑧): x + y = zDomain: Real numbers
• ∀𝑥∀𝑦∃𝑧 𝑄(𝑥, 𝑦, 𝑧) True/False???
• For all real numbers x and for all real numbers y there is a real number z such that 𝑥 + 𝑦 = 𝑧.
• True
• ∃𝑧∀𝑥∀𝑦 𝑄(𝑥, 𝑦, 𝑧) True/False???
• There is a real number z such that for all real
numbers x and for all real numbers y it is true that
𝑥 + 𝑦 = 𝑧.
• False
Example
𝑄 (𝑥 , 𝑦, 𝑧): x + y = zDomain: Real numbers
• ∀𝑥∀𝑦∃𝑧 𝑄(𝑥, 𝑦, 𝑧) True/False???
• For all real numbers x and for all real numbers y there is a real number z such that 𝑥 + 𝑦 = 𝑧.
• True
• ∃𝑧∀𝑥∀𝑦 𝑄(𝑥, 𝑦, 𝑧) True/False???
• There is a real number z such that for all real
numbers x and for all real numbers y it is true that
𝑥 + 𝑦 = 𝑧.
• False
Example
𝑄 (𝑥 , 𝑦, 𝑧): x + y = zDomain: Real numbers
• ∀𝑥∀𝑦∃𝑧 𝑄(𝑥, 𝑦, 𝑧) True/False???
• For all real numbers x and for all real numbers y there is a real number z such that 𝑥 + 𝑦 = 𝑧.
• True
• ∃𝑧∀𝑥∀𝑦 𝑄(𝑥, 𝑦, 𝑧) True/False???
• There is a real number z such that for all real
numbers x and for all real numbers y it is true that 𝑥 + 𝑦 = 𝑧.
• False
Example
𝑄 (𝑥 , 𝑦, 𝑧): x + y = zDomain: Real numbers
• ∀𝑥∀𝑦∃𝑧 𝑄(𝑥, 𝑦, 𝑧) True/False???
• For all real numbers x and for all real numbers y there is a real number z such that 𝑥 + 𝑦 = 𝑧.
• True
• ∃𝑧∀𝑥∀𝑦 𝑄(𝑥, 𝑦, 𝑧) True/False???
• There is a real number z such that for all real
numbers x and for all real numbers y it is true that 𝑥 + 𝑦 = 𝑧.
• False
From Nested Quantifiers to English
• F (a, b): “a and b are friends”
• Domain: All students in COMSATS.
∃𝑥∀𝑦∀𝑧 𝐹 𝑥, 𝑦 ∧ 𝐹 𝑥, 𝑧 ∧ 𝑦 ≠ 𝑧 → ¬𝐹 𝑦, 𝑧
• 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.
• There is a student none of whose friends are also
friends with each other.
From Nested Quantifiers to English
• F (a, b): “a and b are friends”
• Domain: All students in COMSATS.
∃𝑥∀𝑦∀𝑧 𝐹 𝑥, 𝑦 ∧ 𝐹 𝑥, 𝑧 ∧ 𝑦 ≠ 𝑧 → ¬𝐹 𝑦, 𝑧
• 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.
• There is a student none of whose friends are also friends with each other.
From English to Nested Quantifiers
• "If a person is female and is a parent, then this person is someone's mother“
• 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.“
– F(x): “x is female”
– P(x): “x is a parent“
– M(x, y) : “x is the mother of y”
• ∀𝑥[(𝑃 𝑥 ∧ 𝐹(𝑥)) → ∃𝑦𝑀 𝑥, 𝑦 ]
• ∀𝑥∃𝑦[(𝑃 𝑥 ∧ 𝐹(𝑥)) → 𝑀 𝑥, 𝑦 ]
From English to Nested Quantifiers
• "If a person is female and is a parent, then this person is someone's mother“
• 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.“
– F(x): “x is female”
– P(x): “x is a parent“
– M(x, y) : “x is the mother of y”
• ∀𝑥[(𝑃 𝑥 ∧ 𝐹(𝑥)) → ∃𝑦𝑀 𝑥, 𝑦 ]
• ∀𝑥∃𝑦[(𝑃 𝑥 ∧ 𝐹(𝑥)) → 𝑀 𝑥, 𝑦 ]
• The sum of two positive integers is always positive.
• ∀𝑥 ∀𝑦 [ 𝑥 > 0 ∧ 𝑦 > 0 → 𝑥 + 𝑦 > 0 ]
• ∀𝑥 ∀𝑦 [𝑝𝑜𝑠 𝑥 ∧ 𝑝𝑜𝑠 𝑦 → 𝑝𝑜𝑠 𝑥 + 𝑦 ]
• What is domain above? • Integers
• If domain is “+ve integers”
• ∀𝑥 ∀𝑦 𝑥 + 𝑦 > 0
• The sum of two positive integers is always positive.
• ∀𝑥 ∀𝑦 [ 𝑥 > 0 ∧ 𝑦 > 0 → 𝑥 + 𝑦 > 0 ] • ∀𝑥 ∀𝑦 [𝑝𝑜𝑠 𝑥 ∧ 𝑝𝑜𝑠 𝑦 → 𝑝𝑜𝑠 𝑥 + 𝑦 ] • What is domain above?
• Integers
• If domain is “+ve integers”
• ∀𝑥 ∀𝑦 𝑥 + 𝑦 > 0
• The sum of two positive integers is always positive.
• ∀𝑥 ∀𝑦 [ 𝑥 > 0 ∧ 𝑦 > 0 → 𝑥 + 𝑦 > 0 ] • ∀𝑥 ∀𝑦 [𝑝𝑜𝑠 𝑥 ∧ 𝑝𝑜𝑠 𝑦 → 𝑝𝑜𝑠 𝑥 + 𝑦 ] • What is domain above?
• Integers
• If domain is “+ve integers”
• ∀𝑥 ∀𝑦 𝑥 + 𝑦 > 0
• Everyone has exactly one best friend
• For every person x , person x has exactly one best friend.
• ∀𝑥 [person x has exactly one best friend]
• B(x,y): “x has best friend y”
•
∀𝑥∃𝑦[ 𝐵 𝑥, 𝑦 ]
• Exactly one best friend ????
• ∀𝒙∃𝒚[𝑩 𝒙, 𝒚 ∧ ∀𝒛 𝒚 ≠ 𝒛 → ¬𝑩(𝒙, 𝒛 ]
• ∀𝑥∃𝑦∀𝑧[𝐵 𝑥, 𝑦 ∧ 𝑦 ≠ 𝑧 → ¬𝐵(𝑥, 𝑧 ]
• Everyone has exactly one best friend
• For every person x , person x has exactly one best friend.
• ∀𝑥 [person x has exactly one best friend]
• B(x,y): “x has best friend y”
•
∀𝑥∃𝑦[ 𝐵 𝑥, 𝑦 ]
• Exactly one best friend ????
• ∀𝒙∃𝒚[𝑩 𝒙, 𝒚 ∧ ∀𝒛 𝒚 ≠ 𝒛 → ¬𝑩(𝒙, 𝒛 ]
• ∀𝑥∃𝑦∀𝑧[𝐵 𝑥, 𝑦 ∧ 𝑦 ≠ 𝑧 → ¬𝐵(𝑥, 𝑧 ]
• Everyone has exactly one best friend
• For every person x , person x has exactly one best friend.
• ∀𝑥 [person x has exactly one best friend] • B(x,y): “x has best friend y”
•
∀𝑥∃𝑦[ 𝐵 𝑥, 𝑦 ]
• Exactly one best friend ????
• ∀𝒙∃𝒚[𝑩 𝒙, 𝒚 ∧ ∀𝒛 𝒚 ≠ 𝒛 → ¬𝑩(𝒙, 𝒛 ]
• ∀𝑥∃𝑦∀𝑧[𝐵 𝑥, 𝑦 ∧ 𝑦 ≠ 𝑧 → ¬𝐵(𝑥, 𝑧 ]
• Everyone has exactly one best friend
• For every person x , person x has exactly one best friend.
• ∀𝑥 [person x has exactly one best friend] • B(x,y): “x has best friend y”
•
∀𝑥∃𝑦[ 𝐵 𝑥, 𝑦 ]
• Exactly one best friend ????
• ∀𝒙∃𝒚[𝑩 𝒙, 𝒚 ∧ ∀𝒛 𝒚 ≠ 𝒛 → ¬𝑩(𝒙, 𝒛 ]
• ∀𝑥∃𝑦∀𝑧[𝐵 𝑥, 𝑦 ∧ 𝑦 ≠ 𝑧 → ¬𝐵(𝑥, 𝑧 ]
• Everyone has exactly one best friend
• For every person x , person x has exactly one best friend.
• ∀𝑥 [person x has exactly one best friend] • B(x,y): “x has best friend y”
•
∀𝑥∃𝑦[ 𝐵 𝑥, 𝑦 ]
• Exactly one best friend ????
• ∀𝒙∃𝒚[𝑩 𝒙, 𝒚 ∧ ∀𝒛 𝒚 ≠ 𝒛 → ¬𝑩(𝒙, 𝒛 ]
• ∀𝑥∃𝑦∀𝑧[𝐵 𝑥, 𝑦 ∧ 𝑦 ≠ 𝑧 → ¬𝐵(𝑥, 𝑧 ]
• Everyone has exactly one best friend
• For every person x , person x has exactly one best friend.
• ∀𝑥 [person x has exactly one best friend] • B(x,y): “x has best friend y”
•
∀𝑥∃𝑦[ 𝐵 𝑥, 𝑦 ]
• Exactly one best friend ????
• ∀𝒙∃𝒚[𝑩 𝒙, 𝒚 ∧ ∀𝒛 𝒚 ≠ 𝒛 → ¬𝑩(𝒙, 𝒛 ] • ∀𝑥∃𝑦∀𝑧[𝐵 𝑥, 𝑦 ∧ 𝑦 ≠ 𝑧 → ¬𝐵(𝑥, 𝑧 ]
• There is a woman who has taken a flight on every airline in the world.
• Domains: people airlines flights • W(x): x is a woman
• F(x, f): x has taken flight f
• A(f, a): flight f belongs to airline a
• ∃𝒙[𝑾 𝒙 → ∀𝒂∃𝒇 𝑨 𝒇, 𝒂 ∧ 𝑭 𝒙, 𝒇 ]
• ∃𝑥∀𝑎∃𝑓[𝑊 𝑥 → 𝐴 𝑓, 𝑎 ∧ 𝐹 𝑥, 𝑓 ]
• There is a woman who has taken a flight on every airline in the world.
• Domains: woman airlines flights • P(w, f): Woman w has taken flight f
• Q(f, a): flight f belongs to airline a
• ∃𝒙[𝑾 𝒙 → ∀𝒂∃𝒇 𝑨 𝒇, 𝒂 ∧ 𝑭 𝒙, 𝒇 ]
• ∃𝑥∀𝑎∃𝑓[𝑊 𝑥 → 𝐴 𝑓, 𝑎 ∧ 𝐹 𝑥, 𝑓 ]
• There is a woman who has taken a flight on every airline in the world.
• Domains: woman airlines flights • P(w, f): Woman w has taken flight f
• Q(f, a): flight f belongs to airline a
• ∃𝒘∀𝒂∃𝒇[ 𝑷 𝒘, 𝒇 ∧ 𝑸 𝒇, 𝒂 ]
• There is a woman who has taken a flight on every airline in the world.
• Domains: woman airlines flights
• R(w, f, a): Woman w has taken flight f on airline a
• ∃𝒘∀𝒂∃𝒇[𝑸(𝒘, 𝒇, 𝒂]
Bound and free variables
A variable is bound if it is known or quantified. Otherwise, it is free.
Examples:
P(x) x is free
P(5) x is bound to 5
x P(x) x is bound by quantifier
Reminder: in a proposition, all variables must be bound.
Negating Nested Quantifiers
• ¬[ ∃𝒘∀𝒂∃𝒇 𝑷 𝒘, 𝒇 ∧ 𝑸 𝒇, 𝒂 ]
• ∀𝒘∃𝒂∀𝒇 ¬ 𝑷 𝒘, 𝒇 ∨ ¬𝑸 𝒇, 𝒂