Jacobians over Number Fields or Q

Some functions in this section work for general number fields (notably TwoSelmerGroup), while many are only implemented over Q.

Contents

Searching For Points

Points(J) : JacHyp -> SetIndx
RationalPoints(J) : JacHyp -> SetIndx
    Bound: RngInt                       Default: 0
Given a Jacobian J of a genus 2 hyperelliptic curve defined by an integral model over the rationals, determine all rational points on the Jacobian J whose naive height on the associated Kummer surface is less than or equal to Bound.

Torsion

TwoTorsionSubgroup(J) : JacHyp -> GrpAb, Map
Given the Jacobian J of a hyperelliptic curve C which is either of genus 2 or has odd degree defined over a number field K, the function returns J(K)[2] as an abstract group, together with a map sending elements of the abstract group to points on J. The curve C must be given in the simplified form y2=f(x).

TorsionBound(J, n) : JacHyp, RngIntElt -> RngIntElt
Given the Jacobian J of a hyperelliptic curve defined over the rationals or an algebraic number field, this function returns a bound on the size of the rational torsion subgroup of the Jacobian. The bound is obtained by examining the group J(Fp) for the first n good primes or prime ideals p.
TorsionSubgroup(J) : JacHyp -> GrpAb, Map
Given the Jacobian J of a genus 2 curve defined over the rationals, this function returns the rational torsion subgroup of J, and the map from the group into J. The curve must have the form y2 = f(x) with integral coefficients.

Example CrvHyp_TorsionGroups (H134E24)

For the curve C : y2= (x + 3)(x + 2)(x + 1)x(x - 1)(x - 2), the only Q-rational torsion on the Jacobian is 2-torsion.
> _<x> := PolynomialRing(Rationals());
> C := HyperellipticCurve(&*[x-n : n in [-3..2]]);
> J := Jacobian(C);
> T, m := TwoTorsionSubgroup(J);
> T;
Abelian Group isomorphic to Z/2 + Z/2 + Z/2 + Z/2
Defined on 4 generators
Relations:
    2*P[1] = 0
    2*P[2] = 0
    2*P[3] = 0
    2*P[4] = 0
> [ m(T.i) : i in [1..4] ];
[ (x^2 - 3*x + 2, 0, 2), (x^2 - 2*x, 0, 2), (x^2 - x - 2, 0, 2),
(x^2 - 4, 0, 2) ]
> #T eq #TorsionSubgroup(J);
true
The Jacobian for the following curve has torsion subgroup Z/24 over Q.
> C := HyperellipticCurve((2*x^2-2*x-1)*(2*x^4-10*x^3+7*x^2+4*x-4));
> J := Jacobian(C);
> T, m := TwoTorsionSubgroup(J);
> T;
Abelian Group isomorphic to Z/2
Defined on 1 generator
Relations:
    2*P[1] = 0
> m(T.1);
(x^2 - x - 1/2, 0, 2)
> A,h := TorsionSubgroup(J);
> #T eq #A;
false
> A;
Abelian Group isomorphic to Z/24
Defined on 1 generator
Relations:
    24*P[1] = 0
> P := h(A.1);
> P;
(x^2 - 1/2, -1, 2)
> Order(P);
24
> 12 * P eq m(T.1);
true

Heights and Regulator

This section pertains to height functions on the Mordell--Weil group of the Jacobian of hyperelliptic curves over a number field k. However, naive heights and height constants are currently only implemented for Jacobians of genus 2 curves defined over Q.

In the case of genus two curves defined over Q, the canonical height is computed using the algorithm of Müller and Stoll [MS16]. This algorithm computes the canonical height using local error functions on the associated Kummer surface. It avoids factorization, which makes it more efficient than previously used algorithms.

In all other cases the algorithm described in chapter 5 of [Mül10a] is used. It is based on a theorem due to Faltings and Hriljac which expresses the canonical height pairing in terms of Arakelov intersection theory and works as follows:

We find divisors DP and DQ of degree zero on the curve representing P and Q, respectively. For this we use the canonical representative of P and Q (see Section Points on the Jacobian); if P=Q, then the canonical representatives for P and -P are used. Since the canonical representatives have common support at infinity, we subtract the divisor of a function x - λ from one of them. These ideas are due to David Holmes [Hol06]. If there are points at infinity in the positive support of P or Q, then we might have to also subtract the divisor of a function x - μ from the other representatives.

The actual Arakelov intersection computations are performed locally using regular models of the curve (see Section Regular Models of Arithmetic Surfaces) at the relevant primes and Groebner bases over p-adic quotient rings in the non-archimedean case. The algorithm requires factorisation of polynomials over non-archimedean local fields. For archimedean places the intersections multiplicities can be expressed using theta functions with respect to the analytic Jacobian. This relies heavily on several functions described in Section Analytic Jacobians of Hyperelliptic Curves.

If the genus is less than 4, the most expensive archimedean operations are usually applications of the Abel-Jacobi map ToAnalyticJacobian. In larger genus, the computation of theta functions, whose running time grows exponentially in the genus is more expensive.

Regarding the non-archimedean computations, the main bottleneck is integer factorisation which is required to find out which primes may yield non-trivial intersection multiplicities.

Applications: Heights are a useful tool for studying rational points on varieties. The most standard applications concerning points on Jacobians are

proving independence of points in J(k)/Jtors(k) (in particular, the regulator is defined in terms of the canonical height), and
proving non-divisibility: given P ∈J(k) and n ∈Z, proving that P is not of the form nR for some R ∈J(k).

