2.5.9Number Theory (Intermediate)

Bézout's identity

2,463 words11 min readdifficulty · medium1 backlinks

What Is Bézout's Identity?

Why does this matter?

  • It proves the GCD is expressible as an integer linear combination
  • It's the foundation for the Extended Euclidean Algorithm
  • It's used to solve linear Diophantine equations
  • It shows why the GCD is the "smallest positive" linear combination

Derivation From First Principles

Let's prove Bézout's Identity from scratch.

Step 1: Define the set of all linear combinations

Let S={ax+by:x,yZ,ax+by>0}S = \{ax + by : x, y \in \mathbb{Z}, \, ax + by > 0\}

This is the set of all positive integers we can make by combining aa and bb.

Why this set? We want to find the smallest positive number expressible as ax+byax + by. We'll show this smallest number IS the GCD.

Step 2: Show SS is non-empty

Since aa and bb are not both zero, we can pick combinations that are positive:

  • If a>0a > 0: choose x=1,y=0x = 1, y = 0 giving aSa \in S
  • If a<0a < 0: choose x=1,y=0x = -1, y = 0 giving a=aS-a = |a| \in S

So SS contains at least a|a| or b|b|. ✓

Step 3: Let dd be the smallest element of SS

By the Well-Ordering Principle, SS has a smallest element. Call it dd.

Since dSd \in S, we can write: d=ax0+by0d = ax_0 + by_0 for some integers x0,y0x_0, y_0.

Step 4: Prove dd divides both aa and bb

Claim: dad \mid a

Proof by contradiction: Apply the Division Algorithm to aa and dd: a=qd+rwhere 0r<da = qd + r \quad \text{where } 0 \le r < d

Substitute d=ax0+by0d = ax_0 + by_0: a=q(ax0+by0)+ra = q(ax_0 + by_0) + r r=aq(ax0+by0)=a(1qx0)+b(qy0)r = a - q(ax_0 + by_0) = a(1 - qx_0) + b(-qy_0)

Why this step? We've expressed rr as a linear combination of aa and bb.

