1 Introduction

Let N be a positive integer and let \(X_0(N)\) be the smooth compactification of the affine modular curve \(Y_0(N)\) of level N. It is the moduli space parametrizing cyclic N-isogenies between (generalized) elliptic curves. For every d dividing N such that \(\gcd (d, N/d) = 1\), let \(w_d\) denote the corresponding Atkin-Lehner involution on \(X_0(N)\). As explained in [33, §I.2], the involution \(w_d\) sends a point \(x \in Y_0(N)\) representing the isogeny \(\varphi :E \rightarrow E'\), to the point representing the composite isogeny

$$\begin{aligned} E/\ker (\varphi )[d] \rightarrow E/\ker (\varphi ) \xrightarrow {\sim }E' \rightarrow E'/\ker (\varphi ^\vee )[d]. \end{aligned}$$

By the valuative criterion for properness, the involution \(w_d\) has a unique extension to \(X_0(N)\).

Let W(N) denote the group generated by all the Atkin-Lehner involutions on \(X_0(N)\). Then W(N) is isomorphic to \((\mathbb {Z}/2\mathbb {Z})^{\omega (N)}\) where \(\omega (N)\) is the number of distinct prime factors of N. The main object of study in this paper is the quotient curve \(X_0(N)^* := X_0(N)/W(N)\). We denote its Jacobian by \(J_0(N)^*\). We also use the notation \(X_0(N)^+ := X_0(N)/w_N\). (Note that \(w_N\) sends an isogeny to its dual.)

If a rational point on \(X_0(N)^*\) is the image of a cusp on \(X_0(N)\), we call it a cuspidal point or simply a cusp. For every non-cuspidal rational point on \(X_0(N)^*\), its lifts in \(X_0(N)\) correspond to \(\mathbb {Q}\)-curves defined over multi-quadratic extensions of \(\mathbb {Q}\) [26]. Recall that a \(\mathbb {Q}\)-curve is an elliptic curve defined over \({\overline{\mathbb {Q}}}\) that is isogenous to all of its Galois conjugates. If the \(\mathbb {Q}\)-curves have complex multiplication, we will call the rational point a CM point. Otherwise, we call it an exceptional point. Since every CM elliptic curve is a \(\mathbb {Q}\)-curve, the most interesting rational points on \(X_0(N)^*\) are the exceptional points corresponding to non-CM \(\mathbb {Q}\)-curves.

Mazur [45] called the problem of determining the rational points of Atkin-Lehner quotients of \(X_0(N)\) an “extremely interesting diophantine question”. For example, \(\mathbb {Q}\)-rational points on \(X_0(N)^+\) lift to points of degree 1 or 2 on \(X_0(N)\); for the computation of quadratic points on \(X_0(N)\), see [17].

When \(X_0(N)^*\) has genus 0 or 1, the sets \(X_0(N)^*(\mathbb {Q})\) of rational points were determined in [32] who also gave explicit parametrization of the families of \(\mathbb {Q}\)-curves described by these points. When N is a prime power, \(X_0(N)^* = X_0(N)^+\), since \(w_N\) is the only non-trivial Atkin-Lehner involution. For N prime and \(\text {genus}(X_0(N)^*) \in \{2,3\}\), the sets \(X_0(N)^*(\mathbb {Q})\) were computed in [5, 11]. For N prime and \(\text {genus}(X_0(N)^*) \in \{4, 5, 6\}\), the same was carried out by the first three authors and Vishal Arul, Lea Beneish, Mingjie Chen, and Boya Wen in [1]. For N composite and \(\text {genus}(X_0(N)^+) \in \{2, 3, 4, 5, 6\}\), the articles [3, 4, 31, 47] complete the determination of the sets \(X_0(N)^+(\mathbb {Q})\). These articles together verify a conjecture of Galbraith [31] on the set of exceptional rational points on the curves \(X_0(N)^+\) with genus between 2 and 5. Together with these articles and the work of [13], in this paper, we finish the determination of rational points on all hyperelliptic curves \(X_0(N)^*\).

The class of \(\mathbb {Q}\)-curves is important because it is a mild generalization of the class of elliptic curves over \(\mathbb {Q}\) [27]. Analogous to the compatible system of \(\ell \)-adic Galois representations associated to the Tate module of an elliptic curve, one naturally associates to a \(\mathbb {Q}\)-curve E, a compatible system of \(\ell \)-adic Galois representations

$$\begin{aligned} \rho _{E,\ell } : {{\textrm{Gal}}}({\overline{\mathbb {Q}}}/\mathbb {Q}) \rightarrow {\overline{\mathbb {Q}}}^{\times }{{\textrm{GL}}}_2(\mathbb {Q}_{\ell }). \end{aligned}$$

Ribet [52] conjectured that \(\mathbb {Q}\)-curves are exactly all the elliptic curves over \({\overline{\mathbb {Q}}}\) which are quotients of the modular curves \(X_1(N)\). In other words, if E is a \(\mathbb {Q}\)-curve, then the associated representation \(\rho _{E,\ell }\) is the \(\ell \)-adic Galois representation attached to a cusp form on \(\Gamma _1(N)\) for some N. Several partial results [28, 35, 36] for many classes of \(\mathbb {Q}\)-curves were obtained using Wiles’ modularity lifting theorems, until the proof of Serre’s conjecture by Khare, Kisin, and Wintenberger [41] proved Ribet’s conjecture completely [38, Theorem 7.2].

Finding the set \(X_0(N)^*(\mathbb {Q})\) is an arithmetically interesting problem for any level N. But for the purpose of studying non-CM \(\mathbb {Q}\)-curves up to isogeny, the following result of Elkies says that it is enough to look at exceptional rational points on \(X_0(N)^*\) for squarefree levels N.

Theorem 1.1

([26]) Let E be a \(\mathbb {Q}\)-curve without complex multiplication. Then there exists some square-free \(N > 0\) such that E is geometrically isogenous to the \(\mathbb {Q}\)-curves associated to an exceptional rational point on \(X_0(N)^*\).

The following result due to Hasegawa classifies all the hyperelliptic Atkin-Lehner quotients \(X_0(N)^*\).

Theorem 1.2

([34, Theorem B]) There are 64 values of N for which \(X_0(N)^*\) is hyperelliptic. Of these, there are only 7 values of N for which \(X_0(N)^*\) is hyperelliptic with genus \(g \ge 3\), namely \(N = 136\), 171, 207, 252, 315 (\(g = 3\)), 176 (\(g = 4\)), and 279 (\(g = 5\)).

Among the 57 levels N for which \(X_0(N)^*\) has genus 2, there are 39 square-free levelsFootnote 1 and 18 non-squarefree levels. The authors in [13] compute for a subset of these square-free levels the set of rational points on \(X_0(N)^*\) using elliptic curve Chabauty. They also compute the \(\mathbb {Q}\)-curves corresponding to each non-cuspidal point in the set. The prime levels \(N = 67\), 73, 103, 107, 161, 167, 191 were approached using quadratic Chabauty in [5] and [11]. We compute \(X_0(N)^*(\mathbb {Q})\) for the remaining square-free levelsFootnote 2

$$\begin{aligned} \{ 133,134,146,166,177,205,206,213,221,255,266,287,299,330 \} \end{aligned}$$

and the seven levels

$$\begin{aligned} \{ 136, 171, 207, 252, 315, 176, 279 \} \end{aligned}$$

for which \(X_0(N)^*\) is hyperelliptic of genus \(g \ge 3\). For the square-free levels we also compute the j-invariants of the \(\mathbb {Q}\)-curves associated to non-cuspidal rational points. The methods of [13], quadratic and bielliptic quadratic Chabauty, and recent work of Arul and Müller [4] together determine \(X_0(N)^*(\mathbb {Q})\) for all of the 18 non-squarefree levels N as explained in Sect. 3.2. Thus, this completes the determination of rational points on all hyperelliptic curves \(X_0(N)^*\). Together with the results in [1, 4, 5, 11, 13, 18], we have the following theorem.

Main Theorem

Let N be such that \(X_0(N)^*\) is hyperelliptic. Then the set \(X_0(N)^*(\mathbb {Q})\) consists only of points of ‘small’ height.

Suppose N is a square-free positive integer such that \(X_0(N)^*\) is hyperelliptic. Then Table 6 classifies each rational point on \(X_0(N)^*\) as cusp, CM or exceptional. If \(X_0(N)^*\) has no exceptional rational points, then \(N \in \{ 67,107,146,167,205,213,390 \}\). For each of the remaining 32 levels \(N \in \{ 73\), 85, 93, 103, 106, 115, 122, 129, 133, 134, 154, 158, 161, 165, 166, 170, 177, 186, 191, 206, 209, 215, 221, 230, 255, 266, 285, 286, 287, 299, 330, \(357 \}\), there is at least one exceptional rational point.

Remark 1.3

For each of the 39 square-free levels when \(X_0(N)^*\) is hyperelliptic, Table 6 in Appendix A gives more refined information about the rational points on \(X_0(N)^*\). It gives the j-invariants of the \(\mathbb {Q}\)-curves associated to all non-cuspidal rational points, and the CM discriminants for all the CM points.

Remark 1.4

The boundedness conjecture of Elkies [26] predicts that there are only finitely many positive integers N such that \(X_0(N)^*\) contains an exceptional rational point. Although the main theorem of this paper says that exceptional rational points exist on most of the hyperelliptic curves \(X_0(N)^*\) of squarefree level N, we observe from Table 6 that most of these exceptional points arise as the image of a cusp or CM point under the hyperelliptic involution. The only curves that have an exceptional rational point not arising in this way are \(X_0(129)^*\) and \(X_0(286)^*\). Furthermore, the curve \(X_0(129)^*\) has extra automorphisms which in fact explain all the exceptional rational points on this curve.

Remark 1.5

See Table 1 for the list of curves \(X_0(N)^*\) whose rational points were determined in previous works. See Table 2 for the exact list of curves \(X_0(N)^*\) whose rational points are determined in this paper.

We did not make major improvements to the existing algorithms. The main challenge in our computations was to adapt the existing algorithms to our situations and to carefully choose suitable parameters, e.g., the primes in the various Chabauty methods and in the Mordell-Weil sieve, as well as the modulus in the Mordell-Weil sieve.

In Sects. 2.1 to 2.6, we give an overview of the ingredients including the various Chabauty methods and the Mordell-Weil sieve. We indicate in 2.7 how to compute the covering morphisms

$$\begin{aligned} X_0(N) \rightarrow X_0(N)/W'(N) \rightarrow X_0(N)^* \end{aligned}$$

for all subgroups \(W'(N)\) of W(N), which allows one to compute the \(\mathbb {Q}\)-rational points on the coverings, too. In Sect. 2.8, we give the runtimes for intensive quadratic Chabauty computations. In Sects. 3.1 and 3.2, we give details on the computations for the genus 2 curves \(X_0(N)^*\), with N squarefree and non-squarefree respectively. Sect. 4 contains details of the computation for the curves \(X_0(N)^*\) of genus \(\ge 3\). Appendix A contains a table giving refined information about the rational points on \(X_0(N)^*\) for squarefree levels, as mentioned in the main theorem and Remark 1.3.

2 Methods and algorithms used

Most of our computations rely on extensions of Chabauty’s method and additional arguments (e.g., a variation of Mordell-Weil sieve). In this section, we give an overview of the methods used.

A curve over a field is called nice if it is smooth, projective, and geometrically integral. Let \(C/\mathbb {Q}\) be a nice curve of genus \(g \ge 2\) with Jacobian J whose Mordell-Weil group \(J(\mathbb {Q})\) has rank r. For all flavors of Chabauty, assume that we have chosen a base point \(x_0 \in C(\mathbb {Q})\) to embed C into J. In all our cases, there is such an \(x_0\) because there is at least one \(\mathbb {Q}\)-rational cusp. If there were not one, then one could try to use the Mordell-Weil sieve to prove that \(C(\mathbb {Q})\) is empty.

To compute the rank of the Jacobian of a modular curve (over \(\mathbb {Q}\)), we use Magma’s functionality to decompose the Jacobian into simple factors. For a simple modular abelian variety \(A/\mathbb {Q}\), we can determine whether its rank \(r := {\textrm{rk}} A(\mathbb {Q})\) equals 0 or its dimension using [33] and [39] in all our cases.

Theorem 2.1

(Gross–Zagier–Kolyvagin–Logachëv) Let A be a simple modular abelian variety over \(\mathbb {Q}\) of dimension g with algebraic rank \(r := {\textrm{rk}} A(\mathbb {Q})\) and analytic rank \(r_\textrm{an} := {\textrm{ord}}_{s=1}L(A,s) \in \{0,g\}\). Then \(r = r_\textrm{an}\), i.e., the BSD rank conjecture holds for A.

It is sufficient to check that \({\textrm{ord}}_{s=1}L(f,s) \in \{0,1\}\) for one of the newforms associated with A [33, Corollary V.1.3]. One can either read off the analytic rank of f from the LMFDB [44] or use modular symbols to decide whether \(L(f,1) = 0\); to prove that \(L'(f,1) \ne 0\), one can use Dokchitser’s code [25] for computing special L-values.

We used Magma [7] for our Chabauty computations of all flavors and Sage [57] to access Liu’s genus2reduction from [42, 43]. The code to reproduce our computations can be found in the GitHub repository [2]. The log files were produced with Magma 2.26-10.

First we give an overview on the 27 levels N such that \(X_0(N)^*(\mathbb {Q})\) was determined prior (or concurrently) to this paper. N. B. the level 161 appears twice.

Table 1 Levels N and methods previously used to determine \(X_0(N)^*(\mathbb {Q})\)

Now we give an overview on the 37 levels N discussed in this paper and methods we used to determine \(X_0(N)^*(\mathbb {Q})\).

Table 2 Levels N and methods we applied to determine \(X_0(N)^*(\mathbb {Q})\)

The code for all our computations is adapted from previous papers cited in the corresponding subsections below.

2.1 The classical Chabauty–Coleman method

In cases where \(r < g\), we often use the classical method of Chabauty–Coleman. A good overview article on this method is [48] and details on a refinement of this method can be found in [54].

Choose a prime p of good reduction for C. The set \(C(\mathbb {Q})\) is contained in the set

$$\begin{aligned} C(\mathbb {Q}_p)_1 := \Bigg \{x \in C(\mathbb {Q}_p) : \int _{x_0}^x\omega = 0\Bigg \} \subseteq C(\mathbb {Q}_p) \end{aligned}$$

given as the vanishing locus of specific power series given by Coleman integration of a certain differential \(\omega \in {\textrm{H}}^0(C_{\mathbb {Q}_p}, \Omega ^1) \simeq {\textrm{H}}^0(J_{\mathbb {Q}_p},\Omega ^1)\) with the property that \(\int _{[D]}\omega = 0\) for all \([D] \in J(\mathbb {Q})\). For the construction and properties of the Coleman integral on curves, see [24], and [6] for how to compute them on hyperelliptic curves. By linearity of the Coleman integral, it is enough to check the vanishing of \(\int _{[D]}\omega \) for all [D] from a generating set of a finite index subgroup of \(J(\mathbb {Q})\). The Chabauty condition \(r < g\) is used to construct a non-zero such differential \(\omega \), which implies that \(C(\mathbb {Q}_p)_1\) and hence \(C(\mathbb {Q})\) is finite. (In fact, it is enough that the \(\mathbb {Z}_p\)-rank of the p-adic closure of \(J(\mathbb {Q})\) in \(J(\mathbb {Q}_p)\) is less than g.) This is because the integral will be non-zero and a non-zero power series has only finitely many zeros on a 1-dimensional p-adic manifold.

It is crucial that one can compute the p-adic integral as a locally analytic function and hence explicitly approximate the Chabauty set \(C(\mathbb {Q}_p)_1\). If all known \(\mathbb {Q}\)-points coincide with the p-adic approximations, then one has determined \(C(\mathbb {Q})\). If \(g = 2\) and \(r = 1\), then we use a combination of Chabauty–Coleman and the Mordell-Weil sieve, which is included in Magma. For \(g \ge 3\), we use the code of Balakrishnan and Tuitman in [22] to perform explicit Coleman integration for smooth curves. It enables us to determine the points in \(C(\mathbb {Q}_p)_1\) precisely enough to check that this set consists exactly of the known rational points.

The code assumes that the degree-0 divisors given by the difference of the known \(\mathbb {Q}\)-points of C generate a finite index subgroup of \(J(\mathbb {Q})\). For the levels \(N = 171, 176\), the Jacobian of the curve \(X_0(N)^*\) has rank 1, so we simply confirm that one divisor has infinite order. For level \(N = 279\), we check this by looking for at the reduction morphism to \(J(\mathbb {F}_\ell )\) for small primes \(\ell \) of good reduction to prove that there are no non-trivial relations between the divisor classes. For details, confer [56, Lemma 4].

2.2 Elliptic curve Chabauty

When the Chabauty condition is violated, elliptic curve Chabauty is a method that sometimes succeeds in computing \(C(\mathbb {Q})\) using a combination of descent (also called going-up in [51, §5.5]) as described in [55, §1] and an analogue of the Chabauty–Coleman method over number fields. This method is described in [12, 19], and in [13]. We give a short summary in the way we use it.

Assume that \(\pi : C \rightarrow {\mathbb {P}}^1\) is a finite morphism of degree 2 and that C is a hyperelliptic curve of genus \(g = 2\). Let \(\alpha : C' \rightarrow C\) be a twist of the pullback of the multiplication-by-2 morphism on J. (For the definition of a twist of a finite étale Galois covering, see [55, §4].) Note that these are finite étale coverings with geometric Galois group \((\mathbb {Z}/2\mathbb {Z})^4\). One has \(C(\mathbb {Q}) = \bigcup _\alpha \alpha \left( C'(\mathbb {Q})\right) \), where \(\alpha \) runs over all such twists (“descent”). Hence we only need to determine \(C'(\mathbb {Q})\) for the finitely many curves \(C'\) such that \(C'\) has points locally everywhere. These can be computed from the fake 2-Selmer set as described in [20] and in Magma using TwoCoverDescent. Note that the genus of the coverings will grow, so the Chabauty condition is more likely to be satisfied at the expense of increasing the degree.

If \(C'(\mathbb {Q}) = \emptyset \), we can use the Mordell-Weil sieve to prove \(C'(\mathbb {Q}) = \emptyset \). If \(C'(\mathbb {Q}) \ne \emptyset \), we can compute \(C'(\mathbb {Q})\) using the Chabauty method for an elliptic curve quotient over a finite extension of \(\mathbb {Q}\). Since \(C' \rightarrow C\) is Galois with Galois group \((\mathbb {Z}/2\mathbb {Z})^{4}\) (as is \([2]: J \rightarrow J\)), \({\textrm{Jac}}(C')\) is isogenous to \(J \times A\) with the Prym variety \(A := \prod _{i=1}^{15} E_i\) with elliptic curves \(E_i\) over \(\overline{\mathbb {Q}}\) (one has \(15 = 2^{2g} - 1\)). These come equipped with a morphism \(\pi ': E_i \rightarrow {\mathbb {P}}^1\). Since \(g=2\), every \(\mathbb {Z}/2\) cover of \(C_{\overline{\mathbb {Q}}}\) will have an elliptic Prym variety, and \(A = {\textrm{Res}}_{K/\mathbb {Q}}E \times _{\mathbb {Q}} \overline{\mathbb {Q}}\) for some elliptic curve E over the étale algebra K of \(J[2] \setminus \{0\}\). Now one can apply the classical Chabauty–Coleman method to E if \({\textrm{rk}} A(\mathbb {Q}) = {\textrm{rk}} E(K) < [K:\mathbb {Q}] = \dim A\) (note that the dimension of a Jacobian of a curve equals the genus of that curve), together with the information that the images of the \(\mathbb {Q}\)-rational points on \(C'\) on E have image in \({\mathbb {P}}^1(\mathbb {Q})\) under \(\pi '\).

We have replaced an abelian variety over \(\mathbb {Q}\) of dimension d by an elliptic curve over a (possibly) larger field of degree d. One usually suspects this method to work if the degree of K is large because the ranks of elliptic curves are expected to be small, assuming that one can compute them. However, elliptic curve Chabauty often fails for algorithmic reasons. Namely, if the étale algebra K has too large a degree, to perform the 2-descent to compute \(A(\mathbb {Q})\), one would need to compute the class group of a number field of large degree. Such a computation is infeasible, often even assuming GRH. In these cases we can use the quadratic Chabauty method, see Sect. 2.3.

We use this method to determine \(X_0(N)^*(\mathbb {Q})\) for \(N = 147\), 255 and 330. In Sect. 3.2 we work out the case \(N = 147\) in more detail. Our computations were performed using code written by [13].

2.3 Quadratic Chabauty

If the p-adic closure of the image of \(J(\mathbb {Q}) \subset J(\mathbb {Q}_p)\) under \(\log \) has rank g, the classical Chabauty condition is violated. In this case, we can try to use quadratic Chabauty.

If the Néron-Severi rank \(\rho (J)\) of J is larger than 1, then there exists a non-trivial \(Z \in {\textrm{Ker}}({\textrm{NS}}(J) \rightarrow {\textrm{NS}}(C))\) inducing a correspondence on \(C \times _\mathbb {Q}C\). Balakrishnan, Dogra, Müller, Tuitman and Vonk in [8, 10] explain how to attach to any such Z a locally analytic quadratic Chabauty function

$$\begin{aligned} \rho _Z : C(\mathbb {Q}_p)\rightarrow \mathbb {Q}_p \end{aligned}$$

as follows: using Nekovář’s theory of p-adic heights [49], one can construct a global p-adic height which decomposes as a sum of local height functions; for the latter, see [23]. The quadratic Chabauty function \(\rho _Z\) is defined as the difference between the global p-adic height and the local height for the chosen prime p. Their difference equals the sum of the local heights away from p.

The local p-adic heights \(h_v\) with \(v \ne p\) take only finitely many values on \(C(\mathbb {Q}_v)\), see [40]. Therefore, there exists a finite set \(\Upsilon \subset \mathbb {Q}_p\), such that \(\rho _Z(x) \in \Upsilon \) for any \(x \in C(\mathbb {Q})\). As described in [9], this set is often computable a priori by intersection theory.

Since \(\rho _Z\) has Zariski-dense image on every residue disk and is given by a convergent power series, this implies that the set of \(\mathbb {Q}_p\)-rational points of C having values in \(\Upsilon \) under \(\rho _Z\) is finite. As both \(C(\mathbb {Q}_p)_2\) and \(C(\mathbb {Q})\) are contained in that set, \(C(\mathbb {Q})\) is finite as well. Since both \(\rho _Z\) and \(\Upsilon \) can be explicitly computed by [5, 10, 11], this makes the provable determination of \(C(\mathbb {Q}_p)_2\) possible if the quadratic Chabauty condition \(r < g + \rho (J) - 1\) is satisfied. This works at least under the assumption that \(\rho _Z\) has no repeated roots; otherwise, we get a finite superset. The issue is distinguishing between two p-adic roots which are close together and one repeated root. If we do not know whether a root is repeated or not, then there is no terminating process for determining the roots. Looking at the p-adic approximations to a high enough precision, it is possible to prove that there are no multiple roots if there are not, but it is not possible to prove that there is a multiple root. As we work up to finite precision, we can say that we either have one point or two which are close to each other.

The quadratic Chabauty condition holds for our curves since \(r = g\) and \(\rho (J) = \dim {J}\) because J has real multiplication: There is an isomorphism \({\textrm{NS}}(J) \otimes \mathbb {Q}\xrightarrow {\sim }{\textrm{End}}(J)^{\dagger } \otimes \mathbb {Q}\) with \((-)^{\dagger }\) the Rosati involution associated to the canonical principal polarization of J [46, Proposition 17.2]. Since J has real multiplication, the Rosati involution acts trivially on \({\textrm{End}}(J)\) and \({\textrm{End}}(J)\) is a number field of degree equal to \(\dim {J}\).

The quadratic Chabauty algorithm in [10] is specific to modular curves only when determining the nontrivial class Z, which is computed by the Hecke operator \(T_p\) (determined by the Eichler-Shimura relation). The input consists of a plane affine patch of a modular curve \(C/\mathbb {Q}\) (satisfying certain technical properties) and a prime p of good reduction such that the Hecke operator \(T_p\) generates \({\textrm{End}}(J) \otimes _\mathbb {Z}\mathbb {Q}\). To choose the primes p, we tried the first primes satisfying this condition and picked those with which we could compute all the points using the Mordell-Weil sieve. The algorithm outputs a finite set of \(\mathbb {Q}_p\)-points to some precision containing \(C(\mathbb {Q}_p)_2\).

In all our examples where we apply quadratic Chabauty, the set \(\Upsilon \) equals \(\{0\}\). This is because the stable reduction type at all primes of bad reduction computed with Liu’s genus2reduction is the same as the one in [11, Example 5.19] with \(v = 23\). Namely, it is \([\textrm{I}_{1\text {-}1\text {-}0}]\) in the notation of [50], see p. 179 there for this case: The stable model has special fiber a curve of genus 0 with exactly two double points and the given equation defines a regular semistable model over \(\mathbb {Z}_v\) for all bad primes v. We prove regularity of the given hyperelliptic model over \(\mathbb {Z}\) in the singular points of the special fiber. We do this by checking that the v-valuation of the constant term of the defining equation with the coordinates of the singular point plugged in is 1.

The semistability can be checked by invoking Magma’s IsNode for all singular points of the special fiber. Hence all \(\mathbb {Q}_v\)-points lie on exactly one irreducible component of a minimal regular model over \(\mathbb {Z}_v\), so by [11, Theorem 3.2], the height contribution at v is 0. Note that all levels which we apply this to are odd, see Table 4, and the function genus2reduction computes regular semistable model at all primes \(v\ne 2\). This function was developed in [42] and [43], and can be called from Sage.

Before running the quadratic Chabauty algorithm on a hyperelliptic curve, we apply an automorphism such that there are no \(\mathbb {Q}_p\)-rational points at infinity. In all our examples we could find such an automorphism by trying matrices with small entries in \({{\textrm{GL}}}_2(\mathbb {Z})\).

If \(C: y^2 = f(x)\) is hyperelliptic, the bad \(\mathbb {Q}_p\)-rational points for \(p > 2\) are exactly those in a residue disc of a Weierstraß point over \(\mathbb {F}_p\). We usually choose our quadratic Chabauty prime(s) p such that there is no bad \(\mathbb {Q}_p\)-rational point. However, for the levels \(N = 213, 287, 299\), we had to choose the quadratic Chabauty prime(s) p such that there is exactly one bad \(\mathbb {Q}_p\)-rational point because they had only 4 known \(\mathbb {Q}\)-rational points. This would not be enough to solve for the global height pairing, so we had to compute local heights at p manually before running QCModAffine. This can currently be done only for odd degree hyperelliptic curves, which have a Weierstraß point at infinity, and these are bad. Forthcoming work of Gajović could be used to do the computations for even degree hyperelliptic curves. However, by the argument described in Sect. 2.6, we could conclude that this single bad \(\mathbb {Q}_p\)-rational point is not \(\mathbb {Q}\)-rational.

2.4 Bielliptic quadratic Chabauty

There is a variant of quadratic Chabauty useful for bielliptic curves described in [8, 14] and being worked out with precision bounds and implemented by Francesca Bianchi and the fourth author [18]. (The code to perform these computations will be published with their paper.) This method is applicable for \(X_0(166)^*\) with bielliptic equation

$$\begin{aligned} y^2 = x^6 + 2x^4 + 17x^2 - 4. \end{aligned}$$

(Note that the polynomial on the right hand side factors into two irreducible factors over \(\mathbb {Q}\), but elliptic curve Chabauty fails for this curve.) This curve is not further discussed in the current paper, but it will be part of a database of more than 400 bielliptic genus 2 curves from the LMFDB, whose rational points will be computed using this method. In this case, \(r = g = 2\), so the quadratic Chabauty condition is fulfilled. The bielliptic quadratic Chabauty method is simpler as the algorithm makes use of the extra structure which bielliptic genus 2 curves have, in particular the two quotient maps to elliptic curves of rank 1. Most of the computations are then delegated to the level of the two elliptic curves.

We have not attempted to apply the standard quadratic Chabauty method here, as the reduction type at the primes of bad reduction is more complicated, so the height contribution at the bad primes might be non-zero.

2.5 The Mordell-Weil sieve

The Mordell-Weil sieve was introduced in [21] based on an idea by Scharaschkin [53]. In the way we use it, it is also described in [11, §3.4], and we are using their code, with minor adaptations to our examples. Another reference with more details about the Mordell-Weil sieve is [5, §6.7].

For a finite set S of primes and an integer \(M > 1\), consider the commutative diagram

figure a

with the horizontal maps induced by a \(\mathbb {Q}\)-rational divisor class of degree 1. Assume that one can compute \(J(\mathbb {Q})\) in terms of generators and relations, e.g., if the genus of C is 2 and using Stoll’s MordellWeilGroupGenus2 in Magma (this function often succeeds also if , and outputs if its result is correct). Then one can compute the maps \(\alpha \) and \(\beta \). If one wants to prove that \(C(\mathbb {Q})\) is empty, the aim is to find S and M such that the images of \(\alpha \) and \(\beta \) are disjoint. More generally, the sieve can be used to show that a given residue disc in \(C(\mathbb {Q}_\ell )\) does not contain a \(\mathbb {Q}\)-rational point. Conjecturally, for any curve one should be able to provably determine all \(\mathbb {Q}\)-points on a curve [21, §2, p. 4] and [55, Main Conjecture].

We map \(C(\mathbb {Q}_\ell )\) and \(J(\mathbb {Q}_\ell )\) to \(C(\mathbb {F}_\ell )\) and \(J(\mathbb {F}_\ell )\) via the reduction map for primes \(\ell \) of good reduction (not necessarily prime to M). Its fibers are the residue discs.

We now give more details on how we use the sieve. Our finite set S consits of the Mordell-Weil sieve primes \(\ell \) (“MWS primes” for short). It contains as a subset the quadratic Chabauty primes p (“QC primes” for short in Table 4).

Regarding the QC primes: To make the explanation easier, assume that \(J(\mathbb {Q})\) is torsion-free. Let p be a QC prime, i.e., we have computed a set of residue discs of \(C(\mathbb {Q}_p)\) using the quadratic Chabauty algorithm in Sect. 2.3, which contain the \(\mathbb {Q}\)-points of C and such that there is at most one \(\mathbb {Q}\)-point in each residue disc. Let \(P \in C(\mathbb {Q}_p)\) be a point which we suspect is not a \(\mathbb {Q}\)-rational point from our quadratic Chabauty computation, and that P is given to some finite precision \(p^n\). If P were \(\mathbb {Q}\)-rational, then there would exist integers \(a_1, \ldots , a_r\) such that

$$\begin{aligned}{}[P - x_0] = a_1 P_1 + \cdots + a_r P_r \in J(\mathbb {Q}), \end{aligned}$$

where \([P-x_0] \in J(\mathbb {Q})\) is the image of \(P \in C(\mathbb {Q})\) under the Abel-Jacobi map and \(\{P_1, \ldots , P_r\}\) is a generating set of \(J(\mathbb {Q})\). The strategy is to obtain a contradiction working modulo \(p^{n}\). To this end, we compute a tuple \((\tilde{a}_1, \ldots , \tilde{a}_r) \in \mathbb {Z}/p^{n}\mathbb {Z}\) satisfying \(\tilde{a}_i \equiv a_i \;(\bmod \; p^{n})\) using the linearity of Coleman integrals of holomorphic differentials (see [5, equation (48)]). (Note that

$$\begin{aligned} \log _J:J(\mathbb {Q}_p)^1 \otimes _{\mathbb {Z}_p} \mathbb {Q}_p \xrightarrow {\sim }{\textrm{H}}^0(J_{\mathbb {Q}_p},\Omega ^1)^*, [D] \mapsto \Bigg (\omega \mapsto \int _{[D]}\omega \Bigg ) \end{aligned}$$

given by Coleman integrals is an isomorphism. Here, \(J(\mathbb {Q}_p)^1\) is the kernel of the reduction of \(J(\mathbb {Q}_p)\) to \(J(\mathbb {F}_p)\), and \(J(\mathbb {Q}_p)^1\) is of finite index in \(J(\mathbb {Q}_p)\).) This gives us a coset in \(p^nJ(\mathbb {Q})\). To prove that P is not \(\mathbb {Q}\)-rational, it is enough to show that the image of the corresponding coset of \(p^{n} J(\mathbb {Q})\) under \(\alpha \) is not hit by \(\beta \). (Note that since we are taking the quotient of \(J(\mathbb {F}_\ell )\) by \(MJ(\mathbb {F}_\ell )\) for all \(\ell \in S\), this will only give us information if there are MWS primes \(\ell \) with \(p \mid \#J(\mathbb {F}_\ell )/MJ(\mathbb {F}_\ell )\). Hence we take M to be divisible by \(p^n\).) Sometimes we combine this information for several QC primes p with the Chinese remainder theorem.

Regarding the MWS primes: From our Chabauty computations we get residue discs in \(C(\mathbb {Q}_p)\) that contain at most one \(\mathbb {Q}\)-point. (This is the second way in which we use the information from our quadratic Chabauty computation in the Mordell-Weil sieve.) For the MWS primes \(\ell \) that are not QC primes, we compute \(C(\mathbb {F}_\ell )\) and also get residue discs \(C(\mathbb {Q}_\ell )\). Some of these residue discs (obtained for QC primes and other MWS primes) contain the known \(\mathbb {Q}\)-rational points. The other ones are called fake residue discs, and we want to show that they do not contain a \(\mathbb {Q}\)-rational point. To this end, we show that their image under \(\beta \) is not hit by \(\alpha \). This can be decided because \(\alpha \) and \(\beta \) are computable.

We first take M to be the product of the QC primes p (or \(p^n\), but in all our computations p is enough) and run the sieve. If this does prove that the known \(\mathbb {Q}\)-points of C are all of them, we multiply M by a small integer \(M'\) such that the \(\#(J(\mathbb {F}_\ell )/MJ(\mathbb {F}_\ell ))\) have common factors for the MWS primes \(\ell \in S\). We use the heuristics from [21, §3] to compute appropriate MWS primes and \(M'\).

2.6 Excluding \(\mathbb {Q}\)-rational points in Weierstraß discs

Assume that we know (from classical or quadratic Chabauty) that there is at most one \(\mathbb {Q}\)-rational point in the \(\mathbb {Q}_p\)-residue disc of a Weierstraß point over \(\mathbb {F}_p\), p odd and of good reduction. Also assume that the Weierstraß point is not \(\mathbb {Q}\)-rational. Then the number of \(\mathbb {Q}\)-rational points in the residue disc is even (because the orbits of an involution have cardinality either 1 or 2, and orbit size 1 means that it is a fixed point), hence zero because it is \(\le 1\). (We thank Michael Stoll for this argument.)

Note that a power series which describes a regular differential at a Weierstraß point is even, so it becomes odd after integrating. Hence the Chabauty bound for this disk will be even. As the Weierstraß point is always a zero of the integral, one can improve the bound by 1 if one knows that the point is not rational.

We use this argument to prove that the remaining bad \(\mathbb {Q}_p\)-rational point is not \(\mathbb {Q}\)-rational for \(X_0(N)^*\) and \(N = 213, 287, 299\). Here we had to allow one bad \(\mathbb {Q}_p\)-rational point because there were not enough \(\mathbb {Q}\)-rational points to solve for the height pairing and to apply the algorithm for the computation of the local Coleman–Gross p-adic heights at p. This algorithm, due to Balakrishnan and Besser, requires an odd degree \(\mathbb {Q}_p\)-model. (Forthcoming work of Gajović will allow one to compute the local heights also for even degree models.)

2.7 Computation of Atkin-Lehner quotients

If the maximal quotient \(X_0(N)^*\) has finitely many \(\mathbb {Q}\)-rational points and we know them, we can compute the \(\mathbb {Q}\)-rational points on all coverings \(X_0(N)/W'(N)\) for a subgroup \(W'(N)\) of W(N) if we know the quotient morphism. In principle, one could compute the automorphism group of \(X_0(N)\) over \(\mathbb {Q}\) (or over \(\mathbb {F}_p\) and try to lift the automorphisms) using Magma’s AutomorphismGroup and the quotient using CurveQuotient. However, both functions turn out not to be very efficient for our values of N. Therefore we do the following:

Assume that \(X_0(N)\) is of genus \(g \ge 3\) and not hyperelliptic. We compute the canonical model of \(X_0(N)\) in \({\mathbb {P}}^{g-1}\) as an intersection of quadrics by finding enough relations between monomials of degree 2 of an integral basis of \(S_2(\Gamma _0(N))\) until we get an irreducible 1-dimensional scheme. (This is a well-known strategy, presented with more details in [16, 29].) Magma can compute the Atkin-Lehner operators as linear involutions on this basis. We compute the common fixed space of \({\mathbb {P}}^{g-1}\) by all Atkin-Lehner operators in a chosen subgroup \(W'(N)\) of W(N) by simultaneously diagonalizing them, so they are diagonal with entries \(\pm 1\) on their diagonal. Call this new basis \((g_i(q))_{i=1}^g\).

To compute the quotient for a given subgroup \(W'(N)\) of the Atkin-Lehner involutions, let \((x_i)_{i=1}^g\) be the coordinates of the canonical embedding corresponding to \((g_i)_{i=1}^g\). Let \(w_q\) act on \(x_i\) with the same sign as it acts on \(g_i\). Let M be the set of all degree 2 monomials \(m_{i,j} = x_ix_j\) fixed by all Atkin-Lehner operators in \(W'(N)\) and such that there is a \(w_q \in W'(N)\) that does not fix \(g_i\) or \(g_j\). Let J be the set of all i such that \(w_qg_i = g_i\) for all \(w_q \in W'(N)\). Let \(\varphi : {\mathbb {P}}^{g-1} \rightarrow {\mathbb {P}}_{(2,\ldots ,2,1,\ldots ,1)}\),

$$\begin{aligned}{}[x_1:\ldots :x_g] \mapsto [m(x_1, \dotsc , x_g) (m \in M) : x_j (j \in J)] \end{aligned}$$

(image in the weighted projective space). Here the first coordinates with \(m \in M\) are homogeneous of degree 2, and the last coordinates with \(j \in J\) are homogeneous of degree 1. Then by invariant theory, the quotient \(X_0(N)/W'(N)\) is the image of the composition \(X_0(N) \hookrightarrow {\mathbb {P}}^{g-1} \rightarrow {\mathbb {P}}_{(2,\ldots ,2,1,\ldots ,1)}\). (We thank John Voight for this idea.)

There is another method to get the quotient \(X_0(N) \rightarrow X_0(N)/W'(N)\) if the quotient is hyperelliptic: Let \(g_1(q),g_2(q) \in \mathbb {Z}\llbracket q\rrbracket \) be (the q-expansions of) two independent cusp forms with integral coefficients fixed by \(W'(N)\). Assume we know the genus \(g'\) of the quotient. Then, as in [13], we compute a hyperelliptic equation \(y^2 = f(x)\) of the quotient as a solution to the linear equation system given by comparing coefficients in the hyperelliptic equation with \(x(q) = \frac{g_2(q)}{g_1(q)}\) and \(y(q) = qx'(q)\frac{1}{g_1(q)}\). The morphism from the canonical model of \(X_0(N)\) to this hyperelliptic curve with weighted homogeneous coordinates [x : y : z] of degree \((1,g'+1,1)\) is given on the x-coordinate by the coordinate corresponding to \(g_2\) and on the z-coordinate by the coordinate corresponding to \(g_1\). The y-coordinate is computed (assuming \(g' = 2\)) by writing \(y(q)g_1(q)^3\) as a homogeneous polynomial of degree \(g'+1 = 3\) in the \((g_i(q))_i\).

Since there are so many modular coverings, we actually computed the points only for one of them as a proof of concept, namely \(X_0(133) \rightarrow X_0(133)^*\). It turns out that the 8 \(\mathbb {Q}\)-rational points have 4 \(\mathbb {Q}\)-rational preimages. This agrees with Kenku’s computation [37, Theorem 1] of \(X_0(N)(\mathbb {Q})\), implying that \(X_0(133)(\mathbb {Q})\) consists only of cusps. Our code in the file Coverings/X0N_coverings.m on GitHub can be used to do these computations for the other coverings.

2.8 Runtimes and memory usage

We record in Table 3 the runtimes and the memory usage on (one core of) an AMD ® Ryzen Pro 3700U @ 2.30 GHz with 13.6 GB of RAM using Magma V2.26-10. All other computations had negligible runtimes of less then 20 seconds. The biggest contributing factor to the memory usage is the number of cosets to be sieved out in the Mordell-Weil sieve step.

Table 3 Runtimes and memory usage in the cases where we applied quadratic and elliptic curve Chabauty, confer Table 4 for quadratic Chabauty

3 Genus 2 curves \(X_0(N)^*\)

As mentioned in the introduction, thanks to the works of [5, 11, 13, 34], the only genus 2 curves \(X_0(N)^*\) that remain to be studied are the following:

Case 1 (Square-free level): \(N \in \{ 133,134,146,166,177,\) 205, 206, 213, 221, 255,  \(266,287,299,330 \}\)

Case 2 (Non-squarefree level): \(N \in \{ 88, 104, 112, 116, 117, 121, 125, 135, 147,\) \(153, 168,180, 184, 198, 204, 276,\) \(284, 380 \}\)

3.1 Square-free levels

The curves of levels \(N = 134,146,206\) can be addressed by observing the exceptional isomorphisms

$$\begin{aligned} X_0(2p)^* \cong X_0(p)^+ \quad \text {for } p \in \{67,73,103\}, \end{aligned}$$

and \(X_0(p)^{+}({\mathbb {Q}})\) for these p were computed in [5] and [11].

The set \(X_0(166)^*(\mathbb {Q})\) is determined in [18] using bielliptic quadratic Chabauty over \(\mathbb {Q}_7\) and the extra points are sieved out using the primes \(\{107, 4211 \}\). We compute \(X_0(N)^*(\mathbb {Q})\) for the levels \(N = 255\) and 330 using elliptic curve Chabauty (their hyperelliptic polynomials factor over \(\mathbb {Q}\) as a product of a quadratic and a quartic polynomial).

We investigate the remaining cases using quadratic Chabauty. Note that \(X_0(266)^* \cong X_0(133)^*,\) thus we are left with

$$\begin{aligned} N \in \{ 133,177,205,213,221,287,299 \}. \end{aligned}$$

In Table 4, we record the parameters used in the cases where we use quadratic Chabauty. For all levels N in this table, we explain why there is exactly one cusp on \(X_0(N)^*\). The number of cusps on \(X_0(N)\) is

$$\begin{aligned} \sum _{d \mid N}\varphi (\gcd (d,N/d)) = \sum _{d \mid N} 1 = 2^{\omega (N)}. \end{aligned}$$

To get the curve \(X_0(N)^*\), we quotient \(X_0(N)\) by the full group W(N) of order \(2^{\omega (N)}\). The action of W(N) on these cusps is transitive, so \(X_0(N)^*\) has exactly one cusp. We denote this single cusp by \(\infty \).

The quadratic Chabauty method is based on height computations. To use this method, one has to compute the contributions at the primes of bad reductions. In the case of a semistable reduction type with just one component, the contribution is trivial by [11, Theorem 3.2]. Namely, the local heights away from p factor through the reduction graph, which has only one vertex in this case. This is fortunately the case in all of the cases in which we apply quadratic Chabauty (for \(N = 166, 255, 330\) this does not hold, and we approach these using bielliptic quadratic and elliptic curve Chabauty). Therefore, one can run a quadratic Chabauty computation analogous to the one carried out for \(X_0(67)^+\). We conclude that the \(\mathbb {Q}\)-rational points of \(X_0(N)^*(\mathbb {Q})\) for N in (1) are precisely those predicted by Table 1 of [13].

To classify the rational points and compute corresponding j-invariants, we use the method outlined in [13]. Denote by j(z) the usual j-function on \(X_0(1)\). We find suitable generators of the function field of \(X_0(N)^*\). Then we use them to express the symmetric functions of the set \(\{j(dz) : 1 \le d \mid N\}\), in terms of these generators. This is how we find the j-invariants of the \(\mathbb {Q}\)-curves associated to each non-cuspidal rational point on \(X_0(N)^*\). Table 6 in the appendix lists these j-invariants when they lie in \(\mathbb {Q}\) or a quadratic number field, and the defining fields \(\mathbb {Q}(j)\) otherwise. The minimal polynomials of all these j-invariants are given in the file jinvs.log in our GitHub repository [2]. Table 6 also classifies the points of \(X_0(N)^*\) as CM points or exceptional points, and gives the discriminant D of the order of the endomorphism ring when the point is CM.

Table 4 Data used to do the quadratic Chabauty computations and information on \(X_0(N)^*(\mathbb {Q})\). (MWS primes means the additional primes in the Mordell-Weil sieve compared to the QC primes.)

3.2 Non-squarefree levels

Although only square-free levels N are considered in [13], the methods of elliptic curve Chabauty and quadratic Chabauty work beyond this scope. Among the 18 non-squarefree levels N for which \(X_0(N)^*\) has genus 2, we have that \(\text {rk } J_0(N)^*(\mathbb {Q}) \in \{0,1\}\) for all except for \(N = 147\) and \(N = 125\). Thus in those cases one can compute \(X_0(N)^*(\mathbb {Q})\) using the classical Chabauty method implemented in Magma. Recent work of Arul–Müller [4] verifies that the known small rational points on \(X_0(125)^+= X_0(125)^*\) are in fact all of them.

For \(N = 147\), we modified the code attached to [13], as it works to compute \(X_0(147)^*(\mathbb {Q})\) using elliptic curve Chabauty: An equation for \(X_0(147)^*\) is given by

$$\begin{aligned} y^2 = f(x)=(x^2 - x + 1)(x^4 + x^3 - 4x^2 - 3x + 9). \end{aligned}$$

We let \(K := \mathbb {Q}[t]/(t^4 + t^3 - 4t^2 - 3t + 9)\). Then over K the polynomial f(x) factorizes as

$$\begin{aligned} f(x) = L_1(x)L_2(x)Q_1(x)Q_2(x), \end{aligned}$$

where the polynomials \(L_i\) are linear, and the polynomials \(Q_i\) are quadratic. Let E be the elliptic curve \(y^2 = Q_1(x)Q_2(x)\) over K. If \((x_0,y_0)\) is in \(X_0(147)^*(\mathbb {Q})\), then \(x_0\) is the x-coordinate of a point on E(K) or on one of its 3 twists we have to consider. We computed these twists as in [20] and the corresponding rational points in Magma using TwoCoverDescent. We conclude that \(X_0(147)^*(\mathbb {Q})\) equals

$$\begin{aligned} X_0(147)^*(\mathbb {Q}) = \left\{ \pm \infty , (0,\pm 3), (1,\pm 2), (-2,\pm 7), \left( \frac{3}{2},\pm \frac{21}{2^3}\right) ,\left( -\frac{5}{3},\pm \frac{154}{3^3}\right) \right\} . \end{aligned}$$

We handle the \(N=255\) and \(N=330\) cases similarly.

We now proceed with an example of how to compute the points on a modular covering, simpler than the method described in Sect. 2.7: A model of \(X_0(147)^+\) can be computed in Magma, together with its automorphisms. Since there are only two, the non-trivial automorphism of \(X_0(147)^+\) defined over \(\mathbb {Q}\) must be the projection of \(w_3 = w_{49}\), and hence we obtain an explicit map

$$\begin{aligned} X_0(147)^+ \rightarrow X_0(147)^*. \end{aligned}$$

As we know \(X_0(147)^*(\mathbb {Q})\), we can look at preimages of the points under the above map to find that \(\#X_0(147)^+(\mathbb {Q}) = 4\).

B. Banwait and F. Najman were the first to point out the need to compute \(\mathbb {Q}\)-rational points on \(X_0(147)^+\) and \(X_0(147)^*\). Their forthcoming work with the fourth author [15] determines all the cyclic isogenies of elliptic curves over \(\mathbb {Q}(\sqrt{213})\). Before considering this number field, they examined \(\mathbb {Q}(\sqrt{-5})\), and for this choice of number field they had to consider the level \(N = 147\).

For the following non-squarefree levels N with \(r \in \{0,1\}\) we are using classical Chabauty–Coleman: The rank 0 levels are \(N = 104\), 117, 180, and 168, and the rank 1 levels are \(N = 88\), 116, 121, 153, 184, 198, 380, 112, 135, 204, 276, and 284. Arul and Müller [4] determined the \(\mathbb {Q}\)-rational points on the curve \(X_0(125)^+\) with rank \(r = 2\) using quadratic Chabauty.

4 Hyperelliptic \(X_0(N)^*\) of genus \(\ge 3\)

Recall from Theorem 1.2 that the only levels N such that \(X_0(N)^*\) is hyperelliptic of genus \(\ge 3\) are \(N = 136\), 171, 207, 252, 315, 176, and 279.

These 7 levels are addressed with the following methods:

  • Chabauty–Coleman: 136 (Stoll’s bound Theorem 4.1), 171, 176, 279;

  • a degree 2 map to a rank 0 elliptic curve quotient for 207, 252, 315;

  • a covering collection technique for 176. (Note that this level appears twice.)

We provide some details below.

We use the following quantitative sharpening of Chabauty–Coleman by Stoll:

Theorem 4.1

([54, Corollary 6.7]) Let C be a nice curve of genus \(g \ge 2\). Let r be the rank of its Jacobian over \(\mathbb {Q}\). Let p be a prime of good reduction for C. If \(r < g\) and \(p > 2r+2\), then

$$\begin{aligned} \#C(\mathbb {Q}) \le \#C(\mathbb {F}_p) + 2r. \end{aligned}$$

In Table 5 we list all curves for which we use the effective_chabauty function from [22]. For these curves, we first verify that differences of rational points on the curve generate a finite index subgroup of the Mordell-Weil group of the Jacobian. This is done in the file Coleman/diff_of_ratpts.m in our GitHub repository [2]. We do not need the Mordell-Weil sieve step for these curves. These are the only curves for which we actually need to compute a Chabauty function because the bound in Theorem 4.1 is not sharp.

Table 5 Data used to do the Chabauty–Coleman computations using the function effective_chabauty from [22]

The other levels are approached as follows:

For \(X_0(136)^*\), we have \(g = 3\) and \(r = 0\). Using Theorem 4.1 with \(p=3\) we conclude that \(\#X_0(136)^*(\mathbb {Q}) = 4\).

For \(N \in \{207,252,315 \}\), the curve \(X_0(N)^*\) has an explicit degree 2 map to an elliptic curve of rank 0, so the rational points are computed as preimages.

For \(N = 176\), in addition to the Chabauty–Coleman method presented in the table above, one can also use a covering collection technique, as described below:

We have that the Jacobian of

$$\begin{aligned} X_0(176)^*: y^2 = x(x^3 - 2x^2 + 2)(x^3 - 4x + 4)(x^3 + 2x^2 - 2) \end{aligned}$$

has rank 1 over \(\mathbb {Q}\). Let \(f_1 = x(x^3 - 2x^2 + 2)\) and \(f_2 = (x^3 - 4x + 4)(x^3 + 2x^2 - 2)\), whose resultant is \(2^{12}\). We then have to consider the following covering collection

$$\begin{aligned} X_d : y_1^2 = df_1(x), \quad y_2^2 = df_2(x),\quad d \in \{ \pm 1, \pm 2\}. \end{aligned}$$

Consider the curves

$$\begin{aligned} Y_d : y^2 = df_2(x), \quad d \in \{ \pm 1, \pm 2\}. \end{aligned}$$

The Jacobians of \(Y_1\) and \(Y_{-2}\) have rank 1 and those of \(Y_{-1}\) and \(Y_2\) have rank 0, so we can use Chabauty and Chabauty0, respectively, in Magma to find all the rational points. Then we can find all the rational points on the covering collection \(\{X_d\}\), and then show that \(\#X_0(176)^*(\mathbb {Q}) = 5\).