Triangular modular curves of small genus

Triangular modular curves are a generalization of modular curves that arise from quotients of the upper half-plane by congruence subgroups of hyperbolic triangle groups. These curves also arise naturally as a source of Belyi maps with monodromy PGL2(Fq)\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\text {PGL}_2(\mathbb {F}_q)$$\end{document} or PSL2(Fq)\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\text {PSL}_2(\mathbb {F}_q)$$\end{document}. We present a computational approach to enumerate Borel-type triangular modular curves of low genus, and we carry out this enumeration for prime level and small genus.


Motivation
The study of modular curves has rewarded mathematicians for perhaps a century. For an integer N ≥ 1, let 0 (N ), 1 (N ) ≤ SL 2 (Z) be the usual congruence subgroups and let X 0 (N ), X 1 (N ) be the corresponding quotients of the completed upper half-plane. The genera of X 0 (N ) and X 1 (N ) as compact Riemann surfaces can be computed using the Riemann-Hurwitz formula, and it can readily be seen that there are only finitely many of any given genus g ≥ 0.
The study of modular curves of small genus goes back at least to Fricke [10, p. 357]. At the end of the twentieth century, Ogg enumerated and studied elliptic [18] and hyperelliptic [19] modular curves; the resulting Diophantine study [20] informed Mazur's classification of rational isogenies of elliptic curves [16], where the curves of genus 0 are precisely the ones with infinitely many rational points. This explicit study continues today, extended to include all quotients of the upper half-plane by congruence subgroups of SL 2 (Z); the list up to genus 24 was computed by Cummins-Pauli [7]. Recent papers have studied curves with infinitely many rational points in the context of Mazur's Program B-see Rouse-Sutherland-Zureick-Brown [21] for further references and recent results in this direction.
Given this rich backdrop, it is worthwhile to pursue generalizations. For example, replacing SL 2 (Z) with its quaternionic cousins, Voight [26] enumerated all Shimura curves of the form X 1

Setup and main result
In this paper, we consider a different type of generalization: namely, from the point of congruence subgroups of triangle groups as introduced by Clark-Voight [3]. We briefly introduce this construction; for more detail, see Sect. 2.
Let a, b, c ∈ Z ≥2 ∪ {∞}, and suppose that 1/a + 1/b + 1/c < 1 (where 1/∞ = 0). Then there is a triangle in the upper half-plane H (completed if ∞ ∈ {a, b, c}) with angles π/a, π/b, and π/c, unique up to isometry. The reflections in the sides of this triangle generate a discrete subgroup of PGL 2 (R), and the orientation-preserving subgroup (of index 2) defines the triangle group = (a, b, c) ≤ PSL 2 (R), with presentation (omitting the relation δ s s when s = ∞). The triangle group acts properly by isometries on H and the quotient X(a, b, c) := (a, b, c)\H can be given the structure of a compact Riemann surface of genus 0, isomorphic to P 1 with a unique coordinate t taking values 0, 1, ∞ at the vertices labelled a, b, c, respectively. For example, we recover the classical modular group as ( of totally real, abelian number fields. The field F is the subfield of R generated by Tr , and similarly E, called the invariant trace field, is the subfield generated by Tr (2) where (2) ≤ is the subgroup generated by squares. Let Z E ⊂ E be the ring of integers and similarly Z F ⊂ F . Let N ⊆ Z E be a nonzero ideal. Then there is a natural reduction homomorphism N with domain , intuitively thought of as reducing matrix entries modulo N but with a rigorous quaternionic interpretation (see below). The kernel (a, b, c; N) := ker N is called the principal congruence subgroup of level N. A subgroup ≤ (a, b, c) is said to be congruence if ≥ (a, b, c; N) for some N; the level of a congruence subgroup is the minimal such N. Given a congruence subgroup ≤ (a, b, c), we call the quotient X(a, b, c; ) := \H a triangular modular curve, since they generalize the classical modular curves. The quotient map ϕ N : X(a, b, c; ) → X(a, b, c) P 1 C (1.2) (generalizing the j-invariant) is a Belyi map, unramified away from {0, 1, ∞} (by our normalization). Accordingly, the curve X(a, b, c; N) descends to a number field [3,Theorem B].
In light of the motivation above, we focus now on a nice class of congruence subgroups. The E-subalgebra A := E (2) ≤ M 2 (R) generated by (any lift of) the image of (2) → PSL 2 (R) is a quaternion algebra, and := Z E is a Z E -order in A. Then there is a commutative square (2) 1 /{±1} where 1 := {γ ∈ : nrd(γ ) = 1} are the elements of reduced norm 1.
Suppose N ⊆ Z E is coprime to discrd( ) and d F |E , the relative discriminant of F over E; for example, this holds if N is coprime to 2abc. Then the reduction → /N M 2 (Z E /N) gives a well-defined group homomorphism Combined with (1.3), we obtain a commutative diagram (Proposition 3.6) Let G N := π N ( ) be the image. Let s be the order of π N (δ s ) for s = a, b, c; then a , b , c are the ramification degrees in ϕ N above 0, 1, ∞, and the homomorphism π N factors through (a , b , c ). To avoid redundancy, we say that N is admissible for (a, b, c) if s = s for all s = a, b, c-so in particular, s = ∞. Without loss of generality (but see Proposition 3.13), we now suppose that N is admissible for (a, b, c). Then the main result of Clark-Voight [3, Theorem A] (see Theorem 3.12) describes the group G N . For example, when N = p is prime, then where PXL 2 = PSL 2 if p (necessarily unramified in F ) splits completely in F , and otherwise PXL 2 = PGL 2 .
With this in mind, in this paper we focus on the case where N = p is prime. This case is already a quite interesting first step, and still relevant for our motivation (see the next section). Moreover, the case of composite level N builds on the prime level case and at the same time introduces several new challenges that are not present in prime level. We plan to pursue the general case in future work.
Returning now to our original motivation, the usual upper-triangular (Borel-type) subgroups naturally include into G p via (1.6). We define the Borel-type congruence subgroups of We write X 0 (a, b, c; p) and X 1 (a, b, c; p) for the corresponding quotients. For (a, b, c) = (2, 3, ∞), we recover the classical modular curves X 0 (p) and X 1 (p). Our main result is as follows. inating with a conjecture of Rademacher that there are only finitely many genus 0 congruence subgroups of PSL 2 (Z). Thompson [25] proved this for any genus g, but the list of Cummins-Pauli relies upon difficult and delicate p-adic methods of Cox-Parry [6] for an explicit bound on the level in terms of the genus. We propose the following conjecture, which predicts a similar result for triangular modular curves.

Conjecture 1.10
For all g ∈ Z ≥0 , there are only finitely many admissible triangular modular curves of genus g.
We consider our main result (Theorem 1.9) as partial progress towards this conjecturethe Borel-type subgroups are the family with the smallest growing index, thus likely to have the smallest genera. It would be interesting to see if the rather delicate p-adic methods of Cox-Parry can be generalized from PSL 2 (Z/N Z) to groups of the form PXL 2 (Z E /N), as this would imply Conjecture 1.10 in an effective way.

Contents
In Sect. 2, we set up triangular modular curves and as a warmup consider the much easier Galois case X(a, b, c; p). In Sect. 3, we extend the work of Clark-Voight to understand the arithmetic requirements to construct triangular modular curves. Then in Sect. 4, for the case X 0 (a, b, c; p) with a, b, c ∈ Z, we give an explicit formula for the genus and we bound the norm of the level in terms of the genus, proving finiteness; we then provide an algorithm to effectively enumerate them in Sect. 5. In Sect. 6, we provide analogous results for curves X 1 (a, b, c; N), and finally we prove Theorem 1.9. We conclude by providing the list in Appendix A.

Setup and definitions
In this section, we give some basic setup and notation, define congruence subgroups, and consider the enumeration problem in the Galois case; for further reference, see Clark-Voight [3].

Triangle groups
Beginning again, let a, b, c ∈ Z ≥2 ∪ {∞}. Let so that χ(a, b, c)π measures difference from π of the sum of the angles of a triangle with angles π/a, π/b, π/c. If χ(a, b, c) ≥ 0, then such a triangle is drawn on the sphere or Euclidean plane, and these are very classical. Otherwise, we χ(a, b, c) < 0 and we say that the triple (a, b, c) is hyperbolic, as then the triangle lies in the (completed) upper half-plane H. For a hyperbolic triple (a, b, c), we always have bounded away from zero, by a simple maximization argument by cases. As in the introduction, let (a, b, c) be the subgroup of orientation-preserving isometries of the group generated by reflections in the sides of the triangle described above, drawn in the appropriate geometry. Then we have a presentation where δ s corresponds to a counterclockwise rotation at the vertex with angle 2π/s. By cyclic permutation and inversion [3, Remark 2.2], we can reorganize the generators and suppose without loss of generality that From now on, we suppose that the triple (a, b, c) is hyperbolic. Then there is an associated map (a, b, c) → PSL 2 (R), unique up to conjugation. We will often suppress the dependence on the triple from notation, writing for example = (a, b, c).
The group is said to be cocompact if the quotient of the upper half-plane by is compact, else we say is noncocompact. We have noncocompact if and only if at least one of a, b, c is equal to ∞.
Let (2) denote the subgroup of generated by the set of squares {δ 2 : δ ∈ }. Then (2) is a normal subgroup, in fact [3, (5.9)] the quotient / (2) is represented by the elements δ s with s ∈ {a, b, c} such that either s = ∞ or s ∈ Z ≥2 is even, hence if at least two of a, b, c are odd integers; Z/2Z, if exactly one of a, b, c is an odd integer; (Z/2Z) 2 , if all of a, b, c are even integers or ∞. (2.5)

Lemma 2.6
The group (2) is generated by the set Proof Follows from Takeuchi [23, Lemma 3, Proposition 5]: the generating set presented there is smaller (depending on cases), whereas we collect these and symmetrize to make a uniform statement.

Quaternions
For s ∈ Z ≥2 ∪{∞}, let ζ s := exp(2πi/s) and let λ s := ζ s +1/ζ s = 2 cos(2π/s), with ζ ∞ = 1 and λ ∞ = 2 by convention. Define the tower of fields (2.8) The extension F ⊇ E is abelian of exponent at most 2 (since λ 2 2s = λ s + 2) and has degree at most 4. Let Z F ⊇ Z E be the corresponding rings of integers, and let d F |E be the relative discriminant of F | E. The field F is the trace field of the image of in PSL 2 (R), and E the trace field for (2) , also called the invariant trace field (see Maclachlan-Reid [15, Sect. 5.5]).
As above, we have a map → PSL 2 (R); the F -subalgebra B := F ≤ M 2 (R) generated by any lift of the image (well-defined, since −1 ∈ F ) is a quaternion algebra, similarly The same construction applies to (2) , yielding a quaternion E-algebra A and a Z E -order . Let O 1 := {γ ∈ O : nrd(γ ) = 1} be the elements of reduced norm 1 in O, and define 1 similarly. Then we have a commutative square of group homomorphisms In fact, the bottom map descends to the normalizer N A ( ) of in A, as follows.

Lemma 2.11
The composition of the maps (2.12)

Congruence subgroups: general definition
We now define congruence subgroups. Let N ⊆ Z E be a nonzero ideal. Then reducing elements modulo N, as in (2.10) we obtain a commutative diagram 1 (2) (N) (2) but now with kernels in the rows: in particular, we have a group homomorphism with kernel called the principal congruence subgroup of level N. As in the introduction, we define congruence subgroups of to be those that contain a principal congruence subgroup, and a triangular modular curve to be a quotient of the (completed) upper half-plane by a congruence subgroup of a triangle group, for example are called the principal triangular modular curves.

Remark 2.17
One could work more generally with ideals of Z F instead, arriving at the same definition of congruence subgroups but with a different notion of level. In light of what follows, especially the robust failure of N to be surjective, we prefer to work with levels in Z E .
Since normalizes (2) and therefore and N , there is descent to the normalizer as in Lemma 2.11. However, the precise description of (N) depends on the ramification behavior of the primes dividing N in the extension F | E and in the algebras A and B (and this already introduces some subtleties when N is composite). We pursue this in the next section.

Galois case
Before proceeding, as a warmup we consider the curves X(a, b, c; p) corresponding to principal congruence subgroups, where X(a, b, c; p) → X(a, b, c) P 1 is a generically Galois Belyi map. Quite generally, for any generically Galois Belyi map with group G, the ramification indices above each ramification point are equal. Without loss of generality, we may suppose that a, b, c are also the orders of the ramification points. Thus the Riemann-Hurwitz formula gives From this genus formula and (2.2), we can conclude that, for any fixed genus g 0 ≥ 0, there are finitely many hyperbolic G-Galois Belyi maps with genus g 0 . We are of course interested in the special case where where F p := Z E /p is the residue field and PXL 2 (F p ) denotes either PSL 2 (F p ) or PGL 2 (F p ).
(The major task in the next section is to precisely investigate this arithmetically.) Plugging G = PXL 2 (F q ) into the above: Thus, there are no curves X(a, b, c; p) of genus at most 1. For genus 2, we can use the inequality to see that q must be less than 6, so #G ≤ 60 and, if g(X(a, b, c; p)) = 2, then This inequality implies that a ≤ b ≤ c ≤ 7 and, by checking the genera of these possibilities with (2.18), we conclude that there are no curves X(a, b, c; p) of genus 2.

Triangular modular curves
In this section, we study triangular modular curves generalizing the classical modular curves; the main results are Proposition 3.6, where we define the relevant matrix representation of , and Theorem 3.12, describing its image building on work of Clark-Voight [3]. Throughout, we retain our notation from the previous section.

Congruence subgroups: matrix case
We return to (2.13), and identify matrix groups. Recalling (2.9), we first suppose that β = discrd O is coprime to N, so all primes p | N are unramified in B but more strongly we have (O/NO) 1 For the order , we recall Lemma 2.6: given a, b, c, we can compute its Z E -module span in A and therefore a Z E -pseudobasis for , hence its reduced discriminant. Since So we make the stronger assumption that N is coprime to discrd( ). Then from (2.10) we get (2) To descend the bottom map to the normalizer as in Lemma 2.11, we restrict our scope taking N = p prime and work just a little bit more. Let be the localization of Z E at the ideal p (all elements coprime to p become units).

Lemma 3.3 Suppose that p d F |E . Then for s = a, b, c, we can write
with: • υ s ∈ Z × E,(p) , well-defined up to multiplication by an element of Z ×2 E,(p) , i.e., up to the square of an element of Z × E,(p) , and If p is coprime to 2abc, then we may take θ s = 1 and υ s = λ s + 2.

Moreover, the prime p (necessarily unramified in F ) splits completely in F if and only if the Kronecker symbols
Proof First, a bit of generality: for α ∈ E × with even valuation at all primes p | N, by weak approximation in E we can write with υ, θ as in the statement of the lemma. Now to apply this, we observe that F = E(λ 2a , λ 2b , λ 2c ) and recall that λ 2 2s = λ s + 2. By hypothesis, we have p d F |E ; in particular the elements λ s +2 must have even (nonnegative) valuation at p. Thus (3.5) applies, giving (3.4). The final statement follows from the usual splitting criterion in quadratic fields.
We obtain the following result. Proposition 3.6 Suppose that p discrd( )d F |E . Then there is a commutative diagram (2) Remark 3.8 A similar argument works when N is composite; however the right-hand vertical map SL 2 (Z E /N)/{±1} → PGL 2 (Z E /N) may no longer be injective when N is composite. This leads to certain ambiguities about the definition which we will return to in future work.

Admissibility and image
It can and does happen that two different triangular modular curves are isomorphic (as curves and as covers of P 1 ). The issue is simply that in the homomorphism π N from (a, b, c) to a matrix group, the generators δ s need not have order s in the image (for s = a, b, c). In other words, the reduction homomorphism factors through a triangle group with a smaller triple. This happens for example when s = ∞, as the order of π N (δ s ) is always finite! To illustrate this phenomena, we present the following example. and β(2, 3, c) = λ c − 1 ∈ Z × E k . The prime p is totally ramified in F , so F p k F p for p k | p. Thus X(2, 3, p k ; p k ) X(2, 3, p; p 1 ).
To avoid this redundancy, we make the following definition. a triple (a, b, c),

Definition 3.11 Given
• the order of π p (δ s ) is equal to s for all s = a, b, c. Theorem 3.12 (Clark-Voight). We have π p (G (2) p ) = PSL 2 (Z E /p) and where PXL 2 denotes PSL 2 or PGL 2 according as p splits in F ⊇ E or not.
Proof We refer to Clark-Voight [3, Theorem A] for the case where p 2abc; but examining the argument given [3, Remark 5.24, proof of Theorem 9.1] in light of the above, we see that it extends when p discrd( )βd F |E .

Hyperbolic triples reducing to non-hyperbolic triples
In considering admissible triples, we may lose the hypothesis that (a, b, c) is hyperbolic; however, this situation is easy to characterize. We note that in most cases, these groups do not contain PSL 2 (F q ), so they are not considered in this paper. (a , b , c ) is not hyperbolic . Then (a, b, c; p, q) is one of the elements listed in the following table. In the table, p lies below p and q is the residue field degree of p.   (a, b, c) conditions p q PXL E(a , b , c ) (2 k a , 2 k b , 3 · 2 k c ),

Proposition 3.13 Suppose
(3.14) Furthermore, the curves X(a, b, c; p) with (a, b, c; p) as above all have genus 0.
Proof We first focus on the prime ideal case and make a case by case study. The only triples (a, b, c) ∈ (Z ≥0 ∪ {∞}) 3 that are not hyperbolic are Assume first that (a , b , c ) = (2, 2, c) for c > 1. The image of π p : (2, 2, c) → PGL 2 (F q ) must be dihedral. The only dihedral group that is isomorphic to PXL 2 (F q ) for any q is D 6 PSL 2 (F 2 ). Thus, we only have the triple (a , b , c ) = (2, 2, 3) and prime p 2 .
The group (2, 3, 6) is solvable since it fits in the exact sequence: The only solvable groups of the form PXL 2 (F q ) are S 4 PGL 2 (F 3 ) and A 4 PSL 2 (F 3 ). The triple (2, 3, 6) is not admissible for q = 2 or q = 3, so (2, 3, 6) does not arise from any prime ideal p. With the same analysis, we can rule out (2,4,4). We also have that the group (3, 3, 3) is solvable. Hence, the image of π p : (3, 3, 3) → PXL 2 (F q ) must be solvable. The only solvable groups of this form are A 4 PSL 2 (F 3 ) and S 4 PGL 2 (F 3 ). Thus, the only option is that p is a prime above 3 with residue field F 3 .
We now use this fact to finish the analysis. When (a , b , c ) = (2, 3, 3), the admissible prime ideals p have residue field degree 3, 4, and 5. The field E (2, 3, 3) is the rational field, so Z E /p 2 F 2 . In addition, the ideal 2Z E is totally ramified in any field E(2·2 k a , 3·2 k b , 3·2 k c ), so q = 4. The only options then are q = 3 and q = 5. A quick Magma [2] calculation shows that elements with these orders cannot generate PSL 2 (F 5 ).
Similarly, when (a , b , c ) = (2, 3, 4), the only possibilities for q with image containing PSL 2 (F q ) and admissible for p are q = 3 or q = 5. However, the field E(2, 3, 4) is the rational field and 5 is inert in F , so we would have G 5Z E PGL 2 (F 5 ), which is not on the list of possible groups. The same happens for (a , b , c ) = (2, 3, 5); the options of q for an admissible prime p are q = 2, 3, 4, 5. The ideal 2Z E is inert in E(2, 3, 5), an extension of Q of degree 2, thus q = 2 is not possible. The ideal 3Z E is also inert in E(2, 3, 5), so an isomorphism with PXL 2 (F 3 ) is not possible. The only options for q are q = 4 and q = 5.
For all of the possible triples (a , b , c ) and primes p described above, we certify that such map is possible by exhibiting passports for each curve. Finally, we use Eq. (2.18) to compute the genus of each of these curves, finding that they all have genus 0.

Borel-type subgroups
As in the introduction, let be the upper-triangular matrices in GL 2 (Z E /p), and let H 0,p be its image in the projection to PGL 2 (Z E /p). Similarly, let be the upper unipotent subgroup and H 1,p again its image in PGL 2 (Z E /p). We then define the subgroups

Triangular modular curves X 0 (a, b, c; p) of prime level
In this section, we exhibit a formula for the genus of the triangular modular curves X 0 (a, b, c; p) for p prime. Using this formula we show that there are only finitely many such curves with bounded genus.

Setup
Let (a, b, c) be a hyperbolic triple and p be an admissible prime of E = E(a, b, c) with residue field F p . Let q := #F p , so F p F q . Because E is Galois over Q, all primes p have the same ramification and splitting type; it follows that the genus of X 0 (a, b, c; p) only depends on the prime number p ∈ Z below p (and the inertial degree of p over p).
Let G := G p be as in Theorem 3.12. Then the group H 0 = H 0,p consists of the image in G of the upper-triangular matrices of SL 2 (F q ) or GL 2 (F q ), depending on G. By construction, the curves X 0 (a, b, c; p) and X(a, b, c; p) fit in the following diagram.

X(a, b, c; p)
We first compute the index [G : H 0 ], which corresponds to the degree of the cover X 0 (a, b, c; p) → P 1 . If G = PGL 2 (F q ), up to multiplication by a scalar matrix, it is possible to choose representatives of elements of H 0 that have 1 on the first entry of the matrix. Thus, #H 0 = q(q − 1) and [G : H 0 ] = q + 1. When q is even, we have an isomorphism PSL 2 (F q ) PGL 2 (F q ), so the index [G : H 0 ] is the same as above. Finally, if G = PSL 2 (F q ) with q odd, then representatives can be chosen to have 1 on the first entry of the matrix as above. Also, the upper triangular matrices are defined up to multiplication by −1. Hence #H 0 = 1 2 q(q − 1) and [G : H 0 ] = q + 1. Via the projection of the first column of the matrix to P 1 (F q ), the set of cosets G/H 0 is naturally in bijection with P 1 (F q ). With this bijection, the action of π p ( ) on G/H 0 becomes simply matrix multiplication. The ramification of the cover X 0 (a, b, c; p) → P 1 then depends on the cycle decomposition of the corresponding elements (in G) as an element of Sym(P 1 ) S q+1 .

Cycle structure and genus formula
The following lemma describes the cycle structure using only the order of the elements. Recall we write PXL 2 for either PSL 2 or PGL 2 . Proof We note that each class in G is represented by matrices that are diagonalizable over F q , diagonalizable only over F q 2 , or not diagonalizable. We prove the Lemma by studying in detail each case. Let σ s be an element of GL 2 (F q ) whose projection to G is σ s . If σ s is diagonalizable, then we say that σ s is split semisimple, and σ s is conjugate to say the diagonal matrix u 0 0 v . We must have u = v because otherwise σ s would be the identity in G, contradicting that s ≥ 2. The order of σ s is s, so s is the order of uv −1 in F × q . To find the orbits of the action of σ s on P 1 (F q ), we use that for any x ∈ F q . Hence, the action of σ s has two fixed points: 1 : 0 and 0 : 1 , and (q − 1)/s orbits with s elements.
The element σ s is unipotent if and only if it is conjugate to This is the case when the characteristic polynomial of σ s has two equal roots and σ s is not diagonalizable over F 2 q . This happens if and only if s = p. In this case, we have There is only one fixed point and there are q/p orbits of size p.
If the characteristic polynomial of σ s does not split in F q , we call σ s non-split semisimple. The action of σ s has no fixed points because this would imply that σ s has an eigenvector. The splitting field of the characteristic polynomial of σ s is F q 2 . Let α 1 , α 2 ∈ F q 2 \ F q be the roots of this polynomial. Then σ s is conjugate with the diagonal matrix [α 1 , From the analysis of the split semisimple case, we conclude that every orbit has length s. Thus, the action of σ s on P 1 (F q ) has (q + 1)/s orbits of length s.
The following lemma partially solves this problem.

Lemma 4.3
Let G = PSL 2 (F q ) with q odd, and let σ 2 ∈ G be an element of order 2. Then the action of σ 2 on P 1 (F q ) has: (i) two fixed points and (q − 1)/2 orbits of size 2 if −1 is a square modulo q; and (ii) (no fixed points and) (q + 1)/2 orbits of size 2, otherwise.
Proof Let σ 2 be a matrix of order 2 in PSL 2 (F q ). Pick a lift σ 2 ∈ SL 2 (F q ) of σ 2 . Because σ 4 2 is the identity, its characteristic polynomial must be a quadratic polynomial dividing x 4 −1.
In addition, the constant of this polynomial must be 1 since this is the determinant of σ 2 . The only possibility for such a polynomial is x 2 + 1. If −1 ∈ F ×2 q , then this characteristic polynomial splits with distinct roots, so we are in the split semisimple case of Lemma 4.1. Otherwise, −1 is not a square and we are in the non-split semisimple case. Now we are ready to give a formula for the genus g of X 0 (a, b, c; p). For x ∈ R, we write x for the rounding down of x, so 3/2 = 1. (a, b, c) be a hyperbolic admissible triple and p be a prime of E above a rational prime p. Then the genus of X 0 (a, b, c; p) is given by g (X 0 (a, b, c; p)
In the latter case (a = 2 and q odd), Lemma 4.3 implies that when G = PSL 2 (F q ), we have (a, b, c; p) = 0 if and only if q ≡ 1 (mod 4) (case (i)).
Proof Consider elements σ a , σ b , σ c ∈ PXL 2 (F q ) of orders a, b, and c, respectively, such that σ a σ b σ c = 1. We recall that the map X 0 (a, b, c; p) → X(1) has degree q + 1 since [G : H 0 ] = q + 1. The Riemann-Hurwitz formula implies where s is the ramification index at the points that ramify. We can compute s from Lemma 4.1 and Lemma 4.3, with s = k s (s − 1), where if s = 2 or (s = a = 2 and q is even); whereas if s = a = 2 and q is odd, then either k 2 = (q + 1)/2 or k 2 = (q − 1)/2 is determined by the fact that g ∈ Z, since they differ by 1.

Remark 4.8
Instead of using parity, in the PGL 2 (F q ) and q odd case, we can always explicitly compute elements σ 2 , σ b , σ c ∈ G, of orders 2, b, and c respectively, such that σ 2 σ b σ c = 1. We can then decide if σ 2 is split or non-split and use Lemma 4.1 to compute the ramification.

Algorithm
We present an implementation of Theorem 4.4. (a, b, c) be a hyperbolic triple and let p ⊆ Z E(a,b,c) be a nonzero prime ideal. This algorithm computes the genus of X 0 (a, b, c; p) and the Galois group G p of the cover X(a, b, c; p) → P 1 .

Algorithm 4.9 Let
1. Compute the residue field of p and set q := #F p . 2. Compute the residue field Z F /p F , where p F is a prime of F (a, b, c) above p. If F q Z F /p F , then G = PSL 2 (F q ). Otherwise set G = PGL 2 (F q ).
Proof of correctness Correctness follows from the formula in Theorem 4.4. Steps 1 and 2 can be performed by constructing the algebraic number field; it can also be done purely in terms of the prime number p below p as in Algorithm 5.1.

Bounding the genus
Our goal remains to show that, for fixed genus g 0 , there are finitely many admissible curves X 0 (a, b, c; p) of genus g ≤ g 0 . We first characterize the hyperbolic triples (a, b, c) such that the curve X(a, b, c) has Galois group PXL 2 (F q ), for a given q.
In the prime case, the notion of admissible ideal can be turned around, as follows. Proof Let s be the order of π p (δ s ). The cases where (a , b , c ) is not hyperbolic are handled in Proposition 3.13: we get g = 0, and the inequality holds. So we may suppose without loss of generality that s = s for s = {a, b, c}, and still that (a, b, c) is hyperbolic. We study the Belyi map X 0 (a, b, c; p) → P 1 . Let a , b , c be the ramification degrees of this map. Using Lemma 4.1, we have that for s ∈ {a, b, c}, Because of these bounds and (4.6), where χ(a, b, c) is as in (2.1). The result then follows from the previous inequality and (2.2).

Corollary 4.15
For a fixed genus g 0 ∈ Z ≥0 , there are only finitely many hyperbolic triples (a, b, c) and admissible primes p such that the curves X 0 (a, b, c; p) have genus g ≤ g 0 .
Proof By Proposition 4.12, we obtain an upper bound on the rational prime p given by q ≤ 84(g 0 + 1) + 1. Also, for (a, b, c) to be q-admissible, necessarily s ≤ q + 1 for all s ∈ {a, b, c}. This leaves only finitely many possibilities.

Remark 4.16
To make computations more efficient, we can consider a bound on q that depends on χ (a, b, c). For the genus of X 0 (a, b, c; p) to be less than or equal to g 0 , it is necessary that This inequality also shows that Therefore, we can bound a, b, and c whenever q is fixed.

Enumerating curves of low genus
We present the main algorithms that use the theory developed in Sect. 4. The goal of this section is to effectively enumerate the curves X 0 (a, b, c; p) of bounded genus. The number of curves is finite from Corollary 4.15. As explained in Sect. 2, if p is admissible, then G is given by PXL 2 (F q ). The first condition (coprimality) in admissibility can be expensive to check, so we first check the easier necessary (but not sufficient) condition that p β (a, b, c). (a, b, c) be a hyperbolic triple and p be a prime number. This algorithm returns true if there exists a prime p ⊆ Z E(a,b,c) above p such that p β(a, b, c).
1. If p 2abc, then return true.  E(a, b, c) that are admissible such that the genus of X 0 (a, b, c; p) is at most g 0 .

Find
1. Loop over the list of possible powers q = p r , where p is a prime number and q ≤ 84(g 0 + 1) + 1. 2. For each q from step 1, find all q-admissible hyperbolic triples (a, b, c) (as in Definition 4.10). 3. For each q-admissible triple (a, b, c) from step 2, check if χ(a, b, c) satisfies (4.18) and if p does not divide β(a, b, c) using Algorithm 5.1. If yes, compute the candidate genus g of X 0 (a, b, c; p) using Algorithm 4.9. 4. If g ≤ g 0 , check that p discrd( )d F |E . If yes, add (a, b, c; q) to the list lowGenus.
Proof of correctness For step 1, see Proposition 4.12. Every hyperbolic q-admissible triple gives rise to one such curve. The correctness of the rest of the algorithm follows from the work done in Sect. 4.
We list the CPU time (in seconds) for our implementation to compute the list of curves X 0 (a, b, c; p) of genus up to bounds 0, 1, and 2 on a standard laptop:  1 (a, b, c; p) In this section, we use Sect. 4 to give analogous results for triangular modular curves X 1 (a, b, c; p), completing the proof of our main result. We recall that X 1 (a, b, c; p) is defined in (3.18) as the quotient of H by 1 (a, b, c; p).  E(a, b, c), there is a cover X 1 (a, b, c; p) → X 0 (a, b, c; p). All curves X 1 (a, b, c; p) of genus bounded above by g 0 cover curves X 0 (a, b, c; p) of genus bounded above by g 0 . Because of Corollary 4.15, there are finitely many admissible triples (a, b, c) and prime ideals p that give rise to curves X 0 (a, b, c; p) of genus bounded above by g 0 .
We now focus on explicitly enumerating all curves of bounded genus. The goal first is to prove group-theoretic results that describe the degree and ramification of the cover X 1 (p) → X(1). We describe the structure of the quotient PXL 2 (F q ) modulo H 1,p and then describe the action of π p (δ s ) on this quotient. The main difference with Sect. 4 is that the quotient G/H 0,p does not depend on G being isomorphic to PSL 2 (F q ) or PGL 2 (F q ), whereas the structure of G/H 1,p depends on the choice of G. Let H 1 := H 1,p . Lemma 6.2 Let G = PXL 2 (F q ), where F q := Z E /p. The quotient G/H 1 can be described as follows.
To present this isomorphism, we fix a non-square μ ∈ F × q F ×2 q . For any ±(x, z) ∈ (F q × F q \ {(0, 0)})/ ±1 , and any u ∈ {1, μ} F × q /F ×2 q , we choose values of y, w ∈ F q such that xw − yz = u and map ±(x, z) to the class of the matrix x y z w in PGL 2 (F q ). Given two different choices y, w ∈ F q and y , w ∈ F q , if x = 0, then ± x y z w = x y z w 1 x −1 (y − y ) 0 1 .
If x = 0, then z = 0 and 0 = u = yz = y z. Thus, y = y . Also, Thus, the map (F q × F q \ {(0, 0)})/{±1} × F × q /F ×2 q → G/H 1 is a well defined homomorphism. In addition, multiplication by elements in H 1 does not change the square class of the determinant or the first column of the matrix, so the homomorphism described above is injective. Since the cardinalities of the domain and range are equal, we conclude that this is an isomorphism.
We proceed to describe the ramification of the cover X 1 (a, b, c; p) → P 1 . This lemma is similar to Lemma 4.1. The main difference is that in certain cases there are more fixed points than strictly necessary. (a) if G = PSL 2 (F q ) and q is odd, there are (q − 1)/2 fixed points and (q 2 − q)/(2p) orbits of length p, (b) otherwise, there are q − 1 fixed points and (q 2 − q)/p orbits of length p.
Proof We use the description of the quotient G/H 1 given in Lemma 6.2. Let σ s be any element of GL 2 (F q ) that maps to σ s in the quotient to G.
If σ s is split semisimple, then it is conjugate over F q to a diagonal matrix with entries u, v. Because the order of σ s is s, then s is the order of uv −1 . We pick a class in the quotient G/H 1 represented by a matrix M. If the class of M is fixed by the action of σ s , then the first column of M is, up to multiplication by ±1, fixed by multiplication by the diagonal matrix. This implies that (u, v) = ±(1, 1), contradicting that s ≥ 2. Thus, there are no fixed points of the action of σ s on G/H 1 . A similar argument shows that orbits of elements that are not fixed cannot have length less than s. Thus, every element belongs to an orbit of length s.
If σ s is non-split semisimple, then σ s is split in a quadratic extension of F q . We assume that σ s = T −1 [α 1 , α 2 ]T in this extension. If σ r s fixes an element for r ≥ 1, then we have ± α r 1 0 0 α r 2 T x y z w = T x y z w .
1. Loop over all hyperbolic triples (a, b, c) and prime ideals p such that X 0 (a, b, c; p) has genus bounded above by g 0 . This list can be obtained from Algorithm 5.2. 2. For each triple (a, b, c) and ideal p of the previous step, compute the genus g of X 1 (a, b, c; p) with Corollary 6.4. If g ≤ g 0 , then add (a, b, c; p) to the list lowGenusX1.
Proof of correctness For all triples (a, b, c) and prime ideals p there are maps X 1 (a, b, c; p) → X 0 (a, b, c; p). Thus, the only curves X 1 (a, b, c; p) that can have genus g ≤ g 0 must be covering curves X 0 (a, b, c; p) of genus bounded above by g 0 .
We conclude the paper by proving our main result.
Proof of Theorem 1.9 By Corollary 4.15, there are only finitely many curves X 0 (a, b, c; p) with nontrivial admissible prime level p and genus g ≤ g 0 . Since every curve X 1 (a, b, c; p) covers X 0 (a, b, c; p), the same is true for X 1 (a, b, c; p) (see Corollary 6.1).
For the computation, we run Algorithm 5.2 with g 0 = 2, adding extra cases according to Proposition 3.13. To finish, we run Algorithm 6.5. The implementation of this computation can be found in our Magma code [9].