Login
📚 Discrete Mathematics
Chapters ▾
⇩ Download ▾

4.1 Propositional Logic

A proposition is simply a statement. Propositional logic studies the ways statements can interact with each other. It is important to remember that propositional logic does not really care about the content of the statements. For example, in terms of propositional logic, the claims, “if the moon is made of cheese then basketballs are round,” and “if spiders have eight legs then Sam walks with a limp” are exactly the same. They are both implications: statements of the form, P Q .

Truth Tables

Here's a question about playing Monopoly:

If you get more doubles than any other player then you will lose, or if you lose then you must have bought the most properties.

True or false? We will answer this question, and won't need to know anything about Monopoly. Instead we will look at the logical form of the statement.

We need to decide when the statement ( P Q ) ( Q R ) is true. Using the definitions of the connectives in Mathematical Statements, we see that for this to be true, either P Q must be true or Q R must be true (or both). Those are true if either P is false or Q is true (in the first case) and Q is false or R is true (in the second case). So—yeah, it gets kind of messy. Luckily, we can make a chart to keep track of all the possibilities. Enter truth tables. The idea is this: on each row, we list a possible combination of T's and F's (for true and false) for each of the sentential variables, and then mark down whether the statement in question is true or false in that case. We do this for every possible combination of T's and F's. Then we can clearly see in which cases the statement is true or false. For complicated statements, we will first fill in values for each part of the statement, as a way of breaking up our task into smaller, more manageable pieces.

Since the truth value of a statement is completely determined by the truth values of its parts and how they are connected, all you really need to know is the truth tables for each of the logical connectives. Here they are:

P Q P Q
TTT
TFF
FTF
FFF
P Q P Q
TTT
TFT
FTT
FFF
P Q P Q
TTT
TFF
FTT
FFT
P Q P Q
TTT
TFF
FTF
FFT

The truth table for negation looks like this:

P ¬ P
TF
FT

None of these truth tables should come as a surprise; they are all just restating the definitions of the connectives. Let's try another one.

Now let's answer our question about monopoly:

The statement about monopoly is an example of a tautology, a statement which is true on the basis of its logical form alone. Tautologies are always true but they don't tell us much about the world. No knowledge about monopoly was required to determine that the statement was true. In fact, it is equally true that “If the moon is made of cheese, then Elvis is still alive, or if Elvis is still alive, then unicorns have 5 legs.”

Logical Equivalence

You might have noticed in Example that the final column in the truth table for ¬ P Q is identical to the final column in the truth table for P Q :

P Q P Q ¬ P Q
TTTT
TFFF
FTTT
FFTT

This says that no matter what P and Q are, the statements ¬ P Q and P Q either both true or both false. We therefore say these statements are logically equivalent.

Recognizing two statements as logically equivalent can be very helpful. Rephrasing a mathematical statement can often lend insight into what it is saying, or how to prove or refute it. By using truth tables we can systematically verify that two statements are indeed logically equivalent.

Notice that this example gives us a way to “distribute” a negation over a disjunction (an “or”). We have a similar rule for distributing over conjunctions (“and”s):

This suggests there might be a sort of “algebra” you could apply to statements (okay, there is: it is called Boolean algebra) to transform one statement into another. We can start collecting useful examples of logical equivalence, and apply them in succession to a statement, instead of writing out a complicated truth table.

De Morgan's laws do not do not directly help us with implications, but as we saw above, every implication can be written as a disjunction:

With this and De Morgan's laws, you can take any statement and simplify it to the point where negations are only being applied to atomic propositions. Well, actually not, because you could get multiple negations stacked up. But this can be easily dealt with:

Let's see how we can apply the equivalences we have encountered so far.

Notice that the above example illustrates that the negation of an implication is NOT an implication: it is a conjunction! We saw this before, in Mathematical Statements, but it is so important and useful, it warants a second blue box here:

To verify that two statements are logically equivalent, you can use truth tables or a sequence of logically equivalent replacements. The truth table method, although cumbersome, has the advantage that it can verify that two statements are NOT logically equivalent.

Deductions

Earlier we claimed that the following was a valid argument:

If Edith eats her vegetables, then she can have a cookie. Edith ate her vegetables. Therefore Edith gets a cookie.

How do we know this is valid? Let's look at the form of the statements. Let P denote “Edith eats her vegetables” and Q denote “Edith can have a cookie.” The logical form of the argument is then:

P Q
P
Q

