## 1. Introduction

In this paper, we describe the current state of quadratic Chabauty-based algorithms for the resolution of Diophantine equations arising from modular curves. Here we consider the usual modular curves associated to congruence subgroups of $\mathrm {SL}_2(\mathbf {Z})$, as well as Atkin–Lehner quotients thereof.

Recall the motivating question of the subject. Let $E$ be an elliptic curve over a number field $K$. What are the possible ways for the Galois group $\mathrm {Gal} (\overline {K}/K)$ to act on the group of torsion points of $E$? Equivalently, what are the conjugacy classes of subgroups of $\mathrm {GL} _2 (\mathbf {Z}/N\mathbf {Z})$ arising as images of the mod $N$ Galois representation $\rho _{E,N}$?

By a theorem of Serre [Reference SerreSer72], if $E$ is an elliptic curve without complex multiplication, then for all primes $N\gg 0$, the representation $\rho _{E,N}$ is surjective. Serre's uniformity question [Reference SerreSer72] asks whether this can be made *uniform* over $\mathbf {Q}$: is there an $N_0$ such that, for all primes $N>N_0$, if $E/\mathbf {Q}$ is an elliptic curve without complex multiplication, then $\rho _{E,N}$ is surjective? By a classification of maximal subgroups of $\mathrm {GL} _2 (\mathbf {Z}/N\mathbf {Z})$, this amounts to determining elliptic curves whose mod $N$ Galois representation is contained in a Borel subgroup, the normaliser of a split Cartan subgroup, the normaliser of a non-split Cartan subgroup, or an ‘exceptional’ subgroup (such that the projective image is $S_4$, $A_4$, or $A_5$).

Mazur's Program B [Reference MazurMaz77] asks for all of the possible Galois actions on torsion subgroups of elliptic curves without complex multiplication. This question includes Serre's uniformity question but is more general. From a Diophantine perspective, it roughly amounts to determining the rational points on all modular curves.

Rouse and Zureick-Brown [Reference Rouse and Zureick-BrownRZB15] settled this in the context of 2-primary torsion and very recently, with Sutherland [Reference Rouse, Sutherland and Zureick-BrownRSZB22], studied this in the context of $\ell$-primary torsion for other primes $\ell$. For each prime, this produces a finite number of curves, the determination of whose rational points would resolve the $\ell$-primary part of Mazur's question. In §§ 5.1 and 5.3 we compute the rational points on four modular curves $X_{S_4}(13), X_{\scriptstyle \mathrm { ns}}^+(17), X_{11}$ and $X_{15}$ arising in Mazur's Program B. In particular, we prove the following theorem.

Theorem 1.1 We have $\#X_{S_4}(13)(\mathbf {Q}) = 4$. One of these points is a complex multiplication (CM) point, corresponding to discriminant $D=-3$. The other three are exceptional, with corresponding $j$-invariants listed in § 5.1.

Here we call a non-cuspidal rational point *exceptional* if it does not correspond to an elliptic curve with complex multiplication. The curve $X_{S_4}(13)$ has genus 3. This completes the classification of elliptic curves $E/\mathbf {Q}$ and prime level $N>0$ such that $\rho _{E,N}$ is contained in an exceptional subgroup.

We also determine the rational points on $X_{\scriptstyle \mathrm { ns}}^+(17)$, the non-split Cartan modular curve of level 17, which is a genus 6 curve.

Theorem 1.2 We have $\#X_{\scriptstyle \mathrm { ns}}^+(17)(\mathbf {Q}) = 7$ and all of these points are CM, corresponding to discriminants $-3, -7, -11,$ $-12, -27, -28, -163$.

Theorems 1.1 and 1.2 complete the classification of the possible 13-adic and 17-adic images of Galois.

Moving beyond torsion points of elliptic curves over $\mathbf {Q}$, another interesting problem in the Diophantine geometry of modular curves is the determination of the set of rational points on the Atkin–Lehner quotient

of the modular curve $X_0 (N)$. In [Reference GalbraithGal02], Galbraith asks whether, for all primes $N\gg 0$, the only rational points on $X_0 ^+ (N)$ are cusps or CM points. From a moduli perspective, this amounts to finding quadratic $\mathbf {Q}$-curves that are $N$-isogenous to their conjugates. Dogra and Le Fourn [Reference Dogra and Le FournDLF21] proved that the quadratic Chabauty set $X_0^+(N) (\mathbf {Q} _p )_2$ is finite whenever the genus of $X_0^+(N)$ is greater than $1$. Hence, it is natural to ask whether the methods of this paper can be used to give an algorithm for computing $X_0^+(N) (\mathbf {Q} _p )_2$ for any $N$. In fact, in the range of $N$ we consider, finiteness of $X_0 ^+ (N)(\mathbf {Q} _p)_2$ follows from a criterion appearing in earlier work of Siksek [Reference SiksekSik17]. Our computations described in § 5.2 prove the following result.

Theorem 1.3 The only prime values $N$ such that the curve $X_0^+(N)$ is of genus $2$ or $3$ and has an exceptional rational point are $N=73,\ 103,\ 191$. In particular, for prime $N$, there are no exceptional rational points on curves $X_0^+(N)$ of genus 3.

All rational points in Theorem 1.3 have already been found by Galbraith [Reference GalbraithGal99].

Remark 1.4 These computations were recently extended significantly by Adžaga, Arul, Beneish, Chen, Chidambaram, Keller and Wen [Reference Adžaga, Arul, Beneish, Chen, Chidambaram, Keller and WenAAB^{+}21]. They use the quadratic Chabauty method described in this paper to determine the set of rational points on all curves $X_0 ^+ (N)$ of genus 4, 5 and 6 and prime level $N$. Arul and Müller [Reference Arul and MüllerAM23] also compute the rational points on $X_0^+(125)$ using the same method. Adžaga, Chidambaram, Keller and Padurariu [Reference Adžaga, Chidambaram, Keller and PadurariuACKP22] use several techniques, including quadratic Chabauty, to determine the set of rational points on the hyperelliptic Atkin–Lehner star quotient curves $X_0^*(N)$.

Going further, one may wonder what the potential applications of these algorithms are to *non-modular* curves. The main stumbling block in attempting such a generalisation is our running assumption on the Mordell–Weil rank and Picard number of the Jacobian (see § 2.1). Since a generic curve has Picard number $1$, it is not clear how often one should expect a genus $g$ curve with Mordell–Weil rank $g$ to satisfy the quadratic Chabauty hypothesis. Nevertheless, there are other interesting curves where one *would* expect to get some mileage out of such algorithms. The most obvious examples are (Atkin–Lehner quotients of) Shimura curves. In particular, determining the set of rational points on the (infinitely many) curves $X^D /\langle w_D\rangle$, in the notation of Parent and Yafaev [Reference Parent and YafaevPY07], would resolve a conjecture of Clark [Reference ClarkCla03] (Parent and Yafaev determine the rational points for an infinite family of Shimura curves whose Jacobian contains a rank zero isogeny factor).

## 2. Quadratic Chabauty: theory

We give a brief overview of the quadratic Chabauty method. A more complete exposition can be found in [Reference Balakrishnan, Best, Bianchi, Lawrence, Müller, Triantafillou and VonkBBB^{+}21], and we refer the reader to [Reference Balakrishnan and DograBD18, Reference Balakrishnan, Dogra, Müller, Tuitman and VonkBDM^{+}19] for more precise details and proofs. Our description is in terms of Galois representations and filtered $\phi$-modules, but we note that recently Edixhoven and Lido [Reference Edixhoven and LidoEL23] gave a geometric version of quadratic Chabauty, which they used to determine the set of rational points on the bielliptic modular curve $X_0(129)/\langle w_3, w_{43} \rangle$ of genus 2. Duque-Rosero, Hashimoto and Spelier [Reference Duque-Rosero, Hashimoto and SpelierDRHS22] have related this approach to that presented here and used this to give algorithms for geometric quadratic Chabauty for hyperelliptic curves. Besser, Müller and Srinivasan [Reference Besser, Müller and SrinivasanBMS21] have also given an alternative approach to the quadratic Chabauty method based on a new construction of $p$-adic heights on abelian varieties via $p$-adic Arakelov theory.

An early version of the method appeared in work of Kim [Reference KimKim10, Reference Balakrishnan, Kedlaya and KimBKK11], where Massey products were used to construct a locally analytic function, vanishing on the set of integral points of an elliptic curve of rank $1$. These functions were interpreted as height functions, extending the method, in Balakrishnan and Besser [Reference Balakrishnan and BesserBB15] and Balakrishnan, Besser and Müller [Reference Balakrishnan, Besser and MüllerBBM16]. It was extended to its current form in Balakrishnan and Dogra [Reference Balakrishnan and DograBD18], where a systematic use of Nekovář's theory of $p$-adic heights suggested a streamlined approach towards a very general class of curves allowing an abundance of geometric correspondences. It was carried out to determine the set of rational points on $X_{\rm s}^+(13)$, the split Cartan curve of level 13, in [Reference Balakrishnan, Dogra, Müller, Tuitman and VonkBDM^{+}19].

Remark This method fits into the vastly more general framework developed by Kim [Reference KimKim05, Reference KimKim09], elaborating on the idea of studying rational points on curves through path torsors of the étale fundamental group, suggested by Grothendieck's section conjecture. The approach discussed here represents an effective way to make this theory computable and applicable to a variety of examples. It is, however, important to note that different quotients of the fundamental group have been successfully used for this purpose (see, for instance, [Reference Balakrishnan and DograBD21]). Finally, although we restrict our attention to the base field $\mathbf {Q}$, suitable versions exist over number fields (see [Reference Balakrishnan and DograBD18, Reference Balakrishnan and DograBD21, Reference Balakrishnan, Besser, Bianchi and MüllerBBBM21]).

### 2.1 Rational points and global heights

Consider a smooth projective curve $X_{\mathbf {Q}}$ of genus $g \geq 2$ whose Jacobian $J$ has rank $r=g$. We also assume that the abelian logarithm induces an isomorphism

and that $X(\mathbf {Q})$ is non-empty, so we may choose a base point $b$ in $X(\mathbf {Q})$. Suppose that the Néron–Severi rank $\mathrm {rk}_{\mathbf {Z}} \mathrm {NS}(J)$ is at least $2$, so that there exists a non-trivial class

As explained in Balakrishnan and Dogra [Reference Balakrishnan and DograBD18, Lemma 3.2], we can attach to any such choice of $Z$ a suitable quotient $U_Z$ of the $\mathbf {Q}_p$-pro-unipotent fundamental group of $X_{\bar {\mathbf {Q}}}$, which, via a twisting construction by path torsors, gives rise to a certain family of Galois representations,

where $K \in \{ \mathbf {Q}, \mathbf {Q}_p \}$ and $G_K$ is the absolute Galois group of $K$. We refer the reader to [Reference Balakrishnan and DograBD18, § 5.1] for the details of this construction (in particular, for the equivalence relation), and merely recall here that with respect to a suitable choice of basis, the representation $\mathrm {A}(x)$ is lower triangular, of the form

where

