propositional logic - university of...

24
Chapter 5 Propositional Logic A proposition is a statement of some alleged fact which must be either true or false, and cannot be both. It is important to note the status of this statement: this is not some emergent property of things that exist called “propositions”. Rather it is implicit in the definition of the mathematical (or philosophcal) objects that we term propositions. When we choose to view something as a proposition, it is precisely because we are prepared to sign up to these conditions, just as when we choose to call something a “set” we accept that order and repetition can have no role to play. Thus, if we choose to call “it is raining”a proposition, we are accepting that there will be no quibbling along the lines of “well, it’s sort of raining, but not quite, although I wouldn’t say it isn’t raining”. Similarly, we can’t play games like “of course, it must be raining somewhere, but not here”. If we want to allow for more complex situations like these, the route is easy: don’t use propositions! Here are some examples of pretty good candidates to be called proposi- tions: 1. Paris is the capital of France. 2. Jennifer is a popular English boy’s name. 3. 2 + 3 = 8 4. Hatfield is north of London. Propositions 1 and 4 above have the value “true”; propositions 2 and 3 have the value “false”. Exercise 5.1 Which of the following are good candidates to be called propo- sitions? (A non-trivial exercise!) 1. Come back to my place, baby! 79

Upload: others

Post on 29-May-2020

5 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Propositional Logic - University of Hertfordshirejspring.cs.herts.ac.uk/7COM1023_Prop_Logic_Notes.pdf · Propositional Logic A proposition is a statement of some alleged fact which

Chapter 5

Propositional Logic

A proposition is a statement of some alleged fact which must be either trueor false, and cannot be both. It is important to note the status of thisstatement: this is not some emergent property of things that exist called“propositions”. Rather it is implicit in the definition of the mathematical(or philosophcal) objects that we term propositions. When we choose toview something as a proposition, it is precisely because we are preparedto sign up to these conditions, just as when we choose to call something a“set” we accept that order and repetition can have no role to play. Thus,if we choose to call “it is raining”a proposition, we are accepting that therewill be no quibbling along the lines of “well, it’s sort of raining, but notquite, although I wouldn’t say it isn’t raining”. Similarly, we can’t playgames like “of course, it must be raining somewhere, but not here”. If wewant to allow for more complex situations like these, the route is easy: don’tuse propositions!

Here are some examples of pretty good candidates to be called proposi-tions:

1. Paris is the capital of France.

2. Jennifer is a popular English boy’s name.

3. 2 + 3 = 8

4. Hatfield is north of London.

Propositions 1 and 4 above have the value “true”; propositions 2 and 3have the value “false”.

Exercise 5.1 Which of the following are good candidates to be called propo-sitions? (A non-trivial exercise!)

1. Come back to my place, baby!

79

Page 2: Propositional Logic - University of Hertfordshirejspring.cs.herts.ac.uk/7COM1023_Prop_Logic_Notes.pdf · Propositional Logic A proposition is a statement of some alleged fact which

2. I have stopped smoking.

3. (> 3 2)

4. (= x 3)

5. Not all statements are propositions.

6. There is a number less than seven and greater than nine.

7. 3 × 4 = 8.

8. Formal notations give me a headache.

9. Is this really mathematics?

We can express the properties of propositions as three laws. Here are thefirst two:

Law 5.1 (Excluded Middle) A proposition is true or false, there can beno middle ground.

Law 5.2 (Contradiction) A proposition cannot be both true and false.

These laws are not optional! They define what it means for something tobe a proposition. It is inconceivable for the laws to be broken.

Our first two laws tell us that we can see any proposition as having justone of two possible values. Because the logic was developed originally totalk about human reasoning . . . i.e. natural language propositions . . . it wasnatural to call these values “true” and “false”. However, we could just aswell view the two values as “1” and “0” (or “0” and “1”), or as “on” and“off”, or “yes” and “no”, or “hot” and “cold”, or “full” and “empty”. Theonly criteria for the two values are that there are only two of them, and thateach can be viewed in some sense as the “opposite” of the other.

5.1 A Language for Representing Propositions

Here’s the definition of the formal language we are going to use to representpropositions.

The alphabet is

{P, Q, R, . . . , P1, Q1, . . . ,∧,∨, =⇒,⇐⇒,¬, (, )}

The letters are going to be use to denote proposition: we include enoughsymbols from P, Q, R, . . ., subscripted if necessary, to ensure that we neverrun out. We call propositions denoted by a single letter “simple”. Therest of our language is used to construct more complex forms out of simplepropositions: these more complex forms are called “compund” propositions.

80

Page 3: Propositional Logic - University of Hertfordshirejspring.cs.herts.ac.uk/7COM1023_Prop_Logic_Notes.pdf · Propositional Logic A proposition is a statement of some alleged fact which

You might like to think of the analogy with arithmetic: “5” is a simplenumber, “4+3” is another number, 7, but it is expressed in a compoundform, in terms of two simple numbers “4” and “3”. We will call the wffs inour language sentences, as that is the common term in logic. We need toconsider both the syntax and semantics of these compound forms: we willstart with the syntax.The syntax1 is given by the grammar rule

〈sentence〉 = P | Q | R | . . . | P1 | Q1 . . .| ¬〈sentence〉| ( 〈sentence〉 ∨ 〈sentence〉 )| ( 〈sentence〉 ∧ 〈sentence〉 )| ( 〈sentence〉 =⇒ 〈sentence〉 )| ( 〈sentence〉 ⇐⇒ 〈sentence〉 )

We can illustrate the grammatical structure of compound propositionswith parse trees (we will return to these later in the course). Here are theparse trees for the two expressions (P ∧ Q) and (¬P ∨ (Q ∧ R)).

sentence

sentence sentence( )

sentence ( sentence sentence )

¬��sentence Q R

v

^

sentence

sentence sentence( )

P Q

^

( )

P

