Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:

Hedman. A First Course in Logic, 2004 (Oxford)

.pdf
Скачиваний:
140
Добавлен:
10.08.2013
Размер:
7.17 Mб
Скачать

10

Propositional logic

• |= F means every assignment models F . That is, F is a tautology.

So although |= has multiple interpretations, in context it is not ambiguous. The notion of consequence is closely related to the notion of “implies” dis-

cussed in Section 1.1. A formula G is a consequence of a formula F if and only if “F implies G” is always true. We restate this as the following proposition.

Proposition 1.19 For any formulas F and G, G is a consequence of F if and only if F → G is a tautology.

Proof We show that F → G is not a tautology if and only if G is not a consequence of F .

By the definition of “tautology,” F → G is not a tautology if and only if there exists an assignment A such that A |= ¬(F → G).

By the definition of “,” A |= ¬(F → G) if and only if A |= ¬(¬F G). By the semantics of propositional logic, A |= ¬(¬F G) if and only if both

A |= F and A |= ¬G.

Finally, by the definition of “consequence,” there exists an assignment A such that A |= F and A |= ¬G if and only if G is not a consequence of F .

Suppose we want to determine whether or not formula G is a consequence of a formula F . We refer to this as the consequence problem. By Proposition 1.19 this can be rephrased as a validity problem (since G is a consequence of F if and only if G → F is valid). Such problems can be resolved by computing a truth table. If the truth values for F → G are all 1s, then G is a consequence of F . Otherwise, it is not. In particular, if F is a contradiction, then G is a consequence of F regardless of G.

Example 1.20 Let F and G be formulas. Each of the following can easily be verified by computing a truth table.

(F G) |= F

F |= (F G)

(F ¬F ) |= G

Definition 1.21 If both G is a consequence of F and F is a consequence of G, then we say F and G are equivalent. We denote this by F ≡ G.

It follows from Proposition 1.19 that two formulas F and G are equivalent if and only if F ↔ G is a tautology. So we can determine whether two formulas F and G are equivalent by computing a truth table. Each of the equivalences in the following examples can easily be verified in this manner.

Example 1.22 For all formulas F and G, (F G) (G F ) and (F G) (G F ).

 

Propositional logic

11

Example

1.23 For any formula F and any tautology T ,

(F T ) ≡ F and

(F T ) ≡ T .

 

Example

1.24 For any formula F and any contradiction

, (F )

and (F ) ≡ F .

 

Example 1.25 (Distributivity rules) The following two equivalences exhibit the distributivity rules for and . For all formulas F , G, and H,

(F (G H)) ((F G) (F H)) and

(F (G H)) ((F G) (F H)).

Example 1.26 (DeMorgan’s rules) For all formulas F and G

¬(F G) (¬F ¬G), and

¬(F G) (¬F ¬G).

The equivalences in the previous examples are basic. Note that we refer to some of these equivalences as “rules.” Each of these holds true for arbitrary formulas. From these basic equivalences, more elaborate equivalences can be created.

Example 1.27 Using the equivalences in the previous examples, we show that ((C D) A) ((C D) B) (E ¬E) (A B) (C D). Let L denote the formula on the left in this equivalence. Note that (E ¬E) is a tautology. By Example 1.23, L is equivalent to ((C D) A) ((C D) B). According to the second distributivity rule in Example 1.25, this is equivalent to (C D) (A B) (viewing (C D) as the formula F in that rule).

By Example 1.22, this is equivalent to (A B) (C D) which is the formula on the right in our equivalence.

Using the basic rules in Examples 1.22–1.26, we were able to verify that ((C D) A) ((C D) B) (E ¬E) (A B) (C D). This is itself a rule, holding for any formulas A, B, C, D, and E. Alternatively, we could have verified this equivalence by computing a truth table. Such a truth table would have had 25 = 32 rows. The previously established rules provided a more e cient method of verification.

Likewise, we could state “rules for consequence” that would allow us to show that one formula is a consequence of another without having to compute truth tables. In the next section, we exploit this idea and introduce the notion of formal proof. Formal proofs allow us to “derive” formulas from sets of formulas. The following definition extends the notion of consequence to this setting.

12

Propositional logic

 

 

Definition 1.28 Let F = {F1, F2, F3, . . .} be a set of formulas.

 

 

 

For any assignment A, we say A models F , denoted A |= F if A |= Fi for

each formula Fi in F .

 

 

 

We say a formula G is a consequence of F , and write F |= G, if A |= F

implies A |= G for every assignment A.

 

 

 

Suppose that we want to determine whether a formula G is a consequence

of a set of formulas F . If F is finite, then we could consider the conjunction

F

of all formulas in F and compute a truth table for F → G. This method

would

 

 