If r>0r > 0, then rSr \in S (it's a positive linear combination). But r<dr < d, contradicting the fact that dd is the smallest element of SS.

Therefore r=0r = 0, so dad \mid a. ✓

By identical reasoning, dbd \mid b. ✓

Step 5: Prove dd is the GCD

We've shown dd is a common divisor of aa and bb.

Now let cc be any common divisor of aa and bb. Then:

  • ca    a=cmc \mid a \implies a = cm for some integer mm
  • cb    b=cnc \mid b \implies b = cn for some integer nn

Therefore: d=ax0+by0=cmx0+cny0=c(mx0+ny0)d = ax_0 + by_0 = cmx_0 + cny_0 = c(mx_0 + ny_0)

So cdc \mid d.

Why this matters: Any common divisor divides dd, so dd is the greatest common divisor.

Thus d=gcd(a,b)d = \gcd(a, b) and we have: gcd(a,b)=ax0+by0\gcd(a, b) = ax_0 + by_0

This completes the proof. □

Finding Bézout Coefficients: Extended Euclidean Algorithm

The Back-Substitution Method

Non-Uniqueness of Bézout Coefficients

Why? Let d=gcd(a,b)d = \gcd(a,b). Starting from ax0+by0=dax_0 + by_0 = d:

a(x0+kbd)+b(y0kad)=ax0+by0+akbdbkad=d+0=da\left(x_0 + k \cdot \frac{b}{d}\right) + b\left(y_0 - k \cdot \frac{a}{d}\right) = ax_0 + by_0 + ak\frac{b}{d} - bk\frac{a}{d} = d +0 = d

The extra terms cancel! This generates infinitely many coefficient pairs.

Common Mistakes

Applications

1. Solving Linear Diophantine Equations

The equation ax+by=cax + by = c has integer solutions if and only if gcd(a,b)c\gcd(a,b) \mid c.

If ax0+by0=gcd(a,b)ax_0 + by_0 = \gcd(a,b), then multiply by cgcd(a,b)\frac{c}{\gcd(a,b)} to get a solution.

2. Modular Inverses

If gcd(a,m)=1\gcd(a, m) = 1, then ax+my=1ax + my = 1 has solutions. This means ax1(modm)ax \equiv 1 \pmod{m}, so xx is the multiplicative inverse of aa modulo mm.

3. Coprimality Proof

Bézout's Identity provides an alternative characterization of coprimality: gcd(a,b)=1    x,yZ:ax+by=1\gcd(a,b) = 1 \iff \exists x, y \in \mathbb{Z} : ax + by = 1

Active Recall Flashcards

#flashcards/maths

What does Bézout's Identity state? :: For any integers aa and bb (not both zero), there exist integers xx and yy such that ax+by=gcd(a,b)ax + by = \gcd(a,b).

What are Bézout coefficients?
The integers xx and yy in the equation ax+by=gcd(a,b)ax + by = \gcd(a,b) are called Bézout coefficients.
How do you find Bézout coefficients?
Use the Extended Euclidean Algorithm: run the Euclidean algorithm, then back-substitute the remainders to express the GCD as a linear combination.
If (x0,y0)(x_0, y_0) is a solution to ax+by=dax + by = d, what is the general solution?
x=x0+k(b/d)x = x_0 + k(b/d) and y=y0k(a/d)y = y_0 - k(a/d) for any integer kk, where d=gcd(a,b)d = \gcd(a,b).
True or false: Bézout's Identity only applies when gcd(a,b)=1\gcd(a,b) = 1.
False. It applies to any integers a,ba, b not both zero, regardless of their GCD.

What is the key insight in proving Bézout's Identity? :: Consider the set SS of all positive linear combinations ax+byax + by. The smallest element of SS is the GCD, by the Well-Ordering Principle and divisibility arguments.

When does ax+by=cax + by = c have integer solutions?
If and only if gcd(a,b)\gcd(a,b) divides cc.
How is Bézout's Identity used to find modular inverses?
If gcd(a,m)=1\gcd(a,m) = 1, solving ax+my=1ax + my = 1 gives xx such that ax1(modm)ax \equiv 1 \pmod{m}, so xx is the modular inverse of aa.
Recall Explain to a 12-year-old

Imagine you have two types of coins: one worth35 cents and one worth 15 cents. Can you make exactly 5 cents using these coins? You might need to "give back" some coins (negative coefficients).

Bézout's Identity says: if you have two numbers aa and bb, you can always make their GCD by adding/subtracting the right multiples of them. It's like a magic recipe: "Take xx of the first number, yy of the second (some might be negative, meaning you subtract), and you'll get exactly their GCD."

Why is this cool? Because it means the GCD isn't just some abstract "biggest common divisor"—it's something you can build from the original numbers. And the Extended Euclidean Algorithm is the step-by-step recipe for finding exactly how many of each number you need.

Connections

Concept Map

form set

Well-Ordering

written as

Division Algorithm

contradiction forces r=0

common divisor

greatest

yields

coefficients called

foundation for

computes

used to solve

Integers a and b

Set S positive combos ax+by

Smallest element d

d = ax0 + by0

Remainder r < d

d divides a and b

Any divisor c divides d

d = gcd of a and b

Bezout Identity ax+by=gcd

Bezout coefficients x and y

Extended Euclidean Algorithm

Linear Diophantine equations

Hinglish (regional understanding)

Intuition Hinglish mein samjho

Bézout's Identity ek fundamental theorem hai jo kahta hai ki agar tumhare pas do integers hain aa aur bb, tohum unka GCD (greatest common divisor) actually bana sakte ho using integer coefficients. Matlabagar gcd(a,b)=d\gcd(a,b) = d hai, toh kuch integers xx aur yy exist karte hain jahan ax+by=dax + by = d. Yeh bahut powerful hai kyunki yeh prove karta hai ki GCD sirf ek abstract concept nahi hai—tum actually use construct kar sakte ho original numbers se.

Isko prove karne ke liye, hum set SS define karte hain jismein sare positive linear combinations ax+byax + by hain. Well-Ordering Principle se, is set mein ek smallest element hoga, use dd bulate hain. Phir hum Division Algorithm use karke prove karte hain ki yeh dd actually aa aur bb dono ko divide karta hai.Agar koi aur common divisor cc hai, toh woh bhi dd ko divide karega, matlab dd hi greatest common divisor hai. Yeh proof bahut elegant hai aur first principles se derive hota hai.

Extended Euclidean Algorithm woh method hai jisse tum practically Bézout coefficients find kar sakte ho. Normal Euclidean Algorithm run karo remainders find karne ke liye, phir back-substitute karo second-to-last equation se. Har step mein tum remainder ko express karte ho as combination of previous terms, jab tak tum GCD ko original aa aur bb ke terms mein nahi likh lete. Bahut sare solutions possible hain, kyunki agar (x0,y0)(x_0, y_0) ek solution hai toh tum k(b/d)k(b/d) add karke xx mein aur k(a/d)k(a/d) subtract karke yy se infinite solutions bana sakte ho.

Yeh concept linear Diophantine equations solve karne mein, modular inverses compute karne mein, aur number theory ke kai profs mein use hota hai. Samajhna important hai ki coefficients negative bhi ho sakte hain—"linear combination" ka matlab sirf addition nahi, subtraction bhi include karta hai. Yeh theorem GCD ko ek constructive perspective deta hai, jo pure mathematics aur applied cryptography dono mein kafi useful hai.

Go deeper — visual, from zero

Test yourself — Number Theory (Intermediate)

Connections