dhermes / bossylobster-blog

Content, Settings and Build for my Blog
Apache License 2.0
2 stars 3 forks source link

Elliptic Curve Fun #86

Closed dhermes closed 2 years ago

dhermes commented 2 years ago

Inspired by: https://youtu.be/Wy_uzVX1U_g

x / (y + z) + y / (z + x) + z / (x + y) = 1

For fun, I want to find rational solutions on this degree 2 variety in R^3. To do this, s = x + y + z, p = x/s, q = y/s, 1 - z/2 = p + q. Adding 3 = 1 + 1 + 1 = (y + z) / (y + z) + (z + x) / (z + x) + (x + y) / (x + y) to the equation, it becomes:

(x + y + z)[1 / (y + z) + 1 / (z + x) + 1 / (x + y)] = 4

s / (s - x) + s / (s - y) + s / (s - z) = 4

1 / (1 - p) + 1 / (1 - q) + 1 / (p + q) = 4

Starting from this point, we end with with a quadratic in q

(3 - 4p) q^2 - (1 - p)(3 - 4p) q + [3 p^2 - 3p + 1] = 0

which has discriminant

Delta = (p + 1)(4p - 3)(4 p^2 - 3p + 1) = 16 p^4 - 8 p^3 - 11 p^2 + 10p - 3 = f(p)

In order for q to be rational (for p) rational, Delta must be a rational square, so at this point we have a need to find rational points on the elliptic curve

v^2 = f(u)

Making the substitutions u = (9 / 4) (4x + 1) / (12x - 25) and v = 504y / (12x - 25)^2 (hat tip) this elliptic curve transforms to the Weierstrass equation

y^2 = x^3 + (215 / 48) x - (5291 / 864)
    = (12x - 13) (72 x^2 + 78x + 407) / 864
    = (12x - 13) [(24x + 13)^2 + 3087] / 6912

Y^2 Z = X^3 + (215 / 48) X Z^2 - (5291 / 864) Z^3

Figure_1

(In addition to it being obvious from the graph, the discriminant of the curve in Weierstrass form is -21952 != 0.)

From the factorization for f(u) we have already two known rational points (u, v) = (-1, 0) and (u, v) = (3/4, 0). Under the transformation x = (1 / 12) (100u + 9) / (4u - 3) and y = 14v / (4u - 3)^2 the first point lands in R^2 but the other one can only be represented in projective space (as the point at infinity on the curve). They become

P3 = [X : Y : Z] = [13 : 0 : 12]
P0 = [X : Y : Z] = [ 0 : 1 : 0]

(the labels will become clear later)

dhermes commented 2 years ago

From a wonderful Math StackExchange answer I went to MAGMA Web UI and ran

E:=EllipticCurve([215 / 48, - 5291 / 864]);
MordellWeilGroup(E);
RationalPoints(E : Bound:=1000);

which yields

Abelian Group isomorphic to Z/6
Defined on 1 generator
Relations:
    6*$.1 = 0
Mapping from: Abelian Group isomorphic to Z/6
Defined on 1 generator
Relations:
    6*$.1 = 0 to CrvEll: E
Composition of Mapping from: Abelian Group isomorphic to Z/6
Defined on 1 generator
Relations:
    6*$.1 = 0 to Set of points of Elliptic Curve defined by y^2 = x^3 +
2496043745280*x - 2547454723473014784 over Rational Field with coordinates in
Rational Field given by a rule [no inverse] and
Elliptic curve isomorphism from: Elliptic Curve defined by y^2 = x^3 +
2496043745280*x - 2547454723473014784 over Rational Field to CrvEll: E
Taking (x : y : 1) to (1/746496*x : 1/644972544*y : 1)
true true
{@ (0 : 1 : 0), (13/12 : 0 : 1), (25/12 : 7/2 : 1), (25/12 : -7/2 : 1), (109/12
: 28 : 1), (109/12 : -28 : 1) @}
dhermes commented 2 years ago

From some of these solutions:

P2 = [X : Y : Z] = [ 25 :  42  : 12] <==> (u, v) = (INFINITY, INFINITY)
P4 = [X : Y : Z] = [ 25 : -42  : 12] <==> (u, v) = (INFINITY, INFINITY)
P1 = [X : Y : Z] = [109 :  336 : 12] <==> (u, v) = (1, 2)
P5 = [X : Y : Z] = [109 : -336 : 12] <==> (u, v) = (1, -2)

