Natural Deduction Akim Demaille akim@lrde.epita.fr EPITA cole Pour - - PowerPoint PPT Presentation

natural deduction
SMART_READER_LITE
LIVE PREVIEW

Natural Deduction Akim Demaille akim@lrde.epita.fr EPITA cole Pour - - PowerPoint PPT Presentation

Natural Deduction Akim Demaille akim@lrde.epita.fr EPITA cole Pour lInformatique et les Techniques Avances June 10, 2016 Define logic [fuc, ] A. Demaille Natural Deduction 2 / 49 Natural Deduction 1 Logical Formalisms


slide-1
SLIDE 1

Natural Deduction

Akim Demaille akim@lrde.epita.fr

EPITA — École Pour l’Informatique et les Techniques Avancées

June 10, 2016

slide-2
SLIDE 2

Define “logic” [fuc, ]

  • A. Demaille

Natural Deduction 2 / 49

slide-3
SLIDE 3

Natural Deduction

1

Logical Formalisms

2

Natural Deduction

3

Additional Material

  • A. Demaille

Natural Deduction 3 / 49

slide-4
SLIDE 4

Preamble

The following slides are implicitly dedicated to classical logic.

  • A. Demaille

Natural Deduction 4 / 49

slide-5
SLIDE 5

Logical Formalisms

1

Logical Formalisms Syntax Proof Types Proof Systems

2

Natural Deduction

3

Additional Material

  • A. Demaille

Natural Deduction 5 / 49

slide-6
SLIDE 6

Syntax

1

Logical Formalisms Syntax Proof Types Proof Systems

2

Natural Deduction

3

Additional Material

  • A. Demaille

Natural Deduction 6 / 49

slide-7
SLIDE 7

Terminal Symbols

Propositional Calculus

Constants a, b, c, . . . Propositional Variables A, B, C, . . . Unary Connective ¬ Binary Connectives ∧, ∨, ⇒ Punctuation (, ), [, ].

  • A. Demaille

Natural Deduction 7 / 49

slide-8
SLIDE 8

Terminal Symbols

Propositional Calculus

Constants a, b, c, . . . Propositional Variables A, B, C, . . . Unary Connective ¬ Binary Connectives ∧, ∨, ⇒ Punctuation (, ), [, ].

  • A. Demaille

Natural Deduction 7 / 49

slide-9
SLIDE 9

Terminal Symbols

Propositional Calculus

Constants a, b, c, . . . Propositional Variables A, B, C, . . . Unary Connective ¬ Binary Connectives ∧, ∨, ⇒ Punctuation (, ), [, ].

  • A. Demaille

Natural Deduction 7 / 49

slide-10
SLIDE 10

Terminal Symbols

Propositional Calculus

Constants a, b, c, . . . Propositional Variables A, B, C, . . . Unary Connective ¬ Binary Connectives ∧, ∨, ⇒ Punctuation (, ), [, ].

  • A. Demaille

Natural Deduction 7 / 49

slide-11
SLIDE 11

Terminal Symbols

Propositional Calculus

Constants a, b, c, . . . Propositional Variables A, B, C, . . . Unary Connective ¬ Binary Connectives ∧, ∨, ⇒ Punctuation (, ), [, ].

  • A. Demaille

Natural Deduction 7 / 49

slide-12
SLIDE 12

Terminal Symbols

Predicate calculus

Individual Variables x, y, z, . . . Functions f , g, h, . . ., with a fixed arity Predicates P, Q, R, . . ., with a fixed arity Quantifiers ∀, ∃ Punctuation ·.

  • A. Demaille

Natural Deduction 8 / 49

slide-13
SLIDE 13

Terminal Symbols

Predicate calculus

Individual Variables x, y, z, . . . Functions f , g, h, . . ., with a fixed arity Predicates P, Q, R, . . ., with a fixed arity Quantifiers ∀, ∃ Punctuation ·.

  • A. Demaille

Natural Deduction 8 / 49

slide-14
SLIDE 14

Terminal Symbols

Predicate calculus

Individual Variables x, y, z, . . . Functions f , g, h, . . ., with a fixed arity Predicates P, Q, R, . . ., with a fixed arity Quantifiers ∀, ∃ Punctuation ·.

  • A. Demaille

Natural Deduction 8 / 49

slide-15
SLIDE 15

Terminal Symbols

Predicate calculus

Individual Variables x, y, z, . . . Functions f , g, h, . . ., with a fixed arity Predicates P, Q, R, . . ., with a fixed arity Quantifiers ∀, ∃ Punctuation ·.

  • A. Demaille