certainly produce an answer. However, if the set F is large, then computing such a truth table is neither an e cient, nor a pleasant, thing to do. If F is infinite, then this method does not work at all. Another approach is to derive G from F . Consider the following example.

Example 1.29 Let F be the following set of formulas

{A, (A → B), (B → C), (C → D), (D → E), (E → F ), (F → G)}.

Suppose each of the seven formulas in F is true. Then, in particular, A and A → B are true. It follows that B must also be true. Likewise, since B and B → C are true, then C must also be true, and so forth. If each formula in F is true, then A, B, C, D, E, F , and G are true. Each of these formulas is a

consequence of F . We do not need a truth table to see this.

Let F be the conjunction of all formulas in F . That is,

F = A (A → B) (B → C) (C → D) (D → E) (E → F ) (F → G).

The truth table for F → G comprises 128 rows. Without computing a single

row, we can see that each row will have truth value 1. The formula

F →

G is

a tautology and, equivalently, G is a consequence of F .

 

In the previous example, we repeatedly used the fact that if X and X → Y are both true, then Y is also true. That is, we used the fact that Y is a consequence of X (X → Y ). This follows from the truth table we computed in Example 1.16. Rather than compute another truth table (having 128 rows), we used a truth table we have already computed (having only four rows) to deduce that G is a consequence of F . We derived G from F using a previously validated rule.

1.4 Formal proofs

A logic, by definition, has rules for deducing the truth of one sentence from that of another. These rules yield a system of formal proof. In this section, we describe such a proof system for propositional logic.

Propositional logic

13

A proof system consists of a set of basic rules for derivations. These rules allow us to deduce formulas from sets of formulas. It may take several steps to derive a given formula G from a set of formulas F , where each “step” is an application of one of the basic rules. The list of these steps forms a formal proof of G from F .

Of particular interest is the relationship between the notion of formal proof and the notion of consequence. We want a proof system that is sound. That is, we want the following property to hold.

(Soundness) If a formula G can be derived from a set of formulas F , then G is a consequence of F .

If a proof system is sound, then it provides an alternative to truth tables for determining whether a formula G is a consequence of a set of formulas F . In this section, we present a proof system and prove that it is sound. We use this proof system in several examples. The proof system we introduce is intended to be user-friendly. To construct a proof deriving G from F , one may consider the question: why is G a consequence of F ? The object is then to translate one’s reasoning into a formal proof. Although this process is necessarily pedantic, the large yet coherent set of basic rules we provide is intended to aid the translation of thought into formal proof.

The aim of a formal proof system is to make the thought process infallible. Ideally, the proof system could replace the thought process. Instead of thinking, we could blindly follow a set of rules. If two people disagree about whether G truly is a consequence of F , there would be no need for debate. Both parties could perform a computation to see whether or not G is indeed a consequence of F . The reason that “not thinking” is ideal is that we could program a computer to perform this task. In Section 1.8, we introduce another proof system known as resolution. Resolution is a pared down proof system that takes the thinking out of formal proofs. Whereas resolution is intended for the mechanization of proofs, the proof system we describe in the present section is intended for human use.

We now list the basic rules for our proof system. The veracity of many of these rules is self-evident. For example, if F and G can be derived from F , then F G can also be derived from F . We call this rule “ -Introduction.” We use the following notation: we write F G to abbreviate “G can be derived from F .” Using this notation, -Introduction is written as:

if F F and F G then F (F G).

Table 1.5 lists this and other basic rules for derivations.

14

 

Propositional logic

 

 

Table 1.5 Basic rules for derivations

 

Premise

Conclusion

Name

 

 

 

 

 

G is in F

F G

Assumption

 

F G and F F

F G

Monotonicity

 

F G

F ¬¬G

Double negation

 

F F , F G

F (F G)

-Introduction

 

F (F G)

F F

-Elimination

 

F (F G)

F (G F )

-Symmetry

 

F F

F (F G)

-Introduction

 

F (F G),

 

 

 

F {F } H, F {G} H F H

-Elimination

 

F (F G)

F (G F )

-Symmetry

 

F {F } G

F (F → G)

-Introduction

 

F (F → G), F F

F G

-Elimination

 

F F

F (F )

(, )-Introduction

 

F (F )

F F

(, )-Elimination

 

F ((F G) H)

F (F G H)

-Parentheses rule

 

F ((F G) H)

F (F G H)

-Parentheses rule

Table 1.6 More rules for derivations

Rules

Name

 

 

F (F G) if and only if F ¬(¬F ¬G)

-Definition

F (F → G) if and only if F (¬F G)

-Definition

F (F ↔ G) if and only if both F (F → G) and F (G → F )

-Definition

