Bézout's theorem is an important basic theorem of number theory. It states that if and are integers, and is an integer, then the equation has integer solutions in and if and only if the greatest common divisor of and divides .
We have two directions of the equivalence to prove.
Suppose has solutions in and . Then the highest common factor of and divides and , so it divides and ; hence it divides their sum, and hence .
Suppose ; equivalently, there is some such that .
We have the following fact: that the highest common factor is a linear combination of . (Proof; this can also be seen by working through Euclid's algorithm.)
Therefore there are and such that .
Finally, , as required.
Suppose , as above.
The extended_euclidean_algorithm can be used (efficiently!) to obtain a linear combination of and which equals . Once we have found such a linear combination, the solutions to the integer equation follow quickly by just multiplying through by .
Bézout's theorem is important as a step towards the proof of Euclid's lemma, which itself is the key behind the Fundamental Theorem of Arithmetic. It also holds in general principal ideal domains.