Figure 5.1: Parse Trees

We shall allow ourselves to drop the outermost pair of brackets whichthe grammar rule generates round any sentence which is a string of morethan two symbols. So, we shall write P ∧Q, rather than (P ∧Q). Of course,

1The grammar is given using a slightly different meta-language to that seen earlier inthe course. By this stage, however, you should be able to understand simple variants likethis without too much difficulty.

81

Page 4: Propositional Logic - University of Hertfordshirejspring.cs.herts.ac.uk/7COM1023_Prop_Logic_Notes.pdf · Propositional Logic A proposition is a statement of some alleged fact which

if we later want to connect P ∧ Q to R using the symbol ∨, we will have toput the brackets back, . . . (P ∧ Q) ∨ R. And, if we want to parse it strictly,we shall have to put the outer brackets back as well . . . ((P ∧Q)∨R). Thisis another example of where we usually drop formality in favour of commonsense - the outermopst brackets do not add anything, they are only a by-product of the grammar, necessary only for the construction of compoundforms.

Exercise 5.2 Allowing ourselves to drop the outermost pair of brackets,which of the following are 〈sentences〉 according to our grammar? For thosethat are, draw the parse trees (putting the outermost brackets back in).

1. P ∧ Q

2. ∧P

3. P =⇒ Q

4. ¬P

5. ¬P ∧ Q

6. ¬(P ∧ Q)

7. P ∧ Q ∨ R

8. (P ∧ Q) =⇒ R

9. P ∧ (Q =⇒ R)

10. P ∧ ∨Q

11. P ∧ ¬Q

5.2 A Semantic for this Language

All we have so far is an alphabet of symbols, and a grammar, which allowsus to recognise the sentences of the language. Thus we have the syntax forour language. But we currently have no semantics (except for the openingparagraphs, which sugggests we are interested in propositions).

We are going to give this language a semantics which allows us to inter-pret as simple propositions sentences of length 1, and interpret as compoundpropositions sentences of length greater than 1.

82

Page 5: Propositional Logic - University of Hertfordshirejspring.cs.herts.ac.uk/7COM1023_Prop_Logic_Notes.pdf · Propositional Logic A proposition is a statement of some alleged fact which

5.3 Naming Simple Propositions

Clearly, the statements “Smythe has enormous ears” and “Smythe’s earsare enormous” could easily represent the same proposition (if we take forgranted the existence of Smythe’s ear). Similarly, 7 > 6 and 6 < 7 normallyrepresent the same proposition. There is no reason why we can’t name all therepresentations of a proposition, just as we can name all the representationsof a particular set. We use our interpretation of sentences like P and Q inour formal language to denote simple propositions. We will use the symbol=̂ to give names to things, ie. to define the meaning of symbols2.

For example, we may write. . . P =̂ “Smythe’s ears are enormous”. Al-ternatively, we may want to say something about any proposition; for exam-ple: Let P be a proposition. In this case P doesn’t represent any particularproposition, so we know absolutely nothing about it, except that, becauseit represents a proposition it is either true or false.

5.4 Compound Propositions Using ∧ and ∨Consider this proposition . . .

It is hot and we are eating rice pudding.

We can view this as a simple proposition, P , so that

P =̂ “It is hot and we are eating rice pudding”

but, we might reasonably decide that it is made up of two simpler proposi-tions . . .

Q=̂ “It is hot” and R=̂ “We are eating rice pudding”

Now we have a compound proposition which we could write “Q and R”.You will probably agree that the compound proposition will only be true ifboth the simple propositions are true. The connective ∧ from our formallanguage may be interpreted as this “and”, so we write Q ∧ R.

Now consider this proposition . . .

He’s very stupid or very brave.

Again, we may choose to view this as a compound of two simpler proposi-tions:

He is very stupid. He is very brave.2As usual, we will frequently slip into the bad mathematician’s habit of abusing con-

cepts of equality, and write P = . . . when it is pretty obvious what we mean. Be careful,however, for there are times in logics when the different forms of equality are very impor-tant.

83

Page 6: Propositional Logic - University of Hertfordshirejspring.cs.herts.ac.uk/7COM1023_Prop_Logic_Notes.pdf · Propositional Logic A proposition is a statement of some alleged fact which

. . . but this time they are connected by the word “or”. This is a bit trickier.Does the compound proposition mean “He is very stupid or very brave butnot both”, or does it mean “He is very stupid or very brave or perhapsboth”? We can’t be sure from the natural language statement. (You willprobably recognise that here we are grappling with the difference between“exclusive or” and “inclusive or”.)

For the moment, suppose the compound proposition means “He is verystupid or very brave or both”. You will then agree that the compoundproposition must be true when either one or both of the simple propositionsare true.

The connective ∨ from our formal language may be sensibly read as whatwe mean by “inclusive or”. We will interpret the compound propositionP ∨Q as true if and only if one, or both, of P and Q individually interpretsto true.

You may find it helpful to realise that the two symbols ∧ and ∨ are thesame way up as the symbols for set intersection and union repectively: thisis no accident! A∩B is the set of things in both A and B, A∪B is the setof things in A or B.

Even though the translation of ∧ and ∨ as “and” and “or” seems reason-able, we need to be very careful when we come to represent natural languagepropositions by sentences in our formal language.

One way of using up left-over mashed potato and cabbage is to fry it uptogether with a beaten egg or some milk: the result is known as “bubbleand squeak”, possibly because of its affect on the digestion! It would clearlynot be sensible to view the proposition

I love bubble and squeak

as a compound P ∧ Q, where

P =̂ “I love bubble” and Q=̂ “I love squeak”

Here’s another possible way of getting into trouble!

The winner gets a thousand pounds in cash or a holiday in the Bahamas.

Here, the representation . . .

“The winner gets a thousand pounds” ∨ “The winner gets a holiday in the Bahamas”

