Survey
* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project
Review Name Modus ponens CS311H: Discrete Mathematics Modus tollens Inference Rules for Quantifiers Hypothetical syllogism Or introduction Işıl Dillig Or elimination And introduction And elimination Resolution Işıl Dillig, CS311H: Discrete Mathematics Inference Rules for Quantifiers 1/30 Işıl Dillig, Example CS311H: Discrete Mathematics 1. It is not raining or Kate has her umbrella ¬φ1 φ1 → φ2 φ2 → φ3 φ1 → φ3 φ1 φ1 ∨ φ2 φ1 ∨ φ2 ¬φ2 φ1 φ1 φ2 φ1 ∧ φ2 φ1 ∧ φ2 φ1 φ1 ∨ φ2 ¬φ1 ∨ φ3 φ2 ∨ φ3 Inference Rules for Quantifiers I First, encode hypotheses and conclusion as logical formulas. I To do this, identify propositions used in the argument: 2. Kate does not have her umbrella or she does not get wet I r = ”It is raining” 3. It is raining or Kate does not get wet I u= ”Kate has her umbrella” 4. Kate is grumpy only if she is wet I w = ”Kate is wet” I g = ”Kate is grumpy” Show these lead to the conclusion: ”Kate is not grumpy.” CS311H: Discrete Mathematics Inference Rules for Quantifiers 3/30 Işıl Dillig, Encoding in Logic, cont. Işıl Dillig, φ2 φ1 → φ2 ¬φ2 2/30 Encoding in Logic Assume the following hypotheses: Işıl Dillig, Rule of Inference φ1 φ1 → φ2 Inference Rules for Quantifiers 4/30 Formal Proof Using Inference Rules I ”It is not raining or Kate has her umbrella.” I ”Kate does not have her umbrella or she does not get wet” I ”It is raining or Kate does not get wet.” I ” Kate is grumpy only if she is wet.” I Conclusion: ”Kate is not grumpy.” CS311H: Discrete Mathematics CS311H: Discrete Mathematics Inference Rules for Quantifiers 1. 2. 3. 4. 5/30 Işıl Dillig, 1 ¬r ∨ u ¬u ∨ ¬w r ∨ ¬w g →w Hypothesis Hypothesis Hypothesis Hypothesis CS311H: Discrete Mathematics Inference Rules for Quantifiers 6/30 Additional Inference Rules for Quantified Formulas Universal Instantiation I Inference rules we learned so far are sufficient for reasoning about quantifier-free statements I If we know something is true for all members of a group, we can conclude it is also true for a specific member of this group I Four more inference rules for making deductions from quantified formulas I This idea is formally called universal instantiation: I These come in pairs for each quantifier (universal/existential) I One is called generalization, the other one called instantiation Işıl Dillig, CS311H: Discrete Mathematics Inference Rules for Quantifiers ∀x .P (x ) (for any c) P (c) 7/30 Işıl Dillig, Example I CS311H: Discrete Mathematics Inference Rules for Quantifiers 8/30 Universal Generalization Consider predicates man(x) and mortal(x) and the hypotheses: 1. All men are mortal: I Suppose we can prove a claim for an arbitrary element in the domain. I Since we’ve made no assumptions about this element, proof should apply to all elements in the domain. I This correct reasoning is captured by universal generalization 2. Socrates is a man: I Using rules of inference, prove mortal(Socrates) Işıl Dillig, CS311H: Discrete Mathematics Inference Rules for Quantifiers P (c) for arbitrary c ∀x .P (x ) Işıl Dillig, 9/30 Example CS311H: Discrete Mathematics Inference Rules for Quantifiers 10/30 Caveat About Universal Generalization Prove ∀x .Q(x ) from the hypotheses: I When using universal generalization, need to ensure that c is truly arbitrary! I If you prove something about a specific person Mary, you cannot make generalizations about all people I In a proof, this means c must be a fresh name not used previously 1. 2. 3. 4. 5. __________________________________ 6. Işıl Dillig, CS311H: Discrete Mathematics Inference Rules for Quantifiers Işıl Dillig, 11/30 2 CS311H: Discrete Mathematics Inference Rules for Quantifiers 12/30 Existential Instantiation Example Using Existential Instantiation I Consider formula ∃x .P (x ). I We know there is some element, say c, in the domain for which P (c) is true. I This is called existential instantiation: Consider the hypotheses ∃x .P (x ) and ∀x .¬P (x ). Prove that we can derive a contradiction (i.e., false) from these hypotheses. 1. 2. 3. 4. 5. 6. ∃x .P (x ) (for unused c) P (c) I Here, c is a fresh name (i.e., not used before in proof). I Hypothesis Hypothesis Otherwise, can prove non-sensical things such as: ”There exists some animal that can fly. Thus, rabbits can fly”! Işıl Dillig, CS311H: Discrete Mathematics Inference Rules for Quantifiers 13/30 Işıl Dillig, Existential Generalization I Suppose we know P (c) is true for some constant c I Then, there exists an element for which P is true I Thus, we can conlude ∃x .P (x ) I This inference rule called existential generalization: Işıl Dillig, CS311H: Discrete Mathematics Inference Rules for Quantifiers 14/30 Example Using Existential Generalization Consider the hypotheses atUT (George) and smart(George). Prove ∃x . (atUT (x ) ∧ smart(x )) 1. 2. 3. 4. P (c) ∃x .P (x ) CS311H: Discrete Mathematics Inference Rules for Quantifiers 15/30 Universal Instantiation Universal Generalization Existential Instantiation Existential Generalization CS311H: Discrete Mathematics Inference Rules for Quantifiers 16/30 Example 1 Rule of Inference ∀x .P (x ) (anyc) P (c) P (c) (for arbitraryc) ∀x .P (x ) ∃x .P (x ) P (c) for fresh c P (c) ∃x .P (x ) Inference Rules for Quantifiers Hypothesis Hypothesis CS311H: Discrete Mathematics I Name atUT (George) smart(George) Işıl Dillig, Summary of Inference Rules for Quantifiers Işıl Dillig, ∃x .P (x ) ∀x .¬P (x ) Prove that these hypotheses imply ∃x .(P (x ) ∧ ¬B (x )): 1. ∃x . (C (x ) ∧ ¬B (x )) (Hypothesis) 2. ∀x . (C (x ) → P (x )) (Hypothesis) 17/30 Işıl Dillig, 3 CS311H: Discrete Mathematics Inference Rules for Quantifiers 18/30 Example 2 I Example 3 Prove the below hypotheses are contradictory by deriving false Is this formula valid, unsat, or contingent? Prove your answer! 1. ∀x .(P (x ) → (Q(x ) ∧ S (x ))) (Hypothesis) ((∀x .P (x )) ∧ (∀x .Q(x ))) → (∀x .(P (x ) ∧ Q(x ))) 2. ∀x .(P (x ) ∧ R(x )) (Hypothesis) 3. ∃x .(¬R(x ) ∨ ¬S (x )) (Hypothesis) Işıl Dillig, CS311H: Discrete Mathematics Inference Rules for Quantifiers Işıl Dillig, 19/30 Example 4 CS311H: Discrete Mathematics Inference Rules for Quantifiers 20/30 Example 4, cont. What’s wrong with the following “proof” of validity? Is the following formula valid, unsatisfiable, or contingent? 1. (∀x .(P (x ) ∨ Q(x ))) ∧ ¬(∀x .P (x ) ∨ ∀x .Q(x )) (∀x .(P (x ) ∨ Q(x ))) → (∀x .P (x ) ∨ ∀x .Q(x )) 2. (∀x .(P (x ) ∨ Q(x ))) ∧ -elim, 1 4. ∃x .¬P (x ) ∧ ∃x .¬Q(x ) 5. ∃x .¬P (x ) 7. ¬P (c) ∃-inst, 5 9. P (c) ∨ Q(c) 10. Q(c) Işıl Dillig, CS311H: Discrete Mathematics Inference Rules for Quantifiers 21/30 Işıl Dillig, ∧-elim, 1 De Morgan, 3 6. ∃x .¬Q(x ) 8. ¬Q(c) ∧-elim, 4 ∃-inst, 6 ∨-elim, 9, 7 11. Q(c) ∧ ¬Q(c) CS311H: Discrete Mathematics ∧-intro, 10, 8 Inference Rules for Quantifiers 22/30 Some terminology Formalizing statements in logic allows formal, machine-checkable proofs I But these kinds of proofs can be very long and tedious I In practice, humans write slight less formal proofs, where multiple steps are combined into one I We’ll now move from formal proofs in logic to less formal mathematical proofs! CS311H: Discrete Mathematics 3. ¬(∀x .P (x ) ∨ ∀x .Q(x )) ∀-inst, 2 Işıl Dillig, Formal vs. Informal Proofs I ∧-elim, 4 premise Inference Rules for Quantifiers Işıl Dillig, 23/30 4 I Theorem: A mathematical statement that has been proven I Many famous mathematical theorems, e.g., Pythagorean theorem, Fermat’s last theorem I Pythagorean theorem: Let a, b the length of the two sides of a right triangle, and let c be the hypotenuse. Then, a 2 + b2 = c2 I Fermat’s Last Theorem: For any integer n greater than 2, the equation a n + b n = c n has no solutions for non-zero a, b, c. CS311H: Discrete Mathematics Inference Rules for Quantifiers 24/30 Theorems, Lemmas, and Propositions I I There are many correct mathematical statements, but not all of them called theorems Less important statements that can be proven to be correct are propositions I Another variation is a lemma: minor auxiliary result which aids in the proof of a theorem/proposition I Corollary is a result whose proof follows immediately from a theorem or proposition Işıl Dillig, Conjectures vs. Theorems CS311H: Discrete Mathematics Inference Rules for Quantifiers 25/30 I Conjecture is a statement that is suspected to be true by experts but not yet proven I Goldbach’s conjecture: Every even integer greater than 2 can be expressed as the sum of two prime numbers. I One of the oldest unsolved problems in number theory! Işıl Dillig, General Strategies for Proving Theorems CS311H: Discrete Mathematics I To prove p → q in a direct proof, first assume p is true. Direct proof: p → q proved by directly showing that if p is true, then q must follow I Then use rules of inference, axioms, previously shown theorems/lemmas to show that q is also true I Proof by contraposition: Prove p → q by proving ¬q → ¬p I Example: If n is an odd integer, than n 2 is also odd. I Proof by contradiction: Prove that the negation of the theorem yields a contradiction I I Proof by cases: Exhaustively enumerate different possibilities, and prove the theorem for each case Proof: Assume n is odd. By definition of oddness, there must exist some integer k such that n = 2k + 1. Then, n 2 = 4k 2 + 4k + 1 = 2(2k 2 + 2k ) + 1, which is odd. Thus, if n is odd, n 2 is also odd. I Observe: This proof implicitly uses universal generalization and existential instantiation (where?) I In many proofs, one needs to combine several different strategies! Işıl Dillig, CS311H: Discrete Mathematics Inference Rules for Quantifiers 27/30 Işıl Dillig, More Direct Proof Examples CS311H: Discrete Mathematics Inference Rules for Quantifiers 28/30 Another Example I An integer a is called a perfect square if there exists an integer b such that a = b 2 . I Example: Prove that if m and n are perfect squares, then mn is also a perfect square. CS311H: Discrete Mathematics 26/30 Direct Proof Many different strategies for proving theorems: Işıl Dillig, Inference Rules for Quantifiers Inference Rules for Quantifiers I 29/30 Işıl Dillig, 5 Example: Prove that every odd number is the difference of two perfect squares. CS311H: Discrete Mathematics Inference Rules for Quantifiers 30/30