is a frame for the Galois action on the $p$-adic étale homology $V = \mathrm {H}^1_{\scriptstyle \mathrm {\acute {e}t}}(X_{\overline {K}}, \mathbf {Q}_p)^{\vee }$, and $\chi _p\colon G_K \to \mathbf {Q}_p^{\times }$ is the $p$-adic cyclotomic character. Representations of this form, which admit a $G_K$-stable filtration with graded pieces $\mathbf {Q}_p(1), V, \mathbf {Q}_p$, are referred to as *mixed extensions* (see [Reference Balakrishnan, Dogra, Müller, Tuitman and VonkBDM^{+}19, § 3.1]).

The theory of $p$-adic heights due to Nekovář [Reference NekovářNek93, § 2] attaches to any mixed extension $M$ a $p$-adic height $h(M)$. When applied to the family of mixed extensions $\mathrm {A}(x)$, this results in a map

The algebraic properties of this map lie at the heart of the quadratic Chabauty method. Most notably, the method relies on the following two facts.

− The $p$-adic height is a bilinear function of the pair of cohomology classes $([\alpha ], [\beta ])$ associated to the vectors appearing in (2.2).

− It decomposes as a sum of local height functions $h_v$ defined locally at every finite place $v$.

### 2.2 Local decomposition

We now discuss in more detail the decomposition of the global $p$-adic height $h$ described above, as a sum of local height functions

The nature of these local height functions is as follows.

(i)

*The case*$v \neq p$*.*It follows from Kim and Tamagawa [Reference Kim and TamagawaKT08, Corollary 0.2] that the function $h_v$ has finite image, in the sense that there exists a finite set $\Upsilon _v$ such that\[ h_v \colon X(\mathbf{Q}_v) \longrightarrow \Upsilon_v \subset \mathbf{Q}_p. \](ii)

*The case*$v=p$*.*The map $h_p$ is locally analytic and has a simple description in terms of linear algebra data of the filtered $\phi$-module\[ M(x) := \big( \mathrm{A}(x) \otimes_{\mathbf{Q}_p} \mathrm{B}_{\scriptstyle \mathrm{ crys}}\big)^{G_{\mathbf{Q}_p}}, \]where $\mathrm {B}_{\scriptstyle \mathrm { crys}}$ is Fontaine's crystalline period ring. A crucial point in the method of quadratic Chabauty is that the definition of the family of Galois representations $\mathrm {A}(x)$ comes from a motivic quotient of the fundamental group of $X$, and non-abelian $p$-adic Hodge theory yields an analogous de Rham realisation in the form of a filtered connection $(\mathscr {M},\nabla )$ on $X$ with a Frobenius structure, together with an isomorphism of filtered $\phi$-modules\[ x^* \mathscr{M} \simeq M(x) \](see [Reference Balakrishnan, Dogra, Müller, Tuitman and VonkBDM^{+}19, § 5]). We have a pair of elements $\pi _1 (M(x))$ and $\pi _2 (M(x))^\vee (1)$ of $\mathrm {H}^0 (X_{\mathbf {Q} _p },\Omega )^\vee$ associated to the filtered $\phi$-module $M(x)$, via the isomorphism\[ \mathrm{Ext} ^1 _{\scriptstyle \mathrm{ Fil} ,\phi }(\mathbf{Q} _p ,\mathrm{H} ^1 _{\scriptstyle \mathrm{dR}}(X_{\mathbf{Q} _p })^\vee )\simeq \mathrm{H} ^0 (X_{\mathbf{Q} _p },\Omega )^\vee . \]

### 2.3 Finiteness

The decomposition $h = \sum _v h_v$ can be used to leverage the bilinear nature of $h$ against the properties of the functions $h_v$. By (1) in § 2.2, we know that there exists a finite set $\Upsilon = \Upsilon _Z \subset \mathbf {Q}_p$ such that

for any $x$ in $X(\mathbf {Q})$. In § 3, we describe how the terms in this equation may be computed explicitly.

− The set $\Upsilon$ is given by $\{\sum _v \epsilon _v :\epsilon _v \in \Upsilon _v \}$, where the sum is over primes of bad reduction, and $\Upsilon _v$ is the set of values of $h_v (x)$ for $x\in X(\mathbf {Q} _v ).$ For $v\ne p$, the map $h_v$ is made more explicit in § 3.1 using the results of Betts and Dogra [Reference Betts and DograBD19] to compute $\Upsilon _v$ when a regular semi-stable model $\mathcal {X}$ is known. The map $h_v$ factors through the reduction map to the irreducible components of the special fibre of $\mathcal {X}$.

− The map $h_p$ may be computed using [Reference Balakrishnan, Dogra, Müller, Tuitman and VonkBDM

^{+}19, §§ 4,5], where it is explained how the universal properties of the bundle $\mathscr {M}$ rigidify the (known) structures on the graded pieces, enough to allow us to compute them explicitly (see § 3.2).− Using the isomorphism (2.1), we may view the global height as a pairing

\[ h \colon \mathrm{H}^0(X_{\mathbf{Q}_p},\Omega^1)^{\vee} \otimes \mathrm{H}^0(X_{\mathbf{Q}_p},\Omega^1)^{\vee} \longrightarrow \mathbf{Q}_p. \]Using global information, such as an abundance of global points $x \in X(\mathbf {Q})$ if available, we can solve for the height pairing. This is discussed in § 3.3, where we also explain what to do when too few rational points are available.

Via the above, the map $h$ may be extended to a bilinear map

The resulting map

is known to be Zariski dense on every residue disk. We call $\rho$ a *quadratic Chabauty function*, and we write $\rho _Z$ if we want to emphasise the dependence on $Z$. Hence (2.3) implies that $X(\mathbf {Q})$ is finite. Moreover, the computable nature of the quantities involved in (2.3), discussed at length in the next section, allows us to explicitly determine a $p$-adic approximation of the finite set

As explained in [Reference Balakrishnan and DograBD18, Proposition 5.5], this finite set contains the Chabauty–Kim set $X(\mathbf {Q} _p )_2$. In particular, a proof that this set equals $X(\mathbf {Q} )$ gives a verification of Kim's conjecture [Reference Balakrishnan, Dan-Cohen, Kim and WewersBDCKW18, Conjecture 3.1] for the curve $X$ (we refer the reader to [Reference Balakrishnan, Dan-Cohen, Kim and WewersBDCKW18, Definition 2.7] for the definitions of the set $X(\mathbf {Q} _p )_2$).

## 3. Quadratic Chabauty: algorithms

In this section, we discuss the computation of the three ingredients outlined above:

(i) the local height function $h_v$ for $v$ away from $p$, which is described in § 3.1 using the techniques in Betts and Dogra [Reference Betts and DograBD19], given a regular semi-stable model at $v$;

(ii) the height function $h_p$, whose computation using the techniques of [Reference Balakrishnan, Dogra, Müller, Tuitman and VonkBDM

^{+}19] is described in § 3.2;(iii) the determination of the global height pairing $h$, described in § 3.3 using rational divisors as input in the absence of a supply of rational points on the curve.

Our contribution in this paper lies mainly in (i) and (iii), which reflect general features of the method of quadratic Chabauty that were not needed for the curve $X_{\rm s}^+(13)$ treated in [Reference Balakrishnan, Dogra, Müller, Tuitman and VonkBDM^{+}19]. In addition, we discuss some computational techniques to further automate the method of quadratic Chabauty to work for a wide class of modular curves. This includes the Mordell–Weil sieve, which is used to attempt to further refine the finite set of local points in the output to the true set of rational points $X(\mathbf {Q})$.

Remark 3.1 The global height depends on the choice (which we henceforth fix) of

− a non-trivial continuous idèle class character $\chi \colon \mathbf {A}_{\mathbf {Q}}^\times / \mathbf {Q}^{\times } \longrightarrow \mathbf {Q}_p$ ramified at $p$;

− a splitting $s\colon V_{\scriptstyle \mathrm {dR}}/\mathrm {Fil}^0 V_{\scriptstyle \mathrm {dR}} \longrightarrow V_{\scriptstyle \mathrm {dR}}$ of the Hodge filtration, where

\[ V_{\scriptstyle \mathrm{dR}} = \mathrm{D}_{\scriptstyle \mathrm{ crys}}(V) = \mathrm{H}^1_{\scriptstyle \mathrm{dR}}(X_{\mathbf{Q}_p})^{\vee}. \]

We also fix differentials $\omega _{0},\ldots,\omega _{2g-1}$ of the second kind whose classes form a symplectic basis of $\mathrm {H}^1_{\scriptstyle \mathrm {dR}}(X_{\mathbf {Q}_p})$ with respect to the cup product, such that $\omega _{0},\ldots,\omega _{g-1}$ generate $\mathrm {H}^0(X_{\mathbf {Q}_p},\Omega ^1)$.

### 3.1 Local heights away from $p$

Let $\ell \neq p$ and let $F$ be an endomorphism of $J$ whose class $Z$ lies in $\mathrm {Ker}\big (\mathrm {NS}(J) \to \mathrm {NS}(X) \big )$. In [Reference Betts and DograBD19], a description of the map

associated to $F$ and $\chi$ is given, in terms of harmonic analysis on the reduction graph in the sense of Zhang [Reference ZhangZha93].

To explain the result, we introduce some notation. Over some finite extension $K/\mathbf {Q} _{\ell }$, the curve $X$ admits a regular semi-stable model $\mathcal {X}_{\mathrm {reg}}/\mathcal {O}_K$, and a stable model $\mathcal {X}_{\mathrm {st}}/\mathcal {O}_K$. Let $\Gamma _{\mathrm {reg}}$ and $\Gamma _{\mathrm {st}}$ denote the dual graphs of the special fibres of these models. Recall that the *dual graph* of the special fibre is by definition the graphFootnote ^{1} whose vertices are the irreducible components of the special fibre, and whose edges are the singular points of the special fibre. The endpoints of an edge $e$ are defined to be the irreducible components containing the point (by semi-stability, a singular point $e$ lies on at most two irreducible components). By regularity, we have a reduction map

from $X(\mathbf {Q} _{\ell })$ to the vertices of the dual graph $\Gamma _{\mathrm {reg}}$.

The definition is the natural one: given $x\in X(\mathbf {Q} _{\ell })$, there is a unique extension to an $\mathcal {O}_K$-section $x\in \mathcal {X}_{\mathrm {reg}}(\mathcal {O}_K )$. Let $k$ be the residue field of $\mathcal {O}_K$. By regularity, the specialisation of $x$ to $k$ lies on a unique irreducible component of $\mathcal {X}_{\mathrm {reg},k}$.

We may give $\Gamma _{\mathrm {reg}}$ and $\Gamma _{\mathrm {st}}$ the structure of *rationally metrised* graphs (i.e. graphs whose edges $e$ have associated lengths $\ell (e)\in \mathbb {\mathbf {Q} }_{>0}$) by defining the length of an edge $e$ to be $i(e)/r$, where $i$ is the intersection multiplicity of the corresponding singular point and $r$ is the ramification degree of $K/\mathbf {Q} _{\ell }$.

Choose an orientation of the edges of $\Gamma := \Gamma _{\mathrm {st}}$, so that each $e\in E(\Gamma )$ has a source $s(e)$ and target $t(e)$ in $V(\Gamma )$. We define the (rational) homology of $\Gamma$, $H_1 (\Gamma )\subset \mathbf {Q} E(\Gamma )$, to be the kernel of the map