The heights in this section are logarithmic, and they measure the size of the coordinates of the image of P on the Kummer variety associated to J (embedded in (P)2g - 1, where g is the genus of the curve). The naive height h is simply the height of the image of P in (P)2g - 1 using an explicit embedding, which is currently only available for g=2. One can refine this, taking advantage of the group law on J, defining a canonical height which has nice properties with respect to the group law, for instance hat(h)(nP) = n2 hat(h)(P). In particular, hat(h)(P) = 0 if and only if P is a torsion point. The function h - hat(h) is bounded on J(k). Computationally, one generally wants an upper bound on this, because then one can find all points up to a given canonical height by doing a search for points of bounded naive height.

NaiveHeight(P) : JacHypPt -> FldPrElt
NaiveHeight(P) : SrfKumPt -> FldPrElt
Given a point P on the Jacobian of a curve of genus 2 (or on the associated Kummer surface), the function returns the logarithmic height of the image of P in (P)3 under the maps J -> K -> (P)3.

Height(P: parameters) : JacHypPt -> FldReElt
Height(P: Precision) : SrfKumPt -> FldReElt
CanonicalHeight(P: parameters) : JacHypPt -> FldReElt
CanonicalHeight(P: Precision) : SrfKumPt -> FldReElt
    lambda: RngIntElt                   Default: 1
    mu: RngIntElt                       Default: 0
    LocalPrecision: RngIntElt           Default: 0
    UseArakelov: BoolElt                Default: false
    Precision: RngIntElt                Default: 0
The canonical height of a point P on the Jacobian of a hyperelliptic curve over a number field or over the rationals. If the genus is 2 and the ground field is Q, then this computes the canonical height on the associated Kummer surface. Otherwise this function simply computes the height pairing of P with itself using Arakelov intersection theory.
HeightConstant(J: parameters) : JacHyp -> FldPrElt, FldPrElt
    Factor: BoolElt                     Default: true
    Steps: RngIntElt                    Default: 10
    Modified: BoolElt                   Default: false
    Fast: BoolElt                       Default: false
    LocalPrecBound: RngIntElt           Default: 100
    Effort: RngIntElt                   Default: -1
If J is the Jacobian of a genus 2 curve defined over the rationals, of the form y2 = f(x) with integral coefficients, this computes a real number c such that hK(P) ≤hat(h)(P) + c for all P ∈J(Q), where hK is the naive logarithmic height obtained from the Kummer surface and hat(h) is the canonical height on J. The second value returned is a bound for |μ_∞|, the contribution from the infinite place.

If Factor is set, then the discriminant will be factored, and its prime divisors will be considered individually. This usually results in an improvement of the bound. If Fast is set, the cheap bound from [Sto99] is used (and Factor is ignored). If Modified is set, the modified naive height is used as in [MS16]. LocalPrecBound is an upper bound for the precision used in the local computations. Steps is a technical parameter that is used in the computation of the contribution of the infinite place to the bound. Effort is present for compatibility with previous versions. Effort = 0 has the effect of setting Fast to true, Effort ≥1 has the effect of setting Factor to true and Fast to false.

HeightPairing(P, Q: parameters) : JacHypPt, JacHypPt -> FldReElt
    lambda: RngIntElt                   Default: 1
    mu: RngIntElt                       Default: 0
    LocalPrecision: RngIntElt           Default: 0
    UseArakelov: BoolElt                Default: false
    Precision: RngIntElt                Default: 0
The value of the canonical height pairing for rational points P and Q on the Jacobian of a hyperelliptic curve defined over a number field. The pairing can be defined as < P, Q > := (hat(h)(P + Q) - hat(h)(P) - hat(h)(Q))/2 and if the genus is 2 and the ground field is Q, the pairing is computed using this definition. Otherwise the pairing is computed using Arakelov intersection theory.

Sometime these fail due to insufficient precision; if this happens, the parameter LocalPrecision should be changed accordingly.

Changing the parameters lambda and mu (see the introduction above) can sometimes speed up the computations because some of the required integer factorisations might be significantly easier for some values of λ and μ than for others. Note that the parameter mu is only used if it is nonzero.

The parameter UseArakelov indicates whether the algorithm based on Arakelov intersection theory should be used in genus 2.

HeightPairingMatrix(S: Precision) : [JacHypPt] -> AlgMat
    Precision: RngIntElt                Default: 0
    UseArakelov: BoolElt                Default: false
Given a sequence [P1, ... Pn] of points on the Jacobian J of a hyperelliptic curve defined over a number field, this function returns the matrix with entries < Pi, Pj >, where the latter denotes the canonical height pairing between Pi and Pj.

Regulator(S: Precision) : [JacHypPt] -> FldReElt
    Precision: RngIntElt                Default: 0
    UseArakelov: BoolElt                Default: false
Given a sequence S of points on the Jacobian J of a hyperelliptic curve defined over a number field k, the function returns the determinant of the height pairing matrix of S. The regulator is equal to zero when the points are dependent in the Mordell--Weil group, and otherwise is equal to the square of the volume of the parallelotope spanned by the points in the subgroup of the free quotient of J(k) generated by S.

ReducedBasis(S: Precision) : [JacHypPt] -> SeqEnum, AlgMatElt, SeqEnum
ReducedBasis(S: Precision) : @JacHypPt@ -> SeqEnum, AlgMatElt, SeqEnum
ReducedBasis(S: Precision) : JacHypPt -> SeqEnum, AlgMatElt, SeqEnum
    Precision: RngIntElt                Default: 0
    Rels: BoolElt                       Default: false
    SetVerbose("ReducedBasis", n):      Maximum: 3
Given a sequence, indexed set or set S of points on a genus 2 Jacobian, compute an LLL-reduced basis (with respect to the height pairing) of the subgroup generated by the points modulo torsion. The second return value is the height pairing matrix of the basis, computed with the given Precision (default precision when Precision = 0.) If Rels is set to true (and S is not a set), the third return value is a sequence of sequences of integers such that the corresponding input point differs from the specified linear combination of the basis by a torsion point.

