MTH 225 Lecture-Module #03:
Predicates and Quantifers

actually simple propositions "P" and "Q" don't well express statements such as "x is positive"
    need to involve "x"
is a proposition with parameters
e.g.   P(x)   Q(x,y)
e.g. "P()" may represent "is positive"
then P(2) is , P(-8) is 

but how about P(green)? P(true)? ??
actually, just as need type-specifications for parameters of methods/functions in programming,
in logic, for predicates' variables, need to specify

which is the range of values considered for variables
e.g. real numbers
    or just integers
    or just whole numbers {1, 2, 3, ...}
        in which case P(x) would be always true -- for this choice of D



have a symbol expressing "true for all members of D":  
upside-down "A" (or "V" with a bar)

e.g. formulas "∀x P(x)", "∀x,y Q(x,y)"
or maybe "(∀x)[P(x)]", "(∀x,y)[Q(x,y)]"
I (and others) like parentheses more than Rosen (our textbook)

e.g. when "P()" represents "is positive",
the value of "(∀x)[P(x)]" is  if D is {1,2,3,...}
the value of "(∀x)[P(x)]" is  if D is real numbers

another perspective is that if D comprises values {v1v2v3, ...}
then  (∀x)[P(x)]  is equivalent to the following:
P(v1) /\ P(v2) /\ P(v3) /\ ...
e.g. if D is {1,2,5} then  (∀x)[P(x)]  is equivalent to the following:
P(1) /\ P(2) /\ P(5)

e.g. suppose D is the people in this room
and suppose H(x) means "has height less than 2 meters"
can write  (∀x)[H(x)]

another e.g. suppose D is the 13 named colors in Java
    Color.GREEN,  Color.BLACK,  Color.CYAN, ...
can write  (∀x)[if x != Color.BLACK then L(x)]
where "L(x)" means "has some light"



another property is whether some predicate holds for
at least one value
symbol for that is: ∃ (backward "E")

read/understood as "there exists", "for some"
e.g. "(∃x)[P(x)]"

e.g.:
suppose R(z) means "z*z == -1"
(∃z)[R(z)]  is  if D is {1,2,3,...}
but would be true if D were 

another e.g. suppose D is {0,1,2,3,...}
(∃x)[x < 3]  is 

can interpret existential quantification as follows:
if D comprises values {v1v2v3, ...}
then  (∃x)[P(x)]  is equivalent to the following:
    P(v1) \/ P(v2) \/ P(v3) \/ ...

another interpretation (Brad Manor):
existential quantification (forsome) means ">= 1"
i.e. "true for #elements >= 1"
and
universal quantification (forall) means "= D"
i.e. "true for #elements = the number of elements in D"



whenever want, can arbitrarily change name of existentially or universally quantified variable
same as with variable-name in a computer program
e.g.:
    for ( int i = 0; i < 8; i++ )  System.out.println(i);
        ⇔
    for ( int j = 0; j < 8; j++ )  System.out.println(j);

    (∀x)(∃y)[not R(x,y)]
        ⇔
    (∀z)(∃y)[not R(z,y)]

except shouldn't reuse a variable-name that's already being used
same as in a computer program
e.g.:
  for ( int i = 0; i < 8; i++ )
    for ( int k = 0; k < 5; k++ )
      System.out.println(i + ", " + k);

    ?⇔?

  for ( int i = 0; i < 8; i++ )
    for ( int i = 0; i < 5; i++ )
      System.out.println(i + ", " + i);


  (∀x)(∃y)[not R(x,y)]
    ?⇔?
  (∀x)(∃x)[not R(x,x)]

determining whether quantified formula is true/false

(i).
to show that  (∃x)[F(x)]  i.e.  (∃x)[F(x)]  has the value  true,
need to find a value v in domain D you can substitute for  x  in  F(x)
so that  F(x)  has the value  true
e.g. Exercise 36 in Section 1.3 of Johnsonbaugh:
    (∃x)(x > 1  →  x² > x)
can substitute  2  for  x  in the subformula, yielding:
    (2 > 1  →  2² > 2)
        ⇒
    (  →   > 2)
        ⇒
    (  →  )
        ⇒
    ()
and that's enough to show (... has the value  true
(even if it may be  false  for many other possible values for  x)
incidentally, could also substitute  -5  for  x  in the subformula, yielding:
    (-5 > 1  →  (-5)² > -5)
        ⇒
    (  →   > -5)
        ⇒
    (  →  )
        ⇒
    ()

(ii).
another relatively easy case:
to show that  (∀x)[F(x)]  i.e.  (∀x)[F(x)]  has the value  false,
need to find a value v in domain D you can substitute for  x  in  F(x)
so that  F(x)  has the value  false
such a value v called 
e.g. Exercise 33 in Section 1.3 of Johnsonbaugh:
    (∀x)(x² > x)
can substitute  0  for  x  in the subformula, yielding:
    (0² > 0)
        ⇒
    ( > 0)
        ⇒
    ()
and that's enough to show (... has the value  false
(even if it may be  true  for many other possible values for  x)
incidentally, could also substitute  ½  for  x  in the subformula, yielding:
    ((½)² > ½)
        ⇒
    ( > ½)
        ⇒
    ()

(iii).
to show that  (∀x)[F(x)]  i.e.  (∀x)[F(x)]  has the value  true,
need to somehow show that  F(x)  has the value  true
for every possible value of  x  in domain D