where $\mathbf {Q} E(\Gamma )$ and $\mathbf {Q} V(\Gamma )$ are the free $\mathbf {Q}$-vector spaces generated by $E(\Gamma )$ and $V(\Gamma )$, respectively.

Define $\Gamma _{\mathbf {Q} }$ to be the set of points on $\Gamma$ whose distance from a vertex is rational. Formally,

where the equivalence relation is that $(e_1 ,1 )\sim (e_2 ,0)$ whenever $t(e_1 )=s(e_2 )$. Since $\mathcal {X}_{\mathrm {reg}}$ is obtained from $\mathcal {X}_{\scriptstyle \mathrm {st}}$ by taking each singular point (corresponding to an edge $e$) and blowing up $i(e)$ times, we have an inclusion $V(\Gamma _{\mathrm {reg}})\subset \Gamma _{\mathbf {Q} }$ (in the terminology of [Reference Betts and DograBD19, 3.7.1], we may view $\Gamma _{\mathrm {reg}}$ as a rational subdivision of $\Gamma _{\scriptstyle \mathrm {st} }$). In this way we can think of the reduction map, $\mathrm {red}$, as a map from $X(K)$ to $\Gamma _{\mathbf {Q} }$ (see [Reference Betts and DograBD19, Definition 1.3.1]). The rationally metrised graph we obtain is independent of the choice of extension over which $X$ acquires stable reduction [Reference Chinburg and RumelyCR91, Proposition 2.6], and in fact there is an equivalent definition of $\Gamma _{\mathbf {Q} }$ as the limit of the dual graphs of special fibres of regular semi-stable models of $X_L$ over all finite extensions $L$ of $K$ (see [Reference Chinburg and RumelyCR93, § 2]).

In [Reference Betts and DograBD19, Lemma 12.1.1], a map

is defined such that $h_\ell =c\cdot j_{\Gamma }\circ \mathrm {red}$, where $c$ is a constant. The map $j_{\Gamma }$ is defined in terms of the Laplacian operator associated to $\Gamma _{\mathrm {st}}$, which we now define. We say a function

is *piecewise polynomial* if on each edge it is the restriction of a polynomial function $\mathbf {Q} \to \mathbf {Q} _p$. As in [Reference Betts and DograBD19, Definition 7.2.2], we define the *Laplacian* $\nabla ^2 (g)$ of a piecewise polynomial function $g\colon \Gamma _{\mathbf {Q} }\to \mathbf {Q} _p$ to be the formal sum

Here we write the function $g$ restricted to the edge $e$ as a polynomial in $\mathbf {Q} _p [x_e ]$ for notational simplicity, where $x_e$ is the inclusion from the edge $e$, thought of as a line segment $[0,\ell (e)]\cap \mathbf {Q}$, into $\mathbf {Q}$. Hence, we have

The Laplacian is linear on piecewise polynomial functions, and its kernel consists of constant functions. Thus $g$ is uniquely determined by $\nabla ^2(g)$ and its value at one point.

In [Reference Betts and DograBD19], an explicit construction is given of a piecewise polynomial function that corresponds, via $\mathrm {red}$, to the local height function we wish to compute. Recall that $F$ is an element of $\mathrm {End} (J)\otimes \mathbf {Q} _p$ whose image in $\mathrm {NS} (J)$ lies in the kernel of $\mathrm {NS} (J)\to \mathrm {NS} (X)$, and $b\in X(\mathbf {Q} )$ is a rational point.

#### Theorem 3.2 [Reference Betts and DograBD19, Theorem 1.1.2, Lemma 12.1.1 and Corollary 12.1.3]

Let $\Gamma$ be the dual graph of $X$ corresponding to a regular semi-stable model of $X$ over $\mathcal {O}_K$, where $K/\mathbf {Q} _{\ell }$ is a finite extension. Let $\mathrm {red} \colon X(\mathbf {Q} _{\ell } )\to V(\Gamma )$ be the reduction map. For an irreducible component $X_w$ of the special fibre of the regular semi-stable model, let $V_p (X_w )$ denote the $\mathbf {Q} _p$-Tate module of its Jacobian. The morphism $j_{\Gamma }$ is the unique piecewise polynomial function

satisfying $j_{\Gamma }(\mathrm {red} (b))=0$ and $\nabla ^2 (j_{\Gamma })=\mu _F$, where

Here, the morphism $\pi$ is by definition the orthogonal projection

with respect to the pairing $e\cdot e'=\delta _{ee'}$ on $\mathbf {Q} E(\Gamma )$, and $e^*$ is the functional $\mathbf {Q} E(\Gamma )\to \mathbf {Q}$ projecting onto the $e$ component. Recall (e.g. [Reference GrothendieckSGA7, 12.3.7]) that $V_p (X)$ admits a $G_K$-stable filtration

and we have isomorphisms of $G_K$-representations

The action of $F$ on $V_p (X)$ preserves this filtration since it is a morphism of Galois representations, and hence induces an action of $F$ on the weight $-1$ part of $V_p (X)$, which is isomorphic to $\bigoplus _w V_p (X_w )$. Although the action of $F$ need not respect the direct sum decomposition, the decomposition

implies that we can define $\mathrm {Tr} (F|V_p (X_w ))$ as the trace of the $\mathrm {End} (V_p (X_w ))$-component of $F$.

To determine the possible local heights, it suffices to compute the action of $F$ on $\mathrm {H}_1 (\Gamma )$ and on $V_p (X_v )$. In this paper, we do not discuss methods for the algorithmic computation of the action of $F$ on $\mathrm {H}_1 (\Gamma )$, but algorithms for these computations in the case when the curve $X$ is hyperelliptic will be discussed in forthcoming joint work of the first, second and fifth authors with David Corwin, Sachi Hashimoto, Benjamin Matschke, Oana Padurariu, Ciaran Schembri and Tian Wang.

As we explain in § 5.4, one can sometimes use partial information deduced from Theorem 3.2 to determine the possible local heights without computing the action of $F$ on $\mathrm {H}_1 (\Gamma )$ (e.g. if one has enough rational points on $X$ that are suitably independent in $J(\mathbf {Q})$ and $\Gamma _{\mathbf {Q} }$).

Example 3.3 One example for which this strategy succeeds is the curve $C_{188}/\mathbf {Q}$ defined by the equation $y^2 = x^5 - x^4 + x^3 + x^2 - 2x + 1$, as described in Example 5.18. This curve does not have semi-stable reduction over $\mathbf {Q}_2$. Over $K=\mathbf {Q}_2[\sqrt [3]{2}]$, we find a regular semi-stable model $\mathcal {X}_{\mathrm {reg}}$ whose special fibre consists of two genus 1 curves that do not intersect and a genus zero curve intersecting both of them transversely, each at a unique point. We did not manage to obtain this information using any of the existing software packages for computing regular or semi-stable models, such as Magma's RegularModel or the SageMath package MCLF.Footnote ^{2}) Therefore we computed this model by hand, using a standard (but tedious) sequence of blow-ups.

Hence, the metric graph $\Gamma _{\mathrm {reg}}$ is a line segment and the image of $C_{188}(\mathbf {Q} _2 )$ in $\Gamma _{\mathbf {Q} }$ consists of three points on this line. The two edges of $\Gamma _{\mathrm {reg}}$ both have length $1/3$. In this case, since $\Gamma$ has trivial homology, the function $j_{\Gamma }$ is affine linear, so it is uniquely determined by evaluating it at two distinct points. We use this to compute the rational points on $C_{188}$ in Example 5.18.

### 3.2 Local heights at $p$

We discuss the local height component

which appeared in [Reference Balakrishnan, Dogra, Müller, Tuitman and VonkBDM^{+}19, § 5]. Recall that $h_p$ is a locally analytic function, described in terms of the filtered $\phi$-module $M(x)$ discussed in § 2.2. Concretely, we may find two unipotent isomorphisms

where $\lambda ^{\phi }$ respects the Frobenius action and $\lambda ^{\mathrm {Fil}}$ respects the Hodge filtration, which with respect to a suitable basis for $M(x)$ may be represented in ($1+2g+1$)-block matrix form as

(see [Reference Balakrishnan, Dogra, Müller, Tuitman and VonkBDM^{+}19, § 5.3] and [Reference Balakrishnan, Dogra, Müller, Tuitman and VonkBDM^{+}19, § 4.5], respectively). The isomorphism $\lambda ^\phi$ is uniquely determined, whereas $\lambda ^{\mathrm {Fil}}$ is only well defined up to the stabiliser of the Hodge filtration $\mathrm {Fil}^0$. A suitable choice gives $\boldsymbol {\alpha }_{\mathrm {Fil}} =0$.

The splitting $s$ of the Hodge filtration (see Remark 3.1) defines idempotents $s_1,s_2$ on $V_{\scriptstyle \mathrm {dR}}$ with images $s(V_{\scriptstyle \mathrm {dR}}/\mathrm {Fil}^0 V_{\scriptstyle \mathrm {dR}})$ and $\mathrm {Fil}^0 V_{\scriptstyle \mathrm {dR}}$ respectively, with respect to which the local height at $p$ is

by [Reference Balakrishnan, Dogra, Müller, Tuitman and VonkBDM^{+}19, Equation (17)].

In [Reference Balakrishnan, Dogra, Müller, Tuitman and VonkBDM^{+}19] we outline a method to compute these quantities explicitly as functions of the local point $x$ in $X(\mathbf {Q}_p)$, which exploits the existence of the connection $(\mathscr {M},\nabla )$ discussed in § 2.2. The Hodge filtration and Frobenius structures of this bundle are characterised by suitable universal properties, discussed at length in [Reference Balakrishnan, Dogra, Müller, Tuitman and VonkBDM^{+}19, §§ 4 and 5]. We have made the algorithms for the computation of $h_p$ more general and streamlined and have added a precision analysis in § 4 but have not made further contributions to this part of the method beyond what is already contained in [Reference Balakrishnan, Dogra, Müller, Tuitman and VonkBDM^{+}19].

### 3.3 The global height pairing

One key step in the construction of a quadratic Chabauty function is to write the global height pairing $h$ in terms of a basis of the space of bilinear pairings on $\mathrm {H}^0(X_{\mathbf {Q}_p}, \Omega ^1)^{\vee }$. In [Reference Balakrishnan, Dogra, Müller, Tuitman and VonkBDM^{+}19], we had as a working hypothesis that our curve $X$ had sufficiently many rational points, in the following sense. For $x\in X(\mathbf {Q}_p)$, the Galois representation $\mathrm {A}(x)$ can be projected onto $\mathrm {H}^1_f(G_T, V)$ (respectively, $\mathrm {H}^1_f(G_T, V^*(1))$), where $G_T$ is the maximal quotient of $G_{\mathbf {Q}}$ unramified outside $T =\{p\}\cup \{$bad primes for $X\}$. With respect to the dual basis $\omega ^\ast _0,\ldots,\omega ^\ast _{g-1},$ the image is the vector $\alpha$ (respectively, $\beta )$ in (2.2). Both of these cohomology groups are isomorphic, under our running assumptions, to $\mathrm {H}^0(X_{\mathbf {Q}_p}, \Omega ^1)^{\vee }$, so we obtain

