Mathematics 4300 – Foundations of Algebra – Fall 1999

7. The Fundamental Theorem of Arithmetic. We use our new proof tools to prove some more sophisticated properties of the natural numbers, including unique factorization (the fundamental theorem of arithmetic). Proof of Division with Remainders: Recall the set-up. We are given natural numbers m and n with m ≤ n. We want to prove that:

n = mq + r for q a natural number and 0 ≤ r < m. Consider the sentence P (n):

“Given n, then n = mq + r as above for every m ≤ n”

Notice that by phrasing it this way, we do not have to assign m a particular value to make P (n) into a statement, even though both m and n appear in the sentence. Thus we are in a position to fashion a: Proof by Induction:

(a) P (1). If n = 1, then m = 1 also and 1 = 1 · 1 + 0. So q = 1 and r = 0.

(b) Assume P (n), so that n = mq + r for every m ≤ n.

Case 1. n = mq + r and r < m − 1. Then

n + 1 = m · q + (r + 1)

that is, we increase the remainder by 1.

Case 2. n = mq + r and r = m − 1. Then

n + 1 = m · q + m = m(q + 1) + 0

that is, we increase the quotient by 1 and set the remainder to 0. This leaves one extra case because we haven’t considered the possibility: Case 3. m = n + 1. Then n + 1 = (n + 1) · 1 + 0

Taken together, we have P (n + 1), completing the proof by induction. Next, I want to discuss:

Euclid’s Algorithm: Starting with m ≤ n, we repeatedly apply division with remainders in the following pattern:

n = mq_{1} + r_{1}
m = r_{1}q_{2} + r_{2}
r_{1} = r_{2}q_{3} + r_{3}
⋮
r_{i−2} = r_{i−1}q_{i} + r_{i}

stopping only when we get a zero remainder.

Claim: Euclid’s algorithm always stops.

Proof: Consider the set of nonzero remainders:

{r_{1}, r_{2}, r_{3}, ...}

Since we are using the r_{i−1} in place of m to construct r_{i} we know that r_{1} > r_{2} > r_{3} > .... In other words, this is a decreasing sequence. But by the smallest element axiom every set of natural numbers has a smallest element. We let r_{k} be the smallest. Then r_{k+1} cannot be a natural number, telling us that r_{k+1} = 0, and the algorithm stops there.

Example: n = 1175, m = 395.

1175 = 395 · 2 + 385
395 = 385 · 1 + 10
385 = 10 · 38 + 5
10 = 5 · 2 + 0

so the sequence of natural number remainders is {385, 10, 5}.

Definition: The greatest common divisor of m and n (written gcd(m, n)) is the largest natural number d with the property that:

d|m and d|n.

Proposition 1: The last nonzero remainder in Euclid’s algorithm is the greatest common divisor of m and n.

Proof: Let r_{k} be the last nonzero remainder in Euclid’s algorithm. Then the last line of Euclid’s algorithm gives:

r_{k−1} = r_{k}q_{k+1}

so that r_{k} divides r_{k−1}. The next-to-last line gives:

r_{k−2} = r_{k−1}q_{k} + r_{k}

so that since r_{k} divides both itself and r_{k−1}, it must also divide r_{k−2}. Proceed in this way up the sequence of divisions with remainders to conclude that r_{k} divides all the terms on the left side of the Euclidean algorithm, which incudes all the remainders, and finally m and n themselves.

But why is r_{k} the largest natural number to divide m and n?

To see this, we work back down the divisons with remainders. If d|m and d|n, then d|r_{1} because r_{1} = n−mq_{1}. Then d divides r_{2} because r_{2} = m−r_{1}q_{2}, and similarly d divides all the remainders down to r_{k}. But if d|r_{k}, then clearly d ≤ r_{k}, and so all divisors of both m and n are no bigger than r_{k}, thus r_{k} is the greatest common divisor.

Example: 5 = gcd(1175, 395)

(and this method is a good deal quicker than factoring the two numbers!)

Remark: We proved something even better than the proposition. Namely, looking at the last paragraph, we see that every common divisor of m and n actually divides the greatest common divisor.

Proposition 2: If d = gcd(m, n), then there are integers a and b so that:

d = am + bn

Proof: We prove the sentence below for all i by complete induction.

P (i): Every r_{i} in Euclid’s algorithm satisfies r_{i} = a_{i}m + b_{i}n.

(see the exercises in the previous section on complete induction)

(a) P (1) and P (2). Since n = mq_{1} + r_{1}, we get:

r_{1} = (−q_{1})m + n

Similarly, we get:

r_{2} = −q_{2}r_{1} + m = −q_{2}(−q_{1}m + n) + m = (q_{1}q_{2} + 1)m − q_{2}n

(b) Given P (1), ..., P (i) with i ≥ 2, then:

r_{i} = a_{i}m + b_{i}n and r_{i−1} = a_{i−1}m + b_{i−1}n

From Euclid’s algorithm, we also have:

r_{i−1} = r_{i}q_{i+1} + r_{i+1}

so substituting for r_{i} and r_{i−1} gives:

(a_{i−1}m + b_{i−1}n) = (a_{i}m + b_{i}n)q_{i+1} + r_{i+1}

and collecting the coefficients of m and n on one side gives:

r_{i+1} = (a_{i−1} − a_{i}q_{i+1})m + (b_{i−1} − b_{i}q_{i+1})n

which gives us P (i + 1) with a_{i+1} = a_{i−1} − a_{i}q_{i+1} and b_{i+1} = b_{i−1} − b_{i}q_{i+1}.

This proves P (i) by complete induction. If we apply it to the last natural number remainder r_{k}, then it gives the result we want since r_{k} is the gcd.

