# SP20:Lecture 13 Strong induction and Euclidean division

We introduced strong induction and used it to complete our proof that Every natural number is a product of primes. We then started our discussion of number theory with the quotient and remainder.

# Notation: sequences

In this lecture, we will use a bit of shorthand for representing (finite) sequences:

We often want to prove that there exists a sequence of values , all in , satisfying some property. Formally, we would say "there exists and values such that ".

This takes a lot of writing, and also requires us to introduce the variable (which often just adds complexity). So, we will abbreviate this to "there exists such that ".

We will also abbreviate sums and products of all the values: denotes the sum of the and denotes their product. We won't worry too much about the indices; unless otherwise specified, we just mean add (or multiply) all of them.

Note: there is ambiguity in this notation about whether we allow finite or infinite sequences. I will only use this notation for finite sequences.

# Strong induction

In the last lecture, we tried to prove that every natural number has a prime factorization.

We begin this lecture by showing how to modify that proof by strengthening the inductive hypothesis, and then we introduce the general technique of strong induction.

## Strengthing the inductive hypothesis

Sometimes, when doing an inductive proof, the inductive hypothesis doesn't quite say enough to be useful in the inductive step. In this situation, it can sometimes (ironically) be 'easier' to prove a stronger result than the original claim. Although this means you will have more to prove, it also means you will have more facts that you can use inside your inductive step.

For example, Here is a corrected version of the proof that Every natural number has a prime factorization wherein we strengthen the inductive hypothesis. You may find it useful to read them side by side to understand the differences.

There is a lot of technicality involved in this proof that doesn't really help explain what's going on; it is much clearer to write essentially the same proof using strong induction. This is an example to demonstrate that you can always rewrite a strong induction proof using weak induction.

The key idea is that, instead of proving that every number has a prime factorization, we prove that, for any given , every number has a prime factorization. Of course, this means that itself has a prime factorization, but by proving even more, we allow our inductive step to go through.

For all , if then there exists prime numbers with .
We will prove the claim using weak induction, but with a strengthened induction hypothesis. Let be the statement "for all with , there exists prime numbers with . We will prove and assuming .

In the base case, when , we will choose an arbitrary between and ; we see that must be 2. 2 is prime. Therefore, we can choose ; clearly .

For the inductive step, we assume ; our goal is to show , in other words that every has a prime factorization.

Choose an arbitrary . Since and are natural numbers, we see that either or . If , then we can apply to find a prime factorization for . Thus, the only remaining case is when .

There are two cases: could be prime or composite. If is prime, we can proceed as in the base case: simply choose .

If, on the other hand, is composite, then we know that for some natural numbers and .

If we knew that and had prime factorizations, then we could combine them to form a prime factorization of . But now we do know that! Since and , we see that ; similarly . Therefore we can apply to conclude that and have prime factorizations.

We can therefore finish the proof: Let be the prime factorization of , and let be the prime factorization of . If we let be the sequence starting with the and ending with the s (in other words, ). Then clearly .

## Strong induction

Strengthening the inductive hypothesis in this way (from to ) is so common that it has some specialized terminology: we refer to such proofs as proofs by strong induction:Strong induction is similar to weak induction, except that you make additional assumptions in the inductive step.

To prove "for all , P(n)" by strong induction, you must

More concisely, the inductive step requires you to prove assuming for all .

The difference between strong induction and weak induction is only the set of assumptions made in the inductive step.

The intuition for why strong induction works is the same reason as that for weak induction: in order to prove , for example, I would first use the base case to conclude . Next, I would use the inductive step to prove ; this inductive step may use but that's ok, because we've already proved . I would then use the inductive step to conclude ; this may use both and , but that's okay because we've already proved and . Next, I would again use the inductive step to conclude ; as before, this may use , , or , but this is not a problem since we have already proved those three facts. Similarly, we can use the inductive step to conclude P(4), P(5), etc.