. . . is, unfortunately for the winner, almost certainly incorrect! (Why?)

Exercise 5.3 Try to express the following English sentences in proposi-tional logic: there are no unique right answers, so you might be able tothink of more than one possible way of doing it. In general, it’s a goodidea to frame propositions positively; so, for example, in number 10 theproposition would be C = ‘I am a crook’ and the answer, therefore, ¬C.

84

Page 7: Propositional Logic - University of Hertfordshirejspring.cs.herts.ac.uk/7COM1023_Prop_Logic_Notes.pdf · Propositional Logic A proposition is a statement of some alleged fact which

1. Arsenal are good, but Leeds are very good.

2. He likes Jane and Sarah.

3. It is raining cats and dogs.

4. It is not hot or windy.

5. You can have either fame or happiness.

6. He speaks English and French or German.

7. You can have eggs or bacon and beans or sausages.

8. Either that man’s a fraud or he’s your brother.

9. If 14 year olds had the vote, I’d be president. (Evel Knieval)

10. I am not a crook (Richard Nixon)

11. The club will raise ticket prices and/or get more TV revenue. (MiamiDolphins)

12. I can either run the country or control Alice - not both. (TheodoreRoosevelt)

5.5 Truth Tables

Although, so far, we have looked at only two connectives, ∧ and ∨, beforewe go on we will show how the semantics of compound propositions can beconcisely represented in a tabular form, commonly known as a “truth table”.

Here is a truth table that allows us to interpret P ∧ Q for each possiblecombination of interpretations of P and Q individually.

P Q P ∧ Q

T T TT F FF T FF F F

This is called the truth table for P ∧Q. At the risk of explaining the obvious,we read the table row by row. In each row, the first two columns give usone of the possible combinations of interpretations for P and Q individually,and the third column gives us the corresponding interpretation of P ∧ Q.

Here is the truth table for P ∨ Q:

P Q P ∧ Q

T T TT F TF T TF F F

85

Page 8: Propositional Logic - University of Hertfordshirejspring.cs.herts.ac.uk/7COM1023_Prop_Logic_Notes.pdf · Propositional Logic A proposition is a statement of some alleged fact which

5.6 Truth Functionality

If we were to ask, “Why is it that we are able to construct truth tables?”you might say, “What do you mean? Obviously, it’s because we can workout the truth value of a compound proposition from our understanding ofthe connectives and the truth values of the simple propositions that makeit up.” You’d be quite correct! However, this does mean that we must notview as compound of two propositions any statement whose value cannot bethus deduced. Let’s look at an example:

John is cold because he’s wet.

It is very tempting to split it into two simple propositions.

John is cold. John is wet.

and then produce a connective in our propositional logic which can be “readas” because. Suppose for a few moments that we had such a connective:let’s use the symbol to represent this “because connective”, and have ago at drawing a truth table. Here’s the beginnings of it, showing all possiblecombinations of truth values for the two simple propositions

John is cold John is wet John is cold John is wetT T ?T F ?F T ?F F ?

Now, how are we to fill in the last column? That is, how are we to arriveat the truth or falsity of P Q simply by examining the individual truth orfalsity of P and Q? We simply can’t!

For the top row of truth values in the table, if we examine John, andprove to ourselves he is indeed cold, and he really is wet, we still can’t say heis cold because he’s wet. He may be cold because he fell in a lake of freezingwater, so that his wetness did cause his coldness. On the other hand hemay be cold from the wind, and may now be sitting wetly in a bath of hotwater trying to warm up! You may be able to fill in the “?” column for theother three rows to your satisfaction . . . for example, for row 2 you mightsay “If he isn’t wet then the compound proposition that he’s cold becausehe’s wet must be false”. Nevertheless, our inability to fill in the top row isquite sufficient for us to reject the idea of allowing a “because” connectiveinto our logic.

Note that calling something a compound proposition where we can’tdeduce the truth or falsity of the compound from the truth or falsity ofthe simple propositions that make them up are banned by the third law ofpropositional logic:

86

Page 9: Propositional Logic - University of Hertfordshirejspring.cs.herts.ac.uk/7COM1023_Prop_Logic_Notes.pdf · Propositional Logic A proposition is a statement of some alleged fact which

Law 5.3 (Truth Functionality) The truth value of a compound propositionis uniquely determined by the truth values of its constituent parts.

Once again, this is not some emergent property that we need to “understand”,but a condition we must accept before we can use the formal system.

It is the “causal” relationship between Jack’s coldness and his wetnessthat gives rise to the problem: we say that “because” is not a truth functionalconnective. Note that this law doesn’t say we can’t work with “John is coldbecause he is wet” as a single simple proposition.

5.7 Compound Propositions Using ¬There is another way to construct compound propositions, but this timefrom just one simple proposition, using the symbol ¬ which has the followingtruth table:

P ¬P

T FF T

It is easy to see why ¬ is often called “negation” and read as “not”. If aproposition P is true, then ¬P is false, ¬¬P is true, and so on. If P is false,then ¬P is true, and so on.

You may find it a little difficult to see ¬P as a “compound” propositionat all. This is a reasonable point, but since it isn’t just a simple proposition,P , we shall view it as a compound: we gave ourselves only these two choices.

5.8 Compound Propositions Using =⇒Consider the simple propositions:

Your name is Frank.

and

Your name has 5 letters in it.

Now, what’s your name? Suppose you are called Frank, then both thepropositions above are true when applied to you. Suppose you are calledLeroy? Well, in that case, the first is false but the second is true. Supposeyou are called John, then both are false. Are there any circumstances underwhich the first is true and the second false? No!

Now consider the compound proposition:

If your name is Frank then your name has 5 letters in it.

87

Page 10: Propositional Logic - University of Hertfordshirejspring.cs.herts.ac.uk/7COM1023_Prop_Logic_Notes.pdf · Propositional Logic A proposition is a statement of some alleged fact which