Suppose that we can find a basis of $\mathrm {H}^0(X_{\mathbf {Q}_p}, \Omega ^1)^{\vee } \otimes \mathrm {H}^0(X_{\mathbf {Q}_p}, \Omega ^1)^{\vee }$ consisting of elements of the form $\pi (\mathrm {A}_Z(b,x))$, where the $Z$ are cycles on $J$ pulling back to degree 0 cycles on $X$, and the $x$ are rational points on $X$. Then we can compute the coefficients of $h$ in terms of the dual basis by evaluating $h_p(\mathrm {A}_Z(b,x))$ (and, if necessary, $h_{\ell }(\mathrm {A}_Z(b,x))$ for primes $\ell \ne p$). With this choice of basis, the extension of $h$ to a locally analytic function $h\colon X(\mathbf {Q}_p)\to \mathbf {Q}_p$ is immediate.

The number of rational points required can be reduced by working with symmetric heights that are $\mathrm {End}(J)$-equivariant. By the latter we mean that $h(f(x), y) = h(x, f(y))$ for all $f\in \mathrm {End}(J)$, using (2.1). This holds if the splitting $s$ of the Hodge filtration on $V_{\scriptstyle \mathrm {dR}}$ commutes with $\mathrm {End}(J)$ and has the property that $\ker (s)$ is isotropic with respect to the cup product (see [Reference NekovářNek93, § 4.11] and [Reference Balakrishnan and DograBD21, § 4.1]). For instance, if $p$ is a prime of ordinary reduction for the Jacobian, then the height associated to the unit root splitting (see Remark 3.15) is symmetric and $\mathrm {End}(J)$-equivariant. Henceforth we shall assume that $s$ satisfies these assumptions, and we say that $X$ has *sufficiently many rational points* if the approach outlined above succeeds.

#### 3.3.1 Heights on the Jacobian

If our curve does not have sufficiently many rational points in the above sense, then, in light of (2.1), it is natural to solve for the height pairing using rational points on the Jacobian. In this case, we do not have an algorithm at our disposal to compute $h$ using Nekovář's construction, but we can use the equivalence between this construction and that of Coleman and Gross [Reference Coleman and GrossCG89], proved by Besser [Reference BesserBes04]. In the case when the curve is hyperelliptic and given by an odd-degree model over $\mathbf {Q}_p$ (but see Remark 3.7), we can further use the algorithm of Balakrishnan and Besser [Reference Balakrishnan and BesserBB12, Reference Balakrishnan and BesserBB21]. In the discussion that follows, we will assume that we are in this situation. We will also assume that we know $g$ independent points on the Jacobian.

Recall from Remark 3.1 that we have fixed a continuous idèle class character $\chi \colon \mathbf {A}_{\mathbf {Q}}^\times / \mathbf {Q}^{\times } \longrightarrow \mathbf {Q}_p$ ramified at $p$ and a splitting $s\colon V_{\scriptstyle \mathrm {dR}}/\mathrm {Fil}^0 V_{\scriptstyle \mathrm {dR}} \longrightarrow V_{\scriptstyle \mathrm {dR}}$ of the Hodge filtration on $V_{\scriptstyle \mathrm {dR}} = \mathrm {H}^1_{\scriptstyle \mathrm {dR}}(X_{\mathbf {Q}_p})^{\vee }\,.$ The latter corresponds to a subspace $W\subset H^1_{\scriptstyle \mathrm {dR}}(X_{\mathbf {Q}_p})$, complementary to the image of $\mathrm {H}^0(X_{\mathbf {Q}_p},\Omega ^1)$. With respect to these choices, Coleman and Gross define the *local* $p$*-adic height pairing* $h_v(D_1,D_2) \in \mathbf {Q}_p$ at a finite prime $v$ for divisors $D_1,D_2\in \mathrm {Div}^0(X_{\mathbf {Q}_v})$ with disjoint support. The local pairing is bi-additive, and we have $h_v(D_1,D_2) = \chi _v(f(D_2))$ if $D_2 = \operatorname {div}(f)$ is principal. For $v\ne p$, the pairing $h_v$ is also symmetric; $h_p$ is symmetric if and only if $W$ is isotropic with respect to the cup product pairing, which we will assume from now on. Moreover, for $D_1,D_2\in \mathrm {Div}^0(X)$ with disjoint support, only finitely many $h_v(D_1,D_2):= h_v(D_1\otimes \mathbf {Q}_v ,D_2\otimes \mathbf {Q}_v)$ are non-zero. Therefore $h:= \sum _v h_v$ defines a symmetric bilinear pairing $h\colon J(\mathbf {Q})\times J(\mathbf {Q})\to \mathbf {Q}_p$ (see [Reference Coleman and GrossCG89, § 6]).

If we have algorithms to compute the local height pairings, we can solve for the global height pairing in terms of the basis of symmetric bilinear pairings on $J(\mathbf {Q})\otimes \mathbf {Q}_p$ defined by

Since we can express $\pi _1(\mathrm {A}(x))$ and $\pi _2(\mathrm {A}(x))$ in terms of the dual basis $\{\omega _i^*\}$, we can compute $g_{ij}(\pi (\mathrm {A}(x)))$ for $x\in X(\mathbf {Q}_p)$ (with the obvious abuse of notation) and extend $h$ to a locally analytic function $h\colon X(\mathbf {Q}_p)\to \mathbf {Q}_p$.

It remains to discuss the computation of the local heights. For $D_1,D_2\in \mathrm {Div}^0(X_{\mathbf {Q}_p})$ with disjoint support, the local height is the Coleman integral certain differential with residue divisor $\mathrm {Res}(\omega _{D_1})=D_1$, and $c_p$ is a constant so that $c_p^{-1}\chi _p$ extends to a branch $\mathbf {Q}_p^\times \to \mathbf {Q}_p$ of the $p$-adic logarithm; the Coleman integral is taken with respect to this branch. The differential $\omega _{D_1}$ is normalised with respect to the splitting $s$ using a homomorphism

from $T(\mathbf {Q}_p)$, the group of differentials of the third kind with integer residues on $X$, quotiented by $T_l(\mathbf {Q}_p)$, the group of logarithmic differentials $\frac {df}{f}$ with $f\in \mathbf {Q}_p(X)^*$, as in the algorithm below. We restrict to degree zero divisors of the form $P-Q$ where $P,Q$ are non-Weierstrass points in $X(\mathbf {Q}_p)$ that do not reduce to a Weierstrass point in $X(\mathbf {F}_p)$ since we will need to compute Coleman integrals between $P,Q$, and our implementation assumes that these points are in non-Weierstrass disks and defined over $\mathbf {Q}_p$.

##### Algorithm 3.4 The local height $h_p(D_1,D_2)$ at $p$ of the global $p$-adic height [Reference Balakrishnan and BesserBB12]

Input:

− Hyperelliptic curve $X/\mathbf {Q}_p$, given by an affine model $y^2=f(x)$, where $f\in \mathbf {Z}_p[x]$ is square-free of degree $2g+1>2$.

− Prime $p>2g-1$ of good reduction.

− Choice of isotropic subspace $W$ of $H^1_{\scriptstyle \mathrm {dR}}(X_{\mathbf {Q}_p})$, complementary to the subspace of regular 1-forms $\mathrm {H}^0(X_{\mathbf {Q}_p},\Omega ^1)$.

− Divisors $D_1 = P-Q, D_2 = R-S$, where $P,Q,R,S$ are non-Weierstrass points in $X(\mathbf {Q}_p)$ that do not reduce to a Weierstrass point in $X(\mathbf {F}_p)$, and $R,S$ do not lie in the residue disks of $P,Q$.

Output: The local height $h_p(D_1,D_2)$ at $p$ of the Coleman–Gross global $p$-adic height

(i) Choose $\omega$ a differential in $T(\mathbf {Q}_p)$ with $\text {Res}(\omega )=D_1$.

(ii) Solve for the coefficients $b_i$ of $\Psi (\omega )=\sum _{i=0}^{2g-1}b_i\omega _i\in \mathrm {H}_{\scriptstyle \mathrm {dR}}^1(X)$ by computing residues, as in [Reference Balakrishnan and BesserBB12, § 5.2]. Then $\Psi (\omega )-\sum _{i=0}^{g-1}b_i\omega _i\in W$. Let

\[ \omega_{D_1}:= \omega-\sum_{i=0}^{g-1}b_i\omega_i. \](iii) Set $\alpha := \phi ^*(\omega )-p(\omega )$. Use Frobenius equivariance of the map $\Psi$ (and the matrix of Frobenius computed with respect to the basis $\{\omega _i\}$ of $\mathrm {H}_{\scriptstyle \mathrm {dR}}^1(X)$) to compute

\[ \Psi(\alpha)=\phi^*\Psi(\omega)-p\Psi(\omega). \](iv) Let $\beta$ be a $1$-form with $\mathrm {Res}(\beta )=(R)-(S)$. Compute $\Psi (\beta )$.

(v) Compute

\[ h_p(D_1,D_2):= \int_{D_2}\omega_{D_1} = \int_{S}^R \biggl(\omega - \sum_{i=0}^{g-1}b_i\omega_i\bigr), \]where\[ \int_{S}^{R}\omega=\frac{1}{1-p}\biggl(\Psi(\alpha)\cup\Psi(\beta)+\sum_{A \in X(\mathbf{C}_p)}{\rm Res}_{A}\biggl(\alpha\int\beta\biggr)- \int_{\phi(S)}^{S}\omega-\int_{R}^{\phi(R)}\omega\biggr) \](see [Reference Balakrishnan and BesserBB12, Remark 4.9]).

Remark 3.5 Note that in the last step above, $\int _{\phi (S)}^S\omega$ and $\int _{R}^{\phi (R)}\omega$ are tiny integrals, that is, Coleman integrals between points in the same residue disk. Such integrals may be computed merely using a uniformising parameter at any point in the residue disk. The computation $\sum _{A \in X(\mathbf {C}_p)}\mathrm {Res}_{A}\big (\alpha \int \beta \big )$ will, in most cases, require working over various extension of $\mathbf {Q}_p$ to pick up all contributions at all poles (see [Reference Balakrishnan and BesserBB12, Remark 4.10]).

Remark 3.6 If our hyperelliptic curve $X$ does not admit an odd-degree model over $\mathbf {Q}$, we may choose our prime $p$ such that $X$ has an odd-degree model over $\mathbf {Q}_p$ and compute local heights at $p$ on this model. This follows from the fact that $\Psi (\varphi ^*\omega ) = \varphi ^*(\Psi (\omega ))$ for $\varphi$ an isomorphism of curves and $\omega$ a differential of the third kind.

Remark 3.7 In his thesis [Reference GajovićGaj22], Gajović has improved Algorithm 3.4 and extended it to even-degree models of hyperelliptic curves.

The local height at a prime $\ell \ne p$ is defined in terms of intersection theory. We can extend $D_1$ and $D_2$ to divisors $\mathcal {D}_1$ and $\mathcal {D}_2$ on a regular model of $X_{\mathbf {Q}_\ell }$ so that both $\mathcal {D}_i$ have trivial intersection multiplicity with all vertical divisors; then by [Reference Coleman and GrossCG89, Proposition 1.2], we have