Example CrvHyp_HeightPairing (H134E25)

This example illustrates some basic properties of heights, and proves that a certain point in J(Q) is not a nontrivial multiple of any other point in J(Q).

Let J be the Jacobian of y2 = x6 + x2 + 2.

> P<x> := PolynomialRing(Rationals());
> C := HyperellipticCurve(x^6+x^2+2);
> J := Jacobian(C);
Find some small points on C and map them to J:
> ptsC := Points(C : Bound:=1000);
> ptsJ := [ ptsC[i] - ptsC[1] : i in [2,3,4,5,6] ];
> ptsJ;
[ (1, x^3, 2), (x + 1, x^3 - 1, 2), (x + 1, x^3 + 3, 2), (x - 1, x^3 - 3, 2),
(x - 1, x^3 + 1, 2) ]
The canonical heights of these five points:
> [ Height(P) : P in ptsJ ];
[ 0.4798397974504051520232795424905, 0.0000000000000000000000000000000,
0.4798397974504051520232795424906, 0.4798397974504051520232795424906,
0.0000000000000000000000000000000 ]

We see that two of them are torsion (hat(h) = 0), and the others are probably equal or inverse to each other modulo torsion, because they appear to have the same canonical height. If so, they would generate a subgroup of rank 1 in J(Q)/Jtors(Q). The next command verifies this.

> ReducedBasis(ptsJ);
[ (1, x^3, 2) ]
[0.4798397974504051520232795424905]
> P := ptsJ[1];
> P;
(1, x^3, 2)

So this point (which is the first point in our list) generates the others. We proceed to check that the other two non-torsion points in our list are equal to P + T or -P + T for some torsion point T.

> Jtors, maptoJ := TorsionSubgroup(J);
> {ptsJ[3], ptsJ[4]} subset { pt + maptoJ(T) : pt in {P,-P}, T in Jtors };
true

Now we check the property hat(h)(nP) = n2 hat(h)(P) for n=23.

> Height(23*P)/Height(P);
529.0000000000000000000000000001
Of course, the naive height does not behave so nicely, but at least h - hat(h) should be bounded by the height constant.
> HC := HeightConstant(J : Effort:=2);
> HC;
4.26361103592976273994756234607
In particular, all torsion points should have naive height less than this.
> for T in Jtors do
>     NaiveHeight(maptoJ(T));
> end for;
0.000000000000000000000000000000
0.693147180559945309417232121458
0.693147180559945309417232121458
0.693147180559945309417232121458
0.693147180559945309417232121458
0.693147180559945309417232121458
0.693147180559945309417232121458
0.693147180559945309417232121458
> // Does the inequality hold for 23*P?
> NaiveHeight(23*P) - Height(23*P) le HeightConstant(J);
true
Finally, we show that P is not a nontrivial multiple of another point in J(Q)/Jtors(Q) (implying that P generates J(Q)/Jtors(Q) if this has rank 1). For suppose that P = n Q + T for some Q ∈J(Q), T ∈Jtors(Q). Then hat(h)(Q) = (1/n2) hat(h)(P) < hat(h)(P), and the following search shows there is no Q satisfying this bound.
> LogarithmicBound := Height(P) + HeightConstant(J);  // Bound on the naive h(Q)
> AbsoluteBound := Ceiling(Exp(LogarithmicBound));
> PtsUpToAbsBound := Points(J : Bound:=AbsoluteBound );
> ReducedBasis( [ pt : pt in PtsUpToAbsBound ]);
[ (1, x^3, 2) ]
[0.4798397974504051520232795424905]
If Q exists, it would have to be in the set PtsUpToAbsBound. But the results of the final command indicate that the group generated by PtsUpToAbsBound is also generated by a single point of canonical height 0.479839797450405152023279542491, so there are no nontorsion points Q in PtsUpToAbsBound with hat(h)(Q) < hat(h)(P).

This example is continued in Example H134E35, where we prove that J(Q) has rank 1, and then use the fact that P generates J(Q)/Jtors(Q) to find all rational points on C.

Example CrvHyp_HeightPairing2 (H134E26)

We compute a reduced basis for a set of points on the Jacobian J on the genus two curve C: y2 = x6 + x2 + 1.
> P<x> := PolynomialRing(Rationals());
> C := HyperellipticCurve(x^6+x^2+1);
> J := Jacobian(C);

We construct some points on C:

> Z := PointsAtInfinity(C);
> Z;
{@ (1 : -1 : 0), (1 : 1 : 0) @}
> P1 := Z[1];
> P2 := Z[2];
> P3 := C![1/2,9/8,1];
> P4 := C![-1/2,9/8,1];

We now map them to J (for example Q1 is the divisor P1 - P2):

> Q1 := J![P1, P2];
> Q2 := J![P1, P3];
> Q3 := J![P3, P4];
> B, M := ReducedBasis([Q1, Q2, Q3] : Precision := 12);
> B;  // This will be a basis for <Q1, Q2, Q3>
[ (1, -x^3, 2), (x^2, 1, 2) ]
> M;  // The height pairing matrix for the new basis B
[0.2797317933687 5.684341886081E-14]
[5.684341886081E-14 0.9524462128097]
> Determinant(M);
0.2664294871964
Since (Det)(M) is nonzero, the two generators in B are independent.

Saturation

