Dense Pythagorean Triples -- A Cute Problem in Arithmetic Geometry
16 Nov 2021 - Tags: pretty-pictures , sage , featured
I follow a lot of other math blogs, and it’s always fun reading about what
various people are thinking about. Particularly fun for me is when blogs
pose problems to their readers, and the other day Shiva Kintali posted
a really cute problem: For any rational numbers
As soon as I read this problem I was reminded of a really clever trick that is one of the simplest examples in arithmetic geometry. I probably saw this earlier, but I really internalized the idea after seeing it first in a lecture of Richard E. Borcherds (here) then again in the opening chapter of Stillwell’s Mathematics and its History. I’ll summarize the idea here, but for more information you should check out either of these (excellent!) references.
Rewrite
This means we can compeltely characterize pythagorean triples by rational slopes. In the language of algebraic geometry, we say that the affine line is birationally equivalent to the circle.
Now, with this idea in mind, can you answer Kintali’s question? That is,
can you show that for any
I’m going to talk about the solution now, but this is a particularly satisfying problem to solve for yourself, and I recommend you give it a try!
Ok, so what’s the plan? Well we’re intersted in
Following the earlier example, there’s an “obvious” rational point on this
curve:
But now the answer to the question is entirely obvious! Let’s fix some
Of course, from this picture we would expect there to be a plethora of
rational points on the curve whose
It’s at this point that we can (conceptually) stop. We know the answer to Kintali’s question is “yes”. But it’s fun to work out the details so that we can really believe the answer. After all, this machinery is really making some kind of prediction, and should try to test our theory in some special cases!
Again, I encourage you to try and work out the computational details yourself! Now is the time to give it a go ^_^
Ok, so we’re interested in where lines of (rational) slope
for various choices of
Of course, we can substitute the first equation into the second, and solve for
From here, we can get
for any
So now to solve our problem, what do we need to do? Well, given
Then, if all is right with the world, we’ll have successfully found a
pythagorean triple
Now, how do we choose such a
But this is easy to do, and we see that
gets the job done.
In particular, for some
then
will give us the desired triple
Now what would be really neat would be if somebody hacked together an interactive demo for this… Woops! My mouse slipped!
xxxxxxxxxx
def getPoint(t):
"""
get a rational point (x,y) on the curve y^2 - x^2 = 1
given a rational t
"""
return ((-2*t)/(t^2 - 1), (-t^2 - 1)/(t^2-1))
def xinv(s):
"""
find a t so that x(t) = s
"""
return (-1 + sqrt(1 + s^2))/s
def _(alpha=slider([k/1000 for k in range(1001)], default=0.14, label="$\\alpha$"),
beta=slider([k/1000 for k in range(1001)], default=0.57, label="$\\beta$")):
tmin = xinv(alpha)
tmax = xinv(beta)
# average tmin and tmax, then round it to a rational number
t = Rational(round((tmin + tmax)/2, ndigits=4))
(x,y) = getPoint(t)
a = x.numerator()
b = x.denominator()
c = y.numerator()
show(html("$$t = {}$$".format(t)))
show(html("$$(a/b,c/b) = (x,y) = ({},{})$$".format(x,y)))
show(html("So \n $$({})^2 + ({})^2 = ({})^2$$".format(a, b, c)))
if alpha <= beta:
show(html("With \n $$\\alpha < \\frac{" + str(a) + "}{" + str(b) + "} < \\beta$$"))
else:
show(html("With \n $$\\beta < \\frac{" + str(a) + "}{" + str(b) + "} < \\alpha"))
xvar = var('x')
yvar = var('y')
# the curve
p = implicit_plot(yvar^2 - xvar^2 == 1, (xvar,0,1), (yvar,0.8,1.5), color="blue")
# alpha and beta labels
label1 = text("$\\alpha$", (alpha + 0.03, 0.84), color="black", fontsize=15)
label2 = text("$\\beta$", (beta + 0.03, 0.84), color="black", fontsize=15)
# the shaded region
if alpha <= beta:
r = region_plot(lambda x,y: alpha <= x and x <= beta, (0,1), (0.8,1.5), incol="orange", bordercol="orange", alpha=0.5)
else:
r = region_plot(lambda x,y: beta <= x and x <= alpha, (0,1), (0.8,1.5), incol="orange", bordercol="orange", alpha=0.5)
# the line with slope t
l = plot(1 + t * xvar, (0,1), color="black")
show(p + label1 + label2 + r + l, axes=True)
-
As a (fun?) exercise, you should prove both of these claims. One direction should be quite easy, and the other is only a little bit tricky.
As a hint, you might ask yourself: is it possible for a quandratic equation to have one rational root and one irrational root? ↩
-
You might be wondering what happens when you choose a slope of
. If you’ve heard of projective geometry, where we add some “points at infinty” to make the math “cleaner”, this is one instance of that! It turns out that while the slopes don’t correspond to any points in the affine case, once we projectivize they correspond to “points at infinity” where the right of the top curve meets the left of the bottom curve (this is the point associated to a slope of ) or where the left of the top curve meets the right of hte bottom curve (which is associated to the slope ). ↩