Lecture 4
Lecture 4
1
Illegal Quantifications
Once a variable has been bound, we cannot bind it again. For
example the expression
x ( x P (x) )
is nonsensical.
The interior expression (x P (x)) bounded x already and
therefore made it unobservable to the outside.
Going back to our example, the English equivalent would be:
Everybody is an everybody is an octopus.
Let P (x) = “x is an octopus”
L4 2
Multivariate Quantification
Quantification involving only one variable is fairly
straightforward. Just a bunch of OR’s or a bunch of AND’s.
When two or more variables are involved each of which is bound
by a quantifier, the order of the binding is important and the
meaning often requires some thought.
L4 3
Parsing Example
A: True.
For any “exists” we need to find a positive instance.
Since x is the first variable in the expression and is
“existential”, we need a number that works for
all other y, z. Set x = 0 (want to ensure that y -x
is not too small).
Now for each y we need to find a positive instance z
such that y - x ≥ z holds. Plugging in x = 0 we
need to satisfy y ≥ z so set z := y.
L4 6
Parsing Example
L4 7
Multiple quantifiers
• You can have multiple quantifiers on a statement
• xy P(x, y)
– “For all x, there exists a y such that P(x,y)”
– Example: xy (x+y == 0)
• xy P(x,y)
– There exists an x such that for all y P(x,y) is true”
– xy (x*y == 0)
8
Order matters
Set the universe of discourse to be all natural numbers {0, 1, 2,
3, … }.
Let R (x,y ) = “x < y”.
Q1: What does x y R (x,y ) mean?
A1: x y R (x,y ):
“All numbers x admit a bigger number y ”
Q2: What does y x R (x,y ) mean?
A2: y x R (x,y ):
“Some number y is bigger than all x”
L4 9
Order matters
Q: What’s the true value of each expression?
A: x y R (x,y ) is true.
How: Just set y = x + 1
y x R (x,y ) is false
How: y is never bigger than itself, so setting x = y is a
counterexample
Q: What if we have two quantifiers of the same kind? Does
order still matter?
L4 10
Order matters –but not always
If we have two quantifiers of the same kind order is irrelevant.
x y is the same as y x because these are both interpreted
as “for every combination of x and y…”
x y is the same as y x because these are both interpreted
as “there is a pair x , y…”
L4 11
Negating multiple quantifiers
• Recall negation rules for single quantifiers:
– ¬x P(x) = x ¬P(x)
– ¬x P(x) = x ¬P(x)
– Essentially, you change the quantifier(s), and negate what
it’s quantifying
• Examples:
– ¬(xy P(x,y))
• = x ¬y P(x,y)
• = xy ¬P(x,y)
– ¬(xyz P(x,y,z))
• = x¬yz P(x,y,z)
• = x¬yz P(x,y,z)
• = xyz ¬P(x,y,z)
12
Negating multiple quantifiers 2
• Consider ¬(xy P(x,y)) = xy ¬P(x,y)
– The left side is saying “for all x, there exists a y such that P
is true”
– To disprove it (negate it), you need to show that “there
exists an x such that for all y, P is false”
• xy (x+y = y)
– There exists an additive identity for all real numbers
• xy (((x≥0) (y<0)) → (x-y > 0))
– A non-negative number minus a negative number is greater
than zero
• xy (((x≤0) (y≤0)) (x-y > 0))
– The difference between two non-positive numbers is not
necessarily non-positive (i.e. can be positive)
• xy (((x≠0) (y≠0)) ↔ (xy ≠ 0))
– The product of two non-zero numbers is non-zero if and
only if both factors are non-zero
15
Rosen, section 1.4 question 30
• Rewrite these statements so that the negations
only appear within the predicates
a) yx P(x,y)
yx P(x,y)
yx P(x,y)
b) xy P(x,y)
xy P(x,y)
xy P(x,y)
c) y (Q(y) x R(x,y))
y (Q(y) x R(x,y))
y (Q(y) (x R(x,y)))
y (Q(y) x R(x,y))
16
Rosen, section 1.4 question 31
• Express the negations of each of these statements so that
all negation symbols immediately precede predicates.
a) xyz T(x,y,z)
(xyz T(x,y,z))
xyz T(x,y,z)
xyz T(x,y,z)
xyz T(x,y,z)
xyz T(x,y,z)
b) xy P(x,y) xy Q(x,y)
(xy P(x,y) xy Q(x,y))
xy P(x,y) xy Q(x,y)
xy P(x,y) xy Q(x,y)
xy P(x,y) xy Q(x,y)
17