Chapter 1 - Foundations
Total Page:16
File Type:pdf, Size:1020Kb
Chapter 1 - Foundations Introduction Suppose that: 1. Babies are illogical. 2. Nobody is despised who can manage a crocodile. 3. Illogical persons are despised. What conclusion may be reached using all of these premises?1 Which is better, eternal happiness or a ham sandwich? It would appear that eternal happiness is better, but this is really not so! After all, nothing is better than eternal happiness, and a ham sandwich is certainly better than nothing. Therefore a ham sandwich is better than eternal happiness.2 And one of my favorite Lewis Carroll quotes: . \Seven years and six months!" Humpty Dumpty repeated thoughtfully. \An uncomfortable sort of age. Now if you'd asked my advice, I'd have said `Leave off at seven' but it's too late now." \I never ask advice about growing," Alice said indignantly. \Too proud?" the other enquired. Alice felt even more indignant at this suggestion. \I mean," she said, \that one can't help growing older." \One can't, perhaps," said Humpty Dumpty; \but two can. With proper assistance, you might have left off at seven." 1.1 - Propositional Logic Definitions and Notation • Logic • Proposition • Notation • Negation 1Taken from Lewis Carroll 2Raymond Smullyan 1 Truth Tables p q :p :q Conjunction and Disjunction Conjunction of p and q: p q p ^ q T T T F F T F F Disjunction of p and q: p q p _ q T T T F F T F F Other Definitions • Exclusive Or (notation: ⊕) • Implication / Conditional (notation: ! or =) ) • Biconditional (notation: $ or () ) p q p ⊕ q p ! q p $ q T T T F F T F F 2 Other Operations on Implications • Converse • Contrapositive • Inverse Precedence Operator Precedence () 0 : 1 ^ 2 _ 3 ! 4 $ 5 We will follow the book's convention and [almost] always use parentheses to group operators in order to avoid confusion. One exception to this is when negating a proposition, e.g., :p ^ q is equivalent to (:p) ^ q, as opposed to :(p ^ q) Compound Propositions in Truth Tables Example 1. p q :p p ! q :p ^ q (p ! q) _ (:p ^ q) T T T F F T F F 3 Logic and Bit Operators 1.2 - Applications of Propositional Logic Example 2. Suppose that: 1. Babies are illogical. 2. Nobody is despised who can manage a crocodile. 3. Illogical persons are despised. What conclusion may be reached using all of these premises? 1.3 - Propositional Equivalences Definitions • Compound Proposition • Tautology • Contradiction • Contingency 4 Logical Equivalence Definition 1. Notation: ≡ Truth tables can be used to show that compound propositions are logically equivalent. Example 3. Show that p ≡ p _ (p ^ q): p q p ^ q p _ (p ^ q) T T T F F T F F A Larger Example. Show that (p ! q) ^ (p ! r) ≡ p ! (q ^ r): p q r p ! q p ! r (p ! q) ^ (p ! r) q ^ r p ! (q ^ r) T T T T T F T F T T F F F T T F T F F F T F F F 5 Table of Logical Equivalences (The abbreviations are not universal, but you may use them in your homework or on tests if you wish.) Equivalence Name Abbr. p ^ T ≡ p Identity / Idempotent IdC (Conjunction) p _ F ≡ p Identity / Idempotent IdD (Disjunction) p ^ F ≡ F Domination (Conjunction) DomC p _ T ≡ T Domination (Disjunction) DomD :(:p) ≡ p Double Negation DN p ^ q ≡ q ^ p Commutative (Conjunction) CC p _ q ≡ q _ p Commutative (Disjunction) CD (p ^ q) ^ r ≡ p ^ (q ^ r) Associative (Conjunction) AC (p _ q) _ r ≡ p _ (q _ r) Associative (Disjunction) AD p ^ (q _ r) ≡ (p ^ q) _ (p ^ r) Distributive (Conjunction) DC p _ (q ^ r) ≡ (p _ q) ^ (p _ r) Distributive (Disjunction) DD :(p ^ q) ≡ :p _:q DeMorgan's Law DMC (Conjunction) :(p _ q) ≡ :p ^ :q DeMorgan's Law DMD (Disjunction) p ^ (p _ q) ≡ p Absorption (Conjunction) AbC p _ (p ^ q) ≡ p Absorption (Disjunction) AbD p ^ :p ≡ F Negation (Conjunction) p _:p ≡ T Negation (Disjunction) Table 1: Table of Logical Equivalences 6 Equivalence Name Abbr :(p ! q) ≡ p ^ :q Negation of Implication NI p ! q ≡ :p _ q Implication to Disjunction ID p ! q ≡ :q !:p Contrapositive C p _ q ≡ :p ! q p ^ q ≡ :(p !:q) (p ! q) ^ (p ! r) ≡ p ! (q ^ r) (p ! r) ^ (q ! r) ≡ (p _ q) ! r (p ! q) _ (p ! r) ≡ p ! (q _ r) (p ! r) _ (q ! r) ≡ (p ^ q) ! r Table 2: Logical Equivalences Involving Implications Equivalence Name Abbr. :(p $ q) ≡ :p $ q Negation of Biconditional NB :(p $ q) ≡ p $ :q Negation of Biconditional NB (alternative) p $ q ≡ (p ! q) ^ (q ! p) Biconditional B p $ q ≡ :p $ :q p $ q ≡ (p ^ q) _ (:p ^ :q) Table 3: Logical Equivalences Involving Biconditionals Additional Tautologies (Remember, `tautology' these will always be true for any values of p, q, r, and s.) Tautology Name Abbr. p _:p Excluded Middle EM (p ^ q) ! p Simplification S p ! (p _ q) Addition A [p ^ (p ! q)] ! q Modus Ponens MP [(p ! q) ^ (q ! r)] ! (p ! r) Hypothetical Syllogism HS [(p _ q) ^ :q] ! p Disjunctive Syllogism DS [:q ^ (p ! q)] !:p Modus Tollens MT [(p _ r) ^ [(p ! q) ^ (r ! s)]] Constructive Dilemma CDL ! (q _ s) [(:q _:s) ^ [(p ! q) ^ (r ! s)]] Destructive Dilemma DDL ! (:p _:r) (p _ p) ! p Idempotent IM Table 4: Additional Tautologies 7 De Morgan's Laws Example 4. Suppose there is an island populated solely by knights and knaves, and that knights always tell the truth but knaves always lie. While on this island, we encounter two people, A and B. A says \I am a knave or B is a knight", while B says nothing. Determine, if possible, what A and B are. Arguments Using Logical Equivalence Example 5. Prove that :(p ! q) !:q is a tautology. Example 6. Use equivalences from the tables to prove that (p ! q) ^ (p ! r) and p ! (q ^ r) are logically equivalent. 8 Practicality of Using Tables How many rows does a truth table need for a compound proposition containing 2 variables? 3 variables? 5 variable? 100 variables? in general? Propositional Satisfiability Definition 2. 1.4 - Predicates and Quantifiers Introduciton Is \x > 3" a proposition? Definition 3 (Predicates (or `Propositional Functions')). 9 Note that if x has no meaning, then P (x) is just a form. Definition 4 (Domain of Discourse). The domain of discourse (or the universe of discourse or simply domain) of x is. There are two ways to give meaning to a predicate P (x): 1. 2. The Universal Quantifier Definition 5. The universal quantification of the predicate P (x) is the statement . In symbols, Note: Example 7. (Let the domain of discourse be all real numbers.) 10 The Existential Quantifier Definition 6. The existential quantification of the predicate P (x) is the statement . In symbols, Note: Example 8. (Let the domain of discourse be all Grove City students and faculty.) Definition 7 (Free and Bound variables). Definition 8 (Scope). 11 Quantifiers with Conjunction and Disjunction Negating Quantified Expressions Translating Into English Example 9. Let P (x) be the statement \x likes to fly kites", Q(x; y) be the statement \x knows y", and L(x; y) the statement \x likes y". Translate the following logical expressions into conversational English statements: 1. 8x (Q(Amy; x) ! P (x)) 2. 8x (L(Alice; x) !:L(x; Bob)) Translating From English Example 10. Translate the following statements into logical expressions. Be sure to state the domain of discourse. 1. \All cats are gray." 2. \There are pigs which can fly." 12 1.5 - Nested Quantifiers Example 11. 1. 8x (x 6= 0 ! 9y(xy = 1)) 2. 8x8y(x + y = y) Note: The order of quantification matters! Example 12. Let M(x; y) = \x is y's mother". Translate the following into English: • 8y9xM(x; y) • 9x8yM(x; y) Example 13. Translated each of the following in to English, where M is as in the previous example and S(x) = \x is a student". 1. 8y (S(y) ! 9xM(x; y)) 2. 8y9x (S(y) ^ M(x; y)) 13 Example 14. Let L(x; y) = \x loves3 y" and S as in the previous example. Translate the following into logical expressions: 1. Everybody loves somebody. 2. There are people who love everybody. 3. All students love each other. Negating Nested Quantifiers Example 15. :(8x9y xy = 1) We move the negation through each level of quantification, using De Morgan's rules for quantifiers at each step: Example 16. Let I(x) = \x has an internet connection", F (x; y) = \x and y have Facebook messaged", and the domain be students in this class. Translate the following into logical expressions: 1. Someone in your class has an internet connection but has not Facebook messaged anyone else in the class. 2. There are two students in the class who, between them, have messaged everyone else in the class. 3In a 1 John 4 sort of way. 14 Example 17. Let C(x; y) = \student x is enrolled in class y" and the domain of x be GCC students. Translate the following into English sentences: 1. : (9x8y C(x; y)) 2. 9x9y8z ((x 6= y) ^ (C(x; z) $ C(y; z))) 1.6 - Rules of Inference Definitions • Argument • Conclusion • Premises • Valid [Argument] • Fallacy 15 Standard Rules of Inference Each of the following is based on a tautology. p • Modus Ponens p ! q ) q :q • Modus Tollens p ! q ) :p p ! q • Hypothetical Syllogism q ! r ) p ! r p _ q • Disjunctive Syllogism :p ) q p • Addition ) p _ q p ^ q • Simplification ) p p • Conjunction q ) p ^ q p _ q • Resolution :p _ r ) q _ r Example 18.