This proof consists of two parts.
- part 1: proves that Euclidean Algorithm gives us a common factor of two integers.
- part 2: proves that the common divisor that Euclidean Algorithm produces is the largest possible
Euclidean Algorithm gives us a common factor of two integers(a,b).
abr1rirk−2rk−1=q1b+r1,=q2r1+r2,=q3r2+r3,⋮=qi+2ri+1+ri+2,⋮=qkrk−1+rk=qk+1rkwhere(0<r<b)where(0<r2<r1)where(0<r3<r2)where(0<ri+2<ri+1)
From the last euqation, we know that rk∣rk−1.
So, we know that we can express rk−1=crk. where c is an integer.
Now consider the previous equation.
rk−2=qkrk−1+rk=qkcrk+rk=rk(qkc+1)
Thus, we have that rk∣rk−2.
In our equation previous to that one, we have
rk−3=qk−1rk−2+rk−1
From here, since rk∣rk−1 and rk∣rk−2, using our rules of divisibility we have that rk∣rk−3.
As you can see, we can continue this process, considering each previous equation until we get to the last two, where we will find that rk∣a and rk∣b.
Thus, we find that Euclids algorithm gives us a common factor of a and b.
But this says that any arbitrary common factor of a and b that we originally picked divides into rk, the value that Euclidean algorithm produced.
Since we know that rk is a common factor to both a and b, this shows that is must be the largest possible common factor, or gcd(a,b)■
Notice that now we have expressed gcd(a,b) as a linear combination of rk−2 and rk−3.
Next we can substitute for of rk−2 in terms of rk−3 and rk−4, so that the gcd(a,b) can be expressed as the linear combination of rk−3 and rk−4.
Eventually, by continuing this process, gcd(a,b) will be expressed as a linear combination of a and b as desired.
This process will be much easier to see with examples:
Find integers x and y such that
135x+50y=5
Use Euclidean Algorithm to compute gcd(135,50)
135503515=2⋅50+35⋯1◯=1⋅35+15⋯2◯=2⋅15+5⋯3◯=3⋅5
Now, let's use the Extended Euclidean algorithm to solve the problem
5=35−2⋅15 from equation 3
But, we have that
15=50−35 from euqation 2◯
Now we, substitute this value into the previously derived equation:
555=35−2⋅15=35−2⋅(50−35)=3⋅35−2⋅50
Now, finally use the first equation to determine an expression for 35 as a linear combination of 135 and 5035=135−2⋅50 from equation1◯
Plug this into our last euqation:
555=3⋅35−2⋅50=3⋅(135−2⋅50)−2⋅50=3⋅135−8⋅50
So, a set of solutions to the equation is x=3,y=−8