### 3.4 Mordell–Weil sieving

The idea of the Mordell–Weil sieve, originally due to Scharaschkin [Reference ScharaschkinSch99], is to deduce information on rational points on $X$ via the intersection of the images of $X(\mathbf {F}_v)$ and $J(\mathbf {Q})$ in $J(\mathbf {F}_v)$ (or suitable quotients) for several primes $v$ of good reduction. It is often applied to verify that $X(\mathbf {Q})=\varnothing$, but it can also be combined with $p$-adic techniques to compute $X(\mathbf {Q})$ when there are rational points.

We review the basic idea, which is straightforward. Making the sieve perform well in practice is a different matter (see [Reference Bruin and StollBS10] for an elaborate discussion of the issues one encounters and detailed strategies). For ease of exposition, we assume that $J(\mathbf {Q})$ is torsion-free and that we have generators $P_1,\ldots,P_r$ of $J(\mathbf {Q})$. Let $M>1$ be an integer and let $S$ be a finite set of primes of good reduction for $X$. Then the diagram

is commutative. In the situation of interest to us, the horizontal maps are induced by our choice of base point $b \in X(\mathbf {Q})$.

In our work, we use the Mordell–Weil sieve in two ways. On the one hand, we apply it to show that for a fixed prime $p$, a given residue disk in $X(\mathbf {Q}_p)$ does not contain a rational point. To this end, we set $M = M'\cdot p$ for some suitable auxiliary integer $M'$, and we choose $S$ to consist of primes $\ell$ so that $\gcd (\#J(\mathbf {F}_{\ell }), \#J(\mathbf {F}_q))$ is large for some prime divisors $q\mid pM'$. We can then hope that the image of the reduction of the disk under $\prod \beta _{S,M}$ does not meet the image of the map $\prod \alpha _{S,M}$.

On the other hand, we use the sieve to show for fixed $M>1$ that a given coset of $MJ(\mathbf {Q})$ does not contain the image of a point in $X(\mathbf {Q})$ under the Abel–Jacobi map $P\mapsto [P-b]$. Suppose a point $P\in X(\mathbf {Q}_p)$ is given to finite precision $p^N$. If $P$ is rational, then there are integers $a_1,\ldots,a_g$ such that

Via the abelian logarithm, we compute a tuple $(\tilde {a}_1,\ldots,\tilde {a}_g) \in \mathbf {Z}/p^N\mathbf {Z}$ satisfying $a_i \equiv \tilde {a}_i \pmod {p^N}$ for all $i\in \{1,\ldots,g\}$. To show that $P$ is not rational, it suffices to show that the corresponding coset of $p^NJ(\mathbf {Q})$ does not contain the image of such a point.

In our implementation, we have not tried to optimise the interplay between quadratic Chabauty and the Mordell–Weil sieve. Such an optimisation is discussed in [Reference Balakrishnan, Besser and MüllerBBM17, § 7]. Let us only note here that we may combine quadratic Chabauty information coming from several primes, and that we can enhance that information using an auxiliary integer $M'$ similar to the above. Another account of combining quadratic Chabauty with the Mordell–Weil sieve can be found in [Reference Balakrishnan, Best, Bianchi, Lawrence, Müller, Triantafillou and VonkBBB^{+}21, § 6.7].

Remark 3.8 All examples in this paper satisfy $r=g=\mathrm {rk}_{\mathbf {Z}}\mathrm {NS}(J)$, resulting in at least two independent locally analytic functions vanishing in $X(\mathbf {Q})$ for the $g>2$ examples. Since we expect that their common zero set is precisely $X(\mathbf {Q})$ (or that there is a geometric reason for the appearance of any additional $p$-adic solutions), we do not expect to require the sieve. Indeed, we only had to apply the sieve for curves of genus 2. For these examples, we always required only one prime for the quadratic Chabauty computation; we chose this prime in such a way as to simplify the sieving.

### 3.5 Implementation and scope

We have implemented the algorithms described in this section in the computer algebra system Magma [Reference Bosma, Cannon and PlayoustBCP97]. Our code is freely available at [Reference Balakrishnan, Dogra, Müller, Tuitman and VonkBDM^{+}]. It extends the code used for $X_{\mathrm {s}}^+(13)$ in [Reference Balakrishnan, Dogra, Müller, Tuitman and VonkBDM^{+}19] and can be used to recover that example. It is applied to new examples, as discussed in § 5.

We begin by summarising our discussion so far and describe the general procedure to determine the finite set $X(\mathbf {Q}_p)_2$ as it would apply to the modular curve $X$ attached to a general congruence subgroup, and Atkin–Lehner quotients thereof. In this generality, several steps cannot be easily automated, so we discuss the extent to which our implementation has automated the procedure, and point out which steps require additional action from the user. See Example 5.3 for a fairly detailed worked example.

Our techniques are built on prior work of Tuitman on computing the action of Frobenius on rigid cohomology [Reference TuitmanTui17]. We recall some of the underlying structures present in Tuitman's work and a set of assumptions on these auxiliary structures.

Suppose our modular curve $X/\mathbf {Q}$ is given by a (possibly singular) plane model $Q=0$ with $Q(x,y) \in \mathbf {Z}[x,y]$ a polynomial that is irreducible and monic in $y$. Let $d_x$ and $d_y$ denote the degrees of the morphisms $x$ and $y$, respectively, from $X$ to the projective line. Let $\Delta (x) \in \mathbf {Z}[x]$ denote the discriminant of $Q$ with respect to the variable $y$. Moreover, define $r(x) \in \mathbf {Z}[x]$ to be the square-free polynomial with the same zeros as $\Delta (x)$, in other words, $r=\Delta /(\gcd (\Delta,{d\Delta }/{{d} x}))$.

Definition 3.9 Let $W^0 \in \mathrm {GL}_{d_x}(\mathbf {Q}[x,1/r])$ and $W^{\infty } \in \mathrm {GL}_{d_x}(\mathbf {Q}[x,1/x,1/r])$ denote matrices such that, if we denote

for all $0 \leq j \leq d_x-1$, then

(i) $[b^{0 \;}_0,\ldots,b^{0 \;}_{d_x-1}]$ is an integral basis for $\mathbf {Q}(X)$ over $\mathbf {Q}[x]$,

(ii) $[b^{\infty }_0,\ldots,b^{\infty }_{d_x-1}]$ is an integral basis for $\mathbf {Q}(X)$ over $\mathbf {Q}[1/x]$,

where $\mathbf {Q}(X)$ denotes the function field of $X$. Moreover, let $W \in \mathrm {GL}_{d_x}(\mathbf {Q}[x,1/x])$ denote the change-of-basis matrix $W=(W^0)^{-1} W^{\infty }$.

#### Assumption 3.10 [Reference TuitmanTui17, Assumption 1]

(i) The discriminant of $r(x)$ is contained in $\mathbf {Z}_p^{\times }$.

(ii) If we denote $b^0_j = \sum _{i=0}^{d_x-1} W^0_{i+1,j+1} y^i$ and $b^{\infty }_j = \sum _{i=0}^{d_x-1} W^{\infty }_{i+1,j+1} y^i$ for all $0 \leq j \leq d_x-1$, and if we let $\mathbf {F}_p(x,y)$ be the field of fractions of $\mathbf {F}_p[x,y]/(Q)$, then:

(a) the reduction modulo $p$ of $[b^{0 \;}_0,\ldots,b^{0 \;}_{d_x-1}]$ is an integral basis for $\mathbf {F}_p(x,y)$ over $\mathbf {F}_p[x]$;

(b) the reduction modulo $p$ of $[b^{\infty }_0,\ldots,b^{\infty }_{d_x-1}]$ is an integral basis for $\mathbf {F}_p(x,y)$ over $\mathbf {F}_p[1/x]$.

(iii) $W^0 \in \mathrm {GL}_{d_x}(\mathbf {Z}_p[x,1/r])$ and $W^{\infty } \in \mathrm {GL}_{d_x}(\mathbf {Z}_p[x,1/x,1/r])$.

(iv) Denote

\begin{align*} \mathcal{R}^0 &= \mathbf{Z}_p[x]b^{0}_0 +\cdots+\mathbf{Z}_p[x]b^{0}_{d_x-1}, \\ \mathcal{R}^{\infty} &= \mathbf{Z}_p[1/x]b^{\infty}_0+\cdots+\mathbf{Z}_p[1/x]b^{\infty}_{d_x-1}. \end{align*}For a ring $R$, let $R_{\textrm {red}}$ denote the reduced ring obtained by quotienting out by the nilradical. Then the discriminants of the finite $\mathbf {Z}_p$-algebras $(\mathcal {R}^0/(r(x)))_{\textrm {red}}$ and $(\mathcal {R}^{\infty }/(1/x))_{\textrm {red}}$ are contained in $\mathbf {Z}_p^{\times }$.

Remark 3.11 These conditions imply that the curve $X$ has good reduction at $p$.

#### Algorithm 3.12 Quadratic Chabauty for modular curves

Input:

− A modular curve $X/\mathbf {Q}$ with Mordell–Weil rank $r=g$ and $\mathrm {rk}_{\mathbf {Z}}\mathrm {NS}(J)>1$, and for which the image of $J(\mathbf {Q} )$ in $\mathrm {H}^0 (X_{\mathbf {Q} _p },\Omega ^1 )^\vee$ has rank $g$

− A covering of $X$ by affine opens that are birational to a planar curve cut out by an equation that is monic in one variable, has $p$-integral coefficients and satisfies Assumption 3.10 (see § 3.5.1)

− A prime $p$ of good reduction such that the Hecke operator $T_p$ generates $\mathrm {End} ^0 (J)$

− For all primes $\ell$ that are not of potentially good reduction, the local height functions $X(\mathbf {Q} _{\ell })\to \mathrm {Ker} (\mathrm {NS} (J)\to \mathrm {NS} (X))_{\mathbf {Q} _p }^*$, computed using Theorem 3.2 (see § 3.5.3)

− A starting precision $n$

− A height bound $B$

Output: An approximation to a finite set containing the set of points $X(\mathbf {Q}_p)_2$, computed to precision $n' \leq n$ or FAIL

(i) Compute the set $X(\mathbf {Q})_{\mathrm {known}}$ of points in $X(\mathbf {Q})$ with height bounded by $B$.

(ii) Compute an integral symplectic basis for $\mathrm {H}^1_{\scriptstyle \mathrm {dR}}(X_{\mathbf {Q}})$ or return FAIL.

(iii) Compute the action of Frobenius on $\mathrm {H}^1_{\scriptstyle \mathrm {dR}}(X_{\mathbf {Q}_{p}})$ using Tuitman's algorithm [Reference TuitmanTui16, Reference TuitmanTui17]. Use the Eichler–Shimura relation to compute the matrix of the action of the Hecke operator $T_{p}$ on $\mathrm {H}^1_{\scriptstyle \mathrm {dR}}(X_{\mathbf {Q}_{{p}}})$.

(iv) Compute a splitting of the Hodge filtration that is equivariant for the action of $\mathrm {End}(J)$ in the sense of § 3.3.

(v) Compute the matrices of a basis $Z_1, \ldots, Z_{\mathrm {rk}\mathrm {NS}(J) - 1}$ of $\mathrm {Ker}\big (\mathrm {NS}(J) \to \mathrm {NS}(X)\big )$ acting on $\mathrm {H}^1_{\scriptstyle \mathrm {dR}}(X_{\mathbf {Q}_{p}})$ (see § 3.5.2).

(vi) Let $A:= \varnothing$. For each $Z_i$, compute the associated heights:

(a) For each affine patch, do the following:

(i) Compute the functions $\lambda ^{\mathrm {Fil} }$ from (3.1) using [Reference Balakrishnan, Dogra, Müller, Tuitman and VonkBDM

^{+}19, § 4].(ii) Compute the functions $\lambda ^{\phi }$ from (3.1) using [Reference Balakrishnan, Dogra, Müller, Tuitman and VonkBDM

^{+}19, § 5].

(b) Solve for the height pairing, either using a large enough supply of known rational points $P_1, \ldots, P_n$ on $X$, if possible, or by computing the Coleman–Gross height pairing on $r$ independent points in $J(\mathbf {Q})$ (see § 3.5.4). If this is unsuccessful, return FAIL.

(c) Compute solutions of the function(s) coming from $Z_i$ or return FAIL if there has been too much precision loss to determine these solutions.

(d) Check that the solutions are simple. If there is a non-simple solution corresponding to a point in $X(\mathbf {Q})_{\mathrm {known}}$, return FAIL. Else, add to the set $A$ the solutions that (simultaneously) satisfy the(se) function(s).

(vii) Return $A$.

Remark 3.13 We assume that we know a priori that the Mordell–Weil rank of the Jacobian is equal to the genus of the curve. For modular curves, by Gross, Zagier, Kolyvagin and Logachev this amounts to checking that the associated eigenforms have analytic rank $1$ (see, for example, [Reference Dogra and Le FournDLF21, § 7]). For hyperelliptic curves, it is sometimes simpler to carry out a $2$-descent.

Remark 3.14 Note that if the algorithm fails due to a loss of precision, it may be possible to remedy this by increasing the starting precision. One place where increasing precision may not work is if the $p$-adic logarithm does not induce an isomorphism $J(\mathbf {Q} )\otimes \mathbf {Q} _p \simeq \mathrm {H}^0 (X_{\mathbf {Q} _p },\Omega ^1 )^\vee$, even though the rank of $J(\mathbf {Q})$ is $g$. For the Atkin–Lehner quotients $X_0 ^+ (N)$, the weak Birch–Swinnerton-Dyer conjecture implies that $J(\mathbf {Q} )$ always generates $\mathrm {H}^0 (X_{\mathbf {Q} _p },\Omega ^1 )^\vee$ (see [Reference Dogra and Le FournDLF21, Lemma 7]). In general, if $r=g$ and the Zariski closure of $J(\mathbf {Q} )$ is $J$, then a conjecture of Waldschmidt [Reference WaldschmidtWal11, Conjecture 1] (an analogue of the Leopoldt conjecture for abelian varieties) implies that the $p$-adic logarithm is always an isomorphism. In theory, if one *knew* that $J$ gave a counterexample to Waldschmidt's conjecture, and $r=g$, then one could simply apply the Chabauty–Coleman method. However, a priori it could happen that $J$ gave a counterexample but there was no way of verifying this by a computation to finite $p$-adic precision. Another place where increasing precision will not help is if there are multiple roots in step (vi)(c). However, we only expect this to happen for geometric reasons.

One can have $r>g$ for the curves $X_0 ^+ (N)$ with $N$ prime, even though $X_0 ^+ (N)(\mathbf {Q} _p )_2$ is always finite when the genus is greater than $1$ [Reference Dogra and Le FournDLF21]. However, the smallest genus for which this happens is $g=206$ (with $N=5077$), so the $r=g$ hypothesis is not the main restriction to the scope of our algorithms for this family of curves.

Remark 3.15 In the case when $p$ is a prime of ordinary reduction for the Jacobian, one may take the splitting of the Hodge filtration given by the *unit root subspace*, that is, the unit root eigenspace of Frobenius $\phi$ acting on $\mathrm {H}^1(X_{\mathbf {Q}_p})$. Given a basis $\{\eta _1, \ldots, \eta _{2g}\}$ of $\mathrm {H}^1(X_{\mathbf {Q}_p})$, where $\eta _1, \ldots, \eta _g$ are holomorphic, a basis for the unit root eigenspace mod $p^n$ is given by $\{(\phi ^*)^n\eta _{g+1},\ldots, (\phi ^*)^n\eta _{2g}\}.$

Remark 3.16 In this paper, we do not discuss algorithms for computing the input of the local height functions as maps from $\mathbf {Q} _\ell$-points to $\mathbf {Q}_p$-linear functionals on $\mathrm {Ker} (\mathrm {NS} (J) \to \mathrm {NS} (X))$. In § 5 we give examples where this function can be non-trivial, and where $X(\mathbf {Q} )$ can still be determined using quadratic Chabauty. There are two procedures we illustrate for doing this. In § 5.4 we calculate regular semi-stable models at bad primes and have a sufficient supply of rational points (and sufficiently simple dual graphs) to reconstruct the functions $j_\ell$ from Theorem 3.2 using evaluation of $p$-adic local heights at known rational points. In § 5.5, although we know a regular semi-stable model ‘abstractly’, we do not know the relation between the stable model (at the bad prime 17) and the model we use for $p$-adic calculations. This, together with the relative paucity of known rational points, makes it infeasible to apply the first procedure. Instead, we use extra information about the action of inertia on the stable model, together with Theorem 3.2, to identify a subspace of line bundles in $\mathrm {Ker} (\mathrm {NS} (J)\to \mathrm {NS} (X))$ for which the associated local heights vanish.

To further determine the subset of rational points $X(\mathbf {Q})$ from the finite set of points produced by our algorithm, we carry out the Mordell–Weil sieve. In practice it may happen (see below) that $X(\mathbf {Q})$ is returned by the algorithm, but this is typically not the case when $X$ has genus $2$.

#### 3.5.1 Affine patches

Most of the examples discussed in § 5 are either hyperelliptic curves or smooth plane quartics. As demonstrated in § 5.5, our code is sometimes able to treat more general examples. Our implementation was designed to take as input a plane affine patch $Y\colon Q(x,y)=0$ of a modular curve $X/\mathbf {Q}$ satisfying the requirements in § 2.1 and a prime $p$ of good reduction. It returns all rational points on $X$ in affine residue disks where the lift of Frobenius constructed in [Reference TuitmanTui16, Reference TuitmanTui17] is defined. Note that we do not require $Y$ to be smooth, but we need $Q$ to be monic with $p$-integral coefficients.

We can sometimes find an affine patch $Y$ having the convenient property that all rational points on $X$ must be among the points returned by running our algorithm on $Y$. If no such $Y$ is found, then we need to find two suitable affine patches such that every rational point on $X$ is contained in at least one patch. For smooth plane quartics, our implementation includes an algorithm that automates this process for the convenience of the user. For other curves, this step is left to the user.

#### 3.5.2 The Néron–Severi classes $Z_i$

Under the assumption that $T_p$ generates the endomorphism ring of the Jacobian, which we made for convenience above, one may proceed precisely as in [Reference Balakrishnan, Dogra, Müller, Tuitman and VonkBDM^{+}19, § 6.4] to determine a non-trivial class

Indeed, the matrix $A_p$ of the Hecke operator $T_p$ acting on $\mathrm {H}^1_{\scriptstyle \mathrm {dR}}(X_{\mathbf {Q}_p})$ is easily determined from the matrix of Frobenius $F_p$ (which is already a byproduct of the algorithms for the local height at $p$), by the Eichler–Shimura relation:

Under our assumption, the matrices of the classes $Z_i$ acting on $\mathrm {H}^1_{\scriptstyle \mathrm {dR}}(X_{\mathbf {Q}_p})$ may then be computed as linear combinations of powers of $A_p$.

Remark 3.17 This is the only part of our algorithm specific to modular curves, since it relies on the Eichler–Shimura relation. It should, however, be noted that this is mainly a matter of convenience adopted for the purpose of automation. More generally, for a smooth projective curve $X/\mathbf {Q}$ satisfying the assumptions of § 2.1, one could find $p$-adic approximations of the action of the non-trivial classes $Z_i$ on $\mathrm {H}^1_{\scriptstyle \mathrm {dR}}(X_{\mathbf {Q}_p})$ using just $p$-adic linear algebra. Indeed, the space of correspondences which are symmetric under the Rosati involution and induce endomorphisms of trace zero on the Tate module maps under the cycle class into the intersection of the $\mathrm {Fil} ^{1}$ and $\phi =p$ subspaces of

In fact, by the Tate conjecture, the rank of the space of (crystalline) cohomology classes of such correspondences over $\mathbf {F} _p$ is equal to the dimension of the $\phi =p$ subspace of (3.4), and by the $p$-adic Lefschetz-$(1,1)$ theorem of Berthelot and Ogus [Reference Berthelot and OgusBO83, § 3.8] such a correspondence over $\mathbf {F} _p$ lifts to $\mathbf {Q} _p$ if and only if its cycle class lies in $\mathrm {Fil} ^{1}$. Note that the dimension of the space of correspondences symmetric under the Rosati involution need not equal the dimension of $\wedge ^2 \mathrm {H} ^1 _{\scriptstyle \mathrm {dR}}(X_{\mathbf {Q} _p })^{\phi =p}\cap \mathrm {Fil} ^1$, as was erroneously claimed in [Reference Balakrishnan, Dogra, Müller, Tuitman and VonkBDM^{+}19, Lemma 4.5], since the rank of the intersection of a $\mathbf {Z}$-lattice with a $\mathbf {Q} _p$-subspace may be less than the dimension of the intersection with the $\mathbf {Q} _p$-subspace it spans. However, if one knows a set of generators of a finite index subgroup of $\mathrm {End} (J)$ in advance (e.g. using algorithms for rigorous computation of the endomorphism algebra of the Jacobian [Reference Costa, Mascot, Sijsling and VoightCMSV19])) then one can use this to compute the classes of generators in cohomology.