complicated... Hmm...

try this: say  a  is any arbitrary value from domain D
with no assumptions made about it
then try to show that  F(a)  is true

see a little below for examples

(iv).
similar hard case:
to show that  (∃x)[F(x)]  i.e.  (∃x)[F(x)]  has the value  false,
try this: say  a  is any arbitrary value from domain D
with no assumptions made about it
then try to show that  F(a)  is false

examples:
1.
(∀x)(∃y)[x < y]    with domain D := natural numbers N
                                {0, 1, 2, 3, ...}
this formula is universally quantified
i.e. its form is (∀x)[φ] i.e. (∀x)[φ]
with subformula φ being (∃y)[x < y]
anyway, do you think it's true or false? 
then as indicated above, proceed as follows:
say a is arbitrary value from domain D
and try to show that subformula φ with a plugged in for x
    (∃y)[a < y] a.k.a. (∃y)[a < y]
is true
how?

use  for this value
if we try this value, is [a < a + 1] true? yes, we know that!

incidentally, notice we made no assumptions about "a"


2.
(∀x)(∀y)[x < y] with domain D := natural numbers N
first, do you think it's true or false? 
how supposed to show (forall... formula is false?
note DON'T need to show subformula is false for every value
to show (forall... is false, just need to find one 
    value to plug in for variable making the subformula false
need counterexample value v for x making subformula (∀y)[v < y] false
try x := 4
next want (∀y)[4 < y] false
how show (∀y)[4 < y] false? counterexample y := 1
then check [4 < 1] false? yes it's false


3.
(∃x)(∀y)[x < y] with domain D := natural numbers N
first, do you think it's true or false? 
how supposed to show (forsome... i.e. (∃... formula is true?
need to just find one value to plug in for x making the subformula true
try x := 6
so next want (∀y)[6 < y] true
how are we going to do that?
supposed use symbol "a" (for any arbitrary value from domain)
    and show that [6 < a] is true
Houston, we have a problem
it's not going to happen

rethink: do you think (∃x)(∀y)[x < y] is true or false? 
so now try to show (∃x)(∀y)[x < y] is false
how show (forsome... i.e. (∃... formula is false?

so need to show that (∀y)[a < y] is false
how show (forall... formula is false? 
try y := 
check  [a < ]  false?  


4.
(∀y)(∃x)[x < y] with domain D := natural numbers N
                                                                {0, 1, 2, 3, ...}
first, do you think it's true or false? 
how show (∀y)[subformula] formula is true?
use symbol a which could be any arbitrary value from D
plug in y := a
and try to show subformula is true
so try to show (∃x)[x < a] is true
how show (∃x)[subformula] i.e. (∃x)[subformula] is true?
need to find just one value v in domain D making subformula true
potentially use value 0 / maybe can't do it?
    ? [0 < a] ?
there does appear to be a problem here...

let's try showing (∀y)(∃x)[x < y] is false
how show (∀y)[subformula] is false?

then need to show subformula which is "(∃x)[x < 0]" is false
how show (∃x)[subformula] i.e. (∃ x)subformula is false?

so need to show [a < 0] is false. how can we know this?
because our domain is {0,1,2,3,...} and it's general knowledge that
    [a < 0] is false when a is any one of those values





negations of quantifers

two main equivalences:
¬ (∀x)[F]  ⇔  (∃x)[¬ F]
¬ (∃x)[F]  ⇔  (∀x)[¬ F]
called "Generalized De Morgan's Laws"

e.g. suppose D is {0,1,2,3,...}
(incidentally rem. that's called the natural numbers, written "N")
suppose P(x) means "x is prime"
and E(x) means "x is even"
then:
"not (∀x)[P(x) or E(x)]"
represents the following English:
"It's not the case that for each value x in D,
either x is prime or x is even."

by the equivalences above, that formula is equivalent to the following:
"(∃x)(not [ P(x) or E(x) ])"
which in English would be interpreted as follows:
"There is a value x in D for which it's not true that
x is prime or x is even."

further, by an equivalence we saw earlier with rewritings,
the latter formula is equivalent to the following:
"(∃x)[ not P(x)  and  not E(x) ]"
which in English would be interpreted as follows:
"There is a value x in D for which
x is not prime and x is not even."

or suppose R(x,y) means "x is greater than y"
then "not (∃x)(∀y)[R(x,y)]" means:
"It's not the case that there exists a value x
such that for every value y,
x is greater than y."

by the equivalences here (above), that formula is equivalent to the following:
"(∀x)(not (∀y)[R(x,y)])"

by the equivalences here (above), that formula is equivalent to the following:
"(∀x)(∃y)[not R(x,y)]"
which says:
"For each value x in D,
there's a value y in D
for which it's not true that x is greater than y."

Is this formula (the original version of it or either of the equivalent formulas) true or false
when D comprises all the integers {..., -3, -2, -1, 0, 1, 2, 3, ... } (unlimited)?


What if R(x,y) means "x is greater than or equal to y"?
then English of formula is as follows:
"For each value x in D,
there's a value y in D
where it's not true that x is greater than or equal to y."


"(∀x)(∃y)[not R(x,y)]"

What if D is the range of int?


What if D is the range of double?


(Copyright © 2009 by Hugh McGuire   — for thoughts about this, see   http://www.cis.gvsu.edu/~mcguire/teaching/copyright_thoughts.html .)