ARITHMETIC AND NUMBER THEORY
Euclid’s Lemma
A prime number has a decisive property: if it divides a product, it must divide at least one factor. Learn what the statement means, why it is true, and how it supports prime factorization and divisibility proofs.
THE THEOREM
A prime divisor cannot hide across multiplication
For a prime number p and integers a and b, if p divides ab, then p divides a or p divides b.
Here “or” includes both possibilities. The prime may divide only the first factor, only the second, or both. The important point is that it cannot divide the product while dividing neither factor.
What does “divides” mean?
The notation p | n means that n is an integer multiple of p. In symbols, p | n exactly when there is an integer k such that n = pk. For example, 7 | 84 because 84 = 7 × 12. But 7 ∤ 30 because no integer multiplied by 7 gives 30.
Euclid’s Lemma is specifically about a prime dividing a product. It does not say that every divisor of a product must divide one factor. For instance, 6 divides 2 × 3 = 6, but 6 divides neither 2 nor 3. This counterexample is why the word “prime” is essential.
Worked examples
Example 1: identify which factor contains the prime
Since 7 | 84 and 84 = 6 × 14, Euclid’s Lemma says that 7 divides 6 or 14. Check each factor: 6 = 7 × (6/7) is not an integer multiple of 7, while 14 = 7 × 2. Therefore 7 divides the second factor.
The theorem is a logical guarantee, not a shortcut that tells you which factor is divisible before checking. If the prime divides both factors, the conclusion is still true. For example, 5 | (10 × 15), and 5 divides 10 as well as 15.
Example 2: a product divisible by 5
Consider 12 × 35 = 420. Since 420 = 5 × 84, 5 divides the product. It does not divide 12, so the lemma forces 5 to divide 35. Indeed, 35 = 5 × 7. This reasoning can be used in reverse: if a product is known to have a prime factor and one factor is not divisible by that prime, the other factor must carry it.
Example 3: why a composite divisor breaks the rule
Take the composite number 6 and the product 2 × 3. We have 6 | 6, but 6 ∤ 2 and 6 ∤ 3. Thus the analogous statement with “composite 6” in place of “prime p” is false. A composite number can be assembled from pieces spread across different factors: one prime component can come from a and another from b.
This is a useful test whenever a theorem is misstated. The smallest counterexample often reveals which assumption matters. Here, primality prevents a divisor from splitting into separate nontrivial pieces.
Proof using Bézout’s identity
One concise proof uses Bézout’s identity: if two integers have greatest common divisor 1, some integer combination of them equals 1. Let p be prime and suppose p | ab. There are two cases.
p divides a
Then the conclusion already holds. No further argument is needed.
p does not divide a
Because p is prime, its only positive divisors are 1 and p. Since p does not divide a, the greatest common divisor of p and a is 1.
By Bézout’s identity, there exist integers u and v such that up + va = 1. Multiply this equation by b. Since p | ab by assumption, and p clearly divides upb, it divides their sum. But that sum is b, so p | b. In either case, p divides a or p divides b, proving the lemma.
Why the Bézout step is valid
From up + va = 1, multiplication by b gives upb + vab = b. The first term is divisible by p because it contains p as a factor. The second term is divisible by p because p | ab, and multiplying a multiple of p by v keeps it a multiple of p. A sum of two multiples of p is also a multiple of p. Therefore the right side, b, is divisible by p.
The proof depends on primality exactly when it changes p ∤ a into gcd(p,a) = 1. For a composite number d, it is possible that d does not divide a even though gcd(d,a) is greater than 1. Then Bézout’s identity does not give the needed equation, and the conclusion can fail.
Why Euclid’s Lemma matters
It proves uniqueness in prime factorization
Suppose a positive integer has two products of prime factors. Any prime in the first product divides the whole integer and therefore divides the product on the other side. Repeatedly applying Euclid’s Lemma shows that it must divide one of the primes on that side. A prime can divide another prime only when they are equal, so one matching prime factor can be cancelled. Repeating this argument matches every prime, including repeated copies. This is the core of the uniqueness part of the Fundamental Theorem of Arithmetic.
Without this lemma, showing that every integer can be factored into primes would prove only that a factorization exists. Euclid’s Lemma supplies the mechanism that prevents two genuinely different prime lists from representing the same number.
It extends to a product with many factors
If a prime divides a product of three or more integers, it divides at least one factor. Apply the two-factor lemma first to a grouped product, then apply it again to the remaining product.
For example, if 11 divides 4 × 7 × 22, the theorem guarantees that 11 divides 4, 7, or 22. It does not divide 4 or 7, so it must divide 22.
It gives a prime-power consequence
If a prime p divides a power aⁿ, then p divides a. This follows by applying the product version repeatedly. For example, if 3 | a⁴, then 3 must divide at least one of the four copies of a; every copy is the same number, so 3 | a. The converse is immediate: if p | a, then p also divides every positive power of a.
Connection with modular arithmetic
In modular arithmetic, p | n is equivalent to n being congruent to 0 modulo p. Euclid’s Lemma can therefore be phrased: if ab ≡ 0 (mod p) for prime p, then a ≡ 0 (mod p) or b ≡ 0 (mod p). In other words, a product is zero modulo a prime only when at least one factor is zero modulo that prime.
This property is one reason arithmetic modulo a prime behaves especially cleanly. Every nonzero residue has a multiplicative inverse. If a is not divisible by p, then gcd(a,p)=1, so Bézout’s identity gives an inverse of a modulo p. Consequently, from ab ≡ ac (mod p) and p ∤ a, we can cancel a and conclude b ≡ c (mod p). Cancellation is not automatically valid modulo a composite number: modulo 6, 2 × 1 and 2 × 4 are congruent, even though 1 and 4 are not congruent modulo 6.
This contrast is not merely a notation trick. It exposes a structural difference between prime and composite moduli and appears in elementary number theory, algebra, cryptography, and proofs about congruences.
Assumptions and limits
- p must be prime. The conclusion can fail for composite divisors, as 6 | (2 × 3) shows.
- a and b are integers. Divisibility is defined using integer multiples, so the statement is not about arbitrary real numbers.
- The conclusion is “at least one.” It may be one factor or both; the lemma does not claim exactly one.
- Zero causes no exception. Every nonzero integer divides 0 because 0 = p × 0. If a or b is zero, the implication remains valid.
- Negative factors are allowed. Divisibility is unchanged by sign: p | a if and only if p | −a.
For example, if p divides 0 × 8, then p divides the first factor 0, regardless of whether it divides 8. This satisfies the “or” conclusion. The theorem is often introduced with positive integers because that is the simplest setting for prime factorization, but its divisibility statement works for all integers when p is a positive prime.
Common mistakes to avoid
- Using a composite number as p. Test primality first; otherwise the implication is not guaranteed.
- Reversing the logic. If p divides a, then p divides ab is true, but knowing p | ab does not identify which factor it divides without checking.
- Reading “or” as “exactly one.” Both factors may be divisible by p. For example, 5 divides 10 × 15.
- Confusing a divisor of the product with a factor of the product. The theorem concerns divisibility, not whether p appears visibly as one of the written factors before simplification.
- Assuming the result holds for every divisor. The special guarantee belongs to primes. A composite divisor may be assembled from different factors of a and b.
Frequently asked questions
What is Euclid’s Lemma in simple words?
If a prime number divides a product, it must divide at least one of the numbers being multiplied.
Does the prime have to divide exactly one factor?
No. It must divide at least one factor, and it may divide both.
Why must the divisor be prime?
A composite number can be formed by combining prime factors from separate factors. For example, 6 divides 2 × 3 but divides neither 2 nor 3.
How is the lemma used in prime factorization?
It lets a proof match a prime in one factorization with an equal prime in another, establishing that prime factorizations are unique apart from order.
Who proved Euclid’s Lemma?
The result appears in Euclid’s Elements, Book VII, Proposition 30. The modern statement and proof are commonly presented using divisibility or Bézout’s identity.
For the classical source, see Euclid’s Elements, Book VII, Proposition 30.