Twist-minimal trace formulas and the Selberg eigenvalue conjecture

We derive a fully explicit version of the Selberg trace formula for twist-minimal Maass forms of weight 0 and arbitrary conductor and nebentypus character, and apply it to prove two theorems. First, conditional on Artin's conjecture, we classify the even 2-dimensional Artin representations of small conductor; in particular, we show that the even icosahedral representation of smallest conductor is the one found by Doud and Moore, of conductor 1951. Second, we verify the Selberg eigenvalue conjecture for groups of small level, improving on a result of Huxley from 1985.


Introduction
In [BS07], the first and third authors derived a fully explicit version of the Selberg trace formula for cuspidal Maass newforms of squarefree conductor, and applied it to obtain partial results toward the Selberg eigenvalue conjecture and the classification of 2-dimensional Artin representations of small conductor. In this paper we remove the restriction to squarefree conductor, with the following applications: Theorem 1.1. The Selberg eigenvalue conjecture is true for Γ 1 (N) for N ≤ 880, and for Γ(N) for N ≤ 226.
Theorem 1.2. Assuming Artin's conjecture, Table 1 is the complete list, up to twist, of even, nondihedral, irreducible, 2-dimensional Artin representations of conductor ≤ 2862.  Table 1. Even, nondihedral Artin representations of conductor ≤ 2862, up to twist. For each twist equivalence class we indicate the minimal Artin conductor and link to the LMFDB page of a representation in the class, when available.
• As we pointed out in [BS07], in the case of squarefree level the Selberg trace formula becomes substantially cleaner if one sieves down to newforms, and that also helps in numerical applications by thinning out the spectrum. For nonsquarefree level this is no longer the case, as the newform sieve results in more complicated formulas in many cases.
Our main innovation in this paper is to introduce a further sieve down to twist-minimal forms, i.e. those newforms whose conductor cannot be reduced by twisting. Although there are many technical complications to overcome in the intermediate stages, in the end we find that the twist-minimal trace formula is again significantly cleaner and helps to improve the numerics.
A natural question to explore in further investigations is whether one can skip the intermediate stages and derive the twist-minimal trace formula directly. In particular, some of the most intricate parts of the present paper have to do with explicitly describing the Eisenstein series in full generality, but it often turns out that the corresponding terms of the trace formula are annihilated by the twistminimial sieve. A direct proof might shed light on why this is so and avoid messy calculations.
• Theorem 1.1 for Γ(N) improves a 30-year-old result of Huxley [Hux85], who proved the Selberg eigenvalue conjecture for groups of level N ≤ 18. Treating nonsquarefree conductors is essential for this application, since a form of level N can have conductor as large as N 2 . Moreover, the reduction to twist-minimal spaces yields a substantial improvement in our numerical results by essentially halving the spectrum in the critical case of forms of prime level N and conductor N 2 (see (1.3) below). This partially explains why our result for Γ(N) is within a factor of 4 of that for Γ 1 (N), despite the conductors being much larger. • By the Langlands-Tunnell theorem, the Artin conjecture is true for tetrahedral and octahedral representations, so the conclusion of Theorem 1.2 holds unconditionally for those types. In the icosahedral case, by [Boo03] it is enough to assume the Artin conjecture for all representations in a given Galois conjugacy class; i.e., if there is a twist-minimal, even icosahedral representation of conductor ≤ 2862 that does not appear in Table 1, then Artin's conjecture is false for at least one of its Galois conjugates. The entries of Table 1 were computed by Jones and Roberts [JR17] by a thorough search of number fields with prescribed ramification behavior, and we verified the completeness of the list via the trace formula. In principle the number field search by Jones and Roberts [JR14] is exhaustive, so it should be possible to prove Theorem 1.2 unconditionally with a further computation, but that has not yet been carried out to our knowledge. • Theorem 1.1 for Γ 1 (N) improves on the result from [BS07] by extending to nonsquarefree N and increasing the upper bound from 854 to 880. To accomplish the latter, we computed a longer list of class numbers of the quadratic fields Q( √ t 2 ± 4) using the algorithm from [BBJ18]. Nothing (other than limited patience of the user) prevents computing an even longer list and increasing the bounds in Theorem 1.1 a bit more. However, as explained in [BS07,§6], our method suffers from an exponential barrier to increasing the conductor, so that by itself is likely to yield only marginal improvements. Some ideas for surmounting this barrier are described in [BS07,§6]; in any case, as Theorem 1.2 shows, the first even icosahedral representation occurs at conductor N = 1951, 1 so the bounds in Theorem 1.1 cannot be improved unconditionally beyond 1950.
• All of our computations with real and complex numbers were carried out using the interval arithmetic package Arb [Joh17]. Thus, modulo bugs in the software and computer hardware, our results are rigorous. The reader is invited to inspect our source code at [BLS18].
We conclude the introduction with a brief outline of the paper. In §1.1-1.2 we define the space of twist-minimal Maass forms and state our version of the Selberg trace formula for it. In §2 we state and prove the full trace formula in general terms, and then specialize it to Γ 0 (N) with nebentypus character. In §3 we apply the sieving process to pass from the full space to newforms, and then to twist-minimal forms. In §4, we describe some details of the application of the trace formula to Γ(N) and to Artin representations. Finally, in §5 we make a few remarks on numerical aspects of the proofs of Theorems 1.1 and 1.2.
1.1. Preliminaries on twist-minimal spaces of Maass forms. Let H = {z = x+iy ∈ C : y > 0} denote the hyperbolic plane. Given a real number λ > 0 and an even Dirichlet character χ (mod N), let A λ (χ) denote the vector space of Maass cusp forms of eigenvalue λ, level N and nebentypus character χ, i.e. the set of smooth functions f : H → C satisfying (1) f ( az+b cz+d ) = χ(d)f (z) for all ( a b c d ) ∈ Γ 0 (N); (2) Γ 0 (N )\H |f | 2 dx dy y 2 < ∞; (3) −y 2 ∂ 2 ∂x 2 + ∂ 2 ∂y 2 f = λf . We omit the level N from the notation A λ (χ) since it is determined implicitly as the modulus of χ (which might differ from its conductor, i.e. χ need not be primitive). Any f ∈ A λ (χ) has a Fourier expansion of the form for certain coefficients a f (n) ∈ C, where K s (y) = 1 2 R e st−y cosh t dt is the K-Bessel function.
For any n ∈ Z \ {0} coprime to N, let T n : A λ (χ) → A λ (χ) denote the Hecke operator defined by (T n f )(z) = 1 |n| a,d∈Z d>0,ad=n We say that f ∈ A λ (χ) is a normalized Hecke eigenform if a f (1) = 1 and f is a simultaneous eigenfunction of T n for every n coprime to N. In this case, one has T n f = a f (n)f . denote the span of the images of all lower level forms under these maps, and let A new λ (χ) ⊆ A λ (χ) denote the orthogonal complement of A old λ (χ) with respect to the Petersson inner product f, g = Γ 0 (N )\H fḡ dx dy y 2 . We call this the space of newforms of eigenvalue λ, conductor N and character χ.
By strong multiplicity one, we have A new λ (χ) ∩ A new λ (χ ′ ) = {0} unless χ and χ ′ have the same modulus and satisfy χ(n) = χ ′ (n) for all n. In particular, any nonzero f ∈ A new λ (χ) uniquely determines its conductor, which we denote by cond(f ). Moreover, the Hecke operators T n map A new λ (χ) to itself, and A new λ (χ) has a unique basis consisting of normalized Hecke eigenforms.
Suppose that f ∈ A new λ (χ) is a normalized Hecke eigenform. Then for any Dirichlet character ψ (mod q), there is a unique M ∈ Z >0 and a unique g ∈ A new λ (χψ 2 | M ) such that a g (n) = a f (n)ψ(n) for all n ∈ Z \ {0} coprime to q. We write f ⊗ ψ to denote the corresponding g. We say that f is twist minimal if cond(f ⊗ ψ) ≥ cond(f ) for every Dirichlet character ψ.
In light of this, it is enough to consider the trace formula for twist-minimal spaces of forms. In fact, since some twist-minimal spaces are trivial, and for others a given form can have more than one representation as the twist of a twist-minimal form (i.e. it is possible to have cond(f ⊗ ψ) = cond(f ) and f ⊗ ψ = f ), a further reduction of the nebentypus character is possible, as follows.
Definition 1.5. Let χ = p|N χ p be a Dirichlet character modulo N, and put e p = ord p N, s p = ord p cond(χ). We say that χ is minimal if the following statement holds for every prime p | N: p > 2 and s p ∈ {0, e p } or χ p has order 2 ord 2 (p−1) if e p > 3 and 2 | e p .
Note that for an odd prime p, there are 2 ord 2 (p−1)−1 choices of χ p (mod p ep ) of order 2 ord 2 (p−1) , and for any such χ p we have s p = 1 and χ p (−1) = −1; in particular, when p ≡ 3 (mod 4), the Legendre symbol · p is the unique such character. (For p ≡ 1 (mod 4), the spaces resulting from different choices of χ p of order 2 ord 2 (p−1) are twist equivalent, but there is no canonical choice. Similarly, for p = 2 the characters of conductor 2 ⌊e 2 /2⌋ and fixed parity yield twist-equivalent spaces.) Lemma 1.6. Let χ (mod N) be a Dirichlet character, and suppose that A min λ (χ) = {0}. Then there exists ψ (mod N) such that χψ 2 is minimal and A min λ (χ) Proof. Since the map f → f ⊗ψ is injective, by Lemma 1.4 it suffices to show that there is a ψ (mod N) such that χψ 2 is minimal and cond(ψ) cond(χψ) | N. Writing ψ = p|N ψ p , this is equivalent to finding ψ p (mod p ordp N ) such that χ p ψ 2 p is minimal and (1.2) ord p cond(ψ p ) + ord p cond(χ p ψ p ) ≤ ord p N for each prime p | N. Fix p | N and set e = ord p N, s = ord p cond(χ p ). If e ∈ {s, 1} then χ p is minimal, so we can take ψ p equal to the trivial character mod p e . Hence we may assume that e > max{s, 1}. In this case, since A min λ (χ) is nonzero, it follows from [AL78, Theorem 4.3 ′ ] that s ≤ 1 2 e. Suppose that p is odd, and let g be a primitive root mod p e . Then χ p (g) = e(a/ϕ(p e )) for a unique a ∈ Z ∩ [1, ϕ(p e )]. Set and let ψ p be the character defined by ψ p (g) = e(b/ϕ(p e )). Then χ p ψ 2 p is minimal, and since p ordp a | b and e > 1, it follows that ord p cond(ψ p ) ≤ 1 2 e, which implies the desired inequality (1.2).
Suppose now that p = 2. Since s ≤ 1 2 e and there is no character of conductor 2, χ 2 is already minimal if e ≤ 3. Also, by the analogue of [AL78, Theorem 4.4(iii)] for Maass forms, if e ≥ 4 is even then we must have s = e/2, so χ 2 is again minimal. Hence, we may assume that e is an odd number exceeding 3.
Thus, we may restrict our attention to the spaces A min λ (χ) for minimal characters χ.
1.2. The twist-minimal trace formula. Let g : R → C be even, continuous and absolutely integrable, with Fourier transform h(r) = R g(u)e iru du. We say that the pair (g, h) is of trace class if there exists δ > 0 such that h is analytic on the strip Ω = {r ∈ C : |ℑ(r)| < 1 2 + δ} and satisfies h(r) ≪ (1 + |r|) −2−δ for all r ∈ Ω. Let χ (mod N) be a Dirichlet character, and write χ = p|N χ p , where each χ p is a character modulo p ordp N . The trace formula is an expression for λ>0 tr T n | A min λ (χ) h λ − 1 4 in terms of g and χ. Its terms are linear functionals of g with coefficients that are multiplicative functions of χ, i.e. functions F satisfying F (χ) = p|N F (χ p ).
In what follows we fix a prime p and a character χ (mod p e ) of conductor p s , and define the local factor at p for various terms appearing in the trace formula. As a notational convenience, for any proposition P we write δ P to denote the characteristic function of P , i.e. δ P = 1 if P is true and δ P = 0 if P is false.
if n = 1, s < e = 2, Elliptic and hyperbolic terms. Following the notation in [BL17, §1.1], let D denote the set of discriminants, that is Any nonzero D ∈ D may be expressed uniquely in the form dℓ 2 , where d is a fundamental discriminant and ℓ > 0. We define ψ D (n) = d n/ gcd(n,ℓ) , where denotes the Kronecker symbol. Note that ψ D is periodic modulo D, and if D is fundamental then ψ D is the usual quadratic character mod D. Set Then it is not hard to see that so that L(z, ψ D ) has analytic continuation to C, apart from a simple pole at z = 1 when D is a square. In particular, if D is not a square then we have Let t ∈ Z and n ∈ {±1} with D = t 2 − 4n not a square. Then D ∈ D, so we may write D = dℓ 2 as above. Define r = ord p (D/2) + 1, and ω = 1 if 2 ∤ t or p = 2 and r = 2s, 0 otherwise.
With the notation in place, we can now state the trace formula for T n acting on A min λ (χ). Theorem 1.7. Let χ (mod N) be a minimal character of conductor q, n ∈ {±1}, and (g, h) a pair of test functions of trace class. Then 2. Statement and proof of the full Selberg trace formula 2.1. Selberg trace formula in general form from [BS07]. The group of all isometries (orientation preserving or not) of H can be identified with G = PGL 2 (R), where the action is defined by The group of orientation preserving isometries, G + = PSL 2 (R), is a subgroup of index 2 in G. We write G − = G \ G + for the other coset in G. Let Γ be a discrete subgroup of G such that the surface Γ\H is noncompact but of finite area, and let χ be a (unitary) character on Γ. We set Γ + := Γ ∩ G + and assume Γ + = Γ. We let L 2 (Γ\H, χ) be the Hilbert space of functions f : H → C satisfying the automorphy relation f (γz) = χ(γ)f (z), ∀γ ∈ Γ, 8 and Γ\H |f | 2 dµ < ∞.
The set M in NEll(Γ, χ) and Ell(Γ, χ) is given as T has no cusp of Γ + as a fixpoint}, i.e. M is the set of all T ∈ Γ which do not fix any cusp of Γ + and "{T } ⊂ M" denotes that we add over a set of representatives for the Γ-conjugacy classes in M. We write Z Γ (T ) for the centralizer of T in Γ. The sum in NEll(Γ, χ) in (2.2) is over all non-elliptic conjugacy classes in M. Thus T is hyperbolic, reflection or a glide reflection, and let α ∈ (−∞, −1] ∪ (1, ∞) be the unique number such that T is conjugate within G to ( α 0 0 1 ). Then we write N(T ) = |α|. We denote by T 0 some hyperbolic element or a glide reflection in Z Γ (T ). Then the infinite cyclic group depends only on T and not on our choice of T 0 . The sum in Ell(Γ, χ) in (2.3) is over all elliptic conjugate classes in M, and we write θ(T ) for the unique number θ ∈ (0, π 2 ] such that T is conjugate within G to cos θ sin θ − sin θ cos θ . Now we explain the notations appearing in C(Γ, χ) in (2.4). Let be a set of representatives of the cusps of Γ + \H, one from each Γ + -equivalence class. For each j ∈ {1, . . . , κ} we choose N j ∈ G + such that N j (η j ) = ∞ and the stabalizer Γ + η j is We write C Γ,χ for the set of open cusp representatives, viz.