Whatever your name, Frank, John or Leroy, I hope you would agree thatthis proposition is true. The only way we could demonstrate it to be falsewould be to find someone called Frank whose name didn’t have five lettersin it!

So, an “If P then Q” statement is false only when the “P” is true andthe “Q” is false. For our example about names and lengths of names, wecan construct the annotated truth table shown in figure 5.2. Of course, thesecond line of truth values is impossible to arrive at for this example (unlessyou are quite stunningly bad at counting!)

Your name is Frank Your name has 5 letters in it If your name is Frankthen your name has 5 letters in it

T T T(You are called Frank) (There are 5 letters in Frank) (The compound is true)

T F F(You are called Frank) (Suppose there were (The compound would be false!!)

6 letters in Frank!?)

F T T(You’re Leroy, not Frank) (There are 5 letters in Leroy (If you were Frank

but who cares!! ) the compound would be true)

F F T(You’re John, not Frank) (There 4 letters in John (If you were Frank

but who cares!!) the compound would be true)

Figure 5.2: Annotated Truth Table

Here’s another example: consider the simple propositions:

The animal has wings

and

The animal’s name has 5 letters in it

A slightly eccentric naturalist has four pets, two parrots called Frank andGeorgina, and two gorillas called Peter and Geraldine. The naturalist makesthe following statement about his pet collection.

If the animal has wings then the animal’s name has 5 letters in it.

Can you find an animal and name pair that makes this proposition false?Yes, but only by choosing the parrot called Georgina! We might considerthe proposition

If a gorilla has wings then its name has 5 letters in it.

88

Page 11: Propositional Logic - University of Hertfordshirejspring.cs.herts.ac.uk/7COM1023_Prop_Logic_Notes.pdf · Propositional Logic A proposition is a statement of some alleged fact which

to be rather a silly thing to state: but we can’t falsify it! Any statementthat starts off with an “impossible if” evaluates to true.

You may feel we are taking some liberties with “what we normally meanby ‘If . . . then’, but are we really? For example, we normally consider state-ments like “If you can learn French from scratch by tomorrow then I’m aDutchman” to be “true” precisely on the grounds that the “If part” is false,so any consequence can be truly deduced.

Here’s another example: when you state the proposition

If Floppo the Third wins the 2.30 at Epsom then I’ll eat my hat.

you do so in confidence that Floppo is going to flop it and lose, so thatyou will have spoken truly without needing to eat your hat! Maybe you goahead and eat your hat anyway when Floppo loses (just because you have asecret passion for hat-eating), but that won’t have any effect on the “truth”or otherwise of your proposition, will it? On the hand if Floppo wins, youwill need to consume the headgear in order to make your proposition true!

As long as we get to grips with the hidden subtleties of “If . . . then”statements (many of which we ignore most of the time in our day-to-dayuse of English) we can interpret the compound P =⇒ Q as “If P then Q”.An alternative reading is “P implies Q”, so the arrow, =⇒ is often called“implication”.

The truth table for P =⇒ Q is:

P Q P =⇒ Q

T T TT F FF T TF F T

Compare the arguments given in the examples that open this section ofthe notes with the truth table. Note carefully that the only circumstanceunder which P =⇒ Q evaluates to false is when P has the value true and Qhas the value false.

This is the connective that usually presents problems for students, andthe reason is easy to understand: people confuse logical implication (asdefined entirely by the truth tables above) with causal implication. Thesentence

If I hit this nail with a hammer then it will go into the wood.

could be presented as P =⇒ Q, but to most people the english actuallymeans

The nail is going into the wood because I hit it with the hammer.

89

Page 12: Propositional Logic - University of Hertfordshirejspring.cs.herts.ac.uk/7COM1023_Prop_Logic_Notes.pdf · Propositional Logic A proposition is a statement of some alleged fact which

but we have already seen the difficulties of capturing causality, and agreedthat we can’t do it whilst preserving truth functionality, one of the lawswe sign up to with propositional logic. Thus if we capture the somethingas P =⇒ Q, we are choosing to abstract away from causality, and can’tsubsequently bring it back in. It is the desire to think causally whilst usingpropositional logic that generally makes students flounder: if, instead, youaccept the law of truth functionality, most of the problems go away.

5.9 Compound Propositions Using the Connective⇐⇒

There is a significant difference between the following two propositions:

If the animal has wings then the animal’s name has 5 letters in it.

from our earlier example about the eccentric naturalist, and

If you are in the southern hemisphere then you are south of the equator.

As we have seen, for the first, if the animal doesn’t have wings it may or may nothave five letters in its name . But, if you are not in the southern hemispherethen you are definitely not south of the equator either, so although

You are in the southern hemisphere =⇒ You are south of the equator

is certainly true, we can in fact say something stronger. The connective ⇐⇒allows us to say If P then Q, and if not P then not Q either. That is theinterpretation we give P ⇐⇒ Q. P ⇐⇒ Q evaluates to true only when Pand Q are both true or when P and Q are both false.

Here’s the truth table for ⇐⇒, to complete our collection!

P Q P ⇐⇒ Q

T T TT F FF T FF F T

5.10 Generalising Truth Tables

It is fairly obvious that our truth tables can be generalised by replacingthe simple propositions P and Q by compound propositions. The tableis really only about what truth values you get when you combine pairs ofother truth values, so it will “work” perfectly well if P and Q are compoundpropositions.

We shall be a bit fussy, and use curly letters like A,B, etc., to namecompound propositions. It would, strictly, be cheating to use P, Q, etc.,

90

Page 13: Propositional Logic - University of Hertfordshirejspring.cs.herts.ac.uk/7COM1023_Prop_Logic_Notes.pdf · Propositional Logic A proposition is a statement of some alleged fact which

because we have already decided to use them for simple propositions. Thesecurly letters are, of course, not part of our alphabet: we are using them,along with T and F , as part of our meta-language for giving semantics toour sentences.