IsDivisibleBy(P, n) : JacHypPt, RngIntElt -> BoolElt, JacHypPt
For a Q-rational point P on the Jacobian of a curve over Q, this returns whether P is divisible by n, i.e., whether there exists a Q-rational point Q such that n Q = P. If so, the point Q is also returned.
Saturation(bas, p) : [ JacHypPt ] , RngIntElt -> [ JacHypPt ]
For a sequence of Q-rational points on a Jacobian J, this finds the p-saturation in J(Q) of the group generated by the points, i.e., the smallest group containing the points and closed in J(Q) under division by p. The function returns a sequence of generators for the saturated group modulo its torsion subgroup.

The 2-Selmer Group

The principal functions in this section provide information about the Mordell-Weil group J(K) of a hyperelliptic Jacobian defined over the rationals or a number field. Two descent provides an upper bound (since J(K)/(2J(K)) embeds in the 2-Selmer group of J). Finer information is provided by HasSquareSha, which determines the parity of the 2-rank of the Shafarevich--Tate group, and RankBounds collects together all the information that is computable in Magma.

In Magma 2.13, a simpler interface was introduced for computing 2-Selmer groups. The two implementations that were previously accessible still exist internally. A third has been added since. When TwoSelmerGroup is called, it chooses which implementation to use, unless the user specifies this by setting parameter.

BadPrimes(C) : CrvHyp -> SeqEnum
BadPrimes(J) : JacHyp -> SeqEnum
    Badness: RngIntElt                  Default: 1
Given a hyperelliptic curve C with integral coefficients defined over a number field (or the Jacobian of such a curve), the function returns a sequence containing the primes where the given model has bad reduction.

HasSquareSha(J) : JacHyp -> BoolElt
IsEven(J) : JacHyp -> BoolElt
Given the Jacobian of a hyperelliptic curve over Q or a number field, and assuming that the Shafarevich-Tate group of J is finite, this returns true if and only if the order of the Shafarevich-Tate group is a square. (Otherwise, the order is twice a square, as shown by Poonen and Stoll in [PS99]). The order is square if and only if the number of "deficient" primes for C is even (see below).
IsDeficient(C, p) : CrvHyp, RngIntElt -> BoolElt
For a genus 2 curve defined over Q or a number field, this returns true if C is "deficient" at p. By definition, the curve is deficient if there are no points on C defined over any extension of odd degree over Qp (when p is a prime) or over R (when p is 0). Equivalently, C is deficient if there is no Qp-rational divisor of odd degree on C.
HasIndexOne(C,p) : CrvHyp, RngIntElt -> BoolElt
HasIndexOne(C,p) : CrvHyp, RngOrdIdl -> BoolElt
Given a hyperelliptic curve C over Q or a number field, this returns true if and only if there is a divisor of odd degree on C which is defined over the completion at the prime p. An even genus curve is deficient at p if and only if it does not have index one at p.
HasIndexOneEverywhereLocally(C) : CrvHyp -> BoolElt
Returns true if and only if C has index one over all completions of its base field (including real completions).
TwoSelmerGroup(J) : JacHyp -> GrpAb, Map, Any, Any
    Al: MonStgElt                       Default: 
    Fields: SetEnum                     Default: 
    ReturnFakeSelmerData: BoolElt       Default: false
    ReturnRawData: BoolElt              Default: false
    SetVerbose("Selmer", n):            Maximum: 3
The 2-Selmer group of the Jacobian of a hyperelliptic curve defined over Q or a number field. If the curve is not defined over Q then it must have a single rational point at infinity (for curves in the simplified form y2=f(x), this is equivalent to f(x) having odd degree), The algorithm may work better when an integral model of the curve is given (or better yet, a minimal model).

The Selmer group is returned as a finite abelian group S, together with a map from S to some affine algebra A, which represents the standard map from the Selmer group to A * /(A * )2 or to A * /(A * )2Q * (depending whether the degree of f is odd or even).

Three separate implementations exist internally in Magma. (Prior to V2.13 two of these were available as the intrinsics TwoSelmerGroup and TwoSelmerGroupData). The user can specify which implementation is used by setting the optional parameter Al to "TwoSelmerGroupOld", "TwoSelmerGroupNew" or to "TwoSelmerGroupData"; otherwise, an appropriate choice is made automatically.

Much of the computation time is usually spent on class group and unit calculations. These computations can be speeded up by using non-rigorous bounds, and there are two ways to control which bounds are used. The recommended way is to preset them using one of the intrinsics SetClassGroupBounds or SetClassGroupBoundMaps (see Setting the Class Group Bounds). The other way is to precompute the class groups of the fields involved (with the desired optional parameters in ClassGroup), and then pass these fields to TwoSelmerGroup via the optional parameter Fields. The class group data is stored, and if TwoSelmerGroup requires a field that is isomorphic to one of the given Fields, the stored data will automatically be used. The relevant fields are those given by the roots of f, where y2=f(x) is the SimplifiedModel of the curve.

When called with ReturnFakeSelmerData, the program returns an additional item, which specifies the "fake Selmer group" in the terminology of [Sto01]. (This is only relevant to the even degree case.) The returned object is a tuple < B1, B2, B3 >, where B1 is a sequence of elements in A that span a subgroup S1 of A * /(A * )2, and B2 and B3 are sequences of integers that span subgroups S2 and S3 of Q * /(Q * )2. The fake Selmer group S is then determined by the exact sequence 0 -> S3 -> S2 -> S1 -> S -> 0. See [Sto01] for a full explanation of this.

When called with ReturnRawData, the program additionally returns a third item expvecs and a fourth item factorbase. These specify the images in A * /(A * )2 of the Selmer group generators (in unexpanded form). The factorbase is a sequence of elements fj of A, and expvecs is a sequence of vectors in ZF, where F is the number of elements in the factorbase. The image in A * /(A * )2 of the ith Selmer group generator is then the sum over j of fjej where (ej) is the ith exponent vector.