2.2.
Trace formula for Γ 0 (N), χ. Throughout this section we will use the convention that all matrix representatives for elements in G = PGL 2 (R) are taken to have determinant 1 or −1. Let N be an arbitrary positive integer and set Γ + = Γ 0 (N) ⊂ G + . Fix and note that V 2 = 1 2 , the identity matrix, and V Γ + V −1 = Γ + . Hence Γ = Γ ± 0 (N) = Γ + , V ⊂ G is a supergroup of Γ + of index 2. We will use the standard notation ω(N) for the number of primes dividing N.
Let χ be a Dirichlet character modulo N. For any divisor α | N satisfying gcd(α, N/α) = 1, we define for y ≡ α x and y ≡ N/α 1. By the Chinese remainder theorem, such y is uniquely determined modulo N and χ α is a Dirichlet character modulo α. It follows that χ = χ α χ N/α for all such divisors α. For any prime p, we set It follows that χ = p|N χ p (identity of functions on Z); also χ p ≡ 1 for all p ∤ N.
Let us agree to all χ pure if χ p (−1) = 1 for every odd prime p. Note that if χ is even then χ is pure if and only if χ p (−1) = 1 for all primes p. From now on we fix χ to be an even Dirichlet character modulo N, and we set q = cond(χ). We introduce two indicator functions I χ and I q,4 through I χ = I(χ is pure); (2.13) I q,4 = I(p ≡ 4 1 for every prime p | q). (2.14) We view χ as a character on Γ + via This character can be extended in two ways to a character of Γ: either by χ(V ) = 1 or χ(V ) = −1. These extensions are explicitly given by if e p > 0 and s p = 0, 2(e p − 2s p + 1) if e p ≥ 2s p and s p > 0, if p is odd, if e p ≥ 5 and s p = 0, 4(e p − 2s p − 1) if e p ≥ 2s p + 1 and s p ≥ 3, if e 2 = 2 and s 2 < e 2 , 2 if e 2 ≥ 3 and s 2 < e 2 , Finally we define where A t,n [h] is defined in (2.28) and S p (p ep , χ p ; t, n) is given in (2.34) and Lemma 2.8, and , and the area of Γ\H is half as large. By (2.1), we have 2.4. Non-cuspidal contributions NEll + Ell(Γ, χ). The aim of this section is to prove the following proposition.
where d is a fundamental discriminant and ℓ ∈ Z >0 .
The method we use to enumerate the conjugacy classes appearing in these sums is well known, cf., e.g., [Eic56], [Vig80] and [Miy89]. Here we will follow the setup in [Miy89] fairly closely (as was done in [BS07] in the case of N squarefree).
We start by introducing some notations. Set For each n, t ∈ P , we fix one such element T n,t ∈ R. Given n, t ∈ P , we let d and ℓ be the unique integers such that t 2 − 4n = dℓ 2 , ℓ ∈ Z ≥1 and d is a fundamental discriminant (that is d ≡ 4 1, is squarefree and d = 1 or else d ≡ 4 0, d/4 is squarefree and d/4 ≡ 4 1). Then the subalgebra Note that C(T n,t , r) is closed under conjugation by elements in R 1 . We denote by C(T n,t , r)//R 1 = R 1 \C(T n,t , r)/R 1 a set of representatives for the inequivalent R 1 -conjugacy classes in C(T n,t , r). Also for U = ( a b c d ) ∈ C(T n,t , r), we write .
For every f | ℓ, it holds that C(T n,t , r[f ]) ⊂ R and using this one checks that χ (ε) (U) for U ∈ C(T n,t , r[f ]) only depends on the R 1 -conjugacy class of U.
Let h(r[f ]) be the narrow class number for r[f ]. We also define where in the first case ǫ 1 > 1 is the proper fundamental unit in Q( √ d). Following the discussion in [BS07,, we see that NEll(Γ, χ (ε) ) + Ell(Γ, χ (ε) ) can be collected as Remark 2.4. The expression (2.29) would of course look slightly nicer if we did not include the factor "2" in the definition of A t,n [h] (2.28) in the case t 2 − 4n < 0. However our definition makes the final expression slightly simpler.
Lemma 2.5. Let n, t be any integers satisfying √ t 2 − 4n / ∈ Q, and let d, ℓ be the unique integers such that t 2 − 4n = dℓ 2 , ℓ > 0 and d is a fundamental discriminant. Then there exists T ∈ R satisfying det(T ) = n and tr(T ) = t if and only if, for each prime p | N, we have Here e p = ord p (N).
Proof. Such an element T ∈ R exists if and only if there is some a ∈ Z satisfying a(t − a) − n ≡ N 0, and this holds if and only if the same congruence equation is solvable modulo p ep for each prime p | N. The lemma now follows by completing the square in the expression a(t − a) − n, and splitting into the classes 2 | e p and 2 ∤ e p , as well as p = 2 and p > 2.
The R 1 -conjugacy classes in each C(T n,t , r) can be enumerated using a local-to-global principle. Let T = T n,t and r = r[f ] for some f | ℓ. For each prime p, we set which is closed under R × ∞ -conjugation, where we have set R × ∞ = GL + 2 (R). Let us now mildly alter our previous definition of C(T, r)//R 1 (a set of representatives), so as to instead let C(T, r)//R 1 denote the set of R 1 -conjugacy classes in C(T, r). Similarly for By [Miy89, Lemma 6.5.2] (trivially generalized as noted in [BS07]), the map θ is surjective, and in fact θ is exactly h(r)-to-1, where h(r) is the (narrow) class number for r. It remains to understand each factor in the right hand side of (2.31). For v = ∞, we have, as in [Miy89, (6.6.1)], Then by [Miy89, Theorem 6.6.6] 2 , a complete set of representatives for The sets Ω(p e+2ρ ; n, t) and Ω(p e+2ρ+1 ; n, t) are both closed under addition with any element from p e+ρ Z p , and Ω(p e+2ρ ; n, t)/p e+ρ and Ω(p e+2ρ+1 ; n, t)/p e+ρ denote complete sets of representatives for Ω(p e+2ρ ; n, t) mod p e+ρ Z p and Ω(p e+2ρ+1 ; n, t) mod p e+ρ Z p , respectively.
Using the above facts together with χ = p|N χ p and the fact that For p | N with e = ord p (N) and f = ord p (ℓ), set (2.33) S p (p e , χ; t, n) = ξ∈Ω(p e+2f ;n,t)/p e+f Applying (2.35) to (2.29), then by (2.16), In the remainder of this section, we prove Lemma 2.8 and get an explicit formula for S p (p e , χ; t, n). Let us first record the general solution to the congruence equation ξ 2 − tξ + n ≡ 0 modulo a prime power in the following lemma.
Lemma 2.6. Let p be a prime and α a positive integer. Then and 2 ∤ d, or p and t odd, 0 otherwise. and t 2 − 4n = dℓ 2 with d a fundamental discriminant and ℓ ∈ Z.

Applying (2.43) and
β∈{0,1} we get (2.42). and we then write a 1 c 1 ∼ Γ + a 2 c 2 . We fix, once and for all, a set C Γ containing exactly one representative a c satisfying (2.44) for each cusp class, i.e. C Γ = a c : a, c ∈ Z, c ≥ 1, c | N, gcd(a, c) = 1 / ∼ Γ + . We make our choice of C Γ in such a way that (2.45) for every a c ∈ C Γ with gcd(c, N/c) > 2, also −a c ∈ C Γ ; for every c | N with gcd(c, N/c) ≤ 2, 1 c ∈ C Γ . This is possible since a c ∼ Γ + −a c whenever gcd(c, N/c) > 2. Note also that it follows from our choice of C Γ that for every c | N with gcd(c, N/c) ≤ 2, 1 c is the unique cusp in C Γ with denominator c.
For each a c ∈ C Γ , we fix a matrix We make these choices so that W −a/c = −a b c −d for gcd(c, N/c) > 2 and W 1/c = 1 0 c 1 for gcd(c, N/c) ≤ 2 holds for any a c ∈ C Γ (cf. (2.45)). Note that W a/c (∞) = a c , so W −1 a/c ( a c ) = ∞. We also set We then verify that the fixator subgroup of a c in Γ + is the cyclic subgroup generated by T a/c . That is, for the cusp η j = a c , N a/c and T a/c correspond to N j and T j in §2.1.
Lemma 2.9. For any a c ∈ C Γ ,
Proof. This lemma follows from the definition of T a/c in (2.47).
For later use, we prove the following lemma and then compute the set of open cusps. From now on, for each prime p | N, set e p = ord p (N) and s p = ord p (q), where q = cond(χ).
Lemma 2.10. For every x ∈ R, Proof. By the multiplicativity of the Euler ϕ-function, the left hand side of (2.49) becomes a product over primes dividing N: For each prime p | N, the inner sum is Lemma 2.11. The set of open cusps is
Lemma 2.14. Assume that c | N and gcd(c, N/c) ≤ 2. If 4 | N then c 1/c,v = √ N for all v. On the other hand, if 4 ∤ N, then there is some s ∈ {0, 1} (which depends on c and U 1/c ) such that for all v, Proof. For given c and v, following the definition of c 1/c,v in (2.8), we recall that T 1/c,v is a reflection fixing the point 1 c , and that also the other fixpoint of T 1/c,v in ∂H must be a Γ + -cusp, which we call η. We choose where u 1 is an integer satisfying cu 1 ≡ N/c −2; and the two fixpoints in ∂H of the reflection in (2.60) are ∞ and 1 2 (u 1 M N/c + v). Hence But we know from above that the C Γ -representative for the cusp η is 1 c ′ , and one easily verifies that the C Γ -representative of an arbitrary Γ + -cusp α γ with α, γ ∈ Z has denominator gcd N, γ gcd(α,γ) . Hence, letting u 3 := gcd(u 2 , cu 2 + 2) = gcd(u 2 , 2) ∈ {1, 2}, we have c ′ = gcd N, cu 2 + 2 u 3 = 1 u 3 gcd Nu 3 , cu 2 + 2 = N cu 3 gcd cu 3 , cu 2 + 2 N/c .
Combining these, we obtain the formula stated in the lemma.
c|N,gcd(c,N/c)≤2 v∈{0,1} Here Ω 1 (N, q) and ε N are given in ( where the last equality holds by Lemma 2.16 (and its proof). For any prime p | N, let f p = ord p (c). It follows from (2.73) that B = p r holds for some prime p and some r ≥ 1 if and only if min{f p , e p −f p } > e p −s p while min{f p ′ , e p ′ −f p ′ } ≤ e p ′ − s p ′ for every prime p ′ = p. Furthermore, when this holds, we have Hence the expression in (2.72) equals Here the sum over f p equals max{2s p − e p − 1, 0}, and each sum over f p ′ can be evaluated using (2.50) (with x = 0). This leads to the statement of the lemma.

Eisenstein series. Huxley [Hux84] gave explicit expressions (involving Dirichlet
L-functions) for the scattering matrix and its determinant for the congruence subgroups Γ 0 (N), Γ 1 (N) and Γ(N) of the modular group, for arbitrary level N. Note that Γ 0 (N) is conjugate to the group Γ 0 (N) which we consider here. The case of squarefree N had previously been considered in [Hej83,Ch. 11].
Since a c ∈ C Γ,χ , by Lemma 2.11, we have s p ≤ max{e p −f p , f p }. Also gcd(γ, N) = c implies that ord p (γ) ≥ f p with equality unless f p = e p . Now the conditions on α = α(γ, δ) imply

Hence
(2.76) Note that both relations are valid in the special case e p = 2f p . As in [Hux84] we now introduce a family of sums similar to but simpler than (2.75). It will turn out that these sums can be expressed as linear combinations of the Eisenstein series E a/c (z, s, χ) (cf. Lemma 2.19 below), and a key step in computing the scattering matrix will be to invert these linear relations.
Lemma 2.19. For any (m, χ 1 , χ 2 ) ∈ F , we have Proof. For (m, χ 1 , χ 2 ) ∈ F , by [Hux84,p.146(top)], E χ 2 χ 1 (mz, s) can be expressed as Given any g, h, e, f as in this sum, let a and c be the uniquely determined integers such that c = gcd(he, N), a ≡ gcd(c,N/c) −f he c and a c ∈ C Γ . One easily checks that this transformation gives a bijection between the set of tuples Now let (a, c, γ, δ) be any tuple in the above set, with corresponding (g, h, e, f, γ, δ). We then have, for each prime p | N, (2.81) To prove this, first note that if ord p (q 2 ) > ord p (c) then g = m gcd(c,m) ≡ p 0, and thus χ 2,p (g) = 0 so (2.81) holds. Hence from now on we may assume ord p (q 2 ) ≤ ord p (c).
To prove this, assume that a c / ∈ C Γ,χ ; then by Lemma 2.11, there is a prime p | N such that ord p (q) > ord p N gcd(c,N/c) = max{ord p (N/c), ord p (c)}. As noted above, if ord p (q 2 ) > ord p (c) then χ 2,p (g) = 0 and (2.82) holds. On the other hand, if ord p (q 2 ) ≤ ord p (c) then using cond(χχ 2 χ 1 ) = 1 we get ord p (q 1 ) = ord p (q) and since mq 1 | N we have The following lemma gives an explicit enumeration of the set F m . For any c ∈ Z ≥1 , we write X c = {ψ primitive Dirichlet character : cond(ψ) | c} . This set is in one-to-one correspondence with the dual of the group (Z/cZ) × . In particular |X c | = ϕ(c). Recall that q = cond(χ). Let us write Lemma 2.20. Given m | N, the set F m is nonempty if and only if m ∈ G N,q . When this holds, the map is a bijection from F m onto X gcd(m,N/m) . In particular |F m | = ϕ(gcd(m, N/m)).
Proof. By the definition of F , two primitive Dirichlet characters χ 1 and χ 2 satisfy (χ 1 , χ 2 ) ∈ F m if and only if, for every prime p | N, (2.85) s 2 ≤ ord p (m), s 1 ≤ ord p (N/m) and cond(χ p χ 1,p χ 2,p ) = 1, Here s j = ord p (q j ) for j ∈ {1, 2}. Let s = ord p (q). Note that cond(χ p χ 1,p χ 2,p ) = 1 implies that s ≤ max{s 1 , s 2 }. Hence by (2.85), Since this must hold for every p | N, it follows that F m can be nonempty only if m ∈ G N,q . From now on we assume m ∈ G N,q . We will prove that the map in (2.84) is a bijection from F m onto X gcd(m,N/m) . In particular this will imply that F m is non-empty, with |F m | = ϕ(gcd(m, N/m)).
First consider any prime p | N satisfying s ≤ ord p (m) (with s = ord p (q)). For such p, the first and third relations in (2.85) imply s 1 ≤ ord p (m), which together with the second relation in (2.85) implies s 1 ≤ ord p (gcd(m, N/m)). Conversely if χ 1,p is any primitive character with conductor p s 1 subject to s 1 ≤ ord p (gcd(m, N/m)), and if χ 2,p is the unique primitive character satisfying cond(χ p χ 1,p χ 2,p ) = 1, then all the conditions in (2.85) are fulfilled.
Next consider any p | N for which s > ord p (m). Recall that we are assuming m ∈ G N,q ; hence s ≤ max{ord p (m), ord p (N/m)} and so s ≤ ord p (N/m). Then the two last relations in (2.85) together imply s 2 ≤ ord p (N/m), and in combination with the first relation this gives s 2 ≤ ord p (gcd(m, N/m)). Conversely if χ 2,p is any primitive character with conductor p s 2 subject to s 2 ≤ ord p (gcd(m, N/m)), and if χ 1,p is the unique primitive character satisfying cond(χ p χ 1,p χ 2,p ) = 1, then all the conditions in (2.85) are fulfilled.
The above observations imply that the map in (2.84) is indeed a bijection as stated.
It remains to prove the statement (2.98) in the case gcd(m, N/m) ≤ 2. In this case X gcd(m,N/m) consists of the trivial character only, and we see that our task is to prove that p|N,ordp(q)>ordp(m) χ p (−1) = χ α(N,m) (−1). But χ p (−1) = 1 whenever p ∤ q. Hence we are done if we can show that for all primes p Finally assume p = 2 and gcd(m, N/m) = 2. Then ord p (N) ≥ 2, ord p (m) ∈ {1, ord p (N)− 1} and (2.56) implies that ord p (α) = 0 if ord p (m) = ord p (N) − 1, otherwise ord p (α) = ord p (N). Also ord p (q) < ord p (N) since m ∈ G N,q ; and recall that ord p (q) cannot equal to 1 since there is no primitive character modulo 2. From these observations we see that (2.99) holds also when p = 2 and gcd(m, N/m) = 2.
It follows from Lemma 2.23 and Lemma 2.24 that (2.100) In particular M(s) is a square matrix. Proof. Let us fix an ordering F ε such that (m, χ 1 , χ 2 ) comes before (m ′ , χ ′ 1 , χ ′ 2 ) whenever m < m ′ . Giving both the rows and columns of Q(s) this ordering, then Q(s) is lower triangular by definition, and has all diagonal entries equal to one. Therefore det(Q(s)) = 1.
It also follows that det(M(s)) = det(Q(s)M(s)). Now Q(s)M(s) is a square matrix whose rows (respectively columns) are naturally indexed by (m, χ 1 , χ 2 ) ∈ F ε (respectively a c ∈ R Γ,χ ). Let us view Q(s)M(s) as a block matrix, with the blocks indexed by m (row) and c (column). Note that Lemma 2.23 and Lemma 2.24 then show that each diagonal block is a square matrix; furthermore, (2.96) implies that Q(s)M(s) is upper block triangular. Hence, again using (2.96), we see that the determinant is given by the expression in the right hand side of (2.101), for some constant C = c(N, χ) ∈ C.
It also follows that in order to prove C = 0, it suffices to check that for any c ∈ G N,q for which (2.102) R c = a : a c ∈ R Γ,χ is nonempty, the |R c | × |R c |-matrix (χ 2 (a)), with rows indexed by (χ 1 , χ 2 ) ∈ F c and columns indexed by a ∈ R c (recall |F c | = |R c |) has nonvanishing determinant. This is trivial if gcd(c, N/c) ≤ 2 since then R c = {1} (if R c = ∅). Now assume that gcd(c, N/c) > 2, and set t = |F c | = |R c | = 1 2 ϕ(gcd(c, N/c)). Using Lemma 2.20 and Lemma 2.24 we find that by multiplying the columns with appropriate constants of absolute value one, the determinant can be transformed into det(ψ i (g j )) where g 1 , . . . , g t are the elements and ψ 1 , . . . , ψ t are the characters of the Abelian group (Z/ gcd(c, N/c)Z) × /{±1}. Such determinant is nonvanishing, since multiplying the matrix with its conjugate transpose gives t times the t × t identity matrix (cf. [Hux84,p.149 Hence by (2.90), (2.92) and Lemma 2.25, where ω m denotes the trivial Dirichlet character modulo m. We note that for each (m, χ 1 , χ 2 ) ∈ F ε , χ 1 χ 2 ω m is a Dirichlet character modulo mq 1 .
Remark 2.26. By an entirely similar discussion one computes the determinant of the scattering matrix Φ(s) for Γ + , χ . We will not need this formula, but we state it here for possible future reference: (2.104) det(Φ(s)) = (−1) From (2.103) we obtain: We can now evaluate the integral appearing in (2.5): Lemma 2.27.
The proposition will be proved by making the right hand sides in the formulas in Lemma 2.27 and Lemma 2.29 more explicit. We will carry this out in a sequence of lemmas.
Here F p f is given in (2.83).
Proof. Similar to the proof of Lemma 2.20.
Here Ψ 2 is given in (2.18), and √ −1 denotes a square root of −1 in Z/qZ (as exists when I q,4 = 1; and χ( √ −1) is independent of the choice of the square root when I χ = 1).
Proof. Recalling (2.91), we can write Note that F ε 0 = ∅ unless χ is square in the sense that there exists a primitive character χ 1 such that χχ 1 2 (n) = 1 for any n with gcd(n, q) = 1. There exists such a primitive character if and only if for every prime p | N, χ p (−1) = 1, i.e. χ is pure. From now on, we assume that χ is pure. Let

43
Then Note that S ± 0 is multiplicative. One can write For every prime p | N, fix a primitive Dirichlet character ψ p of minimal conductor subject to cond(χ p ψ p 2 ) = 1. We further assume that if p = 2 and s p = 0, s p + 1 if p = 2 and s p ≥ 3, s p if p > 2.
Note that s 2 cannot be 1 or 2. When p is odd, let ξ p be the quadratic character modulo p. When p = 2 let ξ 4 be the quadratic character modulo 4 and ξ 8 be the even quadratic character modulo 8. Then ξ 4 ξ 8 is another quadratic character, and ξ 8 , ξ 4 ξ 8 are the only primitive characters modulo 8.
Note that Ψ 2 appears only when n = 1. But it also occurs in the definition ofΨ 2 when n = −1.
Note thatΨ 2 appears only when n = −1. For p ≡ 4 1, by (3.10), (3.11) and (3.17), we haveΨ min 2 (p e , χ) = 0. Note that Ψ 3 appears only for n = 1.   Hence to show that we obtain the corresponding sum in Theorem 1.7, we have to prove that for each prime p | N, writing now χ in place of χ p , For p odd, using the above formulas together with (3.10) and the fact that Φ new ± = Φ ± when s = e > 0, the desired result (3.18) now follows by a direct computation in each case.
Lemma 4.2. Let ρ : Gal(Q/Q) → GL 2 (C) be a nondihedral, irreducible Artin representation of conductor N, and let χ = p|N χ p be the Dirichlet character associated to det ρ via class field theory. If p | N is a prime such that ord p N ∈ {1, ord p cond(χ)}, then χ p has order 2, 3, 4 or 5. Further, if p and q are two such primes then χ p χ q cannot have order 20.
Proof. Let ρ p denote the restriction of ρ to Gal Q p /Q p . Then ρ p factors through G = Gal(L/Q p ) for some finite extension L/Q p . Let G i , i = 0, 1, 2, . . ., denote the ramification subgroups of G, with G 0 the inertia group. Then ρ p and det ρ p have conductor exponents e = 1 #G 0 i≥0 g∈G i 2 − tr ρ p (g) and s = 1 #G 0 i≥0 g∈G i 1 − det ρ p (g) , respectively. Note that the average of tr ρ p over G i is the number of copies of the trivial representation in ρ p |G i . If this is nonzero then ρ p |G i ∼ = det ρ p |G i ⊕1, from which it follows that the ith terms of the two sums above are the same. If ρ p |G i does not contain the trivial representation then 1 #G i g∈G i 2 − tr ρ p (g) = 2 > 1 ≥ 1 #G i g∈G i 1 − det ρ p (g) .
Thus, the ith term of the formula for e is always ≥ the ith term of the formula for s, with equality if and only if ρ p |G i contains the trivial representation. If e ∈ {1, s} then equality must hold for every term; in particular, ρ p |G 0 contains the trivial representation, so that ρ p |G 0 ∼ = det ρ p |G 0 ⊕ 1. When e = 1, this in turn implies that s = 1, so det ρ p |G 0 is nontrivial. Letρ p denote the composition of ρ p with the canonical projection GL(2, C) → PGL(2, C). Then when e ∈ {1, s}, the natural maps ρ p (G 0 ) → det ρ p (G 0 ) and ρ p (G 0 ) →ρ p (G 0 ) are isomorphisms. Since det ρ p (G 0 ) is a nontrivial cyclic subgroup of C × andρ p (G 0 ) is a subgroup of A 4 , S 4 or A 5 , it follows that det ρ p (G 0 ) ∼ =ρ p (G 0 ) is cyclic of order 2, 3, 4 or 5. Since the Dirichlet character χ p associated to det ρ p is determined by det ρ p |G 0 , they have the same order, which implies the first claim.
In the A 5 case, we may also take advantage of the fact that icosahedral representations occur in Galois-conjugate pairs that are not twist equivalent. Thus, assuming Artin's conjecture, we can still rule out the existence of an icosahedral representation of a given conductor when our computation accommodates one representation (in total over all characters, modulo twist equivalence) but not two. We used this trick to rule out icosahedral representations with conductor N ∈ {2221, 2341, 2381, 2529, 2799}.
We apply the trace formula to compute these, and then minimize Q χ,ǫ with respect to the constraint M −1 j=0 x j = 1. In every case, it turned out that the criterion from [BS07, §4.3] applied, so that the optimal test function h satisfied h(r) ≥ 1 for r ∈ iR. As explained in [BS07, §3.4], every non-CM form occurs with multiplicity m χ . Thus, since the CM forms satisfy Selberg's conjecture, 3 whenever the resulting minimal value of Q χ,ǫ is less than 1, we deduce both the Selberg conjecture and the completeness of the list of nondihedral Artin representations for twist-minimal forms of character χ.
To ensure the accuracy of our numerical computations, we used the interval arithmetic library Arb [Joh17] throughout. To handle the integral terms of the trace formula, for each basis function we first computed ∞ 0 g ′ (u) log u du symbolically, which allowed us to replace log(sinh(u/2)) and log(tanh(u/4)) by the real-analytic functions log(sinh(u/2)/u) and log(tanh(u/4)/u), respectively. Thus, in every integral term, the integrand agrees with an analytic function on each interval [jδ, (j + 1)δ]. After applying a suitable affine transformation to replace the interval by [−1, 1], we use the following rigorous numerical quadrature estimate of Molin [Mol10]: where h = log(5n)/n, a k = h cosh(kh) cosh 2 (sinh(kh)) and x k = tanh(sinh(kh)). Note that the error term decays exponentially in n/ log n. To obtain a bound for |f | on ∂D, we write ∂D = n−1 j=0 {2e(θ) : θ ∈ [j/n, (j + 1)/n)} and use interval arithmetic to bound |f (2e(θ))| on each segment.
Using the algorithm from [BBJ18], we computed the class numbers of Q( √ t 2 ± 4) for all t ≤ e 20 , which enables us to take X as large as 40 in the above. Taking M = 200, various X ≤ 40 and χ as indicated by Lemmas 4.1 and 4.2 sufficed to prove Theorems 1.1 and 1.2.