Lecture 4.

We've now covered a collection of logical connectives, logical equivalences, and started to talk about quantification (although we've been a little bit loose in how we define the set over which we are quantifying. See the book for more discussion of the "universe of discourse").

Let's practice writing out expressions for some things that might be useful later this semester.

  1. how can we express that a number a is prime?
    prime(a) = ~(exists b) (exists c) (a = b*c) ^ (b>1) ^ (c>1) ^ (a>1), with (domain is the integers)
  2. How can we express that there are an infinite number of prime numbers?
  3. ~ (exist) x (prime(x) ^ (forall) y, x>y)
    ( later we will prove this )
  4. What about the sentence. "There is a unique password to professor pless's computer"
    what is a reasonable universe of discourse?
  5. How can we express the "There is a unique x, P(x)" using quantifiers?
    exists(x) P(x) and forall(y) (x = y) or ~P(y)
These quantifiers also give us the ability to express some of the most interesting mathematical questions ever posed:
  1. Fermat's last theorem:
    not (exist) a (exist)b (exist)c (exist) n such that a,b,c>0 n>2 and a^n + b^n = c^n
  2. irrational numbers:
    (exist) x in R (forall) a in Z (forall) b in Z not (x = a/b) ( we will soon prove that square root of 2 is one of these numbers ).
  3. Halting problem:
    H(p,x) program P stops when given input x.
  4. Goldbach's Conjecture: all positive even number > 4 are sum of two primes
    forall(n>=2) (exist prime a,b) a+b=2n
    (not known to be true, strongly believed to be true. Best formal proof: "Every even number can be written as the sum of not more than 300,000 primes", Schnirelman, 1939. try to quantify that!!)

    Rules of inference.

    So far, we've defined propositions, defined how to make compound expressions with connectives, talked about how to find logically equivalent propositions, and talked about quantifying statements so that we can make statements abot things that are true for all elements of a set.

    ALL of these, don't really let you DO anything --- you are either writing down formally some fact, or translating one way of representing a particular formula with another way of representing the formula. The next bit starts to get more exciting. Suppose you have a list of facts. Perhaps you can determine that some new fact, which is NOT logically equivalent to the given list, must be true (if the whole list is true). This is called an argument.

    A "argument" can be written as follows:

    P
    Q
    R
    -----
    S
    

    Where P, Q, R (and perhaps more) are called "Hypothesis". and S is the conclusion.

    If (P^Q^R) --> S is a tautology, then this is a valid argument.

    Proving that an argument is valid can be done using logical equivalences and "rules of inference" which are themselves simple arguments.

    You can also prove an argument is valid using truth tables. How?

    So lets introduce the rules of inference. (Page 58 from the book)

    Rules:
    p
    ---
    p v q        addition
    
    p^q
    ---
    p            simplification
    
    p          
    q
    ---
    p^q         conjunction
    
    p
    p --> q
    -------
    q           modus ponens
    
    ~q
    p --> q
    -------
    ~p          modus tollens.           (prove this one, use contrapositive, MP)
    
    p --> q
    q --> r
    -------
    p --> r     hypothetical syllogism   (prove this one)
    
    p v q
    ~p
    -----
    q           disjunctive syllogism
    
    p v q
    ~p v r
    -----
    q v r       Resolution               (Core of many automated reasoning systems)
    
    but we can prove it without resolution...
    
    p v q   == ~p --> q                 using implies rule:  
    ~p v r  == r v ~p == ~r --> ~p   using commutative and implies.
    ~r --> ~p ^ ~p --> q == ~r --> q == r v q  using hypothetical syllogism...
    
    

    many examples in the book, but ignore the ENGLISH. Instead of trying to PROVE silly english sentences, think of this as a game:

    GIVEN a bag of facts, and a GOAL sentence
      and 
    USING a set of rules that let you combine and rewrite the facts,
    
    MAKE a series of steps that lets you write down the GOAL.
    
    Lets do some samples:
    
    ~p ^ q
    r --> p
    ~r --> s
    s --> t
    ----------
    t
    
    MUST WORK FORWARD.  (but maybe you should think backwards...)
    
    p --> q
    ~p --> r
    r --> s
    ----------
    ~q --> s
    
    
    p v q
    ~p v r
    --------
    q v r
    
    
    

    FALLACIES...

    argument form [(p --> q) ^  q] -->  p
                   (p --> q) ^ ~p] --> ~q
    
      are not valid arguments.  But one uses them all the time...
    
    "you said if you do the problem right then you get credit, but my
    friend got the problem wrong and they got credit and that's WRONG".
    
    
    Interviewer: "Your resume looks impressive but I need another reference."  
    Bill: "Jill can give me a good reference."  
    Interviewer: "Good. But how do I know that Jill is trustworthy?"  
    Bill: "Certainly. I can vouch for her."
    
    as well as any argument where you assume something false!
    
    An example of why absurd conclusions are bad things: 
    
    Bertrand Russell, in a lecture on logic, mentioned that in the sense
    of material implication, a false proposition implies any
    proposition. A student raised his hand and said "In that case, given
    that 1 = 0, prove that you are the Pope". Russell immediately replied,
    "Add 1 to both sides of the equation: then we have 2 = 1. The set
    containing just me and the Pope has 2 members. But 2 = 1, so it has
    only 1 member; therefore, I am the Pope."