This is an example of a deduction rule, an argument form which is always valid. This one is a particularly famous rule called modus ponens. Are you convinced that it is a valid deduction rule? If not, consider the following truth table:

P Q P Q
TTT
TFF
FTT
FFT

This is just the truth table for P Q , but what matters here is that all the lines in the deduction rule have their own column in the truth table. Remember that an argument is valid provided the conclusion must be true given that the premises are true. The premises in this case are P Q and P . Which rows of the truth table correspond to both of these being true? P is true in the first two rows, and of those, only the first row has P Q true as well. And lo-and-behold, in this one case, Q is also true. So if P Q and P are both true, we see that Q must be true as well.

Here are a few more examples.

Beyond Propositions

As we saw in Mathematical Statements, not every statement can be analyzed using logical connectives alone. For example, we might want to work with the statement:

All primes greater than 2 are odd.

To write this statement symbolically, we must use quantifiers. We can translate as follows:

x ( ( P ( x ) x > 2 ) O ( x ) )

. In this case, we are using P ( x ) to denote “ x is prime” and O ( x ) to denote “ x is odd.” These are not propositions, since their truth value depends on the input x . Better to think of P and O as denoting properties of their input. The technical term for these is predicates and when we study them in logic, we need to use predicate logic.

It is important to stress that predicate logic extends propositional logic (much in the way quantum mechanics extends classical mechanics). You will notice that our statement above still used the (propositional) logical connectives. Everything that we learned about logical equivalence and deductions still applies. However, predicate logic allows us to analyze statements at a higher resolution, digging down into the individual propositions P , Q , etc.

A full treatment of predicate logic is beyond the scope of this text. One reason is that there is no systematic procedure for deciding whether two statements in predicate logic are logically equivalent (i.e., there is no analogue to truth tables here). Rather, we end with a two examples of logical equivalence and deduction, to pique your interest.

Consider the statement about a party, “If it's your birthday or there will be cake, then there will be cake.”

  1. Translate the above statement into symbols. Clearly state which statement is P and which is Q .
  2. Make a truth table for the statement.
  3. Assuming the statement is true, what (if anything) can you conclude if there will be cake?
  4. Assuming the statement is true, what (if anything) can you conclude if there will not be cake?
  5. Suppose you found out that the statement was a lie. What can you conclude?
  1. P : it's your birthday; Q : there will be cake. ( P Q ) Q
  2. Hint: you should get three T's and one F.
  3. Only that there will be cake.
  4. It's NOT your birthday!
  5. It's your birthday, but the cake is a lie.

Geoff Poshingten is out at a fancy pizza joint, and decides to order a calzone. When the waiter asks what he would like in it, he replies, “I want either pepperoni or sausage. Also, if I have sausage, then I must also include quail. Oh, and if I have pepperoni or quail then I must also have ricotta cheese.”

  1. Translate Geoff's order into logical symbols.
  2. The waiter knows that Geoff is either a liar or a truth-teller (so either everything he says is false, or everything is true). Which is it?
  3. What, if anything, can the waiter conclude about the ingredients in Geoff's desired calzone?

You should write down three statements using the symbols P , Q , R , S . If Geoff is a truth-teller, then all three statements would be true. If he was a liar, then all three statements would be false. But in either case, we don't yet know whether the four atomic statements are true or false, since he hasn't said them by themselves.

A truth table might help, although is probably not entirely necessary.

Determine whether the following two statements are logically equivalent: ¬ ( P Q ) and P ¬ Q . Explain how you know you are correct.

Make a truth table for each and compare. The statements are logically equivalent.

Simplify the following statements (so that negation only appears right before variables).

  1. ¬ ( P ¬ Q ) .
  2. ( ¬ P ¬ Q ) ¬ ( ¬ Q R ) .
  3. ¬ ( ( P ¬ Q ) ¬ ( R ¬ R ) ) .
  4. It is false that if Sam is not a man then Chris is a woman, and that Chris is not a woman.
  1. P Q .
  2. ( ¬ P ¬ R ) ( Q ¬ R ) or, replacing the implication with a disjunction first: ( P Q ) ( Q ¬ R ) .
  3. ( P Q ) ( R ¬ R ) . This is necessarily false, so it is also equivalent to P ¬ P .
  4. Either Sam is a woman and Chris is a man, or Chris is a woman.

