Download presentation
Presentation is loading. Please wait.
1
CS 270 Math Foundations of CS
Natural Deduction CS 270 Math Foundations of CS Jeremy Johnson
2
Outline An example What’s a proof Rules of natural deduction
Validity by truth table Validity by proof What’s a proof Proof checker Rules of natural deduction Provable equivalence Soundness and Completeness
3
An Example If the train arrives late and there are no taxis at the station, then John is late for his meeting. John is not late for his meeting. The train did arrive late. Therefore, there were taxis at the station. If it is raining and Jane does not have here umbrella with her, then she will get wet. Jane is not wet. It is raining. Therefore, Jane has her umbrella with her.
4
An Example If the train arrives late and there are no taxis at the station, then John is late for his meeting. John is not late for his meeting. The train did arrive late. Therefore, there were taxis at the station. p = the train arrives late q = there are taxis at the station r = John is late for his meeting. 𝑝∧¬𝑞 →𝑟, ¬𝑟,𝑝⊢𝑞 [a sequent]
5
An Example p = it is raining q = Jane has her umbrella
r = Jane gets wet. 𝑝∧¬𝑞 →𝑟, ¬𝑟,𝑝⊢𝑞 If it is raining and Jane does not have here umbrella with her, then she will get wet. Jane is not wet. It is raining. Therefore, Jane has her umbrella with her.
6
Validity by Truth Table
𝑝∧¬𝑞 →𝑟, ¬𝑟,𝑝⊢𝑞 p q r q r pq (pq)r F T
7
Proof By applying rules of inference to a set of formulas, called premises, we derive additional formulas and may infer a conclusion from the premises A sequent is 1,…,n ⊢ Premises 1,…,n Conclusion The sequent is valid if a proof for it can be found
8
Proof A proof is a sequence of formulas that are either premises or follow from the application of a rule to previous formulas Each formula must be labeled by it’s justification, i.e. the rule that was applied along with pointers to the formulas that the rule was applied to It is relatively straightforward to check to see if a proof is valid
9
Validity by Deduction 𝑝∧¬𝑞 →𝑟, ¬𝑟,𝑝⊢𝑞 1 𝑝∧¬𝑞 →𝑟 premise 2 ¬𝑟 3 𝑝 4 ¬𝑞
assumption 5 𝑝∧¬𝑞 ∧i 3,4 6 r →e 1,5 7 ⊥ ⊥i 6,2 8 q ¬e 4-7
10
Rules of Natural Deduction
Natural deduction uses a set of rules formally introduced by Gentzen in 1934 The rules follow a “natural” way of reasoning about Introduction rules Introduce logical operators from premises Elimination rules Eliminate logical operators from premise producing a conclusion without the operator
11
Conjunction Rules Introduction Rule Elimination Rule i
i e1 e2
12
Implication Rules Introduction Rule Assume and show
Elimination Rule (Modus Ponens) … i e
13
Disjunction Rules Introduction Rule
Elimination Rule (proof by case analysis) i1 i2 … … e
14
Negation Rules Introduce the symbol (⊥ =bottom) to encode a contradiction Bottom elimination ⊥ can prove anything Bottom introduction ⊥ ⊥ e. ⊥ i ⊥
15
Negation Rules Introduction and elimination rules (proof by contradiction) Double negation … ⊥ i … ⊥ e e
16
Derived Rules Modus Tollens Disjunctive Syllogism DeMorgan’s Law
(P Q) P Q (P Q) P Q MT DS
17
Alternative Proof 𝑝∧¬𝑞 →𝑟, ¬𝑟,𝑝⊢𝑞 1 𝑝∧¬𝑞 →𝑟 premise 2 ¬𝑟 3 𝑝 4 ¬ 𝑝∧¬𝑞
MT 1,2 5 ¬𝑝 ¬¬𝑞 DM 4 6 ¬¬𝑞 DS 5,3 7 q ¬¬e 6
18
LogicLab The LogicLab tool from the Logic and Proofs course from the CMU online learning initiative allows you to experiment with natural deduction proofs
19
LogicLab
20
Provable Equivalence and are provably equivalent, ⊣⊢ , iff the sequents ⊢ and ⊢ are both valid Alternatively ⊣⊢ iff the sequent ⊢ is valid A valid sequent with no premises is a tautology
21
Distributive Law P (Q R) ⊢ (P Q) (P R) 1 P (Q R) premise
2 P e1 1 3 Q R e2 1 4 Q Assumption 5 P Q i 2,4 6 (P Q) (P R) i1 5 7 R 8 P R i 2,7 9 i2 8 10 e 3,4-6,7-9
22
Distributive Law (P Q) (P R) ⊢ P (Q R) 1 (P Q) (P R)
premise 2 P Q Assumption 3 P e1 2 4 Q e2 2 5 Q R i1 4 6 P (Q R) i 3,5 7 P R 8 e1 7 9 R e2 7 10 i2 9 11 i 8,10 12 e 1,2-6,7-11
23
Semantic Entailment If for all valuations (assignments of variables to truth values) for which all 1,…,n evaluate to true, also evaluates to true then the semantic entailment relation 1,…,n ⊨ holds
24
Soundness and Completeness
1,…,n ⊨ holds iff 1,…,n ⊢ is valid In particular, ⊨ , a tautology, ⊢ is valid. I.E. is a tautology iff is provable Soundness – you can not prove things that are not true in the truth table sense Completeness – you can prove anything that is true in the truth table sense
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.