Predicate Logic
Class notes
Induction, Recursion
Document also available in PDF, Postscript, DVI, Text, LaTeX, LyX.
Chapter 1 Proof techniques (section 2.1)
1.1 Theorems and Informal proofs
What we have seen so far:

Argument
 P_{1}/\···/\ P_{n} > Q
 Syntax
 how it's written
 Semantic
 meaning in a given interpretation
 Valid argument

True for all interpretations
True because of its very structure
Proofs of valid argument are purely based on syntactical rewriting
rules.
Only arguments that are true for all interpretations can be proved.
We are now interested to work in a particular subject (say integer
arithmetic).
Définition 1
A theorem is an argument that is valid in this particular subject.
Exemple 1
If x is even and y is even then xy is even.
E(x): x is even
(for allx ) (for ally ) [E(x)/\ E(y) > E(xy)]
This argument is true in this context, but not universally true.
How to prove it ?
Implicitly, we add new hypothesis which reflects basic facts of this
subject.
For example, we add the following hypothesis:
Using those new hypothesis, it's now possible to write a formal logic
proof of the theorem.
See [, Example 4 p. 87]
1.1.2 Formal and informal proofs:
Remember that the goal of a proof is to be read by humans (in particular
yourself) in order to convince those humans.
The formal proof above is convincing in the sense that you can check
that all the steps are valid. However, it's very difficult to extract
the meaning of the proof:

Why does it work ?
 How could I reuse it for a similar problem ?
The problem is that the keys of the proofs are buried under layers
of insignificant details.
So, starting from now, we will write informal proofs:
Définition 2
An informal proof is a narrative descriptions, of the ideas
and of the important steps of the proof, without extraneous details.
Exemple 2
A proof of the theorem above could be written as follow:
Proof.
Let x and y be two even integers. We can take n and m
such that x=2n and y=2m.
Then, xy=2(2nm). Since 2nm is an integer, xy is an even number.
Let see which details we omitted:

Let x and y be two even integers.
Implicit universal instantiation
 We can take n and m such that x=2n and y=2m.
Implicit universal instantiation for x and y of the definition
of an even number
Implicit existential instantiation for n and m
 Then, xy=2(2nm)
Implicit use of rules of arithmetic
 Since 2nm is an integer, xy is an even number:
Implicit universal instantiation of the definition of an even number
Implicit universal generalization to get the final result
Problem 1
Which details can we omit, and which not ?
A reader will be convinced by the proof if he can check that he could
translate each step of the proof into one or several steps of a formal
proof.
So, this all depends on WHO reads the proof!
You should not write your proof for your instructor, but for yourself,
and for everybody else in the class.
A good rule of thumb is to imagine yourself rereading the proof in
a few month, and to check that even then, you could possibly translate
the proof into a formal one.
The difference between formal and informal proofs is very similar
to the difference between assembly and, say, C++ or Java. A C++ program
is not usable by itself. It's usable because it's possible to translate
it into assembly language.
However, there does not exists, and most likely will never exists,
a compiler that transforms informal proofs into formal proofs. English
is much to rich a language for this.
1.1.3 Formal and informal theorems:
Most of the time, we also won't write theorems as a formal argument,
but rather with an English sentence that could be translated into
a formal argument:
Théorème 1
Let x and y be two integers. [Some definitions: interpretation]
Assume x and y are even. [Some hypothesis: P_{1}/\···/\ P_{n}]
Then, xy is even. [Consequent: Q]
1.1.4 To Prove or not to prove
In textbooks, you can be asked: prove that ...

you know in advance it's true;
 you just have to figure out how to prove it.
Usually, in real life, you first have to find what to prove.

you don't even know in advance if it's true.
Two jobs:

Find the good questions
 Prove or disprove those questions
Définition 3
A conjecture is a statement that you guess is true, but that
you have not proved or disproved yet.
Classical steps:

Explore some examples
 Try to see some pattern emerging
 Formulate a conjecture
 Try to prove (or disprove it)