Therefore the assumption that $T_p$ generates the endomorphism algebra could be circumvented in this step with a little work, although it is used in the computation of the local heights away from $p$ (see below). When the assumption is not satisfied, our implementation throws an error, urging the user to try a different choice of prime $p$.

#### 3.5.3 The local heights away from $p$

This step requires an explicit knowledge of a semi-stable model of the modular curve $X$, as well as a description of the action of $Z_i$ on the concomitant cohomological structures in order to be able to apply Theorem 3.2. It is clear that a full automation of this step, starting from a set of defining equations for $X$, falls outside the scope of our implementation.

Semi-stable models for modular curves are known in many cases (see, for instance, the recent work of Edixhoven and Parent [Reference Edixhoven and ParentEP21]). In practice, one can also often use the SageMath toolbox MCLFFootnote ^{3} due to Rüth and Wewers to compute such models. The main advantage of having computed the $Z_i$ in § 3.5.2 as combinations of powers of $T_p$ is that this makes it easier to compute the quantities appearing in Theorem 3.2. Even though we see no way to fully automate this step, we hope to convince the reader of its practicality by working it out for the genus 2 curves $C_{188}$ and $C_{161}$ in Examples 5.18 and 5.19.

#### 3.5.4 The global height pairing

If there are not sufficiently many rational points on the curve to solve for the height pairing, we instead compute the local heights $h_v$ in the sense of Coleman and Gross (see § 3.3.1). For hyperelliptic curves $X/\mathbf {Q}_p$ of odd degree, $h_p(D_1,D_2)$ can be computed using an algorithm due to Balakrishnan and Besser [Reference Balakrishnan and BesserBB12, Reference Balakrishnan and BesserBB21]. Based on earlier SageMath code due to Balakrishnan, we have implemented this in Magma for divisors $D_1$ and $D_2$ that split over $\mathbf {Q}_p$, have support contained in disjoint residue disks, and for which no points in the support reduce to Weierstrass points mod $p$. To compute the local heights $h_\ell$ for $\ell \ne p$, we rely on Magma's implementation of an algorithm for local canonical heights on hyperelliptic curves described by Holmes and Müller [Reference HolmesHol12, Reference MüllerMül14]. An algorithm for general curves was given by van Bommel, Holmes and Müller [Reference van Bommel, Holmes and MüllervBHM20].