Natural Deduction 8 / 49

slide-16
SLIDE 16

Terminal Symbols

Predicate calculus

Individual Variables x, y, z, . . . Functions f , g, h, . . ., with a fixed arity Predicates P, Q, R, . . ., with a fixed arity Quantifiers ∀, ∃ Punctuation ·.

  • A. Demaille

Natural Deduction 8 / 49

slide-17
SLIDE 17

Propositional Formulas

formula ::= propositional variable | ¬formula | formula ∧ formula | formula ∨ formula | formula ⇒ formula

  • A. Demaille

Natural Deduction 9 / 49

slide-18
SLIDE 18

Terms

term ::= constant | function(term, . . .) With the proper arity.

  • A. Demaille

Natural Deduction 10 / 49

slide-19
SLIDE 19

First Order Formulas

formula ::= propositional variable | ¬formula | formula ∧ formula | formula ∨ formula | formula ⇒ formula | predicate(term, . . .) | ∀individual variable · formula | ∃individual variable · formula With the proper arity.

  • A. Demaille

Natural Deduction 11 / 49

slide-20
SLIDE 20

Syntactic Conventions

Associativity ∧, ∨ are left-associative (unimportant) ⇒ is right-associative (very important) Precedence (increasing)

1 ∀, ∃ 2 ⇒ 3 ∨ 4 ∧ 5 ¬

  • A. Demaille

Natural Deduction 12 / 49

slide-21
SLIDE 21

Syntactic Conventions

Associativity ∧, ∨ are left-associative (unimportant) ⇒ is right-associative (very important) Precedence (increasing)

1 ∀, ∃ 2 ⇒ 3 ∨ 4 ∧ 5 ¬

  • A. Demaille

Natural Deduction 12 / 49

slide-22
SLIDE 22

Free Variables

FV(X) = ∅ FV(P(x1, x2, · · · , xn)) = {x1, x2, · · · , xn} FV(¬A) = FV(A) FV(A ∨ B) = FV(A) ∪ FV(B) FV(A ∧ B) = FV(A) ∪ FV(B) FV(A ⇒ B) = FV(A) ∪ FV(B) FV(∀x · A) = FV(A) − {x} FV(∃x · A) = FV(A) − {x}

  • A. Demaille

Natural Deduction 13 / 49

slide-23
SLIDE 23

Proof Types

1

Logical Formalisms Syntax Proof Types Proof Systems

2

Natural Deduction

3

Additional Material

  • A. Demaille

Natural Deduction 14 / 49

slide-24
SLIDE 24

Different Proof Types

  • A. Demaille

Natural Deduction 15 / 49

slide-25
SLIDE 25
slide-26
SLIDE 26
slide-27
SLIDE 27
slide-28
SLIDE 28
slide-29
SLIDE 29

Proof Systems

1

Logical Formalisms Syntax Proof Types Proof Systems

2

Natural Deduction

3

Additional Material

  • A. Demaille

Natural Deduction 17 / 49

slide-30
SLIDE 30

Proof Systems

Hilbertian Systems Natural Deduction Sequent Calculus Natural Deduction in Sequent Calculus

  • A. Demaille

Natural Deduction 18 / 49

slide-31
SLIDE 31

Proof Systems

Hilbertian Systems Natural Deduction Sequent Calculus Natural Deduction in Sequent Calculus

  • A. Demaille

Natural Deduction 18 / 49

slide-32
SLIDE 32

Proof Systems

Hilbertian Systems Natural Deduction Sequent Calculus Natural Deduction in Sequent Calculus

  • A. Demaille

Natural Deduction 18 / 49

slide-33
SLIDE 33

Proof Systems

Hilbertian Systems Natural Deduction Sequent Calculus Natural Deduction in Sequent Calculus

  • A. Demaille

Natural Deduction 18 / 49

slide-34
SLIDE 34

Axioms

Axioms are formulas that are considered true a priori ∀x · x + 0 = x Axiom schemes use meta-variables (that range over a specific domain) X + Y = Y + X Axiom schemes are used when quantifiers are not welcome SXYZ → XZ(YZ) KXY → X Axiom schemes are used when quantifiers do not apply A ∨ ¬A

  • A. Demaille

Natural Deduction 19 / 49

slide-35
SLIDE 35

Axioms

Axioms are formulas that are considered true a priori ∀x · x + 0 = x Axiom schemes use meta-variables (that range over a specific domain) X + Y = Y + X Axiom schemes are used when quantifiers are not welcome SXYZ → XZ(YZ) KXY → X Axiom schemes are used when quantifiers do not apply A ∨ ¬A

  • A. Demaille