Note that you can always use strong induction instead of weak induction. Using weak induction is just a matter of style: by avoiding unneeded assumptions, you reduce the complexity of your proof, and clearly indicate to the reader what assumptions you are actually planning to use. I often start inductive proofs by not specifying whether they are proofs by strong or weak induction; once I know which inductive hypothesis I actually need, I go back and fill in the beginning of my inductive step.

Here is a simplified version of the proof that every natural number has a prime factorization.

We use strong induction to avoid the notational overhead of strengthening the inductive hypothesis. This proof has the simplicity of the incorrect weak induction proof, but it actually works. You should compare the three versions of the proofs to understand the differences.

For all , if then there exists prime numbers with .
Proof: using strong induction
We will prove the claim using strong induction. Let be the statement that "there exists prime numbers with . We will prove and assuming .

In the base case, when we see that 2 is prime. Therefore, we can choose ; clearly .

For the inductive step, we assume (or in other words, we strong induction for all ; our goal is to show , in other words that has a prime factorization.

There are two cases: could be prime or composite. If is prime, we can proceed as in the base case: simply choose .

If, on the other hand, is composite, then we know that for some natural numbers and .

Since and must be less than , we can apply and to conclude that both and have prime factorizations.

Let be the prime factorization of , and let be the prime factorization of . If we let be the sequence starting with the and ending with the s (in other words, ). Then clearly .

# Variations on induction

There are many variants of induction: For example, in the inductive step, you may assume and prove :

To prove by weak induction, you can prove and prove for an arbitrary , assuming .

This is just a change of variables, but it occasionally makes the notation a bit easier to work with.

There are other variants that you can use. For example, if you only care about for , you can use the following principle:

To prove using weak induction, you can prove and prove for an arbitrary , assuming .

This is also equivalent to weak induction.

In fact, one can even convert a proof by strong induction into a proof by weak induction.

You can mix and match these variations. If you're using an unfamiliar variation, you should check that it makes sense intuitively, and if possible, show how to convert it to a proof by weak induction. For example, you should be sure to avoid a backwards proof while doing induction.

## Proofs that variants are equivalent to the basic weak induction principle

In this lecture we argued that these variants are equivalent to the basic weak induction principle:

To prove "" using weak induction, you must prove (this is often called the base case), and then you must prove for an arbitrary , assuming (this is called the inductive step).

Here are links to the proofs; these are good exercises in using your proof techniques, although they can be a bit abstract:

# Euclidean division

With these basic techniques (weak induction and strong induction) under our belt, we can begin the study of number theory.

For our purposes, refers to the study of the natural numbers and the integers. We will also introduce and study a closely related class of objects, the modular numbers.

Number theory is useful in several areas of computer science, including number representations, digital logic, information theory, and cryptography.

While studying number theory, we will be primarily interested in the properties of the integers and natural numbers. This means that if we want to write something like "", we'll have to be very careful to check that divides . This makes everything very complicated, so instead, we'll avoid dividing natural numbers.

We can, however, do division with remainder. The Euclidean division algorithm is just a fancy way of saying this:

For all and all , there exists numbers and such that

Here and are the quotient and remainder of over :

Definition: Quotient
We say is a quotient of over if for some with . We write (note that quot is a well defined function).
Definition: Remainder
We say is a remainder of over if for some and . We write (note that rem is a well defined function).

Note that all this is a theorem, it is called the "Euclidean division algorithm" because its proof contains an algorithm.

Proof:
We prove this by weak induction on . Let be the statement "for all , there exists satisfying (1) and (2) above." We will show and assuming .

Base case: We want to show P(0). Let . Then and since .

Inductive step: Assume ; we want to show . By , we know that there exists numbers and such that . We want to show that there exists numbers and such that .

Since , we know that either or . In the former case, we can let and . Then (and clearly ).

In the latter case, we can let and . Then . Again it is clear that .

In either case, we have shown that there exist and satisfying (1) and (2), as required.