• Aucun résultat trouvé

Natural Deduction

N/A
N/A
Protected

Academic year: 2022

Partager "Natural Deduction"

Copied!
80
0
0

Texte intégral

(1)

Natural Deduction

Akim [email protected]

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

June 10, 2016

(2)

Define “logic” [fuc, ]

(3)

Natural Deduction

1 Logical Formalisms

2 Natural Deduction

3 Additional Material

A. Demaille Natural Deduction 3 / 49

(4)

Preamble

The following slides are implicitly dedicated to classicallogic.

(5)

Logical Formalisms

1 Logical Formalisms Syntax

Proof Types Proof Systems

2 Natural Deduction

3 Additional Material

A. Demaille Natural Deduction 5 / 49

(6)

Syntax

1 Logical Formalisms Syntax

Proof Types Proof Systems

2 Natural Deduction

3 Additional Material

(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

(8)

Terminal Symbols

Propositional Calculus

Constants a,b,c, . . . Propositional Variables A,B,C, . . .

Unary Connective ¬ Binary Connectives ∧,∨,⇒

Punctuation (,),[,].

(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

(10)

Terminal Symbols

Propositional Calculus

Constants a,b,c, . . . Propositional Variables A,B,C, . . .

Unary Connective ¬ Binary Connectives ∧,∨,⇒

Punctuation (,),[,].

(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

(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 ·.

(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

(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 ·.

(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

(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 ·.

(17)

Propositional Formulas

hformulai ::= hpropositional variablei

| ¬hformulai

| hformulai ∧ hformulai

| hformulai ∨ hformulai

| hformulai ⇒ hformulai

A. Demaille Natural Deduction 9 / 49

(18)

Terms

htermi ::= hconstanti

| hfunctioni(htermi, . . .)

With the proper arity.

(19)

First Order Formulas

hformulai ::= hpropositional variablei

| ¬hformulai

| hformulai ∧ hformulai

| hformulai ∨ hformulai

| hformulai ⇒ hformulai

| hpredicatei(htermi, . . .)

| ∀hindividual variablei · hformulai

| ∃hindividual variablei · hformulai

With the proper arity.

A. Demaille Natural Deduction 11 / 49

(20)

Syntactic Conventions

Associativity ∧,∨ are left-associative (unimportant)

⇒ is right-associative (very important) Precedence (increasing)

1 ∀,∃

2

3

4

5 ¬

(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

(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}

(23)

Proof Types

1 Logical Formalisms Syntax

Proof Types Proof Systems

2 Natural Deduction

3 Additional Material

A. Demaille Natural Deduction 14 / 49

(24)

Different Proof Types

(25)
(26)
(27)
(28)
(29)

Proof Systems

1 Logical Formalisms Syntax

Proof Types Proof Systems

2 Natural Deduction

3 Additional Material

A. Demaille Natural Deduction 17 / 49

(30)

Proof Systems

Hilbertian Systems Natural Deduction Sequent Calculus

Natural Deduction in Sequent Calculus

(31)

Proof Systems

Hilbertian Systems Natural Deduction Sequent Calculus

Natural Deduction in Sequent Calculus

A. Demaille Natural Deduction 18 / 49

(32)

Proof Systems

Hilbertian Systems Natural Deduction Sequent Calculus

Natural Deduction in Sequent Calculus

(33)

Proof Systems

Hilbertian Systems Natural Deduction Sequent Calculus

Natural Deduction in Sequent Calculus

A. Demaille Natural Deduction 18 / 49

(34)

Axioms

Axioms are formulas that are considered true a priori

∀x·x+0=x Axiom schemesuse 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

(35)

Axioms

Axioms are formulas that are considered true a priori

∀x·x+0=x Axiom schemesuse 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

(36)

Axioms

Axioms are formulas that are considered true a priori

∀x·x+0=x Axiom schemesuse 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

(37)

Axioms

Axioms are formulas that are considered true a priori

∀x·x+0=x Axiom schemesuse 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

(38)

Inference Rules

H1 H2 · · · Hn

Rule name C

Axiom name A

(39)

Logical Formalisms

David Hilbert (1862–1943)

A. Demaille Natural Deduction 21 / 49

(40)

Hilbertian System

A single inference rule: themodus 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

(41)

Hilbertian System

A single inference rule: themodus 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

(42)

Hilbertian System

A single inference rule: themodus 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

(43)

Hilbertian System: Prove A ⇒ A

(A((AA)A))(AAA)AA A(AA)A

(AAA)AA AAA

AA

A. Demaille Natural Deduction 23 / 49

(44)

Hilbertian System: Prove A ⇒ A

(A((AA)A))(AAA)AA A(AA)A

(AAA)AA AAA

AA

(45)

Natural Deduction

1 Logical Formalisms

2 Natural Deduction Syntax

Normalization

3 Additional Material

A. Demaille Natural Deduction 24 / 49

(46)

Syntax

1 Logical Formalisms

2 Natural Deduction Syntax

Normalization

3 Additional Material

(47)

Deduction

Deduction

Adeduction is a tree whose root (A) is theconclusionand whose

active

leafs (Γ) is the set ofhypotheses.

Γ·

·· A Any formula Ais a valid hypothesis.

Proof (Demonstration)

Aproof is a deduction without hypotheses.

A. Demaille Natural Deduction 26 / 49

(48)

Deduction

Deduction

Adeduction is a tree whose root (A) is theconclusionand whoseactive leafs (Γ) is the set ofhypotheses.

Γ·

·· A Any formula Ais a valid hypothesis.

Proof (Demonstration)

Aproof is a deduction without hypotheses.

(49)

Deductions

What’s this?

A

A deduction of Aunder the hypothesis A.

A. Demaille Natural Deduction 27 / 49

(50)

Deductions

What’s this?

A A deduction of Aunder the hypothesisA.

(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 ofA (including 0) is discharged.

A. Demaille Natural Deduction 28 / 49

(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 ofA (including 0) is discharged.

(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 ofA (including 0) is discharged.

A. Demaille Natural Deduction 28 / 49

(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 ofA (including 0) is discharged.

(55)

Proving A ⇒ A in Natural Deduction

[A] ⇒I A⇒A

A. Demaille Natural Deduction 29 / 49

(56)

Proving A ⇒ A in Natural Deduction

[A] ⇒I A⇒A

(57)

Conjunction

··

· A

··

· B ∧I A∧B

··

· A∧B

∧lE A

··

· A∧B

∧rE B

A. Demaille Natural Deduction 30 / 49

(58)

Conjunction

··

· A

··

· B ∧I A∧B

··

· A∧B

∧lE A

··

· A∧B

∧rE B

(59)

Universal Quantification

··

· A[y/x]

∀I y 6∈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

(60)

Universal Quantification

··

· A[y/x]

∀I y 6∈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)

(61)

Universal Quantification

··

· A[y/x]

∀I y 6∈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

(62)

Absurd

··

⊥·

⊥E A

(63)

Disjunction

··

· A ∨lI A∨B

··

· B ∨rI A∨B

··

· A∨B

[A]·

·· C

[B]

··

· C ∨E C

A. Demaille Natural Deduction 33 / 49

(64)

Existential Quantification

··

· A[t/x]

∃I

∃x·A

··

∃x··A

[A[y/x]]

··

·

B ∃E y 6∈FV(B,hyp(B)) B

For elimination, y6∈hyp(B), i.e., not in the hypotheses other than the dischargedA.

(65)

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

(66)

Negation

[A]·

··

¬I

¬A

·· A·

··

¬A·

⊥ ¬E

Plus one of these equivalent formulations of the fact that classicalnegation is involutive.

XM A∨ ¬A

··

¬¬A·

¬¬

A

[¬A]·

·· B

[¬A]·

··

¬B

Contradiction A

(67)

Normalization

1 Logical Formalisms

2 Natural Deduction Syntax

Normalization

3 Additional Material

A. Demaille Natural Deduction 36 / 49

(68)

Cut

Cut: Introduction of a connective followed by its elimination.

·· A·

·· B·

∧I A∧B

∧lE A·

··

(69)

Normalization

Thenormalization process eliminates the cuts.

··

· A

··

· B ∧I A∧B

∧lE A

;

··

· A·

··

A. Demaille Natural Deduction 38 / 49

(70)

Normalizing Conjunctions

·· A·

·· B·

∧I A∧B

∧lE A·

··

;

··

· A·

··

··

· A

··

· B ∧I A∧B

∧rE ;

··

· B·

··

(71)

Normalizing Implications

··

· A

[A]·

··

B ⇒I A⇒B

⇒E B·

··

;

··

· A·

·· B·

··

A. Demaille Natural Deduction 40 / 49

(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.

(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

(74)

Additional Material

1 Logical Formalisms

2 Natural Deduction

3 Additional Material

(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

(76)

Edukera

(77)

Edukera

A. Demaille Natural Deduction 46 / 49

(78)

Edukera

http://edukera.appspot.com

8245EEC

(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

(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.

Références

Documents relatifs

In this paper, we introduce a semantics of realisability for the classical propositional natural deduction and we prove a correctness theorem.. This allows to characterize

It is well known that, when the underlying logic is the classical one (i.e. the absurdity rule is allowed) these connectives are redundant since, for example, ∨ and ∧ can be coded

A short (160p.) book addressing all the concerns of this course, and more (especially Linear Logic). Easy and pleasant

A short (160p.) book addressing all the concerns of this course, and more (especially Linear Logic). Easy and pleasant

, after each chapter title or sub-chapter title, a summary is proposed in the manner of ancient used to provide indications as to the contents of the text

In this course we show how some linear properties of Banach spaces, in particular properties related to the asymptotic structure of Banach spaces, are stable under

4- Describe an algorithmic method allowing, given a first-order formula Ψ to compute all the formulas Φ, up to α-equivalence, such that there exists some variable v and some term t

[r]