Transcript Lec11Proofs

Lecture 11
1.5, 3.1 Methods of Proof
Last time in 1.5
To prove theorems we use rules of inference such as:
p, pq, therefore, q
NOT q, pq, therefore NOT p.
p AND q, therefore p
FORALL x P(x), therefore for arbitrary c, P(c)
EXISTS x P(x), therefore for some c, P(c)
It is easy to make mistakes, make sure that:
1) All premises pi are true when you prove (p1 AND p2 AND...pn)  q
2) Every rule of inference you use is correct.
Some proof strategies:
To proof pq
1) direct proof: assume p is true, use rules to prove that q is true.
2) indirect proof, assume q is NOT true, use rules to prove p is NOT true.
To prove p is true:
3) By contradiction: assume p is NOT true, use rules to show that NOT pF
i.e. it leads to a contradiction.
Vacuous –Trivial Proofs
Lets say we want to prove pq but the premise p can be shown to be false!
Then pq is always true because (FT) = T and (FF) = T.
This is a vacuous prove.
Old example: prove that for any set S:   S
Proof: The following must be shown to be true: x ( x 
However: the empty set does not contain any elements
and the premise is always false. Therefore the implication
must always be true!
 x  S)
Trivial Proof: We want to prove pq, and we can show that q is true.
Then, because (TT) = T and (FT) = T we have proven the implication.
Example: P(n): a>=b  a^n >= b^n for postive integers.
Is P(0) true?
P(0): a^0 >= b^0 is equivalent to 1>=1. Therefore, q is true and thus pq is true.
Example Indirect Proof
Prove that: if n is an integer and n^2 is odd, then n is odd.
Direct prove is hard in this case.
Indirect proof: Assume NOT q : n is even.
n = 2k
n^2 = 4k^2 = 2(2k^2) is even, is not odd.
Thus NOT q  NOT p, pq
Example of Proof by Contradiction
def: rational number is a number that can be written as a/b for integers a,b, where
b should not be 0. Reals that are not rational are irrational.
sqrt(2) is irrational.
(note: we are not proving an implication now, although we could
have written it as: if x=sqrt(2)  x = irrational.)
Assume sqrt(2) is not irrational.
sqrt(2) = a/b where there is no common divisor (otherwise divide by this number).
2 = a^2 / b^2
2b^2 = a^2
a^2 = even
a = even
a = 2c
2b^2 = 4c^2
b^2 = 2c^2
b^2 = even
b=even
both a and b can be divided by 2! (contradiction) p  r  r
1.5
An indirect proof is in fact also a prove by contradiction:
Assume p = T and (NOT q) = T
indirect prove: (NOT q)  (NOT p)
Therefore: p AND (NOT p) = T, contradiction
Proof by cases:
(p1 OR p2 OR p3 ... OR pn)  q (if at least one of the premises hold, q follows)
This is equivalent to (p1q) AND (p2q) AND ... AND (pnq)
Example: Prove x^2 >= 0
p1: x<0  x^2 >=0
p2: x=0  x^2 >=0
p3: x>0 x^2 >=0
Equivalence Proofs
These are bidirectional statements of the form pq.
Equivalent to proving 2 cases:
pq
qp
since (pq) AND (qp)  (pq) is a tautology.
Example: Prove integer n is odd if and only if (iff) n^2 is odd.
Lecture 10: if n is odd  n^2 is odd
Lecture 11: if n^2 is odd  n is odd. 
Lists of Equivalences
p1 p2p3.....pn
This means they are all equivalent.
There are C(n,2) pairs to prove!
There is however a smarter way: Design one path through all pi’s that can
bring you from any pi to any other then you are done:
p5
p4
p6
p3
p1
p2
Theorems with Quantifiers
Existence proofs: Proofs of the form: There exists an element x such that.....
xP ( x )
these proofs may be constructive (construct some x) or non-constructive.
Uniqueness: Proofs of the form: there exists a unique element x such that...
! xP( x)  x( P( x)  y ( y  x  P( y )))
Example: Prove that
x! y ( x  y  0)
proof: for arbitrary x, y=-x makes the proposition true. Is it unique.
Assume it is not true and show contradiction:
Let say there is a r such that x+r=0 but r is not –x.
Then it follows that x+r=x+y  r=y which contradicts our assumption.
3.1
self reading
The Halting Problem
Is it possible to design an algorithm that always predicts for a given program P
and a given input to that program I, if it will stop run forever?
Proposition: there isn’t
Proof.
Assume there is such a predictor H(P,I).
A program can be represented as a bit-string, and therefore as input to another
program. Imagine a program P that can take itself as input.
H(P,P) should predict if it stops: H = 1 if it stops, H=0 if it doesn’t stop.
Define a new program K(P) as follows:
that is K(P) loops forever if H(P,P) = 1
K(P) = stops
if H(P,P) = 0
Can H(K,K) predict whether this program stops?
K(K) loops forever if H(K,K) = 1
K(K) stops
if H(K,K) = 0
So H(K,K) does not predict correctly which is in contradiction with the assumption!
Sequences & Summations
definition: A sequence is a function from the set of integers to a set S:
a1,a2,a3,.... (function from 1,2...  a1,a2,...)
an is a term in the sequence which is sometimes denoted with {an} (not a set!)
Example: {an} with an= 1/n over n=1,....
1,1/2,1/3, ...
Geometric progression: Sequence of the form: a,ar,ar^2,...,ar^n,...
a = initial term, r = common ratio are real numbers
3,6,12,24,... (a=3,r=2): ratios are constant
Arithmetic progression Sequence of the form a,a+d,a+2d,...,a+nd,...
a = initial term and d = common difference are real numbers
3,5,7,9,11,...(a=3,r=2): differences are constant
A string: finite sequence a1,...,an.
Sums Notation
notation:
n
single sum
a  a
i m
n2
double sum
n
i
a m
n2
a

n2

k m2
n2
  a   (a
i  m1 j  m2
ij
i  m1
i , m1
ak  2  am ,..., an
ai ,m1 1  ....ain1 )
Summations
n
S   ar j 
Theorem
j 0
n
n 1

ar
a
n

ar j   r  1

j 0
 (n  1)a

if r  1
if r  1
proof
rS   ar j 1 
j 0
n 1
rS   ar k 
k 1
rS  ar
n 1
n
 a   ar k 
k 0
trivial
rS  ar n 1  a  S 
ar n 1  a
S
if r  1
r 1
Summations
n
Theorem:
 a  jd  (n  1)a  d
j 0
n(n  1)
2
sketch of proof:
Split into 2 cases: even and odd n.
In both cases argue as follows:
0  1  2  ...  n 
(0  n)  (1  n  1)  (2  n  2)  ...
n(n  1)

2