ΘρϵηΠατπ

Linear Diophantine Equation
A linear diophantine equation is an equation of the form ax+by=c where a,b,c

Note that while we know that there are infinitely many solutions to the above equation if we're seaching in 2 but it's not clear if there is even one solution when we restrict x,y

A Linear Diophantine Equation Has Solutions if the GCD of the coefficients divides the Constant
ax+by=c has solutions if and only if gcd(a,b)|c

Let g:=gcd(a,b) and suppose that x0,y0 is a solution so that ax0+by0=c since g|a,b we know that g|ax0+by0 therefore g|c as needed.

Recall that we have some x0,y0 such that gcd(a,b)=ax0+by0 since g|c so c=gk for some k thus multiplying our previous equation by k we obtain c=gk=a(kx0)+b(ky0)

One Solution Yields Infinitely Many
Suppose that ax0+by0=c is a solution and d:=gcd(a,b) , then the entire set of solutions is given by: S:={(x0,y0)+t(bd,ad):t}
Taking sS then we see that s=(x0+tbd,y0tad) Now, let's confirm that this is a solution, so we have to make sure that as1+bs2=c. a(x0+tbd)+b(y0tad)=ax0+by0+0=c therefore every element in S is a solution, but let's now show that it contains all solutions.

We already know that (x0,y0) is a solution, so let x1,y1 be a different solution, then we have ax1+by1=c=ax0+by0a(x1x0)=b(y1y0) dividing through by g:=gcd(a,b) we see that ag(x1x0)=bg(y1y0) but then recall that gcd(ag,bg)=1 thus by forced division, we see that ag|y1y0so that there is some k such that y1y0=agk thus ag(x1x0)=bg(y1y0)ag(x1x0)=bg(agk) therefore by cancellation we have that x1x0=bgk and symmetrically y1y0=agk therefore (x1,y1)=(x0kbg,y0+kag) so therefore (x1,y1)S as needed.

The Set of Linear Combinations Are All Integral Multiples of Their GCD
For any a,b the set S:={ax+by:x,y} is precisely the set of all integral multiples of gcd(a,b)

For notational ease, let g:=gcd(a,b). Recall that gcd(ag,bg)=1 iff there are some x,y such that agx+bgy=1 if and only if a(dx)+b(dy)=dg

This observation tells us that any integer multiple of g is in S. Now supose we have ax+byS, we want to show this is a multiple of g, equivalently we want to show that g|ax+by, but this is certainly true becuase ax+byg=(ag)x+(bg)y so it does