• Nenhum resultado encontrado

Three larger examples

No documento Types for Proofs and Programs (páginas 57-63)

2 Deriving constructive natural deduction rules from truth tables

2.1 Three larger examples

As examples we look in more detail at two ternary connectives and one binary connective.

The ternary connectives we treat are if-then-else, the “if-then-else” connective, andmost, the ternary connective that is true if at least 2 of the arguments are true. These have been discussed in finer detail in [7], notably the connectiveif-then-else. The binary connective that we study at the end of this section is thenand, written AB for nand(A, B). It is also known as theSheffer stroke, the well-known connective that is functionally complete classically, whereAB expresses¬(AB).

The truth tables ofmostandif-then-elseare as follows, where we denoteifAthenBelseC byAB/C.

A B C most(A, B, C) AB/C

0 0 0 0 0

0 0 1 0 1

0 1 0 0 0

0 1 1 1 1

1 0 0 0 0

1 0 1 1 0

1 1 0 1 1

1 1 1 1 1

From the lines in the truth table ofAB/Cwith a 0 we get the following four elimination rules.

`AB/C A`D B`D C`D

`D

`AB/C A`D `B C`D

`D

`AB/C `A B`D C`D

`D

`AB/C `A B `D `C

`D

Using Lemmas 9 and 12, these can be reduced to the following two. (The two rules on the first line reduce to else-el, the two rules on the second line reduce to then-el.)

These are not the only possible optimizations: the two rules on the left can also be combined into an “if-el” rule:

`AB/C B`D C`D if-el

`D

From the lines in the truth table ofAB/Cwith a 1 we get the following four introduction rules:

A`AB/C B`AB/C `C

`AB/C

A`AB/C `B `C

`AB/C

`A `B C`AB/C

`AB/C

`A `B `C

`AB/C

Using Lemmas 9 and 12 can be reduced to the following two. (The two rules on the first line reduce to else-in, the two rules on the second line reduce to then-in.)

A`AB/C `C

else-in

`AB/C

`A `B

then-in

`AB/C

Again, these are not the only possible optimizations: the two rules on the right can also be combined into an “if-in” rule:

`B `C if-in

`AB/C

In [7], we have studied the if-then-elseconnective in more detail, and we have shown that if-then-else, together with > and⊥ is functionally complete: all other constructive connectives can be defined in terms of it.

From the lines in the truth table of most(A, B, C) with a 0 we get the following four elimination rules.

`most(A, B, C) A`D B`D C`D

`D

`most(A, B, C) A`D B`D `C

`D

`most(A, B, C) A`D `B C`D

`D

`most(A, B, C) `A B`D C`D

`D

Using Lemmas 9 and 12, these can be reduced to the following three. If we would follow the naming conventions that we introduced earlier, we would have most-el1 =most-el00_, most-el2=most-el0_0 andmost-el3=most-el_00, but we will not pursue that naming here.

`most(A, B, C) A`D B`D

most-el1

`D

`most(A, B, C) A`D C`D

most-el2

`B

`most(A, B, C) B`D C`D

most-el3

`B

From the lines in the truth table of most(A, B, C) with a 1 we get the following four introduction rules:

A`most(A, B, C) `B `C

`most(A, B, C)

`A B `most(A, B, C) `C

`most(A, B, C)

`A `B C`most(A, B, C)

`most(A, B, C)

`A `B `C

`most(A, B, C)

T Y P E S 2 0 1 7

Using Lemmas 9 and 12 can be reduced to the following three.

`A `B

most-in1

`most(A, B, C)

`A `C

most-in2

`most(A, B, C)

`B `C

most-in3

`most(A, B, C)

The truth table fornand(A, B), which we write asAB is as follows.

A B AB

0 0 1

0 1 1

1 0 1

1 1 0

From this we derive the following 3 introduction and 1 elimination rule A`AB B`AB

↑-in00

`AB

A`AB `B

↑-in01

`AB

`A B`AB

↑-in10

`AB

`AB `A `B

`D ↑-el

The three introduction rules can be combined to two rules, so our optimized set of deduction rules fornand consists of three rules. We call thisnand-logic.

IDefinition 14. The logic with just the connectivenand and the three derivation rules below we define asnand-logic. We denote derivability in this logic by Γ`A.

A`AB

↑-inl

`AB

B`AB

↑-inr

`AB

`AB `A `B

`D ↑-el

We can define the usual connectives of intuitionistic proposition logic (Definition 13) in terms ofnandin the usual way. This gives rise to an embedding of intuitionistic proposition logic into thenand-logic.