Natural Deduction 19 / 49

slide-36
SLIDE 36

Axioms

Axioms are formulas that are considered true a priori ∀x · x + 0 = x Axiom schemes use meta-variables (that range over a specific domain) X + Y = Y + X Axiom schemes are used when quantifiers are not welcome SXYZ → XZ(YZ) KXY → X Axiom schemes are used when quantifiers do not apply A ∨ ¬A

  • A. Demaille

Natural Deduction 19 / 49

slide-37
SLIDE 37

Axioms

Axioms are formulas that are considered true a priori ∀x · x + 0 = x Axiom schemes use meta-variables (that range over a specific domain) X + Y = Y + X Axiom schemes are used when quantifiers are not welcome SXYZ → XZ(YZ) KXY → X Axiom schemes are used when quantifiers do not apply A ∨ ¬A

  • A. Demaille

Natural Deduction 19 / 49

slide-38
SLIDE 38

Inference Rules

H1 H2 · · · Hn Rule name C Axiom name A

  • A. Demaille

Natural Deduction 20 / 49

slide-39
SLIDE 39

Logical Formalisms

David Hilbert (1862–1943)

  • A. Demaille

Natural Deduction 21 / 49

slide-40
SLIDE 40

Hilbertian System

A single inference rule: the modus ponens A A ⇒ B modus ponens B Many axioms to define the connectives A ⇒ B ⇒ A ∧ B A ∧ B ⇒ A A ∧ B ⇒ B A ⇒ A ∨ B B ⇒ A ∨ B A ∨ B ⇒ (A ⇒ C) ⇒ (B ⇒ C) ⇒ C A ⇒ B ⇒ A (A ⇒ (B ⇒ C)) ⇒ (A ⇒ B) ⇒ A ⇒ C A ∨ ¬A A ⇒ ¬A ⇒ B

  • A. Demaille

Natural Deduction 22 / 49

slide-41
SLIDE 41

Hilbertian System

A single inference rule: the modus ponens A A ⇒ B modus ponens B Many axioms to define the connectives A ⇒ B ⇒ A ∧ B A ∧ B ⇒ A A ∧ B ⇒ B A ⇒ A ∨ B B ⇒ A ∨ B A ∨ B ⇒ (A ⇒ C) ⇒ (B ⇒ C) ⇒ C A ⇒ B ⇒ A (A ⇒ (B ⇒ C)) ⇒ (A ⇒ B) ⇒ A ⇒ C A ∨ ¬A A ⇒ ¬A ⇒ B

  • A. Demaille

Natural Deduction 22 / 49

slide-42
SLIDE 42

Hilbertian System

A single inference rule: the modus ponens A A ⇒ B modus ponens B Many axioms to define the connectives A ⇒ B ⇒ A ∧ B A ∧ B ⇒ A A ∧ B ⇒ B A ⇒ A ∨ B B ⇒ A ∨ B A ∨ B ⇒ (A ⇒ C) ⇒ (B ⇒ C) ⇒ C A ⇒ B ⇒ A (A ⇒ (B ⇒ C)) ⇒ (A ⇒ B) ⇒ A ⇒ C ⇒ A ∨ ¬A A ⇒ ¬A ⇒ B

  • A. Demaille

Natural Deduction 22 / 49

slide-43
SLIDE 43

Hilbertian System: Prove A ⇒ A

  • A. Demaille

Natural Deduction 23 / 49

slide-44
SLIDE 44

Hilbertian System: Prove A ⇒ A

(A ⇒ ((A ⇒ A) ⇒ A)) ⇒ (A ⇒ A ⇒ A) ⇒ A ⇒ A A ⇒ (A ⇒ A) ⇒ A (A ⇒ A ⇒ A) ⇒ A ⇒ A A ⇒ A ⇒ A A ⇒ A

  • A. Demaille

Natural Deduction 23 / 49

slide-45
SLIDE 45

Natural Deduction

1

Logical Formalisms

2

Natural Deduction Syntax Normalization

3

Additional Material

  • A. Demaille

Natural Deduction 24 / 49

slide-46
SLIDE 46

Syntax

1

Logical Formalisms

2

Natural Deduction Syntax Normalization

3

Additional Material

  • A. Demaille

Natural Deduction 25 / 49

slide-47
SLIDE 47

Deduction

Deduction

A deduction is a tree whose root (A) is the conclusion and whose leafs (Γ) is the set of hypotheses. Γ · · · A Any formula A is a valid hypothesis.

