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

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

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

20

Propositional logic

Definition 1.41 Formulas F and G are provably equivalent if both {F } G and

{G} F .

Corollary 1.42 If F and G are provably equivalent, then they are equivalent.

Proof This follows immediately from Theorem 1.37.

Consider now the converses of Theorem 1.37 and its Corollaries. Theorem 1.37 states that if G can be derived from F , then G is a consequence of F . Is the opposite true? Can we derive from F every consequence of F ? Can every tautology be given a formal proof as in Example 1.40? If two formulas are equivalent, does this mean we can prove that they are equivalent? We claim that the answer to each of these questions is “yes.” We claim that every rule that is true in propositional logic, all infinitely many of them, can be derived from the rules in Tables 1.5 and 1.6. This is not obvious.

Example 1.43 It may seem that our list of rules is incomplete. For example, the formulas F and ¬¬F are clearly equivalent. So if we can derive the formula ¬¬F from a set of formulas F , then we should also be able to derive F from F . However this is not one of our rules. Double negation states that if F F , then F ¬¬F . We now show that the converse of Double negation, although not stated as a rule, can be derived from our rules.

Premise: F ¬¬F Conclusion: F F

Statement

Justification

 

 

 

1.

F ¬¬F

Premise

2.

F {¬F } ¬¬F

Monotonicity applied to 1

3.

F {¬F } ¬F

Assumption

4.

F {¬F } (¬F ¬¬F )

-Introduction applied to 3 and 2

5.

F {¬F } F

Contradiction rule (1.33) applied to 4

6.

F {F } F

Assumption

7.

F F

Proof by cases applied to 5 and 6

So not only are F and ¬¬F equivalent formulas, we can formally prove that they are equivalent formulas. We claim that each of the equivalences in the previous section are actually provably equivalent. In particular, we show that the Distributivity rules from Example 1.25 and DeMorgan’s rules from Example 1.26 can be given formal derivations.

Proposition 1.44 (DeMorgan’s rules) The equivalent pairs of formulas in Example 1.26 are each provably equivalent.

Propositional logic

21

Proof We prove this for the second of DeMorgan’s rules. We demonstrate formal proofs for each of the following:

(F G)} (¬F ¬G), and {(¬F ¬G)} ¬(F G).

 

Statement

Justification

 

 

 

 

 

 

 

1.

(¬F ¬G)} (F G)

-Introduction

 

 

2.

(F G)} ¬¬(¬F ¬G)

Contrapositive

 

 

3.

(F G)} (¬F ¬G)

Double negation

 

 

 

 

 

 

Statement

Justification

 

 

 

1.

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

Assumption

2.

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

Assumption

3.

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

-Elimination applied to 2

4.

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

-Elimination applied to 1 and 3

5.

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

-Symmetry applied to 2

6.

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

-Elimination applied to 5

7.

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

Proof by contradiction

 

 

applied to 4 and 6

 

 

 

We have demonstrated that ¬(F G) and (¬F ¬G) are provably equivalent. The verification of DeMorgan’s first rule is left as Exercise 1.23.

Proposition 1.45 ( -Distributivity) For any formulas F , G, and H, the formulas (F (G H)) and ((F G) (F H)) are provably equivalent.

Proof To prove this, we must derive each formula from the other. Instead of providing formal proofs, we outline the derivations and leave the details to the reader. First we show that (F G) (F H) can be derived from F (G H).

Premise: F F (G H).

Conclusion: F (F G) (F H)

We sketch a formal proof using Proof by cases. Assuming the premise, we show that (F G) (F H) can be derived from both F {G} and F {¬G}.

From the premise, we see that F {G} F . It follows that (F G) can be derived from F {G}. We then obtain F {G} (F G) (F H) by-Introduction.

22

Propositional logic

Next we show that F {¬G} (F G) (F H). From the premise we see that both F and (G H) can be derived from F {¬G}. Since, F {¬G} ¬G, we obtain F {¬G} H from (G H) by -Modus Ponens. It follows that F {¬G} (F H). Finally, we get F {¬G} (F G) (F H) by -Introduction.

We must also show that the converse holds.

Premise: F (F G) (F H)

Conclusion: F F (G H)

We prove this by twice applying -Elimination. Since (G H) can be derived from both (F G) and (F H), we obtain F (G H) by applying -Elimination to the premise. We obtain F F in the same manner. The conclusion then follows by -Introduction.

