ΘρϵηΠατπ

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 s∈S then we see that s=(x0+tbd,y0−tad) Now, let's confirm that this is a solution, so we have to make sure that as1+bs2=c. a(x0+tbd)+b(y0−tad)=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+by0⟺a(x1−x0)=−b(y1−y0) dividing through by g:=gcd⁡(a,b) we see that ag(x1−x0)=−bg(y1−y0) but then recall that gcd⁡(ag,bg)=1 thus by forced division, we see that ag|y1−y0so that there is some k∈ℤ such that y1−y0=agk thus ag(x1−x0)=−bg(y1−y0)⟺ag(x1−x0)=−bg(agk) therefore by cancellation we have that x1−x0=−bgk and symmetrically y1−y0=agk therefore (x1,y1)=(x0−kbg,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+by∈S, 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