Introduction to Logic Natural Deduction Michael Genesereth Computer

  • Slides: 40
Download presentation
Introduction to Logic Natural Deduction Michael Genesereth Computer Science Department Stanford University

Introduction to Logic Natural Deduction Michael Genesereth Computer Science Department Stanford University

Example - Transitivity Given (p Þ q) and (q Þ r), prove (p Þ

Example - Transitivity Given (p Þ q) and (q Þ r), prove (p Þ r). 1. p Þ q Premise 2. q Þ r Premise 3. (q Þ r) Þ (p Þ (q Þ r)) IC 4. (p Þ (q Þ r)) IE: 2, 3 5. (p Þ (q Þ r)) Þ ((p Þ q) Þ (p Þ r)) ID 6. (p Þ q) Þ (p Þ r) 7. p Þ r IE: 4, 5 IE: 1, 6

Structured Proofs

Structured Proofs

Natural Deduction Making Assumptions e. g. assume p Applying Ordinary Rules of Inference to

Natural Deduction Making Assumptions e. g. assume p Applying Ordinary Rules of Inference to derive conclusions e. g. derive q Discharging Assumptions leading to implications e. g. conclude p ⇒ q

Conditional Proofs

Conditional Proofs

Making Assumptions In a conditional proof, it is permissible to make an arbitrary assumption

Making Assumptions In a conditional proof, it is permissible to make an arbitrary assumption or hypothetical in a nested proof. The assumption need not be in the original premise set. Such assumptions can be used within the nested proof. However, they may not be used outside of the subproof in which they appear.

Example

Example

Ordinary Rules of Inference An ordinary rule of inference applies to a proof at

Ordinary Rules of Inference An ordinary rule of inference applies to a proof at any level of nesting if and only there is an instance of the rule in which all of the premises occur earlier in the nested proof or in some “superproof” of the nested proof. Importantly, it is not permissible to apply an ordinary rule of inference to premises in subproofs of a nested proof or in other subproofs of a superproof of a nested proof.

Example

Example

Bad Proof X X

Bad Proof X X

Bad Proof X X

Bad Proof X X

Structured Rules of Inference A structured rule of inference is a pattern of reasoning

Structured Rules of Inference A structured rule of inference is a pattern of reasoning consisting of one or more schemas, called premises, and one or more additional schemas, called conclusions, in which one of the premises is a condition of the form φ ⊢ ψ. φ⊢ ψ φ⇒ ψ This schema is called Implication Introduction.

Structured Rule Application A structured rule of inference applies to a nested proof if

Structured Rule Application A structured rule of inference applies to a nested proof if and only there is an instance of the rule in which all of the premises are satisfied. A premise that is an ordinary schema is satisfied if and only if it occurs earlier in the nested proof or in any “superproof” of that nested subproof. A premise of the form φ ⊢ ψ is satisfied if and only if t nested proof has φ as an assumption and terminates in ψ.

Structured Proof A structured proof of a conclusion from a set of premises is

Structured Proof A structured proof of a conclusion from a set of premises is a sequence of (possibly nested) sentences terminating in an occurrence of the conclusion at the top level of the proof. Each step in the proof must be either (1) a premise (at the top level), (2) an assumption, or (3) the result of applying an ordinary or structured rule of inference to earlier items in the sequence (subject to the constraints given above).

Fitch

Fitch

Negations Negation Introduction (NI): φ⇒ χ φ ⇒ Øχ Øφ Negation Elimination (NE): ØØφ

Negations Negation Introduction (NI): φ⇒ χ φ ⇒ Øχ Øφ Negation Elimination (NE): ØØφ φ

Conjunctions And Introduction (AI): φ ψ φÙψ And Elimination (AE): φÙψ φ ψ

Conjunctions And Introduction (AI): φ ψ φÙψ And Elimination (AE): φÙψ φ ψ

Disjunctions Or Introduction (BI): φ φÚψ Or Elimination (BE): φÚψ φ⇒ χ ψ⇒ χ

Disjunctions Or Introduction (BI): φ φÚψ Or Elimination (BE): φÚψ φ⇒ χ ψ⇒ χ χ

Implications And Introduction (AI): φ⊢ ψ φ⇒ ψ Implications Elimination (AE): φ⇒ ψ φ

Implications And Introduction (AI): φ⊢ ψ φ⇒ ψ Implications Elimination (AE): φ⇒ ψ φ ψ

Equivalences / Biconditionals Biconditional Introduction (BI): φ⇒ ψ ψ⇒ φ φÛψ Biconditional Elimination (BE):

Equivalences / Biconditionals Biconditional Introduction (BI): φ⇒ ψ ψ⇒ φ φÛψ Biconditional Elimination (BE): φÛψ φ⇒ ψ ψ⇒ φ

Transitivity - Hilbert Proof Given (p Þ q) and (q Þ r), prove (p

Transitivity - Hilbert Proof Given (p Þ q) and (q Þ r), prove (p Þ r). 1. p Þ q Premise 2. q Þ r Premise 3. (q Þ r) Þ (p Þ (q Þ r)) IC 4. (p Þ (q Þ r)) IE: 2, 3 5. (p Þ (q Þ r)) Þ ((p Þ q) Þ (p Þ r)) ID 6. (p Þ q) Þ (p Þ r) 7. p Þ r IE: 4, 5 IE: 1, 6

Transitivity - Fitch Proof Given (p Þ q) and (q Þ r), prove (p

Transitivity - Fitch Proof Given (p Þ q) and (q Þ r), prove (p Þ r).

Reflexivity - Hilbert Proof Prove (p Þ p). 1. p Þ (p Þ p)

Reflexivity - Hilbert Proof Prove (p Þ p). 1. p Þ (p Þ p) IC 2. p Þ ((p Þ p) IC 3 p Þ ((p Þ p)) Þ (p Þ p)) 4 (p Þ p)) Þ (p Þ p) ID 5. (p Þ p) IE: 1, 4 IE: 2, 4

Reflexivity - Fitch Proof Prove (p Þ p). 1. | p 2. p Þp

Reflexivity - Fitch Proof Prove (p Þ p). 1. | p 2. p Þp Assumption Implication Introduction: 1, 1

Inconsistency - Hilbert Proof Given p and Øp, prove q. 1. p 3 Øp

Inconsistency - Hilbert Proof Given p and Øp, prove q. 1. p 3 Øp Þ (Øq Þ Øp) Premis e IC 4 Øq Þ Øp IE: 3, 2 5. (Øq Þ Øp) Þ (p Þ q) 6. p Þ q 7. q IR IE: 5, 4 IE: 6, 1 2. Øp

Inconsistency - Fitch Proof Given p and Øp, prove q. 1. p 2. Øp

Inconsistency - Fitch Proof Given p and Øp, prove q. 1. p 2. Øp Premise 3 | Øq Assumption 4 |p Reiteration: 1 5. Øq Þ p Implication Introduction: 3, 4 6. | Øq Assumption 7. | Øp Reiteration: 2 8. Øq Þ Øp Implication Introduction: 6, 7 9. ØØq Negation Introduction: 5, 8 10. q Negation Elimination: 9

Negation Elimination - Hilbert Proof Prove (ØØp Þ p). 1 ØØp Þ (ØØØØp Þ

Negation Elimination - Hilbert Proof Prove (ØØp Þ p). 1 ØØp Þ (ØØØØp Þ ØØp) IC 2. (ØØØØp Þ ØØp) Þ (Øp Þ ØØØp) IR 4. ØØp Þ (Øp Þ ØØØp) 5. (Øp Þ ØØØp) Þ (ØØp Þ p) 6. ØØp Þ (ØØp Þ p) 7. (ØØp Þ p)) Þ ((ØØp Þ ØØp) Þ (ØØp Þ p)) Transitivity: 1, 2 IR Transitivity: 4, 5 ID 8. (ØØp Þ ØØp) Þ (ØØp Þ p) IE: 7, 6 9. ØØp Þ ØØp Reflexivity 10. ØØp Þ p IE: 8, 9

Negation Elimination - Fitch Proof Prove (ØØp Þ p). 1 | ØØp Assumption 2.

Negation Elimination - Fitch Proof Prove (ØØp Þ p). 1 | ØØp Assumption 2. |p Negation Elimination: 1 4. ØØp Þ p Implication Introduction: 1, 2

Negation Introduction - Hilbert Proof Prove (p Þ ØØp). 1. p Þ p Reflexivity

Negation Introduction - Hilbert Proof Prove (p Þ ØØp). 1. p Þ p Reflexivity 2. Øp Þ Øp Reflexivity 3. p Þ ØØp Contradiction: 1, 2

Negation Introduction - Fitch Proof Prove (p Þ ØØp). 1. 2. 3. 4. |p

Negation Introduction - Fitch Proof Prove (p Þ ØØp). 1. 2. 3. 4. |p | | Øp | |p | Øp Þ p pppØp 5. | | Øp 6. | Øp Þ Øp 7. | ØØp 8. p Þ ØØp Assumption Reiteration: 1 Implication Introduction: 2, 3 Assumption Implication Introduction: 5, 5 Negation Introduction: 4, 6 Implication Introduction: 1, 7

Soundness and Completeness

Soundness and Completeness

Logical Entailment and Provability Completeness A set of premises D logically entails a conclusion

Logical Entailment and Provability Completeness A set of premises D logically entails a conclusion j (D |= j) if and only if every interpretation that satisfies D also satisfies j. If there exists a proof of a sentence φ from a set Δ of premises using the rules of inference in R, we say that φ is provable from Δ using R (written Δ ⊢R φ).

Soundness and Completeness A proof system is sound if and only if every provable

Soundness and Completeness A proof system is sound if and only if every provable conclusion is logically entailed. If Δ ⊢ φ, then Δ ⊨ φ. A proof system is complete if and only if every logical conclusion is provable. If Δ ⊨ φ, then Δ ⊢ φ.

Fitch Theorem: Fitch is sound and complete for Propositional Logic. D |= j if

Fitch Theorem: Fitch is sound and complete for Propositional Logic. D |= j if and only if Δ ⊢Fitch φ. Upshot: The truth table method and the proof method succeed in exactly the same cases!

Practical Matters

Practical Matters

Reasoning Tips Tip 1: If the goal has the form (φ ⇒ ψ) ,

Reasoning Tips Tip 1: If the goal has the form (φ ⇒ ψ) , it is often good to assume φ and prove ψ and then use Implication Introduction to derive the goal. 1. q Premise 2. | p Assumption 3. | q Reiteration: 1 4. p Þ q IE: 2, 3

Reasoning Tips Tip 2: If the goal has the form (φ ∧ ψ) ,

Reasoning Tips Tip 2: If the goal has the form (φ ∧ ψ) , prove φ and then prove ψ and then use And Introduction to derive (φ ∧ ψ). Tip 3: If the goal has the form (φ ∨ ψ) , try to prove φ or prove ψ (but we do not need to prove both), then use Or Introduction to disjoin with anything else.

Reasoning Tips Tip 4: If the goal has the form ¬φ, (a) assume φ

Reasoning Tips Tip 4: If the goal has the form ¬φ, (a) assume φ and derive the sentence (φ ⇒ ψ), (b) assume φ again and derive the sentence ¬ψ leading to (φ ⇒ ¬ψ), and (c) use Negation Introduction to derive ¬φ as desired. Tip 5: To prove any sentence φ, assume ¬φ, prove a contradiction as just discussed, thereby deriving ¬¬φ, and then apply Negation Elimination to get φ.

Reasoning Tips Tip 6: Given a premise of the form (φ ⇒ ψ)and a

Reasoning Tips Tip 6: Given a premise of the form (φ ⇒ ψ)and a goal ψ, try proving φ and then use Implication Elimination to derive ψ. Tip 7: Given a premise (φ ∨ ψ)and our goal is to prove χ, try proving (φ ⇒ χ) and (ψ ⇒ χ) and use Or Elimination to derive χ.