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