Chapter 3 Propositional Calculus Goal: Learn to manipulate Boolean expressions without regard to their (intrinsic) meaning. Preliminaries Definition Calculus reasoning process based on calculation with symbols Definition Propositional Calculus method of calculating with Boolean expressions involving propositional variables. Equational Logic Components of Equational Logic Axioms Inference Rules Leibniz (1.5) Transitivity (1.4) Textual Substitution (1.1) A theorem is 1. an axiom 2. a conclusion of an inference rule whose premises are theorems 3. a boolean expression that, using the inference rules, is proved equivalent to an axiom or a previously proved theorem. All Theorems are valid (and all valid expressions are theorems). Typically the axioms are stated for individual operators and they are given in some particular order so as to "define" an operator. Our text uses a non-traditional approach because of its desire to emphasize certain items. We want to develop skill at manipulations. Axiom (3.1) Axiom, Associativity of ((pq)r)(p(qr). This axiom allows us to remove parentheses when expressing equivalences (3.2) Axiom, Symmetry of . pq qp. Imagine the parentheses (pq) (qp). Theorem: ppqq Proof: ppqq = <3.2 substituting p for pqq using Leibniz > pp = <3.2 substituting pqq for p using Leibniz> pqqp Thus ppqq is equivalent to an axiom 3.2 it is a theorem. (3.3) Axiom, Identity of . (ptrue)p. (3.4) Theorem. true trueqq. true is called an identity because p(truep) and (3.5) Reflexivity of pp Let's prove both of these true = <3.3 and let q=true (truetruetrue> truetrue = <3.3 replacing the second true with qq> trueqq pp = <ppqq theorem ppqq which is a theorem thus pp is a theorem too. Note: 3.3 and 3.2 imply that true or true are redundant in an expression and therefore can be left out if desired. [trueqq] says that trueq is equivalent to q so the true can be left off.. Another proof technique: To prove that PQ we can do P = reason something = reason … = reason Q because this is equivalent line to the following true = <3.3> PP = reason 1 Psomething = reason 2 … = reason last PQ (3.6) (3.7) To prove that PQ is a theorem, transform P to Q or Q to P using Leibniz. Metatheorem Any two theorems are equivalent. Tone Ttwo. Negation, Inequivalence, and false (3.8) Axiom, Definition of false false true (3.9) Axiom, Distributivity of over . (pq) pq (3.10) Axiom, Definition of /: (p/q) (pq) Do 3.11 through 3.19 WITH the CLASS. 3.12 ⌐⌐p p ⌐⌐p p < 3.11 ⌐pqp~q, with p,q := ~p,p> ~~pp~p~p p~p~pp <3.3 q:=~p> ptruep <3,2> truepp Heuristic techniques and principles Match structures to figure out which rules to use. To prove a theorem about # in terms of @ expand the definition of # to arrive at a formula that contains @, use properties of @, and then go back to # if necessary. Portia's Suitor problem: From Shakespeare's Merchant of Venice (and chapter 5 of the book) Portia has a gold casket and a silver casket. She has put her portrait in one of them. She has also written an inscription on each of the caskets: On the gold casket is written: The portrait is not in here. On the silver casket is written: Exactly one of these inscriptions is true. Portia explains to her suitor that either inscription may be true or may be false but that she has placed her portrait in a casket and the placement is consistent with the truth or falsity of the inscriptions. If he can choose the correct casket, the she will marry him. Assuming that her suitor wanted to marry her which casket should he choose? Formalize the problem: gp: The portrait is in the gold casket sp: The portrait is in the silver casket gi: The portrait is not in the gold casket (inscription on the gold casket) si: Exactly one of gi and si is true (inscription on the silver casket.) We want to state the problem in terms of formal statements and then see if the formal statements can be used to derive either gp or sp. Formal statements: 1) F0: gp sp 2) F1: gi gp 3) F3: si (si gi) Start with F3 (since it is the most complex statement) and go from there. si si gi = true gi = gi = gp = gp now does this show that the portrait is in the gold casket? NO! because we don't know that the formal statements are consistent. i.e if they are contradictory then anything could be proven. So we finish by answering the question. is it possible for F0, F1 and F2 to all be true. Well if the portrait is in the gold casket then we have consistency. SECTION 3.4 DISJUNCTION 3.24 Axiom, Symmetry of : pq q p 3.25 Axiom, Associativity of : p(qr) (pq)r 3.26 Axiom, Idempotency of : pp p 3.27 Axiom, Distributivity of over : p(q r) pq pr 3.28 Axiom, Excluded middle: p p 3.29 3.30 3.31 3.32 Theorem: Zero of : ptrue true Theorem: Identity of : pfalse p Theorem: Distributivity of over : p(qr) (pq)(pr) Theorem: pq p q p do 3.29 ptrue true <prove this by transforming ptrue into true ptrue = <3.3> p(p p) = <3.27> Pp pp = <3.3> true do some more. 3.5 CONJUNCTION 3.35 Axiom, Golden Rule: pq p q pq explain the meaning of this p and q means p q p or q but rearranging items can write it as p q means p and q p or q list basic properties of 3.36 through 3.42 relationships between and 3.43 and 3.47 3.6 IMPLICATION 3.57 Axiom, Implication pq p q q 3.57 Axiom, Def Consequent p q q p 3.58 Th, Definition Implication pq p q (hwk) 3.59 Th, Def Impl pq pq p 3.60 Th, Contrapositive pq q p (hwk) 3.83 Leibniz Axiom (e=f) (E[z:=e] = E[z:=f]) where E is any expression. compare to inference rule Leibniz if X=Y is valid then so is E[z:=X]=E[z:=Y]. So what we have here is the rule which says if X=Y is true in ALL STATES then so is E[z:=X]=E[z:=Y] whereas Leibniz axiom says if e=f in SOME STATE then E[z:=e] = E[z:=f] for that state too. 3.84 Substitution e=f E[z:=e] e=f E[z:=f] replace by 3.85 pE z p pE z true 3.86 E z p p E z false p Conjunctive Normal Form E0 E1 … En where each Ek is a disjunction of boolean variables and their negations Define Disjunctive Normal Form Do 3.88 in class for disjunctive Normal form Do 3.89 in class for conjunctive Normal form Chapter 4 Relaxing Proof Styles Monotonicity 4.1,4.2,4.3 Additional Proof Techniques Assume the antecedent Case Analysis (avoid if possible) show qr p by showing pq rq Proof by Mutual Implication pq pq qp Proof by Contradiction pfalse p Proof by Contrapositive pq qp