logo

Proof of the Extended Euclidean Theorem 📂Number Theory

Proof of the Extended Euclidean Theorem

Theorem 1

For two integers a,ba,b, there always exists an integer solution for ax+by=gcd(a,b)ax + by = \gcd (a,b).

Description

This theorem is also known as the Linear Congruence Theorem as it implies that gcd(a,b)\gcd (a,b) can be expressed as a linear equation involving aa and bb.

Although its appearance seems somewhat complex and it only discusses existence, it is surprisingly widely used. It might not provide a specific solution (x,y)(x,y), but the fact that we can start from the relationship between aa and bb is a significant gain. It is incredibly useful especially when we don’t know what xx and yy are.

Proof

Elementary Proof

Strategy: As the name suggests, the Extended Euclidean Theorem repeats the Euclidean algorithm. Hence, it is also referred to as the Extended Euclidean Algorithm.


Euclidean algorithm: For ri<ri+1 r_i<r_{i+1}, let’s define a:=r1a: = r_{-1} and b:=r0b:=r_{0} that satisfy the recurrence relation ri1=qi+1ri+ri+1r_{i-1} = q_{i+1} \cdot r_{i} + r_{i+1}. For nn that satisfies rn+1=0r_{n+1} = 0, rn=gcd(a,b)r_{n} = \gcd (a,b)

According to the Euclidean algorithm, r1r_{1} is r1=aq1b r_{1} = a - q_{1} b In other words, it can be represented as a linear combination of aa and bb. Meanwhile, r2=bq2r1 r_{2} = b - q_{2} r_{1} and substituting the above r1=aq1br_{1} = a - q_{1} b yields r2=bq2r1=bq2(aq1b)=q2a+(1+q1q2)b \begin{align*} r_{2} =& b - q_{2} r_{1} \\ =& b - q_{2} ( a - q_{1} b ) \\ =& -q_{2} a + ( 1 + q_{1} q_{2} ) b \end{align*} meaning r2r_{2} can also be represented as a linear combination of aa and bb. Repeating this nn times, rnr_{n} can be expressed for some x,yZx,y \in \mathbb{Z} as rn=xa+yb r_{n} = x a + y b Since the Euclidean algorithm ensures rn=gcd(a,b)r_{n} = \gcd (a,b), (x,y)(x,y) exists as a solution for ax+by=gcd(a,b)ax + by = \gcd (a,b).

Algebraic Proof

The ring of integers Z\mathbb{Z} is a PID, hence a Bezout domain.

See Also

Generalization: Bezout Domain

As pointed out in the algebraic proof, if a domain is a Bezout domain, then the Extended Euclidean Theorem applies no matter where that domain is.


  1. Silverman. (2012). A Friendly Introduction to Number Theory (4th Edition): p42. ↩︎