Proof (Demonstration)

A proof is a deduction without hypotheses.

  • A. Demaille

Natural Deduction 26 / 49

slide-48
SLIDE 48

Deduction

Deduction

A deduction is a tree whose root (A) is the conclusion and whose active leafs (Γ) is the set of hypotheses. Γ · · · A Any formula A is a valid hypothesis.

Proof (Demonstration)

A proof is a deduction without hypotheses.

  • A. Demaille

Natural Deduction 26 / 49

slide-49
SLIDE 49

Deductions

What’s this? A

  • A. Demaille

Natural Deduction 27 / 49

slide-50
SLIDE 50

Deductions

What’s this? A A deduction of A under the hypothesis A.

  • A. Demaille

Natural Deduction 27 / 49

slide-51
SLIDE 51

Implication

[A] · · · B ⇒I A ⇒ B · · · A · · · A ⇒ B ⇒E B Deduction theorem, and Modus Ponens. Note the connection with (left) contraction: any number of A (including 0) is discharged.

  • A. Demaille

Natural Deduction 28 / 49

slide-52
SLIDE 52

Implication

[A] · · · B ⇒I A ⇒ B · · · A · · · A ⇒ B ⇒E B Deduction theorem, and Modus Ponens. Note the connection with (left) contraction: any number of A (including 0) is discharged.

  • A. Demaille

Natural Deduction 28 / 49

slide-53
SLIDE 53

Implication

[A] · · · B ⇒I A ⇒ B · · · A · · · A ⇒ B ⇒E B Deduction theorem, and Modus Ponens. Note the connection with (left) contraction: any number of A (including 0) is discharged.

  • A. Demaille

Natural Deduction 28 / 49

slide-54
SLIDE 54

Implication

[A] · · · B ⇒I A ⇒ B · · · A · · · A ⇒ B ⇒E B Deduction theorem, and Modus Ponens. Note the connection with (left) contraction: any number of A (including 0) is discharged.

  • A. Demaille

Natural Deduction 28 / 49

slide-55
SLIDE 55

Proving A ⇒ A in Natural Deduction

  • A. Demaille

Natural Deduction 29 / 49

slide-56
SLIDE 56

Proving A ⇒ A in Natural Deduction

[A] ⇒I A ⇒ A

  • A. Demaille

Natural Deduction 29 / 49

slide-57
SLIDE 57

Conjunction

· · · A · · · B ∧I A ∧ B · · · A ∧ B ∧lE A · · · A ∧ B ∧rE B

  • A. Demaille

Natural Deduction 30 / 49

slide-58
SLIDE 58

Conjunction

· · · A · · · B ∧I A ∧ B · · · A ∧ B ∧lE A · · · A ∧ B ∧rE B

  • A. Demaille

Natural Deduction 30 / 49

slide-59
SLIDE 59

Universal Quantification

· · · A[y/x] ∀I y ∈ FV(hyp(A)) ∀x · A · · · ∀x · A ∀E A[t/x] [A] ∀I ∀x · A ⇒I A ⇒ ∀x · A [A] ⇒I A ⇒ A ∀I ∀x · (A ⇒ A)

  • A. Demaille

Natural Deduction 31 / 49

slide-60
SLIDE 60

Universal Quantification

· · · A[y/x] ∀I y ∈ FV(hyp(A)) ∀x · A · · · ∀x · A ∀E A[t/x] [A] ∀I ∀x · A ⇒I A ⇒ ∀x · A [A] ⇒I A ⇒ A ∀I ∀x · (A ⇒ A)

  • A. Demaille

Natural Deduction 31 / 49

slide-61
SLIDE 61

Universal Quantification

· · · A[y/x] ∀I y ∈ FV(hyp(A)) ∀x · A · · · ∀x · A ∀E A[t/x] [A] ∀I ∀x · A ⇒I A ⇒ ∀x · A [A] ⇒I A ⇒ A ∀I ∀x · (A ⇒ A)

  • A. Demaille

Natural Deduction 31 / 49

slide-62
SLIDE 62

Absurd

· · · ⊥ ⊥E A

  • A. Demaille

Natural Deduction 32 / 49

slide-63
SLIDE 63

Disjunction

· · · A ∨lI A ∨ B · · · B ∨rI A ∨ B · · · A ∨ B [A] · · · C [B] · · · C ∨E C

  • A. Demaille

Natural Deduction 33 / 49

slide-64
SLIDE 64

Existential Quantification

