number-theory

Created 27 Jul 2023

Proving Euclid's Lemma

tl;dr: A journey from the ground up in which we use axioms to build a proof that every positive integer can be uniquely prime factored.

This is part 4, where we use what we have so far to finally prove Euclid's Lemma (technically, the generalized version). In general, the level of rigor will decrease as the parts go on, so that the reader doesn't get bored to death. But it should be obvious how to fill out everything with complete rigor. Here is a glossary of math symbols.

What? It's... argh!

Ask anyone to prove this:

If 2x2x is divisible by 33, then so is xx.

I bet that almost everyone would attempt to use prime factorization: "in the prime factorization of 2x2x, there must be a 3. But 2 is a prime, thus the 3 must occur in the prime factorization of xx."

Ok... but we're trying to prove prime factorization, so we can't use it!

Actually, we can do something smart in this case: if 32x3 \mid 2x, then 3(3xx)3 \mid (3x - x). But 33x3 \mid 3x, therefore 3x3 \mid x, by Lemma 4 in part 1 (i.e. that if ab,aca \mid b, a \mid c then aa divides any linear combination of bb and cc). In other words, if 2x2x is divisible by 3 then so is 2x-2x, therefore so is 2x+3x-2x + 3x.

Now ask them to prove the generalized version:

If abca \mid bc and gcd(a,b)=1gcd(a,b) = 1, then aca \mid c.

Here's where most people would really like to appeal to prime factorization: "the set of prime factors of b must be completely different to the set of prime factors of a, else they would share a common factor. So in the prime factorization of bc, removing the factorization of b will not affect any primes that divide a. So a divides c."

So, how do we prove this using only the things we've built out of axioms?

We can actually generalize the trick from before!

In the "if 32x3 \mid 2x then 3x3 \mid x" case, the trick was to write 1 (the desired coefficient of xx) as a linear combination of 2 and 3:

x=(32)x=3x2xx = (3-2)x = 3x-2x

And this let us deduce that if 32x3 \mid 2x, then 33x2x3 \mid 3x - 2x because both 3x3x and 2x2x are divisible by 3.

Let's try with a different pair of numbers.

If 5128x51 \mid 28x, does 51x51 \mid x ?

TRICK: Try to write 1 as a linear combination of 51 and 28. But we know we can do this, by Bezout's Lemma, which we proved in the last part! To find a concrete solution, use the magic box (see the last part if you are unfamiliar):

114112
01129112051
1011561128

So, 11512028=111 \cdot 51 - 20 \cdot 28 = 1. Now to use the trick:x=(11512028)xx = (11 \cdot 51 - 20 \cdot 28)x=51(11x)+28x(20) = 51 \cdot (11x) + 28x \cdot (-20)

Hence, if 5128x51 \mid 28x, then 51x51 \mid x, because we wrote xx as a linear combination of things that were divisible by 51.

I think we're ready to generalize now.

Proposition.

If abca \mid bc and gcd(a,b)=1gcd(a,b)=1, then aca \mid c. True in Z\mathbb{Z}.

Proof.

Suppose abca \mid bc and gcd(a,b)=1gcd(a,b) = 1.

Then by Bezout's Lemma, there exist integers x,yx,y such that ax+by=1ax + by = 1.

Hence, c=(ax+by)c=a(cx)+y(bc)c = (ax+by)c = a(cx) + y(bc).

Since abca \mid bc and aa(cx)a \mid a(cx), we have that aa(cx)+y(bc)a \mid a(cx) + y(bc), so aca \mid c, as required.

Nice - surprisingly simple proof, right?

The actual Euclid's Lemma

Actually, Euclid's Lemma states that if pp is a prime and pabp \mid ab (where a,ba,b are two integers), then pap \mid a or pbp \mid b. But what we've already proved is pretty much a generalized version of this: the only extra thing we need to prove is that if pp doesn't divide aa, then gcd(p,a)=1gcd(p, a) = 1. But this is true by definition of prime - if gcd(p,a)>1gcd(p,a) > 1 then pp has a factor that isn't 11 or pp (namely, this factor is gcd(p,a)gcd(p,a)); contradiction.