Mathematics for Computer Science

(avery) #1
1.6. Proving an “If and Only If ” 13

1.5.2 Method #2 - Prove the Contrapositive
An implication (“PIMPLIESQ”) is logically equivalent to itscontrapositive
NOT.Q/IMPLIES NOT.P/:
Proving one is as good as proving the other, and proving the contrapositive is some-
times easier than proving the original statement. If so, then you can proceed as
follows:


  1. Write, “We prove the contrapositive:” and then state the contrapositive.

  2. Proceed as in Method #1.


Example
Theorem 1.5.2.Ifris irrational, then

p
ris also irrational.
A number isrationalwhen it equals a quotient of integers —that is, if it equals
m=nfor some integersmandn. If it’s not rational, then it’s calledirrational. So
we must show that ifrisnota ratio of integers, then

p
ris alsonota ratio of
integers. That’s pretty convoluted! We can eliminate bothnot’s and simplify the
proof by using the contrapositive instead.
Proof. We prove the contrapositive: if

p
ris rational, thenris rational.
Assume that

p
ris rational. Then there exist integersmandnsuch that:
p
rD

m
n
Squaring both sides gives:
rD

m^2
n^2
Sincem^2 andn^2 are integers,ris also rational. 

1.6 Proving an “If and Only If”


Many mathematical theorems assert that two statements are logically equivalent;
that is, one holds if and only if the other does. Here is an example that has been
known for several thousand years:
Two triangles have the same side lengths if and only if two side lengths
and the angle between those sides are the same.
The phrase “if and only if” comes up so often that it is often abbreviated “iff.”
Free download pdf