A < BAndreas Klappenecker
Motivation
We want to highlight some basic proof techniques using inequalities as an example.
We start from first principles and define when a number a is greater than a number b.
Then we derive some simple facts, exercising the direct proof technique.
Building on this foundation, we prove for some simple function f(n) that f(n) = O(g(n)). We also show how to disprove such a claim.
A<B
Let a and b be real numbers.
We say that a is greater than b, written a > b, if and only if a-b is a positive number.
Transitivity
Let a, b, and c be real numbers.
Theorem: If a>b and b>c then a>c.
Proof: Since a>b and b>c, it follows that a-b and b-c are positive real numbers (by definition of >).
The sum of positive real numbers is positive,
hence a-b + b-c = a-c is a positive real number.
Therefore, we can conclude that a>c. We only used the definition!
Adding a Number
Theorem: Let a, b, and c be real numbers.
If a>b, then a+c > b+c
Proof: Try to prove it yourself!
Adding Inequalities
Theorem: If a>b and c>d, then a+c > b+d.
Proof: If a>b, then a+c > b+c by the previous theorem.
Similarly, it follows from c>d that b+c > b+d.
By transitivity, we get a+c > b+d. Now we used previously
established facts
Multiplication and Inequalities
Theorem: Suppose that a>b. For any c>0, we have ac>bc. For any c<0, we have ac<bc.
Theorem: Suppose that a>b and c>d. Then ac>bd.
Again: Try to prove these yourself!
Big Oh
Example
Theorem: n = O(n2)
Proof: For all natural numbers n, we have n>=1.
It follows that n2>=n holds for all n >= 1.
Thus, by definition, n = O(n2).
We used that inequalities can be multiplied by a positive constant.
Proof by Contradiction
We want to prove that a certain statement S is true.
We begin by assuming that the statement S is false. We then deduce from the fact that S is false by logical reasoning some fact that is not true, an absurdity. Therefore, the statement
“S is false”
must be wrong, hence S must be true.
Example
Theorem: n2∉O(n).
Proof: Seeking a contradiction, we assume that n2 ∈O(n). Then there would have to exist a constant U and a natural number n0 such that
n2<= Un holds for all n>= n0.
This would imply that n <= U holds for all
n > max(n0 ,U), which is absurd. Therefore, we can conclude that n2 is not contained in O(n).