Section 3.2 Geometry of Equations
ΒΆBut just proving things are true and using them isn't enough. Why is the theorem true, intuitively? I believe the right way to approach this is with geometry, as in the following figure. Then try out the interactive cell below to see how things change with different coefficients.
xxxxxxxxxx
def _(a=slider(-10,10,1,6),b=slider(-10,10,1,4), c=slider(-20,20,1,2),viewsize=slider(3,20,1,5)):
p = plot(-(a/b)*x+c/b,-viewsize,viewsize, plot_points=200)
lattice_pts=[[i,j] for i in [-viewsize..viewsize] for j in [-viewsize..viewsize]]
plot_lattice_pts = points(lattice_pts,rgbcolor=(0,0,0), pointsize=2)
if mod(c,gcd(a,b))==0:
line_pts = [coords for coords in lattice_pts if a*coords[0]+b*coords[1]==c]
if line_pts==[]:
plot_line_pts = Graphics()
else:
plot_line_pts = points(line_pts,rgbcolor=(0,0,1), pointsize=20)
pretty_print(html("Showing solutions to $%sx+%sy=%s$ in this viewing window"%(str(a),str(b),str(c))))
show(p+plot_lattice_pts+plot_line_pts, figsize=[5,5], xmin=-viewsize,xmax=viewsize, ymin=-viewsize,ymax=viewsize)
else:
pretty_print(html("The gcd of $%s$ and $%s$ is $%s$, which does not divide $%s$,"%(str(a),str(b),str(gcd(a,b)),str(c))))
pretty_print(html("so no solutions to $%sx+%sy=%s$"%(str(a),str(b),str(c))))
show(p+plot_lattice_pts, figsize=[5,5],xmin=-viewsize,xmax=viewsize, ymin=-viewsize,ymax=viewsize)
Definition 3.2.2.
The integer lattice is the set of points (m,n) for m,nβZ.
-
First, Theorem 3.1.2 now expresses a very mysterious geometric idea, depending on whether
gcd(a,b)β£cIf so, then this line hits lots of the lattice points; if not, the line somehow slides between every single one of them! You can check this by keeping a,b the same and varying c in the interact above.
-
Secondly, it makes the proof of why Theorem 3.1.2 gets all of the answers much clearer. If you have one answer (for instance, (1,β1)) and go right by the run and down by the rise in ab (our example was a=6,b=4), you hit another solution (perhaps here (β3,5)) since it's still all integers and the slope was the line's slope.
But wait, couldn't there be points in between? Sure. So make ab into lowest terms (e.g. 32), which would be a/db/d. And this is the βsmallestβ rise over run that works to keep you on the line and keep you on integer points.
Third, it can help clarify the role of the solution which the Bezout identity (extended Euclidean algorithm) gives for ax+by=c. Namely, as pointed out in in a 2013 American Mathematical Monthly article by S. A. Rankin [C.7.21], the βsolution provided β¦ lies nearest to the origin.β Try the interactive cell at the beginning of this subsection to convince yourself of this!