To solve for the height pairing, we need to find representatives for $r$ independent points in $J(\mathbf {Q})$ that satisfy the assumptions mentioned above. Our implementation is currently restricted to genus 2 curves, since this step was only necessary for such curves, but a generalisation to higher-genus hyperelliptic curves would be straightforward.

Remark 3.18 The code is currently restricted to the base field $K=\mathbf {Q}$. To extend it to more general number fields, one would need to combine these algorithms with those used in [Reference Balakrishnan and DograBD18] for imaginary quadratic fields in certain cases, or with those in [Reference Balakrishnan, Besser, Bianchi and MüllerBBBM21] for general number fields.

## 4. Precision analysis

In this section we bound the loss of absolute $p$-adic precision that may occur in our computations by bounding the valuations of the error terms. We also estimate the valuations of the power series expansion of the quadratic Chabauty function $\rho$ and use this to bound the precision of its roots.

We retain the notation used in the previous sections. Recall from (2.5) that $\rho = h-h_p$, where:

− $h$ is the global $p$-adic height defined in (2.4);

− $h_p$ is the local component of $h$, discussed in § 2.2.

By (3.2), the local height $h_p$ satisfies

where the Hodge filtration of the filtered $\phi$-module $M(x) := \big ( \mathrm {A}_Z(b,x) \otimes _{\mathbf {Q}_p} \mathrm {B}_{\scriptstyle \mathrm { crys}}\big )^{G_{\mathbf {Q}_p}}$ discussed in § 2.2 is encoded by $\boldsymbol {\beta }_{\mathrm {Fil}}$ and $\gamma _{\mathrm {Fil}}$. and $\boldsymbol {\alpha }_{\phi }, \boldsymbol {\beta }_{\phi }$ and ${\gamma }_{\phi }$ encode the Frobenius structure of $M(x)$.

We will bound the loss of precision in the computation of the Hodge filtration in § 4.1, and we do the same for the Frobenius structure in § 4.2. In § 4.3 we bound the precision loss for the global height computation. In the final part of this section, § 4.4, we bound the valuation of the coefficients of the expansion of $\rho$ in a residue disk, and we discuss how this may be used to provably determine the roots of $\rho$ to a certain precision. This section relies heavily on [Reference Balakrishnan, Dogra, Müller, Tuitman and VonkBDM^{+}19, §§ 4 and 5].

### 4.1 Hodge filtration

We first bound the loss of precision in steps (ii)–(v) of Algorithm 3.12. For simplicity, we restrict to one class $Z$; the extension to $\mathrm {rk}\mathrm {NS}(J) - 1$ such classes is immediate. Let $Y/\mathbf {Q}$ be an affine open subset of $X$, birational to a curve given by an equation that satisfies Assumption 3.10. We may compute an integral, symplectic basis $\boldsymbol {\omega }=(\omega _0 ,\ldots,\omega _{2g-1})$ of de Rham cohomology over $\mathbf {Q}$ exactly, and extend this to an integral basis of $H^1 _{\scriptstyle \mathrm {dR}}(Y)$ via differentials $(\omega _{2g},\ldots,\omega _{2g+d-2})$ of the third kind. Using such a basis, we may compute the action of the Frobenius operator $F$ on $\mathrm {H} ^1 _{\scriptstyle \mathrm {dR}}(X/\mathbf {Q} _p )$ to any desired $p$-adic precision using Tuitman's algorithm [Reference TuitmanTui16, Reference TuitmanTui17], from which we obtain the action of the Hecke operator $T_p = F + pF^{-1}$ on $\mathrm {H}^1 _{\scriptstyle \mathrm {dR}}(X/\mathbf {Q} _p)$ by the Eichler–Shimura relation. The inversion of $F$ results in a finite and computable loss of precision, which the code takes into account. This results in an algorithm that returns the action of the correspondence $Z$ correctly modulo $p^n$ for some $n\geq 1$ that is returned by the algorithm.

Using this, we may compute a matrix $\Lambda$ with entries in $H^0 (Y,\Omega _{Y_{\mathbf {Q}}})$, of the form

such that $d+\Lambda$ extends to a flat connection on $X$. From this, we may compute $\gamma _{\mathrm {Fil} }$ and $\boldsymbol {\beta }_{\mathrm {Fil} }$ from (3.1). We recall from [Reference Balakrishnan, Dogra, Müller, Tuitman and VonkBDM^{+}19, § 4] that the defining properties of $\eta$, the $\boldsymbol {\beta }_{\mathrm {Fil} }$ and $\gamma _{\mathrm {Fil}}$ are as enumerated below. For $x\in (X-Y)(\overline {\mathbf {Q} })$, we let $t_x$ denote a parameter, and $\boldsymbol {\Omega }_x$ denote the vector of formal integrals of the basis differentials $\omega _i$:

(i) The first $g$ entries of $\boldsymbol {\beta }_{\mathrm {Fil} }$ are zero, and the last $g$ are given by a vector $\mathbf {b}_{\mathrm {Fil} }$ of constants specified below.

(ii) $\eta$ is a linear combination of $\omega _{2g},\ldots,\omega _{2g+d-2}$, unique by [Reference Balakrishnan, Dogra, Müller, Tuitman and VonkBDM

^{+}19, Lemma 4.10], such that(4.1)\begin{equation} d\boldsymbol{\Omega }_x^{\intercal }Z \boldsymbol{\Omega }_x -\eta \end{equation}has vanishing residues at all $x\in (X-Y)(\overline {\mathbf {Q} })$.(iii) $\mathbf {b}_{\mathrm {Fil} }$ and $\gamma _{\mathrm {Fil} } \in \mathcal {O}(Y)$ are the unique solutions to the equation $\gamma _{\mathrm {Fil} }(b)=0$ and

(4.2)\begin{equation} g_x +\gamma _{\mathrm{Fil}}-\mathbf{b}_{\mathrm{Fil} }^\intercal N^\intercal \boldsymbol{\Omega }_x -\boldsymbol{\Omega }_x ^\intercal Z N N^\intercal \boldsymbol{\Omega }_x \in L[\! [t_x ]\! ] \end{equation}for all $x\in (X-Y)(\overline {\mathbf {Q} })$, where $g_x \in \overline {\mathbf {Q} }[\! [t_x ]\! ]$ is defined to be the formal integral of $d\boldsymbol {\Omega }_x ^\intercal Zd\boldsymbol {\Omega }_x -\eta$ and $N$ is the block $2g \times g$ matrix with top block zero and lower block a $g \times g$ identity matrix.

Given our basis $\boldsymbol {\omega }$, we may calculate $\boldsymbol {\Omega }_x$ to any given $t_x$-adic precision. Note that to solve (4.1), we only need to know $\boldsymbol {\Omega }_x$ modulo $t_x ^{m_x}$, where $m_x$ is the maximum of the order of the poles of the entries of $\boldsymbol {\Omega }_x$. Similarly, to solve for $\gamma _{\mathrm {Fil}}$ and $\mathbf {b}_{\mathrm {Fil}}$ in (4.2), we need only compute the principal parts of $\boldsymbol {\Omega }_x$ and $\boldsymbol {\Omega }_x ^\intercal Z N N^\intercal \boldsymbol {\Omega }_x$. Hence, given the above, we may calculate $\eta,\gamma _{\mathrm {Fil} }$ and $\mathbf {b}_{\mathrm {Fil} }$ to precision $p^{n-2\nu }$, where $\nu$ is minus the minimum of the valuations of the $t_x^i$ coefficients of the entries of $\boldsymbol {\Omega }_x$, for $i\leq m_x$.

### 4.2 Frobenius-equivariant splitting

We now bound the loss of precision in the computation of the Frobenius-equivariant splitting