These arguments can be arranged as formal two-column proofs. We leave this as Exercise 1.24.

Proposition 1.46 ( -Distributivity) For any formulas F , G, and H, the formulas (F (G H)) and ((F G) (F H)) are provably equivalent.

Proof Exercise 1.25.

Of course, we do not need formal proofs to verify these equivalences. We could use truth tables. In the case of the Distributivity rules and DeMorgan’s rules, truth tables provide a more e cient method of verification than formal proofs. For now, the importance of Propositions 1.44, 1.45, and 1.46 is that they lend credence to our earlier claim that we can formally prove anything that is true in propositional logic. Later, these propositions will help us prove this claim.

At the outset of this section, we said we would be interested in the relationship between the notion of formal proof and the notion of consequence. We proved in Theorem 1.37 that if G can be formally proved from F then G is a consequence of F . We stated, without proof, that the opposite of this is also true: if F |= G then F G. So the symbol |= introduced in the previous section and the symbol introduced in the present section mean the same thing in propositional logic. This is the Completeness theorem for propositional logic, the proof of which will be given at the conclusion of this chapter.

1.5 Proof by induction

There are two types of proofs that must be distinguished. We have discussed and given several examples of formal proofs. This type of proof arises from the rules of the logic. Such proofs are said to take place within the logic, and we refer to them as internal proofs. Formal proofs have a limited scope. They can prove only sentences that can be written in the logic. In contrast, we may want to prove something about the logic itself. We may want to prove, say,

Propositional logic

23

that every sentence in the logic has a certain property. Such statements that refer to the logic itself generally can neither be stated nor proved within the logic. We give external proofs for such statements. External proofs are sometimes called meta-mathematical. However, this terminology belies the fact that external proofs are often more mathematical in nature than formal proofs.

Induction is a method of external proof that is used repeatedly in this book. Suppose that we want to prove that some property holds for every formula of propositional logic. For example, in the next section we show that each formula of propositional logic is equivalent to some formula in conjunctive normal form. We will define “conjunctive normal form” later. Our present concern is the question of how can we prove such a thing for all formulas. We need a systematic way to check each and every formula F . We do this by induction on the complexity of F . Induction on the complexity of F is analogous to mathematical induction.

1.5.1 Mathematical induction. Recall that mathematical induction is a method of proof that allows us to prove something for all natural numbers. For example, suppose we want to prove that for all natural numbers n, the number 11n 4n is divisible by 7. Using mathematical induction, we can do this in two steps. First, we show that the statement is true for n = 1. This is easy. Second, we show that if the statement holds for n = m for some m, then it also holds for n = m+1. This is the inductive step. In our example, we can do this by observing that 11m+1 4m+1 = 11m+1 11 · 4m + 7 · 4m = 11(11m 4m) + 7 · 4m. It follows that if 11m 4m is divisible by 7, then so is 11m+1 4m+1. This completes the proof. It’s like the domino e ect. It is true for n = 1, and so, by the second step of the proof, it must also be true for n = 2, and therefore n = 3, and n = 4, and so forth. We conclude that for every natural number n, 11n 4n is divisible by 7.

An example of mathematical induction that is more relevant to propositional logic is provided by the proof of Proposition 1.47. This proposition is a generalization of DeMorgan’s rules. First, we introduce some notation.

Notation 1 Let F1, . . . , Fn be formulas. We write

n

Fi to abbreviate F1 F2 . . . Fn, and

i=1

n

Fi to abbreviate F1 F2 . . . Fn.

i=1

Proposition 1.47 Let {F1, . . . , Fn} be a finite set of formulas. Then both

¬

n

Fi

n

¬Fi and ¬

n

Fi n

¬Fi .

 

 

 

 

 

 

 

i

 

 

i=1

 

i=1

 

 

i=1

=1

 

 

 

 

n

n

¬Fi) by induction on n.

Proof We show that ¬( i=1 Fi) ( i=1

24

 

 

 

 

 

Propositional logic

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

1

1

¬Fi). By