· · · A[t/x] ∃I ∃x · A · · · ∃x · A [A[y/x]] · · · B ∃E y ∈ FV(B, hyp(B)) B For elimination, y ∈ hyp(B), i.e., not in the hypotheses other than the discharged A.

  • A. Demaille

Natural Deduction 34 / 49

slide-65
SLIDE 65

Negation

[A] · · · ⊥ ¬I ¬A · · · A · · · ¬A ¬E ⊥

  • A. Demaille

Natural Deduction 35 / 49

slide-66
SLIDE 66

Negation

[A] · · · ⊥ ¬I ¬A · · · A · · · ¬A ¬E ⊥ Plus one of these equivalent formulations of the fact that classical negation is involutive. XM A ∨ ¬A · · · ¬¬A ¬¬ A [¬A] · · · B [¬A] · · · ¬B Contradiction A

  • A. Demaille

Natural Deduction 35 / 49

slide-67
SLIDE 67

Normalization

1

Logical Formalisms

2

Natural Deduction Syntax Normalization

3

Additional Material

  • A. Demaille

Natural Deduction 36 / 49

slide-68
SLIDE 68

Cut

Cut: Introduction of a connective followed by its elimination. · · · A · · · B ∧I A ∧ B ∧lE A · · ·

  • A. Demaille

Natural Deduction 37 / 49

slide-69
SLIDE 69

Normalization

The normalization process eliminates the cuts. · · · A · · · B ∧I A ∧ B ∧lE A ❀ · · · A · · ·

  • A. Demaille

Natural Deduction 38 / 49

slide-70
SLIDE 70

Normalizing Conjunctions

· · · A · · · B ∧I A ∧ B ∧lE A · · · ❀ · · · A · · · · · · A · · · B ∧I A ∧ B ∧rE B · · · ❀ · · · B · · ·

  • A. Demaille

Natural Deduction 39 / 49

slide-71
SLIDE 71

Normalizing Implications

· · · A [A] · · · B ⇒I A ⇒ B ⇒E B · · · ❀ · · · A · · · B · · ·

  • A. Demaille

Natural Deduction 40 / 49

slide-72
SLIDE 72

Normalizing Universal Quantifiers

· · · A ∀I ∀x · A ∀E A[t/x] · · · ❀ · · · A[t/x] · · · x must not be free in the hypotheses, otherwise the reduction would change them.

  • A. Demaille

Natural Deduction 41 / 49

slide-73
SLIDE 73

Normalizing Disjunction

· · · A ∨lI A ∨ B [A] · · · C [B] · · · C ∨E C · · · ❀ · · · A · · · C · · · · · · B ∨rI A ∨ B [A] · · · C [B] · · · C ∨E C · · · ❀ · · · B · · · C · · ·

  • A. Demaille

Natural Deduction 42 / 49

slide-74
SLIDE 74

Additional Material

1

Logical Formalisms

2

Natural Deduction

3

Additional Material

  • A. Demaille

Natural Deduction 43 / 49

slide-75
SLIDE 75

Logicians in a Bar

Three logicians walk into a bar, and the bartender asks “Would you all like a drink?” The first one says, “Maybe.” The second one says, “Maybe.” The third one says, “Yes.”

  • A. Demaille

Natural Deduction 44 / 49

slide-76
SLIDE 76

Edukera

  • A. Demaille

Natural Deduction 45 / 49

slide-77
SLIDE 77

Edukera

  • A. Demaille

Natural Deduction 46 / 49

slide-78
SLIDE 78

Edukera

http://edukera.appspot.com 8245EEC

  • A. Demaille

Natural Deduction 47 / 49

slide-79
SLIDE 79

Bibliography Notes

[Girard et al., 1989] A short (160p.) book addressing all the concerns of this course, and more (especially Linear Logic). Easy and pleasant to read. Now available for free. [Girard, 2004] A much more comprehensive book focusing on logic and its connections with computer science. In French.

  • A. Demaille

Natural Deduction 48 / 49

slide-80
SLIDE 80

Bibliography I

Fuck theory — Experiments in visceral philosophy. http://fucktheory.tumblr.com/post/12492878134/ dictionary-of-philosophy-logic. Girard, J.-Y. (2004). Cours de Logique, Rome, Automne 2004. http://logica.uniroma3.it/uif/corso/. Girard, J.-Y., Lafont, Y., and Taylor, P. (1989). Proofs and Types. Cambridge University Press. http://www.cs.man.ac.uk/~pt/stable/Proofs+Types.html.

  • A. Demaille

Natural Deduction 49 / 49