User:Virginia-American/Sandbox/Euclid's lemma

In number theory, Euclid's lemma (also called Euclid's first theorem) is a lemma that captures one of the fundamental properties of prime numbers. It states that if a prime divides the product of two numbers, it must divide one of the factors. For example since 133 × 143 = 19019 is divisible by 19, one or both of 133 or 143 must be as well (In fact, 19 × 7 = 133.) It used in the proof of the fundamental theorem of arithmetic.

The lemma is not true for composite numbers. For example, 8 does not divide 4 and 8 does not divide 6, yet 8 does divide their product 24.

Formulations
Let p be a prime number, and assume p divides the product of two integers a and b. (In symbols this is written p|ab.) Then p divides a or p divides b (or perhaps both).

Equivalent statements are

If p does not divide a and p does not divide b, then p does not divide ab. If p does not divide a and p divides ab, then p divides b.

A generalization is also called Euclid's lemma:

If n|ab, and n is relatively prime to a, then n|b. (This is a generalization because if n is prime, either n|a or n is relatively prime to a.)

History
The lemma first appears as proposition 30 in Book VII of Euclid's Elements. It is included in practically every book that covers elementary number theory.

Via Bézout's identity
The easiest proof of Euclid's lemma uses another lemma called Bézout's identity. This states that if x and y are relatively prime integers there exist integers r and s such that

rx+sy = 1. $$ Let a and n be relatively prime, and assume that n|ab. By Bézout, there are r and s making

rn+sa = 1. $$ Multiply both sides by b:

rnb+sab = b. $$ The first term on the left is divisible by n, and the second term is divisible by ab which by hypotheses is divisible by n. Therefore their sum, b, is also divisible by n. This is the generalization of Euclid's lemma mentioned above.

Euclidean proof
The logic of this proof is basically Euclid's, but the notation and some of the concepts (zero, negative) would be foreign to him. It relies on the fact that a set of non-negative integers has a smallest member.

Divisibility
Definition. Assume a ≠ 0 and let b be any integer. If there is an integer q such that b = aq, a is said to divide b; a is a divisor of b and b is a multiple of a.

Notation. a divides b is writtten a|b.

Lemma. If a ≠ 0 then a|0, a|a and a|−a. Lemma. 1|a and −1|a. Lemma. If a|b then −a|b, a|−b, −a|−b, and |a|||b|. Lemma. If ac|bc then a|b. Lemma. If a|b and c ≠ 0 then ac|bc. Lemma. If a|b and b|c then a|c. Lemma. If a|b and x is an integer then a|bx. Lemma. If a|b and a|c then a|b ± c. Lemma. If a|b and a|c and x and y are integers then a|bx ± cy. Lemma. If b ≠ 0 and a|b then |a| ≤ |b|. This implies that b only has a finite number of divisors.

Division with a remainder
Theorem. If a > 0 and b is an integer then there is a unique pair of integers q and r such that b = qa + r and 0 ≤ r < a.

Definition. q is the quotient and r is the remainder.

Proof. (existence) The set of numbers {b − ua: u an integer} contains both positive and negative numbers. Let r = b − qa be the smallest non-negative number in the set. Then r ≥ 0, and r − a = b − (q + 1)a < 0. (uniqueness) If q were replaced by a smaller value, u < q, u ≤ q − 1 the corresponding remainder would be greater than or equal to a: b − ua ≥ b − (q − 1)a = r + a ≥ a''. Similarly, if u > q the remainder would be negative: u ≥ q + 1, b − ua ≤ b − (q + 1)a = r − a < 0.

Least common multiple
Definition. If a ≠ 0 and b ≠ 0 a common multiple of a and b is any integer k such that a|k and b|k.

Lemma. If a ≠ 0 and b ≠ 0 they have a least positive common multiple. Proof. The set of positive common multiples contains |ab| so it is not empty and therefore has a smallest member.

Notation. If a ≠ 0 and b ≠ 0 their least positive common multiple is written lcm(a, b).

Theorem. Assume a ≠ 0 and b ≠ 0. Let m = lcm(a, b) and let n be any common multiple of a and b. Then m|n.

Proof. There are numbers q and r such that n = qm + r,  0 ≤ r < m. It follows from r = n − qm, a|m and a|n that a|r. Similarly b|m and b|n imply that b|r. That is, r is a commmon multiple of a and b. r is non-negative and is less than the least positive common multiple m. Therefore r = 0. But then n = qm, i.e. m|n.

Greatest common divisor
Definition. If a ≠ 0 or b ≠ 0 a common divisor of a and b is any integer k such that k|a and k|b.

Lemma. If a ≠ 0 or b ≠ 0 they have a greatest common divisor. It is positive. Proof. Every integer divides 0. If a = 0 then b ≠ 0, and their common divisors are simply the divisors of b. The largest of these is |b|. Now assume that both a ≠ 0 and b ≠ 0. The set of divisors of a is finite, the set of divisors of b is finite, therefore their intersection is finite and has a largest member. It must be positive because 1 is a positive common divisor of a and b.

Notation. If a ≠ 0 or b ≠ 0 their greatest common divisor is written gcd(a, b).

Theorem. Assume a ≠ 0 or b ≠ 0. Let d = gcd(a, b) and let e be any common divisor of a and b. Then e|d.

Proof. If a = 0 then b ≠ 0. In this case d = gcd(0, b) = |b|, so k|a and k|b trivially imply that k|d. Now assume that both a ≠ 0 and b ≠ 0, and let m = lcd(a, b). Since ab is a common multiple of a and b, m|ab, i.e. there is an integer g such that ab = gm. The proof has two steps i) if e is common divisor of a and b then e|g; ii) d = |g|. i) Let e be a common divisor of a and b. There are integers r and s such that a = er, b = es. Consider the number ers = as = br. It is a common multiple of a and b, so there is a t such that ers = mt. Multiplying by e gives eres = ab = mte. Multiplying by g gives abg = gmte = abte, and dividing by ab gives g = te, i.e. e|g. ii) Since any common divisor e of a and b divides g, e ≤ |g|. In particular, d = gcd(a, b) ≤ |g|. Dividing ab = gm by b gives a = g(m/b), and m/b is an integer. Similarly, b = g(m/a), so g is a common divisor of a and b. But d is defined to be the greatest common divisor, so d ≥ |g|. Therefore, d = |g|.

Relation between gcd and lcm
Corollary. If a ≠ 0 and b ≠ 0 then lcm(a, b)gcd(a,b) = |ab|. Corollary. If a ≠ 0 and b ≠ 0 and gcd(a, b) = 1 then lcm(a, b) = |ab|.

Euclid's lemma
Theorem. If a|bc and gcd(a, b) = 1 then a|c.

Proof. Since a|bc, a ≠ 0. If b = 0, gcd(a, 0) = 1 implies that a = ±1. But then a|c. If b ≠ 0, let m = lcm(a, b). Since gcd(a, b) = 1, m = |ab|. Since bc is a common multiple of a and b, it is a multiple of m = |ab|. That is ab|bc so a|c.