Recall that p is a prime number if 1 and p are the only natural numbers that divide p. This tells us in particular that if m < p, then gcd(m, p) = 1. Similarly, if p < m and p does not divide m, then gcd(p, m) = gcd(m, p) = 1 (because the gcd must divide p and cannot be equal to p). The Proposition we have just proved therefore tells us:

1 = am + bp

for some integers a and b whenever p does not divide m.

Proposition 3: Suppose p is a prime and p|mn. Then p|m or p|n (or both).

Proof: Let’s suppose p does not divide m. Then by the discussion above:

1 = am + bp.

Multiplying through by n gives:

n = a(mn) + bpn

but since p divides mn, this equation tells us that it must also divide n. Thus if p doesn’t divide m, then it must divide n. This proves the proposition!

Now for the fundamental theorem of arithmetic.

Unique Factorization: Every n > 1 is a product of finitely many prime numbers, and there is only one way to factor n as a product of primes.

Proof: We use the smallest element axiom. Let S be the set of natural numbers which are bigger than 1 and not a product of finitely many primes, and suppose s is the smallest element of S. Then either:

(i) s is a prime, or else

(ii) s = mn for some m, n such that 1 < m < s and 1 < n < s.

But (i) is not allowed since then s would be a product of one prime, so not an element of S. And since s is smallest, we see that if (ii) occurs, then m and n are not in S, so they must be products of finitely many primes, say m = p_{1}....p_{i} and n = q_{1}...q_{j}, so that s = p_{1}....p_{i}q_{1}....q_{j} would also be a product of finitely many primes. That is, s ∉ S. Thus we’ve discovered that there cannot be a smallest element of S, so we must have S = ∅, proving that every n > 1 is a product of finitely many primes.

Now to show that there is only one factorization. Suppose

n = p_{1}...p_{i} and n = q_{1}...q_{j}.

Then p_{1}|q_{1}....q_{j}, so by the Proposition above, either p_{1} divides q_{1} or else it divides q_{2}....q_{j}. Similarly, either p_{1} divides q_{2} or it divides q_{3}....q_{j}. Eventually, we find that p_{1} must divide one of q_{1}, ...., q_{j}, implying that p_{1} must be equal to one of the q_{1}, ..., q_{j} since each p and q is a prime. Similarly, p_{2} must be equal to one of the other q’s, etc. and it follows that the p’s and q’s are the same primes(!) Thus there is only one way to factor n.

Euclid’s proof that there are infinitely many primes: Suppose there were only finitely many primes. Then we could list them:

p_{1}, p_{2}, ..., p_{m}

so that the list stops at p_{m}. We would then have the peculiar number:

n = p_{1}p_{2}...p_{m} + 1

which cannot be a prime (because it is bigger than all the primes) and cannot have any prime factors, because none of the list p_{1}, ..., p_{m} of primes divides it (they all divide n−1, so they can’t divide n). But then n would not factor as a product of primes, and we’ve just shown that every natural number factors as a product of primes. So this peculiar n does not exist, and therefore there must be infinitely many primes!

Finding gcd’s by factoring: Suppose we are given m and n, together with their factorizations into primes:

m = p_{1}^{n_{1}}p_{2}^{n_{2}}...p_{i}^{n_{i}} and n = q_{1}^{m_{1}}q_{2}^{m_{2}}...q_{j}^{m_{j}}

(the same primes are collected together, so that p_{1} ≠ p_{2} ≠ ... ≠ p_{i} and similarly for the q’s). Then we get a factorization of the gcd(m, n) by the following procedure. We try to locate each p as a q. If it is not a q, it doesn’t factor the gcd. If it is a q, then it does factor, and the smaller of the two exponents is the exponent which occurs in the factorization of the gcd.

Example: 720 = 2^{4} · 3 · 5 and 200 = 2^{3} · 5^{2} so

gcd(720, 200) = 2^{3} · 5 = 40

(Why does this procedure work?)

Exercises:

1. Prove by induction that:

(a) r^{m}r^{n} = r^{m+n} and

(b) (r^{m})^{n} = r^{mn} (Hint: Think about the proof of division with remainders.)

2. For each of the following pairs of numbers m and n, first find their gcd (call it d), and second, find integers a and b so that d = am + bn. Example: m = 395, n = 1175. Going up Euclid’s algorithm we get:

5 = (−38)10 + 385 = (−38)(395 − 385) + 385 = (−38)395 + (39)385 = (−38)395 + (39)(1175 − 2 · 395) = (−38 − 2 · 39)395 + (39)1175

= (−116)395 + (39)1175

(a) m = 24 and n = 61

(b) m = 24 and n = 62

(c) m = 24 and n = 63

(d) m = 232617 and n = 533127

3. The least common multiple of m and n, written lcm(m, n), is the smallest natural number e such that both:

m|e and n|e

(a) Let d = gcd(m, n). Prove that lcm(m, n) ≤ \frac{mn}{d}.

(b) Prove that lcm(m, n) divides mn. (Hint: If lcm(m, n) = ma and lcm(m, n) = nb, then gcd(a, b) = 1.)

(c) Prove that d ≥ \frac{mn}{lcm(m,n)}.

(d) Conclude that: lcm(m, n) · gcd(m, n) = m · n.

(e) If we are given the prime factorizations of m and n then what is the prime factorization of the lcm(m, n)? (Model your answer on the procedure for finding the prime factorization of the gcd.)

4. If p is a prime and m < p, prove that p divides \binom{p}{m}. (Hint: p divides p! = \binom{p}{m} · m! · (p − m)!)