In Sage, an elliptic curve is always specified by (the coefficient of) a long Weierstrass equation
\[y^2 + a_1 xy + a_3 y = x^3 + a_2 x^2 + a_4 x + a_6.\]
So
EllipticCurve([a,b,c,d,e])
will yield
\[y^2 + a xy + c y = x^3 + b x^2 + d x + e.\]
E = EllipticCurve([1,2,3,4,5])
E
E = EllipticCurve([-2,2])
E
F = EllipticCurve([-2,1.1])
F
plot(E, xmax=5, ymin=-5, ymax=5, figsize=6, thickness=4) + plot(F, color='aqua', thickness=4)
For this curve, the number of rational solutions over \(\mathbb Z/ {p \mathbb Z}\) where the prime is \(5\) is \(9.\)
# The number of integer solutions modulus 5 is:
E.Np(5)
Emod5 = EllipticCurve(Zmod(5), [1,2,3,4,5])
Emod5.points()
From the Cremona index:
plot(EllipticCurve('37b2'))
E = EllipticCurve([2,5])
print(E)
Emod5 = EllipticCurve(Zmod(5), [2,5])
Emod5.points()
So we have the point \((0,0)\) as a solution because \(0^2\equiv_{(\text{mod} 5)} 0^3 + 2\times 0 +5.\) There are no other integer solutions.
The second point \((0:1:0)\) is just infinite.
Algebraically, this can be understood as homogeneous coordinates, in which initially there is a change of variables as to translate the \(x-y\) Cartesian plane where the curve is plotted to a plane translated \(1\) unit up along a newly introduced \(z\) axis so that the range of points on the plane are connected to the origin as a projection of a cone of lines emanating from the origin or “pencil of lines.” This is projective geometry.
This is explained in this lecture by Bill Shillito and in this video by NJ Wildberger.
After this transformation, if we imagine the points on any of these lines to be \([X, Y ,Z],\) the points of the curve on the translated plane would be \([\frac X Z, \frac Y Z, 1]\), which corresponds to scaling any of the lines connecting the origin to the points (\([X,Y,Z]\)) by \(Z\). This is called the projective plane \(\left(\mathbb P^2\right)\) and forms and equivalence relation where \((1,1,1)\equiv (2,2,2)\).
Notice the upper case of the new variables \(X, Y.\)
Plugging these back into the initial equation of an elliptic curve \(y^2 =x^3 - 2x +2\) would result in \(\left(\frac Y Z \right)^2 = \left(\frac X Z \right)^3 - 2 \left(\frac X Z \right) + 2.\)
To convert into the homogeneous expression, all the terms should be of the same degree, which is achieved by getting rid of the denominators as in \(( Y^2 Z) = (X)^3 - 2(X Z^2) + 2X^3\).
What is the advantage of homogeneous coordinates? The allow interpreting the points at infinity more readily:The points at infinity are not in the new plane at \(Z=1\), rather, \(Z=0.\)
Therefore we end up with \(Y^2 \, 0 = X^3.\) This means that \(X\) has to be zero, and \(Y\) can take any value. Hence \((0:1:0),\) as above. This is explained in here.
There are explanations about mapping the infinity plane to a sphere to visualize the point at infinity as in here, or here or here.
Imaging the curve on a unit sphere allows imagining the point at infinity as the North Pole, and the original plot as in here:
The equations for a unit sphere centered at \((0,0)\) are:
\[ \begin{align} \left(\frac{2x}{x^2 + y^2 + 1}, \frac{2y}{x^2 + y^2 + 1}, \frac{-1 + x^2 + y^2}{x^2 + y^2 + 1} \right) \end{align}\]
as in here.
It turns out that elliptic curves have a group structure with the addition operation defined as:
If P and Q are two points on the curve, then we can uniquely describe a third point P + Q in the following way. First, draw the line that intersects P and Q. This will generally intersect the cubic at a third point, R. We then take P + Q to be −R, the point opposite R.
Why reflect across the \(x\)-axis? So that the point at infinity \(\mathcal O\) is the identity element. Without reflection, \(\mathcal O + P = –P\) instead of \(\mathcal O + P = P.\)
The following visualization makes operations on points across the \(x\) axis understandable:
It is clear therefore, why \(P + Q + P = \mathcal O.\)