IUM lectures on Numbers

2.12. Division, divisibility and primes

We can't do exact division in the natural numbers (1 and 2 are natural numbers, but 1/2 isn't). However we can do division with remainder.

Here's the idea we are about to formulate more rigorously: The remainder of a on division by b is what you get when you subtract b from a as many times as possible. The quotient of a on division by b is the maximum number of subtractions of b you can perform.

Definition 27

Let b\in\N with b nonzero. We define the quotient function q_b : \N \to \N as follows: for a natural number a,

  • if a\geq b: then there exists k such that a=b+k, and we set q_b(a) to be q_b(k)+1.

  • otherwise: we set q_b(a) to be 0.

Similarly we define the remainder function r_b : \N \to \N as follows: for a natural number a,

  • if a\geq b: then there exists k such that a=b+k, and we set r_b(a) to be r_b(k).

  • otherwise: we set r_b(a) to be a.

Example: q_3(7)=q_3(4)+1=q_3(1)+1+1=0+1+1=2, and r_3(7)=r_3(4)=r_3(1)=1. That is, when 7 is divided by 3, the quotient is 2 and the remainder is 1.

This is the first time we are using strong recursion (Definition 25): we define q_b(a) and r_b(a) in terms of prior, not necessarily immediately-prior, values of q_b and r_b.

Proposition 28 (Quotient-Remainder Theorem)

Let a, b\in\N with b nonzero. Letting q and r be respectively the quotient and remainder when a is divided by b, we have:

  • 0\leq r<b

  • a=bq+r.

Proof

Fix b and do strong induction on a.

Let a be a natural number and suppose that for all natural numbers t<a, 0\leq r_b(t)<b and t=bq_b(t)+r_b(t). There are now two cases to consider:

  • if a\geq b: then there exists k<a such that a=b+k. We can deduce the desired results from the inductive hypothesis applied to k: 0\leq r_b(k)<b and k=bq_b(k)+r_b(k).

  • otherwise: then r_b(a)=a, where 0\leq a<b by assumption, and q_b(a)=0, so a=b\times 0+a=bq_b(a)+r_b(a).

Even though we can't do exact division in naturals, we can at least record when it would work.

Definition 29

Let n,m\in\mathbb{N}. We say that m divides n if there exists a number k\in\mathbb{N}, such that n=m\times k. Notation: m\mid n. We also say that n is divisible by m.

Note that this is the analogue of the definition of \leq, with addition replaced by multiplication.

Lemma 30

Let a, k and d be natural numbers, and suppose that d divides both a and a+k. Then d divides k.

Proof

Since d is a factor of both a and a+k, and a+k\geq a, let us write a=da', a+k=db' for some natural numbers a' and b'. By the totality of the order a'\ge b' or a'\le b'.

If the former, by Theorem 23(2) a=da'\ge db'=a+k; by the antisymmetry of the order a=a+k, so by the cancellative principle of addition (Theorem 18), k=0, so d divides k.

If the latter, then there exists a natural number k' such that b'=a'+k'. We then have a+k=db'=d(a'+k')=a+dk'; by the cancellative principle of addition (Theorem 18), k=dk', so d is a factor of k.

Definition 31

A natural number n\geq 2 which is divisible only by 1 and itself is called a prime number. An integer greater than 1 which is not prime is called composite.

Note that 0 and 1 are neither prime nor composite; 0 is zero, and 1 is called a unit.

By "a finite product of prime numbers" below, we mean "a product of finitely many prime numbers", so for example 84=2^2\times 3\times 7.

Proposition 32 (Prime factorisation)

Every natural number greater than one can be factored as a finite product of prime numbers.

Proof

We prove this by strong induction. Let n be a natural number greater than one and suppose that all previous natural numbers greater than one can be factored as a finite product of prime numbers.

This number n is either prime or composite. If it's prime then it's the product of one prime number! And if it's composite then we can write n=ab with 1<a,b<n. By the inductive hypothesis, each of a and b can be factored as a finite product of prime numbers, so n=ab is also a product of finitely many primes.

If you think about it, 1 is also a product of prime numbers: it's the product of no prime numbers at all (for the same reason that 2^0=1).

Here is another consequence of these ideas.

Theorem 33

There are infinitely many primes.

Proof

We will prove this result by contradiction. Assume that there are only finitely many primes p_1,p_2,\dots,p_n, n\in\mathbb{N} and define X=p_1p_2\dots p_n+1. By the previous proposition, X must have a prime factor q. Then q\mid p_1p_2\dots p_n+1. But also q must be one of the p_i because those are all of the primes. Hence q\mid p_1p_2\dots p_n. Hence by Lemma 30 q divides 1, which is a contradiction. There are therefore infinitely many primes.