There are a lot of rules. Note the organization of the list. It begins with a couple of rules that are quite intuitive: Assumption and Monotonicity. There follow a few similarly named rules for various symbols of propositional logic. The four rules that conclude the list reflect conventions (C1) and (C2). In addition to the rules in Table 1.5, we have the rules in Table 1.6 regarding the definitions of , , and .

Our list of rules is both too big and too small. It is too big in the sense that some of these rules are redundant. For example, since can be expressed in terms of ¬ and , -Symmetry follows from -Symmetry (see Exercise 1.13). We could pare these redundant rules from our list. In fact, we really need only

Propositional logic

15

three rules! These rules must be phrased within the proper context and are the topic of Section 1.8. Our present concern is not economy, but utility. These rules allow us to derive formulas from other formulas. The more rules at our disposal, the better. In this sense, the above list is too small. As we shall see, there is no end to the rules that can be derived from those stated above.

Having listed these rules for derivations, we now define “formal proof.”

Definition 1.30 A formal proof in propositional logic is a finite sequence of statements of the form “X Y ” (where X is a set of formulas and Y is a formula) each of which follows from the previous statements by one of the rules in Table 1.5 or Table 1.6. We say that G can be derived from F if there is a formal proof concluding with the statement F G.

A formal proof can always be put into two-column form. The best way to describe formal proofs is to give an example.

Example 1.31 Let H = {(¬A B), (¬A C), (A ¬D)}.

We derive the formula D → (A B C) from H.

Statement

Justification

 

 

 

1.

H {D} D

Assumption

2.

H {D} (A ¬D)

Assumption

3.

H {D} (¬D A)

-Symmetry applied to 2

4.

H {D} (D → A)

-Definition applied to 3

5.

H {D} A

-Elimination applied to 4 and 1

6.

H {D} (¬A B)

Assumption

7.

H {D} (A → B)

-Definition applied to 6

8.

H {D} B

-Elimination applied to 7 and 5

9.

H {D} (¬A C)

Assumption

10.

H {D} (A → C)

-Definition applied to 9

11.

H {D} C

-Elimination applied to 10 and 5

12.

H {D} (A B)

-Introduction applied to 5 and 8

13.H {D} ((A B) C) -Introduction applied to 12 and 11

14.H {D} (A B C) -Parenthesis rule applied to 13

15.H (D → (A B C)) -Introduction applied to 14

16. H D → (A B C)

(, )-Elimination

At first glance, the above proof looks like a complicated way of demonstrating a fact that is not so complicated. However, reading the proof line-by-line we see that each line asserts a simple truth that is easy to verify. Proofs can be made

16

Propositional logic

more succinct by using additional rules. For example, note that in the previous proof we repeatedly introduced the symbol only to eliminate it. Instead, we could have separately proved the following rule.

Premise: F (¬F G), F F Conclusion: F G

Statement

Justification

 

 

 

1.

F F

Premise

2.

F (¬F G)

Premise

3.

F (F → G)

-Definition applied to 2

4.

F G

-Elimination applied to 3 and 1

The proof in Example 1.31 essentially repeats the above argument three times. We can treat this four-line proof as a subroutine. Had we established this rule prior to Example 1.31, we could have referred to it three times to make the proof more concise. For lack of a better name, we christen this rule -Modus Ponens. “Modus ponens” is a standard name for the rule we call -Elimination. As the archaic name suggests, this rule has been around for a while. It is found in what can be considered the origin of formal proofs: Euclid’s Elements. The next five examples establish some other rules that facilitate the construction of proofs.

Example 1.32 (Tautology rule) This rule states that, for any formula G, (¬G G) can be derived from any set of formulas.

Premise: None Conclusion: F (¬G G)

Statement

Justification

 

 

1. F {G} G

Assumption

2.F (G → G) -Introduction applied to 1

3.F (¬G G) -Definition applied to 2

Example 1.33 (Contradiction rule) This rule states that any formula G can be derived from the contradiction F ¬F .

Premise: F (F ¬F )

Conclusion: F G

 

 

Propositional logic

17

 

 

 

Statement

Justification

 

 

 

 

 

1.

F (F ¬F )

Premise

 

2.

F (¬F F )

-Symmetry applied to 1

 

3.

F ¬F

-Elimination applied to 2

 

4.

F (¬F G)

-Introduction applied to 3

 

5.

F F

-Elimination applied to 1

 

6.

F G

-Modus Ponens applied to 4 and 5

 

Example 1.34 (Contrapositive) This is the rule of logic that states that if p implies q, then ¬q implies ¬p.

Premise: F {F } G Conclusion: F {¬G} ¬F

Statement

Justification

 

 

 

1.

F {F } G

Premise

2.

F {F } ¬¬G

Double negation applied to 1

3.

F (F → ¬¬G)

-Introduction applied to 2

4.

F (¬F ¬¬G)

-Definition applied to 3

5.