Use De Morgan's Laws, and any other logical equivalence facts you know to simplify the following statements. Show all your steps. Your final statements should have negations only appear directly next to the sentence variables or predicates ( P , Q , E ( x ) , etc.), and no double negations. It would be a good idea to use only conjunctions, disjunctions, and negations.

  1. ¬ ( ( ¬ P Q ) ¬ ( R ¬ S ) ) .
  2. ¬ ( ( ¬ P ¬ Q ) ( ¬ Q R ) ) (careful with the implications).
  3. For both parts above, verify your answers are correct using truth tables. That is, use a truth table to check that the given statement and your proposed simplification are actually logically equivalent.

Consider the statement, “If a number is triangular or square, then it is not prime”

  1. Make a truth table for the statement ( T S ) ¬ P .
  2. If you believed the statement was false, what properties would a counterexample need to possess? Explain by referencing your truth table.
  3. If the statement were true, what could you conclude about the number 5657, which is definitely prime? Again, explain using the truth table.
  1. There will be three rows in which the statement is false.
  2. Consider the three rows that evaluate to false and say what the truth values of T , S , and P are there.
  3. You are looking for a row in which P is true, and the whole statement is true.

Tommy Flanagan was telling you what he ate yesterday afternoon. He tells you, “I had either popcorn or raisins. Also, if I had cucumber sandwiches, then I had soda. But I didn't drink soda or tea.” Of course you know that Tommy is the worlds worst liar, and everything he says is false. What did Tommy eat?

Justify your answer by writing all of Tommy's statements using sentence variables ( P , Q , R , S , T ), taking their negations, and using these to deduce what Tommy actually ate.

Write down three statements, and then take the negation of each (since he is a liar). You should find that Tommy ate one item and drank one item. ( Q is for cucumber sandwiches.)

Can you chain implications together? That is, if P Q and Q R , does that means the P R ? Can you chain more implications together? Let's find out:

  1. Prove that the following is a valid deduction rule:
    P Q
    Q R
    P R
  2. Prove that the following is a valid deduction rule for any n 2 :
    P 1 P 2
    P 2 P 3
    P n 1 P n
    P 1 P n .

    I suggest you don't go through the trouble of writing out a 2 n row truth table. Instead, you should use part (a) and mathematical induction.

For the second part, you can inductively assume that from the first n 2 implications you can deduce P 1 P n 1 . Then you are back in the case in part (a) again.

We can also simplify statements in predicate logic using our rules for passing negations over quantifiers, and then applying propositional logical equivalence to the “inside” propositional part. Simplify the statements below (so negation appears only directly next to predicates).

  1. ¬ x y ( ¬ O ( x ) E ( y ) ) .
  2. ¬ x ¬ y ¬ ( x < y z ( x < z y < z ) ) .
  3. There is a number n for which no other number is either less n than or equal to n .
  4. It is false that for every number n there are two other numbers which n is between.
  1. x y ( O ( x ) ¬ E ( y ) ) .
  2. x y ( x y z ( x z y z ) ) .
  3. There is a number n for which every other number is strictly greater than n .
  4. There is a number n which is not between any other two numbers.

Simplify the statements below to the point that negation symbols occur only directly next to predicates.

  1. ¬ x y ( x < y y < x ) .
  2. ¬ ( x P ( x ) y P ( y ) ) .

Simplifying negations will be especially useful in the next section when we try to prove a statement by considering what would happen if it were false. For each statement below, write the negation of the statement as simply as possible. Don't just say, “it is false that …” .

  1. Every number is either even or odd.
  2. There is a sequence that is both arithmetic and geometric.
  3. For all numbers n , if n is prime, then n + 3 is not prime.

It might help to translate the statements into symbols and then use the formulaic rules to simplify negations (i.e., rules for quantifiers and De Morgan's laws). After simplifying, you should get x ( ¬ E ( x ) ¬ O ( x ) ) , for the first one, for example. Then translate this back into English.

Suppose P and Q are (possibly molecular) propositional statements. Prove that P and Q are logically equivalent if any only if P Q is a tautology.

What do these concepts mean in terms of truth tables?

Suppose P 1 , P 2 , , P n and Q are (possibly molecular) propositional statements. Suppose further that

P 1
P 2
P n
Q

This is a valid deduction rule. Prove that the statement

( P 1 P 2 P n ) Q

is a tautology.

Discrete Mathematics: An Open Introduction, 3rd edition, by Oscar Levin (discrete.openmathbooks.org), licensed under CC BY-SA 4.0; this adaptation is distributed under the same license. License: CC-BY-SA-4.0.