Note that finding v^2 = f(u) was to find p, but p = 1 means that 1 / (1 - p) is undefined, so this still doesn't help us.

Using the rules for adding points on an elliptic curve (tracing lines / tangent lines and dealing with multiplicities):

P3 + P3 = 0
P2 + P4 = 0
P1 + P5 = 0

P3 + P2 + P1 = 0
P3 + P4 + P5 = 0

P2 + P2 + P2 = 0
P4 + P4 + P4 = 0

P1 + P1 + P4 = 0
P5 + P5 + P2 = 0

we see the addition table

   | P0 | P1 | P2 | P3 | P4 | P5 |
---+----+----+----+----+----+----|
P0 | P0 | P1 | P2 | P3 | P4 | P5 |
P1 | P1 | P2 | P3 | P4 | P5 | P0 |
P2 | P2 | P3 | P4 | P5 | P0 | P1 |
P3 | P3 | P4 | P5 | P0 | P1 | P2 |
P4 | P4 | P5 | P0 | P1 | P2 | P3 |
P5 | P5 | P0 | P1 | P2 | P3 | P4 |

which is identical to the addition table for Z/6Z (based on Abelian Group isomorphic to Z/6 comment). So we could take either P1 or P5 as the generator.

dhermes commented 2 years ago

When u = p = -1, the original equation becomes 7(q - 1)^2 = 0, i.e. q = 1, which is similarly not allowed since we must be able to divide 1 / (1 - q).

dhermes commented 2 years ago

Two things left I want to do

dhermes commented 2 years ago

Q[sqrt(2)]

More fun here!! Trying to do Q[sqrt(2)] led to another dead end. If we instead try to find rational points on the elliptic curve given by

2 v^2 = f(u)

and use the substitutions u = (9 / 4) (2x + 1) / (6x - 25) and v = 126y / (6x - 25)^2 the Weierstrass equation is

y^2 = x^3 + (215 / 12) x - (5291 / 108)

In a crazy twist, this has even FEWER rational points than the curve v^2 = f(u)! It only has the point at infinity and 0^2 = f(-1) / (u, v) = (-1, 0):

Abelian Group isomorphic to Z/2
Defined on 1 generator
Relations:
    2*$.1 = 0
Mapping from: Abelian Group isomorphic to Z/2
Defined on 1 generator
Relations:
    2*$.1 = 0 to CrvEll: E
Composition of Mapping from: Abelian Group isomorphic to Z/2
Defined on 1 generator
Relations:
    2*$.1 = 0 to Set of points of Elliptic Curve defined by y^2 = x^3 +
2437542720*x - 77742148543488 over Rational Field with coordinates in Rational
Field given by a rule [no inverse] and
Elliptic curve isomorphism from: Elliptic Curve defined by y^2 = x^3 +
2437542720*x - 77742148543488 over Rational Field to CrvEll: E
Taking (x : y : 1) to (1/11664*x : 1/1259712*y : 1)
true true
{@ (0 : 1 : 0), (13/6 : 0 : 1) @}

Q[sqrt(3)]

Luckily 3 bails us out with an infinite family of rational points:

3 v^2 = f(u)

u = (9 / 4) (3x + 1) / (9x - 25)
v = 189 y / (9x - 25)^2

y^2 = x^3 + (215 / 27) x - (10572 / 729)

produces

Abelian Group isomorphic to Z/2 + Z
Defined on 2 generators
Relations:
    2*$.1 = 0
Mapping from: Abelian Group isomorphic to Z/2 + Z
Defined on 2 generators
Relations:
    2*$.1 = 0 to CrvEll: E
Composition of Mapping from: Abelian Group isomorphic to Z/2 + Z
Defined on 2 generators
Relations:
    2*$.1 = 0 to Set of points of Elliptic Curve defined by y^2 = x^3 +
2248975938645*x - 2178739959825575718 over Rational Field with coordinates in
Rational Field given by a rule [no inverse] and
Elliptic curve isomorphism from: Elliptic Curve defined by y^2 = x^3 +
2248975938645*x - 2178739959825575718 over Rational Field to CrvEll: E
Taking (x : y : 1) to (1/531441*x : 1/387420489*y : 1)
true true
{@ (0 : 1 : 0), (13/9 : 0 : 1), (31/9 : 22/3 : 1), (31/9 : -22/3 : 1), (77/9 :
704/27 : 1), (77/9 : -704/27 : 1) @}

