Semantic Entailment and Natural Deduction Alice Gao Lecture 6, September 26, 2017 Entailment 1/55
Learning goals Semantic entailment Define semantic entailment. Explain subtleties of semantic entailment. Determine whether a semantic entailment holds by using truth tables, valuation trees, and/or logical identities. Prove semantic entailment using truth tables and/or valuation trees. Natural deduction in propositional logic Describe rules of inference for natural deduction. Prove a conclusion from given premises using natural deduction inference rules. Describe strategies for applying each inference rule when proving a conclusion formula using natural deduction. Entailment 2/55
A review of the conditional Consider the formulas and. The following two statements are equivalent: for any truth valuation, if is true, then is true. is a tautology. Entailment 3/55
Subtleties about the conditional Consider the formulas and. How many of the following statements are true? a. If is false, then is true. b. If and, then is false. c. If is a tautology, then is true. d. Two of (a), (b), and (c) are true. e. All of (a), (b), and (c) are true. Entailment 4/55
Proving arguments valid Recall that logic is the science of reasoning. One important goal of logic is to infer that a conclusion is true based on a set of premises. A logical argument: Premise 1 Premise 2... Premise n Conclusion A common problem is to prove that an argument is valid, that is the set of premises semantically entails the conclusion. Entailment 5/55
Formalizing argument validity: Semantic Entailment Let be a set of premises and let be the conclusion that we want to derive. semantically entails, denoted, if and only if Whenever all the premises in are true, then the conclusion is true. For any truth valuation, if every premise in is true under, then the conclusion is true under. For any truth valuation, if satisfies (denoted T), then satisfies ( T). is a tautology. If semantically entails, then we say that the argument (with the premises in and the conclusion ) is valid. What does T ( satisfies ) mean? See the next slide. Entailment 6/55
What does T mean? T ( satisfies ) means... Every formula in is true under the valuation. If a formula is in, then is true under. If is the empty set, then any valuation satisfies. Why? The definition of satisfies says If a formula is in, then is true under. There is no formula in, so the premise of the above statement is false, which means the statement is vacuously true. Thus, any valuation satisfies the empty set. Entailment 7/55
Subtleties about entailment Consider a set of formulas and the formula. How many of the following statements are true? a. If in is false, then is false. b. If, then is true. c. If is true, then is a tautology ( is the empty set). d. Two of (a), (b), and (c) are true. e. All of (a), (b), and (c) are true. Entailment 8/55
Proving or disproving entailment Proving that entails, denoted : Using a truth table: Consider all rows of the truth table in which all of the formulas in are true. Verify that is true in all of these rows. Direct proof: For every truth valuation under which all of the premises are true, show that the conclusion is also true under this valuation. Proof by contradiction: Assume that the entailment does not hold, which means that there is a truth valuation under which all of the premises are true and the conclusion is false. Derive a contradiction. Proving that does not entail, denoted : Find one truth valuation under which all of the premises in are true and the conclusion is false. Entailment 9/55
Proving entailment using a truth table Let,, and. Based on the truth table, which of the following statements is true? a. and. b. and. c. and. d. and. 0 0 1 1 1 1 0 1 1 1 1 0 1 0 1 0 0 0 1 1 0 1 0 1 Entailment 10/55
Proving entailment What is? a. True b. False 0 0 1 0 1 0 1 1 0 0 1 0 1 0 0 1 1 0 1 1 Entailment 11/55
Equivalence and Entailment Equivalence can be expressed using the notion of entailment. Lemma. if and only if both and. Entailment 12/55
Proofs in Propositional Logic: Natural Deduction Natural Deduction 13/55
Solution to the previous puzzle A very special island is inhabited only by knights and knaves. Knights always tell the truth, and knaves always lie. You meet three inhabitants: Alice, Rex and Bob. 1. Alice says, Rex is a knave. This means Alice and Rex are different. 2. Rex says, it s false that Bob is a knave (or Bob is a knight). This means Rex and Bob are the same. 3. Bob claims, I am a knight or Alice is a knight. Bob is a knight, or Bob and Alice are both knaves. Based on 1 and 2, Alice and Bob are different, so they cannot both be knaves (2nd option in 3). Thus, the only possibility left is Alice is a knave, and Rex and Bob are knights. Natural Deduction Overview 14/55
Labyrinth Puzzle Natural Deduction Overview 15/55
Learning goals Natural deduction in propositional logic Describe rules of inference for natural deduction. Prove a conclusion from given premises using natural deduction inference rules. Describe strategies for applying each inference rule when proving a conclusion formula using natural deduction. Natural Deduction Overview 16/55
The Natural Deduction Proof System We will consider a proof system called Natural Deduction. It closely follows how people (mathematicians, at least) normally make formal arguments. It extends easily to more-powerful forms of logic. Natural Deduction Overview 17/55
Why would you want to study natural deduction proofs? It is impressive to be able to write proofs with nested boxes and mysterious symbols as justifications. Be able to prove or disprove that Superman exists (on Tuesday). Be able to prove or disprove that the onnagata are correct to insist that males should play female characters in Japanese kabuki theatres. To realize that writing proofs and problem solving in general is both a creative and a scientific endeavour. To develop problem solving strategies that can be used in many other situations. Natural Deduction Overview 18/55
A proof is syntactic First, we think about proofs in a purely syntactic way. A proof starts with a set of premises, transforms the premises based on a set of inference rules (by pattern matching), and reaches a conclusion. We write ND or simply if we can find such a proof that starts with a set of premises and ends with the conclusion. Natural Deduction Overview 19/55
Goal is to show semantic entailment Next, we think about connecting proofs to semantic entailment. We will answer these questions: (Soundness) Does every proof establish a semantic entailment? If I can find a proof from to, can I conclude that semantically entails? Does imply? (Completeness) For every semantic entailment, can I find a proof for it? If I know that semantically entails, can I find a proof from to? Does imply? Natural Deduction Overview 20/55
Reflexivity / Premise If you want to write down a previous formula in the proof again, you can do it by reflexivity. Name -notation inference notation Reflexivity, or Premise The notation on the right: Given the formulas above the line, we can infer the formula below the line. The version in the center reminds us of the role of assumptions in Natural Deduction. Other rules will make more use of it. Natural Deduction Basic Rules 21/55
An example using reflexivity Here is a proof of. 1. Premise 2. Premise 3. Reflexivity: 1 Alternatively, we could simply write and be done. 1. Premise Natural Deduction Basic Rules 22/55
For each symbol, the rules come in pairs. An introduction rule adds the symbol to the formula. An elimination rule removes the symbol from the formula. Natural Deduction Basic Rules 23/55
Rules for Conjunction Name -notation inference notation -introduction ( i) If and, then Name -notation inference notation -elimination ( e) If, then and Natural Deduction Conjunction Rules 24/55
Example: Conjunction Rules Example. Show that. 1. Premise 2. e: 1 3. e: 1 4. i: 2, 3 Natural Deduction Conjunction Rules 25/55
Example: Conjunction Rules (2) Example. Show that,. 1. Premise 2. Premise 3. e: 1 4. i: 3, 2 Natural Deduction Conjunction Rules 26/55
Rules for Implication: e Name -notation inference notation -elimination ( e) (modus ponens) If and, then In words: If you assume is true and implies, then you may conclude. Natural Deduction Implication Rules 27/55
Rules for Implication: i Name -notation inference notation -introduction ( i) If, then. The box denotes a sub-proof. In the sub-proof, we starts by assuming that is true (a premise of the sub-proof), and we conclude that is true. Nothing inside the sub-proof may come out. Outside of the sub-proof, we could only use the sub-proof as a whole. Natural Deduction Implication Rules 28/55
Example: Rule i and sub-proofs Example. Give a proof of. To start, we write down the premises at the beginning, and the conclusion at the end. What next? 1. Premise 2. Premise 3. Assumption 4. e: 1, 3 5. e: 2, 4 6.??? The goal contains. Let s try rule i. Inside the sub-proof, we can use rule e. Done! Natural Deduction Implication Rules 29/55
Rules of Disjunction: i and e Name -notation inference notation -introduction ( i) -elimination ( e) If, then and If, and,, then, e is also known as proof by cases... Natural Deduction Disjunction Rules 30/55
Example: Or-Introduction and -Elimination Example: Show that. 1. Premise 2. Assumption 3. Assumption 4. Reflexivity: 2 5. i: 3 4 6. i: 5 7. Assumption 8. Assumption 9. Reflexivity: 7 10. i: 8 9 11. i: 10 12. e: 1, 2 6, 7 11 Natural Deduction Disjunction Rules 31/55
Negation We shall treat negation by considering contradictions. We shall use the notation to represent any contradiction. It may appear in proofs as if it were a formula. The elimination rule for negation: Name -notation inference notation -introduction, or -elimination ( e),, If we have both and, then we have a contradiction. Natural Deduction Negation 32/55
Negation Introduction ( i) If an assumption leads to a contradiction, then derive. Name -notation inference notation -introduction ( i) If, then. Natural Deduction Negation 33/55
Example: Negation Example. Show that. 1. Premise 2. Assumption 3. e: 1, 2 4. e: 2, 3 5. i: 2 4 Natural Deduction Negation 34/55
The Last Two Basic Rules Double-Negation Elimination: Name -notation inference notation -elimination ( e) If, then Contradiction Elimination: Name -notation inference notation -elimination ( e) If, then Natural Deduction Negation 35/55
A Redundant Rule The rule of -elimination is not actually needed. Suppose a proof has 27. some rule 28. e: 27. We can replace these by 27. some rule 28. Assumption 29. Reflexivity: 27 30. i: 28 29 31. e: 30. Thus any proof that uses e can be modified into a proof that does not. Natural Deduction Negation 36/55
Example: Modus tollens The principle of modus tollens:. 1. Premise 2. Premise 3. Assumption 4. e: 3, 1 5. e: 2, 4 6.?? Modus tollens is sometimes taken as a derived rule : MT Natural Deduction Negation 37/55
Derived Rules Whenever we have a proof of the form, we can consider it as a derived rule: If we use this in a proof, it can be replaced by the original proof of. The result is a proof using only the basic rules. Using derived rules does not expand the things that can be proved. But they can make it easier to find a proof. Natural Deduction Negation 38/55
Strategies for natural deduction proofs 1. Work forward from the premises. Can you apply an elimination rule? 2. Work backwards from the conclusion. What introduction rule do you need to use at the end? 3. Stare at the formula. Notice its structure. Use it to guide your proof. 4. If a direct proof doesn t work, try a proof by contradiction. Natural Deduction Additional Examples and Techniques 39/55
Further Examples of Natural Deduction Example. Show that. In the sub-proof, try -elimination on the assumption (step 2). 1. Premise 2. Assumption 3. Assumption 4. i: 3 5. Assumption 6. e: 5, 1 7. i: 6 8. e: 2, 3 4, 5 7 9. i: 2 8 Natural Deduction Additional Examples and Techniques 40/55
Life s Not Always So Easy Example. Show that. 1. Assumption 2. No elimination applies. 3. 4.????? 5. No connective. 6. Try i Time to try something ingenious. Natural Deduction Additional Examples and Techniques 41/55
Some Common Derived Rules Proof by contradiction (reductio ad absurdum): if, then. The Law of Excluded Middle (tertiam non datur):. Double-Negation Introduction: if then. You can try to prove these yourself, as exercises. (Hint: in the first two, the last step uses rule e:.) Or see pages 24 26 of Huth and Ryan. Natural Deduction Additional Examples and Techniques 42/55
Soundness and Completeness of Natural Deduction for Propositional Logic Natural Deduction Soundness and Completeness 43/55
Soundness and Completeness of Natural Deduction We want to prove that Natural Deduction is both sound and complete. Soundness of Natural Deduction means that the conclusion of a proof is always a logical consequence of the premises. That is, If ND, then. Completeness of Natural Deduction means that all logical consequences in propositional logic are provable in Natural Deduction. That is, If, then ND. Natural Deduction Soundness and Completeness 44/55
Proof of Soundness To prove soundness, we use induction on the length of the proof: For all deductions which have a proof of length or less, it is the case that. That property, however, is not quite good enough to carry out the induction. We actually use the following property of a natural number. Suppose that a formula appears at line of a partial deduction, which may have one or more open sub-proofs. Let be the set of premises used and be the set of assumptions of open sub-proofs. Then. Natural Deduction Soundness and Completeness 45/55
Basis of the Induction Base case. The shortest deductions have length 1, and thus are either 1. Premise. or 1. Assumption. 2. We have either (in the first case), or (in the second case). Thus, as required. Natural Deduction Soundness and Completeness 46/55
Proof of Soundness: Inductive Step Inductive step. Hypothesis: the property holds for each ; that is, If some formula appears at line or earlier of some partial deduction, with premises and un-closed assumptions, then. To prove: if appears at line, then (where when is an assumption, and otherwise). The case that is an assumption is trivial. Otherwise, formula must have a justification by some rule. We shall consider each possible rule. Natural Deduction Soundness and Completeness 47/55
Inductive Step, Case I Case I: was justified by i. We must have, where each of and appear earlier in the proof, at steps and, respectively. Also, any sub-proof open at step or is still open at step. Thus the induction hypothesis applies to both; that is, and. By the definition of, this yields, as required. Natural Deduction Soundness and Completeness 48/55
Inductive Step, Case II Case II: was justified by i. Rule i requires that and there is a closed sub-proof with assumption and conclusion, ending by step. Also, any sub-proof open before the assumption of is still open at step. The induction hypothesis thus implies. Hence, as required. Natural Deduction Soundness and Completeness 49/55
Inductive Step, Cases III ff. Case III: was justified by e. This requires that be the pseudo-formula, and that the proof contain formulas and for some, each using at most steps. By the induction hypothesis, both and. Thus is contradictory, and for any. Cases IV XIII: The other cases follow by similar reasoning. This completes the inductive step, and the proof of soundness. Natural Deduction Soundness and Completeness 50/55
Completeness of Natural Deduction We now turn to completeness. Recall that completeness means the following. Let be a set of formulas and be a formula. If, then. That is, every consequence has a proof. How can we prove this? Natural Deduction Proof of Completeness 51/55
Proof of Completeness: Getting started We shall assume that the set of hypotheses is finite. The theorem is also true for infinite sets of hypotheses, but that requires a completely different proof. Suppose that, where. Thus the formula is a tautology. Lemma. Every tautology is provable in Natural Deduction. Once we prove the Lemma, the result follows. Given a proof of, one can use i and e to complete a proof of. Natural Deduction Proof of Completeness 52/55
Tautologies Have Proofs For a tautology, every line of its truth table ends with T. We can mimic the construction of a truth table using inferences in Natural Deduction. Claim. Let have variables. Let be a valuation, and define as if T if F If T, then, and if F, then. To prove the claim, use structural induction on formulas (which is induction on the column number of the truth table). Once the claim is proven, we can prove a tautology as follows. Natural Deduction Proof of Completeness 53/55
Outline of the Proof of a Tautology 1. L.E.M. 2. L.E.M.. L.E.M. 1. assumption assumption assumption. e: 2, 1. assumption e:,. e: 1,, Once each variable is assumed true or false, the previous claim provides a proof. Natural Deduction Proof of Completeness 54/55
Proving the Claim Hypothesis: the following hold for formulas and : If, then ; If, then ; If, then ; and If, then. If, put the two proofs of and together, and then infer, by i. If (i.e., and ), Prove and. Assume ; from it, conclude ( e) and then ( e). From the sub-proof, conclude, by i. The other cases are similar. Natural Deduction Proof of Completeness 55/55