RankBound(J) : JacHyp -> RngIntElt
RankBounds(J) : JacHyp -> RngIntElt, RngIntElt
An upper, or a lower and an upper bound, on the rank of the Mordell-Weil group of J, which should be the Jacobian of a hyperelliptic curve over the rationals or a number field. RankBound can be computed provided both TwoSelmerGroup and TwoTorsionSubgroup are implemented for J, while RankBounds is only implemented for Jacobians defined over Q.

For curves of even degree and odd genus it is not always possible to compute an upper bound for the rank. One can compute instead an upper bound for the rank of the subgroup of the Mordell-Weil group consisting of points which can be represented by rational divisors. When the curve has index one everywhere locally, every rational divisor class can be represented by a rational divisor. RankBound and RankBounds check if this condition is satisfied and throws an error when it does not hold.

An initial upper bound is furnished by computing the 2-Selmer group. For even degree hyperelliptic curves this can potentially be sharpened by determining if the torsor T parameterizing divisor classes of degree 1 on the curve represents a nontrivial element of Sha[2]. This can be achieved in two ways. If Sha does not have square order (see HasSquareSha) then T is nontrivial and the bound can be decreased by 1. If there are rational divisor classes of degree 1 everywhere locally, then T lies in Sha[2], and RankBounds will attempt to determine whether T is divisible by 2 in Sha using the algorithm described in [Cre12]. When T is not divisible by 2, the bound may be lowered by 2. Examples of both phenomena are given below.

The lower bound is computed by searching for points on the Jacobian, then determining their independence using either the height pairing machinery or by considering their images in J(Q)/2J(Q).

Example CrvHyp_2-selmer-group (H134E27)

In this example, we find out as much as we can about the Mordell-Weil group of the Jacobian of y2 = x(x + 13442)(x + 108152)(x + 54062)(x + 27002). First define the curve and its Jacobian:
> _<x> := PolynomialRing(Rationals());
> pol := x*(x+1344^2)*(x+10815^2)*(x+5406^2)*(x+2700^2);
> C := HyperellipticCurve( pol );
> J := Jacobian(C);
> J;
Jacobian of Hyperelliptic Curve defined by
y^2 = x^5 + 155285397*x^4 + 4761213301312596*x^3 + 33018689414366470785600*x^2
+ 45012299099933971943424000000*x over Rational Field

We can search for points on C (with x-coordinate up to Bound):

> ptsC := Points(C : Bound := 10^6);
> ptsC;
{@ (1 : 0 : 0), (0 : 0 : 1), (43264 : -44828581639628800 : 1),
(43264 : 44828581639628800 : 1) @}
> pointAtInfinity := ptsC[1];

This pointAtInfinity (1 : 0 : 0) might not seem to lie on C, but recall that in Magma, a hyperelliptic curve lives in a weighted projective plane. We can also search for points on the Jacobian, which takes longer:

> time ptsJ := Points(J : Bound := 2000);
Time: 0.670
> ptsJ;
{@ (1, 0, 0), (x, 0, 1) @}
The notation for points on J is explained in the section "Points on the Jacobian" in this chapter. The points appearing above are the trivial point on J, and the point corresponding to the divisor (0:0:1) - (1:0:0) on C.
> ptsJ[1] eq J!0;  // Is the first point equal to 0 on J?
true
> Order( ptsJ[2] );
2
So far, we have only found some trivial points on J. In fact, we can see from the equation that J has full 2-torsion, which we now confirm.
> Jtors, map := TorsionSubgroup(J);
> Jtors;
Abelian Group isomorphic to Z/2 + Z/2 + Z/2 + Z/4
Defined on 4 generators
Relations:
2*P[1] = 0
2*P[2] = 0
2*P[3] = 0
4*P[4] = 0
Jtors is an abstract group, and map converts elements of Jtors to actual points on J. Here are the generator of the Z/4 and its inverse.
> map(Jtors.4);
> map(3*Jtors.4);
(x^2 + 32963094*x - 212161021632000, 94792247622*x - 2005558137487296000, 2)
(x^2 + 32963094*x - 212161021632000, -94792247622*x + 2005558137487296000, 2)
Looking at the points on C we found above, the third of them looks nontrivial, so we find its order on J:
> P := ptsC[3];
> PJ := J![ P, pointAtInfinity ];
> PJ;
(x - 43264, -44828581639628800, 1)
> Order(PJ);
0
This means PJ has infinite order on J. Now we do two-descent on J:
> #TwoSelmerGroup(J);
64
We already knew that J(Q)[2] has order 16, and that the rank of J(Q) is at least 1, so we now know that the rank is either 1 or 2. We now ask whether the order of Sha(J) is a square or twice a square (assuming it is finite):
> HasSquareSha(J);
true
It follows (assuming Sha(J) is finite) that Sha(J) has square order, and that J(Q) has rank 2, even though the other generator of J(Q) is probably not easy to find, especially if does not come from a point on C.

For more examples of Selmer group computations, see the next section.

Example CrvHyp_nonsquare-sha (H134E28)

We produce some Jacobians for which the order of the Tate-Shafarevich group is twice a square (assuming it is finite). We then observe how this affects the rank bounds.

A good source of examples are curves y2 = 3(x6 - x2 + a) for a = 1 mod 3, since these curves are "deficient" at 3 (for the definition, see above); this can be proved by elementary arguments. We now list those (for a up to 50) which have nonsquare Sha.

