In algebra and number theory, Euclid's lemma is a lemma that captures a fundamental property of prime numbers: [note 1]
Euclid's lemma — If a prime p divides the product ab of two integers a and b, then p must divide at least one of those integers a or b.
For example, if p = 19, a = 133, b = 143, then ab = 133 × 143 = 19019, and since this is divisible by 19, the lemma implies that one or both of 133 or 143 must be as well. In fact, 133 = 19 × 7.
The lemma first appeared in Euclid's Elements , and is a fundamental result in elementary number theory.
If the premise of the lemma does not hold, that is, if p is a composite number, its consequent may be either true or false. For example, in the case of p = 10, a = 4, b = 15, composite number 10 divides ab = 4 × 15 = 60, but 10 divides neither 4 nor 15.
This property is the key in the proof of the fundamental theorem of arithmetic. [note 2] It is used to define prime elements, a generalization of prime numbers to arbitrary commutative rings. Euclid's lemma shows that in the integers irreducible elements are also prime elements. The proof uses induction so it does not apply to all integral domains.
Euclid's lemma is commonly used in the following equivalent form:
Theorem — If is a prime number that divides the product and does not divide then it divides
Euclid's lemma can be generalized as follows from prime numbers to any integers.
Theorem — If an integer n divides the product ab of two integers, and is coprime with a, then n divides b.
This is a generalization because a prime number p is coprime with an integer a if and only if p does not divide a.
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. [4] [5] [6] [7] [8]
The generalization of the lemma to integers appeared in Jean Prestet's textbook Nouveaux Elémens de Mathématiques in 1681. [9]
In Carl Friedrich Gauss's treatise Disquisitiones Arithmeticae , the statement of the lemma is Euclid's Proposition 14 (Section 2), which he uses to prove the uniqueness of the decomposition product of prime factors of an integer (Theorem 16), admitting the existence as "obvious". From this existence and uniqueness he then deduces the generalization of prime numbers to integers. [10] For this reason, the generalization of Euclid's lemma is sometimes referred to as Gauss's lemma, but some believe this usage is incorrect [11] due to confusion with Gauss's lemma on quadratic residues.
The two first subsections, are proofs of the generalized version of Euclid's lemma, namely that: if n divides ab and is coprime with a then it divides b.
The original Euclid's lemma follows immediately, since, if n is prime then it divides a or does not divide a in which case it is coprime with a so per the generalized version it divides b.
In modern mathematics, a common proof involves Bézout's identity, which was unknown at Euclid's time. [12] Bézout's identity states that if x and y are coprime integers (i.e. they share no common divisors other than 1 and −1) there exist integers r and s such that
Let a and n be coprime, and assume that n|ab [note 3] . By Bézout's identity, there are r and s such that
Multiply both sides by b:
The first term on the left is divisible by n, and the second term is divisible by ab, which by hypothesis is divisible by n. Therefore their sum, b, is also divisible by n.
The following proof is inspired by Euclid's version of Euclidean algorithm, which proceeds by using only subtractions.
Suppose that and that n and a are coprime (that is, their greatest common divisor is 1). One has to prove that n divides b. Since there exists an integer q such that
Without loss of generality, one can suppose that n, q, a, and b are positive, since the divisibility relation is independent of the signs of the involved integers.
To prove the theorem by strong induction, we suppose that it has been proved for all smaller values of ab. There are three cases:
Euclid's lemma is proved at the Proposition 30 in Book VII of Euclid's Elements. The original proof is difficult to understand as is, so we quote the commentary from Euclid (1956 , pp. 319–332).