Professional Documents
Culture Documents
Kanak Kshetri
– e.g. x is even
– e.g. F (x)
• e.g. for “x is even”, we can define the universe as the natural numbers
1
2.2 Quantifiers
2.2.1 Definition: Universal Quantification ∀
• Suppose F (x) is a WFF involving the variable x
• Then, ∀x.F (x) is a WFF called universal quantification
• It says that every item in the universe has the property F
2
2.3 Expanding Quantified Expressions
2.3.1 Expansions
• ∀x.F (x) = F (c1 ) ∧ F (c2 ) ∧ · · · ∧ F (cn )
2.3.2 Exercise 1
• U = {1, 2, 3}
• ∀x.F (x)
• ∃x.F (x)
• ∃x.∀y.G(x, y)
– (G(1, 1) ∧ G(1, 2) ∧ G(1, 3)) ∨ (G(2, 1) ∧ G(2, 2) ∧ G(2, 3)) ∨ (G(3, 1) ∧ G(3, 2) ∧ G(3, 3))
2.3.3 Exercise 2
• U =Z
• (F (1, 5) ∨ F (1, 6)) ∧ (F (2, 5), F (2, 6)) ∧ (F (3, 5), F (3, 6)) ∧ (F (4, 5) ∨ F (4, 6))
3
– If B(x) is false, then the implication is true
– Then, if x is a horse, the implication is true
– Suppose all the birds in the universe can’t actually fly
– Since we’ve found something that makes the implication true, by existential quan-
tification, the implication is true
– This is a contradiction
– ∃x.E(x)
– ∀x.E(x) ∨ O(x)
– ∀x.¬(E(x) ∧ O(x))
• We don’t have the same bug as “some birds can fly” with the implication because we’re
doing a universal quantification and not an existential one. So, if there is a single pair
of odd numbers whose sum is not even, the implication would be false, which is what
we want.
– ∀x.C(x) ⇒ B(x)
– ∃x.D(x) ∧ F (x)
4
– ∀x.P (x) ⇒ ¬B(x)
– ∃x.B(x) ∧ F (x)
• $∃ x. (tired(x) ∧ ∀ y. helpsMoveHouse(x,y))
– there is someone who will help anyone move despite being tired
5
3.1 Exercise 6: Haskell expression to Logic, compute value
• Note: using haskell’s builtin functions instead of equivalent Stdm ones
– ∀x ∈ {1, 2, 3}.x = 2
– False: counterexample is ‘1’
– ∃x ∈ {1, 2, 3}.x = 2
– True
• Convert to haskell
6
3.4 Exercise 8: Calculate values of expressions
• pxy means x = y + 1
• U = {1, 2}
• ∀x.(∃y.p(x, y))
• ∃x, y.p(x, y)
– (∃x.∃yp(x, y)
– ((∃y.p(1, y)) ∨ (∃x.p(2, y)) (by removing exists x)
– ((p(1, 1) ∨ p(1, 2)) ∨ (p(2, 1) ∨ p(2, 2))
– Since p(2, 1) is true, the whole expression is True
– (Haskell verification: any (\ x -> any (p x) [1,2]) [1,2] gives True)
• ∃x.(∀y.p(x, y))
• ∀x, y.p(x, y)
7
• If universe is finite, then the rules might not be necessary
– e.g. ∀x.F (x) could be replaced by F (x1 ), · · · F (xn ), n is the size of the universe
– But, propositional inference rules allow us to do deductions when the universe is
infinite
( + + ) : : [ a ] −> [ a ] −> [ a ]
[ ] ++ ys = ys
( x : xs ) ++ ys = x : ( xs ++ ys )
8
– E(x) ∨ ¬E(x) can be shown just by assuming either E(x) or ¬E(x) to be true
• Proof
• Problem is that we didn’t show that it works for an arbitrary natural number; we just
showed that it works for a particular one.
• If you have established a property for everything in the universe, you can assume it
holds for a particular element of the universe.
4.3.3 Example: ∀x.F (x) ⇒ G(x), ∀x.G(x) ⇒ H(x) ` ∀x.F (x) ⇒ H(x)
• By forall elimination, F (p) ⇒ G(p) for an arbitrary p
• Since this is for an arbitrary p, we can use forall introduction to get ∀x.F (x) ⇒
G(x), ∀x.G(x) ⇒ H(x) ` ∀x.F (x) ⇒ H(x)
9
4.3.4 Example: ∀x.∀y.F (x, y) ` ∀y.∀x.F (x, y)
• By forall elimination, we have ∀y.F (p, y) where p is arbitrary
• So, we have just shown that the order of forall quantifiers does not matter.
10
4.5 Existential Elimination
4.5.1 Definition
• Recall or elimination:
• If you have ∃x.F (x), F (c) ` A{carbitrary} then you can infer A
11
4.5.5 Exercise 11: Find a counterexample for: ∀y, ∃x.F (x, y) ` ∃x.∀yF (x, y)
• Let F (x, y) mean that x is greater than y
• Then, ∀y, ∃x.F (x, y) says that the natural numbers is unbounded, which is correct
• But, ∃x.∀y.F (x, y) says that there is some natural number that is larger than all others,
which is incorrect.
4.5.6 Exercise 12: Prove: ∀x, (F (x) ∧ G(x)) ` (∀xF (x)) ∧ (∀x.G(x))
• By forall elimination, we have F (c) ∧ G(c), c arbitrary
• Note that these are implications and only work in one direction
• ∃x.f (x)
12
5.4 Law: Combining Propositions
• In all of the following, q does not contain x as a variable
• Summary: we can push in propositions inside quantifiers if they don’t have the quan-
tified variable
13
5.7 Example: ∃x.(f (x) ⇒ g(x)) ∧ (∀x.f (x)) ⇒ ∃x.g(x)
• Direct proof starting from the left side
• Now, push the forall inside the exists to get ∃x.((f (x) ⇒ g(x)) ∧ ∀y.f (y))
6 Further Reading
• See references at end of chapter 6
7 Review Exercises
7.1 Exercise 13
7.1.1 Problem
• Universe has 10 elements
14
7.2 Exercise 14: Prove (∃f (x)) ∨ (∃g(x)) ` ∃x.(f (x) ∧ g(x))
• By exists elimination, we get f (c) for some c
• Since the existence of either x or y makes the whole statement true, we can combine
them to get ∃x.f (x) ∨ g(x)
7.3 Exercise 15: Prove (∀x.f (x)) ∨ (∀x.g(x)) ` ∀x(f (x) ∨ g(x))
• By forall elimination, we get f (c) for arbitrary c
• Since the above holds true for arbitrary c, by universal introduction, ∀x.(f (x) ∨ g(x))
• Provide counterexamples that show why the laws don’t hold in the opposite direction
15
– But on the right side we also claim that every number is even, and every number
is odd. Both of which are false.
• More concrete counterexample:
– Universe is: {Shrek, Donkey}
– f (x) means x = Shrek
– g(x) means x = Donkey
– Left Side:
– ∀x.(f (x) ∨ g(x))
– (f (Shrek) ∨ g(Shrek)) ∧ (f (Donkey) ∨ g(Donkey))
– (T rue ∨ F alse) ∧ (F alse ∨ T rue)
– T rue
– Right Side:
– (∀x.f (x)) ∨ (∀x.g(x))
– (f (Shrek) ∧ f (Donkey)) ∨ (g(Shrek) ∧ g(Donkey))
– (T rue ∧ F alse) ∨ (F alse ∧ T rue)
– F alse ∨ F alse = F alse
– So, we’re trying to do a T rue ⇒ F alse, which is F alse
• Counterexample for ∃x.f (x) ∧ ∃x.g(x) ⇒ ∃x.(f (x) ∧ g(x))
– Again using the Shrek, Donkey example
– Left side:
– ∃x.f (x) ∧ ∃x.g(x)
– (f (Shrek) ∨ f (Donkey)) ∧ (g(Shrek) ∨ g(Donkey))
– (T rue ∨ F alse) ∧ (F alse ∨ T rue)
– T rue
– Right side:
– ∃x.(f (x) ∧ g(x))
– (f (Shrek) ∧ g(Shrek)) ∨ (f (Donkey) ∧ g(Donkey))
– (T rue ∧ F alse) ∨ (F alse ∧ T rue)
– F alse ∨ F alse
– F alse
– So, we’re trying to do a T rue ⇒ F alse, which is F alse
7.6 TODO : Exercise 18: Prove (∀x.f (x) ⇒ h(x) ∧ ∀x.g(x) ⇒ h(x)) ⇒ ∀x.(f (x) ∨
g(x) ⇒ h(x))
• By using the laws on combining quantifiers, we can get ∀x.((f (x) ⇒ h(x))∧(g(x) ⇒ h(x))
• TODO: Now we need to do some kind of or elimination and combine.
16
7.7 Exercise 19
• Universe is natural numbers
• predicate: “if a number occurs in either of the sequences that are arguments to append,
it occurs in the final series as well”
17