Here’s the general truth table for ∧,∨, =⇒ and ⇐⇒. (You can copy theone for ¬ onto this page if you want to complete the picture):

A B A ∧ B A ∨ B A =⇒ B A ⇐⇒ BT T T T T TT F F T F FF T F T T FF F F F T T

We are now in a position to find all possible interpretations of any sentenceof propositional logic, however complicated, by applying the “rules” in thegeneral truth table above to the “sub-sentences” it is composed of:

Example 5.1 Suppose we want to examine the potential interpretations of¬((P ∨Q) =⇒ Q), for all combinations of the truth values of P and Q. Firstwe need to reveal the structure of the sentence:

3︷ ︸︸ ︷

¬(

1︷ ︸︸ ︷(P ∨ Q) =⇒ Q)

︸ ︷︷ ︸2

We can now draw a truth table, just as we did for each of the connectives.The table needs to contain a row for each combination of interpretations

of the relevant simple propositional symbols, P, Q,R . . . contained in thesentence that we want to consider, and a column for every sub-expressionused in building up the complex expression. Here is the truth table. Makesure you can see why we have these columns, and not, for example, a columnheaded ¬(P ∨ Q)

P Q (P ∨ Q) ((P ∨ Q) =⇒ Q) ¬((P ∨ Q) =⇒ Q)T T T T FT F T F TF T T T FF F F T F

Exercise 5.4 Draw a truth table to show all possible interpretations of theexpression¬(P ∨Q) =⇒ Q. Compare it with the expression and table in Example 5.1.

Example 5.2 Here is a truth table to show all possible interpretations of

((P ∧ Q) ∨ ¬R) ⇐⇒ P

91

Page 14: Propositional Logic - University of Hertfordshirejspring.cs.herts.ac.uk/7COM1023_Prop_Logic_Notes.pdf · Propositional Logic A proposition is a statement of some alleged fact which

P Q R (P ∧ Q) ¬R ((P ∧ Q) ∨ ¬R) ((P ∧ Q) ∨ ¬R) ⇐⇒ P

T T T T F T TT T F T T T TT F T F F F FT F F F T T TF T T F F F TF T F F T T FF F T F F F TF F F F T T F

Exercise 5.5 How many rows will there be in a truth table showing allpossible interpretations of a sentence containing n simple propositions?

Exercise 5.6 Draw up truth tables to show all possible interpretations ofeach of the following:

1. P ∧ (P ∨ Q)

2. (P ∨ Q) ∧ (P =⇒ Q)

3. ¬P ∧ (P ∨ (Q =⇒ P ))

4. (P ∧ (Q ∨ P )) ⇐⇒ P

5. (P =⇒ Q) =⇒ (¬P ∨ Q)

5.11 The Semantic Turnstile

We are about to make an important transtion, from working within ourformal system to making Statements about Sentences in our Logic.

So far we have seen how to express propositions in a formal language,but what can we do with them? The motivation for studying logic was toallow us to formalise the reasoning process. For example, we wanted to beable to reflect arguments such as

If the cabbage is tough then granny is using her false teeth.Granny is using her false teeth. Therefore the cabage is tough.

and see if the deduction is valid. Note carefully that our language so farallows us to express propositions, not properties of sets of propositions. Inorder to allow such meta-level discussion we will need to introduce somemeta-langauge: ensure that you understand this point. Before we considerthe question of valid deduction in English, let us explore the mechanisms wewill need in the formalism.

Here are some examples.

92

Page 15: Propositional Logic - University of Hertfordshirejspring.cs.herts.ac.uk/7COM1023_Prop_Logic_Notes.pdf · Propositional Logic A proposition is a statement of some alleged fact which

Example 5.3 The following are correct statements about the semantics ofsentences of propositional logic. (Make sure you are convinced they areindeed correct!)

1. Whenever both the sentences P and Q evaluate to true, so does thesentence P ∧ Q.

2. Whenever both the sentences P and P =⇒ Q evaluate to true, so doesthe sentence Q.

3. The sentence P ∨¬P always evaluates to true (regardless of the truthof P ).

It’s clearly going to be useful to be able to make such statements, for thesame kind of reasons as it is useful to be able to say “3 + 4 has the samevalue as 7”, or “x + y has the same value as y + x”.

We introduce two meta-symbols in order to do so, |=, known as thesemantic turnstile, and an ordinary-looking comma (,). We could wrap thisup as another formal language, but we will work informally here, as thegrammar is pretty simple.

Here are natural language statements of our last example, again: eachis followed by its expression in our new meta-language:

1. Whenever both the sentences P and Q evaluate to true, so does thesentence P ∧ Q.

P, Q |= P ∧ Q

2. Whenever both the sentences P and P =⇒ Q evaluate to true, so doesthe sentence Q.

P, P =⇒ Q |= Q

3. The sentence P ∨¬P always evaluates to true (regardless of the truthof P ).

|= P ∨ ¬P

You can see that the way to “read” a meta-language statement of the formS |= A, where S is some (possibly empty) collection of sentences is as follows:

“Whenever the collection of sentences on the left of the turnstileare all true, so is the sentence on the right”.

This is often stated alternatively like this

“The sentence on the right of the turnstile is a logical consequence ofthe collection of sentences on the left of the turnstile”

93

Page 16: Propositional Logic - University of Hertfordshirejspring.cs.herts.ac.uk/7COM1023_Prop_Logic_Notes.pdf · Propositional Logic A proposition is a statement of some alleged fact which

In the special case where there are no sentences on the left, we can simplysay “The sentence on the right always has the value true”.

We can, of course, use truth tables to demonstrate the correctness ofsuch statements.

Example 5.4 Here is a truth table which shows that P , P =⇒ Q |= Q

P Q P =⇒ Q

T T TT F FF T TF F T