IDefinition 15.

¬A˙ := AA

A∨˙ B := (AA)↑(BB) A∧˙ B := (AB)↑(AB) A→˙ B := A↑(BB)

This gives rise to the following interpretation of intuitionistic proposition logic intonand-logic.

p := ¬˙¬p˙ forpproposition letter (¬A) := ¬A˙

(AB) := A∨˙ B (AB) := A∧˙ B

As a side remark, the translation of a proposition letter pcould also be chosen to be pin stead of ˙¬¬p. Then the soundness statement below (Proposition 17) requires an additional˙ double negation: If Γ`iA, then Γ `¬˙¬A˙ . The connective ↑is very much a “negative connective” and the choice of ˙¬¬p˙ as translation ofprenders all formulasAnegative, so the double negation can be avoided.

Before proving the soundness of the interpretation we give some auxiliary lemmas.

ILemma 16. Innand-logic, we have the following.

1. For arbitrary propositions AandB,

¬˙¬(A˙ ↑B)`AB, 2. For every A,

¬˙¬˙¬A˙ `¬A.˙

3. For every proposition P from intuitionistic proposition logic,

¬˙¬P˙ `P.

4. For arbitrary propositions AandB, If Γ, A`B thenΓ,¬B˙ `¬A.˙

Proof. The following proves ˙¬¬(A˙ ↑B)`AB. Here Γ = ˙¬¬(A˙ ↑B), A, B, AB and the last↑-in rule denotes a successive application of↑-inl followed by↑-inr. Finally, the lowest↑-el has one premise more, which is an exact copy of the derivation of ˙¬¬(A˙ ↑B), A, B`¬(A˙ ↑B) that is given.

¬˙¬(A˙ ↑B), A, B`¬˙¬(A˙ ↑B)

Γ`AB Γ`A Γ`B

˙ ↑-el

¬¬(A˙ ↑B), A, B, AB`¬(A˙ ↑B)

↑-in

¬˙¬(A˙ ↑B), A, B`¬(A˙ ↑B)

↑-el

¬˙¬(A˙ ↑B), A, B`AB

================================================================↑-in

¬˙¬(A˙ ↑B)`AB

So, ˙¬¬˙¬A˙ `¬A˙ follows immediately, and similarly ˙¬¬P˙ `P for every propositionP from intuitionistic proposition logic.

Now, assuming that Γ, A`B, we can make the following derivation of Γ,¬B˙ `¬A, using˙ the fact that Γ, BB, A`B by weakening.

Γ, BB, A`BB Γ, BB, A`B Γ, BB, A`B

↑-el Γ, BB, A`AA

↑-in Γ, BB`AA

J We can now prove the soundness of the interpretation of intuitionistic proposition logic intonand-logic.

IProposition 17. IfΓ`iA, thenΓ`A.

Proof. The proof is by induction on the derivation of Γ`iA, so we have to show that the rules of intuitionistic proposition logic are sound inside nand-logic (after interpretation). We use Lemma 16, notably case (4), which we indicate explicitly in the derivations.

T Y P E S 2 0 1 7

¬-in: we show that¬-in of Definition 13 is derivable.

A`AA

↑-in A`AA

¬-el: we show that¬-el of Definition 13 is derivable.

`AA `A `A

`D ↑-el

∨-in: we show thatA`A∨˙ B is derivable.

A, AA`AA A, AA`A A, AA`A

↑-el A, AA`(AA)↑(BB)

↑-inl A`(AA)↑(BB)

∨-el: we show that the following rule is derivable (which suffices).

`A∨˙ B A`D B `D

`¬˙¬D˙

`(AA)↑(BB)

A`D

============16(4) DD`AA

B`D

============16(4) DD`BB DD`(DD)↑(DD) ↑-el

↑-inl

`(DD)↑(DD)

∧-el: we show thatA∧˙ B `¬˙¬A˙ is derivable.

A∧˙ B`(AB)↑(AB)

AA`AA A`A AA, A`AB ↑-el

↑-inl AA`AB

↑-el A∧˙ B, AA`A

======================================================16(4) A∧˙ B, AA`(AA)↑(AA)

↑-inl A∧˙ B`(AA)↑(AA)

∧-in: we show that the following rule is derivable (which suffices).

`A `B

`A∧˙ B

AB `AB `A `B

↑-el AB `(AB)↑(AB)

↑-inl

`(AB)↑(AB)

→-in: we show that the following rule is derivable (which suffices).

A`B

`A→˙ B

BB `BB A`B A`B

↑-el

→-el: we show that the following rule is derivable (which suffices).

`A→˙ B `A

`¬˙¬B˙

