Lecture 03
Lecture 03
Lecture 03
Logic
Logic:
Logic
a formal game played with symbols which turns out to be useful for modeling mathematical reasoning. a formal game played with symbols which turns out to be useful for modeling the world.
Math:
Compound sentence
Potassium is not observed. At least one of hydrogen and potassium is observed. If potassium is observed then hydrogen is also observed.
If Im not playing tennis then Im watching tennis, and if Im not watching tennis then Im reading about tennis.
(kh)
((pw)(wr))
( ) x1 , x2 , x 3 ,
(punctuation) (punctuation) (not) (and) (or) (implies) (if and only if) (variable symbols)
Inductive rules: If A is a WFF, so is A . If A, B are WFFs, so are (AB) , (AB) , (AB) , (AB) .
If potassium is observed then carbon and hydrogen are also observed. (k(ch))
If potassium is observed then carbon and hydrogen are also observed. (k(ch)) Whether this statement/formula is true/false depends on whether the variables are true/false (state of the world). If k is T, c is T, h is F If k is F, c is F, h is T the formula is False. the formula is True.
Satisfiability
satisfies S: V [S] = T S is satisfiable: there exists V such that V [S] = T S is unsatisfiable: V [S] = F for all V S is a tautology: V [S] = T for all V
S = ((x(yz))((xy)z))
Tautology: automatically true, for purely logical reasons Truth table
x
F F F F T T T T
y
F F T T F F T T
z
F T F T F T F T
((x(yz))((xy)z))
S = ((x(yz))((xy)z))
Truth table
x
F F F F T T T T
S = ((x(yz))((xy)z))
Truth table
x
F F F F T T T T
y
F F T T F F T T
z
F T F T F T F T
((x(yz))((xy)z))
T
y
F F T T F F T T
z
F T F T F T F T
((x(yz))((xy)z))
T T T T T T T T
S is satisfiable!
S is a tautology!
Conjectures:
There is no polynomial time algorithm that works for every formula. There is no O(1.999n) time algorithm that works for every formula.
Russell?
Wittgenstein?
Post?
Peirce?
ukasiewicz?
Jevons?
LaddFranklin?
Logical Equivalence
Definition: Formulas S and T are equivalent, written S T, if V[S] = V[T] for all truth-assignments V. I.e., their truth tables are exactly the same.
Example equivalences
(xy) (xy) (AB) (AB) AB (AB) AB ((AB)(BA)) A A (AB) (BA) ((AB)C) (A(BC)) remark: so its okay to write (ABC) AA A ((AB)C) ((AC)(BC)) etc.
Problem: Show (((xy)x)y) is a tautology. Solution 1: Truth-table method Solution 2: Use equivalences: = (((xy)x)y) (using AB AB ((xy)x)y (using (AB) AB ((xy)x)y (using (AB)C A(BC) (xy)(xy) (using AB AB (xy)(xy) SS, where S = (xy).
Logical entailment
Is S a tautology? moderately interesting
) ) ) )
Logical entailment
Definition: Formulas A1, , Am entail formula S, written A1, , Am S, if every truth-assignment V which makes A1, , Am equal T also makes S equal T. S is a logical consequence of A1, , Am.
Entailment examples
x, y (xy) A, B (AB) for any BA (AB) for any B A, AB B AB, BC AC Ax, Bx AB etc. fact: iff A1, , Am S (A1Am)S is a tautology
Alex is smarter than everyone: x IsSmarter(a,x) variable: stands for an object (person)
constant name: stands for a particular object relation name: stands for a mapping, object(s) T/F
Alex is smarter than everyone: x IsSmarter(a,x) Alex is smarter than everyone else: x ((x=a)IsSmarter(a,x))
Alex is smarter than everyone: x IsSmarter(a,x) Alex is smarter than everyone else: x ((x=a)IsSmarter(a,x)) Alexs father is smarter than everyone elses father: x ((x=a)IsSmarter(Father(a),Father(x))) function name: stands for a mapping, object(s) object
Vocabulary: A collection of constant-names, function-names, relation-names. Vocabulary from the previous slide: one constant-name: one function-name: one relation-name: a Father() IsSmarter(, )
Vocabulary: A collection of constant-names, function-names, relation-names. Another example of a vocabulary: one constant-name: two function-names: one relation-name: a Next(), Combine(, ) IsPrior(, )
x (Next(x)=Combine(a,a))
Q: Is this sentence true? A: The question does not make sense.
Whether or not this sentence is true depends on the interpretation of the vocabulary. Interpretation: Informally, says what objects are and what the vocabulary means.
x (Next(x)=Combine(a,a))
Q: Is this sentence true? A: The question does not make sense. Whether or not this sentence is true depends on the interpretation of the vocabulary. Interpretation: Specifies a nonempty set (universe) of objects. Maps each constant-name to a specific object. Maps each relation-name to an actual relation. Maps each function-name to an actual function.
x (Next(x)=Combine(a,a))
Interpretation #1:
Universe = all strings of 0s and 1s a = 1001 Next(x) = x0 Combine(x,y) = xy IsPrior(x,y) = True iff x is a prefix of y
False
x (Next(x)=Combine(a,a))
Interpretation #2:
Universe = integers a=0 Next(x) = x+1 Combine(x,y) = x+y IsPrior(x,y) = True iff x < y
x (Next(x)=Combine(a,a))
Interpretation #2:
Universe = natural numbers a=0 Next(x) = x+1 Combine(x,y) = x+y IsPrior(x,y) = True iff x < y
True
False
Satisfiability / Tautology
Interpretation I satisfies sentence S: I [S] = T S is satisfiable: there exists I such that I [S] = T S is unsatisfiable: I [S] = F for all I S is a tautology: I [S] = T for all I
satisfiable
Tautology: automatically true, for purely logical reasons Unsatisfiable: automatically false, for purely logical reasons Satisfiable (but not a tautology): truth value depends on the interpretation of the vocabulary
(y x (x=Next(y))) (w z (w=z))
Problem 1: Show this is satisfiable. Lets pick this interpretation: Universe = integers, Next(y) = y+1. Now (y x (x=Next(y))) means theres an integer y such that every integer = y+1. Thats False! So the whole sentence becomes True. Hence the sentence is satisfiable.
(y x (x=Next(y))) (w z (w=z))
Problem 2: Is it a tautology?
(y x (x=Next(y))) (w z (w=z))
Problem 2: Is it a tautology? Solution: Yes, it is a tautology!
There is no truth table method. You cant enumerate all possible interpretations! It seems like you have to use some cleverness
Proof: Let I be any interpretation. If I [y x (x=Next(y))] = F, then the sentence is True. If I [y x (x=Next(y))] = T, then every object equals Next(y). In that case, I [w z (w=z)] = T. So no matter what, I [the sentence] = T.
(y x (x=Next(y))) (w z (w=z))
Problem 2: Is it a tautology?
Checking tautologies
Hmm Its really a shame that theres no truth table method. Is there any mechanical method?? Gottlob Frege
&
A fixed set of rules for deducing new tautologies from known tautologies.
A, E.g.,
A B B
Checking tautologies
Open almost any textbook on logic. Page 1 will have some Deductive Calculus, like: Base Case tautologies / tautology families:
1. AA is a 1st order tautology for any sentence A 2. In fact, given any tautology in propositional logic, you can replace its variables with sentences to get a 1st order tautology 3. x y ((x=ay=b)(Func(x,y)=Func(a,b))) 4. IsR(a)(x IsR(x)) 5. blah blah blah, a bunch more obviously tautological kinds of sentences
Easy claim: anything deducible is indeed a 1st order tautology. Question: is every tautology deducible?
Kurt Gdel
Deduction rule:
Checking tautologies
Consequence: There is a purely mechanical (algorithmic) way to verify that a given S is a tautology. Just brute-force search for the shortest proof in Deductive Calculus!
Logical entailment
Is S a tautology of 1st order logic? moderately interesting Assuming axioms A1, , Am, is S a logical consequence (theorem)?
Logical entailment
Definition: Formulas A1, , Am entail formula S, written A1, , Am S, if every interpretation I which makes A1, , Am equal T also makes S equal T. Equivalently, (A1Am)S is a tautology.
Euclid
5. If a straight line falling on two straight lines make the interior angles on the same side less than two right angles, the two straight lines, if produced indefinitely, meet on that side on which are the angles less than the two right angles.
Alfred Tarski He did it right. In his interpretation, universe is the points of R2.
none
IsBetween(x,y,z) IsSameLength(x1,x2,y1,y2)
10
Example 2: Arithmetic of
constant-name: function-names: axioms: 0 Successor(x) Plus(x,y) Times(x,y)
Example 2: Arithmetic of
Question: How complete are those 7 axioms? Answer based on 125 years of experience: Pretty darn complete. Almost all true statements about arithmetic can be deduced from them.
Four-Square Theorem, Prime Number Theorem, FLT (?)
Giuseppe Peano x (Successor(x)=0) x y (Successor(x)=Successor(y))(x=y) x Plus(x,0)=x x y Plus(x,Successor(y))=Successor(Plus(x,y)) x Times(x,0)=0 x y Times(x,Successor(y))=Plus(Times(x,y),x) Induction: For any parameterized formula F(x), (F(0)(x F(x)F(Successor(x)))) x F(x)
We do know one or two tricky theorems which Peanos axioms dont entail (see Lec. 24)
propositional logic: meaning of WFFs truth assignments tautology/satisfiable truth-table method equivalences entailment
Study Guide
11