Obviously the finite degree generator (x, y) = (13/9, 0) is our (u, v) = (-1, 0), but the other generator produces our desired outcome:

x = 31/9 <==> u = 17/4
y = +/- 22/3 <==> v = +/- 77/4

p = 17/4, q+ = (-13 + 11 sqrt(3)) / 8, q- = (-13 - 11 sqrt(3)) / 8
dhermes commented 2 years ago

Side note here, there is clearly a pattern to these substitutions and I was intentionally uniform for the 2v^2 and 3v^2 treatment. For the general case (which I'll probably re-specialize to n = 1 when I write this blog post):

n v^2 = f(u)

u = (9 / 4) (nx + 1) / (3nx - 25)
v = 63ny / (3nx - 25)^2

y^2 = x^3 + 215 / (3 n^2) x - 10582 / (27 n^3)

which when specialized to 1 gives the same information / same group

Abelian Group isomorphic to Z/6
Defined on 1 generator
Relations:
    6*$.1 = 0
Mapping from: Abelian Group isomorphic to Z/6
Defined on 1 generator
Relations:
    6*$.1 = 0 to CrvEll: E
Composition of Mapping from: Abelian Group isomorphic to Z/6
Defined on 1 generator
Relations:
    6*$.1 = 0 to Set of points of Elliptic Curve defined by y^2 = x^3 +
38086605*x - 151840133874 over Rational Field with coordinates in Rational Field
given by a rule [no inverse] and
Elliptic curve isomorphism from: Elliptic Curve defined by y^2 = x^3 +
38086605*x - 151840133874 over Rational Field to CrvEll: E
Taking (x : y : 1) to (1/729*x : 1/19683*y : 1)
true true
{@ (0 : 1 : 0), (13/3 : 0 : 1), (25/3 : 28 : 1), (25/3 : -28 : 1), (109/3 : 224
: 1), (109/3 : -224 : 1) @}
dhermes commented 2 years ago

Also when I write the blog post I won't use x, y twice to represent different quantities.

dhermes commented 2 years ago

Reference for Weierstrass equation: https://en.wikipedia.org/wiki/Elliptic_curve#Elliptic_curves_over_the_real_numbers

dhermes commented 2 years ago

Even better

y^2 = x^3 + 215 / (3 n^2) x - 10582 / (27 n^3)
    = [x - 13 / (3n)] [(6nx + 13)^2 + 3087] / (36 n^2)
dhermes commented 2 years ago

We can find q in terms of u/p and v by looking back at the original quadratic

(3 - 4u) q^2 - (1 - u)(3 - 4u) q + (3u^2 - 3u + 1) = 0

q+ = [(1 - p)(3 - 4p) + v] / [2(3 - 4p)]
q- = [(1 - p)(3 - 4p) - v] / [2(3 - 4p)]

and then substituting back u = (9 / 4) (4x + 1) / (12x - 25) and v = 504y / (12x - 25)^2 (and using a common denominator in case we want to move to projective space)

p = 18(4x + 1) / [8(12x - 25)]
q+ = (12x - 109 - 24y) / [8(12x - 25)]
q- = (12x - 109 + 24y) / [8(12x - 25)]

Using this representation, we try the projective representation P = 18(4X + Z), R = 8(12X - 25Z) and then have the two options Q = (12X - 109Z +/- 24Y). We end with with 6 points in this projective representation as well:

P0/P0: [ 0 :  1 : 0]
P1/P5: [ 1 : -1 : 1]
P1/P5: [ 1 :  1 : 1]
P2/P4: [ 1 : -1 : 0]
P2/P4: [ 1 :  0 : 0]
P3/P3: [-1 :  1 : 1]

Some of these were initially perplexing so I'll go a little deeper. We knew that p = 3/4 produced the point at infinity P0 = [X : Y : Z] = [0 : 1 : 0 ], so where did 3/4 go? Well plugging it into 1 / (1 - p) + 1 / (1 - q) + 1 / (p + q) = 4 we end up with

     4 = (16q^2 - 4q + 19) / (4q^2 - q - 3)
<==> 1 = (16q^2 - 4q + 19) / (16q^2 - 4q - 12)

which can never be true for finite q (since the non-constant coefficients are the same in the numerator and denominator). But if we let q tend towards +/- infinity this will be true, hence the point at infinity in [P : Q : R] space (and the absence of 3/4). This has multiplicity 2 in some sense (because q^2 is involved), but so does every other point in [P : Q : R] space.

The solutions p = 1, q = +/- 1 solve the equation when denominators are cleared (even they they are invalid since 1 - p = 0 cannot be divided by). Similarly for the solutions q = 1, p = +/- 1 (which overlaps at p = q = 1).

This leaves the other two points at infinity from P2/P4. It makes sense that these are infinite due to the fact that x = 25/12 can't carry over when a transformation divides by 12x - 25.

dhermes commented 2 years ago

Inverting this system (to sanity check the projective coordinates), we get

x = (100p + 9) / [12(4p - 3)]
y = +/- 168(p + 2q - 1) / [12(4p - 3)]

So setting X = 100P + 9R, Y = +/- 168(P + 2Q - R), Z = 12(4P - 3R) we get confirmation:

[ P :  Q : R] <==> [   X :       Y :  Z ]
------------------------------------------
[ 0 :  1 : 0] <==> [   0 :       1 :  0 ]
[ 1 : -1 : 1] <==> [ 109 : +/- 336 : 12 ]
[ 1 :  1 : 1] <==> [ 109 : +/- 336 : 12 ]
[ 1 : -1 : 0] <==> [  25 : +/-  42 : 12 ]
[ 1 :  0 : 0] <==> [  25 : +/-  42 : 12 ]
[-1 :  1 : 1] <==> [  13 :       0 : 12 ]
dhermes commented 2 years ago

For the purposes of the post, I need to re-do the v^2 = f(u) stuff with a transformation from the same family used for 2v^2 = f(u) and 3v^2 = f(u):

v^2 = f(u)

u = (9 / 4) (x + 1) / (3x - 25)
v = 63y / (3x - 25)^2

q+ = [(1 - p)(3 - 4p) + v] / [2(3 - 4p)]
q- = [(1 - p)(3 - 4p) - v] / [2(3 - 4p)]

y^2 = x^3 + (215 / 3) x - 10582 / 27
    = [x - 13 / 3] [(6x + 13)^2 + 3087] / 36

u = (9 / 4) (x + 1) / (3x - 25)
v = 63y / (3x - 25)^2

p = 18(x + 1) / [8(3x - 25)]
q+ = (3x - 109 - 3y) / [8(3x - 25)]
q- = (3x - 109 + 3y) / [8(3x - 25)]

x = (100p + 9) / [3(4p - 3)]
y = +/- 336(p + 2q - 1) / [3(4p - 3)]

As we saw above the points [ X : Y : Z ] are:

   [   X :    Y : Z ] <==> [  P :       Q : R ]
-------------------------
P0 [   0 :    1 : 0 ] <==> [  0 :       1 : 0 ]
P1 [ 109 :  672 : 3 ] <==> [  1 : 1 OR -1 : 1 ]
P2 [  25 :   84 : 3 ] <==> [  1 : 0 OR -1 : 0 ]
P3 [  13 :    0 : 3 ] <==> [ -1 :       1 : 1 ]
P4 [  25 :  -84 : 3 ] <==> [  1 : 0 OR -1 : 0 ]
P5 [ 109 : -672 : 3 ] <==> [  1 : 1 OR -1 : 1 ]

and running it in the other direction passes sanity check:

[ P :  Q : R] <==> [   X :       Y : Z ]
------------------------------------------
[ 0 :  1 : 0] <==> [   0 :       1 : 0 ]
[ 1 : -1 : 1] <==> [ 109 : +/- 672 : 3 ]
[ 1 :  1 : 1] <==> [ 109 : +/- 672 : 3 ]
[ 1 : -1 : 0] <==> [  25 :  +/- 84 : 3 ]
[ 1 :  0 : 0] <==> [  25 :  +/- 84 : 3 ]
[-1 :  1 : 1] <==> [  13 :       0 : 3 ]
dhermes commented 2 years ago

https://blog.bossylobster.com/2021/10/elementary-elliptic.html