Bezout's Identity
Take two integers, say and . Can you always find whole numbers and , possibly negative? These numbers should satisfy equals their greatest common divisor. This question looks innocent. But it sits at the foundation of nearly all elementary number theory. It is the precise statement that the greatest common divisor is not just a number you can compute. It is also a number you can build out of the original two integers. This construction uses only addition, subtraction, and integer scaling. Bézout's identity answers this question completely, and does more. It characterizes exactly which integers arise as for varying . These are namely all multiples of , and nothing else. This dual nature — an existence statement and a classification statement — is what makes the identity so load-bearing. It converts a purely multiplicative notion (divisibility, common divisors) into an additive, linear one (integer combinations). That translation is the single most useful trick in the elementary theory of integers. The identity is the theoretical engine behind the Euclidean Algorithm. Run in reverse, the algorithm's steps produce the coefficients explicitly. This gives the Extended Euclidean Algorithm. It is also the quiet reason Euclid's Lemma holds (if a prime divides a product it divides a factor). It is the reason linear Diophantine equations are solvable exactly when . And it is the reason modular inverses exist whenever . This is the starting point for solving Linear Congruences. This article states and proves Bézout's identity from first principles. It uses only the Well-Ordering Principle and the division algorithm. It proves the full converse characterizing representable integers. It works two concrete asymmetric examples by hand. And it shows exactly which hypothesis cannot be dropped (that are not both zero).
- For integers not both zero, there exist integers with .
- The set of all values equals exactly the set of multiples of .
- The coefficients are never unique; the full solution set is an explicit line of lattice points.
- Proved via the well-ordering principle: take the smallest positive value of , show it divides both and .
- The identity is the theoretical justification for the Extended Euclidean Algorithm and for solvability of .
- Key idea: the gcd is the smallest positive integer expressible as an integer linear combination of and .
Where this lives today
Bézout's identity is the computational backbone of modular arithmetic in cryptography: the Extended Euclidean Algorithm uses exactly the back-substitution shown above to compute modular inverses, the core operation inside RSA key generation, Diffie–Hellman exchange setup, and elliptic curve cryptography. In coding theory, it underlies the Chinese Remainder Theorem's constructive proof, which reconstructs a number from its residues by explicitly building Bézout coefficients for the moduli. In computer algebra systems, solving linear Diophantine equations is done by first checking and then scaling a Bézout pair — precisely the argument used in Example 2. In abstract algebra, the identity generalizes verbatim to any Principal Ideal Domain (polynomial rings over a field, Gaussian integers, and more), where it is the statement that every ideal is principal and generated by a gcd; this generalization is one of the first deep structural facts students meet when moving from to ring theory. In numerical analysis and lattice-based cryptography, Bézout-type combinations appear in lattice reduction algorithms (e.g. the LLL algorithm) that search for short integer combinations of basis vectors, a higher-dimensional analogue of exactly this identity.
Ask the tutor: Can you show me step by step how the Extended Euclidean Algorithm recovers a Bézout pair for gcd(1740, 493)?
Let , not both zero, and let denote their greatest common divisor: the unique positive integer dividing both and that is divisible by every common divisor of and .
Bézout's identity is the statement that there exist integers such that
Such a pair is called a Bézout pair for , and any integer of the form is called an integer linear combination of and . The strong form of the identity further asserts that the set of all such combinations,
is exactly the set of all integer multiples of , i.e. .
Intuition
Think of and as two step sizes you are allowed to walk, forward or backward, along the number line, and you may combine any number of steps of each kind (that is what "integer multiple" means). The set of all positions you can reach, , turns out to be beautifully rigid: it is always an evenly spaced grid of points, a copy of for some . Bézout's identity says this is precisely — the largest common divisor is also the smallest positive reachable distance. The key structural fact hiding underneath is that is closed under addition, subtraction, and scaling by any integer — it is what algebraists call an ideal of — and every such subset of that contains a nonzero element is automatically the multiples of its own smallest positive element. This is why the proof does not need to mention the Euclidean Algorithm at all: it is a direct consequence of the Well-Ordering Principle, the fact that every nonempty set of positive integers has a least element.
Prime-power lattice picture
A second way to see the identity is geometrically, through the lattice of pairs and the linear map .
Both pictures illustrate the same content: no matter how you combine and with integer coefficients, you can never escape the multiples of , and itself is achievable, e.g. with : .
Let with not both and equal to , and let . Then: 1. (Existence) There exist such that . 2. (Characterization) .
Let , not both zero, and let
Then contains a smallest positive element , and every element of is a multiple of .
Non-emptiness of positive elements. Since are not both zero, at least one of is a positive integer (if then or is positive; similarly for ). Each of lies in , taking to be respectively. Hence the set of positive elements of is nonempty.
Existence of a least element. By the Well-Ordering Principle, every nonempty set of positive integers has a least element. Let , and fix integers with .
Every element of is a multiple of . Let be arbitrary. Apply the division algorithm to divide by : there exist unique integers with
Then
so as well, being an integer linear combination of and . If , then and , contradicting the minimality of . Hence , so , i.e. is a multiple of . This shows . Conversely, since and is closed under integer scaling — for any , — we get . Hence .
∎Proof of the Theorem, using the Lemma. Let and let be the least positive element of , which exists and satisfies by the preceding lemma. We show ; this simultaneously proves existence (part 1) and the characterization (part 2), since .
Step 1: divides both and . Since , divides . Since , divides . So is a common divisor of and .
Step 2: every common divisor of divides . Let be any common divisor of and , so and . Write for some integers (possible since ). Since and , we have and , hence divides their sum .
Step 3: conclude . By definition, is the unique positive common divisor of that is divisible by every common divisor of (equivalently: the greatest common divisor, since among positive common divisors, the divisibility order and the size order coincide — a common divisor cannot exceed or unless one of them is , and the case both zero is excluded by hypothesis). From Step 1, is a positive common divisor of . From Step 2, every common divisor of divides ; in particular . Since is itself a common divisor and is the smallest positive combination, and since is a positive common divisor of , Step 2 applied with gives ; and Step 1 shows is a common divisor of , so by the defining maximality property of (every common divisor divides ), as well. Two positive integers dividing each other are equal: . Hence , proving the characterization, and exhibits the required with , proving existence.
∎If is one Bézout pair, then the complete set of integer pairs with is
In particular, when , the Bézout pair is never unique.
Suppose . Subtracting, . Divide through by : writing , with (dividing a common divisor's defining coprime cofactors is standard: if divided 's cofactors, then would be a larger common divisor of , contradicting maximality of ), we get
Since and , Euclid's Lemma gives — this instance of Euclid's Lemma for coprime is itself a direct corollary of the theorem just proved, applied to : as , there are with , so ; since by hypothesis, divides both terms, hence . Write for some . Substituting back into gives , and since (as ; the case is degenerate and handled separately below), we cancel to get , i.e. . This confirms every solution has the claimed form, and direct substitution shows every such pair does solve . (If then and any works with fixed — a genuinely different, degenerate parametrization, consistent with making the -coordinate rigid, matching the formula.)
∎Worked examples
Example 1: , . Run the Euclidean Algorithm forward to find , recording each quotient and remainder:
The last nonzero remainder is , so . Now unwind the steps (back-substitution), which is exactly the theorem's proof made algorithmic — the Extended Euclidean Algorithm:
Check: , and , so . ✓ So is a Bézout pair: . By the corollary, every Bézout pair is for , since and . Checking : , and . ✓
Example 2: , (asymmetric, testing the characterization half of the theorem). Euclidean algorithm:
So . Back-substitute:
Check: . ✓ So works: . Now use the characterization half of the theorem to test membership: is an integer combination of and ? Since is a multiple of , the theorem guarantees yes, and gives an explicit witness by scaling: . Verify: , , sum . ✓ Is an integer combination of and ? Since and , the theorem's characterization () guarantees this is impossible — no integers satisfy , regardless of how cleverly chosen. This negative conclusion is exactly the power of the "only multiples of " half of Bézout's identity: it is not merely an existence result but a complete classification.
Drop the hypothesis that are not both zero: set , . Then is conventionally undefined or set to by convention (there is no largest common divisor, since every integer divides , so there is no maximum). Even granting the convention , the identity's content collapses: the set
does trivially equal , so the equation is not false, but the entire proof breaks down at the first step of the lemma: there is no positive element in at all, so the well-ordering principle cannot be invoked to produce a least positive combination, and the argument that " divides and " via never gets off the ground because no such exists. The theorem is vacuously consistent here but mathematically empty — no genuine Bézout pair with informative coefficients is produced, and none of the downstream uses (solving , finding modular inverses) make sense when . This is why every careful statement of the identity explicitly excludes the case : the proof machinery, not merely the conclusion, requires a nonzero combination to exist to seed the well-ordering argument.
Scope, edge cases & common traps
| Situation | What holds | Common mistake |
|---|---|---|
| both nonzero | Full theorem applies; unique family of solutions given by corollary | Believing is unique |
| One of is zero, other nonzero | ; identity trivially for any | Forgetting is unconstrained here |
| both zero | Theorem hypothesis fails; no genuine content | Silently plugging in and claiming a real Bézout pair exists |
| negative | Theorem still applies verbatim; always taken positive | Assuming must be positive or that signs of restrict signs of |
| Existence of some solution to | Solvable iff (direct corollary of characterization) | Assuming solvability whenever , ignoring the divisibility condition |
The mathematician behind it
Origins · 1 minÉtienne Bézout and how this was discovered
Bézout was a French mathematician best known for his 1779 treatise Théorie générale des équations algébriques, which studied the elimination theory of systems of polynomial equations and established what is now called Bézout's theorem on the intersection number of plane curves. The integer identity that bears his name today is, historically, a special linear case of ideas that trace back further — to Bachet de Méziriac's 1624 work on integer solutions of linear equations, itself building on Euclid's algorithm from antiquity — but Bézout's systematic treatment of resultants and linear combinations of polynomial and integer quantities led his name to be attached to this entire family of results. He served for decades as an examiner of naval and artillery cadets in France, and wrote widely used mathematics textbooks for that purpose, making rigorous computational number theory and algebra part of standard technical education.
Is the Bézout pair unique for given ?
No. If is one Bézout pair for with both nonzero, then every pair of the form for is also a Bézout pair, and these are all of them, as proved in the corollary above. Geometrically, the solutions form an infinite arithmetic progression of lattice points along a line of slope in the -plane. Algorithmically, the Extended Euclidean Algorithm returns one specific such pair — typically the one with smallest absolute values — but any valid pair works equally well for applications like computing modular inverses.
Does Bézout's identity require and to be coprime?
No, and this is a common point of confusion. The identity holds for any integers not both zero, producing , which need not be . The special case (coprimality) is important enough to deserve its own name, sometimes stated as: are coprime if and only if there exist with . This special case is exactly what powers the proof of Euclid's Lemma and the existence of modular inverses for Linear Congruences, but the general identity applies regardless of whether share a common factor.
How does Bézout's identity relate to solving the general linear Diophantine equation ?
It gives a complete solvability criterion and construction method. First, has an integer solution if and only if divides ; this follows immediately from the characterization . If , write and take any Bézout pair with ; then solves . All solutions then form the arithmetic family described in the corollary, scaled appropriately. This is the standard method used in both hand computation and computer algebra systems.
Why does the proof avoid using the Euclidean Algorithm directly?
To keep the logical foundations clean and non-circular. The proof given here uses only the Well-Ordering Principle and basic divisibility, which makes it independent of, and in fact more fundamental than, the algorithmic machinery of the Euclidean Algorithm. This matters because the Extended Euclidean Algorithm, which computes explicit Bézout coefficients via back-substitution, is best understood as an efficient constructive method for producing the pair that the well-ordering proof only asserts exists. Keeping the existence proof separate from the algorithm avoids circular reasoning and clarifies which parts of the theory are purely existential versus computational.
Does an analogous identity hold for more than two integers?
Yes. For integers not all zero, there exist integers with , and the set of all such combinations equals the multiples of that gcd. The proof is essentially identical: apply the well-ordering principle to the set of positive integer combinations of , show the least positive element divides every and is divisible by every common divisor. In practice one often computes the multi-integer gcd and its Bézout coefficients by repeatedly applying the two-variable case, e.g. .
What goes wrong if I try to apply Bézout's identity to real numbers instead of integers?
The identity is specifically a statement about the integers , and it fails for real numbers in the relevant sense. For real , the set is either (if ) or all of (otherwise, since real linear combinations can produce any real number by scaling), so there is no analogue of "smallest positive combination" — the reals are densely ordered with no least positive element, so the well-ordering step of the proof has no foothold. The identity genuinely depends on integers forming a discrete, well-ordered structure; its natural home in abstract algebra is the broader class of Euclidean domains and principal ideal domains, not general fields or rings.
Can Bézout's identity be used to prove Euclid's Lemma, and if so how?
Yes, and this is one of its most important consequences. Euclid's Lemma states that if a prime divides a product , then or . Suppose ; since is prime, . By Bézout's identity there exist integers with . Multiply both sides by : . Since trivially and by hypothesis (so ), divides the sum . Hence , completing the proof. This derivation is non-circular because Bézout's identity was established independently using only the well-ordering principle.