F (¬¬G ¬F )

-Symmetry applied to 4

6.

F (¬G → ¬F )

-Definition applied to 5

7.

F {¬G} (¬G → ¬F )

Monotonicity applied to 6

8.

F {¬G} ¬G

Assumption

9.

F {¬G} ¬F

-Elimination applied to 6 and 8

Example 1.35 (Proof by cases) This rule provides a useful way to structure a proof.

Premise: F {F } G, F {¬F } G

Conclusion: F G

Statement

Justification

 

 

 

1.

F {F } G

Assumption

2.

F {¬F } G

Assumption

3.

F (¬F F )

Tautology rule

4.

F G

-Elimination applied to 3, 2, and 1

18

Propositional logic

Example 1.36 (Proof by contradiction) Another way to structure a proof is by contradiction. As the following proof indicates, proof by contradiction is (in this context) essentially the contrapositive of proof by cases.

Premise: F {F } G, F {F } ¬G

Conclusion: F ¬F

Statement

Justification

 

 

 

1.

F {F } G

Premise

2.

F {¬G} ¬F

Contrapositive applied to 1

3.

F {F } ¬G

Premise

4.

F {¬¬G} ¬F Contrapositive applied to 3

5.

F ¬F

Proof by cases applied to 2 and 4

These are now established rules that may henceforth be used to justify statements in proofs. By “established” we mean that these rules are true, provided that the rules in Table 1.5 are true. We must prove that this is the case. We must prove that our proof system is sound: that if G can be derived from F , then G is in fact a consequence of F .

Theorem 1.37 (Soundness) If F G, then F |= G.

Proof If F G, then there is a formal proof concluding with F G. Each line of the proof contains a statement of the form X Y which is justified by one of the rules in Tables 1.5 or 1.6. We want to show that for each line of the proof, if X Y , then X |= Y . This can be accomplished by verifying each rule in the tables one-by-one. We demonstrate this by verifying three rules: Assumption,-Elimination, and -Introduction. The verification of the remaining rules are left as an exercise.

We begin with the first rule of Table 1.5: Assumption. The conclusion of this rule is that F G. We must show, under the premise of this rule, that F |= G. But this is clear since the premise states that G is in F (if A models F then A must model G).

Refer next to -Elimination. This rule states that if F (F G), then F F . We must show that if F |= (F G), then F |= F . That is, we must show that F is a consequence of (F G). This is verified by the following truth table.

F

G

(F G)

((F G) → F )

0

0

0

1

0

1

0

1

1

0

0

1

1

1

1

1

 

 

 

 

Propositional logic

19

Now consider -Introduction. This rule states that if F {F } G then F (F → G). To verify this, we must show that if F {F } |= G then F |= (F → G). Assuming that F {F } |= G, we want to show that, for any assignment A, if A |= F , then A |= (F → G).

So suppose that A |= F and A(F ) is defined. If A(F ) = 0, then A |= (F → G) regardless of the value of A(G). If, on the other hand, A(F ) = 1, then A |= F {F }. By our assumption, A |= G. In any case, we see that A |= (F → G). Since A was an arbitrary assignment modeling F , we conclude that F |= (F → G) as was required.

Essentially, we must verify that each rule is true when is replaced by |=. For most of the rules, like -Elimination, this can be accomplished by computing a small truth table. For the last four rules of Table 1.5, there is really nothing to prove. These four rules hold by conventions (C1) and (C2). Also, each rule in Table 1.6 is sound by virtue of the definitions of , , and . We leave the verification of the remaining rules in Table 1.5 as Exercise 1.22.

Formal proofs provide a method for showing that a formula is a consequence of other formulas. The following Corollaries state that formal proofs can also show that a formula is valid or unsatisfiable.

Corollary 1.38 If G can be derived from the empty set, then G is a tautology.

Proof If G, then, by Monotonicity, F G for every set of formulas F . By Theorem 1.37, F |= G for every set of formulas F . It follows that A |= G for any assignment A and G is a tautology.

Corollary 1.39 If ¬G can be derived from the empty set, then G is a contradiction.

Proof This is immediate from the previous Corollary and the definition of “contradiction.”

Example 1.40 The following formal proof shows that ((A → B) A) is a tautology.

Statement

Justification

 

 

 

1.

{¬A} ¬A

Assumption

2.

{¬A} (¬A B)

-Introduction applied to 1

3.

{¬A} (A → B)

-Definition applied to 2

4.

{¬A} ((A → B) A)

-Introduction applied to 3

5.

{A} A

Assumption

6.

{A} (A (A → B))

-Introduction applied to 5

7.

{A} ((A → B) A)

-Symmetry applied to 6

8.

((A → B) A)

Proof by cases applied to 4 and 7

Formal proofs can also show that two formulas are equivalent.