Lecture 5 CS 1813 – Discrete Mathematics Lecture 5 - CS 1813 Discrete Math, University of Oklahoma 2/22/2019 Lecture 5 CS 1813 – Discrete Mathematics What Not and Rules Galore CS 1813 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page
Or Introduction and Or Elimination Theorem (Or Commutes) a b |– b a a {IL} a b Or Intro Left b {IR} a b Or Intro Right a b a |– c b |– c {E} c Or Elimination Suppose We could prove the formula b a assuming a alone And we could prove b a again, assuming b alone Then we could apply E to prove b a assuming a b assumptions temporarily admitted discharged by E a {IR} b a b {IL} b a remaining assumption a b {E} b a conclusion CS 1813 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page
CS 1813 Discrete Mathematics, Univ Oklahoma What is Not? Definition of the Not Operator a means aFalse Rationale You don’t want False to follow from True So, if aFalse is True, then a better be False Which means, a must be True True means False - Right? So, True means FalseFalse (def’n of True) Consistent with definition of the Not operator All this stuff is rigged for consistency Countless logicians worked it out a long time ago Proofs of WFFs containing Not use this def’n CS 1813 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page
CS 1813 Discrete Mathematics, Univ Oklahoma Modus Tollens Theorem (Modus Tollens) a b, b |– a Proof This is a homework problem Proved in text, too Your job Express in natural deduction form Convert to proof-checker notation We will take it as a proven theorem Counting on you to succeed CS 1813 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page
Inference Rules Galore Theorems become new inference rules thm cited on right (like a rule) premises above the line a b b {modTol} a conclusion below a b {Comm} b a a b {Comm} b a ab bc {Chain} ac CS 1813 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page
Or Commutes Inside Not (a b) |– (b a) Plan Prove b a a b Cite Modus Tollens a b, b |– a (a b) {()Comm} (b a) Not Or Commutes as rule assumption temporarily admitted Using Or-Commutes Theorem discharged by I b a {Comm} a b Using Modus Tollens {I} b a a b (a b) {modTol} remaining assumption (b a) conclusion CS 1813 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page
Using Theorems as Inference Rules in the Proof Checker andCommThm = Theorem [A `And` B] (B `And` A) andComm = Use andCommThm Prototype Citation — [Proof] `andComm` Prop conclusion here premises go here infix citation Just like ordinary rule-citation Except premises are in a sequence instead of a tuple CS 1813 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page
CS 1813 Discrete Mathematics, Univ Oklahoma Curried Constructors Use - another constructor for the type Proof Use :: Theorem -> [Proof ] -> Prop -> Proof three arguments Familiar constructors for the type Proof AndI :: (Proof, Proof) -> Prop -> Proof two arguments AndEL :: Proof -> Prop -> Proof 1st premises ImpI :: Proof -> Prop -> Proof 2nd conclusion How many arguments do these require? Use (Theorem [A `And` B] (B `And` A)) Use andCommThm where andCommThm = Theorem [A `And` B] (B `And` A) Two arguments remain to be supplied First argument is specified (the theorem being cited) That leaves two other arguments Premises and conclusion remain to be supplied by citation CS 1813 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page
Preparing Theorems for Citation as Rules define module in file named Lecture4Thms.hs import Lecture4Thms (to use def’ns elsewhere) module Lecture4Thms where andCommThm = Theorem [A `And` B] (B `And` A) andComm = Use andCommThm name for theorem name for citing theorem as inference rule orCommThm = Theorem [A `Or` B] (B `Or` A) orComm = Use orCommThm impChainThm = Theorem [A `Imp` B, B `Imp` C] (A `Imp` C) impChain = Use impChainThm import Lecture4Thms -- to cite theorems from Lecture4Thms.hs CS 1813 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page
Or-Commutes-In-Not Theorem and Proof in Proof-Checker Notation Lecture 5 - CS 1813 Discrete Math, University of Oklahoma 2/22/2019 Or-Commutes-In-Not Theorem and Proof in Proof-Checker Notation orCommInNotFwdThm = Theorem [Not(A `Or` B)] (Not(B `Or` A)) proofOrCommInNotFwdThm = [ ( [ Assume(B `Or` A) ] {--------------------------}`orComm` (A `Or` B)) {---------------------------------------}`ImpI` ((B `Or` A) `Imp` (A `Or` B)) , Assume(Not(A `Or` B)) ] {---------------------------------------------------------------------------}`modTol` (Not(B `Or` A)) Premise sequence for orComm [Proof] Assumption discharged by ImpI premises for modTol [Proof, Proof] At this point, again go to the Haskell session with lecture04.hs and again demonstrate use of proof checker. CS 1813 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page
Not Or Elimination – Left (a b) |– a Plan – Assume a Derive False Cite {I} (a b) {()EL} a Not Or Elimination (Left) as rule assumption temporarily admitted means (a b) (assumption of theorem) discharged by I a {IL} a b Cite what rule? (a b) False {E} False Now what? {I} a False means a (conclusion of theorem) CS 1813 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page
Not Or Elimination – Right (a b) |– b {()ER} b Not Or Elimination (Right) as rule Plan – Flip it around with {()Comm} Cite {()EL} (a b) {()Comm} (b a) Cite what rule? {()EL} b CS 1813 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page
DeMorgan’s Law for Or (Forward Half) (a b) |– (a) (b) {DeMF} (a)(b) DeMorgan Or Fwd as rule Plan Derive halves of conclusion separately Cite {I} (a b) {()EL} a (a b) {()ER} b {I} (a) (b) CS 1813 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page
DeMorgan’s Law for Or (Backward Half) (a) (b) |– (a b) Plan Use {E} to derive False from a b Cite {I} to conclude (a b)False Hold onto your seat This proof is supercharged prove this as an exercise Admit for planned {E} Admit for planned {I} (a) (b) (a) (b) {EL} a {ER} b Discharged by {I} a b Discharged by {E} a b { +&- } { +&- } False False {E} False {I} (a b) False CS 1813 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page
Rules Galore! — Theorems in Rule Form (a b) {DeMF} (a)(b) DeMorgan Or Fwd (a)(b) {DeMB} (a b) DeMorgan Or Bkw a b {Comm} b a And Commutes a b {Comm} b a Or Commutes ab, bc {Chain} ac Implication Chain Rule (a b) {()Comm} (b a) Not Or Commutes a b b {modTol} a Modus Tollens a a { +&- } False NeverBoth CS 1813 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page
CS 1813 Discrete Mathematics, Univ Oklahoma What Is Discrete Math? discrete math An area of mathematics dealing with countable collections of entities Example Topics Logic Trees and graphs Functions and relations Grammars Combinatorics Number theory et cetera discreet math A math that shows good judgment in conduct Not covered in discrete math CS 1813 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page
CS 1813 Discrete Mathematics, Univ Oklahoma End of Lecture CS 1813 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page