Lecture Notes 4
Lecture Notes 4
1
Example
• Show that “if n is an integer and 3n+2 is odd,
then n is odd”
• Use p q q p
• Proof by contraposition:
– Assume n is even, i.e., n=2k, for some k
– It follows 3n+2=3(2k)+2=6k+2=2(3k+1)
– Thus 3n+2 is even
2
Example
• Prove that if n=ab, where a and b are positive
integers, then a n or b n
p q q p
Assume (a n b n )
a n b n
ab n n n
ab n
3
Example
• Definition: the real number r is rational if there
exist integers p and q with q≠0 such that r=p/q
• A real number that is not rational is irrational
• Prove that the sum of two rational numbers is
rational (i.e., “For every real number r and
every real number s, if r and s are rational
numbers, then r+s is rational”)
• Direct proof? Proof by contraposition?
4
Example
• Let r=p/q and s=t/u where p, q, t, u, are
integers and q≠0, and u≠0.
• r+s=p/q+t/u=(pu+qt)/qu
• Since q≠0 and u≠0, qu≠0
• Consequently, r+s is the ratio of two integers.
Thus r+s is rational
5
Example
• Prove that if n is an integer and n2 is odd, then
n is odd
• Direct proof? Proof by contraposition?
p : n 2 is odd
q : n is odd
Direct proof : Let n 2 2k 1, then n 2k 1
Proof by contradiction : n 2k , it follows that n 2 4k 2 2(2k 2 )
6
Proof by contradiction of p
• Suppose we want to prove a statement p
• Further assume that we can find a
contradiction q such that ┐p→q is true
• Since q is false, but ┐p→q is true, we can
conclude ┐p is false, which means p is true
• The statement ┐r˄r is contradiction, we can
prove that p is true if we can show that
┐p→(┐r˄r), i.e., if p is not true, then there is a
contradiction
7
Example
• Show that at least 4 of any 22 days must fall on the same
day of the week
• Let p be the proposition “at least 4 of any 22 days fall on
the same day of the week”
• Suppose ┐p is true, which means at most 3 of 22 days fall
on the same day of the week
• Which implies at most 21 days could have been chosen
because for each of the days of the week, at most 3 of the
chosen days could fall on that day
• If r is the statement that 22 days are chosen. Then, we
have
┐p→(┐r˄r) 8
Example
• Prove that 2 is irrational by giving a proof by
contradiction
• Let p be the proposition “ 2is irrational”
• ┐p: 2 is rational, and thus 2 a / bwhere a and
b have no common factors
• Thus 2=a2/b2, 2b2=a2, and thus a2 is even
• a2 is even and so a is even (can easily show if n2 is
even, then n is even). Let a=2c for some integer c,
2b2=a2=4c2, and thus b2=2c2, and b2 is even
9
Example
• Since b2 is even, b must be even
• ┐p leads to 2 a / b where and b have no
common factors, and both a and b are even
(and thus a common factor), a contradiction
• That is, the statement “ 2 is irrational” is true
10
Proof by contradiction of p->q
• Can be used to prove conditional statements
• First assume the negation of the conclusion
• Then use premises and negation of conclusion
to arrive a contradiction
• Reason: p→q≡((p˄┐q)→F)
11
Proof by contradiction
• Can rewrite a proof by contraposition of a
conditional statement p→q as proof by
contradiction
• Proof by contraposition: show if ┐q then ┐p
• Proof by contradiction: assume p and ┐q are
both true
• Then use steps of ┐q→┐p to show ┐p is true
• This leads to ┐q→p˄┐p, a contradiction
12
Example
• Proof by contradiction “If 3n+2 is odd, then n is
odd”
• Let p be “3n+2 is odd” and q be “n is odd”
• To construct a proof by contradiction, assume
both p and ┐q are both true
• Since n is even, let n=2k, then 3n+2=6k+2=
2(3k+1). So 3n+2 is even, i.e. ┐p,
• Both p and ┐p are true, so we have a
contradiction
13
Example
• Note that we can also prove by contradiction
that p→q is true by assuming that p and ┐q
are both true, and show that q must be also
true
• This implies q and ┐q are both true, a
contradiction
• Can turn a direct proof into a proof by
contradiction
14
Proof of equivalence
• To prove a theorem that is a biconditional
statement p↔q, we show p→q and q →p
• The validity is based on the tautology
(p↔q) ↔((p→q)˄(q →p))
15
Example
• Prove the theorem “If n is a positive integer,
then n is odd if and only if n2 is odd”
• To prove “p if and only if q” where p is “n is
odd” and q is “n2 is odd”
• Need to show p→q and q→p
“If n is odd, then n2 is odd”, and “If n2 is odd,
then n is odd
• We have proved p→q and q→p in previous
examples and thus prove this theorem with iff
16