Natural Deduction
Akim Demaille akim@lrde.epita.fr
EPITA — École Pour l’Informatique et les Techniques Avancées
June 10, 2016
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
Akim Demaille akim@lrde.epita.fr
EPITA — École Pour l’Informatique et les Techniques Avancées
June 10, 2016
Natural Deduction 2 / 49
1
Logical Formalisms
2
Natural Deduction
3
Additional Material
Natural Deduction 3 / 49
The following slides are implicitly dedicated to classical logic.
Natural Deduction 4 / 49
1
Logical Formalisms Syntax Proof Types Proof Systems
2
Natural Deduction
3
Additional Material
Natural Deduction 5 / 49
1
Logical Formalisms Syntax Proof Types Proof Systems
2
Natural Deduction
3
Additional Material
Natural Deduction 6 / 49
Propositional Calculus
Constants a, b, c, . . . Propositional Variables A, B, C, . . . Unary Connective ¬ Binary Connectives ∧, ∨, ⇒ Punctuation (, ), [, ].
Natural Deduction 7 / 49
Propositional Calculus
Constants a, b, c, . . . Propositional Variables A, B, C, . . . Unary Connective ¬ Binary Connectives ∧, ∨, ⇒ Punctuation (, ), [, ].
Natural Deduction 7 / 49
Propositional Calculus
Constants a, b, c, . . . Propositional Variables A, B, C, . . . Unary Connective ¬ Binary Connectives ∧, ∨, ⇒ Punctuation (, ), [, ].
Natural Deduction 7 / 49
Propositional Calculus
Constants a, b, c, . . . Propositional Variables A, B, C, . . . Unary Connective ¬ Binary Connectives ∧, ∨, ⇒ Punctuation (, ), [, ].
Natural Deduction 7 / 49
Propositional Calculus
Constants a, b, c, . . . Propositional Variables A, B, C, . . . Unary Connective ¬ Binary Connectives ∧, ∨, ⇒ Punctuation (, ), [, ].
Natural Deduction 7 / 49
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 ·.
Natural Deduction 8 / 49
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 ·.
Natural Deduction 8 / 49
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 ·.
Natural Deduction 8 / 49
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 ·.
Natural Deduction 8 / 49
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 ·.
Natural Deduction 8 / 49
formula ::= propositional variable | ¬formula | formula ∧ formula | formula ∨ formula | formula ⇒ formula
Natural Deduction 9 / 49
term ::= constant | function(term, . . .) With the proper arity.
Natural Deduction 10 / 49
formula ::= propositional variable | ¬formula | formula ∧ formula | formula ∨ formula | formula ⇒ formula | predicate(term, . . .) | ∀individual variable · formula | ∃individual variable · formula With the proper arity.
Natural Deduction 11 / 49
Associativity ∧, ∨ are left-associative (unimportant) ⇒ is right-associative (very important) Precedence (increasing)
1 ∀, ∃ 2 ⇒ 3 ∨ 4 ∧ 5 ¬
Natural Deduction 12 / 49
Associativity ∧, ∨ are left-associative (unimportant) ⇒ is right-associative (very important) Precedence (increasing)
1 ∀, ∃ 2 ⇒ 3 ∨ 4 ∧ 5 ¬
Natural Deduction 12 / 49
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}
Natural Deduction 13 / 49
1
Logical Formalisms Syntax Proof Types Proof Systems
2
Natural Deduction
3
Additional Material
Natural Deduction 14 / 49
Natural Deduction 15 / 49
1
Logical Formalisms Syntax Proof Types Proof Systems
2
Natural Deduction
3
Additional Material
Natural Deduction 17 / 49
Hilbertian Systems Natural Deduction Sequent Calculus Natural Deduction in Sequent Calculus
Natural Deduction 18 / 49
Hilbertian Systems Natural Deduction Sequent Calculus Natural Deduction in Sequent Calculus
Natural Deduction 18 / 49
Hilbertian Systems Natural Deduction Sequent Calculus Natural Deduction in Sequent Calculus
Natural Deduction 18 / 49
Hilbertian Systems Natural Deduction Sequent Calculus Natural Deduction in Sequent Calculus
Natural Deduction 18 / 49
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
Natural Deduction 19 / 49
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
Natural Deduction 19 / 49
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
Natural Deduction 19 / 49
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
Natural Deduction 19 / 49
H1 H2 · · · Hn Rule name C Axiom name A
Natural Deduction 20 / 49
David Hilbert (1862–1943)
Natural Deduction 21 / 49
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
Natural Deduction 22 / 49
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
Natural Deduction 22 / 49
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
Natural Deduction 22 / 49
Natural Deduction 23 / 49
(A ⇒ ((A ⇒ A) ⇒ A)) ⇒ (A ⇒ A ⇒ A) ⇒ A ⇒ A A ⇒ (A ⇒ A) ⇒ A (A ⇒ A ⇒ A) ⇒ A ⇒ A A ⇒ A ⇒ A A ⇒ A
Natural Deduction 23 / 49
1
Logical Formalisms
2
Natural Deduction Syntax Normalization
3
Additional Material
Natural Deduction 24 / 49
1
Logical Formalisms
2
Natural Deduction Syntax Normalization
3
Additional Material
Natural Deduction 25 / 49
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.
Natural Deduction 26 / 49
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.
Natural Deduction 26 / 49
What’s this? A
Natural Deduction 27 / 49
What’s this? A A deduction of A under the hypothesis A.
Natural Deduction 27 / 49
[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.
Natural Deduction 28 / 49
[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.
Natural Deduction 28 / 49
[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.
Natural Deduction 28 / 49
[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.
Natural Deduction 28 / 49
Natural Deduction 29 / 49
[A] ⇒I A ⇒ A
Natural Deduction 29 / 49
· · · A · · · B ∧I A ∧ B · · · A ∧ B ∧lE A · · · A ∧ B ∧rE B
Natural Deduction 30 / 49
· · · A · · · B ∧I A ∧ B · · · A ∧ B ∧lE A · · · A ∧ B ∧rE B
Natural Deduction 30 / 49
· · · 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)
Natural Deduction 31 / 49
· · · 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)
Natural Deduction 31 / 49
· · · 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)
Natural Deduction 31 / 49
· · · ⊥ ⊥E A
Natural Deduction 32 / 49
· · · A ∨lI A ∨ B · · · B ∨rI A ∨ B · · · A ∨ B [A] · · · C [B] · · · C ∨E C
Natural Deduction 33 / 49
· · · 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.
Natural Deduction 34 / 49
[A] · · · ⊥ ¬I ¬A · · · A · · · ¬A ¬E ⊥
Natural Deduction 35 / 49
[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
Natural Deduction 35 / 49
1
Logical Formalisms
2
Natural Deduction Syntax Normalization
3
Additional Material
Natural Deduction 36 / 49
Cut: Introduction of a connective followed by its elimination. · · · A · · · B ∧I A ∧ B ∧lE A · · ·
Natural Deduction 37 / 49
The normalization process eliminates the cuts. · · · A · · · B ∧I A ∧ B ∧lE A ❀ · · · A · · ·
Natural Deduction 38 / 49
· · · A · · · B ∧I A ∧ B ∧lE A · · · ❀ · · · A · · · · · · A · · · B ∧I A ∧ B ∧rE B · · · ❀ · · · B · · ·
Natural Deduction 39 / 49
· · · A [A] · · · B ⇒I A ⇒ B ⇒E B · · · ❀ · · · A · · · B · · ·
Natural Deduction 40 / 49
· · · 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.
Natural Deduction 41 / 49
· · · A ∨lI A ∨ B [A] · · · C [B] · · · C ∨E C · · · ❀ · · · A · · · C · · · · · · B ∨rI A ∨ B [A] · · · C [B] · · · C ∨E C · · · ❀ · · · B · · · C · · ·
Natural Deduction 42 / 49
1
Logical Formalisms
2
Natural Deduction
3
Additional Material
Natural Deduction 43 / 49
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.”
Natural Deduction 44 / 49
Natural Deduction 45 / 49
Natural Deduction 46 / 49
Natural Deduction 47 / 49
[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.
Natural Deduction 48 / 49
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.
Natural Deduction 49 / 49