Euclid's Lemma: Statement, Proof and Examples
EuclidCurve Smart Team · 2026-11-12 · 6 min read
For young mathematicians in the UK, USA, UAE, Singapore and Hong Kong
Euclid's lemma is one of the oldest results in mathematics, from Book VII of Euclid's Elements, written around 300 BC. It is short, it is powerful, and it quietly holds up the whole idea that every number has one prime factorisation.
Euclid's lemma: if a prime p divides a product ab, then p divides a or p divides b.
Guess first: 6 divides 4 × 9 = 36. Does 6 divide 4 or 9?
- Yes, it divides 4
- Yes, it divides 9
- No, it divides neither
Neither! 6 = 2 × 3 splits its factors between 4 and 9. That is exactly why Euclid's lemma needs a prime: a prime cannot be split.
What it says, with examples
If a prime divides the product of two whole numbers, it must divide at least one of them. For example, 7 \mid 42 = 6 × 7, and indeed 7 \mid 7. And 13 \mid 26 × 15 = 390, so 13 must divide 26 or 15: it divides 26.
Why the number must be prime
As the guess above showed, 6 \mid 4 × 9, yet 6 divides neither 4 nor 9. A composite number can share its factors out between a and b. A prime has no smaller factors to share, so it has nowhere to hide.
The proof in four lines
Suppose p is prime, p \mid ab, and p does not divide a. Because p is prime, its only divisors are 1 and p, so \gcd(p, a) = 1.
By Bézout's identity there are integers x and y with px + ay = 1. Multiply both sides by b: pbx + aby = b.
Now p divides pbx, and p divides aby because p \mid ab. So p divides their sum, which is b. That proves the lemma.
The numbers x and y come from running Euclid's algorithm backwards, which our post on Euclid's algorithm shows step by step.
Your turn
The prime 17 divides 24n. What is the smallest positive integer n?
Solution: 17 is prime and does not divide 24, so by Euclid's lemma it must divide n. The smallest positive such n is 17.
Going further
The lemma extends to longer products: if a prime p divides a_1 a_2 \cdots a_n, then p divides at least one of the a_i. And the same proof gives a stronger version: if n \mid ab and \gcd(n, a) = 1, then n \mid b, even when n is not prime.
Most importantly, the lemma is the key step in the Fundamental Theorem of Arithmetic: every whole number greater than 1 can be written as a product of primes in exactly one way, apart from the order. Without it, a number could have two different prime factorisations.
Your turn
A prime p greater than 7 divides 35 × 66. What is p?
Solution: 35 = 5 × 7 and 66 = 2 × 3 × 11. By Euclid's lemma p must divide 35 or 66, so it is one of 2, 3, 5, 7 or 11. The only one greater than 7 is 11.
Practice: master Euclid's lemma
Guess first: Practice 1: Which statement is Euclid's lemma?
- If a prime p divides ab, then p divides a or p divides b
- If any number n divides ab, then n divides a or n divides b
- If a prime p divides a + b, then p divides a or p divides b
Only the first is true. The second fails for n = 6: 6 \mid 4 × 9 but not 4 or 9. The third fails too: 2 \mid 1 + 3, yet 2 divides neither 1 nor 3.
Guess first: Practice 2: 15 divides 6 × 10 = 60. Does Euclid's lemma tell us that 15 divides 6 or 10?
- Yes
- No, because 15 is not prime
15 is not prime, so the lemma says nothing, and indeed 15 divides neither 6 nor 10: its factors 3 and 5 are split between them.
Your turn
Practice 3: The prime 11 divides 7n, and n is between 50 and 60. What is n?
Solution: 11 is prime and does not divide 7, so by Euclid's lemma 11 \mid n. The only multiple of 11 between 50 and 60 is 55.
Your turn
Practice 4: A prime p divides 91². Enter the largest value p can take.
Solution: p \mid 91 × 91, so by Euclid's lemma p \mid 91 = 7 × 13. So p is 7 or 13, and the largest is 13.
Your turn
Practice 5: A prime p divides a³, where a = 60. How many different values can p take?
Solution: p \mid a × a × a, so by the lemma p \mid a = 60 = 2² × 3 × 5. So p is 2, 3 or 5: three values.
Where this shows up in exams: AMC 10 / 12
Number theory (divisibility, primes and remainders) is a regular part of AMC 10 and AMC 12 papers, and Euclid's lemma is often the quickest route through those questions.
Quick questions
What is Euclid's lemma?
If a prime number p divides a product ab, then p divides a or p divides b. For example, 7 divides 6 × 7 = 42, and 7 divides 7.
Why must p be prime in Euclid's lemma?
Because a composite number can split its factors between a and b: 6 divides 4 × 9 = 36 but divides neither 4 nor 9.
How is Euclid's lemma proved?
If p does not divide a, then gcd(p, a) = 1, so by Bézout's identity px + ay = 1 for some integers x and y. Multiplying by b gives pbx + aby = b, and p divides both terms on the left, so p divides b.
Written by the EuclidCurve Smart Team. We are the maths and physics tutors behind EuclidCurve. We teach IB, AMC, ESAT and TMUA students in the UK, USA, UAE, Singapore and Hong Kong, and we write about the maths hiding in everyday life.