> _<x> := PolynomialRing(Rationals());
> for a := 1 to 50 do
>    if a mod 3 eq 1 then
>       Ca :=  HyperellipticCurve( 3*(x^6-x^2+a) );
>       assert IsDeficient(Ca,3);
>          // (This causes a failure if our assertion is wrong.)
>       if not HasSquareSha(Jacobian(Ca)) then print Ca; end if;
>    end if;
> end for;
Hyperelliptic Curve defined by y^2 = 3*x^6 - 3*x^2 + 12 over Rational Field
Hyperelliptic Curve defined by y^2 = 3*x^6 - 3*x^2 + 21 over Rational Field
Hyperelliptic Curve defined by y^2 = 3*x^6 - 3*x^2 + 30 over Rational Field
Hyperelliptic Curve defined by y^2 = 3*x^6 - 3*x^2 + 48 over Rational Field
Hyperelliptic Curve defined by y^2 = 3*x^6 - 3*x^2 + 57 over Rational Field
Hyperelliptic Curve defined by y^2 = 3*x^6 - 3*x^2 + 66 over Rational Field
Hyperelliptic Curve defined by y^2 = 3*x^6 - 3*x^2 + 84 over Rational Field
Hyperelliptic Curve defined by y^2 = 3*x^6 - 3*x^2 + 93 over Rational Field
Hyperelliptic Curve defined by y^2 = 3*x^6 - 3*x^2 + 102 over Rational Field
Hyperelliptic Curve defined by y^2 = 3*x^6 - 3*x^2 + 129 over Rational Field
Hyperelliptic Curve defined by y^2 = 3*x^6 - 3*x^2 + 138 over Rational Field
Aside: we could have tried simply y2 = 3(x6 + a) for a = 1 mod 3, but this won't produce any examples: it's a cute exercise to show that for these curves, the number of deficient primes is always even.

Now consider the Mordell-Weil rank of the second curve listed (where a=7),

> C7 :=  HyperellipticCurve( 3*(x^6-x^2+7) );
> J := Jacobian(C7);
> #TwoTorsionSubgroup(J);
1
> #TwoSelmerGroup(J);
2
> RankBound(J);
0
There is no nontrivial 2-torsion in J(Q), and the Selmer group has order 2. The program has checked that the order of the Tate-Shafarevich group is twice a square (hence the 2-rank of Sha is exactly 1), and therefore it has returned a RankBound indicating that J(Q) has rank 0. This rank bound is unconditional. In fact, the computation proves that there is a subgroup Z/2 in Sha modulo the subgroup of infinitely divisible elements; therefore one may also deduce unconditionally that the 2-power part of Sha is finite cyclic (since if there was an infinitely 2-divisible part, it would still contribute to the 2-Selmer group).

Example CrvHyp_sha_visibility (H134E29)

We demonstrate a non-trivial Tate-Shafarevich group on the Jacobian of a genus 2 curve. We consider the following Jacobian.
> P<x>:=PolynomialRing(Rationals());
> C:=HyperellipticCurve(-x^6 + 2*x^5 + 3*x^4 + 2*x^3 - x - 3);
> JC:=Jacobian(C);
We determine an upper bound on its Mordell-Weil rank
> RankBound(JC);
3
But we can only find one independent rational point on this Jacobian.
> V:=RationalPoints(JC,x^2 + 83/149*x + 313/596,2);
> B:=ReducedBasis(V);
> #B;
1
We test if there is a quadratic twist of our curve that does have high Mordell-Weil rank.
> d:=-1;
> Cd:=QuadraticTwist(C,d);
> JCd:=Jacobian(Cd);
> Vd:=RationalPoints(JCd:Bound:=100);
> Bd:=ReducedBasis(Vd);
> #Bd;
4
This shows that the Mordell-Weil rank of (Jac)(Cd)(Q) is at least four.

Note that (rank )(Jac)(C)(Q(Sqrt(d))) = (rank )(Jac)(C)(Q) + (rank )(Jac)(Cd)(Q), so if we can find an upper bound on the Mordell-Weil rank of (Jac)(C) over Q(Sqrt(d)) then we also find an upper bound on (rank )(Jac)(Cd)(Q). We first try this with unproven class group data.

