Propositional Logic - Lecture Notes | MATH 387, Study notes of Discrete Mathematics

Material Type: Notes; Professor: Holmes; Class: Discrete and Foundational Mathematics; Subject: Mathematics; University: Boise State University; Term: Spring 2009;

Typology: Study notes

Pre 2010

Uploaded on 08/19/2009

koofers-user-gai-1
koofers-user-gai-1 🇺🇸

5

(2)

10 documents

1 / 158

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Math 387 Spring 2009 Lecture Notes
M. Randall Holmes
May 7, 2009
Contents
1 Introduction 3
2 Propositional Logic 3
2.1 January 20, 2009: levels of language, basic operations, truth
tables ............................... 4
2.2 January 21, 2009: adequacy of our basic operations; reducing
themtoofar............................ 9
2.3 January 23, 2009: proof strategy for natural deduction proofs 13
2.3.1 Conjunctions in proofs . . . . . . . . . . . . . . . . . . 13
2.3.2 Implications in proofs . . . . . . . . . . . . . . . . . . . 14
2.3.3 Biconditionals in proofs . . . . . . . . . . . . . . . . . 14
2.3.4 An example with conjunction and implication (and bi-
conditional) ........................ 14
2.3.5 Negation in proofs . . . . . . . . . . . . . . . . . . . . 16
2.3.6 Disjunction in proofs . . . . . . . . . . . . . . . . . . . 16
2.3.7 Discussion and more examples . . . . . . . . . . . . . . 16
2.4 HomeworkSet1: ......................... 18
2.5 January 26, 2009: Examples of natural deduction proofs. . . . 20
2.6 January 27, 2009: Lab I . . . . . . . . . . . . . . . . . . . . . 25
2.7 January 28, 2009: sequents and rules. . . . . . . . . . . . . . . 40
2.8 Homework2............................ 44
2.9 Jan 30, 2009: Proofs of correctness of sequent rules. . . . . . . 46
2.10 February 2, 2009: sample proof trees. . . . . . . . . . . . . . . 48
2.11 Tuesday, February 3, 2009: Lab II, worked on Homework II . . 50
1
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33
pf34
pf35
pf36
pf37
pf38
pf39
pf3a
pf3b
pf3c
pf3d
pf3e
pf3f
pf40
pf41
pf42
pf43
pf44
pf45
pf46
pf47
pf48
pf49
pf4a
pf4b
pf4c
pf4d
pf4e
pf4f
pf50
pf51
pf52
pf53
pf54
pf55
pf56
pf57
pf58
pf59
pf5a
pf5b
pf5c
pf5d
pf5e
pf5f
pf60
pf61
pf62
pf63
pf64

Partial preview of the text

Download Propositional Logic - Lecture Notes | MATH 387 and more Study notes Discrete Mathematics in PDF only on Docsity!

