Number Theory
G-d created the integers. All else is the work of man - Kronecker.
Number theory is the area of mathematics where we study the properties of the integers, particularly divisibilty and primality.
An integer n is even iff n=2k for some integer k.
An integer n is odd iff n=2k+1 for some integer k.
Claim: The product of two odd numbers is always odd.
Proof: Consider the product of n = 2k+1 and m = 2l+1.
Note how we relabeled the variable l to distinguish the two uses of the definition in the product.
In number theory we are interested in proving such general properties of the integers.
Types of Numbers
There are several different classes of numbers which are of interest, listed below in order of increasing generality:
Typically denoted Z.
Are integers themselves rational?
The irrational numbers are reals which are not rational, like and .
Each of these classes has different number theoretic properties and definitions, so be sure you know which type of numbers you mean when you state something!
Mathematical Proof
We have seen how truth tables and inference rules can can be used to prove the truth of logical formulas.
Most areas of mathematics require equally rigorous but less formal proofs. This means writing proofs in complete English sentences, augmented by appropriate notation.
Each proof must start with a rigourous statement of what is to be proven. Any ambiguity about the statement means any proof cannot be correct!
The added flexibility of not filling all the logical steps enables us to prove far more complicated things, although it requires us to use our own discipline to avoid mistakes.
Check these proofs that ``all odd numbers are prime'' for common logical errors in proofs:
A proof shows why something is true - if you don't have an idea, you don't have a proof!
Fermat's Last Theorem
Fermat's Last Theorem states that the equation
has no solutions in the natural numbers for any n > 3.
What about FLT when n=1?
What about FLT when n=2?
What about FLT for integers instead of naturals?
Over 350 years ago, Fermat claimed, presumably erroneously, that he had a proof that was ``too long to write in the margin of his book''.
No proof was found until Wiles solved the problem in 1993, and even this proof contained a ``gap'' which was not resolved until a few years later.
This ``gap'' was one of Wiles jumping to a conclusion; after it was pointed out he devoted himself to carefully proving this step (or its equivalent).
Counterexamples
The easiest way to resolve a mathematical conjecture is provide a counterexample, a specific instance where it is false.
Mathematicians argue that all odd numbers are not prime by pointing out that is composite.
Conjecture: For all real numbers a and b, if , then a=b.
Counterexample: consider a=1 and b=-1!
Conjecture: For all real numbers a and b, if a=b, then .
Proof: . height6pt width4pt
A good place to look to find counterexamples is at boundary cases, examples near the edges of the definition and so likely to be overlooked (such as negative numbers, 0, and the largest number).
Boundary case errors also account for a large percentage of bugs in programs, because the programmer did not think out the complete implications of what they wrote.
The best way to hunt for counterexamples is to try to prove the statement, and look where you get into difficulties with the proof.
What is a Rational Number?
A number r is rational if it can be written as the ratio of two integers, i.e. r=a/b where and .
Is -(5/39) rational?
Is 12432 rational?
Is 0.281 rational?
Is 0/2 rational?
Is 2/0 rational?
All of those above can be written as ratios of integers, and all except for the last one has non-zero denominator.
Is 0.123123123123...rational?
Repeating Decimals
To show that is rational we must produce the numerator and the denominator yielding this repeating decimal.
Let . Then:
So x = 123 / 999. Similar arguments can be used to show that any repeating decimal yields a rational number.
Properties of Rational Numbers
The ``real'' numbers in computers are really rational numbers, because they have a finite length. Example: 54.345834 = 54345834 / 1000000.
That ``real'' numbers in computers are represented as rationals sometimes causes problems, like !
Representing a rational number correctly requires keeping both of the integers. Example:
Theorem: The sum of any two rational numbers x and y is rational.
Proof: Since they are rational, let x=a/b and y=c/d, where a, b, c, d are integers and .
Since a, b, c, d are integers, the numerator is an integer.
Since , the denominator is a non-zero integer.
This is an example of a direct proof.
So What's Not a Rational Number?
An irrational number is a real which cannot be expressed as the ratio of two integers.
Irrational numbers seem, well, irrational - at least the ancient Greeks thought so.
By the Pythagorean Theorem, the length of the diagonal of a square is .
Note that the Pythagorean Theorem is a special case of Fermat's Last Theorem.
The Irrationality of
Although we can approximate the arbitrarily closely by a rational number, it is not rational!
We can show this using a beautiful proof by contradiction.
Proof: Assume the converse, that is rational.
Therefore for some integers m and n, where m and n have no common factors (otherwise we could just cancel them, i.e. 124/56 = 31/14).
By squaring both sides, we get , or
Therefore and m must be even numbers, so m=2k for some integer k. Thus
Dividing both sides by 2 leaves , so and n must be even, i.e. n=2l.
So . But we assumed that m and n had no common factors, so we have a contradiction!
Therefore, cannot be rational! height6pt width4pt