`A↑(BB) `A BB`BB BB`B ↑-el

=====================================16(4) BB`(BB)↑(BB)

↑-inl

`(BB)↑(BB)

J

The reverse of Proposition 17 does not hold. For example, 6`p∨ ¬p, forpa proposition letter, while (p∨ ¬p)= ( ˙pp)˙ ↑( ˙¬p˙ ↑¬˙p), where ˙˙ p:= ˙¬¬p. The proposition (A˙ ↑A)↑ ( ˙¬A↑¬A) is derivable in˙ nand-logic for anyA (note that ˙¬A=AA):

¬A˙ ↑¬A˙ `¬A˙ ↑¬A˙ AAA˙ AAA˙ AA,¬A˙ ↑¬A˙ `(AA)↑( ˙¬A↑¬A)˙ ↑-el

=============================================↑-in

`(AA)↑( ˙¬A↑¬A

There is also an obvious mapping fromnand-logic to intuitionistic proposition logic, by interpretingAB as¬(AB). As a matter of fact, it can also be shown in the joint system (i.e. where we add nand to intuitionistic proposition logic) thatAB and ¬(AB) are equivalent: AB` ¬(AB) and¬(AB)`AB. In presence of the implication and conjunction connective, the latter can be reformulated as`AB ←→ ¬(AB) (where, as usual, we letC←→D abbreviate (CD)∧(DC)).

IDefinition 18. We define the mapping (−) from nand-logic to intuitionistic proposition logic by defining

(AB):=¬(AB)

and further by induction on propositions. This mapping extends to sets of hypotheses Γ in the obvious way.

IProposition 19. IfΓ`A, thenΓ`iA.

Proof. By induction on the derivation. The only thing to show is that the rules↑-el,↑-inl and↑-inr are sound in intuitionistic proposition logic is we interpretAB as¬(AB). So we have to verify the soundness of the following rules.

A` ¬(AB)

` ¬(AB)

B ` ¬(AB)

` ¬(AB)

` ¬(AB) `A `B

`D

A simple inspection shows that these rules are sound in intuitionistic proposition logic. J We can now formulate a Glivenko-like theorem that relates nand-logic and intuitionistic proposition logic. (Glivenko’s theorem, e.g. see [22], relates intuitionistic and classical proposition logic via the double negation.)

IProposition 20. ForA a proposition of intuitionistic proposition logic,

`iA↑↓←→ ¬¬A .

T Y P E S 2 0 1 7

Proof. By induction on the structure ofA.

A=p, a proposition letter. Thenp↑↓= ( ˙¬¬p=¬(¬(pp)∧ ¬(pp))←→ ¬¬p.

AB. Then (¬B)↑↓= (BB)=¬(BB)←→ ¬¬¬B.

A=BC. Then (BC)↑↓ = ((BB)↑(CC)) =¬(¬(BB)∧ ¬(CC))←→

¬¬(BC).

For the equivalence¬(¬B∧ ¬C)←→ ¬¬(BC): from left to right, if ¬(BC), then

¬B and¬C, so we have a contradiction with¬(¬B∧ ¬C); from right to left, if¬B∧ ¬C, then¬B and so fromBC we deriveC, contradiction, so we derive¬(BC), but this contradicts¬¬(BC), so we conclude that¬(¬B∧ ¬C)

A=BC. Then (BC)↑↓ = ((BC)↑(BC)) =¬(¬(BC)∧ ¬(BC))←→

¬¬(BC).

A=BC. Then (BC)↑↓= (B↑(CC))=¬(B∧ ¬(CC))←→ ¬¬(BC).

For the equivalence¬(B∧ ¬C)←→ ¬¬(BC): From left to right, assume¬(BC);

if C, then BC, so from ¬(BC) we get ¬C; then if B we also haveB ∧ ¬C, contradicting¬(B∧ ¬C), so we have¬B; but from¬Bwe getBC. Contradiction, so we conclude¬¬(BC). From right to left: AssumeB∧ ¬C. ThenBC impliesC, contradiction, so¬(BC), contradicting¬(BC), so we conclude¬(B∧ ¬C). J ICorollary 21. ForA a proposition in intuitionistic proposition logic,

`i¬¬A ⇐⇒ `A.

Proof. If`i¬¬A, then`¬˙¬A˙ by Proposition 17, and so`¬˙¬A˙ by Lemma 16(1).

If`A, then`i A↑↓ by Proposition 19, so`i¬¬A by Proposition 20. J

No documento Types for Proofs and Programs (páginas 57-63)