Steps 13 are inductive reasoning, whereas step 4 is deductive reasoning.
Finding the good questions is as important as solving them !
Exemple 3
Fermat's conjecture.
1.1.5 Some ``research'' around the factorial
Définition 4
Let n be an integer. The factorial of n is the number n!:=n(n1)···1.
For example, 1!=1 and 4!=4·3·2·1=24.
Problem 2
How big is n! ?
1.2 Proof techniques
We want to prove some argument of the form P > Q.
1.2.1 Disproof by counter example
Conjecture 1
If n is a positive integer, then n!<n^{3}.
1.2.2 Direct proof
Définition 5
Direct proof

Assume P
 Deduce Q
Exemple 4
Prove that if x and y are even, then xy is even.
Exercice 1
Prove that if x and y are even, then x+y is even.
1.2.3 Proof by contraposition
Exemple 5
Prove that if n^{2} is odd, then n is odd.
Hint: prove instead that if n is even, then n2 is
even.
Définition 6
Proof by contraposition:

Assume Q' (the consequent is false)
 Prove P' (the antecedent is also false)
This technique relies on the fact that P > Q is equivalent to
Q' > P'.
Exercice 2
Prove that xy is odd if and only if x and y are odd.
1.2.4 Exhaustive proof
Problem 1
Can a proof by example be valid ?
Yes, if there is a finite number of cases to be treated.
Exemple 6
Propositional logic formula (the truth table is finite)
Définition 7
Proof by exhaustion means that all cases have been exhausted.
(and so are you ...).
Exemple 7
Drawing a figure without lifting the pencil and without retracing
a line.
1.2.5 Some ``research'' around rational numbers
Définition 8
A number x is rational if it can be written as p/q,
where p and q are integers.
Exemple 8
5, 7/5, 1/3, 14/4, 7/2,
... are rational.
Problem 2
Properties of rational numbers ?
Remarque 1
If x is rational, it's always possible to choose p and q
so that:

q is positive
 p and q are relatively prime
I.e., the biggest common divisor of p and q is 1.
Problem 3
Are all numbers rational ?
Problem 4
Assume x and y are rational.

Is x+y rational ?
 Is xy rational ?
 Is x/y rational ?
Problem 5
Is the square root of an integer a rational number ?
Problem 6
Prove that the square root of 2 is irrational.
1.2.6 Proof by contradiction
Théorème 2
The square root of 2 is irrational.
Proof.
Let's assume the square root of 2 is rational.
Let p and q be two integers such that (2)^{1/2}=p/q
and p and q are relatively prime.
Then, we have 2=(p/q)^{2}, and so 2q^{2}=p^{2}.
Therefore p^{2} is even, and we have seen that this implies that
p is also even.
Let k be the integer such that p=2k.
Then, we have 2q^{2}=p^{2}=(2k)^{2}=4k^{2}, and so q^{2}=2k^{2}.
It follows that q^{2} is even, and so q is also even.
Conclusion: p and q are both even.
That's a contradiction, since p and q are relatively prime!
Définition 9
Proof by contradiction

Assume the contrary
 Deduce a contradiction
This technique relies on the fact that:

Q/\ Q' is always false
 if P>0 is true, then P is false.
1.2.7 Serendipity
Exemple 9
The chess board problem.
1.3 Summary
Goal 
Technique 
Name 
P > Q 
Assume P ; deduce Q. 
Direct proof/Deduction method 
P'> Q' 
Prove Q> P. 
Proof by contraposition 
Q' 
Assume Q; deduce a contradiction. 
Proof by contradiction 
P<> Q 
Prove P> Q; prove Q> P. 

P/\ Q 
Prove P ; prove Q. 

P\/ Q 
Prove P'> Q 

(P_{1}\/ P_{2})> Q 
Prove P_{1}> Q; prove P_{2}> Q 
Proof by cases 
(for allx ) Q(x) 
Let x; prove Q(x) 
ui / ug 
(there existsx ) Q(x) 
Construct a such that Q(a) 
eg 

Be smart 
Serendipity 
Predicate Logic
Class notes
Induction, Recursion
Proof Techniques /
CSM MACS358 /
Nicolas M. Thiéry
Last modified: Fri Jan 19 13:12:17 2007