mathematics for computing
play

Mathematics for Computing Equational Logic as Calculus of Boolean - PDF document

Axioms Fill in the Blanks! Anything Wrong? false (3.1) Axiom, Associativity of : = (3.15) p p false (3.2) Axiom, Symmetry of : p p (3.3) Axiom, Identity of : = (3.11) p q p q


  1. Axioms — Fill in the Blanks! Anything Wrong? false (3.1) Axiom, Associativity of ≡ : = � (3.15) ¬ p ≡ p ≡ false � (3.2) Axiom, Symmetry of ≡ : ¬ p ≡ p (3.3) Axiom, Identity of ≡ : = � (3.11) ¬ p ≡ q ≡ p ≡ ¬ q � (3.8) Axiom, Definition of false : ¬ p ≡ ¬ p ≡ q ≡ ¬ q (3.9) Axiom, Distributivity of ¬ over ≡ : = � (3.14) ( p �≡ q ) ≡ ¬ p ≡ q , twice � (3.10) Axiom, Definition of �≡ : p �≡ p �≡ q ≡ ¬ q (3.24) Axiom, Symmetry of ∨ : = � (3.14) ( p �≡ q ) ≡ ¬ p ≡ q , twice � (3.25) Axiom, Associativity of ∨ : p ≡ p ≡ ¬ q ≡ ¬ q (3.26) Axiom, Idempotency of ∨ : = � (3.2) Symmetry of ≡� (3.27) Axiom, Distributivity of ∨ over ≡ : p ≡ p (3.28) Axiom, Excluded Middle : = � (3.3) Identity of ≡� true Plan for Today Textbook Chapter 3: Propositional Calculus Mathematics for Computing Equational Logic as Calculus of Boolean Expressions COMP SCI 1FC3 Equivalence, true McMaster University, Winter 2013 Negation, Inequivalence, false Disjunction Wolfram Kahl Conjunction kahl@cas.mcmaster.ca Calculating puzzle solutions: Knights and Knaves 30 January 2013 Theorems Equivalence Axioms, and Theorem (3.4) A theorem is (3.1) Axiom, Associativity of ≡ : (( p ≡ q ) ≡ r ) ≡ ( p ≡ ( q ≡ r )) either an axiom or the conclusion of an inference rule where the premises (3.2) Axiom, Symmetry of ≡ : p ≡ q ≡ q ≡ p are theorems (3.3) Axiom, Identity of ≡ : true ≡ q ≡ q or a Boolean expression proved (using the inference rules) equal to an axiom or a previously proved theorem . The least interesting theorem , shorter proof: Such proofs will be presented in the calculational style . Proving (3.4) true : Note: true “ theorem ” is a syntactic concept − → proofs “ validity ” is a semantic concept − → truth tables = � (3.2) Symmetry of ≡ , with p : = true � For the propositional logic E , theoremhood and validity true ≡ q ≡ q — This is (3.3) Identity of ≡ coincide: All theorems in E are valid: E is sound All valid Boolean expressions are theorems in E : E is complete

  2. Equivalence Axioms and Theorems Proving Equivalences Using Equality Chains (3.1) Axiom, Associativity of ≡ : (( p ≡ q ) ≡ r ) ≡ ( p ≡ ( q ≡ r )) (3.6) Proof Method : To prove that P ≡ Q is a theorem, trans- form P to Q or Q to P using Leibniz. (3.2) Axiom, Symmetry of ≡ : p ≡ q ≡ q ≡ p Justification: Each transformation of P to Q using Leibniz can be turned into a proof of P ≡ Q : (3.3) Axiom, Identity of ≡ : true ≡ q ≡ q true — This is (3.4) Theorems and Metatheorems: = � (3.3), true = q = q � (3.4) true P ≡ P P (3.5) Reflexivity of ≡ : p ≡ p = � Hint 0 � = � Hint 0 � (3.6) Proof Method : To prove that P ≡ Q is a theorem, trans- R P ≡ R form P to Q or Q to P using Leibniz. = � Hint 1 � = � Hint 1 � (3.7) Metatheorem : Any two theorems are equivalent. . . . . . . = � Hint 2 � = � Hint 2 � Q P ≡ Q \ ThisIs { ... } — also Before First Step (3.6) Proof Method : To prove that P ≡ Q is a theorem, trans- form P to Q or Q to P using Leibniz. true — This is (3.4) true — This is (3.4) = � (3.3), true = q = q � = � (3.3), true = q = q � P ≡ P P ≡ P P = � Hint 0 � P ≡ R = � Hint 0 � = � Hint 0 � R P ≡ R = � Hint 1 � = � Hint 1 � = � Hint 1 � . . . . . . . . . = � Hint 2 � P ≡ Q = � Hint 2 � = � Hint 2 � P ≡ Q Q \begin{calc} (3.22) Principle: Structure proofs to avoid repeating the same \true \ThisIs{(3.4)} \CalcStep{=}{(3.3), $\true = q = q$} subexpression on many lines. P \equiv P \CalcStep{=}{Hint 0} A More Subtle Puzzle A More Subtle Puzzle — Solution 1 We now have only two brothers (identical twins). One of A T : Arthur is truthful them is named Arthur and the other has a different name. � ( Arthur answers X ) ≡ X � Axiom: A T ≡ One of the two always lies and the other always tells the A T ≡ Arthur answers A T ≡ A T truth, but we are not told whether Arthur is the liar or the truth-teller. One day you meet the two brothers together, = � (3.2) symmetry: p ≡ q ≡ q ≡ p , twice � and you wish to find out which one is Arthur. Arthur answers A T You are allowed to ask just one of them a question answer- able by yes or no, and again the question may not contain A T ≡ � Henry answers X ≡ ¬ X � Axiom: more than three words. What question would you ask? A T ≡ Henry answers ¬ A T ≡ ¬¬ A T = � (3.12) Double negation ¬¬ p = p � A T ≡ Henry answers ¬ A T ≡ A T Raymond Smullyan: To Mock a Mockingbird = � (3.2) symmetry: p ≡ q ≡ q ≡ p , twice � Henry answers ¬ A T

  3. Negation Axioms and Theorems A More Subtle Puzzle — Solution 2 false ≡ ¬ true (3.8) Axiom, Definition of false : A L : Arthur lies � � A L ≡ Arthur answers X ≡ ¬ X Axiom: (3.9) Axiom, Distributivity of ¬ over ≡ : ¬ ( p ≡ q ) ≡ ¬ p ≡ q Can be used as: A L ≡ Arthur answers ¬ A L ≡ ¬¬ A L ¬ ( p ≡ q ) = ( ¬ p ≡ q ) = � (3.12) ¬¬ p = p � ( ¬ ( p ≡ q ) ≡ ¬ p ) = q A L ≡ Arthur answers ¬ A L ≡ A L (3.10) Axiom, Definition of �≡ : ( p �≡ q ) ≡ ¬ ( p ≡ q ) = � (3.2) symmetry: p ≡ q ≡ q ≡ p , twice � Theorems: Arthur answers ¬ A L (3.11) ¬ p ≡ q ≡ p ≡ ¬ q ( ¬ p ≡ ¬ q ) ≡ ( p ≡ q ) � � A L ≡ Henry answers X ≡ X Axiom: (3.12) Double negation : ¬¬ p ≡ p (3.13) Negation of false : ¬ false ≡ true A L ≡ Henry answers A L ≡ A L (3.14) ( p �≡ q ) ≡ ¬ p ≡ q = � (3.2) symmetry: p ≡ q ≡ q ≡ p , twice � (3.15) ¬ p ≡ p ≡ false Henry answers A L Raymond Smullyan posed many puzzles about an island that You encounter two people A and B . What are A and B if has two kinds of inhabitants: A says “We are of the same type.”? 4 knights , who always tell the truth, and A V : A is a knave knaves , who always lie. Axiom: A V ≡ A says X ≡ ¬ X You encounter two people A and B . What are A and B if ≡ A says ( A V ≡ B V ) ≡ ¬ ( A V ≡ B V ) A V A says “We are both knaves.”? 1 = � (3.2) symmetry of ≡� A says “At least one of us is a knave.”? A says ( A V ≡ B V ) ≡ ≡ ¬ ( A V ≡ B V ) A V 2 = � (3.9) ¬ ( p ≡ q ) ≡ ¬ p ≡ q � A says “If I am a knight, then so is B .”? 3 A says ( A V ≡ B V ) ≡ ≡ ≡ ¬ B V A V A V A says “We are of the same type.”? 4 = � (3.2) symmetry of ≡ : p ≡ q ≡ q ≡ p � A says “ B is a knight” and A says ( A V ≡ B V ) ≡ ¬ B V 5 B says “The two of us are opposite types.”? Avoid Repetition in Proofs! You encounter two people A and B . What are A and B if A says “We are of the same type.”? 4 (3.22) Principle: Structure proofs to avoid repeating the same A V : A is a knave subexpression on many lines. Axiom: A V ≡ A says X ≡ ¬ X A says X ≡ A V ≡ ¬ X Textbook, p. 48 A says ( A V ≡ B V ) = � Def. “says” � ≡ ¬ ( A V ≡ B V ) A V = � (3.9) ¬ ( p ≡ q ) ≡ ¬ p ≡ q � A V ≡ A V ≡ ¬ B V = � (3.2) symmetry of ≡ : p ≡ q ≡ q ≡ p � ¬ B V

  4. Inequivalence Theorems (3.23) Heuristic of Definition Elimination (3.16) Symmetry of �≡ : ( p �≡ q ) ≡ ( q �≡ p ) To prove a theorem concerning an operator ◦ that is defined in terms of another, say • , expand the definition (3.17) Associativity of �≡ : (( p �≡ q ) �≡ r ) ≡ ( p �≡ ( q �≡ r )) of ◦ to arrive at a formula that contains • ; exploit prop- (( p �≡ q ) ≡ r ) ≡ ( p �≡ ( q ≡ r )) (3.18) Mutual associativity : erties of • to manipulate the formula, and then (possibly) p �≡ q ≡ r ≡ p ≡ q �≡ r (3.19) Mutual interchangeability : reintroduce ◦ using its definition. Textbook, p. 48 “Unfold-Fold strategy” A says “ B is a knight” and 5 Inequivalence Theorems: Symmetry B says “The two of us are opposite types.”? ≡ P H ≡ X P says X (3.16) Symmetry of �≡ : ( p �≡ q ) ≡ ( q �≡ p ) B says ( A H �≡ B H ) Proving (3.16) Symmetry of �≡ : A says B H = � Def. “says” � p �≡ q = � Def. “says” � B H ≡ ( A H �≡ B H ) — Unfold A H ≡ B H = � (3.10) Definition of �≡ � = � (3.14) ( p �≡ q ) ≡ ¬ p ≡ q � ¬ ( p ≡ q ) B H ≡ ¬ A H ≡ B H = � (3.2) Symmetry of ≡� = � symmetry of ≡ : p ≡ q ≡ q ≡ p � ¬ ( q ≡ p ) ¬ A H — Fold = � (3.10) Definition of �≡ � = � idempotency of conjunction � q �≡ p ¬ A H ∧ ¬ A H = � Above: “ A says B H ” � ¬ A H ∧ ¬ B H (3.21) Heuristic Identify applicable theorems by matching the structure of expressions or subexpressions. The operators that appear in a boolean expression and the shape of its subexpres- sions can focus the choice of theorems to be used in ma- nipulating it. Obviously, the more theorems you know by heart and the more practice you have in pattern matching, the easier it will be to develop proofs. Textbook, p. 47

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend