# Hyperelliptic and trigonal modular curves in characteristic $p$

Maarten Derickx  Maarten Derickx, Den Haag, The Netherlands
<EMAIL_ADDRESS>http://www.maartenderickx.nl/ and  Filip Najman  Filip
Najman, University of Zagreb, Bijenička Cesta 30, 10000 Zagreb, Croatia
<EMAIL_ADDRESS>https://web.math.pmf.unizg.hr/~fnajman/

###### Abstract.

Let $X_{\Delta}(N)$ be an intermediate modular curve of level $N$, meaning
that there exist (possibly trivial) morphisms $X_{1}(N)\rightarrow
X_{\Delta}(N)\rightarrow X_{0}(N)$. For all such intermediate modular curves,
we give an explicit description of all primes $p$ such that
$X_{\Delta}(N)_{\overline{\mathbb{F}\rule{0.0pt}{6.0pt}}_{p}}$ is either
hyperelliptic or trigonal. Furthermore we also determine all primes $p$ such
that $X_{\Delta}(N)_{\mathbb{F}_{p}}$ is trigonal.

This is done by first using the Castelnuovo-Severi inequality to establish a
bound $N_{0}$ such that if
$X_{0}(N)_{{\overline{\mathbb{F}\rule{0.0pt}{6.0pt}}_{p}}}$ is hyperelliptic
or trigonal, then $N\leq N_{0}$. To deal with the remaining small values of
$N$, we develop a method based on the careful study of the canonical ideal to
determine, for a fixed curve $X_{\Delta}(N)$, all the primes $p$ such that the
$X_{\Delta}(N)_{{\overline{\mathbb{F}\rule{0.0pt}{6.0pt}}_{p}}}$ is trigonal
or hyperelliptic.

Furthermore, using similar methods, we show that
$X_{\Delta}(N)_{{\overline{\mathbb{F}\rule{0.0pt}{6.0pt}}_{p}}}$ is not a
smooth plane quintic, for any $N$ and any $p$.

##  1\. Introduction

Let $k$ be a field and $C$ a curve over $k$. Throughout the paper we will
assume all curves are geometrically integral and proper over $k$. The gonality
$\operatorname{gon}_{k}C$ of $C$ over $k$ is the least degree of a non-
constant morphism $f:C\rightarrow\mathbb{P}^{1}_{k}$. Equivalently, it is the
least degree of a non-constant function $f\in k(C)$.

We will study the gonality of modular curves, and in particular of
”intermediate” modular curves $X_{\Delta}(N)$. Let $N$ be a positive integer
and let $\Delta$ be a subgroup of
$(\mathbb{Z}/N\mathbb{Z})^{\times}/\langle-1\rangle$; we will say that
$\Delta$ is of level $N$. Let $X_{\Delta}(N)$ be the modular curve, defined
over $\mathbb{Q}$, associated to the modular group
$\Gamma_{\Delta}=\Gamma_{\Delta}(N)$ defined by

$\Gamma_{\Delta}=\left\\{\begin{pmatrix}a&b\\\
c&d\end{pmatrix}\in\operatorname{SL}_{2}(\mathbb{Z})\mid c\equiv 0\text{ mod
}N,(a\text{ mod }N)\in\Delta\right\\}.$

If $\Delta$ is the trivial subgroup of
$(\mathbb{Z}/N\mathbb{Z})^{\times}/\langle-1\rangle$, then
$X_{\Delta}(N)=X_{1}(N)$ and for
$\Delta=(\mathbb{Z}/N\mathbb{Z})^{\times}/\langle-1\rangle$ we have
$X_{\Delta}(N)=X_{0}(N)$. The morphisms $X_{1}(N)\rightarrow X_{0}(N)$ factor
through $X_{\Delta}(N)$: $X_{1}(N)\rightarrow X_{\Delta}(N)\rightarrow
X_{0}(N)$.

Gonalities of modular curves over fields of characteristic $0$, most commonly
$\mathbb{Q}$ or $\mathbb{C}$, have received considerable attention. The
modular curves that have been most studied are $X_{0}(N)$ and $X_{1}(N)$. For
$X_{0}(N)$ the results are as follows. Ogg [17] determined the hyperelliptic
modular curves $X_{0}(N)$. Hasegawa and Shimura [10] determined the $X_{0}(N)$
that are trigonal over $\mathbb{C}$ and over $\mathbb{Q}$, and Jeon and Park
[14] determined the $X_{0}(N)$ that are tetragonal over $\mathbb{C}$. More
recently, Najman and Orlić [16] determined the $X_{0}(N)$ that are tetragonal
and pentagonal over $\mathbb{Q}$ and determined the gonality of $X_{0}(N)$ for
all $N<135.$

All the curves $X_{1}(N)$ with $\operatorname{gon}_{\mathbb{Q}}X_{1}(N)=d$
were determined for $d=2$ by Ishii and Momose [11] (they even determined all
hyperelliptic $X_{\Delta}(N)$), for $d=3$ by Jeon, Kim and Schweizer [13] and
for $d=4$ by Jeon, Kim and Park [12] and for $5\leq d\leq 8$ by Derickx and
van Hoeij [7]. Derickx and van Hoeij [7] also determined
$\operatorname{gon}_{\mathbb{Q}}X_{1}(N)$ for all $N\leq 40$ and gave upper
bounds for $N\leq 250$.

More generally, Abramovich [1] gave a lower bound for the gonality of any
modular curve over $\mathbb{C}$ (which is usually not sharp). From this
result, it easily follows that there are only finitely many modular curves $X$
with $\operatorname{gon}_{\mathbb{C}}X\leq d$ for some fixed positive integer
$d$.

In this paper we consider the gonality of the modular curves $X_{\Delta}(N)$
over $\mathbb{F}_{p}$ and ${\overline{\mathbb{F}\rule{0.0pt}{6.0pt}}_{p}}$.
Poonen [19] showed that if one fixes the prime $p$, then the set of $\Gamma$
such that
$\operatorname{gon}_{{\overline{\mathbb{F}\rule{0.0pt}{6.0pt}}_{p}}}{X_{\Gamma}}\leq
d$ is finite, and gave lower bounds on
$\operatorname{gon}_{\mathbb{F}_{p^{2}}}{X_{\Gamma}}$ and
$\operatorname{gon}_{\overline{\mathbb{F}\rule{0.0pt}{6.0pt}}_{p}}{X_{\Gamma}}$,
depending on $p$ and the index of $\Gamma$ in
$\operatorname{PSL}_{2}(\mathbb{Z})$ [19, Proposition 3.1].

In Theorem 1.3 and Theorem 1.4 we will explicitly find all the pairs
$(\Gamma_{\Delta},p)$, with $p$ not dividing the level of $\Gamma_{\Delta}$
such that $\operatorname{gon}_{\mathbb{F}_{p}}{X_{\Gamma}}=2$ and
$\operatorname{gon}_{\mathbb{F}_{p}}{X_{\Gamma}}=3$.

It is easy to see that, for any curve $X$,
$\operatorname{gon}_{\mathbb{F}_{p}}X\leq\operatorname{gon}_{\mathbb{Q}}X$. It
is natural to ask, in the case of (some sets of) modular curves, when does
equality hold? A question in this direction, which was also one of the
motivations for this paper, was asked by David Zureick-Brown on
MathOverflow111https://mathoverflow.net/questions/132618/hyperelliptic-
modular-curves-in-characteristic-p.

######  Question 1.1.

Are there any $N$ such that $X_{0}(N)_{\mathbb{Q}}$ is not hyperelliptic but
for some $p$ not dividing $N$, $X_{0}(N)_{\mathbb{F}_{p}}$ is hyperelliptic?

We show in Theorem 1.3 below that the answer to this question is negative. We
consider the following more general questions.

######  Question 1.2.

  * A)

Given some family of modular curves $S$ and a positive integer $d$, can we
determine all $X\in S$ and primes $p$ of good reduction for $X$ such that

$\operatorname{gon}_{\mathbb{F}_{p}}X=d?$

  * B)

Given $S$ and $d$, can we also determine the $X$ and $p$ as above such that

$\operatorname{gon}_{\overline{\mathbb{F}\rule{0.0pt}{6.0pt}}_{p}}X=d?$

For $d=2$ both versions of the question are equivalent if
$X(\mathbb{Q})\neq\emptyset$ for all $X\in S$, since a curve with an
$\mathbb{F}_{p}$ point is hyperelliptic over $\mathbb{F}_{p}$ if and only if
it is hyperelliptic over $\overline{\mathbb{F}\rule{0.0pt}{6.0pt}}_{p}$. We
answer these questions for $d=2$ and $3$ where $S$ is the set of all
intermediate modular curves $X_{\Delta}(N)$.

######  Theorem 1.3.

Let $N$ be a positive integer, $p$ a prime not dividing $N$, and
$X_{\Delta}(N)$ an intermediate modular curve of level $N$. Then

$2=\operatorname{gon}_{{\overline{\mathbb{F}\rule{0.0pt}{6.0pt}}}_{p}}X_{\Delta}(N)<\operatorname{gon}_{\mathbb{C}}X_{\Delta}(N).$

if and only if $N=37$, $\Delta=\langle
4\rangle\leq(\mathbb{Z}/N\mathbb{Z})^{\times}$ and $p=2$.

######  Theorem 1.4.

Let $N$ be a positive integer, $p$ a prime not dividing $N$, and
$X_{\Delta}(N)$ an intermediate modular curve of level $N$. Then

$3=\operatorname{gon}_{{\overline{\mathbb{F}\rule{0.0pt}{6.0pt}}}_{p}}X_{\Delta}(N)<\operatorname{gon}_{\mathbb{C}}X_{\Delta}(N).$

if and only if $X_{\Delta}(N)=X_{0}(73)$ and $p=2$.

To answer 1.2 A) for $d=3$, in Section 6 we determine the fields of definition
of all trigonal maps $X_{\Delta}(N)\rightarrow\mathbb{P}^{1}$ in
characteristic $p$, for all $p$ not dividing $N$.

Anni, Assaf and Lorenzo García recently proved [2], among other results, that
there are no modular curves $X_{\Delta}(N)$ that have a smooth plane model of
degree $5$. We prove the same result for all $X_{\Delta}(N)$ over all
${\overline{\mathbb{F}\rule{0.0pt}{6.0pt}}_{p}}$.

######  Theorem 1.5.

Let $N$ be a positive integer, $p$ a prime not dividing $N$, and
$X_{\Delta}(N)$ an intermediate modular curve of level $N$. Then
$X_{\Delta}(N)_{{\overline{\mathbb{F}\rule{0.0pt}{6.0pt}}_{p}}}$ is not a
smooth plane quintic.

We prove our results in 2 steps. First, we show that the set of $N$ we need to
consider is such that the class number $h(-4N)$ is not too large (see Lemma
3.3 and Proposition 3.6). The (now proven) Gauss conjecture then reduces the
problem to dealing with only finitely many $N$. This strategy could in
principle also be used to classify all hyperelliptic and trigonal modular
curves over $\mathbb{Q}$ and $\mathbb{C}$.

Second, to deal with the remaining $N$, we develop explicit computational
criteria (see Section 4), based on Petri’s theorem, to check whether, for a
given $N$, there exists an $X_{\Delta}(N)$ of level $N$ and a prime $p$ not
dividing $N$ such that $X_{\Delta}(N)_{\mathbb{F}_{p}}$ is
hyperelliptic/trigonal/a smooth plane quintic.

All the code used to obtain our results can be found at [6].

###  1.1. Acknowledgements

We thank John Voight and David Zureick-Brown for their helpful discussion and
pointers to relevant literature.

##  2\. Background and notation

We now set up notation that will be used throughout the paper. By $X_{0}(N)$
we denote the classical modular curve parametrizing isomorphism classes of
pairs $(E,C)$ of generalized elliptic curves together with a cyclic subgroup
$C$ of order $N$. We will call a divisor $d>1$ of $N$ an Atkin-Lehner divisor
if $(d,N/d)=1$. For any Atkin-Lehner divisor $d$ of $N$ the Atkin-Lehner
involution $w_{d}$ acts on $(E,C)$ by sending it to $(E/C,E[N]/C)$. The Atkin-
Lehner involutions form a subgroup of $\operatorname{Aut}(X_{0}(N))$
isomorphic to $(\mathbb{Z}/2\mathbb{Z})^{\omega(N)}$, where $\omega(N)$ is the
number of prime divisors of $N$. The curve $X_{0}(N)$ and all its Atkin-Lehner
involutions are defined over $\mathbb{Q}$. The quotient $X_{0}(N)/w_{N}$ is
denoted by $X_{0}^{+}(N)$ and the quotient of $X_{0}(N)$ by the whole group of
Atkin-Lehner involutions is denoted by $X_{0}^{*}(N)$.

The number of the ramification points $\nu(d,N)$ of the map
$X_{0}(N)\rightarrow X_{0}(N)/w_{d}$ will be given in terms of class numbers
of imaginary quadratic fields (see Lemma 3.3 and Proposition 3.6). We give the
relevant data, which is taken from [23], about quadratic imaginary fields of
class number up to $100$ in Appendix A

By $X_{1}(N)$ we denote the modular curve whose $k$-rational points
parameterize pairs $(E,P)$ where $E$ is a generalized elliptic curve and $P\in
E(k)$ is a point $N$, up to $k$-isomorphism. For a
$d\in(\mathbb{Z}/N\mathbb{Z})^{\times}/\langle-1\rangle$, the diamond operator
$\langle d\rangle$ acts on $X_{1}(N)$ by sending $(E,P)$ to $(E,dP)$. For a
subgroup $\Delta\leq(\mathbb{Z}/N\mathbb{Z})^{\times}/\langle-1\rangle$,
$X_{\Delta}(N)$ is the quotient of $X_{1}(N)$ by the automorphism group of
diamond operators $\langle d\rangle$, for $d\in\Delta$. We note that for
$\Delta=(\mathbb{Z}/N\mathbb{Z})^{\times}$, we have $X_{\Delta}(N)=X_{0}(N)$
and for $\Delta=\langle-1\rangle$, we have $X_{\Delta}(N)=X_{1}(N)$. For any
$\Delta\leq(\mathbb{Z}/N\mathbb{Z})^{\times}/\langle-1\rangle$, the curve
$X_{\Delta}(N)$ lies ”in between” $X_{0}(N)$ and $X_{1}(N)$, in the sense that
there are (Galois) morphisms

$X_{1}(N)\rightarrow X_{\Delta}(N)\rightarrow X_{0}(N);$

hence the curves $X_{\Delta}(N)$ are called intermediate modular curves.

Let $X/k$ be a curve over a number field $k$ of genus $g\geq 2$. The canonical
ring (or as it is often called, the homogenous coordinate ring) of $X$ is

$R(X):=\bigoplus_{d=0}^{\infty}H^{0}(X,\Omega^{\otimes d}_{X/k}).$

Let $V:=H^{0}(X,\Omega_{X/k})$ and
$\operatorname{Sym}(V):=\bigoplus_{d=0}^{\infty}\operatorname{Sym}^{d}(V)$.
The identity map $\operatorname{Sym}^{1}(V)\rightarrow R(X)_{1}$ (which just
sends $V$ to $V$) induces a map of graded rings
$f_{can}:\operatorname{Sym}(V)\rightarrow R(X)$. Hence we obtain the canonical
map

$X\simeq\operatorname{Proj}(R(X))\rightarrow\operatorname{Proj}(\operatorname{Sym}(V))\simeq\mathbb{P}^{g-1}_{k}.$

The ideal $I_{can}:=\ker f_{can}\subseteq\operatorname{Sym}(V)$ is called the
canonical ideal.

Recall Petri’s theorem ([18, 20], see also [22, Section 1.1] for a historical
overview): for a nonsingular projective curve $X$ of genus $\geq 2$ that is
neither hyperelliptic, trigonal (possessing a map $X\rightarrow\mathbb{P}^{1}$
of degree 3) nor a smooth plane curve of degree 5, the canonical ring $R(X)$
is generated in degree 1 and $I$ is generated in degree 2. More precisely, we
have the following proposition.

######  Proposition 2.1.

Let $X/k$ be a curve of genus $g\geq 3$. By $V\cdot(I_{can})_{2}$ we denote
the image of $V\otimes(I_{can})_{2}$ in $(I_{can})_{3}$.

  * a)

$X$ is hyperelliptic over $\overline{k}$ if and only if
$(I_{can})_{2}\subseteq\operatorname{Sym}^{2}(V)$ is of dimension
$\binom{g-1}{2}$.

  * b)

Suppose $X$ is not hyperelliptic and not a smooth a plane quintic. Then $X$ is
trigonal over $\overline{k}$ if and only if the dimension of

$(I_{can})_{3}/(V\cdot(I_{can})_{2})$

is $g-3$.

  * c)

Suppose $X$ is a smooth plane quintic over $\overline{k}$. Then $g=6$ and the
dimension of

$(I_{can})_{3}/(V\cdot(I_{can})_{2})$

is $g-3=3$.

###### Proof.

This follows directly from [22, Table Ia]. ∎

##  3\. Bounds for hyperelliptic and trigonal curves

######  Definition 3.1.

We say that a curve is subhyperelliptic if it is of gonality $\leq 2$.

######  Proposition 3.2 (Castelnuovo-Severi inequality, [21, Theorem 3.11.3]).

Let $k$ be a prefect field, and let $X,\ Y,\ Z$ be curves over $k$. Let non-
constant morphisms $\pi_{Y}:X\rightarrow Y$ and $\pi_{Z}:X\rightarrow Z$ over
$k$ be given, and let their degrees be $m$ and $n$, respectively. Assume that
there is no morphism $X\rightarrow X^{\prime}$ of degree $>1$ through which
both $\pi_{Y}$ and $\pi_{X}$ factor. Then the following inequality hold:

$g(X)\leq m\cdot g(Y)+n\cdot g(Z)+(m-1)(n-1).$ (3.1)

Let, as before, $N$ be a integer, $d$ an Atkin-Lehner divisor of $N$ and let
$f_{d}:X_{0}(N)\rightarrow X_{0}(N)/w_{d}$ be the quotient map by the Atkin-
Lehner $w_{d}$ involution and denote by $\nu(d;N)$ the number of complex
ramification points of $f_{d}$.

######  Lemma 3.3 ([17, p.454.], see also [15]).

Let $N>4$ be an integer. The number of ramification points $\nu(N;N)$ of
$f_{N}$ satisfies

$\nu(N;N)=\begin{cases}h(-4N)+h(-N)&\text{if }N\equiv 3\pmod{4},\\\
h(-4N)&\text{otherwise.}\end{cases}$

In fact in [9, Remark 2] there is also a description of $v(d;N)$ when $d\neq
N$. While we used that formula in some explicit calculations, it is not
necessary for the main argument.

######  Proposition 3.4.