First, suppose n = 1. We need to show that ¬( i=1 Fi) ( i=1

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

the definitions of “

” and “ ,” this is the same as ¬(F1) (¬F1), which is true

by convention (C1).

 

 

 

 

that, for some m ≥ 1 and

 

 

Our

induction

hypothesis is

any

formulas

F1, . . . , Fm, we have

 

¬ m Fi m ¬Fi .

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

=1

 

 

 

i=1

 

 

 

We want to show that

 

i

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

¬ m+1 Fi m+1 ¬Fi .

 

 

 

 

 

 

 

 

=1

 

 

 

 

=1

 

 

 

 

 

 

 

 

i

 

 

 

i

 

 

 

 

 

 

 

we have

 

 

 

 

 

 

 

 

 

 

By the definition of

m+1

≡ ¬

m

Fi Fm+1 .

 

 

 

 

 

¬

Fi

i=1

 

 

 

 

 

 

 

=1

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

i

 

 

 

 

 

 

 

 

 

 

 

By DeMorgan’s rule we get

 

 

 

 

 

 

 

 

 

 

 

 

 

(1) ¬ m+1 Fi ≡ ¬ m Fi ¬Fm+1 .

 

 

 

 

 

 

 

=1

 

 

 

 

 

i=1

 

 

 

 

 

 

 

 

 

i

 

 

 

 

 

 

 

 

 

 

By our induction hypothesis,

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

¬ m Fi m ¬Fi .

 

 

 

 

 

 

 

 

=1

 

 

 

i=1

 

 

 

 

 

 

 

 

 

i

 

 

 

 

 

 

 

 

() Substituting this into (1) yields

 

 

 

 

 

 

 

 

 

 

¬ m+1 Fi m ¬Fi ¬Fm+1 .

 

 

 

 

 

 

 

=1

 

 

 

i=1

 

 

 

 

 

 

 

 

 

i

 

 

 

 

 

 

 

 

 

Finally, by the definition of

we arrive at

 

 

 

 

 

 

 

 

 

 

 

m+1

 

 

m+1

 

 

 

 

 

 

 

 

¬

 

Fi

 

¬Fi.

 

 

 

 

 

 

 

 

 

=1

 

 

i=1

 

 

 

 

 

 

 

 

 

i

 

 

 

 

 

 

We have shown that

(

m+1 F

)

(

m+1

¬

F

) as was required. We conclude

 

 

n

 

¬n

i=1

i

 

 

i=1

i

 

 

 

that ¬(

i=1 Fi) (

 

 

 

 

 

 

n.

 

 

 

 

 

 

 

i=1 ¬Fi) for any

 

 

 

 

 

 

 

The second equivalence of the

proposition follows from the first. Since

n+1

 

 

n+1

 

 

 

 

 

 

 

 

 

 

 

 

( i=1

¬Fi) ≡ ¬(

i=1 Fi) holds for any formulas Fi, it holds when each Fi

is replaced by ¬Fi:

 

n+1 ¬¬Fi ≡ ¬ n+1 ¬Fi .

 

 

 

 

 

 

 

 

 

 

 

 

 

 

i=1

 

 

 

 

 

 

=1

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

i

 

 

 

 

 

 

 

Propositional logic

25

Since these two formulas are equivalent, their negations are also equivalent:

 

 

 

¬ n+1

¬¬Fi ≡ ¬¬ n+1

¬Fi .

 

 

 

i

 

 

 

 

 

=1

i=1

 

n

n

 

 

Now ¬(

 

 

 

i=1 Fi) (

 

i=1 ¬Fi) by double negation.

Likewise, we can generalize the distributivity rules as follows.

Proposition 1.48 Let {F1, . . . , Fn} and {G1, . . . , Gm} be finite sets of formulas. The following equivalences hold:

n

Fi

m

Gj

 

n

m

(Fi Gj )

i

 

 

 

 

 

=1

Fi

j=1

 

 

 

i=1

j=1

(Fi Gj )

n

m

Gj

n

m

i

 

 

 

 

 

=1

 

j=1

 

 

 

i=1

j=1

 

Proof Exercise 1.27.

There is one unjustified step in the proof of Proposition 1.47. In the step labeled with (), we essentially said that if G ≡ G, then (G F ) (G F ). Although this substitution makes intuitive sense, we have not yet established this as a rule we may use. We validate this step in Theorem 1.49. We prove this theorem by induction on the complexity of formulas. We now describe this method of proof.

1.5.2 Induction on the complexity of formulas. Suppose we want to show that property P holds for every formula F . We can do this by induction on the complexity of F follows. First we show that every atomic formula possesses property P. This corresponds to verifying case n = 1 in mathematical induction. The atomic case is our induction basis. We then assume that property P holds for formulas G and H. This is our induction hypothesis. Our aim is to show that property P necessarily holds for ¬G, G H, G H, G → H, and G ↔ H. If we succeed at this, then we can rightly conclude that P holds for all formulas. This completes the proof.

Theorem 1.49 (Substitution theorem) Suppose F ≡ G. Let H be a formula that contains F as a subformula. Let H be the formula obtained by replacing some occurrence of F in H with G. Then H ≡ H .

Proof We prove this by induction on the complexity of H.

First suppose H is atomic. Then the only subformula of H is H itself. So F = H. It follows that H = G and, since F ≡ G, we have H ≡ H .

26 Propositional logic

Our induction hypothesis is that the conclusion of the theorem holds for formulas H1 and H2 each of which contains an occurrence of F as a subformula. That is, H1 ≡ H1 and H2 ≡ H2 whenever H1 and H2 are formulas obtained from H1 and H2 by replacing an occurrence of F with G.

Suppose H = ¬H1. Then H = ¬H1. Since H1 ≡ H1, we have ¬H1 ≡ ¬H1. It follows that H ≡ H as was required.

Suppose H is one of the following formulas: H1 H2, H1 H2, H1 → H2, or H1 ↔ H2. Since F is a subformula of H, F is a subformula of H1, a subformula of H2, or is H itself. If F = H, then we have H = F ≡ G = H as in the atomic case. So we may assume that the occurrence of F that is to be replaced by G occurs either in H1 or H2. With no loss of generality, we may assume that it occurs in H1.

If H = H1 H2 then H = H1 H2. In this case we have:

H1 H2 is true if and only if

both H1 and H2 are true if and only if

both H1 and H2 are true (since H1 ≡ H1) if and only if H1 H2 is true.

That is, H1 H2 ≡ H1 H2. Since H ≡ H1 H2, we have H ≡ H .

If H = H1 H2, then H = H1 H2. By the definition of , we have

H ≡ ¬(¬H1 ¬H2) and H ≡ ¬(¬H1 H2). It follows from the previous cases (corresponding to ¬ and ) that H ≡ H .

If H = H1 → H2, then H = H1 → H2. By the definition of , H ≡ (¬H1 H2 and H ≡ (¬H1 H2). It follows from the previous cases (corresponding to ¬ and ) that H ≡ H .

If H = H1 ↔ H2, then H = H1 ↔ H2. By the definition of , H ≡ (H1 → H2) (H2 → H1) and H ≡ (H1 → H2) (H2 → H1). It follows from the previous cases (corresponding to and ) that H ≡ H .

We conclude that for any formula H that contains F as a subformula,

H ≡ H .

In fact, this theorem remains true when “” is replaced by “provably equivalent.”

Theorem 1.50 Suppose that F and G are provably equivalent. Let H be a formula that contains F as a subformula. Let H be the formula obtained by replacing some occurrence of F in H with G. Then H and H are provably equivalent.

Proof The proof is similar to the proof of Theorem 1.49. Proceed by induction on the complexity of H. The induction hypothesis is that both

 

 

Propositional logic

27

H1

and H1

are provably equivalent, and

 

H2

and H2

are provably equivalent

 

where H1 and H2 are formulas obtained from H1 and H2 by replacing an occurrence of F with G. We want to verify in each of the five cases that H and H are provably equivalent. To do this, we refer to the rules in Tables 1.5 and 1.6 (whereas in the proof of Theorem 1.49 we referred to the semantics of propositional logic). We leave the details of this proof as Exercise 1.28.

The word “induction” indicates that we are reasoning from a particular case to the general case. Proofs by induction involve two steps and conclude that some statement holds in general for all natural numbers or for all formulas. These two steps are called the “base step” and the “induction step.” In mathematical induction, the base step is the step where we show that the statement is true for n = 1. If we are using induction on the complexity of formulas, then the base step is the step where we verify the statement holds for all atomic formulas.

The induction step for mathematical induction is the step where we show that, if the statement is true for n = m, then it is also true for n = m + 1. The induction step for induction on the complexity of formulas comprises five cases corresponding to ¬, , , , and . Note that, in the proof of Theorem 1.49, the cases corresponding to , , and followed quickly from the cases regarding ¬ and . This is because , , and were defined in terms of ¬ and . This suggests an alternative form for the induction step which we now describe.

Suppose we want to show that some property P holds for all formulas of propositional logic. To do this by induction on the complexity of formulas, we first show that P holds for all atomic formulas (the base step). For the induction step, instead of verifying the five cases as above, we can sometimes do just three cases. First we show that P is preserved under equivalence. That is, we show that if F ≡ G and G possess property P , then so does F . If this is true, then we only need to consider the cases corresponding to ¬ and . This su ces because every formula of propositional logic is equivalent to a formula that uses only ¬ and (and neither , , nor ). We demonstrate this version of the induction step in the next section where we prove that every formula in propositional logic is equivalent to a formula that is in conjunctive normal form.

1.6 Normal forms

In Example 1.27 we showed that the formula ((C D) A) ((C D) B) (E ¬E) is equivalent to the formula (A B) (C D) which is a disjunction of two conjunctions. In this section we show that there is nothing special about ((C D) A) ((C D) B) (E ¬E). Every formula of propositional logic

28

Propositional logic

is equivalent to a formula that is a disjunction of conjunctions. We begin with some definitions.

Definition 1.51 A literal is an atomic formula or the negation of an atomic formula, and we refer to these as being positive or negative, respectively.

Example 1.52 If A is an atomic formula, then A is a positive literal and ¬A is a negative literal.

Definition 1.53 A formula F is in conjunctive normal form (CNF) if it is a conjunction of disjunctions of literals. That is,

F =

n

m

Li,j

 

i

 

 

 

 

=1

j=1

 

 

where each Li,j is either atomic or a negated atomic formula.

Definition 1.54 A formula F is in disjunctive normal form (DNF) if it is a disjunction of conjunctions of literals. That is,

F =

n

m

Li,j

 

i

 

 

 

 

=1

j=1

 

 

where each Li,j is either atomic or a negated atomic formula .

Example 1.55

(A B) (C D) (¬A ¬B ¬D) is in CN F ,

(¬A B) C (B ¬C D) is in DN F , and

(A B) ((A C) (B D)) is neither CN F nor DN F .

Lemma 1.56 Let F be a formula in CNF and G be a formula in DNF. Then ¬F is equivalent to a formula in DNF and ¬G is equivalent to a formula in CNF.

Proof If F is in CNF, then F is the formula

n

m

 

 

 

Li,j

 

 

i=1 j=1

for some literals Li,j . The negation of this formula

¬F = ¬

n

m

Li,j

 

i

 

 

 

 

=1

j=1

 

 

Propositional logic

29

is equivalent to

 

m

Li,j

 

n

¬

 

 

 

j

 

 

i=1

 

=1

 

 

by Proposition 1.47. Likewise, by the same proposition, this is equivalent to

 

n

m

 

 

 

 

 

 

 

 

¬Li,j .

 

i=1 j=1

This formula is in DNF and is equivalent to ¬F .

Similarly, using Proposition 1.47 twice, we can prove that ¬G is equivalent to a formula in CNF.

Theorem 1.57 Every formula F is equivalent to some formula F1 in CNF and some formula F2 in DNF.

Proof We prove this by induction on the complexity of F .

First suppose F is atomic. Then F is already both CNF and DNF. So we can take F1 = F2 = F .

Our induction hypothesis is that the conclusion of the theorem holds for formulas G and H. That is, we suppose there exist formulas H1 and G1 in CNF and H2 and G2 in DNF such that H ≡ H1 ≡ H2 and G ≡ G1 ≡ G2.

The property of being equivalent to formulas in CNF and DNF is clearly preserved under equivalence. If F ≡ G, then, by our induction hypothesis, we can just take F1 = G1 and F2 = G2. It therefore su ces to verify only two more cases corresponding to ¬ and .

Suppose first that F has the form ¬G. Then F ≡ ¬G1 ≡ ¬G2. Since G1 is in CNF, ¬G1 is equivalent to a formula G3 in DNF by Lemma 1.56. Likewise, ¬G2 is equivalent to a formula G4 in CNF. So we can take F1 = G4 and F2 = G3.

Now suppose F has the form G H. Then F ≡ G1 H1 by substitution (Theorem 1.49). Since G1 and H1 are both in CNF, so is their conjunction.

It remains to be shown that F = G H is equivalent to a formula in DNF. Again using Theorem 1.49, F ≡ G2 H2. Since each of these formulas is in DNF, they can be written as follows:

G2 =

Mi and H2 = Nj

i

j

where each Mi and Nj is a conjunction of literals. We then have

F ≡ Mi Nj .

ij