GEOMETRIC QUADRATIC CHABAUTY AND p -ADIC HEIGHTS

. Let X be a curve of genus g > 1 over Q whose Jacobian J has Mordell–Weil rank r and N´eron–Severi rank ρ . When r < g + ρ − 1, the geometric quadratic Chabauty method determines a ﬁnite set of p -adic points containing the rational points of X . We describe algorithms for geometric quadratic Chabauty that translate the geometric quadratic Chabauty method into the language of p -adic heights and p -adic (Coleman) integrals. This translation also allows us to give a comparison to the (original) cohomological method for quadratic Chabauty. We show that the ﬁnite set of p -adic points produced by the geometric method is contained in the ﬁnite set produced by the cohomological method, and give a description of their diﬀerence.


Introduction
Let X Q be a smooth, projective, geometrically irreducible curve of genus g > 1 over Q.The problem of describing X Q (Q), the set of rational points of X Q , has fascinated mathematicians for centuries.A famous conjecture of Mordell [Mor22] is that, for g > 1, the set X Q (Q) is finite.Faltings's theorem states that Mordell's conjecture is true [Fal83].However, Faltings's theorem is not effective, meaning that it does not give a method to determine the set of rational points.There is still an ongoing effort to find explicit methods to compute the set X Q (Q).Chabauty's theorem [Cha41] gives a finiteness result for X Q (Q) on certain curves by using p-adic analysis.This was made effective by Coleman [Col85a] through the development of Coleman integration; he gave a method to find p-adic power series that vanish on a superset of X Q (Q) for the curves Chabauty considered.This breakthrough is the starting point for the Chabauty-Kim program [Kim09] of p-adic methods for proving the finiteness of X Q (Q) generalizing Chabauty and Coleman's method.The quadratic Chabauty method [BBM16, BD18, BD21, EL21, BMS21] is an effective instance of the Chabauty-Kim method, first developed by Balakrishnan and Dogra, for studying the rational points of X Q .
Let J Q be the Jacobian of X Q , with Mordell-Weil rank r and Néron-Severi rank ρ := rk NS(J Q ) > 1.Let p > 2 be a prime, not necessarily of good reduction for X Q .Quadratic Chabauty is an effective p-adic method for producing a finite set of p-adic points containing the rational points of X Q , when r < g + ρ − 1.There are several approaches to the quadratic Chabauty method.The (original) cohomological quadratic Chabauty method [BD18,BD21] studies X Q (Q) using p-adic height functions and works in certain Selmer varieties (for p of good reduction).This method has been applied to determine the rational points on many modular curves [BBB + 21, BDM + 21], including the cursed curve [BDM + 19], a famously JDR was supported by a grant from the Simons Foundation (550029, to John Voight).SH was supported by National Science Foundation grant DGE-1840990.PS was partially supported by NWO grant VI.Vidi.193.006.difficult problem.The geometric quadratic Chabauty method [EL21] is an algebro-geometric method for quadratic Chabauty, and the computations take place in G m -torsors over J Q .
In this paper, we give a comparison of the geometric and cohomological methods for quadratic Chabauty in the cases where both methods can be applied.We prove the following theorem.
Theorem A (Comparison Theorem (Theorem 8.5)).Assume that p is a prime of good reduction for X Q .Assume that r = g, ρ > 1, and the p-adic closure J Q (Q) is of finite index in J Q (Q p ). Assume X Q (Q) = ∅, and let b ∈ X Q (Q) be a choice of a rational base point.Let X(Q p ) Coh be the finite set of p-adic points obtained under these assumptions with the cohomological quadratic Chabauty method (see Definition 8.1 and Remark 8.2).Let X/Z be a proper regular model of X Q .Let X(Z p ) Geo be the finite set of p-adic points obtained with the geometric quadratic Chabauty method (see Definition 2.3).Then we have the inclusions and we can explicitly characterize X(Q p ) Coh \ X(Z p ) Geo .
In [HS22], it is shown that the classical Chabauty-Coleman method [Col85b] and the geometric linear Chabauty method [Spe20] are related by a similar comparison theorem.
The geometric quadratic Chabauty method studies the Poincaré torsor, the universal G mbiextension over J Q × J Q .By pulling back the Poincaré torsor by a nontrivial trace zero morphism f : J Q → J Q , we can construct a nontrivial torsor T over the Néron model of J Q whose restriction to X Q is trivial.This allows us to embed X Q into T through a section.The idea of the geometric quadratic Chabauty method is to intersect the image of the integer points on a regular model of X Q with the p-adic closure of the integer points T (Z).This intersection contains X Q (Q).
Suppose further that p is a prime of good reduction for X Q .We give new algorithms for geometric quadratic Chabauty that work mainly in the trivial biextension Q g p × Q g p × Q p .Working on the trivial biextension translates the geometric quadratic Chabauty method into the language of Coleman-Gross heights [CG89] and Coleman integrals [Col85a].The main contribution of this paper is to explicitly give this translation into the language of heights and Coleman integrals.This translation allows us to prove the comparison theorem between the cohomological quadratic Chabauty method and the geometric quadratic Chabauty method.We also give an algorithm to compute the local heights away from p associated to the curve X Q .These heights are also studied in [BD20].
We further leverage the language of p-adic heights to compute the embedding of X Q into T and the integer points T (Z) as convergent power series.Then determining up to finite p-adic precision a finite set containing X Q (Q) reduces to solving simple polynomial equations.Theoretically, by working modulo p k for large enough k ∈ N, the geometric quadratic Chabauty method will always produce a finite set of p-adic points with precision k containing X Q (Q).We describe algorithms for finding this finite set of p-adic points that are practical when X Q is a hyperelliptic curve.Our Magma code implementing these algorithms can be found in [DRHS].
Finally, we present an example of our new method applied to the modular curve X 0 (67) + and a trace zero endomorphism f arising from the Hecke operator T 2 .Even though the rational points on this curve have already been determined [BBB + 21], this provides a new way of analyzing the set of rational points.

