euclid-step-keeps-gcd

Sun Sep 13 2026

The Euclidean algorithm replaces the pair (a,b)(a, b) by (b,r)(b, r), where a=qb+ra = q b + r and 0≤r<b0 \le r < b, and repeats until the remainder is 0. It computes gcd⁡(a,b)\gcd(a, b) only if every step preserves it:

gcd⁡(a,b)=gcd⁡(b,r).\gcd(a, b) = \gcd(b, r).

Where I got stuck

Picture aa as a strip cut into qq segments of length bb and a leftover of length rr. Let d=gcd⁡(a,b)d = \gcd(a, b), the biggest block that tiles both aa and bb. The block dd tiles the whole strip and tiles each bb segment, so it tiles the leftover:

r=a−qb=(k1−qk2) d.r = a - q b = (k_1 - q k_2)\, d .

So dd divides both bb and rr. I read that as "dd is the gcd of (b,r)(b, r) as well", equality, done. When the write-up said this only proves gcd⁡(a,b)≤gcd⁡(b,r)\gcd(a, b) \le \gcd(b, r), I pushed back for three turns. I had started with dd being the gcd, not some factor, so where could an inequality come from?

What the argument actually used

One property of dd: it divides aa and bb. It never used that dd is the largest such number. So any block with that property survives the same argument, and the conclusion is only what is true of every such block: dd is a common divisor of (b,r)(b, r). Being the gcd of (a,b)(a, b) is a fact about the pair (a,b)(a, b). It says nothing about how the pair (b,r)(b, r) ranks its divisors.

The counterexample is to the inference, not to the number. Take a=24a = 24, b=18b = 18, so 24=1⋅18+624 = 1 \cdot 18 + 6. The block 3 tiles 24 and 18, so by the same argument it tiles r=6r = 6. All true, and gcd⁡(18,6)=6\gcd(18, 6) = 6, not 3. The argument's shape cannot tell 3 from 6, so it cannot conclude "greatest" for either.

euclid-step-divides-vs-greatest

What the strip argument proves, exactly: every common divisor of (a,b)(a, b) is a common divisor of (b,r)(b, r). Hence gcd⁡(a,b)≤gcd⁡(b,r)\gcd(a, b) \le \gcd(b, r), and nothing more.

The other direction

The way it closed: suppose (b,r)(b, r) had a common divisor ee bigger than dd. Then ee divides bb and rr, so it divides qb+r=aq b + r = a. That makes ee a common divisor of (a,b)(a, b) bigger than the greatest one, which is impossible. So no common divisor of (b,r)(b, r) exceeds dd, and with the first half that is equality.

Written out directly it is the same line. Take any ee dividing both bb and rr, say b=em1b = e m_1 and r=em2r = e m_2. Then

a=qb+r=e (qm1+m2),a = q b + r = e\,(q m_1 + m_2),

so ee divides aa too. Every common divisor of (b,r)(b, r) is a common divisor of (a,b)(a, b), which gives gcd⁡(b,r)≤gcd⁡(a,b)\gcd(b, r) \le \gcd(a, b).

The two directions use different halves of the same equation. The first subtracts, r=a−qbr = a - q b, and the second adds back, a=qb+ra = q b + r. Each is one line, and neither alone is the lemma. On the counterexample pair the chain runs (24,18)→(18,6)→(6,0)(24, 18) \to (18, 6) \to (6, 0) with gcd 6 at every stage. On a coprime pair, (12,5)→(5,2)→(2,1)→(1,0)(12, 5) \to (5, 2) \to (2, 1) \to (1, 0), the gcd is 1 throughout, which is what makes the back-substitution in units-mod-n-coprime-and-totient land on 1.

The general lesson: an argument that uses only a shared property cannot single out the extreme element. To prove "dd is the greatest" the word greatest has to enter somewhere, and here it enters only through the reverse direction. Same shape as one-to-one-proof-converse-trap: one direction proved, both directions claimed.

Mantra "Tiles both" makes it a factor. "Greatest" needs the other direction.