Math.3336: Discrete Mathematics Nested Quantifiers/Rules of Inference Instructor: Dr. Blerina Xhabli Department of Mathematics, University of Houston https://www.math.uh.edu/ blerina Email: blerina@math.uh.edu Fall 2018 Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Nested Quantifiers/Rules of Inference 1/26
Assignments to work on Homework #2 due Wednesday, 9/5, 11:59pm Homework #3 due Wednesday, 9/12, 11:59pm No credit unless turned in by 11:59pm on due date Late submissions not allowed, but lowest homework score dropped when calculating grades Homework will be submitted online in your CASA accounts. You can find the instructions on how to upload your homework in our class webpage. Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Nested Quantifiers/Rules of Inference 2/26
Part II Predicate Logic Predicate Logic Summary The Language of Quantifiers Logical Equivalences Nested Quantifiers Translation from Predicate Logic to English Translation from English to Predicate Logic Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Nested Quantifiers/Rules of Inference 3/26
Summary of Quantifiers and/or Nested Quantifiers Statement When True? When False? x P(x) P(x) is true for every x P(x) is false for some x x P(x) P(x) is true for some x P(x) is false for every x Statement x y P(x, y) y x P(x, y) x y P(x, y) x y P(x, y) x y P(x, y) y x P(x, y) When True? P(x, y) is true for every pair x, y For every x, there is a y for which P(x, y) is true There is an x for which P(x, y) is true for every y There is a pair x, y for which P(x, y) is true Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Nested Quantifiers/Rules of Inference 4/26
Translation with Quantifiers Let A(x) and S(x) be two predicates. Universal quantifiers usually go with implications All A(x) is S(x): No A(x) is S(x): x (A(x) S(x)) x (A(x) S(x)) Existential quantifiers usually go with conjunctions Some A(x) is S(x): x (A(x) S(x)) Some A(x) is not S(x): x (A(x) S(x)) Observation: Universal quantifiers usually go with implications, and existential quantifiers go with conjunctions Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Nested Quantifiers/Rules of Inference 5/26
Understanding Quantifiers and their Orders Let U be the real numbers, and P(x, y) : x y = 0. What is the truth value of the following? x y P(x, y) false x y P(x, y) true x y P(x, y) true x y P(x, y) true Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Nested Quantifiers/Rules of Inference 6/26
Understanding Quantifiers and their Orders Let U be the real numbers, and P(x, y) : x/y = 1. What is the truth value of the following? x y P(x, y) false x y P(x, y) false x y P(x, y) false x y P(x, y) true Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Nested Quantifiers/Rules of Inference 7/26
Translating Predicate Logic into English Given predicates student(x), UH (x), and friends(x, y), what do the following formulas say in English? x ((UH(x) student(x)) ( y (friends(x, y) UH (y)))) Every UH student has a friend outside of UH. x ((student(x) UH(x)) y friends(x, y)) Students who are not at UH have no friends. x y ((student(x) student(y) friends(x, y)) (UH(x) UH(y))) If two students are friends, then they are both at UH. Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Nested Quantifiers/Rules of Inference 8/26
Translating English into predicate Logic Given predicates student(x), UH (x), and friends(x, y), how do we express the following in predicate logic? Every UH student has a friend x (student(x) UH(x) y friends(x, y)) At least one UH student has no friends x (student(x) UH(x) y friends(x, y)) All UH students are friends with each other x y (student(x) student(y) UH(x) UH(y)) friends(x, y) Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Nested Quantifiers/Rules of Inference 9/26
Satisfiability, Validity in Predicate Logic The concepts of satisfiability, validity also important in Predicate Logic A predicate logic formula F is satisfiable if there exists some domain and some interpretation such that F evaluates to true Example: Prove that x P(x) Q(x) is satisfiable. D = { }, P( ) = true, Q( ) = true A predicate logic formula F is valid if, for all domains and all interpretations, F evaluates to true Prove that x P(x) Q(x) is not valid. D = { }, P( ) = true, Q( ) = false Formulas that are satisfiable, but not valid are contingent, e.g., x P(x) Q(x) Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Nested Quantifiers/Rules of Inference 10/26
Example Is the following formula valid, unsatisfiable, or contingent? Prove your answer. (( x P(x)) ( x Q(x))) ( x (P(x) Q(x))) If we take D = {, }, P( ) = true, P( ) = false, Q( ) = false, Q( ) = true, then the formula above is false. If we take D = {, }, P( ) = true, P( ) = false, Q( ) = true, Q( ) = false, then the formula above is true. Thus, the formula above is contingent. Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Nested Quantifiers/Rules of Inference 11/26
Equivalence Two formulas F 1 and F 2 are equivalent if F 1 F 2 is valid In propositional logic, we could prove equivalence using truth tables, but not possible in predicate logic. However, we can still use known equivalences to rewrite one formula as the other. Example: Prove that ( x (P(x) Q(x))) and x (P(x) Q(x)) are equivalent. Example: Prove that x y P(x, y) and x y P(x, y) are equivalent. Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Nested Quantifiers/Rules of Inference 12/26
Chapter 1 - The Foundations: Logic and Proofs Chapter 1 - Overview Propositional Logic The Language of Propositions Section 1.1 Applications* Section 1.2 Logical Equivalences Section 1.3 Predicate Logic The Language of Quantifiers Section 1.4 Logical Equivalences Section 1.4 Nested Quantifiers Section 1.5 Proofs Rules of Inference Section 1.6 Proof Methods Section 1.7 Proof Strategy Section 1.8 Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Nested Quantifiers/Rules of Inference 13/26
Part III Proofs Proofs Summary Valid Arguments and Rules of Inference Proof Methods Proof Strategies Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Nested Quantifiers/Rules of Inference 14/26
Section 1.6 Rules of Inference Proofs Summary Valid Arguments Inference Rules for Propositional Logic Using Rules of Inference to Build Arguments Inference Rules for Quantified Statements Building Arguments for Quantified Statements Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Nested Quantifiers/Rules of Inference 15/26
Rules of Inference We can prove validity in Predicate Logic by using proof rules Proof rules are written as rules of inference: An example inference rule: Hypothesis1 Hypothesis2... Conclusion All men are mortal Socrates is a man Socrates is mortal We ll learn about more general inference rules that will allow constructing formal proofs Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Nested Quantifiers/Rules of Inference 16/26
Modus Ponens Most basic inference rule is modus ponens: φ 1 φ 1 φ 2 φ 2 Modus ponens applicable to both propositional logic and predicate logic Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Nested Quantifiers/Rules of Inference 17/26
Example Uses of Modus Ponens Application of modus ponens in propositional logic: p q (p q) r Application of modus ponens in first-order logic: r P(a) P(a) Q(b) Q(b) Application of modus ponens in a math proof: If x > 1, then x 2 > x. We know x > 1. Therefore, x 2 > x > 1. Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Nested Quantifiers/Rules of Inference 18/26
Modus Tollens Second important inference rule is modus tollens: φ 1 φ 2 φ 2 φ 1 Recall: φ 1 φ 2 and its contrapositive φ 2 φ 1 are equivalent to each other Therefore, correctness of this rule follows from modus ponens and equivalence of a formula and its contrapositive. Example argument using modus tollens: If x > 1, then x 2 > x. But we know x 2 x. Therefore, x 1. Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Nested Quantifiers/Rules of Inference 19/26
Example Uses of Modus Tollens Application of modus tollens in propositional logic: p (q r) (q r) p Application of modus tollens in predicate logic: Q(a) P(a) Q(a) P(a) Application of modus ponens in a math proof: If x > 1, then x 2 > x. We know x > 1. Therefore, x 2 > x > 1. Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Nested Quantifiers/Rules of Inference 20/26
Hypothetical Syllogism (HS) φ 1 φ 2 φ 2 φ 3 φ 1 φ 3 Basically says implication is transitive An example application of hypothetical syllogism: If I do not wake up, then I cannot go to work. If I cannot go to work, then I will not get paid. If I do not wake up, then I will not get paid. Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Nested Quantifiers/Rules of Inference 21/26
Addition and Elimination Addition: φ 1 φ 1 φ 2 Example application: Socrates is a man. Therefore, either Socrates is a man or there are red elephants on the moon. Elimination (Disjunctive Syllogism): φ 1 φ 2 φ 2 φ 1 Example application: It is either a dog or a cat. It is not a dog. Therefore, it must be a cat. Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Nested Quantifiers/Rules of Inference 22/26
Conjunction and Elimination Conjunction: φ 1 φ 2 φ 1 φ 2 This rule just follows from definition of conjunction Example application: It is Tuesday. It s the afternoon. Therefore, it s Tuesday afternoon. Elimination (Simplification): φ 1 φ 2 φ 1 Example application: It is Tuesday afternoon. Therefore, it is Tuesday. Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Nested Quantifiers/Rules of Inference 23/26
Resolution Final inference rule: resolution φ 1 φ 2 φ 1 φ 3 φ 2 φ 3 To see why this is correct, observe φ 1 is either true or false. Suppose φ 1 is true. Then, φ 1 is false. Therefore, by second hypothesis, φ 3 must be true. Suppose φ 1 is false. Then, by 1st hypothesis, φ 2 must be true. In any case, either φ 2 or φ 3 must be true; φ 2 φ 3 Resolution is key inference rule for automating logical reasoning! Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Nested Quantifiers/Rules of Inference 24/26
Resolution Example Example 1: Example 2: P(a) Q(b) Q(b) R(c) P(a) R(c) p q q p q Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Nested Quantifiers/Rules of Inference 25/26
Summary Name Rule of Inference Modus ponens φ 1 φ 1 φ 2 φ 2 Modus tollens φ 1 φ 2 φ 2 φ 1 Hypothetical syllogism Addition Or elimination Conjunction And elimination Resolution φ 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 Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Nested Quantifiers/Rules of Inference 26/26