Thus P, P =⇒ Q |= Q since whenever the two sentences, P and P =⇒ Q, onthe left hand side are interpreted as true (namely in row one) the sentence,Q, on the right is true. Note that for this task we don’t care about rows inthe truth table where the propositions on the left of the turnstile are not alltrue.

Sometimes we have compound sentences that are true regardless of thetruth values of the simple propositions being used. In this case, we use thesame notation, but we don’t indicate any simple propositions on the leftof the turnstile, to indicate that the truth of the compound form does notdepend on anything.

Example 5.5 Here is a truth table that shows |= P ∨ ¬P .

P ¬P P ∨ ¬P

T F TF T T

As the final column only contains true on every row, we can claim that|= P ∨ ¬P .

Exercise 5.7 Draw truth tables to show the following

1. P ∧ Q |= P ∨ Q

2. ¬P, P ∨ Q |= Q

3. |= (P =⇒ Q) ⇐⇒ (¬P ∨ Q)

4. (Q ∨ P ) =⇒ R |= Q =⇒ R

5. |= P =⇒ (P ∨ Q)

If you’re on your toes, you may have noticed some apparent similarity be-tween, for example, the meta-language statement P |= P ∨ Q and the sen-tence of propositional logic, P =⇒ (P ∨ Q).

94

Page 17: Propositional Logic - University of Hertfordshirejspring.cs.herts.ac.uk/7COM1023_Prop_Logic_Notes.pdf · Propositional Logic A proposition is a statement of some alleged fact which

Exercise 5.8 Draw up a truth table for P =⇒ (P∨Q). You should discoverit is true for all combinations of values of P and Q. That is, that we canalso correctly state |= P =⇒ (P ∨ Q)

The last exercise provides a particular example of a general point. If Sis some collection of propositions, and A is some proposition, then, if weknow that S |= A, the proposition formed by “anding together” all of thesentences in the collection S, and following them by the =⇒ connective withA on the right of the =⇒ will be true for all values of the simple propositionsinvolved. What a mouthful! Let’s try it out.

Exercise 5.9 (In this exercise you may prefer to add extra columns ontothe truth tables from Exercise 5.7, rather than starting from scratch.)

1. In Exercise 5.7.1 you showed

P ∧ Q |= P ∨ Q

Now draw up a truth table to show that (P ∧Q) =⇒ (P ∨Q) is alwaystrue, whatever combination of values is chosen for P and Q. (Youmay feel this is so obvious that you don’t need to draw the table:fine!) Having convinced yourself of this, you are then entitled to writedown |= (P ∧ Q) =⇒ (P ∨ Q).

2. In Exercise 5.7.2 you showed

¬P, P ∨ Q |= Q

Now draw up a truth table to show that (¬P ∧ (P ∨ Q)) =⇒ Q isalways true, whatever combination of values is chosen for P and Q.Having convinced yourself of this, you are then entitled to write down|= (¬P ∧ (P ∨ Q)) =⇒ Q.

3. In Exercise 5.7.5 you showed

(Q ∨ P ) =⇒ R |= Q =⇒ R

Now draw up a truth table to show that ((Q ∨ P ) =⇒ R) =⇒ (Q =⇒R) is always true, whatever combination of values is chosen for P andQ. Having convinced yourself of this, you are then entitled to writedown |= ((Q ∨ P ) =⇒ R) =⇒ (Q =⇒ R).

So, there is a connection between |= and =⇒, but note that when we writedown a proposition like P =⇒ (P ∨ R) or P =⇒ Q we do so on the un-derstanding it may evaluate to true or false for some values of P , Q, R.When we write down |= P =⇒ (P ∨ R) we do so in the knowledge thatit is always true. Of course |= P =⇒ Q is not a correct statement of themeta-language, because when P is true and Q is false P =⇒ Q is false.

95

Page 18: Propositional Logic - University of Hertfordshirejspring.cs.herts.ac.uk/7COM1023_Prop_Logic_Notes.pdf · Propositional Logic A proposition is a statement of some alleged fact which

Exercise 5.10 Draw up a truth table to show that both the following arecorrect:

P =⇒ Q |= ¬P ∨ Q and ¬P ∨ Q |= P =⇒ Q

Having done that, you can of course write down:

|= (P =⇒ Q) =⇒ (¬P ∨ Q) and |= (¬P ∨ Q) =⇒ (P =⇒ Q)

that is, “the implication is always true in both directions”. Now, by in-specting your truth table, and having a think, convince yourself that if twosentences “turnstile both ways” then they always have the the same truthvalue for each particular combination of values of the simple propositionsthat make them up.

Now add a column to your truth table to show that |= (P =⇒ Q) ⇐⇒(¬P ∨ Q) is a correct meta-language statement.

5.12 Classifying Sentences

As we have just seen, some sentences always interpret to true regardless ofthe interpretation of the simple propositions they contain. For example, anysentence of the form (A ∨ ¬A) will always be true as it is effectively just astatement of the law of the excluded middle. A sentence which takes thevalue true for every interpretation of its constituent parts is said to be validor is called a tautology. Of course, another way of saying “A is a tautology”is to write |= A.

Some sentences will always interpret to false, such as any of the form(A ∧ ¬A): if this were not the case then A could not be a proposition as itwould break the law of contradiction. A sentence which always interpretsto false, regardless of the truth values of its constituent parts, is called aninconsistency , or is said to be inconsistent.

A sentence which takes the values true and false depending on the inter-pretations of its constituent parts, is called a contingency. If you draw up atruth table for ¬((P ∨Q) =⇒ Q) you will see this sentence is a contingency;it is contingent on, or depends on, the values of P and Q.

Sentences which take the value true under at least one possible inter-pretation are said to be consistent. Thus tautologies and contingencies areconsistent, but inconsistencies are (obviously!) not.

Exercise 5.11 Classify the sentences of Exercise 5.6 under the headingstautology, contingency, and inconsistency.

