This worksheet introduces you to some basic things you can do with elliptic curves in SAGE. It includes several exercises, for which you might want to open a new worksheet to experiment in with all kinds of functions. For those taking the class for credit, all these exercises are homework.
Some rules regarding the homework:
Help about sage in general is available through http://www.sagemath.org/ and in particular the tutorial at http://www.sagemath.org/doc/tutorial/ is very useful for beginners. Information about elliptic curves in particular is on http://www.sagemath.org/doc/reference/plane_curves.html.
Construction of elliptic curves and points (exercise 1)
Number of points of the reduction and torsion (exercise 2,3,4,5)
Bad reduction (exercise 6,7,8,9)
The Frobenius endomorphism (exercise 10, 11, 13)
Mordell-Weil groups (exercise 14,15,16)
Period lattices (exercise 17,18)
Porism of Diophantos (exercise 19)
Modularity (exercise 20)
Heights (exercise 21)
One way to specify an elliptic curve is by a pair $[a,b]$ of coefficients in the Weierstrass equation $y^2 = x^3 + ax + b$.
{{{id=17| a = -43 b = 166 E1 = EllipticCurve([a,b]) E1 /// }}} Verify the discriminant of $E_1$ equals a multiple of $4a^3+27b^2$. {{{id=16| D1 = E1.discriminant() D1 == -16*(4*a^3+27*b^2) /// }}}Recall that <tab> after 'E1.' shows everything you can do with $E_1$.
{{{id=51| E1. /// }}} A point is defined by just coercing a list of two affine or three homogeneous coordinates into $E_1$. {{{id=62| P = E1([3,8]) P /// }}}Exercise 1: Compute $nP$ for all integers $n$.
Answer:
{{{id=61| /// }}}With E.Np(r) we get the number of points on the reduction of E to the finite field of $r$ elements, where $r$ is prime (including the singular point, if it exists).
Exercise 2: Create a list of the number of $\mathbb{F}_p$-points on the reduction of $E_1$ modulo $p$ for all primes $p$ of good reduction under $100$.
Answer:
{{{id=63| /// }}}Exercise 3: What is the greatest common divisor of those numbers and what does this say about the torsion subgroup of $E_1(\mathbb{Q})$?
Exercise 4: Find a function that computes the size of the torsion group so that you can verify the answer to your last statement directly.
Note that you can also define an elliptic curve by its Weierstrass equation after declaring $x$ and $y$ as variables.
{{{id=101| x,y = var('x,y') C = EllipticCurve(y^2 + y == x^3 + x) C /// }}}Exercise 5: Compute the torsion subgroup of the elliptic curve given by $y^2 + xy - 5y = x^3 - 5x^2$.
Answer:
{{{id=60| /// }}}We can also define an elliptic curve $E_2$ by specifying the coefficients $a_1,a_2,a_3,a_4,a_6$ of a long Weierstrass equation.
{{{id=1| a1=0 a2=0 a3=1 a4=9 a6=0 E2=EllipticCurve(QQ,[a1,a2,a3,a4,a6]) E2 /// }}}Exercise 6: Compute the discriminant of $E_2$ and factorize it.
Answer:
{{{id=5| /// }}}From the (correct) answer to the previous exercise, we see that the only primes of bad reduction are $3$, $7$, $13$, and $19$.
Exercise 7: Compute for each prime of bad reduction of $E_2$ the number of points on the reduction.
Answer:
{{{id=6| /// }}}Fact: the nonsingular points on a singular curve given by a Weierstrass equation over a field $k$, at least in characteristic not equal to 2, are in bijection with the elements of one of three groups, namely $k$ (additive, when the singular point is a cusp), or $k^*$ (split multiplicative, for a node with tangents defined over $k$), or the kernel of the norm from $l^*$ to $k^*$ where $l$ is a quadratic field extension of $k$ (nonsplit multiplicative, for a node whose tangents are defined over $l$).
Exercise 8: Use the number of points counted above to read off the types of singular reduction (additive, split multiplicative or nonsplit multiplicative) of $E_2$ at its primes of bad reduction.
Answer: (just text, so no sage-commands)
{{{id=102| /// }}}Exercise 9: Check that the following gives a result that is consistent with your previous answer.
{{{id=103| [(p,E2.local_data(p).bad_reduction_type()) for p in range(50) if p in Primes()] /// }}}Answer: (just explain with text, so no sage-commands)
{{{id=82| /// }}}Exercise 10: Use the number of points of $E_2$ over the field of 5 elements to show that in $\mathrm{End}(E_2)$, we have $\mathrm{Frob} = [-1] + [2] i$ for some square root $i$ of $[-1]$.
Answer: (just text, no Sage)
Exercise 11: Use the result of Exercise 10 to compute the number of points on $E_2$ over the field of $5^n$ elements for $n$ from $1$ to $20$ and check that your answer agrees with the list computed above.
Answer:
{{{id=132| /// }}}Exercise 12 was removed :-) There is no exercise 12 in the 2015 version.
Exercise 13: For $p =23$, is there for every $N$ in the Hasse-Weil interval $$[ p+1-2\sqrt{p}, p+1+2\sqrt{p} ]$$ an elliptic curve $C$ over $\mathbb{F}_p$ with $\#C(\mathbb{F}_p) = N$ ?
Answer:
{{{id=45| /// }}}Exercise 14: Compute the rank of the elliptic curves given by
$$y^2 = x(x-3)(x+4)$$ $$y^2 = x(x-1)(x+3)$$ $$y^2 = x(x+1)(x-14)$$ $$y^2 = x(x^2+1)$$
Answer:
{{{id=69| /// }}}Exercise 15: Compute the rank of the curve $y^2 = x^3 + a$ for $a \in \{1,...,100\}$. Also compare how long this takes for $a=11$ to how long it takes for $a=10000001$.
Answer:
{{{id=70| /// }}}Exercise 16: What is the smallest integer $a>0$ for which the rank of the Mordell-Weil group of the curve $y^2 = x^3+a$ is at least 3?
Answer:
{{{id=110| /// }}}Exercise 17: Find the period lattice of $E_1$ (a lattice $L$ in the complex numbers $\mathbb{C}$, such that $\mathbb{C}/L$ is isomorphic to $E_1$) and a basis for it. If one scaled the lattice so that one of the basis vectors becomes $1$, then what do you notice about the real part of the other basis vector after scaling? Try the same with some other elliptic curves that are defined over the real numbers. How are the real parts related to the number of components of the elliptic curve over the reals?
Answer:
{{{id=52| /// }}}The elliptic curve given by $y^2 = x^3 + 5$ has complex multiplication: there is an automorphism that multiplies the $x$-coordinate by a cube root of unity. This implies that after scaling, the period lattice is contained in an imaginary quadratic field.
Exercise 18: Use the function algebraic_dependency to find generators of the scaled lattice that are contained in an imaginary quadratic field.
Answer:
{{{id=57| /// }}}Diophantos shows that if a postive rational number $d$ is the difference of two rational positive cubes, then it is also the sum of two rational positive cubes. For instance, since $7 = 2^3 - 1^3$, there should also be positive rational numbers $x$ and $y$ with $x^3 + y^3 = 7$. Indeed, one has $(\tfrac{4}{3})^3+(\tfrac{5}{3})^3=7$.
We consider the projective curve given by $x^3 + y^3 = dz^3$ with the point $[1:-1:0]$ and make a substitution to obtain a Weierstrass model of the elliptic curve.
{{{id=97| P2.Feel free to plot the curves, but please delete the plots before printing or making a pdf (to save paper).
{{{id=117| plot(C) /// }}} We can check that the transformation does indeed map $E$ to $C$ by doing a substitution. {{{id=46| f=C.defining_polynomial() g=E.defining_polynomial() 64*27*d^2*f(transformation); g; /// }}}Exercise 19: Find positive rational $x,y$, other than $\{x,y\} = \{\tfrac{4}{3},\tfrac{5}{3}\}$ with $x^3 + y^3 = 7$.
Exercise 20 For any prime $p$, let $N_p$ denote the number of points on the elliptic curve given by $y^2 = x^3-4x^2+16$ over $\mathbb{F}_p$ (at least when this is nonsingular). Let $M_n$ denote the coefficient of $q^n$ in the formal power series expansion of the infinite product $$q\prod_{n\geq 1} (1-q^n)^2(1-q^{11n})^2.$$ Compute $M_p+N_p$ for all primes $p$ up to $100$. Conjecture what $M_p+N_p$ equals for general primes $p$.
Here are some examples of how to work with power series:
{{{id=120| R.= QQ[[]] q + O(q^101) (q^3 + q^10 + O(q^15)).list() /// }}}
Answer:
{{{id=124| /// }}}
Back to topHeights
Given a Weierstrass model of an elliptic curve $C$ over $\mathbb{Q}$, we define the naive logarithmic height of a rational point $P \in C(\mathbb{Q})$ by $$ h_{\rm n}(P) = \log \left( \max (|d|,|n|)\right), $$ with $d,n \in \mathbb{Z}$ such that $\gcd(d,n)=1$ and $x(P) = \tfrac{d}{n}$.
Exercise 21: Take your favorite elliptic curve in short Weierstrass form with a point $P$ of infinite order. For $m \in \{1,\ldots,100\}$, compute the square root of $h_{\rm n}(mP)$. How do the values seem to grow asymptotically?
Answer:
{{{id=93| /// }}}
Back to top {{{id=106| /// }}}