Math 387 Spring 2009 Lecture Notes

 - May 7, M. Randall Holmes 
  • 1 Introduction Contents
  • 2 Propositional Logic - tables 2.1 January 20, 2009: levels of language, basic operations, truth - them too far 2.2 January 21, 2009: adequacy of our basic operations; reducing
    • 2.3 January 23, 2009: proof strategy for natural deduction proofs
      • 2.3.1 Conjunctions in proofs
      • 2.3.2 Implications in proofs
      • 2.3.3 Biconditionals in proofs
        • conditional) 2.3.4 An example with conjunction and implication (and bi-
      • 2.3.5 Negation in proofs
      • 2.3.6 Disjunction in proofs
      • 2.3.7 Discussion and more examples
    • 2.4 Homework Set 1:
    • 2.5 January 26, 2009: Examples of natural deduction proofs.
    • 2.6 January 27, 2009: Lab I
    • 2.7 January 28, 2009: sequents and rules.
    • 2.8 Homework
    • 2.9 Jan 30, 2009: Proofs of correctness of sequent rules.
    • 2.10 February 2, 2009: sample proof trees.
    • 2.11 Tuesday, February 3, 2009: Lab II, worked on Homework II

2.12 Wednesday, February 4, 2009: multiple-conclusion sequents and rules; derivations of rules for disjunction and implication from those for negation and conjunction............. 51

3 Predicate or First-Order Logic 56 3.1 Friday, February 6, 2009: introduction to predicate sentences and quantifiers.......................... 56 3.2 February 9, 2009: sample proof trees and natural deduction proofs with quantifiers....................... 61 3.3 February 10, 2009 – Lab III, first stand-alone lab assignment. 63 3.4 Wednesday, February 11, 2009: some proof tree examples... 63

4 Formalized Arithmetic 65 4.1 Tuesday, February 17, 2009: discussion of test, introduction to formal arithmetic; formal rules for equality......... 65 4.2 February 18, 2009: multiple and restricted quantifiers; addi- tion of natural numbers is commutative!............ 68 4.3 Homework 3............................ 70 4.4 February 20th and 23d, 2009: Definition and properties of order in formal arithmetic.................... 71 4.5 February 24th, 2009: Lab IV................... 76

5 Completeness of first order logic 99 5.1 Soundness of our logic...................... 99 5.2 The cut rule and Marcel’s ThmCut command.......... 100 5.3 Completeness of our logic.................... 102

6 Constructions in set theory 106 6.1 March 2, 2009: introduction to set theory............ 106 6.2 March 3, 2009: lab V (continuation of Lab IV)......... 111 6.3 March 4th and 6th, 2009: implementation of mathematical concepts: (Zermelo) natural numbers, proof strategy for set theory, the ordered pair, basics of functions and relations... 111 6.3.1 Zermelo’s implementation of the natural numbers... 111 6.3.2 Proof strategy for set theory............... 115 6.3.3 Definition and basic properties of the ordered pair... 116 6.3.4 Basics of the theory of relations and functions; sizes of sets............................. 119

2.1 January 20, 2009: levels of language, basic opera-

tions, truth tables

I started by saying something about three layers of language.

formalized language: Formalized languages have precise definitions for all symbols employed and a precisely expressed grammar of allowed ex- pressions. The language of propositional logic that we introduce in this section is a formalized language. A computer language is a formalized language!

mathematical English: In mathematical English, we speak more or less naturally, though we are more careful about our grammar and our use of particular words may be governed by the technical meanings we assign them in mathematics. We hope that the formal rules of inference that we learn to apply to formalized languages will transfer to techniques of reasoning that we can use in writing proofs in mathematical English (and in fact I will talk about the relationships between these activities).

ordinary speech: Our ordinary language is filled with ambiguities and vague- nesses of meaning. We know this, yet we manage to get along somehow... It might be that learning how to reason very precisely in formalized lan- guages or in mathematical proofs may help us argue more convincingly in other areas of life, but other things are also at work there.

We begin defining the formalized language of propositional logic.

atomic sentences: For the moment, sentences with no internal structure are represented by capital letters A, B, C...

sentence variables: Script letters such as A, B, C are sentence variables, which may stand for any sentence at all (whether it has internal struc- ture or not). We will see the use of this shortly.

complex sentences: If A and B are any sentences, ¬A, (A ∧ B), (A ∨ B), (A → B), and (A ↔ B) are sentences.

These sentence forms ¬A, (A ∧ B), (A ∨ B), (A → B), and (A ↔ B) are read “not A”, “A and B”, “A or B”, if A, then B”, and “A if and only if B”. The precise intended meanings are explained below.

Note the use of sentence variables in the definition of complex sentences. The general sentence form (A ∧ B) (a conjunction) includes examples like ((A∨B)∧¬(C)), because the script letters A and B may themselves represent complex sentences. The use of parentheses above may appear excessive. We will adopt con- ventions of “order of operations” which allow many parentheses to be left out. However, since we are in the realm of formalized language, we need to spell out precisely what omissions we will allow (as we would when enabling order of operations in a computer language). We will do this below: until then we may drop parentheses in cases where confusion is unlikely. We introduce the semantics (fancy Greek term for “meaning”) of our constructions. Each sentence of our formal language is intended to be either true or false. More formally, we assign a value t or f to each sentence. Each atomic sentence may have the value t or f ; nothing in propositional logic allows us to decide which. The value of a sentence variable is determined by the structure of the sentence it represents. The value of a sentence ¬A is t if the value of A is f , and f if the value of A is t. This is more readily seen in a truth table.

A ¬A t f f t The operation denoted by ¬ is called negation and the sentence ¬A means “It is not the case that A”. We will give truth tables for each of the complex sentence constructions we have given. We do add that we firmly maintain that truth tables, while they are a useful technical tool, have nothing at all to do with how we ac- tually reason in formalized or unformalized language. They are very precise, however, which is an advantage.

A B A ∧ B t t t t f f f t f f f f

By promising her child that if he cleans up his room, she will order pizza, the mother seems to be saying A → B, where A means “the child cleans up his room” and B means “the mother orders pizza”. If the child cleans up his room and the pizza is ordered, the promise has been kept. If the child cleans up his room, and the mother does not order pizza, the promise has been broken: we feel that the mother was lying. If the child does not clean up his room and the mother orders pizza, the mother may be foolishly generous but she was not lying. If the child does not clean up his room and the mother does not order pizza, that is only to be expected. In each case, our feelings agree with the truth table given above. To see the discomfort one might feel with this, consider the statement “if 2+2=5, then Napoleon conquered China”. Our table above assures us that this is true. Our instinctive reaction is not so much that it is false but that the hypothesis has nothing to do with the conclusion. “if 2+2 = 5, then I like ice cream” (I do) leads to similar discomfort (it is judged true) and “If 2+2 = 4 then the first European settlement in Australia was at Botany Bay” (it was), which our table tells us is true, again leaves us unsatisfied because of the lack of a connection between the hypothesis and the conclusion. We find in practice that this is the most convenient definition of impli- cation. Experience should make us more comfortable with it. We note that this is not a modern folly of logicians: one of the schools of logic in classical antiquity (early in the Common Era) artived at the same conclusion as to what the definition of implication must be (I do not remember which one).

A B A ↔ B t t t t f f f t f f f t The operation represented by ↔ is called the biconditional and we read A ↔ B as “A if and only if B”, for which we use “A iff B” as an abbreviation. A ↔ B says that A and B have the same value. We have some additional remarks to make about the rhetoric of negation. Of course ¬¬A has the same value as A. Also, we do not say “It is not the case that it is not the case that A”, when what we want to say is just A. This is the famous issue of double negation.

When we negate an atomic sentence (how about A, defined as “Snow is white”, we do not say anything like “It is not the case that snow is white”: we say “Snow isn’t white”. Now consider ¬(A ∧ B). This could be read as “It is not the case that A and B”, but it seems safer to read it as “It is not the case both that A and B”, to avoid ambiguity. Notice that this is not anything we would really say. If A is “Snow is white” and B is “Violets are blue”, ¬(A ∧ B) should be read literally “It is not the case both that snow is white and violets are blue”, but one would be much more likely to say “Snow isn’t white or violets aren’t blue”, which reflects the following equivalence:

A B ¬ ( A ∧ B ) ¬ A ∨ ¬ B t t f t t t f t f f t t f t t f f f t t t f f t t f f t t f t f t f f t f f f t f t t f The fact recorded above is written ¬(A ∧ B) ≡ (¬A ∨ ¬B). This is one of what are called “de Morgan’s laws”. This says something more than ¬(A ∧ B) ↔ (¬A ∨ ¬B), though it does say this: it says that this is true no matter what sentences replace A and B. Similar facts which you might be asked to verify in homework are

  1. ¬(A ∨ B) ≡ (¬A ∧ ¬B) This is the other de Morgan law.
  2. A → B ≡ (¬A ∨ B)
  3. A ↔ B ≡ ((A → B) ∧ (B → A))

Notice that A ∧ B is equivalent to ¬¬(A ∧ B), which is in turn equiva- lent to ¬(¬A ∨ ¬B), so we can define conjunction in terms of negation and disjunction. The facts above show that implication can be defined in terms of negation and disjunction, and the biconditional can be defined in terms of conjunction and implication, both of which can be defined in terms of negation and disjunction. It is also possible to define disjunction in terms of negation and conjunc- tion in basically the same way, and then define implication and the bicondi- tional in terms of negation and conjunction as well.

2 n^ elements: this corresponds to the fact that a truth table for an expression containing n propositional letters has 2n^ lines. In constructing an element of Bn^ we make n independent choices from 2 alternatives: this is why Bn^ has 2 n^ arguments. We have just counted the rows in a truth table with n letters, or the elements of the domain of an n-ary truth function. We can do more than this: we can count how many n-ary truth functions there are. To define an n-ary truth function we assign a value (either t or f ) independently to the 2 n^ elements of the domain, so there are 2^2

n n-ary truth functions. This indicates why the “finiteness” of the method of truth tables can be overplayed. A real-life logic circuit may have 100 binary inputs, and may reasonably be supposed to have binary output depending in a truth- functional way on those inputs. This means that to analyze the behavior of the circuit with 100 inputs we need to consider 2^100 possible combinations of the input values, or about 10^30. This is an impracticably large number: the method of truth tables will not really work to analyze the behavior of logic circuits. Even worse, there are 2^2 100 possible different behaviors for a logic circuit with 100 inputs. To write this number down would take on the order of 10^30 digits in decimal notation. Spend some time contemplating just how ridiculously large this is. We take a moment to talk about order of operations. Our official notation has a lot of parentheses. We adopt conventions (just as we do in arithmetic) to avoid having to write so many. We apply operations in the following order when not forced to do so in a different order by parentheses: first ¬, then ∧, then ∨, then →, then ↔. So We can now answer Question 1 in the affirmative and say precisely what we mean by our affirmative answer.

Theorem: Every n-ary truth function f (p 1 ,... , pn) is associated with an expression involving propositional variables A 1 ,... , An and the opera- tions ¬, ∧, ∨ with the property that if each Ai has the truth value pi then the truth value of the expression is f (p 1 ,... , pn).

Proof: We do not give a formal proof, but illustrate a procedure which will give an expression with any desired truth table which shows why this is true. If we have a truth table with columns for each Ai and a final col- umn giving the truth value of an unknown expression, we can write

an expression with this truth table as a disjunction of conjunctions of propositional letters and negations of propositional letters (except in one special case). There will be a term in the disjunction for each row in the truth table for which the value of the unknown expression is t. This term will be a conjunction containing terms Ai if Ai is assigned the value t in that row and ¬Aj if Ai is assigned the value f in that row. The exceptional case is that in which there is no row in which the unknown expression has the truth value t. In this case the expression A 1 ∧¬A 1 will work: if one prefers to have every letter in the expression, one can throw all the other letters into the conjunction along with the contradiction. Here is an example of the procedure.

A B C ???

t t t t t t f f t f t f t f f t f t t t f t f f f f t t f f f f

is realized if ??? is taken to be

(A ∧ B ∧ C) ∨ (A ∧ ¬B ∧ ¬C) ∨ (¬A ∧ B ∧ C) ∨ (¬A ∧ ¬B ∧ C).

Now for Question 2. Our answer to this is also affirmative (in a sense we have too many logical operators of propositional logic) but it is really a “tongue-in-cheek” answer: in reality we really do not want to work with fewer basic operations, even though we can replace the set of three operations we have just shown to be adequate with a single operation! We showed above that ¬, ∧, ∨ are enough to define all operations on sentences which have truth tables. We also showed, at the end of the previous lecture, that we can define disjunction in terms of negation and conjunction

A ∨ B ≡ ¬(¬A ∧ ¬B)

negation: ¬A ≡ A ↓ A

disjunction: A ∨ B ≡ (A ↓ B) ↓ (A ↓ B)

conjunction: A ∧ B ≡ (A ↓ A) ↓ (B ↓ B)

It is very interesting and may occasionally be useful in formal arguments about propositional logic that we can reduce all the operations to one op- eration, but facts about the way we think drive our desire to have all the operations ¬, ∧, ∨, →, and even ↔ as basic operations. We would not reduce the reasoning techniques for all of these to rules for using | or even the more familiar ↓ because that does not reflect the way we actually reason. In the next lecture, we will start introducing the basic rules for reasoning with the constructions of propositional logic on an informal level which we hope will actually be helpful in writing proofs in mathematical English!

2.3 January 23, 2009: proof strategy for natural de-

duction proofs

In this lecture, we introduce strategies for dealing with statements in proofs based on their logical form. For each of the logical operators, we present two different kinds of strategies: one for proving a statement of that form and one for using a statement of that form which you have proved or shown to follow from your assumptions. The method of proof we are describing, presented in mathematical English in a highly structured form, we will call natural deduction. In this style of reasoning (which we will conduct here in symbols but which can also be done in (mathematical) English) we need to distinguish between statements which we are trying to prove, which we will call “goals” and statements which we have assumed or shown to follow from our assumptions (or proved unconditionally), which I might sometimes call “posits”, as in the Math 502 notes. Always be careful in a proof to distiguish between what you know or can assume on the one hand and what you are trying to prove or deduce from current assumptions on the other.

2.3.1 Conjunctions in proofs

To deduce a statement of the form A ∧ B from your current assumptions, deduce A from your current assumptions, and then deduce B from your

current assumptions. If you have shown that A ∧ B follows from your assumptions, you can further conclude that A follows from your assumptions and that B follows from your assumptions.

2.3.2 Implications in proofs

To deduce a statement of the form A → B from your current assumptions, add the new assumption A and adopt B as your new goal. If you succeed in deducing B, you can then conclude that A → B follows from your original assumptions (and drop the temporary assumption A). If you have shown that A → B follows from your current assumptions and that A follows from your current assumptions, then B also follows from your current assumptions. This is traditionally called the rule of modus ponens. A way to phrase modus ponens which starts out with just the implication sentence is this: if you have shown that A → B follows from current assump- tions, adopt A as a new goal: once you have deduced the goal A you will be able to draw the additional conclusion B.

2.3.3 Biconditionals in proofs

To show that A ↔ B follows from your current assumptions, prove that A → B follows from your current assumptions (use the strategy above) and that B → A follows from your current assumptions. If one has shown that A ↔ B follows from your current assumptions and that A follows therefrom, then B also follows. If one has shown that A ↔ B follows from your current assumptions and that B follows therefrom, then A also follows. Both sets of rules for the biconditional follow directly from the equivalence A ↔ B ≡ (A → B) ∧ (B → A) and the rules for conjunction and implication.

2.3.4 An example with conjunction and implication (and bicon- ditional)

We prove A → (B → C) ↔ A ∧ B → C.

Goal 1: A → (B → C) → (A ∧ B → C) Recall that to prove a biconditional we need to prove the implications in both directions. To prove the

All goals are now established and the proof is complete.

The indented structure should help you to see the structure of the proof, and in particular to see the scope of each assumption.

2.3.5 Negation in proofs

Negation and disjunction are perhaps a little trickier than conjunction and implication. To show that ¬A follows from your current assumptions, add a new as- sumption A and show that a contradiction B ∧ ¬B follows. (This is not proof by contradiction, but the direct proof of a negation; we will see proof by contradiction below). If you have shown that ¬¬A follows from your current assumptions, you can further conclude A Notice that I am not giving a general rule for using a negative conclusion. The strategy of proof by contradicton follows from these two rules. To show that a statement A (of any logical form) follows from your current assumptions, assume ¬A and deduce a contradiction. This is a direct proof of the negation ¬¬A, from which the further conclusion A can be drawn.

2.3.6 Disjunction in proofs

To show that A ∨ B follows from your current assumptions, make an addi- tional assumption ¬A and show that B follows. To show that A ∨ B follows from your current assumptions, make an additional assumption ¬B and show that A follows. Notice there are two similar symmetric strategies here. Here is something important I omitted from my lecture (but you will get it on Monday). Suppose we have shown that A ∨ B follows from our assumptions and we have a goal C (of any logical form). To show that C follows, show that it follows if we replace the assumption A ∨ B with A and also follows if we replace the assumption A∨B with B. This is the well-known strategy of proof by cases, which is the usual strategy for using a disjunction.

2.3.7 Discussion and more examples

The rules I have given so far are the official basic rules. There are other ones which we will use!

I gave two other rules for disjunction in class Friday, which actually follow from proof by cases with a little work. From A ∨ B and ¬A, deduce B. From A ∨ B and ¬B, deduce A. These come out of the fact that A ∨ B ≡ ¬A → B ≡ ¬B → A. I will show below how to deduce these rules (well, one of them) from proof by cases. A very important set of additional rules for implication follow from the equivalence of A → B with its contrapositive ¬B → ¬A.

proof by contrapositive: To show that A → B follows from our current assumptions, add a new assumption ¬B and deduce the new goal ¬A. (this is a proof of ¬B → ¬A, so if we show the equivalence of implica- tions with their contrapositives we justify this strategy.

modus tollens: From A → B and ¬B deduce ¬A. (from ¬B → ¬A and ¬B, ¬A follows by modus ponens).

We justify these additional rules of implication by the following proof.

Theorem: (A → B) ↔ (¬B → ¬A)

The proof of a biconditional falls apart into proofs of two implications.

Goal 1: (A → B) → (¬B → ¬A) We prove an implication in the usual way. Assume (1.1): A → B Goal 1.1: ¬B → ¬A Another implication! Assume: ¬B Goal 1.1.1: ¬A We now have a strategy for proving negations. Assume: A Goal 1.1.1.1: a contradiction From A and Assumption 1.1 we can deduce B by modus ponens. From B and ¬B (assumed above) we get the contradiction B ∧ ¬B, which achieves our goal. Goal 2: (¬B → ¬A) → (A → B) We use the usual strategy for implication.

  1. Again because of associativity, we can write A ∨ B ∨ C ∨ D and further things of that sort, using conjunction, disjunction, or biconditional to link any number of sentences (there is one more logical operation we can do this with.. .). The meaning of A ∨ B ∨ C ∨ D is quite obvious; the meaning of A ↔ B ↔ C ↔ D is rather less obvious. Do some investigation. Find out what A 1 ↔ A 2 ↔... ↔ An− 1 ↔ An means in general. There is a simple description, but it is not at all obvious without actually doing examples. Make truth tables for n = 3 and n = 4 and you might get an idea. I’m sure you can find this in a book somewhere. Please don’t.
  2. Write out A ↔ B using just the Sheffer stroke. Write it out using just neither-nor.
  3. Boolean algebra: There is a tradition of computational logic in which we write conjunction as it if it were multiplication and disjunction as if it were addition. The following logical equivalences written as algebraic equations look somewhat familiar (with some startling exceptions). We use 0 for f and 1 for t. We use −a for ¬a though this is not as good an analogy.

a + b = b + a ab = ba a + (b + c) = (a + b) + c (ab)c = a(bc) a(b + c) = ab + ac a + bc = (a + b)(a + c) a + 0 = a 1 a = a 0 a = 0 1 + a = 1 −(a + b) = (−a)(−b) −(−a) = a −(ab) = −a + −b a + −a = 1 a(−a) = 0

Identify the de Morgan laws on this list. Verify one of the distribu- tive laws using a truth table. If you find any of the other statements startling, feel free to verify them (you get points if you are first to identify an error). How would I most conveniently write a → b? Can you describe the relationship between the left hand and right hand columns of the table? (There is a simple description: moreover, if you

take any theorem of Boolean algebra and make the changes which take you from one column to the other, you get another theorem of Boolean algebra). Write an algebraic proof of the surprising distributive law a + bc = (a + b)(a + c) by first writing a + bc = −(−(a + bc)) (why can we do this?) then applying de Morgan’s law and the other distributive law. I’ve given you the general idea: write it out in detail.

  1. (more algebraic logic) Interpret 0 as false and 1 as true as in the previ- ous problem. Instead of considering the usual propositional operations as we do there, start with a familiar system of algebra involving just 0 and 1, namely mod 2 arithmetic. Which logical operation does mod 2 multiplication represent? Hint: it is familiar! Which logical operation does mod 2 addition represent? Hint: it is less familiar, but we have given a name for it and a truth table above. Notice that mod 2 addition is of course associative, so we have shown that another logical operation is associative. Now for a little more fun: suppose we interpret 0 as true and 1 as false. What logical operations do the addition and multiplication of mod 2 arithmetic represent then?

2.5 January 26, 2009: Examples of natural deduction

proofs.

On this day, we did some examples to illustrate the style of reasoning de- scribed the previous day. Here is an example using just conjunction and implication.

Prove: (A → B) ∧ (B → C) → (A → C)

It’s an implication.

Assume (1): (A → B) ∧ (B → C) Goal: (A → C) Assume: A