5.13 Valid Deduction in Natural Language

We now have sufficient background to tackle the formalisation of some ar-guments in English. Let us start with our familiar problem

96

Page 19: Propositional Logic - University of Hertfordshirejspring.cs.herts.ac.uk/7COM1023_Prop_Logic_Notes.pdf · Propositional Logic A proposition is a statement of some alleged fact which

If the cabbage is tough then granny is using her false teeth.Granny is using her false teeth. Therefore the cabage is tough.

We will formalise this as follows.

P =̂The cabbage is tough

Q=̂Granny is using her false teeth.

Thus our first premise is P =⇒ Q the second becomes Q and we want toask whether if we accept that the premises are true the truth of theconclusion, P , always follows. But this is precisely what we were askingwhen we looked at the semantic turnstile, thus the validity of the argumentcan be formalised by checking whether

P =⇒ Q , Q |= P

and, as a simple truth table will show, the answer is no. Thus this is not avalid form of argument.

Exercise 5.12 Formalise the following statements and check their validityby using the semantic turnstile.

1. If Susan is eating porridge then Wendy is watching TV. Susan is eatingporridge. Therefore Wendy is watching TV.

2. If Christopher is playing pooh-sticks then Ivan is tall. Ivan is not tall.Therefore Christopher is not playing Pooh-sticks.

3. If Albert is standing up then Sally is hungry. Albert is not standingup. Therefore Sally is not hungry.

4. If Ernest is singing then Mary is 18. Mary is 18. Therefore Ernest issinging.

5. It is always the case that either it is raining or if the moon is made ofgreen cheese it is not raining.

5.14 Equivalence

|= (P =⇒ Q) ⇐⇒ (¬P ∨ Q) in Exercise 5.10 tells us that the sentences(propositions) (P =⇒ Q) and (¬P ∨ Q) always have the same truth value.If two sentences always have the same truth value then they are said tobe equivalent, just as if two arithmetic expressions have the same numericvalue they too are said to be equivalent. Note that equivalence is a semanticconcept: the two “sides” of the equivalence have the same truth value, or“meaning”.

97

Page 20: Propositional Logic - University of Hertfordshirejspring.cs.herts.ac.uk/7COM1023_Prop_Logic_Notes.pdf · Propositional Logic A proposition is a statement of some alleged fact which

We could, of course, show equivalence using a double turnstile symbol,thus:

P =⇒ Q=| |= ¬P ∨ Q

However, we shall use the symbol ≡ in this context3, thus:

P =⇒ Q ≡ ¬P ∨ Q

This piece of notation is by no means universal, and many writers on logicdo not introduce the idea of equivalence at all. This is because, as youcan deduce from Exercise 5.10 A ≡ B is the case precisely when A ⇐⇒ Bis a tautology, so we can always express P =⇒ Q ≡ ¬P ∨ Q by writing|= (P =⇒ Q) ⇐⇒ (¬P ∨ Q) instead . . . no real need for the ≡ symbol,therefore: we just think it makes things look a little simpler!

There are a number of useful properties of our propositional logic thatcan be expressed as equivalences, and some of these are given below.Idempotent Properties

A ∧A ≡ A and A ∨A ≡ A

Commutative Properties

A ∧ B ≡ B ∧ A and A ∨ B ≡ B ∨ A

Associative Properties

(A ∧ B) ∧ C ≡ A ∧ (B ∧ C) and (A ∨ B) ∨ C ≡ A ∨ (B ∨ C)

Distributive Properties

A ∨ (B ∧ C) ≡ (A ∨ B) ∧ (A ∨ C) and A ∧ (B ∨ C) ≡ (A ∧ B) ∨ (A ∧ C)

De Morgan’s Rules

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

Double Negation Property

¬¬A ≡ A

You may like to prove some of these equivalences using truth tables.Equivalences are very useful because we can clearly substitute equivalent

expressions in a sentence of propositional logic without changing its truthvalue (our law of truth functionality ensures this). So, if we have a com-pound proposition W which contains the compound A within it, and if Ais equivalent to B we can replace any or all the A’s in W by B.

3Yet another sort of equality!

98

Page 21: Propositional Logic - University of Hertfordshirejspring.cs.herts.ac.uk/7COM1023_Prop_Logic_Notes.pdf · Propositional Logic A proposition is a statement of some alleged fact which

Example 5.6 Given that

P =⇒ Q ≡ ¬P ∨ Q

then we may replace any expression of the form P =⇒ Q by the equiva-lent expression ¬P ∨ Q. For example, we may rewrite (P =⇒ Q) ∨ R as(¬P ∨ Q) ∨ R.

We can also generalise equivalences. Any equivalence expressed in termsof simple proposition symbols can have its simple proposition symbols re-placed consistently by other simple or compound propositions, as long asthe substitution will not cause any confusion (for example, by introducinga letter already being used somewhere else). This rule actually means thatwe were being a bit fussy insisting on using A,B . . . we could have just usedP, Q, R . . . and generalised all the results.

Example 5.7 Given that

P ∧ P ≡ P

then we can generalise this to give

(¬P ∨ Q) ∧ (¬P ∨ Q) ≡ (¬P ∨ Q)

These rules give us an alternative way of reasoning about equivalences, orabout properties of propositions like tautology and inconsistency. Insteadof using truth tables, which can be very large if there are more than two orthree simple proposition symbols, we can use our laws of equivalences andmanipulate one expression to show it is equivalent to another, or show itis a tautology, and so on. Of course, to be convincing we need to explaincarefully our justification for each step in the manipulation. In essence, wehave created an algebra of propositions, just as we had analgebra of sets,relations and functions earlier.

Example 5.8 We shall show thatA ∧ B ≡ (A ∧ B) ∧ (A ∨ B).

It is usually easier to try to simplify the more complicated looking side,rather than complicate the simpler one! So we shall manipulate the righthand side.