> SetClassGroupBounds("GRH");
> K:=QuadraticField(d);
> CK:=BaseChange(C,K);
> JCK:=Jacobian(CK);
> NumberOfGenerators(TwoSelmerGroup(JCK));
5
We find that (rank)(Jac)(C)(Q(Sqrt(d)))≤5, which means that (Jac)(C) must indeed have Mordell-Weil rank 1 over Q. To make the class group computation unconditional, we must check up to the Minkowski bound for each of the number fields utilized in the computation
> Aa:=AbsoluteAlgebra(JCK`Algebra);
> L:=Aa[1];
> MinkowskiBound(L);
3763009
The command FactorBasisVerify(IntegerRing(L),1000,MinkowskiBound(L)) would perform the required check, but will take considerable time to complete.

Example CrvHyp_BetterRankBounds (H134E30)

In this example we compute the Mordell-Weil rank of a genus 3 hyperelliptic Jacobian J with nontrivial 2-torsion in Sha using a different method. Namely we perform a 2-descent on the torsor parameterizing divisor classes of degree one on the curve as described in [Cre12].
> f := Polynomial([Rationals()| 30, 10, 30, 20, 10, 10, 10, 30, 10 ]);
> f;
10*x^8 + 30*x^7 + 10*x^6 + 10*x^5 + 10*x^4 + 20*x^3 + 30*x^2 + 10*x + 30
> X := HyperellipticCurve(f);
> J := Jacobian(X);
> SetClassGroupBounds("GRH");
> S := TwoSelmerGroup(J);
> #S;
4
> TorsionBound(J,5);
1
Here the 2-Selmer rank is 2 and there is no nontrivial 2-torsion. So the 2-descent on J gives an upper bound of 2 for the Mordell-Weil rank. However, one can do better.
> J`TwoSelmerSet;
Calling TwoSelmerGroup also computes the 2-Selmer set of the torsor T parameterizing rational divisor classes of degree 1 (because C is everywhere locally solvable, the parameter Al := "TwoSelmerGroupNew" was used). This extra information allows us to deduce a better bound for the rank.
> RankBounds(J);
0 0
In this example the 2-Selmer set is empty, which implies that T is not divisible by 2 in Sha. Consequently Sha[2] has rank at least 2 (because of well known properties of the Cassels-Tate pairing). The theory behind these computations is described in [Cre12].

Example CrvHyp_DisregardTheWarning (H134E31)

For hyperelliptic curves of even degree and odd genus it is not always possible to obtain an upper bound for the Mordell-Weil rank. When the curve does not have index one everywhere locally, it may not be the case that every rational divisor class can be represented by a rational divisor.

Here we provide an example of an even degree odd genus curve which does not have index one everywhere locally, but for which we can still compute an upper bound for the Mordell-Weil rank. The use of SetClassGroupBounds speeds up the computation, but is not necessary.

> f := Polynomial([Rationals()|-9, 8, 8, 1, -8, -8, -7, -2, -7 ]);
> C := HyperellipticCurve(f);
> Genus(C);
3
> Degree(C);
8
> J := Jacobian(C);
> SetClassGroupBounds("GRH");
> RankBound(J);
Runtime error: Upper bound is not obtainable.
Upper bound for the rank of Pic^0(X)/2*Pic^0(X) is 2.
The error occurs because C does not have index one everywhere locally. In fact it is easy to see C has no real points. So over the reals it has no rational divisors of odd degree. However C has points locally at all nonarchimedean primes. This means C fails to have index 1 at exactly one prime. The obstruction to a rational divisor class being represented by a rational divisor is an element of the Brauer group. It follows from reciprocity in the Brauer group that every Q-rational divisor class is represented by a Q-rational divisor. In particular Pic0(C) =J(Q). So we can disregard the warning.
> HasIndexOneEverywhereLocally(C);
false 0
> Roots(f,RealField(50));
[]
> Evaluate(f,0) lt 0;
true
> &and[ HasIndexOne(C,p) : p in BadPrimes(C) ];
true

The Mordell-Weil Group

The Mordell-Weil group of a Jacobian over Q is the group J(Q) of rational points on J. The theorem of (Mordell-)Weil states that this group is a finitely generated abelian group. Magma contains functionality that attempts to determine this group when J is the Jacobian of a curve C of genus 2.

A variety of approaches are used for this.

The computation of the 2-Selmer group of J (see TwoSelmerGroup) and the 2-Selmer set of Pic1 of C to obtain an upper bound on the rank of J(Q). See also RankBound.

The computation of the torsion subgroup of J(Q) (see TorsionSubgroup).

Search for rational points on C and on J and computation of the subgroup of J(Q) generated by the points found. This uses ReducedBasis, which in turn is based on height computations.

Search for rational points on varieties associated to 2-covering spaces of J. This makes it possible to find larger points than by a direct search.

Search for rational points on varieties associated to 2-covering spaces of Pic1C, if Pic1C corresponds to an element of the 2-Selmer group that may be in the image of J(Q) and no rational point mapping to it has been found so far. This can find even larger points.

Use isogenous abelian surfaces to obtain possibly better upper bounds. For this, see TwoPowerIsogenies.

If J is isogenous to a product of two elliptic curves or to the restriction of scalars of an elliptic curve over a quadratic field, use functionality for their Mordell-Weil groups.

Try to use visualization to improve the upper bound. If we can find a squarefree integer d != 1 such that we can determine the rank of the quadratic twist J(d)(Q) and a bound for the rank of J(Q(Sqrt(d))), then we can deduce a bound on the rank of J(Q), since rk J(Q) + rk J(d)(Q) = rk J(Q(Sqrt(d))).

If the rank can be determined (i.e., upper and lower bound agree), then the known subgroup is saturated (see Saturation) to obtain the full Mordell-Weil group.

The resulting procedure is usually quite fast (below one second) and successful. Longer running times can be caused by the class group computation triggered by the 2-Selmer group computation (this can be sped up by assuming GRH via SetClassGroupBounds ("GRH")), by the need to find large generators, or when the best upper bound on the rank that can be determined is not sharp.

MordellWeilGroupGenus2(J) : JacHyp -> GrpAb, Map, BoolElt, BoolElt, RngIntElt
    SearchBounds: SeqEnum[RngIntElt]    Default: [5, 10, 20, 50, 100, 300, 1000]
    SearchBounds2: SeqEnum[RngIntElt]   Default: [100, 200, 500, 1000]
    SearchBounds3: SeqEnum[RngIntElt]   Default: [10, 20, 50, 100, 200]
    MaxBound: RngIntElt                 Default: 10000
    BoundC: RngIntElt                   Default: 10000
    MaxIndex: RngIntElt                 Default: 1000
    maxp1: RngIntElt                    Default: 29
    maxp2: RngIntElt                    Default: 13
    Rankbound: RngIntElt                Default: Infinity()
    RankOnly: BoolElt                   Default: false
    LogDiscBound: FldReElt              Default: 40.0
    TwistSearchBound: RngIntElt         Default: 200
    TwistBound: RngIntElt               Default: 200
    SetVerbose("MordellWeilGroup", n):  Maximum: 3
Given the Jacobian J of a genus 2 curve over the rationals, this attempts to compute the Mordell-Weil group J(Q). It returns an abstract abelian group G and a map from G to J(Q). The third value is a flag that indicates whether the subgroup found could be shown to be of finite index. The fourth value is another flag that indicates whether the result is proved to be correct. The last return value is the upper bound for the rank obtained from 2-descent and possibly visualization. If RankOnly is set to true, then saturation is not attempted, and the function returns as soon as the rank has been determined. If RankBound is provided, it will be used as an upper bound on the rank (e.g., one can pass the analytic rank here to get a result that is conditional on BSD). There are a number of further technical parameters that affect the effort spent during the various stages of the computation. BoundC is used as a (multiplicative) height bound for searching for points on the underlying curve. SearchBounds is an increasing sequence of positive integers specifying successive height bounds for a point search directly on J (phase 1). SearchBounds2 is similar and used in the search for rational points on 2-covering spaces of J (phase 2); SearchBounds3 is used analogously in the search for rational points of 2-covering spaces of Pic1 of the underlying curve (phase 3). MaxBound is an upper bound on the height used for searching for rational points on J during saturation. MaxIndex bounds the primes at which saturation is attempted. maxp1 and maxp2 are used to bound the primes p for which Fp-points and the corresponding lattices are constructed for the point searches in phases 2 and 3, respectively. LogDiscBound is a bound on the logarithm of the discriminant of curves with isogenous Jacobians that are tried to find a better rank bound. TwistSearchBound and TwistBound are used in the visualization step; TwistSearchBound gives a bound for the point search on the 2-coverings that is used to detect possibly `good' quadratic twists, and TwistBound is a bound on the absolute value of the squarefree integers d such that the quadratic twist by d is considered.
MordellWeilGroup(J) : JacHyp -> GrpAb, Map, BoolElt, BoolElt
J is a hyperelliptic Jacobian. If the genus of the curve of J is at most 2 (and J is defined over the rationals when it is 2 or over a number field when it is 1), attempt to determine the group of rational points on J. When the base field is finite, this works in general. The first return value is an abstract abelian group, the second is a map from this group into J or into an elliptic curve isomorphic to J when the genus is 1. The third value is a flag that indicates whether the subgroup found could be shown to be of finite index. The fourth value is another flag that indicates whether the result is proved to be correct. Over finite fields, this calls AbelianGroup. For genus 2 over the rationals, this calls MordellWeilGroupGenus2. For genus 1 over the rationals or number fields, this calls MordellWeilGroup on an isomorphic elliptic curve.

Example CrvHyp_Mordell-Weil_ex (H134E32)

We find the Mordell-Weil group of the Jacobian of a genus 2 curve.
> R<x> := PolynomialRing(Rationals());
> C := HyperellipticCurve(-x^6 + x^5 - 3*x^4 + 5*x^3 + 5*x^2 - 5*x + 4);
> J := Jacobian(C);
> SetVerbose("MordellWeilGroup", 1); // so we can see what is going on
> MordellWeilGroup(J);
------------------------------------------------------------------------
Mordell-Weil group of the Jacobian of
Hyperelliptic Curve defined by y^2 = -x^6 + x^5 - 3*x^4 + 5*x^3 + 5*x^2 - 5*x +
4 over Rational Field
------------------------------------------------------------------------
The torsion subgroup is trivial.
Computing rank bound...
Upper bound for the rank: 5
Found 9 points from points on the curve,
 generating a subgroup of rank 5
 ==> rank is 5 <==
Height difference bound is 1.0480.
The MW lattice has (squared) covering radius <= 2.2151.
Search for points up to height 26 to saturate...
Found 55 points.
The group we found is Z^5.
This could be shown to be the full Mordell-Weil group.
Abelian Group isomorphic to Z (5 copies)
Defined on 5 generators (free)
Mapping from: Abelian Group isomorphic to Z (5 copies)
Defined on 5 generators (free) to JacHyp: J given by a rule
true true

We see that the group has rank 5 (and no torsion).

Example CrvHyp_Mordell-Weil_ex2 (H134E33)

Here is another example; this is curve 968.a.1936.1 from the LMFDB. This example shows that the map from the abstract abelian group to the Jacobian has an inverse.
> R<x> := PolynomialRing(Rationals());
> C := HyperellipticCurve(x^6-x^4, 1);
> J := Jacobian(C);
> SetVerbose("MordellWeilGroup", 1); // so we can see what is going on
> MordellWeilGroup(J);
------------------------------------------------------------------------
Mordell-Weil group of the Jacobian of
Hyperelliptic Curve defined by y^2 + y = x^6 - x^4 over Rational Field
------------------------------------------------------------------------
The torsion subgroup is Z/5.
Computing rank bound...
Upper bound for the rank: 1
Found 7 points from points on the curve,
 generating a subgroup of rank 1
 ==> rank is 1 <==
Curve is bielliptic (of degree 2). Use elliptic curves.
MW group of first elliptic curve is Z  (verified).
MW group of second elliptic curve is Z/5  (verified).
Points on J generate a subgroup of rank 1
 ==> rank is 1 <==
The group we found is Z/5 + Z.
This could be shown to be the full Mordell-Weil group.
Abelian Group isomorphic to Z/5 + Z
Defined on 2 generators
Relations:
    5*$.1 = 0
Mapping from: Abelian Group isomorphic to Z/5 + Z
Defined on 2 generators
Relations:
    5*$.1 = 0 to JacHyp: J given by a rule
true true
> G, m := $1;
> pts := Points(J : Bound := 1); #pts;
7
> [pt @@ m : pt in pts];
[
    0,
    G.1,
    4*G.1,
    2*G.2,
    -2*G.2,
    4*G.1 - 2*G.2,
    G.1 + 2*G.2
]
> forall{i : i in [1..#pts] | m($1[i]) eq pts[i]};
true

Here we have a non-trivial torsion subgroup, and we see a case that can be reduced to computing the Mordell-Weil groups of two elliptic curves.

V2.28, 13 July 2023