A tautology is a proposition that is always true, regardless of the truth values of the propo-
sitional variables it contains. A proposition that is always false is called a contradiction. A proposition that is neither a tautology nor a contradiction is called acontingency.
Example 2.5.1 From the following truth table
p p p∨p p∧p
T F T F
F T T F
we gather thatp∨pis a tautology, andp∧pis a contradiction.
In words, p∨psays that either the statementpis true, or the statementpis true (that is,p is false). This claim is always true.
The compound statement p∧pclaims that pis true, and at the same time, pis also true (which meanspis false). This is clearly impossible. Hence,p∧pmust be false. N
2.5 Logical Equivalences 29
Example 2.5.2 Show that (p⇒q)⇔(q⇒p) is a tautology.
Solution: We can use a truth table to verify the claim.
p q p⇒q q p q⇒p (p⇒q)⇔(q⇒p)
T T T T F F T
F T T F T T T
F F T T T T T
Note how we work on each component of the compound statement separately before putting
them together to obtain the final answer. N
Example 2.5.3 Show that the argument
“Ifpandq, thenr. Therefore, if notr, then notpor notq.” is valid. In other words, show that the logic used in the argument is correct.
Solution: Symbolically, the argument says
[(p∧q)⇒r]⇒[r⇒(p∨q)]. (2.1) We want to show that it is a tautology. It is easy to verify with a truth table. We can also argue that this compound statement is always true by showing that it can never be false.
Suppose, on the contrary, that (2.1) is false for some choices of p, q, andr. Then (p∧q)⇒r must be true, and r⇒(p∨q) must be false. For the second implication to be false, we need
r to be true, and p∨q to be false.
They in turn imply thatris false, and bothpandqare false; hence bothpandqare true. This would make (p∧q)⇒r false, contradicting the assumption that it is true. Thus, (2.1) cannot
be false, it must be a tautology. N
Hands-On Exercise 2.5.1 Use a truth table to show that [(p∧q)⇒r]⇒[r⇒(p∨q)] is a tautology.
Solution: We need eight combinations of truth values inp, q, andr. We list the truth values according to the following convention. In the first column for the truth values ofp, fill the upper half with T and the lower half with F. In the next column for the truth values ofq, repeat the same pattern, separately, with the upper half and the lower half. So we split the upper half of the second column into two halves, fill the top half with T and the lower half with F. Likewise, split the lower half of the second column into two halves, fill the top half with T and the lower half with F. Repeat the same pattern with the third column for the truth values ofr, and so on if we have more propositional variables.
Complete the following table:
p q r p∧q (p∧q)⇒r r p q p∨q r⇒(p∨q) [(p∧q)⇒r]⇒[r⇒(p∨q)] T T T T T F T F T T F F F T T F T F F F T F F F
30 Chapter 2 Logic
Question: If there are four propositional variables in a proposition, how many rows are there in
the truth table? 4
Definition. Two logical formulaspandqare said to belogically equivalent, denoted p≡q,
ifp⇔q is a tautology. ♦
We are not saying that p is equal toq. Since pand q represent two different statements, they cannot be the same. What we are saying is, they always produce the same truth value, Do not writep=q;
instead, writep≡q. regardless of the truth values of the underlying propositional variables. That is why we write p≡q instead ofp=q.
Example 2.5.4 We have learned that
p⇔q≡(p⇒q)∧(q⇒p),
which is the reason why we callp⇔qa biconditional statement. N Example 2.5.5 Use truth tables to verify the following equivalent statements.
(a) p⇒q≡p∨q.
(b) p∧(q∨r)≡(p∧q)∨(p∧r).
Solution: The truth tables for (a) and (b) are depicted below. p q p⇒q p p∨q T T T F T T F F F F F T T T T F F T T T p q r q∨r p∧(q∨r) p∧q q∧r (p∧q)∨(p∧r) T T T T T T T T T T F T T T F T T F T T T F T T T F F F F F F F F T T T F F F F F T F T F F F F F F T T F F F F F F F T F F F F
Example (a) is an important result. It says that p⇒ q is true when one of these two things happen: (i) whenpis false, (ii) otherwise (whenpis true) qmust be true. N
Hands-On Exercise 2.5.2 Use truth tables to establish these logical equivalences. (a) p⇒q≡q⇒p
(b) p∨p≡p (c) p∧q≡p∨q
2.5 Logical Equivalences 31
Solution: We have set up the table for (a), and leave the rest to you. p q p⇒q q p q⇒p T T T F F T F F 4
Hands-On Exercise 2.5.3 The logical connective exclusive or, denotedpYq, means eitherp orqbut not both. Consequently,
pYq≡(p∨q)∧(p∧q)≡(p∧q)∨(p∧q). Construct a truth table to verify this claim.
4
Properties of Logical Equivalence. Denote byT and F a tautology and a contradiction, respectively. We have the following properties for any propositional variablesp,q, andr.
1. Commutative properties: p∨q≡q∨p, p∧q≡q∧p. 2. Associative properties: (p∨q)∨r≡p∨(q∨r), (p∧q)∧r≡p∧(q∧r). 3. Distributive laws: p∨(q∧r)≡(p∨q)∧(p∨r), p∧(q∨r)≡(p∧q)∨(p∧r). 4. Idempotent laws: p∨p≡p, p∧p≡p. 5. De Morgan’s laws: p∨q≡p∧q, p∧q≡p∨q.
6. Laws of the excluded middle, orinverse laws: p∨p≡T,
p∧p≡F.
7. Identity laws: p∨F ≡p,
p∧T ≡p.
8. Domination laws: p∨T ≡T,
32 Chapter 2 Logic
9. Equivalence of an implication and its contrapositive: p⇒q≡q⇒p. Two VERY important
logical equivalences.
Memorize them! 10. Writing an implication as a disjunction: p⇒q≡p∨q.
Be sure you memorize the last two equivalences, because we will use them frequently in the rest of the course.
Remark. These properties are not easy to recall. Instead of focusing on the symbolic formulas, try to understand their meanings. Let us explain them in words, and compare them to similar operations on the real numbers,
1. Commutative properties: In short, they say that “the order of operation does not
matter.” It does not matter which of the two logical statements comes first, the result from conjunction and disjunction always produces the same truth value. Compare this to addition of real numbers: x+y=y+x. Subtraction is not commutative, because it is not always true thatx−y=y−x. This explains why we have to make sure that an operation is commutative.
2. Associative properties: Roughly speaking, these properties also say that “the order
of operation does not matter.” However, there is a key difference between them and the commutative properties.
• Commutative properties apply to operations ontwo logical statements, but associa- tive properties involvesthreelogical statements. Since∧and∨arebinaryoperations, we can only work on a pair of statements at a time. Given the three statementsp, q, and r, appearing in that order, which pair of statements should we operate on first? The answer is: it does not matter. It is the order ofgrouping (hence the term associative) that does not matter in associative properties.
• The important consequence of the associative property is: since it does not matter on which pair of statements we should carry out the operation first, we can eliminate the parentheses and write, for example,
p∨q∨r
without worrying about any confusion.
• Not all operations are associative. Subtraction is not associative. Given three num- bers 5, 7, and 4, in that order, how should we carry out two subtractions? Which interpretation should we use:
(5−7)−4, or 5−(7−4)?
Since they lead to different results, we have to be careful where to place the paren- theses.
3. Distributive laws: When we mix twodifferent operations on three logical statements,
one of them has to work on a pair of statements first, forming an “inner” operation. This is followed by the “outer” operation to complete the compound statement. Distributive laws say that we can distribute the “outer” operation over the inner one.
4. Idempotent laws: When an operation is applied to a pair of identical logical statements,
the result is the same logical statement. Compare this to the equation x2=x, where xis
a real number. It is true only whenx= 0 orx= 1. But the logical equivalencesp∨p≡p andp∧p≡pare true for all p.
5. De Morgan’s laws: When we negate a disjunction (respectively, a conjunction), we
have to negate the two logical statements, and change the operation from disjunction to conjunction (respectively, from conjunction to a disjunction).
2.5 Logical Equivalences 33
6. Laws of the excluded middle, orinverse laws: Any statement is either true or false,
hence p∨pis always true. Likewise, a statement cannot be both true and false at the same time, hence p∧pis always false.
7. Identity laws: Compare them to the equationx·1 =x: the value ofxis unchanged after
multiplying by 1. We call the number 1 the multiplicative identity. For logical operations, the identity for disjunction is F, and the identity for conjunction is T.
8. Domination laws: Compare them to the equationx·0 = 0 for real numbers: the result
is always 0, regardless of the value x. The “zero” for disjunction is T, and the “zero” for
conjunction is F. ♦
Example 2.5.6 What is the negation of 2≤x≤3? Give a logical explanation as well as a graphical explanation.
Solution: The inequality 2≤x≤3 means
(2≤x)∧(x≤3). Its negation, according to De Morgan’s laws, is
(2> x)∨(x >3).
The inequality 2≤x≤3 yields a closed interval. Its negation yields two open intervals. Their graphical representations on the real number line are depicted below.
s s 2 3 (2≤x)∧(x≤3) c c 2 3 (2> x)∨(x >3)
Take note of the two endpoints 2 and 3. They change from inclusion to exclusion when we take
negation. N
Hands-On Exercise 2.5.4 Since 0≤x≤1 means “0≤xandx≤1,” its negation should be See Example 2.2.5. “0> xor x >1,” which is often written as “x <0 orx >1.” Explain why it is inappropriate,
and indeed incorrect, to write “0> x >1.”
4
Example 2.5.7 Expand (p∧q)∨(r∧s).
Solution: Compare this problem to the expansion of (x+y)(u+v). We use the distributive law twice to obtain
(x+y)(u+v) = x(u+v) +y(u+v) = xu+xv+yu+yv.
Let us follow the same procedure to expand (p∧q)∨(r∧s). We need to apply the distributive law twice. The first time, regard (r∧s) as a single statement, and distribute it overp∧q. In the second round, distributepandq, separately, overr∧s. The complete solution is shown below.
(p∧q)∨(r∧s) ≡ [p∨(r∧s)]∧[q∨(r∧s)]
34 Chapter 2 Logic
We can also proceed as follows:
(p∧q)∨(r∧s) ≡ [(p∧q)∨r]∧[(p∧q)∨s]
≡ (p∨r)∧(q∨r)∧(p∨s)∧(q∨s).
The two results are identical because∧is commutative. N Hands-On Exercise 2.5.5 Expand (p∨q)∧(r∨s).
4
Example 2.5.8 We have used a truth table to verify that [(p∧q)⇒r]⇒[r⇒(p∨q)]
is a tautology. We can use the properties of logical equivalence to show that this compound statement is logically equivalent toT. This kind of proof is usually more difficult to follow, so it is a good idea to supply the explanation in each step. Here is a complete proof:
[(p∧q)⇒r]⇒[r⇒(p∨q)] ≡ (p∧q)⇒r∨[r⇒(p∨q)] (implication as disjunction)
≡ (p∧q)⇒r∨[p∨q⇒r] (implication as disjunction)
≡ (p∧q)⇒r∨[(p∧q)⇒r] (De Morgan’s law)
≡ T (inverse law)
This is precisely what we called the left-to-right method for proving an identity (in this case, a
logical equivalence). N
Example 2.5.9 Writep⇒qas a conjunction.
Solution: It is important to remember that Wrong ways to negate
an implication.
p⇒q6≡q⇒p,
and
p⇒q6≡p⇒q
either. Instead, sincep⇒q≡p∨q, it follows from De Morgan’s law that p⇒q≡p∨q≡p∧q.
Alternatively, we can argue as follows. Interpretp⇒qas sayingp⇒qis false. This requiresp How to negate an
implication? to be true andqto be false, which translates intop∧q. Thus,p⇒q≡p∧q. N
Summary and Review
• Two logical statements are logically equivalent if they always produce the same truth value.
• Consequently,p≡q is same as sayingp⇔qis a tautology.
• Beside distributive and De Morgan’s laws, remember these two equivalences as well; they are very helpful when dealing with implications.
2.5 Logical Equivalences 35
Exercises 2.5
1. Use a truth table to verify the De Morgan’s lawp∨q≡p∧q. 2. Use truth tables to verify the two associative properties.
3. Construct a truth table for each formula below. Which ones are tautologies? (a) (p∨q)⇒p
(b) (p⇒q)∨(p⇒q) (c) (p⇒q)⇒r
4. Use truth tables to verify these logical equivalences. (a) (p∧q)⇔p≡p⇒q
(b) (p∧q)⇒r≡p⇒(q∨r) (c) (p⇒q)∧(p⇒r)≡p∧(q∨r)
5. Use only the properties of logical equivalences to verify (b) and (c) in Problem 4.
6. Determine whether formulasuandv are logically equivalent (you may use truth tables or properties of logical equivalences).
(a) u: (p⇒q)∧(p⇒q) v: p (b) u: p⇒q v: q⇒p
(c) u: p⇔q v: q⇔p (d) u: (p⇒q)⇒r v: p⇒(q⇒r)
7. Find the converse, inverse, and contrapositive of these implications.
(a) If triangleABC is isosceles and contains an angle of 45 degrees, thenABC is a right triangle.
(b) If quadrilateralABCDis a square, then it is both a rectangle and a rhombus. (c) If quadrilateralABCD has two sides of equal length, then it is either a rectangle or
a rhombus.
8. Negate the following implications: (a) x2>0⇒x >0.
(b) IfP QRS is a square, thenP QRS is a parallelogram. (c) Ifn >1 is prime, thenn+ 1 is composite.
(d) Ifxandy are integers such thatxy≥1, then eitherx≥1 ory≥1. 9. Determine whether the following formulas are true or false:
(a) p⇔q≡p⇔q (b) (p⇒q)∨(p⇒q)≡p
(c) p⇒q≡q⇒p
10. Determine whether the following formulas are true or false: (a) (p⇒q)⇒r≡p⇒(q⇒r)
(b) p⇒(q∨r)≡(p⇒q)∨(p⇒r) (c) p⇒(q∧r)≡(p⇒q)∧(p⇒r)
11. Which of the following statements are equivalent to the statement “ifx2>0, thenx >0”?
(a) Ifx >0, thenx2>0. (b) Ifx≤0, thenx2≤0. (c) Ifx2≤0, thenx≤0. (d) Ifx26>0, thenx6>0.
36 Chapter 2 Logic
12. Determine whether the following formulas are tautologies, contradictions, or neither: (a) (p⇒q)∧p
(b) (p⇒q)∧(p∧q) (c) (p⇒q)∧q
13. Simplify the following formulas:
(a)p∧(p∧q) (b)p∨q (c)p⇒q
14. Simplify the following formulas:
(a) (p⇒q)∧(q⇒p) (b)p∧q (c)p∧(p∨q)