(A ∧ B) ∧ (A ∨ B)

≡ ((A∧B)∧A)∨ ((A∧B)∧B) (Using the Distributive Property for∧ over ∨.)

≡ (A ∧ (A ∧ B)) ∨ ((A ∧ B) ∧ B) (Using the Commutative Propertyof ∧ )

≡ ((A ∧A) ∧ B) ∨ (A ∧ (B ∧ B)) (Using the Associative Property of∧, twice!)

99

Page 22: Propositional Logic - University of Hertfordshirejspring.cs.herts.ac.uk/7COM1023_Prop_Logic_Notes.pdf · Propositional Logic A proposition is a statement of some alleged fact which

≡ (A ∧ B) ∨ (A ∧ B) (. . . Idempotency of ∧, twice.)

≡ (A ∧ B) (. . . Idempotency of ∨.)

≡ original left hand side. QED (that is: “done it!”)

Example 5.9 A different use of the same kind of reasoning . . .Given that P ∧¬P is an inconsistency (i.e. never true) let us show that

the truth value of (A∨B) ∧ (¬A∨B) depends only on the truth value of BWe haven’t many clues here, except that maybe we should try to isolate

an inconsistency of the form P ∧ ¬P within (A ∨ B) ∧ (¬A ∨ B)(A ∨ B) ∧ (¬A ∨ B)

≡ (B ∨ A) ∧ (B ∨ ¬A) (Commutative Property of ∨)

≡ B ∨ (A ∧ ¬A) (Distributive Propery of ∨)

but A ∧ ¬A is an inconsistency (given) so it is always false. We knowfrom the truth table for ∨ that if B is or’d with false the result will betrue if and only if B is true. It follows that

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

If you are not convinced, construct a truth table.

Exercise 5.13 Without using truth tables . . .

1. Show that ¬(A ∨ ¬B) ≡ ¬A ∧ B

2. By applying Associative and Commutative Properties of ∧,show that (A ∧ B) ∧ (C ∧ D) ≡ (B ∧ C) ∧ (A ∧D)

3. Given that P =⇒ Q ≡ Q ∨ ¬P , and that P ∨ ¬P is a tautology, showthat B =⇒ (A =⇒ B) is a tautology.

4. Given that P ∧ ¬P is an inconsistency,show that ¬(¬A ∨ B) ∧ ¬(¬B ∨ A) is an inconsistency.

5.15 Introducing T and F into our Formal Lan-guage.

The argument used in the final step of Example 5.9 was a bit of a fudge,and probably took informality a bit too far, and you will have been draggedinto the same kind of problems at times in Exercise 5.13.

It is convenient to have a special symbol to denote propositions whichwe know are true. This might arise when we have a particular interpretationin mind or when we are dealing with a compound proposition that we can

100

Page 23: Propositional Logic - University of Hertfordshirejspring.cs.herts.ac.uk/7COM1023_Prop_Logic_Notes.pdf · Propositional Logic A proposition is a statement of some alleged fact which

see is a tautology, and hence must always be true. Similar arguments leadto a need for a symbol to denote propositions that we know are false.

Well, we can have them if we want them: formal languages are man-madeafter all. We shall introduce the symbol T to denote a proposition that isalways true and F to denote one that is always false. Don’t get confusedby the fact that we have been using these two symbols already in our truthtables. In the truth tables they were used to give meaning (semantics) asshorthands for “true” and “false”; now we are using them within our formalnotation. We also allowed their use in our language for any old proposition:it would be daft, however, to name some proposition T or F , unless weknew it was always true or false. Strictly, we should go back and upgradeour alphabet and rewrite our language syntax, but we won’t bother, as weare not interested in retaining complete formality at this stage.

Once we have T and F to play with we can derive several more usefulequivalences, for example, here is the truth table showing P ∧ T ≡ P .

T P P ∧ T

T T TT F F

From the truth table, we can see that P ∧ T ≡ P . This is useful, becausewherever we have (P ∧ T ) within a sentence, we may replace it by P .

Exercise 5.14 Not all of of the following are actually correct. Decide whichare correct. If you feel you need to, draw up truth tables to check yourdecisions.

1. P ∧ ¬P ≡ F

2. P ⇐⇒ F ≡ F

3. P =⇒ T ≡ P

4. T =⇒ P ≡ P

5. ¬(T ∨ P ) ≡ F

6. T ∧ (¬P ∨ F ) ≡ P

7. |= P ∨ T

8. |= T =⇒ P

9. |= T ∧ P

10. |= T ⇐⇒ T

11. |= F =⇒ P

101

Page 24: Propositional Logic - University of Hertfordshirejspring.cs.herts.ac.uk/7COM1023_Prop_Logic_Notes.pdf · Propositional Logic A proposition is a statement of some alleged fact which

We shall now add the following to the list of equivalences on page 98,and subsequently we, and you, may quote any of these results without proof:

Other Equivalences

(i) ¬T ≡ F (ii) ¬F ≡ T (iii) A ∧ T ≡ A(iv) A ∧ F ≡ F (v) A ∨ T ≡ T (vi) A ∨ F ≡ A(vii) A ∨ ¬A ≡ T (viii) A ∧ ¬A ≡ F (ix) A =⇒ B ≡ ¬A ∨ B(x) P =⇒ T ≡ T (xi) F =⇒ P ≡ T (xii) (P =⇒ Q) ∧ (Q =⇒ P ) ≡ P ⇐⇒ Q

The two results P =⇒ T ≡ T and F =⇒ P ≡ T are particularly inter-esting, because they expose common problems that people have in reasoningin these cases. Sentences of the following forms

If the Moon is made of green cheese then . . . .

and

If . . . then the Moon goes round the Earth

are both true, regardless of what fills in the . . . : problems arise,however,if we forget the law of truth functionality, and mistakenly interpret oursentences with causality.

102