Let $X$ be a curve over a field $k$ of genus $g$, let
$f:X\rightarrow\mathbb{P}^{1}$ be a morphism of prime degree $p$, and suppose
$G\leq\operatorname{Aut}_{\bar{k}}X$ is a Galois stable subgroup such that
$X/G$ is of genus 0. If $g>(p-1)(\\#G-1)$ then $f$ is cyclic and there is an
automorphism $\sigma$ of order $p$ in $G$ such that $f$ is quotienting by
$\sigma$.

###### Proof.

Since $g>(p-1)(\\#G-1)$ the Castelnuovo-Severi inequality applied to $g:X\to
X/G$ and $f$ tells us that $f$ and $g$ have a common factor. But since $f$ is
of prime degree, it follows that $g$ factors through $f$. Since, by Galois
theory, all intermediate curves $X\rightarrow X^{\prime}\rightarrow X/G$ are
of the form $X^{\prime}=X/H$ for some subgroup $H$ of $G$, it follows that
there exists a subgroup $G^{\prime}$ of $G$ of order $p$ such that $f$ is
quotienting by $G^{\prime}$, proving the claim. ∎

######  Corollary 3.5.

Let $p$ be a prime, $N$ an integer, and $k$ an algebraically closed field of
characteristic coprime to $N$. Let $\Delta$ be a subgroup of
$(\mathbb{Z}/N\mathbb{Z})^{\times}/\langle-1\rangle$, such that $w_{d}\Delta
w_{d}^{-1}=\Delta$. Suppose there is a $d|N$ with $(d,N/d)=1$ such that
$X_{0}(N)/w_{d}$ is of genus 0, and that
$\mathrm{genus}(X_{\Delta}(N))>(p-1)(\frac{\phi(N)}{\\#\Delta}-1)$. Then any
morphism $f:X_{\Delta}(N)\rightarrow\mathbb{P}^{1}$ of degree $p$ is cyclic
and there is an automorphism $\sigma$ is in the group generated by $w_{d}$ and
the diamond operators, such that $f$ is quotienting by $\sigma$.

###### Proof.

The condition $w_{d}\Delta w_{d}^{-1}=\Delta$ ensures that the map
$X_{1}(N)/\Delta\to X_{0}(N)/w_{d}$ is Galois. The result now follows by
applying Proposition 3.4 to the subgroup of $\operatorname{Aut}X_{\Delta}(N)$
generated by $w_{d}$ and the diamond operators. ∎

######  Proposition 3.6.

Suppose $k$ is a field such that $p=\operatorname{char}k$ does not divide $N$.
Let $d>1$ be an Atkin-Lehner divisors of $N$ and $f_{d}:X_{0}(N)\rightarrow
X_{0}(N)/w_{d}$ the quotient map. The following hold:

  1. (1)

if $X_{0}(N)_{k}$ is hyperelliptic, then either
$(X_{0}(N)/w_{d})_{\mathbb{Z}[1/N]}$ is of genus $0$ or
$\nu(d;N)\leq 4$.

  2. (2)

if $f:X_{0}(N)_{k}\to\mathbb{P}^{1}_{k}$ is a map of odd degree $m$ then
$\nu(d;N)\leq 2m$.

  3. (3)

if $f:X_{0}(N)_{k}\to\mathbb{P}^{1}_{k}$ is a map of even degree $m$ then
either $\nu(d;N)\leq 2m$ or $f$ factors via $f_{d}$.

###### Proof.

We prove (1); part (2) and (3) are proven analogously, where in (2) we use
that an odd degree map cannot factor via $f_{d}$. First observe that since
$X_{0}^{+}(N)_{\mathbb{Z}[1/N]}$ is smooth, the genus is preserved under base
change to $k$. It follows that $X_{0}(N)/w_{d}$ has genus $0$ over $k$ if and
only if it has genus $0$ over $\mathbb{Z}[1/N]$. Hence if its genus is
nonzero, then $f_{d}$ is not the hyperelliptic map.

Note that since the degree of a map doesn’t change under field extensions the
proposition for $k$ follows from the proposition for $\bar{k}$, so we may
assume $k$ is algebraically closed and hence perfect. Applying the
Castelnuovo-Severi inequality to the maps $f_{d}$ and the hyperelliptic
$h:X_{0}(N)\rightarrow\mathbb{P}^{1}$, we get

$g(X_{0}(N))\leq 2g(X_{0}(N)/w_{d})+1.$ (3.2)

Applying the Riemann-Hurwitz formula to the map $f_{d}$ we get

$2g(X_{0}(N))=4g(X_{0}(N)/w_{d})-2+\nu(d;N).$ (3.3)

Combining (3.2) and (3.3) yields the claimed result.

∎

###  3.1. Hyperelliptic curves

######  Definition 3.7.

Let $N$ be an integer,
$\Delta\leq(\mathbb{Z}/N\mathbb{Z})^{\times}/\langle-1\rangle$ and $p$ a prime
not dividing $N$. We will say that a pair $(\Delta,p)$ is an exceptional
hyperelliptic pair if $X:=X_{\Delta}(N)$ is not hyperelliptic over
$\mathbb{Z}[1/N]$, but $X_{\overline{\mathbb{F}\rule{0.0pt}{6.0pt}}_{p}}$ is
hyperelliptic.

We define

$S_{0}:=\left\\{34,43,45,52,57,64,67,72,73,85,93,97,163,193\right\\},$
$H:=\left\\{22,23,26,28,29,30,31,33,35,37,39,40,41,46,47,48,50,59,71\right\\},$

and

$SH:=H\cup\\{N\leq 32,36,49\\}.$ (3.4)

The set $H$ is the set of $N$ such the $X_{0}(N)$ is hyperelliptic and $SH$ is
the set of $N$ such that $X_{0}(N)$ is subhyperelliptic. The set $S_{0}$
consists of the values of $N$ such that $X_{0}(N)_{\mathbb{Z}[1/N]}$ is not
subhyperelliptic, and $v(d;N)\leq 4$ for all Atkin-Lehner divisors $d$ of $N$.

######  Proposition 3.8.

Let $\Delta=(\mathbb{Z}/N\mathbb{Z})^{\times}/\langle-1\rangle$, i.e.
$X_{\Delta}(N)=X_{0}(N)$. If $(\Delta,p)$ is an exceptional hyperelliptic
pair, then $N\in S_{0}$.

###### Proof.

Suppose $X_{0}(N)_{\mathbb{F}_{p}}$ is hyperelliptic. By Proposition 3.6 (1),
it follows that either $X_{0}(N)_{\mathbb{Z}[1/N]}$ is hyperelliptic (in which
case $(\Delta,p)$ is not exceptional) or $v(d;N)\leq 4$ for every Atkin-Lehner
divisor $d$ of $N$. Using Lemma 3.3 we compute that $v(d;N)\leq 4$ for all
Atkin-Lehner divisors $d$ of $N$ and $X_{0}(N)_{\mathbb{Z}[1/N]}$ is not
subhyperelliptic only if $N\in S_{0}\cup\\{88,148,232\\}$.

To rule out the values $N\in\\{88,148,232\\}$ we note that for each of these
$N$, there exists a divisor $n|N$ such that $X_{0}(n)_{\mathbb{Z}[1/n]}$ is
not subhyperelliptic and $v(d;n)>6$ for some Atkin-Lehner divisor $d$ of $n$.
Hence for all primes $p$ not dividing $N$ (and hence not dividing $N$), it
follows by the same argument as above that $X_{0}(n)_{\mathbb{F}_{p}}$ is not
hyperelliptic. Now it follows by [19, Proposition A.1 (vii)] that
$X_{0}(N)_{\mathbb{F}_{p}}$ is not hyperelliptic. ∎

###  3.2. Trigonal curves

######  Definition 3.9.

Let $N$ be an integer,
$\Delta\leq(\mathbb{Z}/N\mathbb{Z})^{\times}/\langle-1\rangle$ and $p$ a prime
not dividing $N$. We will say that a pair $(\Delta,p)$ is an exceptional
trigonal pair if $X_{\Delta}(N)$ is not trigonal over $\mathbb{Z}[1/N]$, but
is trigonal over ${{\overline{\mathbb{F}\rule{0.0pt}{6.0pt}}}_{p}}$. We will
say $(N,p)$ is an exceptional pair if $X_{0}(N)$ is not trigonal over
$\mathbb{Z}[1/N]$, but is trigonal over
${{\overline{\mathbb{F}\rule{0.0pt}{6.0pt}}}_{p}}$.

Let $S_{1}$ be the following set

$\displaystyle S_{1}:=\\{$ $\displaystyle
34,37,38,40,43,44,45,48,50,52,53,54,57,58,61,64,67,72,73,76,$ $\displaystyle
81,85,88,93,97,106,108,109,121,157,162,163,169,193,277,397\\}.$

######  Proposition 3.10.

Let $X=X_{0}(N)$. If $(N,p)$ is an exceptional trigonal pair, then $N\in
S_{1}$.

###### Proof.

Suppose $X_{0}(N)_{{\overline{\mathbb{F}\rule{0.0pt}{6.0pt}}}_{p}}$ is
trigonal. By Proposition 3.6 (2), it follows that either
$X_{0}(N)_{\mathbb{Z}[1/N]}$ is trigonal (in which case $(N,p)$ is not
exceptional) or $v(d;N)\leq 6$ for an Atkin-Lehner divisors $d$ of $N$. Using
Lemma 3.3 we compute that $v(d;N)\leq 6$ and $X_{0}(N)_{\mathbb{Z}[1/N]}$ is
not trigonal only if $N\in S_{1}\cup\\{148,172,232,268,652\\}$.

To rule out the values $N\in\\{148,172,232,268,652\\}$ we note that for each
of these $N$, there exists a divisor $n|N$ such that
$X_{0}(n)_{\mathbb{Z}[1/n]}$ is of gonality $>3$ and $v(d;n)>6$ for some
Atkin-Lehner divisor $d$ of $n$. Hence for all primes $p$ not dividing $N$
(and hence not dividing $n$), it follows by the same argument as above that
$X_{0}(n)_{\mathbb{F}_{p}}$ is not trigonal. Now it follows by [19,
Proposition A.1 (vii)] that $X_{0}(N)_{\mathbb{F}_{p}}$ is not trigonal. ∎

##  4\. Checking hyperellipticity and trigonality of a given $X_{\Delta}(N)$
over $\mathbb{F}_{p}$ for all $p$

In Section 3 we showed that to find all exceptional hyperelliptic pairs
$(\Delta,p)$ we need to consider only finitely many subgroups $\Delta$, i.e.
only those for which either the level is in $S_{0}$ or such that $X_{0}(N)$ is
subhyperelliptic. Similarly, to determine all exceptional trigonal pairs
$(\Delta,p)$ we need to consider only the finitely many subgroups $\Delta$ for
which either the level is in $S_{1}$ or such that $X_{0}(N)$ is of gonality
$\leq 3$ over $\overline{\mathbb{Q}}$.

In this section we explain how to find, for a given $\Delta$, all the $p$ such
that $(\Delta,p)$ is an exceptional hyperelliptic or trigonal pair.

We will first need the following lemma.

######  Lemma 4.1.

Let $R$ be a discrete valuation ring with residue field $k$, fraction field
$K$ and uniformizer $\pi$. Let $X$ be a nice (meaning smooth, projective, and
geometrically integral) curve over $R$ and suppose $\mathcal{L}$ is a line
bundle on $X$ such that $\mathcal{L}(X_{k})$ and $\mathcal{L}(X_{K})$ have the
same dimension, then the map $\mathcal{L}(X)\otimes_{R}k\to\mathcal{L}(X_{k})$
is an isomorphism.

###### Proof.

This is done by taking global sections of the exact sequence

$0\to\mathcal{L}\xrightarrow{\cdot\pi}\mathcal{L}\to\mathcal{L}/\pi\mathcal{L}\to
0.$

Since $\mathcal{L}/\pi\mathcal{L}\cong\mathcal{L}\otimes k$, taking global
sections of this sequence gives an injection
$\mathcal{L}(X)\otimes_{R}k\to\mathcal{L}(X_{k})$. Comparing dimensions shows
that it has to be an isomorphism. ∎

Let $X$ be nice curve over $\mathbb{Z}[1/N]$ of genus $g>2$. We use the
notation set up in Section 2, in particular,
$V:=H^{0}(X,\Omega_{X_{\mathbb{Z}[1/N]}})$. We have that $V$,
$\operatorname{Sym}^{2}(V)$ and $R(X)_{2}=H^{0}(X,\Omega^{\otimes
2}_{X_{\mathbb{Z}[1/N]}})$ are free $\mathbb{Z}[1/N]$-modules of rank $g$,
$\binom{g+1}{2}$ and $3g-3$, respectively.

From the previous lemma we get

$\displaystyle V\otimes\mathbb{F}_{p}$ $\displaystyle\simeq
H^{0}(X_{\mathbb{F}_{p}},\Omega_{X_{\mathbb{F}_{p}}}),$ (4.1)
$\displaystyle\operatorname{Sym}^{m}(V)\otimes\mathbb{F}_{p}$
$\displaystyle\simeq\operatorname{Sym}^{m}(V\otimes\mathbb{F}_{p}),$ (4.2)
$\displaystyle R(X)_{m}\otimes\mathbb{F}_{p}\simeq R(X_{\mathbb{F}_{p}})_{m}$
$\displaystyle=H^{0}(X_{\mathbb{F}_{p}},\Omega^{\otimes
m}_{X_{\mathbb{F}_{p}}}).\ $ (4.3)

The degree $m$ part $(I_{can,\mathbb{F}_{p}})_{m}$ of the canonical ideal of
$X_{\mathbb{F}_{p}}$ can be represented as

$(I_{can,\mathbb{F}_{p}})_{m}=\ker\left(f^{m}_{can,\mathbb{F}_{p}}:\operatorname{Sym}^{m}(H^{0}(X_{\mathbb{F}_{p}},\Omega_{X_{\mathbb{F}_{p}}}))\rightarrow
H^{0}(X_{\mathbb{F}_{p}},\Omega^{\otimes m}_{X_{\mathbb{F}_{p}}})\right).$
(4.4)

###  4.1. Hyperelliptic curves

It follows by Proposition 2.1 and [22, Table Ia] that
$X_{{\overline{\mathbb{F}\rule{0.0pt}{6.0pt}}}_{p}}$ is hyperelliptic if and
only if

$\dim(I_{can,\mathbb{F}_{p}})_{2}=\binom{g-1}{2}.$ (4.5)

Now the map $f^{2}_{can,\mathbb{F}_{p}}$ is the reduction mod $p$ of the map
$f^{2}_{can}:\operatorname{Sym}^{m}(V)\to R(X)_{2}$. By putting a matrix
representing the map $f^{2}_{can}$ into Smith normal form it is easy to see
modulo which primes the dimension of the kernel is $\binom{g-1}{2}$. So we
have a criterion to detect the primes of hyperelliptic reduction.

To explicitly determine $H^{0}(X_{\Gamma},\Omega_{X_{\Gamma}})$ for a modular
curve $X_{\Gamma}$ corresponding to the congruence group
$\Gamma\supset\Gamma(N)$, we use the isomorphism [8, Eq. 12.1.4]

$H^{0}(X_{\Gamma,\mathbb{Z}[1/N]},\Omega_{X_{\Gamma,\mathbb{Z}[1/N]}})\cong
S_{2}(\Gamma,\mathbb{Z}[1/N]),$ (4.6)

where for a ring $R$,we denote by $S_{2}(\Gamma,R)$ is the space of cusp forms
of weight $2$ with coefficients in $R$. The map

$f^{2}_{can,\mathbb{Z}[1/N]}:\operatorname{Sym}^{2}(H^{0}(X,\Omega_{X_{\mathbb{Z}[1/N]}}))\rightarrow
H^{0}(X_{\mathbb{Z}[1/N]},\Omega^{\otimes 2}_{\mathbb{Z}[1/N]})$

can be computed on $\mathrm{Sym}^{2}S_{2}(\Gamma,\mathbb{Z}[1/N])$ by
multiplying $q$-expansions. On the other hand,
$(\Omega^{1}_{X/\mathbb{Z}[1/N]}\otimes\Omega^{1}_{X/\mathbb{Z}[1/N]})$ can be
identified with the subspace of $S_{4}(\Gamma,\mathbb{Z}[1/N])$ of cusp forms
of weight 4 that have a double zero at all cusps.

In particular, after obtaining a matrix representing the
$\mathbb{Z}[1/N]$-module homomorphism $f^{2}_{can,\mathbb{Z}[1/N]}$ as
explained above, and putting it in Smith normal form, one can easily read out
the exact primes $p$ where the rank of this matrix will change upon reduction
modulo $p$. So we have translated everything into ranks of matrices that can
easily be computed in terms of cusp forms.

###  4.2. Trigonality of nonhyperelliptic curves

For the entirety of this section let $X$ be nice curve over $\mathbb{Z}[1/N]$
of genus $g>3$ such that furthermore
$X_{{\overline{\mathbb{F}\rule{0.0pt}{6.0pt}}}_{p}}$ is not hyperelliptic for
any prime $p$ coprime to $N$. Then we can also detect whether
$X_{{\overline{\mathbb{F}\rule{0.0pt}{6.0pt}}}_{p}}$ is either trigonal or a
smooth plane quintic. Namely by Proposition 2.1 this happens if and only if

$\dim\left((I_{can,\mathbb{F}_{p}})_{3}/(V\otimes\mathbb{F}_{p}\cdot(I_{can,\mathbb{F}_{p}})_{2})\right)=g-3.$
(4.7)

The assumption that $X_{\mathbb{F}_{p}}$ is not hyperelliptic for all primes
$p$ coprime to $M$ implies that $R(X_{\mathbb{F}_{p}})_{m}$ is generated in
degree $1$. In particular the map $f^{m}_{can,\mathbb{F}_{p}}$ in (4.4) is
surjective and the ranks of the matrices associated to
$f_{can,\mathbb{Q}}^{m}$ and $f_{can,\mathbb{F}_{p}}^{m}$ are the same, from
which it also follows that the dimension of $(I_{can,\mathbb{F}_{p}})_{m}$ is
the rank of $(I_{can})_{m}$ as a $\mathbb{Z}[1/N]$-module. As a consequence we
have

$(I_{can})_{m}\otimes\mathbb{F}_{p}\cong(I_{can,\mathbb{F}_{p}})_{m}$ (4.8)

The importance of the above isomorphism is that for all primes $p$ one has
that the linear map
$\mu_{\mathbb{F}_{p}}:(V\otimes\mathbb{F}_{p})\otimes(I_{can,\mathbb{F}_{p}})_{2}\to(I_{can,\mathbb{F}_{p}})_{3}$
is just the reduction modulo $p$ of the linear map:

$\mu:V\otimes(I_{can})_{2}\to(I_{can})_{3}.$ (4.9)

From the surjectivity of (4.4) one can also compute
$\dim(I_{can,\mathbb{F}_{p}})_{m}$. Indeed

$\displaystyle\dim(I_{can,\mathbb{F}_{p}})_{m}$
$\displaystyle=\dim\operatorname{Sym}^{m}(H^{0}(X_{\mathbb{F}_{p}},\Omega_{X_{\mathbb{F}_{p}}}))-\dim
H^{0}(X_{\mathbb{F}_{p}},\Omega^{\otimes m}_{X_{\mathbb{F}_{p}}}),$ (4.10)
$\displaystyle=\binom{g+m-1}{m}-(2m-1)(g-1).$ (4.11)

Putting the above equalities together one has that the primes of trigonal or
smooth plane quintic reduction are exactly the primes such that the matrix
$\mu$ has rank $\binom{g+3-1}{3}-5(g-1)-(g-3)$ modulo $p$. Again, these primes
can easily be read of from the matrix $\mu$ after one puts $\mu$ into Smith
normal form.

However, the matrix $\mu$ has a domain and codomain whose dimension grow as a
cubic polynomial in $g$ so computing this matrix and putting it in Smith
normal form might become computationally very expensive once $g$ becomes
large. And in fact it does become too expensive for some of the curves for
which we wanted to compute the primes of trigonal reduction. However if
$X(\mathbb{Z}[1/N])$ contain an integral point then the computation can be
significantly sped up, as we will describe now.

From the discussion in the first paragraph of [22, p.18] we directly get the
following lemma.

######  Lemma 4.2 ([22, Section 2.5]).

Let $X_{k}$ be a non-hyperelliptic curve of genus $\geq 4$ over an
algebraically closed field $k$ and $X_{k,2}$ be the variety cut out by
$(I_{can,k})_{2}$, i.e. the quadrics vanishing on $X_{k}$. Then

  * (1)

$X_{k}$ is trigonal or a smooth plane quintic if and only if $X_{k,2}$ is a
surface.

  * (2)

$X_{k}$ is not trigonal or a smooth plane quintic if and only if
$X_{k,2}=X_{k}$.

Now let $P\in X(\mathbb{Z}[1/N])$ be a point. From Lemma 4.2 it follows that
the tangent space $T_{P}X_{k,2}$ is $1$-dimensional if and only if $X$ is not
trigonal or a smooth plane quintic. Since $X$ is not hyperelliptic modulo any
prime, the canonical embedding allows one to see $X$ as a subvariety of
$\mathbb{P}^{g-1}_{\mathbb{Z}[1/N]}$. Let $x_{0},x_{1},\ldots,x_{g-1}$ be the
coordinates on $\mathbb{P}^{g-1}_{\mathbb{Z}[1/N]}$ of some affine
neighborhood of $P$ and $f_{i}$ be generators of $(I_{can})_{2}$ on this
neighborhood. Because of (4.8) the reductions $f_{i}$ modulo $p$ are also
generators of $(I_{can,\mathbb{F}_{p}})_{2}$; we compute
$T_{P_{\mathbb{F}_{p}}}X_{\mathbb{F}_{p},2}$ as the kernel of the Jacobian
matrix $J=\left(\frac{\delta f_{i}(P)}{\delta x_{i}}\right)_{i,j}$ modulo p.
This is a matrix that can itself be written down over $\mathbb{Z}[1/N]$, and
as before putting it in Smith normal form allows us to easily read out the
possible trigonal or smooth plane quintic primes, by computing the primes such
that this matrix has rank $<g-2$.

###  4.3. Smooth plane quintics

We note that the methods of our paper do not distinguish between smooth plane
quintics and trigonal curves, hence the methods of Section 4.2 are also used
to detect possible smooth plane quintics. However, since plane smooth quintics
necessarily have genus 6, this greatly reduces the number of curves that need
to be considered. It fortunately turns out that no intermediate modular curves
of genus 6 satisfy the necessary and sufficient conditions of being either
trigonal or a smooth plane quintic.

##  5\. Proof of Theorems 1.3 1.4 and 1.5

###### Proof of Theorem 1.3.

We first prove that there are no exceptional pairs $(\Delta,p)$, where
$\Delta$ is the trivial group; this is done as explained in Section 4. By
Proposition 3.8 the values that need to be checked are $N\in S_{0}$. We obtain
that $p\nmid N$, the curve $X_{0}(N)_{\mathbb{F}_{p}}$ is hyperelliptic if and
only if $X_{0}(N)_{\mathbb{Z}[1/N]}$ is.

It remains to consider the nontrivial subgroups $\Delta$. Suppose $\Delta$ is
nontrivial and $(\Delta,p)$ is an exceptional hyperelliptic pair. If there
exists a morphism of curves $X_{k}\rightarrow Y_{k}$ defined over a field $k$
and $X_{k}$ is hyperelliptic, then it follows that $Y_{k}$ has to be
subhyperelliptic [19, Proposition A.1. (vii)]. It follows, that
$X_{\Delta}(N)$ can be hyperelliptic over $\mathbb{F}_{p}$ only if
$X_{0}(N)_{\mathbb{Z}[1/N]}$ is hyperelliptic. Since for any $N$ there are
finitely many $\Delta$ of level $N$, we are reduced to checking the
hyperellipticity of finitely many $X_{\Delta}(N)$ to complete the proof of
Theorem 1.3.

All the computations to verify this take 116 seconds, and we find the unique
exceptional pair $\Delta:=\langle
4\rangle\leq(\mathbb{Z}/37\mathbb{Z})^{\times}$ and $p=2$. ∎

###### Proof of Theorem 1.4.

We first determine the exceptional trigonal pairs for the trivial groups
$\Delta$, i.e. $X_{\Delta}(N)=X_{0}(N)$. By Proposition 3.10, the values that
need to be checked are $N\in S_{1}.$ We follow the procedure described in
Section 4.2 and get the exceptional trigonal pair $X_{0}(73)$ and $p=2$.

Using the arguments as in the proof of of Theorem 1.3, it follows that it
remains to nontrivial subgroups $\Delta$, and the ones that need to be
considered are the ones such that $X_{0}(N)_{\mathbb{Z}[1/N]}$ is of gonality
$\leq 3$, and in addition the $\Delta$ of level 73 for $p=2$. We check this,
and after 23 minutes of computation obtain that there are no additional
exceptional pairs. ∎

###### Proof of Theorem 1.5.

Using the arguments as in the proof of Theorem 1.4 (and the fact that we need
only consider curves of genus 6), it turns out there are no intermediate
modular curves that are smooth plane quintics in any characteristic. ∎

##  6\. Fields of definition of trigonal maps on non hyperelliptic curves

While Theorem 1.4 completely solves 1.2 B) for intermediate modular curves and
$d=3$, it remains to consider 1.2 A) for trigonal curves over finite fields
$\mathbb{F}_{q}$. Let $X/k$ be a curve of genus $g$ with $X(k)\neq\emptyset$
that is trigonal over $\overline{k}$ and not subhyperelliptic. Then $X$ is
trigonal over $k$ if $g=3$ ([19, Proposition A.1 (iv)]) or $g>5$ [16,
Corollary 4.6 (i)]. Hence the only case of interest here is $g=4$.

######  Proposition 6.1.

Let $X$ be a curve of genus $4$ over $\mathbb{Z}[1/N]$ of non-hyperelliptic
reduction at all primes of good reduction with
$X(\mathbb{Z}[1/N])\neq\emptyset$. Then the canonical model of $X$ is a smooth
complete intersection of a cubic and a quadric $Q$ in
$\mathbb{P}^{3}_{\mathbb{Z}[1/N]}$. Let $D$ be the discriminant of an
extension of this quadric $Q$ to $\mathbb{Z}$; we assume that $D$ is not a
perfect square and let $\mathcal{O}(D)$ be the order of discriminant $D$. Then

  1. (1)

$X$ is trigonal over the quadratic field $\mathcal{O}(D)\otimes\mathbb{Q}$,
but not over $\mathbb{Q}.$

  2. (2)

For all positive odd integers $n$ and all rational primes $p$ coprime to $N$
at which the order $\mathcal{O}(D)$ is maximal, $X$ is trigonal over
$\mathbb{F}_{p^{n}}$ if and only if $p$ splits or ramifies in
$\mathcal{O}(D)$.

  3. (3)

For all positive even integers $n$ and all rational primes $p$ coprime to $N$,
$X$ is trigonal over $\mathbb{F}_{p^{n}}$.

###### Proof.

Let $k$ be a field of characteristic coprime to $N$ with $X:=X_{k}$ smooth and
non-hyperelliptic. Furthermore, let
$W_{d}^{r}(X_{k})\subset\operatorname{Pic}^{d}X_{k}$ denote the Brill-Noether
variety corresponding to line bundles that have at least $r+1$ linearly
independent global sections. Note that since $X(\mathbb{Z}[1/N])\neq\emptyset$
we also have $X(k)\neq\emptyset$ and hence any point in
$\operatorname{Pic}^{d}X(k)$ actually comes from a $k$-rational line bundle of
degree $d$ 222on the other hand, if $X(k)=\emptyset$ and $k$ is perfect, then
a point in $\operatorname{Pic}^{d}X(k)$ only gives a line bundle over
$\overline{k}$ that is isomorphic to all its Galois conjugates. In particular,
every $k$-rational point on the Brill-Noether variety $W_{3}^{1}(X_{k})$ comes
from a line bundle defined over $k$ of degree $3$ with two linearly
independent global sections, and hence gives rise to a non-constant
$k$-rational function degree $\leq 3$, which is actually of degree 3 by the
non-hyperellipticity assumption. Conversely, every $k$-rational function of
degree $3$ gives a rational point on $W_{3}^{1}(X_{k})$. In conclusion,
$X_{k}$ is trigonal if and only if $W_{d}^{r}(X_{k})(k)\neq\emptyset$.

By [3, p.206], the Brill-Noether variety $W_{3}^{1}(X_{k})$ either has 1 or 2
points over $\overline{k}$. The case $W_{3}^{1}(X)$ being isomorphic to $X$
mentioned there cannot happen since we assumed $X$ to not be hyperelliptic. If
$\\#W_{3}^{1}(X_{k})(\overline{k})=1$ then $\\#W_{3}^{1}(X_{k})(k)=1$ and
$X_{k}$ is trigonal by the above discussion. On the other hand if
$\\#W_{3}^{1}(X_{k})(\overline{k})=2$, then there are exactly two
possibilities. Namely:

  * (a)

$\\#W_{3}^{1}(X_{k})(k)=2$ and hence $X_{k}$ is trigonal,

  * (b)

$\\#W_{3}^{1}(X_{k})(k)=0$ and hence $X_{k}$ is not trigonal but becomes
trigonal over the quadratic extension of $k$ over which the two points of
$\\#W_{3}^{1}(X)$ are defined.

We let $F_{X_{k}}$ denote the smallest field extension of $k$ for which
$\\#W_{3}^{1}(X_{k})(F_{X_{k}})>0$. So either $F_{X_{k}}=k$ or it is the
quadratic field over which the two points of $\\#W_{3}^{1}(X)$ are defined in
case (b) above.

Since $X_{k}$ is not hyperelliptic, the canonical model of $X$ is a smooth
complete intersection of a cubic and a quadric $Q_{k}$ in
$\mathbb{P}^{3}_{k}$. Each $g_{3}^{1}$ corresponding to one of the points in
$W_{3}^{1}(X)(k)$ is a family of lines in $\mathbb{P}^{3}_{k}$ intersecting
$X_{k}$ three times, counting multiplicities. Let $L$ denote one of these
lines. By Bezout’s theorem this line $L$ lies on the quadric $Q_{k}$. In
particular, if $Q_{k}$ is nonsingular then the lines of the $g_{3}^{1}$
actually form a ruling of $Q$ (see [3, p.206] again). In the nonsingular case,
the field $F_{X_{k}}$ defined above is actually the field of definition of
these rulings. If $\operatorname{char}k>2$, then this field is obtained by
adjoining to $k$ the square root of the discriminant of the polynomial
defining $Q$ (see e.g [4, p.45-46]).

Part (1) immediately follows from this discussion. Indeed,
$F_{X_{\mathbb{Q}}}=\mathbb{Q}(\sqrt{D})=\mathcal{O}(D)\otimes\mathbb{Q}$. So
for a field extension $K$ of $\mathbb{Q}$ we have
$\\#W_{3}^{1}(X_{\mathbb{Q}})(K)>0$ if and only if $K$ contains
$\mathbb{Q}(\sqrt{D})$. Both of these equivalent conditions are equivalent to
$X_{K}$ being trigonal.

Part $(3)$ follows similarly since $F_{X_{\mathbb{F}_{p}}}$ is either
$\mathbb{F}_{p}$ or $\mathbb{F}_{p^{2}}$. So in particular,
$\mathbb{F}_{p^{n}}$ contains $F_{X_{\mathbb{F}_{p}}}$ if $n$ is even.

Now we prove part $(2)$ in the case where $p$ splits or ramifies in
$\mathcal{O}(D)$. Let $\mathfrak{p}$ be a prime of $\mathcal{O}(D)$ lying over
$p$. Then by the maximality assumption on $\mathcal{O}(D)$ at $p$, the ring
$\mathcal{O}(D)_{\mathfrak{p}}$ is a discrete valuation ring and the residue
field of $\mathcal{O}(D)_{\mathfrak{p}}$ is $\mathbb{F}_{p}$. By part (1) we
have $\operatorname{gon}X_{\mathcal{O}(D)\otimes\mathbb{Q}}=3$. Since the
gonality of a curve can only decrease under specialization and field
extensions we have

$\operatorname{gon}X_{\mathbb{F}_{p^{n}}}\leq\operatorname{gon}X_{\mathbb{F}_{p}}\leq\operatorname{gon}X_{\mathcal{O}(D)_{\mathfrak{p}}\otimes\mathbb{Q}}\leq\operatorname{gon}X_{\mathcal{O}(D)\otimes\mathbb{Q}}=3.$

Hence $\operatorname{gon}X_{\mathbb{F}_{p^{n}}}=3$ by the non-hyperellipticity
assumption.

What remains is to show part $(2)$ when $p$ is inert. Assume for the moment
$p>2$. Since $p$ is inert in $\mathcal{O}(D)$ we know that
$F_{X_{\mathbb{F}_{p}}}=\mathbb{F}_{p}(\sqrt{D})$ is a quadratic extension of
$\mathbb{F}_{p}$ and hence isomorphic to $\mathbb{F}_{p}^{2}$. It follows that
$X$ is trigonal over $\mathbb{F}_{p}^{n}$ if and only if $\mathbb{F}_{p}^{n}$
contains $\mathbb{F}_{p}^{2}$, which happens exactly when $n$ is even. So if
$n$ is odd, $X_{\mathbb{F}_{p}^{n}}$ is not trigonal.

The case $p=2$ is slightly more subtle. While it might be possible to deal
with this case abstractly, we found it clearer to take a more explicit
approach. Let’s write the quadric $Q$ in $\mathbb{P}^{3}$ as

$Q=\sum_{i=0}^{3}\sum_{j=0}^{i}a_{i,j}x_{i}x_{j}.$

For this quadric we will also use the matrix form notation

$Q=\begin{bmatrix}a_{0,0}&a_{0,1}&a_{0,2}&a_{0,3}\\\
*&a_{1,1}&a_{1,2}&a_{1,3}\\\ *&*&a_{2,2}&a_{2,3}\\\
*&*&*&a_{3,3}\end{bmatrix}.$

Let $P\in X(\mathbb{Z}[1/N])\subseteq\mathbb{P}^{3}(\mathbb{Z}[1/N])$ be a
point. By choosing a suitable set of coordinates on $\mathbb{P}^{3}$ we may
assume $P=(0:0:0:1)$ and hence $a_{3,3}=0$. By a further change of coordinates
we may assume $a_{1,3}=a_{2,3}=0$ as well, so that $Q$ looks like:

$\begin{bmatrix}a_{0,0}&a_{0,1}&a_{0,2}&a_{0,3}\\\ *&a_{1,1}&a_{1,2}&0\\\
*&*&a_{2,2}&0\\\ *&*&*&0\end{bmatrix}.$

With $Q$ as above, we have $D=a_{0,3}^{2}(a_{1,2}^{2}-4a_{1,1}a_{2,2})$. The
assumption for $p$ to be inert in $\mathcal{O}(D)$ is equivalent to $D\equiv
5\mod 8.$ In particular $Q_{\mathbb{F}_{p}}$ is nonsingular and $a_{0,3}\equiv
a_{1,2}\equiv a_{1,1}\equiv a_{2,2}\equiv 1\mod 2$.

Since $Q_{\mathbb{F}_{2}}$ is nonsingular it has two rulings. These two
rulings both contain a line passing through $P$. Additionally, starting from
$P$ one can let $T\subset P^{3}_{\mathbb{F}_{2}}$ be the tangent space to
$Q_{\mathbb{F}_{2}}$ at $P_{\mathbb{F}_{2}}$, and $T\cap Q_{\mathbb{F}_{2}}$
will be exactly the union of these same two lines. In particular if these two
lines are interchanged by the action of Galois, then these two rulings will be
interchanged as well.

Now let’s compute $T$ on the affine chart where $x_{3}\neq 0$ and let
$X_{0},X_{1},X_{2}$ be the affine coordinates on
$\mathbb{A}^{3}_{\mathbb{F}_{2}}$. Then the tangent space $T$ is given by
$X_{0}=0$, so that the union of two lines on $Q_{\mathbb{F}_{2}}$ passing
through $P_{\mathbb{F}_{2}}$ can be described by $X_{0}=0$ and
$a_{1,1}X_{1}^{2}+a_{1,2}X_{1}X_{2}+a_{2,2}X_{2}^{2}$. Since $a_{1,1}\equiv
a_{2,2}\equiv a_{1,2}=1\pmod{2}$, the polynomial
$a_{1,1}X_{1}^{2}+a_{1,2}X_{1}X_{2}+a_{2,2}X_{2}^{2}$, is irreducible and
hence so is also the scheme $T\cap Q_{\mathbb{F}_{2}}$. This can only happen
if the geometric lines generating $T\cap Q_{\mathbb{F}_{2}}$ are Galois
conjugates. In particular, the two rulings of $Q_{\mathbb{F}_{2}}$ are swapped
by the action of Galois, $W_{3}^{1}(X_{\mathbb{F}_{2}})$ consist of two points
whose field of definition is $\mathbb{F}_{2^{2}}$ and hence
$X_{\mathbb{F}_{2}^{n}}$ is not trigonal when $n$ is odd.

∎

######  Remark 6.2.

In case $X_{k}$ is of genus $4$ with $X_{k}(k)\neq\emptyset$ and is neither
hyperelliptic or trigonal over $k$, then it is necessarily tetragonal over
$k$, see e.g. [19, Proposition A.1 (iv)].

The table below lists all genus $4$ intermediate modular curves by specifying
their level $N$, the group $\Delta(N)$, and the disciriminant $D$ of the
corresponding order $\mathcal{O}$. Note that
$\Delta(N)=(\mathbb{Z}/N\mathbb{Z})^{*}/\pm 1$ means $X_{\Delta}(N)=X_{0}(N)$
and $D$ a perfect square means that the curve is trigonal over $\mathbb{Q}$.
We note that the cases $X_{\Delta}(N)=X_{0}(N)$ had already been previously
solved in [10, p. 136].

$N$ | $\Delta(N)$ | $D$
---|---|---
25 | $\langle 7\rangle$ | 5
26 | $\langle 17\rangle$ | 1
26 | $\langle 5\rangle$ | 1
28 | $\langle 3\rangle$ | 0
28 | $\langle 13,15\rangle$ | 4
29 | $\langle 4\rangle$ | 1
37 | $\langle 4\rangle$ | 0
38 | $(\mathbb{Z}/38\mathbb{Z})^{\times}/\langle-1\rangle$ | -3
44 | $(\mathbb{Z}/44\mathbb{Z})^{\times}/\langle-1\rangle$ | -8
50 | $\langle 19\rangle$ | 1
53 | $(\mathbb{Z}/53\mathbb{Z})^{\times}/\langle-1\rangle$ | -15
54 | $(\mathbb{Z}/54\mathbb{Z})^{\times}/\langle-1\rangle$ | 1
61 | $(\mathbb{Z}/61\mathbb{Z})^{\times}/\langle-1\rangle$ | -4
81 | $(\mathbb{Z}/81\mathbb{Z})^{\times}/\langle-1\rangle$ | 0
Table 1. Field of definition of trigonal maps

## Appendix A

###  A.1. Discriminants of class number at most 100

Let $D<0$ be a fundamental discriminant and $f$ a positive integer. Then the
following formula relates class numbers of (not necessarily fundamental)
discriminants to those of fundamental discriminants (see [5, Corollary 7.28])

$h(Df^{2})=\frac{h(D)f}{u_{D,f}}\prod_{p|f}\left(1-\left(\frac{D}{p}\right)\frac{1}{p}\right),$
(A.1)

where $w_{D,f}=3$ if $D=-3$ and $f\neq 1$, $w_{D,f}=2$ if $D=-4$ and $f\neq 1$
and $w_{D,f}=1$ otherwise. Using this formula and the list of negative
fundamental discriminants of class number $\leq 100$ from [23, Table 4.], it
is straightforward to compile a list of all negative discriminants of class
number $\leq 100$. For each class number $h\leq 100$ we record the number of
discriminants $Df^{2}<0$ such that $h(Df^{2})=h$ in the second column, and the
smallest $Df^{2}$ such that $h(Df^{2})=h$ in the third column.

h | # | smallest | h | # | smallest | h | # | smallest | h | # | smallest
---|---|---|---|---|---|---|---|---|---|---|---
1 | 13 | -163 | 26 | 227 | -103027 | 51 | 217 | -546067 | 76 | 1381 | -1086187
2 | 29 | -427 | 27 | 136 | -103387 | 52 | 1003 | -457867 | 77 | 236 | -1242763
3 | 25 | -907 | 28 | 623 | -126043 | 53 | 130 | -425107 | 78 | 921 | -1004347
4 | 84 | -1555 | 29 | 94 | -166147 | 54 | 806 | -532123 | 79 | 200 | -1333963
5 | 29 | -2683 | 30 | 473 | -137083 | 55 | 177 | -452083 | 80 | 3851 | -1165483
6 | 101 | -4075 | 31 | 83 | -133387 | 56 | 1809 | -494323 | 81 | 338 | -1030723
7 | 38 | -5923 | 32 | 1231 | -164803 | 57 | 237 | -615883 | 82 | 486 | -1446547
8 | 208 | -7987 | 33 | 158 | -222643 | 58 | 360 | -586987 | 83 | 174 | -1074907
9 | 55 | -10627 | 34 | 260 | -189883 | 59 | 144 | -474307 | 84 | 2990 | -1225387
10 | 123 | -13843 | 35 | 111 | -210907 | 60 | 2352 | -662803 | 85 | 246 | -1285747
11 | 46 | -15667 | 36 | 1303 | -217627 | 61 | 149 | -606643 | 86 | 553 | -1534723
12 | 379 | -19723 | 37 | 96 | -158923 | 62 | 386 | -647707 | 87 | 313 | -1261747
13 | 43 | -20563 | 38 | 283 | -289963 | 63 | 311 | -991027 | 88 | 2769 | -1265587
14 | 134 | -30067 | 39 | 162 | -253507 | 64 | 2915 | -693067 | 89 | 206 | -1429387
15 | 95 | -34483 | 40 | 1418 | -274003 | 65 | 192 | -703123 | 90 | 1508 | -1548523
16 | 531 | -35275 | 41 | 125 | -296587 | 66 | 856 | -958483 | 91 | 249 | -1391083
17 | 50 | -37123 | 42 | 595 | -301387 | 67 | 145 | -652723 | 92 | 1590 | -1452067
18 | 291 | -48427 | 43 | 123 | -300787 | 68 | 1227 | -819163 | 93 | 354 | -1475203
19 | 59 | -38707 | 44 | 909 | -319867 | 69 | 292 | -888427 | 94 | 598 | -1587763
20 | 502 | -58843 | 45 | 231 | -308323 | 70 | 702 | -821683 | 95 | 273 | -1659067
21 | 118 | -61483 | 46 | 328 | -462883 | 71 | 176 | -909547 | 96 | 7265 | -1684027
22 | 184 | -85507 | 47 | 117 | -375523 | 72 | 4046 | -947923 | 97 | 208 | -1842523
23 | 78 | -90787 | 48 | 2893 | -335203 | 73 | 137 | -886867 | 98 | 707 | -2383747
24 | 1042 | -111763 | 49 | 146 | -393187 | 74 | 472 | -951043 | 99 | 396 | -1480627
25 | 101 | -93307 | 50 | 440 | -389467 | 75 | 353 | -916507 | 100 | 2304 | -1856563
Table 2. Imaginary class numbers smaller than 100

The full list of all discriminants of class number $\leq 100$ can be found at
[6] in the `small_class_numbers_and_ramification.ipynb` file.

###  A.2. Ramification degrees of $X_{0}(N)\to X_{0}(N)^{+}$ at most 100

Using Lemma 3.3 and Table 2 one can easily compile a list of all integers $N$
such that the ramification degree of $X_{0}(N)\to X_{0}(N)^{+}$ is at most
100. For each degree $d\leq 100$ we record the number of integers $N$ that the
ramification degree of $X_{0}(N)\to X_{0}(N)^{+}$ equals $d$, as well at the
maximum of these $N$. Note that by the Riemann-Hurwitz formula the
ramification degree is always even.

d | # | largest | d | # | largest | d | # | largest | d | # | largest
---|---|---|---|---|---|---|---|---|---|---|---
2 | 18 | 58 | 28 | 257 | 13297 | 54 | 125 | 48742 | 80 | 2309 | 120712
4 | 48 | 253 | 30 | 88 | 14422 | 56 | 992 | 62302 | 82 | 118 | 151237
6 | 32 | 652 | 32 | 790 | 18748 | 58 | 77 | 48778 | 84 | 1019 | 166798
8 | 128 | 1012 | 34 | 56 | 18397 | 60 | 817 | 83218 | 86 | 106 | 137197
10 | 39 | 1318 | 36 | 482 | 22768 | 62 | 96 | 85402 | 88 | 1413 | 150382
12 | 173 | 2608 | 38 | 74 | 30493 | 64 | 1857 | 106177 | 90 | 238 | 149053
14 | 35 | 2293 | 40 | 785 | 30178 | 66 | 175 | 92698 | 92 | 577 | 189352
16 | 329 | 4048 | 42 | 130 | 29437 | 68 | 493 | 102958 | 94 | 112 | 184438
18 | 62 | 5692 | 44 | 375 | 34318 | 70 | 127 | 94378 | 96 | 4289 | 198958
20 | 225 | 5377 | 46 | 78 | 47338 | 72 | 1963 | 134773 | 98 | 132 | 161302
22 | 40 | 6637 | 48 | 1618 | 41728 | 74 | 104 | 91228 | 100 | 842 | 200722
24 | 576 | 10432 | 50 | 75 | 43717 | 76 | 506 | 121972 |  |  |
26 | 63 | 11302 | 52 | 389 | 50317 | 78 | 170 | 92458 |  |  |
Table 3. Ramification degree smaller than 100

The full list of all integers $N$ of ramification degree $\leq 100$ can be
found at [6] in the `small_class_numbers_and_ramification.ipynb` file.

## References

  * [1] D. Abramovich, A linear lower bound on the gonality of modular curves, Internat. Math. Res. Notices, (1996), pp. 1005–1011.
  * [2] S. Anni, E. Assaf, and E. L. García, On smooth plane models for modular curves of shimura type.  Res. Number Theory, to appear, available at: https://arxiv.org/abs/2203.06370.
  * [3] E. Arbarello, M. Cornalba, P. A. Griffiths, and J. Harris, Geometry of algebraic curves. Volume I, vol. 267 of Grundlehren Math. Wiss., Springer, Cham, 1985.
  * [4] P. L. Clark, On elementary equivalence, isomorphism and isogeny, J. Théor. Nombres Bordx., 18 (2006), pp. 29–58.
  * [5] D. A. Cox, Primes of the form $x^{2}+ny^{2}$, A Wiley-Interscience Publication, John Wiley & Sons Inc., New York, 1989.  Fermat, class field theory and complex multiplication.
  * [6] M. Derickx and F. Najman, Code for the paper ”hyperelliptic and trigonal modular curves in characteristic p”.  available at https://github.com/koffie/mdsage/tree/01feabecc9dc755df828cadf8143b6d9aae419fa/articles/derickx_najman-hyperelliptic_trigonal/.
  * [7] M. Derickx and M. van Hoeij, Gonality of the modular curve $X_{1}(N)$, J. Algebra, 417 (2014), pp. 52–71.
  * [8] F. Diamond and J. Im, Modular forms and modular curves, in Seminar on Fermat’s last theorem. The Fields Institute for Research in Mathematical Sciences, 1993-1994, Toronto, Ontario, Canada. Proceedings, Providence, RI: American Mathematical Society (publ. for the Canadian Mathematical Society), 1995, pp. 39–133.
  * [9] M. Furumoto and Y. Hasegawa, Hyperelliptic quotients of modular curves $X_{0}(N)$, Tokyo J. Math., 22 (1999), pp. 105–125.
  * [10] Y. Hasegawa and M. Shimura, Trigonal modular curves, Acta Arith., 88 (1999), pp. 129–140.
  * [11] N. Ishii and F. Momose, Hyperelliptic modular curves, Tsukuba J. Math., 15 (1991), pp. 413–423.
  * [12] D. Jeon, C. H. Kim, and E. Park, On the torsion of elliptic curves over quartic number fields, J. London Math. Soc. (2), 74 (2006), pp. 1–12.
  * [13] D. Jeon, C. H. Kim, and A. Schweizer, On the torsion of elliptic curves over cubic number fields, Acta Arith., 113 (2004), pp. 291–301.
  * [14] D. Jeon and E. Park, Tetragonal modular curves, Acta Arith., 120 (2005), pp. 307–312.
  * [15] M. A. Kenku, Atkin-Lehner involutions and class number residuality, Acta Arith., 33 (1977), pp. 1–9.
  * [16] F. Najman and P. Orlić, Gonality of the modular curve $X_{0}(N)$.  Math. Comp, to appear, available at: https://arxiv.org/abs/2207.11650.
  * [17] A. P. Ogg, Hyperelliptic modular curves, Bull. Soc. Math. France, 102 (1974), pp. 449–462.
  * [18] K. Petri, Über die invariante Darstellung algebraischer Funktionen einer Veränderlichen., Math. Ann., 88 (1923), pp. 242–289.
  * [19] B. Poonen, Gonality of modular curves in characteristic $p$, Math. Res. Lett., 14 (2007), pp. 691–701.
  * [20] B. Saint-Donat, On Petri’s analysis of the linear system of quadrics through a canonical curve, Math. Ann., 206 (1973), pp. 157–175.
  * [21] H. Stichtenoth, Algebraic function fields and codes, vol. 254 of Grad. Texts Math., Berlin: Springer, 2nd ed. ed., 2009.
  * [22] J. Voight and D. Zureick-Brown, The canonical ring of a stacky curve, vol. 1362 of Mem. Am. Math. Soc., Providence, RI: American Mathematical Society (AMS), 2022.
  * [23] M. Watkins, Class numbers of imaginary quadratic fields, Math. Comput., 73 (2004), pp. 907–938.