Overview and Set-up
We first set up some notation and give a broad overview of the geometric quadratic Chabauty method, then outline the contents of our paper.
Let X Q be any smooth, projective, geometrically irreducible curve over Q with a proper regular model X of X Q over the integers and a fixed base point b ∈ X Q (Q) = X(Z).Let X sm denote the open subscheme of X consisting of points at which X is smooth over Z; then X sm (Z) = X(Z).Let J Q denote the Jacobian of X Q and J denote the Néron model of J Q over the integers.Suppose J Q has Mordell-Weil rank r and Néron-Severi rank ρ = ρ(J Q ).Let p be a prime greater than 2 not necessarily of good reduction for X Q .
The goal in geometric quadratic Chabauty is to lift X into a non-trivial G ρ−1 m -torsor T over J through a section j b lying over the Abel-Jacobi embedding j b : X sm → J.Over Q we find this section j b by giving a trivializing section of the G ρ−1 m -torsor j * b T Q over X Q .If we want to spread this out over Z, there is an obstruction coming from the multidegree.
Definition 2.1.The multidegree of a line bundle L on a curve C with geometrically irreducible components (C i ) i∈I over Q is (deg The map Pic(X) → Pic(X Q ) is not in general an isomorphism, and j * b T is not in general trivial over X since its multidegree over the fibers X F ℓ of X might be non-zero.This is the only obstruction: the torsor can be trivialized over an open U ⊂ X sm constructed by picking one geometrically irreducible component in each fiber X F ℓ and removing the other irreducible components.If U does not contain a F q -point of X, then it certainly contains no integer points, and hence we only consider U that are everywhere locally soluble.We call these everywhere locally solvable fiberwise geometrically irreducible open U ⊂ X sm simple open sets.By [Sta18a, Tag 04KV] every irreducible component of X F ℓ admitting a smooth F ℓ -point is geometrically irreducible.Hence every point P ∈ X sm (Z) is contained in U(Z) for a unique simple open U.There is a finite number of simple open sets.For every such open, the map Pic(U) → Pic(X Q ) is an isomorphism.We fix a simple open U, and obtain a trivialization j b : U → T lying over j b .
Because G m (Z) = {±1} is finite, we can expect the closure of T (Z) inside the (g + ρ − 1)dimensional p-adic manifold T (Z p ) to be of dimension at most r.The image of the p-adic points of U, namely j b (U(Z p )), is of dimension 1.Given this T , we see the analogue of the classical Chabauty's theorem, that applies for curves satisfying the inequality r < g [Cha41].
The geometric quadratic Chabauty method computes this finite set X(Z p ) Geo , working in one simple open U ⊂ X and one residue disk of U(Z p ) at a time.In Algorithm 7.1 we give an algorithm to determine j b (U(Z p )) ∩ T (Z) to finite precision.
To construct the G ρ−1 m -torsor T over J we start with the universal G m -torsor.In our calculations this takes the form of the Poincaré torsor M × over J × J 0 (this is actually a pullback of the Poincaré torsor over J × J ∨0 ; for more details see Section 3).Here J ∨0 is the fiberwise connected component of J ∨ containing 0.
Remark 2.4.When p is a prime of good reduction for X, we have J 0 . By the universality of M × , we want to construct T by pulling back M × along morphisms (id, α i ) : J → J × J 0 for i = 1, . . ., ρ − 1. Define where exp(G) ∈ N ≥1 is the exponent of a finite group G.Note that m• : J → J 0 is then a well defined morphism.Any morphism of schemes J → J can be written as a translation composed with an endomorphism, and hence we choose our morphisms α i : J → J 0 to be of the form m • • tr c i •f i with c i ∈ J(Z) and f i : J → J a morphism of group schemes.
The torsor T is the product T = ρ−1 i=1 (id, α i ) * M × as a fiber product over J.We also let M ×,ρ−1 be the product taken as a fiber product over J via the first projection map M × → J × J 0 → J.In order to embed U through a section j b : U → T , the torsor T pulled back to U must be trivial: that is j * b (id, α i ) * M × must be trivial over U.The torsor (id, α i ) * M × over J can be thought of as the total space of a line bundle without its zero section, and the condition that its pullback L α i := j * b (id, α i ) * M × to U is trivial forces the corresponding line bundle to be degree 0. Equivalently, the trace of f i must be 0. The condition that L α i is trivial uniquely determines c i . (2) Because the Néron-Severi rank of J Q is ρ, the Jacobian J has ρ − 1 independent non-trivial endomorphisms of trace zero.
Definition 2.5.For Y a scheme, S a ring with residue field Spec F p → Spec S and Q ∈ Y (F p ), we define the residue disk over Q, denoted by Y (S) Q := {y ∈ Y (S) | y = Q}, to be the set of all S-points specializing to Q.
Let P ∈ U(F p ).The residue disk U(Z p ) P embeds into the residue disk T (Z p ) j b (P ) of T through the section j b .Since p > 2, we have that 1 and −1 reduce to different points modulo p and hence the map T (Z) j b (P ) → J(Z) j b (P ) is a bijection.By [Par00, Proposition 2.3] and the fact that p > 2 the residue disk J(Z) j b (P ) is up to a translation isomorphic to Z r p .In [EL21, Theorem 4.10] this bijection T (Z) j b (P ) → J(Z) j b (P ) is upgraded to a morphism κ : Z r p → T (Z p ) j b (P ) with image exactly T (Z) j b (P ) .In this paper we make the geometric quadratic Chabauty method explicit in the case where p is of good reduction by giving algorithms to compute j b and κ in a residue disk as polynomials in parameters up to finite precision.This translates the geometric Chabauty method into solving simple polynomial equations.We also give algorithms to work in residue disks of T explicitly using p-adic heights and Coleman integrals.Moreover, by writing the geometric quadratic Chabauty method in terms of p-adic heights and Coleman integrals, we are able to prove Theorem A.
2.1.Structure of the paper.In Section 3 we provide background on the Poincaré torsor and its realizations.We solve the problem of how to efficiently represent elements of a residue disk of T .We show how to represent elements of the Poincaré torsor M × using the following statement that appears in [EL21, Section 9.3].
Proposition 2.6.Let p > 2 be a prime of good reduction for X.There is a morphism of biextensions over J(Z p ) × J(Z p ) with the trivial Q p -biextension structure on the latter product.
By Remark 2.4, we have that J 0 (Z p ) = J(Z p ).This proposition allows us to record elements of M × (Z p ) up to p-adic finite precision.In Proposition 3.11 we describe the image of integer points of T in this trivial biextension Since we can construct a bijection from residue disks of J(Z p ) to Z g p using Coleman integrals, we can explicitly write down a homeomorphism from the residue disk T (Z p ) j b (P ) to Z g p × Q ρ−1 p factoring through Ψ; this is done in Corollary 3.22.Crucially, we prove that this homeomorphism is given by convergent power series on Z g+ρ−1 p , i.e. power series that modulo every power of p are given by polynomials.
Then in Section 4 we give an algorithm to construct the unique line bundle associated to the endomorphism f from a divisor in U ×X satisfying certain properties described in Lemma 4.4.Using this line bundle we write down a theoretical formula for the trivializing section j b : U → T .We give an algorithm for computing the convergent power series describing the embedding of a residue disk of the curve into the biextension N in Section 5.In Section 6 we give formulas for computing points in the biextension N that are the image of generating sections of certain residue disks of M.
In Section 7 we tie everything together with the algorithm for geometric quadratic Chabauty in a residue disk U(Z) P .In this section, we also describe how to compute a finite set of p-adic points to finite precision containing the integer points in a single residue disk U(Z) P .We do this by reducing our computations to T (Z/p k Z) j b (P ) and using a Hensel-like lemma [EL21, Theorem 4.12].By iterating over residue disks we find X(Z p ) Geo up to finite precision.
The comparison theorem appears in Section 8. Theorem 8.5 states that the finite set of points found by the cohomological quadratic Chabauty method is a superset of the points found by the geometric method, and gives an explicit description of the points in their difference.
Section 9 shows a worked example of the algorithms applied to the case of X 0 (67) + .The rational points on this curve have been determined previously [BBB + 21], but the computations here demonstrate the practicality of the geometric quadratic Chabauty algorithms presented here for hyperelliptic modular curves.

Understanding the biextension and T
A crucial object of study in our paper is the Poincaré torsor.This has four incarnations, which we introduce in the following four subsections.Sections 3.1 and 3.2 are expository sections and introduce important background from [EL21].Section 3.3 introduces the trivial biextension, and contains new propositions relating the biextension to p-adic heights.Section 3.4 introduces the pseudoparametrization of the torsor that we work with for the rest of the paper, and proves that the pseudoparametrization is given by nice convergent power series modulo powers of p.
3.1.The Poincaré torsor P. First we introduce the Poincaré torsor P × Q over J Q × J ∨ Q , its biextension structure, and the torsor P × over the integers.For more details on the Poincaré torsor and biextensions, see [MB85, §I.2.5] or Grothendieck's Exposés VII and VIII [GRR72].The abelian variety J ∨ Q is a moduli space for line bundles algebraically equivalent to zero on Q .Given a line bundle L over a scheme S, there is an associated G m -torsor L × defined by taking the sheaf of non-vanishing sections, and similarly given a G m -torsor Y there is an associated line bundle Y ⊗ O × S O S .Applying these associations to the Poincaré bundle, we obtain the universal G m -torsor × -pseudotorsor: either empty or an O S (S) × -torsor.The Poincaré torsor P × Q has the structure of a biextension over J Q × J ∨ Q , as we will now explain.Addition in J ∨ Q corresponds to tensoring line bundles on J Q .This, along with the theorem of the square, induces a partial group law on P × Q .Let S be a scheme over Q.For x ∈ J Q (S) and y 1 , y 2 ∈ J ∨ Q (S) we have a tensor product which is an isomorphism of G m -torsors (x, y 1 ) * P × Q ⊗ (x, y 2 ) * P × Q → (x, y 1 + y 2 ) * P × Q that we denote by ⊗ 2 , because we are adding on the second coordinate (while the first coordinate stays fixed).Similarly since (J ∨ Q ) ∨ is canonically identified with J Q , we also have the tensor product In other words, tensoring points in the biextension is not order-dependent.The structure of these two partial group laws over the product J Q × J ∨ Q , together with this compatibility, makes For our applications, we need to work over the integers.Let J 0 be the fiberwise connected component of J containing 0. This represents line bundles on C that are fiberwise of multidegree 0. Let J ∨ be the Néron model of J ∨ Q and similarly let J ∨0 be the fiberwise connected component of J ∨ containing 0. The Poincaré torsor extends to a biextension P × over J ×J ∨0 .In particular, the integer points of P × lying over (x, y) ∈ (J × J ∨0 )(Z) form a G m (Z)-torsor, i.e. a {±1}-torsor.So there is exactly one integer point lying over (x, y), up to sign.

The biextension M.
To work with explicit computations of points in the Poincaré torsor in practice, we need a few modifications of P × .We introduce two torsors over J × J 0 , M × and N the trivial biextension.
We first discuss the construction of M × and the generating sections of its residue disks.The Abel-Jacobi embedding induces an isomorphism j * b : J ∨ → J and hence an isomorphism j * b : J ∨0 → J 0 .We define For the torsor M × , we have an explicit description of the fibers.Let S be a scheme, x ∈ J(S) be a point corresponding to a line bundle L, and y ∈ J 0 (S) be a point with representing divisor E = E + − E − such that E + and E − are effective and of the same multidegree.We denote the fiber (x, y) * M × of M × over (x, y) ∈ (J × J 0 )(S) by M × (x, y).This fiber which we also denote by Norm E/S L × .When S = Spec Z we also write simply Norm E L × .This fiber can be thought of as the aggregate of how L looks around E.
This description of the fiber is proven in [EL21, Proposition 6.8.7] and more general facts about these norms can be found in [EL21, Section 6].Because equation (5) may seem a bit opaque, we provide some examples of how to apply the formula in practice.
Definition 3.1.Let S be a scheme.Let D and E be two relative Cartier divisors on X S /S.We say D and E are disjoint over S if their support is disjoint as closed subschemes of X S .In particular, it is not enough to have disjoint S-points if D or E does not split completely over S.
Example 3.2.Let S be a scheme, [D] ∈ J(S), and [E] ∈ J 0 (S) be points of J and J 0 with representing divisors D and E where E has multidegree 0. Assume D and E are disjoint over S, and write E = E + − E − with E + , E − effective.Then the G m -torsor E * O X (D) × is generated by Norm E + /S (1)⊗Norm E − /S (1) −1 where 1 is here seen as a section of O X (D) × | E ±1 .We also denote this generator by E * 1.
Example 3.3.Suppose the fiber of X sm /Z over 2 is geometrically irreducible.Let [D] ∈ J(Z) and [E] ∈ J 0 (Z) be points of J and J 0 with representing divisors D and E. Assume D and E are disjoint over Z[ 1 2 ] and meet with multiplicity 1 over 2. Then Remark 3.4.Let S be a scheme.If D = Div g ∈ Div 0 (X S /S) is the principal divisor of a rational function g and is disjoint from E ∈ Div 0 (X S /S), then the isomorphism O X (D) → O X given by multiplication by g induces an isomorphism Remark 3.5.In general, if [D] ∈ J(Z), [E] ∈ J 0 (Z), and we have a choice of representing divisors D and E that are disjoint over Q, using intersection theory we can determine n ∈ Q × unique up to sign, such that Norm E O X (D) × is generated by n • E * 1.If E is not of multidegree 0, there is a unique vertical divisor V ⊂ C with V + E of multidegree 0. In this case, one can compute the unique rational number a up to sign such that (E +V ) * O X (D) × = a Norm E O X (D) × .This is treated in detail in [EL21, Section 6.9].
The partial group laws on M × are also very explicit: let [E], [E 1 ], [E 2 ] ∈ J 0 (S) and L, L 1 , L 2 ∈ J(S).They are given by the morphisms corresponding to ⊗ 2 and Example 3.6.Let x 1 , x 2 ∈ J(Z) and y 1 , y 2 ∈ J 0 (Z).Let z ij ∈ M × (Z) be points above (x i , y j ) for i ∈ {1, 2}.Then for n 1 , n 2 , m 1 , m 2 ∈ Z we can construct points above (n This allows us to construct many integer points of M × by starting with a few points that lie over generators of the Jacobian and then applying the partial group laws.In Section 6 we will use this idea to determine the integer points of the torsor T landing in a specific residue disk of T .
3.3.The trivial biextension N .In practice, we will often translate between M and the trivial biextension N where we do our computations.We explain how to make this translation following [EL21, Section 9.3].From now on, we assume p > 2 is a prime of good reduction for X Q .
Let [D] ∈ J(Q p ) and [E] ∈ J 0 (Q p ) be divisor classes with a choice of representing divisors D and E that are disjoint over Q p .Then E * O X (D) × is a Q × p -torsor, trivial with generator E * 1 by Example 3.2.Let h p be the cyclotomic Coleman-Gross local height at p with respect to an isotropic splitting H 1 dR (X) = H 0 (X, Ω 1 X ) ⊕ W of the Hodge filtration [CG89, Section 5].Choose a branch of the logarithm with log p = 0 so that it is compatible with h p .The height h p is a biadditive, symmetric pairing on disjoint divisors of degree 0, taking values in Q p .For f a rational function and Div f its associated divisor, it also satisfies the equality h p (D, Div f ) = log f (D).
Remark 3.7.The assumption that p is a prime of good reduction for X is used to define the logarithm of J Zp , and to compute the Coleman-Gross height and iterated Coleman integrals.There is a more general construction using Vologodsky integrals to construct the Coleman-Gross height [Bes22], but currently there is no known way to compute this more general height for a prime of bad reduction.
We define a map We define N to be the trivial . By definition, the partial group laws in N are just addition keeping one coordinate fixed.Let The second group law is Definition 3.8.We define the morphism of biextensions on the first two factors and ψ on the last factor.
Remark 3.9.Since log(−1) = 0, the morphism Ψ sends the two integer points of M × (Z) above a fixed integer point of J × J 0 to the same point.
The following proposition appears in [EL21, Section 9.3] but is not proven.
Proof.First we show that Ψ is well defined.For divisor classes [D] ∈ J(Q p ) and [E] ∈ J 0 (Q p ) we can always choose representing divisors D and E with disjoint support over Q p ; we show that the choice of representing divisors D and E does not matter.Suppose D = D ′ + Div g for some rational function g with Div g disjoint from E. Multiplication by g Finally we show that Ψ preserves the two group laws (6) and (7 Therefore Ψ preserves ⊗ 1 .By symmetry of the norm it also preserves ⊗ 2 .
The following proposition relates this to the global p-adic height.
where q ranges over the primes of bad reduction for X and F Fq has support in X Fq .Then by [EL21, Proposition 6.9.3] we have the equation where q ranges over the bad primes.
Recall that Norm E (L × ) is by definition Norm E/ Spec Z (L × | E ); this torsor is canonically identified with O Spec Z ( q q −(E•D)q ) × and hence has generator q q −(E•D)q , where (E • D) q denotes the intersection number of E and D over Z (q) taking values in Z.
In total, we see that under these identifications M × ([D], [E + F ]) is generated by the element E * q q −((E+F )•D)q .By definition, for q = p, we have that h q (D, E) is −((E + F ) • D) q log q, and hence we get as we wanted.
3.4.The torsor T f .We set up some notation.Recall from Section 2 that we have fixed a simple open set U ⊂ X sm that contains the smooth points of one geometrically irreducible component of each fiber.Let f be a trace zero endomorphism of J. Recall the integer m from (1).The map m Remark 3.12.If f is identically zero, then T f is isomorphic to the trivial G m -torsor over J.If r < g this reduces to the geometric linear Chabauty case, see [Spe20,HS22] for more details, but when r = g this trivial torsor contains no information.
As discussed in the overview, we work on the curve residue disk by residue disk, and hence we will describe the residue disks of T f , culminating in Lemma 3.20.Throughout the rest of this section, fix a t ∈ T f (F p ).We work inside the residue disk T f (Z p ) t .Since T f is trivial on fibers, the residue disk We would like to parametrize this residue disk.Definition 3.13.Let Y be a smooth scheme over Z p of relative dimension d, and let y ∈ Y (F p ).We say t 1 , . . ., t d are parameters of Y at y if they are elements of the local ring O Y,y such that the maximal ideal is given by (p, t 1 , . . ., t d ). Define We call t ′ a parametrization given by parameters given by u → (u − 1)/p.Note that the map log, defined by its power series log but this is not a parametrization; it is not given by evaluating elements of the maximal ideal, and is not even fully algebraic in nature.However, there is a relation between ϕ and θ, in that θ • ϕ −1 is given by the power series ].In [EL21, Lemma 6.6.8] the residue disk T f (Z p ) t is parametrized using parameters at t.However, this parametrization can be difficult to work with because it uses parameters in J.The group law of J expressed in these parameters is given by complicated converging power series.It is possible to use this parametrization in practice: see for example [Mas20], where the Khuri-Makdisi representation [KM04] is generalized in order to work with points of the Jacobian up to the required p-adic precision and compute parameters of them; however, with this representation other steps of the algorithm, like computing the image under an endomorphism, would be more difficult.Here, we opt to use the logarithm of J instead to give a bijection between the residue disk T f (Z p ) t and Z g+1 p that is not a parametrization in the sense of Definition 3.13.For a definition of this logarithm, see [Hon70].To describe the relationship between this bijection and the parametrization of this residue disk we need the framework of convergent power series.
Definition 3.15.Let n ∈ N. The ring of convergent power series in n variables is defined as where x = (x 1 , . . ., x n ) is the vector of variables.An element of this ring is called an integral convergent power series if it lies inside Z p [[x 1 , . . ., x n ]].The convergent power series are those power series converging on all of Z n p .Unlike formal power series, one can always compose two (integral) convergent power series, since by definition the resulting infinite sum inside the ring of (integral) convergent power series converges.
Remark 3.16.Let Y be a smooth scheme over is given by (multivariate) integral convergent power series that are linear modulo p, and in fact are of degree at most M modulo p M .
Lemma 3.17.Let G be a smooth, commutative group scheme over Z p of relative dimension d.Let G(Z p ) 0 be the residue disk containing the unit 0 ∈ G(Z p ).Let θ : G(Z p ) 0 → Z d p be a parametrization, and let log : p is given by d integral convergent power series in d variables.For n ≥ 0 the coefficient of a degree n monomial in one of these power series has valuation at least max(1, n − v p (n)).
Proof.By [Spe20, Lemma 3.7] the function log •θ −1 is given by integral convergent power series.There the third author gives the vector-valued formula log = where x = (x 1 , . . ., x d ) is the vector of variables, the coefficients a I lie in Z p , the notation |I| means i 1 + • • • + i d where I = (i 1 , . . ., i d ), and c n = p n /n.(In this paper we do not divide by p in the log, unlike in [Spe20]).The result follows immediately from the observation that The following result establishes the analyticity of the map ψ on residue disks of M × .
Then ψ z • Θ is given by a convergent power series.
As discussed above, we can now find a bijection between residue disks of T f and Z g p × Q p .We use the logarithm of the Jacobian, which gives an isomorphism log : J(Z p ) 0 → pZ g p by choosing a basis of H 0 (J Zp , Ω 1 ) as well as the map ψ defined in (8).For ease of notation, we suppress the monomorphism T f → M × in our notation, and apply ψ directly to T f (Z p ). Definition 3.19.Recall that we fixed a t ∈ T f (F p ). Choose t ∈ T f (Z p ) t to be a lift of t.Let where ψ is defined in (8) and the map ξ f : T f → J is the structure morphism of T f .We call ϕ f a pseudoparametrization of the residue disk T f (Z p ) t .
Similarly to Example 3.14, this is not a parametrization; it shares some of the properties of a parametrization, notably the property in Remark 3.16, as the following lemma shows.
Lemma 3.20.The pseudoparametrization ϕ f is an injection, and for any parametrization p × Q p is given by g + 1 convergent power series.The valuation of the coefficient of any degree n monomial occurring in one of the first g convergent power series is at least max(0, n − 1 − v p (n)).
Proof.By Lemma 3.17 and Lemma 3.18 the pseudoparametrization is given by convergent power series and the valuations of the coefficients behave in the required way.It remains to prove that it is an injection.First, note that the maps 1 p log : J(Z p ) 0 → Z g p and ).Then we have that log λ+h p (D, E) = log λ ′ +h p (D, E) so, because 1 p log is injective on residue disks, then λ = λ ′ , and ϕ f is injective.By Lemma 3.17 the result follows.
3.5.The torsor T .Let f 1 , . . ., f ρ−1 be a basis for the trace zero endomorphisms of J.We simplify our notation by setting Now we define ξ : T → J to be the G ρ−1 m -torsor given by the fiber product Finally, let j b : U → T be a choice of morphism (well defined up to the choice of ρ − 1 signs) coming from the morphisms j b,f i : U → T i .
As in Section 3.4, we can pseudoparametrize residue disks of T .
(Recall that ξ i (z i ) and ξ i ( ti ) are independent of i, since T is a fibered product over J.) Corollary 3.22.The pseudoparametrization map ϕ is an injection, and for any parametrization θ : is given by g + ρ − 1 convergent power series.For any of the first g power series, the valuation of the coefficient of a degree n monomial is at least n − 1 − v p (n).
Proof.This is a corollary of Lemma 3.20.
The main advantage of this method is that for ϕ f we need only to compute the map ψ defined in (8); it is this fact that allows to us to mainly work in N and only translate back to the image of the residue disk under ϕ when needed.

The line bundle
In this section we describe how to explicitly construct the nontrivial G m -torsor T and give a formula for the section j b : U → T .For this, we work with endomorphisms of J.We make this explicit by considering correspondences on X Q × X Q and extensions on U × X. Recall that p > 2 is henceforth a prime of good reduction.
Remark 4.1.To work with divisors on U, X or U × X explicitly, we use equations for a projective regular model of X.There are multiple ways to do this.On a theoretical level, a regular model itself is projective over Z because it is a repeated blowup of the projective closure of its generic fiber.On a practical level, this process could embed the regular model in a high-dimensional projective space, and it is easier to work on affine patches.In this case we give divisors on each of the affine patches by Gröbner bases, compatible with the glueing data.For a practical implementation, we recommend this latter method.This is implemented in Magma, for example.The methods in the rest of the section are agnostic to the exact implementation.Throughout this section, we assume we can represent effective divisors on the regular model by a Gröbner basis, and we represent general divisors by a difference between two effective divisors.
As explained in Section 3.5, to construct the torsor T , we need ρ − 1 independent trace zero endomorphisms (f i ) ρ−1 i=1 : J → J. (In general one only needs n independent nontrivial trace zero endomorphisms where n is such that r < g + n, but one expects to obtain a smaller superset of p-adic points containing X(Z) for higher n.In fact, if we use n nontrivial independent endomorphisms such that r < g + n−1, then we expect to cut out X(Z) exactly unless there is some geometric reason for extra points.)To work with any endomorphism f : J → J explicitly, we recall some facts about correspondences, as can be found in [Smi05].A correspondence on X × X is a divisor D on X × X.
Write D = i n i D i as a sum of prime divisors.Denote by π D i 1 : D i → X the projection onto the first factor of X × X and similarly π D i 2 for projection onto the second factor.The correspondence D induces an endomorphism of the Jacobian Example 4.2.Consider negation −1• : J → J on a hyperelliptic curve of the form y 2 = h(x, z) in weighted projective space.If we give X×X the projective coordinates x, y, z, x ′ , y ′ , z ′ , then a correspondence representing −1• is given by the homogeneous equation y = −y ′ .The aim of this section is to describe, given correspondences for all f i , how to calculate the morphism j b : U → T .For this goal, we partially follow [EL21, Section 7].
In the case where X Q is a classical modular curve we can construct many trace zero endomorphisms using the Hecke algebra.See for example the computation leading to (24) in Section 9.
We now focus on the computations for a single trace zero endomorphism f : J → J.We can compute equations for a correspondence D f,Q ⊂ X Q ×X Q inducing f using the code of Costa, Mascot, Sijsling, and Voight [CMSV19].The input of that algorithm is the g × g matrix giving the representation of the morphism f on a basis of differential forms H 0 (X Q , Ω 1 ).
where m is defined in (1)).4. Return A α , as a Gröbner basis over Z.
Lemma 4.4.The divisor A α on X sm × X given by Algorithm 4.3 is the unique divisor on X sm × X with the following properties: (a) the endomorphism of J induced by the correspondence This divisor A α determines a line bundle L α = O X sm ×X (A α ) on X sm × X, rigidified on X sm × b, of degree 0 on the fibers of the first projection, and such that ∆ * L α is trivial.This induces the endomorphism m • •f by The rest of this section will be dedicated to computing α, and computing the trivialization of j * b (id, α) * M × .Algorithm 4.7 (Compute c).
Input: equations for a correspondence A α output by Algorithm 4.3, inducing the morphism m 1. Set A f := A α /m (recall that A α was defined as m times a different correspondence, so this is well defined).2. Compute the generic fiber A f,Q of A f .3. Compute equations for the divisor A f,Q | b×X by specializing the equations of A f,Q to b in the first copy of X sm .4. Return a Gröbner basis for A f,Q | b×X over Q. Proof.By construction, K is the defining ideal for the image of Z.The pushforward of Z is then exactly (deg Remark 4.9.In Step 5, we need to compute the degree of a morphism between projective schemes.There are algorithms to compute the degree of a rational map between two projective schemes.See for example [Sta18b] for a discussion on an implementation in Macaulay2.
Remark 4.11.In the case where one can write [D + − D − ] as a sum k i=1 n i P i of S-points, one can use the isomorphism P i × X ≃ X to simply compute A α | P i ×X on X and take the linear combination Finally, we discuss the section j b : U → T lying above the Abel-Jacobi map j b : U → J with base point b.Let z ∈ X(F p ).Since the pullback j * b T is trivial, there is a morphism j b : U → T embedding each residue disk U(Z p ) z into the (g + ρ − 1)-dimensional residue disk T (Z p ) j b (z) .To compute this map, we follow [EL21, Section 7].Let n be the product of all primes of bad reduction.We first need to compute the numbers W q and V q mentioned in [EL21, Proposition 7.8] for q | n.These numbers have an involved definition in general.Nevertheless, they can be explicitly computed in our case, and we explain their meaning below.
By Lemma 4.4 the line bundles ∆ * (L α ) and (id, b) * (L α ) are trivial with trivializing sections ℓ = 1.Then W q is defined as the valuation of this section ℓ on U Fq .In our case, these are always 0. It remains to compute V q .We recall the definition.Note that L α has degree 0 on the fibers of the projection U × X → U, but it might not have multidegree 0. Definition 4.12.We define V to be the unique vertical divisor on U × X having support disjoint from U × b such that L α (V ) has multidegree 0 on all fibers of the projection.Write V Fq as a sum of irreducible components of U Fq ×X Fq , i.e., as a linear combination of U Fq ×Y Fq where Y Fq is an irreducible component of X Fq .For q | n define V q ∈ Z to be the coefficient of the component (U Proof.Since V is the unique vertical divisor with A α + V having multidegree 0 on all fibers of the projection, we have that By construction, the divisors z − b and A α| z×X are disjoint over Z, hence it remains to show that ((z − b) • V | z×X ) q = V q .This follows from Definition 4.12 and the fact that V has support disjoint from U × b.
To compute these numbers, we give the following algorithm.
Algorithm 4.14 (Calculate V q ).Input: the curve X, a bad prime q dividing n, the open set U such that U(F q ) = ∅, and the divisor A α on X × X.
Compute the multidegree of the irreducible components of X Fq . 5. Compute the unique linear combination D ⊂ X Fq of these irreducible components such that D does not meet b and such that A α | Q×X + D has multidegree 0 at the fiber over q. 6. Set V q to be the coefficient of the irreducible component containing U Fq in D. 7. Return V q .
Remark 4.15.These local heights can also be computed using harmonic analysis on the dual graph, see [BD20, Section 12].Even though both the geometric method and the harmonic method can be realized as combinatorics on the dual graph, it is not clear how to compare the two computations of local heights.
Let R be a ring and z ∈ U(R).By [EL21, Proposition 7.5] we have We apply [EL21, Proposition 7.8] to give a formula for j b (z) when R ⊂ Z p .We have that is a trivializing section over the curve.The image in N is given by

Embedding the curve
We now describe how to compute the embedding of the curve into the torsor through the evaluation of the trivializing section j b on a residue disk of the point P ∈ U(F p ). Recall the pseudoparametrization ϕ : from Definition 3.21.Let ν be a local parameter in the residue disk of the curve above P .We can parametrize this residue disk by evaluating This is also a parametrization in finite precision, i.e. we have bijections Z/p k Z → U(Z/p k+1 Z) P for any integer k ≥ 1. Define the map λ : Z p → T (Z p ) j b (P ) to be the composite of this parametrization Z p → U(Z p ) P and j b .In this section, we show how to apply the following proposition.
For actual calculations with the convergent power series ϕ • λ, we need to lower bound the valuation of the coefficients.Proposition 5.2.Let ν be a coordinate for Z p .Consider the g + ρ − 1 convergent power series given by ϕ • λ : Z p → Z g p × Q ρ−1 p .For any of the first g convergent power series, the valuation of the coefficient of ν n is at least n − 1 − v p (n).For any of the last ρ − 1 power series, the valuation of the coefficient is at least n − 1 − 2⌊log p n⌋ + v, where v is an explicit (possibly negative) constant.
Proof.The result about the coefficients of the first g power series follows from Corollary 3.22.
Let i ∈ {1, . . ., ρ − 1}.Then [BDM + 21, Lemma 4.5] states that the Nekovář height h Nek i,p : X(Q p ) → Q p corresponding to the trace zero endomorphism f i is analytic on residue disks.Let c = min{0, min j d j (η)} for the d j (η) defined in [BDM + 21, Section 4].Furthermore they show that the valuation of the coefficient of ν n is at least n − 1 − 2⌊log p n⌋ + v ′ , where v ′ := min(ord p (γ Fil ), c + c 2 ), and γ Fil and c 2 are explicit constants defined in [BDM + 21, Section 4], depending on f i among other things.(The valuation of the coefficients of ν n stated in [BDM + 21, Lemma 4.5] differs by n from the value given here, because our coordinates differ from theirs by a factor of p.) In Section 8 we go more into detail about this Nekovář height.In particular, in Theorem 8.10 together with Proposition 8.11 we show that h Nek i,p (z) and h p (z − b, A α i | z×X ) differ by a factor of −m.It follows from Corollary 4.16 that we can take v := v ′ + v p (m).
Remark 5.3.In the example of Section 9, we calculate that the constant v is 0 for the residue disk of the curve we consider there.We suspect that this constant can often be taken to be 0, at least in the cases p > 2g − 1 and p ∤ #J(F p ).
We first present a general algorithm to compute the trivializing section ϕ • λ.For example, if p > 3 and v = 0, to compute j b (P ν ) in N modulo p, it suffices to compute j b on two values, for example j b (P 0 ) and j b (P 1 ).Since the embedding must be linear in ν on U(Z/p 2 Z) P , we can interpolate between these values to determine the map.In general, to compute ϕ • λ to finite precision, it is enough to determine the map on Z/p k Z-points for some large enough k.We give an algorithm to compute j b (P ) when P is a Z/p k Z-point.3. Calculate all h p (P ν − b, A α i | Pν ×X ). 4. For each A α i , compute c U,i := − q|n V q log q using Algorithm 4.14, where n is the product of the primes of bad reduction for X. 5.Return For the rest of this section, we describe a practical algorithm to do Step (3) of Algorithm 5.4 in the case where X is a hyperelliptic curve of the form y 2 = H(x).For hyperelliptic curves where H has odd degree, there is an algorithm to compute the local Coleman-Gross height at p of two disjoint divisors given as a sum of points [BB12, Algorithm 5.7].Forthcoming work of Gajović extends this algorithm to even degree models.
For any i = 1, . . ., (ρ − 1) since the divisor A α i | Pν ×X on X Qp may not split as a sum of points, we instead consider multiples of this divisor nA α i | Pν ×X for n ∈ N. We can hope some large enough multiple splits as a sum of points.Therefore, we must explicitly describe arithmetic in the Jacobian.For hyperelliptic curves, this process can be done via Cantor's algorithm [Can87].The main idea is to use the Mumford representations of divisors.We use the implementation of Cantor's algorithm done by Sutherland in [Sut19, Section 3].The only extra step is to keep track of the function that realizes the linear equivalence with a Mumford representation of the sum.Even though Sutherland works with even degree models for hyperelliptic curves, the algorithms still apply to our odd degree model hyperelliptic curves (see [Sut19,p.433]).
Remark 5.5.In practice, we represent divisors with ideals of polynomial rings.We can translate from a Gröbner basis of an ideal to a Mumford representation in the following way.Let Y be a hyperelliptic curve over a field k given by y 2 = H(x).Let π : Y → P 1 be the degree two morphism forgetting y.Let D be an effective divisor on the affine chart k[x, y]/(y 2 − H(x)) of Y , given by a Gröbner basis.We assume that D and ι(D) are disjoint.Then we can find a Mumford representation for D by simply taking a Gröbner basis with respect to the lexicographical ordering y ≤ x.If D and ιD are not disjoint, one can explicitly compute an effective divisor E on P 1 such that D − π * E is disjoint from ι(D − π * E), and hence find a Mumford representation for D − π * E.
We can now give a practical algorithm to compute the local heights at p in Step (3) of Algorithm 5.4.When X is a hyperelliptic curve of the form y 2 = H(x), given P ν ∈ U(Z/p k Z) we can apply Algorithm 4.10 to obtain A α i | Pν×X as a divisor on X Qp .

Set y
Algorithm 5.6 does not always terminate; we cannot guarantee that eventually nA α i | Pν ×Y splits completely into a sum of points over Q p .In theory, we can split any divisor as a sum of points over some finite extension of Q p .However, working with these field extensions of Q p is often currently not possible in practice.
Remark 5.7.Algorithms 5.4 and 5.6 take in a point P ν of precision k, but their output can be of smaller precision.This depends on the precision loss in the computation of the p-adic height; see [BB12, Section 6.2].

Integer points of the torsor
Next we discuss the integer points of the torsor T .We give an algorithm to construct a map κ : Z r p → T (Z p ) j b (P ) with image exactly T (Z) j b (P ) .In practice, to give an upper bound on #U(Z) P , we only need to compute the image of the map κ in T (Z/p 2 Z) j b (P ) , because after composing with the pseudoparametrization ϕ from Definition 3.21 the map κ is given by convergent power series.In fact, in this section we will show that by virtue of our choice of pseudoparametrization, they are given by g homogeneous linear polynomials and ρ − 1 quadratic polynomials.
For now we restrict to a single trace zero endomorphism f and the corresponding torsor T f .By iterating over the linearly independent trace zero endomorphisms f 1 , . . ., f ρ−1 we recover T and κ.
Note that if the residue disk T f (Z) j b (P ) is empty, then its p-adic closure is also empty, and therefore we do not need to consider P .If the disk is not empty, then we can find t ∈ T f (Z) j b (P ) by arithmetic in the Jacobian.It is enough to consider if the corresponding residue disk J(Z) j b (P ) is empty.This is an instance of the Mordell-Weil sieve at p.
As an intermediate step, we need to compute points Q ij on N , the trivial biextension, that are the image under Ψ (defined in Definition of generating sections on certain fibers of M × (Z).
We construct points on N that are the image of generating sections of residue disks of M ×,ρ−1 (Z) following the method in Example 3.6.
Algorithm 6.1 (Compute the Q ij ).Input: G 1 , . . ., G r ′ a generating set of the Mordell-Weil group of J, a trace zero endomorphism f : J → J. Output: Points Q ij on N that are the image of the generating section of M × (G i , f (G j ))(Z) and Q i0 that are the image of the generating section of For each G i , use Algorithm 4.10 to compute representing divisors D 1 , . . ., D r ′ of f (G i ). 3. Use Algorithm 4.7 to compute a divisor D 0 whose class is the point c ∈ J(Z). 4. Compute the local height h p (E i , D j ) and h p (E i , D 0 ) for 1 ≤ i, j ≤ r ′ . 5. Using [vBHM20, Section 2], compute the height h ℓ (E i , D j ) at ℓ = p and h ℓ (E i , D 0 ) at ℓ = p for 1 ≤ i, j ≤ r ′ .6.Return Let G 1 , . . ., G r ′ be a generating set for the full Mordell-Weil group, with r ′ ≥ r.Let G i be a basis for the kernel of reduction J(Z) → J(F p ) for i = 1, . . ., r. (Note that the reduction map is injective when restricted to the torsion of J(Z), so the kernel of reduction is a free Z-module of rank r.) Write for some e ij ∈ Z.Let G t denote the projection of t ∈ T (Z) j b (P ) to J j b (P ) .Write for some e 0i ∈ Z.Using the biextension group laws and the points Q ij we construct a series of points in M × (Z) living over certain points in J × J that are the image of generating sections of the corresponding residue disks in M × (Z).
A formula for the points P ij over ( G i , f (m G j )) is Here, • i and i for i = 1, 2 denote the biextension group laws (7) and (6).
Next R i t live over ( G i , α( G t )) and hence Finally, S tj live over ( G t , f (m G j )) and so Remark 6.2.In M × (Z), these points are all unique up to sign.Since we are recording the image in N , this sign does not matter.
For n = (n 1 , . . ., n r ) ∈ Z r we can now construct the points A t(n), B t(n), C(n), and D t(n) in T (Z) given by [EL21, (4.2)-(4.4)].The key property of this construction is that D t(n) lies above the point G t + i n i G i ∈ J(Z) j b (P ) .Furthermore, by [EL21, (4.6)-(4.9)],we have that D t((p − 1)n) is in the residue disk T f (Z) j b (P ) , allowing us to explicitly construct the map Finally, by [EL21, Theorem 4.10], the map κ f,Z extends uniquely to a continuous map The image of κ f is T f (Z) j b (P ) .
By iterating over the basis f 1 , . . ., f ρ−1 of trace zero endomorphisms, we obtain the map and its unique extension to a continuous map The map κ has image T (Z) j b (P ) .
Recall the pseudoparametrization ϕ : is given by g homogeneous linear polynomials and ρ − 1 polynomials of degree at most 2.
Proof.It is enough to show this for κ Z , since ϕ • κ is continuous.
We make the identification J(Z) on the first g components.Since log is a group homomorphism, it follows the first g polynomials are homogeneous linear as desired.
Now we fix one of the ρ − 1 trace zero endomorphisms f : J → J. Let π f : Z g p × Q ρ−1 p → Q p be the projection onto the coefficient corresponding to f .Consider the map τ := π f • ϕ • κ Z .We write F for the affine linear map where we identify J(Z) α(j b (P )) with Z r by subtracting α(D 0 ) and use J(Z) 0 ≃ Z r .
By [EL21, (4.2)-(4.4)]we have that τ (n 1 , . . ., n r ) is a sum of a constant term, a linear function in the integers n 1 , . . ., n r , a linear function in F n and a bilinear form evaluated in (n, F n). Since F is linear, in total, this gives a function of degree at most 2 in n.

The geometric quadratic Chabauty algorithm
In this section, we present the main algorithm of this paper for doing geometric quadratic Chabauty.This algorithm ties together the results of the previous sections.
Algorithm 7.1 (Geometric quadratic Chabauty in a single disk).Input: ∅ with a regular model X of genus g and Mordell-Weil rank r, and with Jacobian of Néron-Severi rank ρ > 1, such that r < g + ρ − 1; • ρ−1 nontrivial independent trace zero endomorphisms represented by (g×g)-matrices giving the action on the sheaf of differentials with respect to a fixed basis; • an open set U ⊂ X sm containing the smooth points of one geometrically irreducible component of X Fq for all primes q; • a prime p > 2 of good reduction for X; • a generating set G 1 , . . ., G r ′ of the Mordell-Weil group of J. Output: g +ρ−2 integral convergent power series in Z p z 1 , . . ., z r up to precision k, defining j b (U(Z p ) P ) ∩ T (Z) inside T (Z).
For each of the given trace zero endomorphisms f do Steps 2 through 5. 1.For each of the given trace zero endomorphisms f do the following.
Using the elements Q ij , find the map κ f,Z : Z r → T f (Z) j b (P ) as in (15) and extend it to the map κ f : Z r p → T f (Z p ) j b (P ) .

Return g
By iterating this over all simple opens U (as in Section 2), and also iterating over all F p -points of U, we obtain multivariate power series up to precision k cutting out X(Z p ) Geo .
Remark 7.2.By [EL21, Section 9.2], the power series in the output of Algorithm 7.1 have at most finitely many zeros in Z p .In practice, one can solve these power series up to enough precision by using a multivariate Hensel's lemma [Kuh11,Theorem 25].This assumes that the Jacobian matrix of the sequence of power series is invertible over Q p .We expect this to always happen unless there is a geometric obstruction.
Often solving these power series modulo p is enough to determine X(Z p ) Geo .See for example [EL21, Theorem 4.12], which we use in Section 9.Even if computations modulo p are not enough, one can increase the precision by considering the residue disks U(Z p ) P , where P ∈ U(Z/p k Z) for some integer k.An example of the geometric Chabauty method with higher precision is given in Remark 9.9.
Remark 7.3.In practice, to run Algorithm 7.1 we need to be able to compute Coleman-Gross heights on the curve X.Currently, this has only been made algorithmic for hyperelliptic curves.

The comparison theorem
In this section we give a comparison theorem between the geometric method and the cohomological quadratic Chabauty of [BD18, BD21, BDM + 19, BDM + 21].In Theorem 8.5, we show that the geometric method produces a refined set of points, as is the case for classical Chabauty-Coleman [HS22].
For this section we assume that p is a prime of good reduction, that r = g, that ρ > 1, and further, that J(Z) has finite index in J(Z p ).The cohomological quadratic Chabauty set in [BD18] is defined under these assumptions.We do not require a semistable model for X/Q q , q|n as is sometimes assumed; a semistable model can make explicit calculations of heights away from p easier, see [BD20] or [BDM + 21, Section 3.1].By [Bet21, Lemma 6.1.1]the local heights away from p factor through the component set of the minimal regular model.
Let Z 1 , . . ., Z ρ−1 be a basis for ker(NS(J) → NS(X)).In the cohomological method, from the transpose Z ⊤ i of such a correspondence 1 we can construct a quadratic Chabauty function σ i : X(Q p ) → Q p and a finite subset Ω i ⊂ Q p described explicitly in terms of local heights at primes of bad reduction such that σ i (z) ∈ Ω i for all z ∈ X(Q).This finite subset Ω i consists of one constant c U,i for every simple open U.
We describe the construction of σ i and the set Ω i in more detail after we present the main theorem.The divisor Z i is the correspondence of a trace zero endomorphism f i : J → J of the Jacobian.In the geometric method, we work with the endomorphism α i := m • • tr c i •f i .This multiplication with m will result in all the heights in the trivial biextension N to be a factor m larger than in the cohomological case.
where the union is over all simple opens U.
Remark 8.2.As far as we know, the existing literature does not explicitly define the quadratic Chabauty set in the case of multiple endomorphisms.In the case where one uses a single trace zero endomorphism, the set is defined in [BD18, Theorem 1.2].One can see Definition 8.1 as a special case of the finite set implicitly defined in [Bet21, Theorem A], for the quotient of the fundamental group that is an extension of the abelianization by Here the union and the intersection have been switched, and hence the resulting set can be bigger.The difference between the two sets consists exactly of points x ∈ X(Q p ) such that σ i (x) ∈ Ω i for every i, but such that there is no U with σ i (x) = c U,i for every i.In particular, the points in the difference do not lie in any of the simple opens U, and hence are not rational points.
Recall the definition of X(Z p ) Geo from Definition 2.3.Given a covering of X(Z) by simple opens U we have that The following definitions give terminology for two of the cases in which X(Q p ) Coh is strictly bigger than X(Z p ) Geo .Definition 8.3.We say that the Mordell-Weil group is of good reduction (modulo p) if the map J(Z) 0 /pJ(Z) 0 → J(Z/p 2 Z) 0 is injective.Otherwise, we say that it is of bad reduction.
The Mordell-Weil group being of good reduction is equivalent to the map J(Z) 0 → J(Z p ) 0 being an isomorphism.On the level of abstract groups, this map is always an embedding Z g p → Z g p with image of index some power of p. Another equivalent way of stating this is that the p-saturation of is always equal to J(Z p ) 0 , and the Mordell-Weil group is of bad reduction if and only if this p-saturation is bigger than J(Z) 0 .Definition 8.4.For Q ∈ X(F p ), if j b (Q) is not in the image of the reduction map J(Z) → J(F p ), then we say Q fails the Mordell-Weil sieve (at p).In this case, the residue disk X(Z p ) Q cannot contain a rational point.Otherwise, Q passes the Mordell-Weil sieve (at p).
Our main theorem is the following comparison theorem.
Theorem 8.5.There is an inclusion X(Q) ⊆ X(Z p ) Geo ⊆ X(Q p ) Coh .For P ∈ X(Q p ) Coh we have P ∈ X(Z p ) Geo if and only if one of the following conditions holds: (1) P fails the Mordell-Weil sieve at p; (2) the Mordell-Weil group is of bad reduction at p and j b (P ) does not lie in the p-adic closure of the Mordell-Weil group, but only in its p-saturation.
Remark 8.6.It follows immediately from the proof of Theorem 8.5 that the inclusion X(Q) ⊆ X(Z p ) Geo ⊆ X(Q p ) Coh and comparison from Theorem 8.5 also hold when the sets X(Z p ) Geo and X(Q p ) Coh are constructed using a fixed subset Z i 1 , . . ., Z i k of 1 ≤ k < ρ − 1 independent elements of ker(NS(J) → NS(X)), instead of a full basis.
Remark 8.7.In [HS22], an analogous theorem is given for the comparison between the classical Chabauty-Coleman method, as in [Col85b,BBK10], and the geometric linear Chabauty, as developed in [Spe20] and [HS22].The comparison theorem [HS22, Theorem 4.1] shows that the set of candidates found by the classical Chabauty-Coleman method contains the set found by geometric linear Chabauty method.Furthermore, the two sets differ by conditions analogous to (1) and (2).
Let 1 ≤ i ≤ ρ(J) − 1.We briefly recall the constructions of σ i and Ω i from [BDM + 21].For more details, the reader can also consult [BD18, BDM + 19].The cohomological method for quadratic Chabauty uses Nekovář's theory [Nek93] of p-adic heights of certain Galois representations to construct a global height h Nek i : X(Q) → Q p by attaching a family of Galois representations to X(Q) and X(Q p ).The Galois representation depends on the choice of base point b as well as the correspondence Z i .We suppress this dependence on b in our notation.The global height also depends on a choice of splitting of the Hodge filtration and idèle class character, which we choose to be compatible with the choices made to construct the Coleman-Gross height h.In particular we choose the cyclotomic character.This global height This global height decomposes as a sum of local heights over finite places where ) for z ∈ X(Q p ), recalling that the right hand side implicitly depends on Z i .Then, for any z ∈ X(Q), using the decomposition above we can write h Nek i (z) = h Nek i,p (z) + q =p h Nek i,q (z).The set Ω i ⊂ Q p is defined by the local heights in the following way.Let Ω i,q := {h Nek i,q (z) | z ∈ X(Q q )}.If X Fq is geometrically irreducible, then Ω i,q = {0}.We can therefore define the finite set Hence, when z ∈ X(Q), we have σ i (z) ∈ Ω i and so X(Q p ) Coh ⊇ X(Q).
Remark 8.8.The function σ i (z) is locally analytic [BDM + 21, pp.6, 10].If X has sufficiently many rational points, then one can explicitly express the function σ i (z) as a power series in every residue disk, and for each c ∈ Ω i and each residue disk of X(Q p ) find the roots of σ i (z) − c to explicitly solve for elements of X(Q p ) Coh .
The following theorem relates the local height of the Galois representation associated to a point P ∈ X(Q p ) to a pairing with a divisor that is studied in [DRS12].
Proof.Let z ∈ U(Z p ) ⊂ X(Z p ) with z = b.By Theorem 8.10 and Proposition 8.11 we have that

This is equal to
This last equality follows from Corollary 4.16.
Proof of Theorem 8.5.Let c ∈ Ω i , and consider the function σ i − c.By (19), Theorem 8.10, and Definition 8.15 there is a simple open U ⊂ X such that c = c U,i .
Let j b,U,i denote the map U → T i .According to Lemma 8.17 we have that −m( where T i (Z p ) → M × (Z p ) is the natural injective map.Define g U,i := −m(σ i − c).Note that the first three maps in (20) are injections.
With this formulation we have Similarly, we can write By Lemma 8.13, the set Z(g U,i ) contains Therefore, we get the containment X(Z p ) Geo ⊆ X(Q p ) Coh .By Lemma 8.14 for fixed U, i the difference consists exactly of points P that fail the Mordell-Weil sieve and points P such that j b (P ) lies not in J(Z) but only in its p-saturation.We see that an element of X(Q p ) Coh \ X(Z p ) Geo satisfies condition (1) or condition (2) of Theorem 8.5.On the other hand, if P ∈ X(Q p ) Coh fails the Mordell-Weil sieve or j b (P ) / ∈ J(Z), then P ∈ X(Z p ) Geo .The theorem follows.

Example
We give an example of the implementation on the modular curve X 0 (67) + of the algorithms presented.The rational points on this curve have already been determined [BBB + 21] using quadratic Chabauty and a Mordell-Weil sieve, but we can also use the methods presented here to show the following proposition about the rational points of the curve in one residue disk.Magma code that can be used to verify the computations here can be found in [DRHS].Let X be a regular model for X 0 (67) + over the integers given by the homogenization of y 2 + (x 3 + x + 1)y = x 5 − x in the weighted projective plane P 2 (1,3,1) .Then X(Q) = X(Z) and we show the following.
Theorem 9.1.The integer points of X(Z) that do not reduce to (1, 4) ∈ X(F 7 ) are contained in the set Remark 9.2.The residue disk above (1, 4) ∈ X(F 7 ) has at least two integer points, [1 : −3 : 2] and [1 : −10 : 2].Using geometric quadratic Chabauty modulo p 2 , we cannot bound the size of this residue disk.After doing the necessary calculations, it turns out im j b (z) = im κ(0, n 2 ).In this case, applying [EL21, Theorem 4.12], since the ring is not finite, we cannot determine the solutions using calculations modulo p 2 .
By increasing precision we are guaranteed a finite set of solutions in this residue disk.In practice, this requires computing heights of points that lie in residue disks at infinity which is not possible using current implementations of Coleman-Gross heights.
We present the computations in a single residue disk over P = (0, −1) ∈ X(F 7 ) where we show the following.
Proposition 9.3.The integer points of X(Z) reducing to (0, −1) ∈ X(F 7 ) are contained in the set {(0, −1), (4 We first list some facts about this curve that will be useful in our computations.The curve X is a projective curve of genus 2 with Jacobian J.We recall some details about X and its Jacobian that are presented in [BBB + 21, Section 6].The Jacobian J has Mordell-Weil rank 2 and J Q has Néron-Severi rank 2. In addition, the only prime of bad reduction of X is 67.At 67, the special fiber is geometrically irreducible: it has one component with two nodes defined over F 67 2 .Hence, there are only geometrically irreducible fibers over every prime. Remark 9.4.For this example curve, all of the fibers are geometrically irreducible, leading to a simplification in the notation used in the example compared to the notation in the preceding sections.In general, one needs to consider a distinction between J and J 0 , where J 0 is the fiberwise connected component of 0 in J.We also omit the constant m which is the least common multiple of the exponents of all J/J 0 (F p ), with p ranging over all primes.Since J = J 0 , we have m = 1.Let X sm denote the open subscheme of X consisting of points at which X is smooth over Z. Above, we consider the simple open subschemes U of X sm .In this example, there is only one simple open to consider: the scheme X sm obtained by removing the two Galois conjugate nodes in the fiber over 67.Since X is regular, X sm (Z) = X(Z). of this matrix is nonzero, so we let f := 2T 2 + 3 id : J → J.The endomorphism f has trace zero and matrix representation 1 −2 −2 −1 (24) with respect to the basis presented in (23).Using the work of [CMSV19], we can compute a divisor D f ⊂ X Q × X Q inducing f .The equations that define this divisor are given in (32).Then Algorithm 4.3 produces the divisor A α that satisfies the properties of Lemma 4.4.
We now use Algorithm 4.10 to calculate f (G 1 ) and f (G 2 ), where G 1 and G 2 are the generators of the Mordell-Weil group of J as in (22).
Since J(Z) = J(Q), the divisor f (G i ) only needs to be computed over the rationals for i = 1, 2. For example, applying (9) we get f (G 1 ) = O X (D f | P ×X − D f | ι(P )×X ) and we can compute an explicit divisor f (G 1 ) using the equations for D f .We find that Furthermore, we compute c = [−11G 1 − 8G 2 ] using Algorithm 4.7.
We can parametrize the residue disk over P up to finite precision by We now find the trivializing section ϕ • λ, following Section 5.By direct computation the constant v from Proposition 5.2 is 0, hence the pseudoparametrization ϕ has codomain Z 3 p (instead of Z 2 p × Q p ).This computation is done using code from the repository [BDM + ].Since p > 3, by Proposition 5.2 the map ϕ • λ : Z p → Z 3 p is linear modulo p.We will calculate j b (P 0 ) and j b (P 1 ) following Algorithm 5.4 and interpolate to determine the map.What the following computations show is that (27) ϕ • λ(ν) ≡ (2ν, 0, 6 − ν) mod p.
By Proposition 5.1, the image of the map ϕ • λ is cut out by two convergent power series.Giving Z 3 p the coordinates (x 1 , x 2 , x 3 ), we see the image of ϕ • λ is cut out by the equations g 1 = 0, g 2 = 0 with g 1 ≡ x 2 mod p, g 2 ≡ 2x 3 + x 1 + 2 mod p.
Algorithm 5.4 relies on being able to compute Coleman-Gross local heights at p and at primes of bad reduction.We first note that, since the special fiber of X at 67 is geometrically irreducible, the heights at ℓ = p are all trivial, and we only have to consider the heights at p. Balakrishnan [Bal] has implemented Coleman-Gross local heights h p (D, E) for disjoint divisors of degree 0 on a curve Y with a few requirements: (1) the hyperelliptic curve Y : y 2 = H(x) is given by a monic odd degree model; (2) the divisors D and E split as a sum of points Remark 9.5.Suppose that D = i n i P i and E = Div r + E ′ where E ′ = j m j Q j with so we can also compute h p (D, E).
We now compute for P the local height ψ( j b (P )) = h p (P − b, A α | P ×X ).Let B, C be the divisors on X defined in Algorithm 4.3.One can check that B ∩ P ν is empty over Z/p 2 Z for all ν ∈ F p , so we have , with E P 0 = E ′ P 0 + Div g P 0 where g P 0 is computed explicitly as an element of the function field and given by equation (33).By Remark 9.5, we can decompose h p (P − b, E P 0 ) = h p (P − b, E ′ P 0 ) + h p (P − b, Div g P 0 ).We compute h p (P − b, Div g P 0 ) = log g P 0 (P )/g P 0 (b) = log(4/9) ≡ 7 mod 49.
We also compute Unlike the P 0 case, the divisor D P 1 := D f | P 1 ×X is not a sum of two p-adic points.Instead we use the explicit Cantor's algorithm [Can87,Sut19] to get a linearly equivalent multiple which does split as a sum of p-adic points.
Let (u 1 , v 1 ) be the Mumford representation for D P 1 .Then using [Sut19, Algorithm Compose] we can compute (u 2 , v 2 ), the Mumford representation for 2D P 1 .Applying [Sut19, Algorithm Reduce] we obtain the Mumford representation (u 3 , v 3 ) for the reduction of 2D P 1 along with r = (y − v 2 (x))/u 3 (x), satisfying the relationship Remark 9.7.Since the computations for D P 1 were done on the regular model, we need to change the equations to the odd degree model.The Mumford divisor for D P 1 is a sum of 2 points over a totally ramified extension of Q p .Using the equations (28) for the change of model we can map the points to two points (x 1 , y 1 ), (x 2 , y 2 ) on the odd degree model and construct the corresponding degree 2 Mumford divisor (u 1 , v 1 ) vanishing on the x-coordinates using interpolation: Then 2D P 1 is linearly equivalent to a divisor that splits into a sum of two points over the odd degree model.The splitting is given by {Q 1 , Q 2 } := {(469610 • 7 + O(7 9 ), −15018865 + O(7 9 )), (499647 + O(7 9 ), −14480684 + O(7 9 ))}.By (29) we have With the splitting in hand, we can compute j b (P 1 ): The divisor B − C is not a sum of points, but we have that B − C is equal to 4∞ − − ιb − 5ιQ + Div(g P 1 ), where g P 1 is given by (34).Therefore ψ( j b (P 1 )) is ).Now we can calculate j b (P 1 ) in the map ϕ : T (Z p ) j b (P ) → Z 3 p given in Definition 3.21.We can compute this using the logarithm, normalized by the logarithm at P : Hence we see ϕ( j b (P 0 )) = (0, 0, 6) and ϕ( j b (P 1 )) = (2, 0, 5).By interpolating these values we get (27).
We now discuss the map κ using formulas in Section 6.We will show that the map ϕ • κ : Z 2 p → Z 3 p , which is by Proposition 6.3 given by two homogeneous linear polynomials and one quadratic polynomial, is modulo p equal to Following Algorithm 6.1 we construct the points of M × (G i , f (G j ))(Z) and M × (G i , c)(Z) for i, j = 1, 2 as in [EL21, Section 8.3].We work out the example M × (G 1 , f (G 2 ))(Z) here in detail.Recall from (25) that we have G ).Since we want to work with the image in N , and this representation of f (G 2 ) is not disjoint from G 1 over Q, we represent G 1 by the linearly equivalent divisor ιb − ∞ + + ∞ − − Q and f (G 2 ) by the linearly equivalent divisor 3(P − ιP ) + (P − ιQ).These divisors are not disjoint over Z because −ιQ and ιb intersect over Z/2Z so We can compute The remaining Q ij are: Remark 9.8.In practice, since we will need to add Q ij in N ≃ J(Q p ) × J(Q p ) × Q p we use the map log : J(Q p ) → Q g p for i, j = 1, 2 and for j = 0, we store Q ij as the vector (log(G i ), log(f (G j )), h(G i , f (G j ))).This allows us to add in Q g p instead of J(Q p ).We proceed to compute the bijection κ : Z 2 p → T (Z p ) j b (P ) of the integral points of T modulo p 2 , as in [EL21, Section 8.5].The divisor j b (P ) ∈ J(F p ) is equal to the image of in J(F p ) and correspondingly we define e 01 := 1 and e 02 := 3.
We now have the tools to prove the upper bound on the number of points in the residue disk #X(Z) P .We define and so by [EL21, Theorem 4.12] we have an upper bound of 2 on #X(Z) P .Specifically, we see that there is at most one point reducing to P 0 , namely P itself, and at most one point reducing to P 4 in X(Z/p 2 Z) P ; the other P ν have no rational points lying over them.
Remark 9.9.If we calculate κ and j b with greater p-adic precision, we can compute the point reducing to P 4 with greater precision.This can be done by brute force, that is, trying all lifts of the found solution n 1 = 1, n 2 = 3, ν = 4 and seeing when any of the calculated values of κ or j b agree modulo the required precision.However, there is a more efficient way.We can look at the "higher residue disks" X(Z p ) P 4 and T (Z p ) j b (P 4 ) , consisting of points that reduce to a specified Z/p 2 Z-point.We can parametrize X(Z p ) P 4 with the map Z p → X(Z p ) P 4 sending µ to P 4+pµ .With respect to our usual map ϕ : T (Z p ) j b (P ) → Z 3 p , we get a bijection of the higher residue disk of the torsor T (Z p ) j b (P 4 ) → (1, 0, 2) + pZ 3 p .Given these identifications, the inclusion j b : X sm (Z p ) P 4 → T (Z p ) j b (P 4 ) is given by power series that are linear modulo p.Like in Section 5, these can be found by interpolation.Similarly, κ restricted to (1 + pZ p ) × (3 + pZ p ) gives the inclusion κ : T (Z) j b (P 4 ) → T (Z p ) j b (P 4 ) .For these identifications, κ is actually homogeneous linear modulo p. Solving the resulting affine linear system of equations, we get that the only possible intersection of the image of κ and of j b in the higher residue disk T (Z/p 3 Z) j b (P 4 ) ≃ F 3 p is (5, 1, 5), corresponding to P 4+pµ with µ = 4.This is the point P 32 ∈ X(Z/p 3 Z) P 4 .

Appendix A. Equations
We provide the equations used in the computations of Section 9. We give coordinates ((x, y), (u, v)) to X ×X.With this notation, the equations that define the divisor D f are the following.
so the choice of representing divisor for [D] does not change the value of Ψ.By symmetry of the norm [EL21, Section 6.5], we can also conclude that Ψ does not depend on the choice of representing divisor for [E].
compatible with the previous rigidification; (d) the degree of A α restricted to fibers of the first projection is 0. Proof.By [Smi05, Theorem 3.4.7],any divisor inducing the endomorphism m • •f is of the form mD f + F such that F is a sum of vertical or horizontal divisors, so then (a) holds.Conditions (b) and (c) force F to be m(−B × X + X sm × B − X sm × C).Finally, by [BL04, Proposition 11.5.2] and the important fact that the trace of f is zero we have that deg(A α | P ×X ) = 0 and (d) holds.So A α is the desired divisor.Remark 4.5.Conditions (b) and (d) are the other way from the order chosen in Edixhoven-Lido, in order to agree with the convention in[CMSV19].(That is, in Edixhoven-Lido, they require that the fibers of the second projection are degree 0.) Algorithm 4.8 (Compute f * ).Input: a morphism of projective schemes f : X → Y given as a graded ring morphism f * : S → R, where X = Proj R and Y = Proj S; an irreducible subvariety Z of X given by a Gröbner basis for its defining ideal J in R. Output: the pushforward f * ([Z]), given by a Gröbner basis.1.Let B be a set of generators of S. 2. Set I ⊂ S ⊗ R to be the ideal generated by {b ⊗ 1 − 1 ⊗ f * (b) | b ∈ B} and 1 ⊗ J. 3. Compute a Gröbner basis B for I with respect to the lexicographical ordering on S ⊗ R. 4. Set K := I ∩ S with Gröbner basis B ∩ S. 5. Compute the degree d := deg (f | Z : Proj R/J → Proj S/K).6.Return a Gröbner basis for K d .
Algorithm 4.10 (Apply f ).Input: a ring S and two effective divisors D + and D − on X sm S of the same degree; the correspondence A α from Algorithm 4.3 inducing the morphism m • f : J → J. Output: the Jacobian point m • f ([D + − D − ]) ∈ J(S). 1.For D ∈ {D + , D − } do: (a) Compute a Gröbner basis for A α | D×X as a divisor on D × X.(b) Write D = i n i D i as a sum of irreducible components using primary decomposition.(c) Compute the Gröbner basis for the pushforward E(D i ) := n i f * (D i ) on X using Algorithm 4.8 for every D i .(d) Set E(D) :
Algorithm 5.6 (Local heights for the trivializing section on a hyperelliptic curve).Input: A point P ν ∈ U(Z/p k Z) P on a hyperelliptic curve Y : y 2 = H(x) and the Mumford representation of A α i | Pν ×Y as a divisor on Y .Output: The value h p (P ν − b, A α i | Pν ×Y ) to finite precision.1. Set n := 1. 2. Use Cantor's Algorithm to compute a Mumford representation (u n , v n ) and a rational function s n such that Div(u n , v n ) + Div s n = nA α i | Pν ×Y [Can87].3. Check if u n factors completely over Q p into linear factors.4. If yes, set x j to be the roots of u n for j = 1, . . ., deg(u n ).If no, increase n by 1 and go back to Step (2).
(a) Compute the correspondence A α that induces the endomorphism m • •f : J → J as given in Lemma 4.4.(b) Find the divisor representing c = [(L α ) b×X ] ∈ J(Z) using Algorithm 4.7.(c) Choose a local parameter ν to parametrize U(Z p ) P as ν → P ν .By Proposition 5.2 the map ν → ϕ • λ(ν) is modulo p k given by a polynomial with bounded degree.By calculating enough values, interpolate to find the polynomial expression.In particular, when v = 0 and p > 3, for k = 1, the degree bound is 1.In this case, compute ϕ • λ(0), ϕ • λ(1) and interpolate the resulting line.(d) With the generating set G 1 , . . ., G r ′ , use Algorithm 6.1 to compute points Q ij , Q i0 ∈ N up to precision k that are the images of the generating sections of M