from (3.1) for $x \in X(\mathbf {Q}_p)\cap ]\mathcal {U}[$, where $\mathcal {U}$ is an open of $Y_{\mathbf {F} _p }$ on which we have an overconvergent lift of Frobenius. This computation is the content of [Reference Balakrishnan, Dogra, Müller, Tuitman and VonkBDM^{+}19, § 5].

The first step is to find the Frobenius structure on the filtered $\phi$-module $M(b)$. By [Reference Balakrishnan, Dogra, Müller, Tuitman and VonkBDM^{+}19, § 5.3.2], the inverse of the Frobenius structure is given by a matrix

such that

where $j^{\dagger} \mathcal {O}_Y$ is the overconvergent structure sheaf on the tube $]Y[$.

Compared to [Reference Balakrishnan, Dogra, Müller, Tuitman and VonkBDM^{+}19, § 5.3.2], we give a slightly more detailed account of the algorithm to find $G$. We first apply the algorithms in [Reference TuitmanTui16, Reference TuitmanTui17] (see [Reference Balakrishnan and TuitmanBT20, Algorithm 2.18]) to compute the action of Frobenius on $\mathrm {H}^1_{\scriptstyle \mathrm {{rig}}}(X\otimes \mathbf {Q}_p)$ as

for a matrix $F \in M_{2g}(\mathbf {Q}_p)$ and a column vector $\mathbf {f}$ with entries in $\mathrm {H}^0(\,]Y[\,,j^{\dagger} \mathcal {O}_Y)$, uniquely determined by the condition that $\mathbf {f}(b_0 ) = \mathbf {0}$, where $b_0$ is the Teichmüller point in the disk of $b$.

Next, we define a vector of functions $\mathbf {g}_0 := -F^{\intercal}Z \mathbf {f}$. Then the differential

is of the second kind, and therefore the reduction algorithms in $\mathrm {H}^1_{\mathrm {rig}}(Y)$ from [Reference TuitmanTui16, Reference TuitmanTui17] can be applied to compute a vector of constants $\mathbf {c} \in \mathbf {Q}_p^{2g}$ and a function $H$Footnote ^{4} $\in \mathrm {H}^0(\,]Y[\,,j^{\dagger} \mathcal {O}_Y)$ such that

Hence, the function $\mathbf {g}:= \mathbf {g}_0 +\mathbf {c}$ satisfies

and we normalise $H$ by requiring that $H(b_0)=0$. The matrix

then satisfies (4.3).

#### 4.2.1 Frobenius-equivariant splitting for Teichmüller points

Suppose that $x_0\in X(\mathbf {Q}_p)\cap ]\mathcal {U}[$ is a Teichmüller point. As described in [Reference Balakrishnan, Dogra, Müller, Tuitman and VonkBDM^{+}19, § 5.3.2], the Frobenius-equivariant splitting of $M(x_0)$ is given by

The loss of precision in the computation of $\mathbf {f}$ and $F$ is estimated in [Reference TuitmanTui17]. Hence, it is easy to bound the precision loss in the computation of $\lambda ^\phi (x_0)$ using the following result.

Proposition 4.1 Suppose that the entries of the matrix $G$ and a point $P\in X(\mathbf {Q}_p)\cap ]\mathcal {U}[$ are accurate to $n$ digits of precision. Then $G(P)$ is also accurate to $n$ digits of precision.

Our proof of Proposition 4.1 is somewhat similar to but more involved than the proofs in [Reference Balakrishnan and TuitmanBT20, § 4], where the loss of precision in the evaluation of $\mathbf {f}$ and of single Coleman integrals is estimated. We may expand

The hardest part of the proof of Proposition 4.1 is to find lower bounds on the valuation of the coefficients $w_{j,k}$, which we now describe. Let $e_0$ (respectively, $e_\infty$) be the maximum of the ramification indices of the map $x\colon X\to \mathbf {P}^1$ with respect to our chosen model at points lying in affine (resp., infinite) disks.

Lemma 4.2 There is a constant $\kappa$ such that for all $j,k$ we have

Proof. Looking at the constituent parts of (4.5), we start with $(\phi ^*\boldsymbol {\omega }^{\intercal})Z\mathbf {f}$. We write

Then $\mathrm {ord}_p(d_{j_1, k_1}^{(i)}) \geq \lfloor {j_1}/{p} \rfloor + 1$ by [Reference TuitmanTui17, Proof of Proposition 4.9]. We have

where $f_{i,0}, f_{i,\infty }$ and $f_{i,\mathrm {end}}$ correspond to the three reduction steps (2), (3) and (4) in the reduction algorithm from [Reference TuitmanTui17], summarised in [Reference Balakrishnan and TuitmanBT20, Algorithm 2.18]. By (1), (3) and (4) of [Reference Balakrishnan and TuitmanBT20], there are $\mu _1, \lambda _1\ge 0$ such that

Equation (2) of [Reference Balakrishnan and TuitmanBT20] implies the lower bound $\mathrm {ord}_p(c_{j_2, k_2}^{(i)}) \geq \left \lfloor {j_2}/{p} \right \rfloor + 1 - \log _p \lfloor j_2 e_0\rfloor.$ Let

Without loss of generality, the matrix $Z$ has $p$-integral entries. Hence, every $(Z\mathbf {f})_i$ is of the form

where, for all $k_2$, we have

Let us now consider, for each $i$,

We distinguish two cases. If $j_2 > 0$ then

If $j_2 = 0$, then $\mathrm {ord}_p(d^{(i)}_{j_1,k_1}g^{(i)}_{j_2,k_2})\geq \left \lfloor {j_1}/{p}\right \rfloor + 1 + \kappa _1$. Together, these yield

The next term to consider in (4.5) is $\phi ^* \eta - p \eta$, where $\eta$ is constructed in [Reference Balakrishnan, Dogra, Müller, Tuitman and VonkBDM^{+}19, § 4]. Let $\kappa _2$ denote the $p$-adic valuation of the vector of coefficients of $\eta$ in terms of the basis differentials $\omega _{2g},\ldots,\omega _{2g+2-d}$ (see [Reference Balakrishnan, Dogra, Müller, Tuitman and VonkBDM^{+}19, § 4.1]). Write

Then the $s_{jk}$ satisfy $\mathrm {ord}_p(s_{jk}) \geq \kappa _2 + \left \lfloor {j}/{p} \right \rfloor + 1$ if $j\neq 0$ and $\mathrm {ord}_p(s_{0k}) \geq \kappa _2 +1$, so

For the final summand $\mathbf {g}_0 ^{\intercal}\boldsymbol {\omega }$ in (4.5) note that since $F$ has $p$-integral entries, every $(F^{\intercal}Z \mathbf {f})_i$ has an expansion as in (4.12). Because $\omega _i$ is integral for all $i$, the lower bounds in (4.13) remain valid for $\mathbf {g}_0 ^{\intercal}\boldsymbol {\omega }$. The proof of Lemma 4.2 follows from this and from (4.14) and (4.15) upon setting $\kappa = \min \{\kappa _1,\kappa _2\}$.

We now estimate the precision loss that can occur during the application of the reduction algorithm from [Reference TuitmanTui17] to the differential $\xi$. Our proof is similar to the proof of [Reference TuitmanTui17, Prop 4.9], which estimates the precision loss in the reduction of $F^*(\omega _i)$. Suppose that $\xi$ is correct to $n$ digits of $p$-adic precision. First consider terms in (4.9) with $j>0$. It follows from (4.10) that $j - p\log _p(je_0) \leq pm - p\kappa$ (note that $\kappa \le 0$). By [Reference TuitmanTui17, Proposition 3.7], the precision loss at pole order $j$ during the reduction at finite points is at most $\lfloor \log _p(j_{\max }e_0)\rfloor,$ where $j_{\max }$ is the largest integer $j$ such that $j - p\log _p(je_0) \leq pn - p\kappa.$ As in the proof of [Reference TuitmanTui17, Proposition 4.9], this might introduce small poles above $\infty$, but by the same reasoning as in [Reference TuitmanTui17], the reduction of these poles leads to a loss of precision bounded by $\lfloor \log _p(-(\mathrm {ord}_\infty W^{-1})+1)e_{\infty }\rfloor$. We set

If we write

then the loss of precision during the reductions above infinity (where $j\leq 0$) is bounded by $g_2:= \lfloor \log _p(m_\infty e_\infty )\rfloor.$

Hence, we have established the following lemma.

Lemma 4.3 Suppose that $\xi$ is correct to $n$ digits of precision. Then $\mathbf {c}$ and $H$ are correct to $n-\max \{g_1(n), g_2\}$ digits of precision.

Proof of Proposition 4.1 Similar to the $f_i$, we may decompose $H$ as $H = H_0 + H_{\infty } + H_{\mathrm {end}}$, corresponding to steps (2), (3) and (4), respectively, in [Reference Balakrishnan and TuitmanBT20, Algorithm 2.18]. By the above, the reduction above finite points introduces a denominator of valuation at most $\log _p(je_0)$ for pole order $j$, therefore we have

Recall that the matrix $G$ is defined in (4.7). There is no loss of precision when evaluating $\mathbf {f}(P)$ by [Reference Balakrishnan and TuitmanBT20, Proposition 4.5]. By our assumption that $F$ and $Z$ are $p$-integral, there is no precision loss when evaluating $\mathbf {g_0}(P)$. Using the bounds (4.17), the proof of [Reference Balakrishnan and TuitmanBT20, Proposition 4.5] shows that $H(P)$ is accurate to $n$ digits of precision as well. Since $\mathbf {g} = \mathbf {g_0} + \mathbf {c}$, the proposition follows.

#### 4.2.2 Frobenius-equivariant splitting for general points

For $x\in X(\mathbf {Q}_p)\cap ]\mathcal {U}[$, not necessarily Teichmüller, the Frobenius-equivariant splitting $\lambda ^\phi (x)$ of $M(x)$ is given by

where $x_0$ is the Teichmüller point in the disk of $x$. The first two matrices in (4.18) correspond to parallel transport of $\Lambda$ from $x$ to $x_0$ and from $b_0$ to $b$, respectively.

For the local height $h_p(A(x))$, we need the Frobenius-equivariant splitting $\lambda ^\phi (x)$ both for fixed $x$ and for $x$ varying inside a residue disk. We start by bounding the valuations of the coefficients of power series expansions of the differentials in the parallel transport matrices of $\Lambda$ in terms of a local coordinate $t$ at a fixed affine point $y_0 \in X(\mathbf {Q}_p)\cap ]\mathcal {U}[$. By assumption, the entries of the expansions of $\boldsymbol {\omega }$ and $\boldsymbol {\omega }^{\intercal }Z$ all have integral coefficients, so their integrals have entries whose $i$th coefficient has valuation $-\geq \mathrm {ord}_p(i)$. Therefore, we have

It follows that

By construction, the coefficients of $\eta$ in terms of $\omega _{2g},\ldots,\omega _{2g+d-2}$ are polynomials in $x$. Define $d_i(\eta )$ to be the valuation of the $i$th coefficient if $i$ is smaller than the maximum of the degrees of these coefficients and 0 otherwise. Then the $i$th coefficient of the integral of $\eta$ has valuation at least $-\mathrm {ord}_p(i)-d_i(\eta )$. Hence, the $i$th coefficient of every expansion of the parallel transport matrix in $t$ has valuation at least

For definite parallel transport from $y_0$ to another $\mathbf {Q}_p$-point $y_1$ in the same residue disk, we need to evaluate the integrals above. Suppose that $y_0,y_1$, and the coefficients of the expansions of $\boldsymbol {\omega }$ and $\eta$ are correct to $n$ digits of $p$-adic precision, and suppose that the expansions are truncated modulo $t^l$. Let

Then $\int _{y_0}^{y_1}\omega _j$ and $\int _{y_0}^{y_1}(Z\boldsymbol {\omega })_j$ are correct to $\min \{\nu _1,\nu _2\}$ digits by [Reference Balakrishnan and TuitmanBT20, Proposition 4.1]. The proof of [Reference Balakrishnan and TuitmanBT20, Proposition 4.1] requires that the differential we integrate has integral coefficients. A modification of this proof yields that the integral $\int _{y_0}^{y_1}\eta$ is correct to $\min \{\nu _1', \nu _2\}$ digits, where $\nu '_1=1+\min _{i\ge l}\{i-\lfloor \log _p(i+1)\rfloor -d_i(\eta )\}.$ A similar modification shows that the double integral $\int ^{y_1} _{{y_0}}\boldsymbol {\omega }^{\intercal }Z \boldsymbol {\omega }$ is correct to $\min \{\nu _1'', \nu _2'\}$ digits, where $\nu _1''= 1+\min _{i\ge l}\{i-2\lfloor \log _p(i+1)\rfloor \}$ and

Hence, we obtain the following lemma.

Lemma 4.4 The parallel transport matrix from ${y_0}$ to ${y_1}$ is correct to $\min \{\nu _1',\nu ''_2, \nu _2'\}$ digits of precision.

Using (4.18), we can finally bound the loss of precision in the computation of $\lambda ^\phi (x)$ for fixed points $x\in X(\mathbf {Q}_p)\cap ]\mathcal {U}[$ by combining Lemma 4.4 and Proposition 4.1.

### 4.3 Global heights

We now discuss the possible precision loss in the computation of the global height $h$. In step (vi(b)) of Algorithm 3.12 we solve for $d_1,\ldots,d_g$ such that

in terms of a basis $\{\Psi _i\}$ of bilinear pairings on $\mathrm {H}^0(X_{\mathbf {Q}_p}, \Omega ^1)^{\vee }$ by evaluating $h$ and the