A symplectic restriction problem

We investigate the norm of a degree 2 Siegel modular form of asymptotically large weight whose argument is restricted to the 3-dimensional subspace of its imaginary part. On average over Saito-Kurokawa lifts an asymptotic formula is established that is consistent with the mass equidistribution conjecture on the Siegel upper half space as well as the Lindelof hypothesis for the corresponding Koecher-Maass series. The ingredients include a new relative trace formula for pairs of Heegner periods.

1. Introduction 1.1. Restriction norm of eigenfunctions. The question, 'to what extent can the mass of a Laplace eigenfunction φ on a Riemannian manifold X localize?', is a classical problem in analysis and is often quantified by upper (or lower) bounds for L p -bounds for the restriction of φ to suitable submanifolds Y ⊆ X. The prototypical example is the case where X is a surface and Y is a curve, often a geodesic; see e.g. [B,BGT,CS,GRS,Ma2,R1,R2] and references therein.
If X is the quotient of a symmetric space by an arithmetic lattice (often called an arithmetic manifold), an additional layer of number theoretic structure enters. Not only can this be used to obtain stronger bounds [Ma1], but sometimes the period integrals can be expressed in terms of special values of L-functions. A typical such case is the L 2 -restriction of a Maaß form for the group SL n+1 (Z) to its upper left n-by-n block, which can be expressed as an average of central values of GL(n) × GL(n + 1) Rankin-Selberg L-functions [LY, LLY]. Other potential cases arise from the Gross-Prasad conjecture [II]. Often in this context, optimal restriction norm bounds are equivalent to the Lindelöf conjecture on average over the spectral family of L-functions in question.
In this paper we consider certain Siegel modular forms F for the symplectic group Sp 4 (Z): we investigate the L 2 -restriction of a Saito-Kurokawa lift F (Z) on the 6-dimensional Siegel upper half space H (2) to the 3-dimensional subspace where the argument Z = X + iY is restricted to its imaginary part. This is a very natural set-up, it is a direct higher-dimensional analogue of the classical problem of bounding a cusp form f for SL 2 (Z) on the vertical geodesic, mentioned at the beginning; cf. [BKY,Section 7]. While the latter leads, via Hecke's integral representation, directly to the corresponding L-function L(f, s), things become much more involved for Siegel modular forms.
We start by stating the corresponding period formula. For an even positive integer k let S (2) k denote the space of Siegel modular forms of degree 2 of weight k for the group Sp 4 (Z), equipped with the standard Petersson inner product; see Section 2. We think of k as tending to infinity and are interested in asymptotic results with respect to k. We restrict the argument of a cusp form F ∈ S (2) k to its imaginary part iY with Y ∈ P(R) where P(R), equipped with the measure dY /(det Y ) 3/2 , is the set of positive definite symmetric 2-by-2 matrices. Consider the restriction norm where SL 2 (Z) acts on P(R) by γ → γ ⊤ Y γ. Letting H denote the usual upper half plane, we observe that SL 2 (Z)\P(R) ∼ = SL 2 (Z)\H × R >0 has infinite measure; see (6.1) below. The factor π 2 90 = 3 π · π 3 270 = vol(Sp 4 (Z)\H (2) ) vol(SL 2 (Z)\H) accounts for the fact that, in accordance with the literature, we choose the standard measures on Sp 4 (Z)\H (2) and SL 2 (Z)\H which are not probability measures. Let Λ denote a set of spectral components of L 2 (SL 2 (Z)\H) consisting of the constant function 3/π, an orthonormal basis of Hecke-Maaß cusp forms and the Eisenstein series E(., 1/2 + it) for t ∈ R. The set Λ is equipped with the counting measure on its discrete part and with the measure dt/4π on its continuous part. We denote by Λ the corresponding combined sum/integral. For F ∈ S (2) k and u ∈ Λ let L(F × u, s) denote the Koecher-Maaß series defined in (6.3). This series has a functional equation featuring the gamma factors G(F × u, s) as defined in (6.4), but has no Euler product. The following proposition is proved in Section 6.

Proposition 1. For F ∈ S
(2) k with even k we have where Λ ev denotes the set of all even u ∈ Λ.
An interesting subfamily of Siegel modular forms are the Saito-Kurokawa lifts F h (sometimes called the Maaß Spezialschar ) of half-integral weight modular forms h ∈ S + k−1/2 (4) in Kohnen's plus-space or equivalently their Shimura lifts f h ∈ S 2k−2 (see Section 2 for details). In this case, the Koecher-Maaß series L(F h × u, s) roughly becomes a Rankin-Selberg L-function of two half-integral weight cusp forms, namely of h and the weight 1/2 automorphic form whose Shimura lift equals u; see Proposition 16 below and cf. [DIm]. Of course, this series also has no Euler product. The convexity bound for L-functions along with trivial bounds implies would follow from the Lindelöf hypothesis for these L-functions. It should be noted, however, that in absence of an Euler product it is not expected that these L-functions satisfy the Riemann hypothesis, but one may still hope that the Lindelöf hypothesis is true; see [Kim] for some support of this conjecture. However, even if it is, then proving (1.2) appears to be far out of reach by current technology -it corresponds to an average of size k 3/2 of a family of L-functions of conductor k 8 . This is analogous to the genus 1 situation in which the L 2 -restriction norm of a holomorphic cusp form of weight k leads to an average of size k 1/2 of a family of L-functions of conductor k 4 ; see [BKY,(1.12)]. These problems belong to the hard cases where sharp bounds for the L 2 -restriction norm imply very strong subconvexity bounds. A different symplectic restriction problem was treated in [LiuY] and [BKY], where the argument Z ∈ H (2) of Saito-Kurokawa lifts was restricted to the diagonal, a four-dimensional subspace of H (2) . The corresponding analogue of Proposition 1, due to Ichino [Ic], leads to an average of size k of L-functions of conductor k 4 .
1.2. The main result and mass equidistribution in higher rank. Fix a smooth, non-negative test function W with non-empty support in [1,2]. Let ω := 2 1 W (x)x dx and consider for a large parameter K and a Hecke eigenbasis B + k−1/2 (4) of S + k−1/2 (4). Note that dim S + k−1/2 (4) ∼ k/6. The first main result of this paper is the following asymptotic formula.
This may be interpreted as an average version of the Lindelöf hypothesis for twisted Koecher-Maaß series. This restriction problem, however, is structurally quite different from all previously considered restriction problems with connections to L-functions, as the period formula features Lfunctions that are not in the Selberg class and the restriction norm does not remain bounded.
More importantly, there is a strong connection between Theorem 2 and the mass equidistribution conjecture that we now explain. Let g be a test function on Sp 4 (Z)\H (2) . Then the (arithmetic) mass equidistribution conjecture for the Siegel upper half space states that 1 as F traverses a sequence of Hecke-Siegel cusp forms of growing weight. While the corresponding statement for classical cusp forms of degree 1 was proved by Holowinsky and Soundararajan [HS], no such statement has been obtained for Siegel modular forms of higher degree (but see [SV] for certain cases of the quantum unique ergodicity conjecture in higher rank). Nevertheless, one may even go one step further and conjecture that the above limit holds when one restricts the full space Sp 4 (Z)\H (2) to a submanifold. In particular, one might conjecture that vol(Sp 4 (Z)\H (2) ) F 2 dY (det Y ) 3/2 holds. As the right hand side has infinite measure, we cannot simply replace g with the constant function. This is precisely the reason why N av (K) is unbounded as K → ∞. However, since F is a cusp form, the L 2 -normalized and Sp 4 (Z)-invariant function |F (iY )| 2 (det Y ) k / F 2 decays exponentially quickly if Y is (in a precise sense) very large or very small. So effectively g may be restricted to the characteristic function of a compact set depending on k. We quantify this in Appendix C and show that, for such g, the right hand side equals vol(SL 2 (Z)\H) · 4 log k + O(1).
In this case the previous asymptotic reads (1.4) N (F ) ∼ 4 log k as k → ∞. The asymptotic (1.4) is, of course, highly conjectural, and as mentioned above even the ordinary mass equidistribution conjecture (without restricting to a thin subset) is currently out of reach. Theorem 2 provides an unconditional proof of (1.4) on average over Saito-Kurokawa lifts in agreement with the mass equidistribution conjecture. In particular, the constant 4 in Theorem 2 is very relevant, and this constant has a story of its own. It is the outcome of several archimedean integrals, numerical values in period formulae and a gigantic Euler product whose special value can be expressed in terms of zeta values (cf. (12.8)). In deducing its value we have corrected several numerical constants in the literature. We shall come back to this point in due course; see for instance the remark after Lemma 8. The authors would like to thank Gergely Harcos for useful and clarifying discussions in this respect. Theorem 2 opens the door for several other related problems. The reader may wonder what happens for generic, i.e. non-CAP Siegel modular forms. Any reasonable spectral average would include at least the space of Siegel modular forms S (2) k of weight k which is of dimension ∼ ck 3 for some constant c (in fact c = 1/8640). This leads to a bigger average than the one presently considered over about k 2 Saito-Kurokawa lifts. The starting point for the L 2 -restriction norm of generic Siegel modular forms is again the period formula in Proposition 1. Coupled with an approximate functional equation (as in Lemma 17), this is amenable to the Kitaoka-Petersson formula [Kit] and an analysis along the lines of [Bl2]. We hope to return to this interesting problem soon.
Whilst the proof of Theorem 2 rests on many ingredients, to which we address in detail in the coming sections, there are a few highlights which may be of stand alone interest. We describe these in the remainder of the introduction.
1.3. A relative trace formula for pairs of Heegner periods. Here we focus on a novel trace formula of independent interest beyond its application in proving Theorem 2. Let D be a discriminant, i.e. a non-square integer ≡ 0, 1 (mod 4). For a discriminant D < 0 let H D ⊆ SL 2 (Z)\H denote the set of all Heegner points; that is, the set of all z = ( |D|i − B)/(2A) where AX 2 + BXY + CY 2 is a Γ-equivalence class of integral quadratic forms of discriminant D = B 2 − 4AC. For a function f : SL 2 (Z)\H → C define the period where ǫ(z) ∈ {1, 2, 3} is the order of the stabilizer of z in PSL 2 (Z). Its counterparts for positive discriminants D are periods over geodesic cycles. These periods are classical objects with myriad interwoven connections to half-integral weight modular forms, base change L-functions, quadratic fields and quadratic forms. An interesting special case is the constant function f = 1 in which case P (D; 1) = H(D) is, by definition, the Hurwitz class number. With applications to the above mentioned symplectic restriction problem in mind, we are interested in pairs of Heegner periods in the spectral average Λev P (D 1 ; u)P (D 2 ; u)h(t u )du for a suitable test function h and two discriminants D 1 , D 2 < 0. While pairs of geodesics have been studied in a few situations [Pi1,Pi2,MMW], to the best of our knowledge, nothing seems to be known about spectral averages of pairs of Heegner periods. Opening the sums in the definition of P (D 1 ; u) and P (D 2 ; u), this can be expressed as a double sum of an automorphic kernel z1∈HD 1 z2∈HD 2 1 ǫ(z 1 )ǫ(z 2 ) γ∈Γ k(z 1 , γz 2 ) in the usual notation which resembles the set-up of a relative trace formula. However, the standard methods in this situation (e.g. [Go]) do not easily apply here as the stabilizers of z 1 and z 2 are essentially trivial. We thus take a different approach to establish the following relative trace formula for which we need some notation. For n > 0 and t ∈ R let where J it (x) is the Bessel function. Finally, for κ ∈ Z + 1/2, n, m ∈ Z and c ∈ N define the modified Kloosterman sums Note that K + κ (n, m, c) is symmetric in m and n and 2-periodic in κ. They satisfy the Weil-type bound (1.9) K + κ (m, n, c) ≪ c 1/2+ε (m, n, c) 1/2 , see e.g. [Wa,Lemma 4] in the case n = m, the general case being analogous. In order to simplify the notation we assume that D 1 , D 2 are fundamental discriminants. In Section 7 we state the general version for arbitrary negative discriminants.
Theorem 3. Let ∆ 1 , ∆ 2 be negative fundamental discriminants and let h be an even function, holomorphic in |ℑt| < 2/3 with h(t) ≪ (1 + |t|) −10 . Then The experienced reader will spot the strategy of the proof from the shape of the formula: A Katok-Sarnak-type formula translates P (∆; u) into a product of a first and a ∆-th half-integral weight Fourier coefficient. In this way, a pair of two Heegner periods becomes a product of four halfintegral weight Fourier coefficients. A quadrilinear form of half-integral weight Fourier coefficients is not directly amenable to any known spectral summation formula, but we can use a Waldspurgertype formula a second time, now in the other direction, to translate the two first coefficients into a central L-value. This L-value can be written explicitly as a sum of Hecke eigenvalues by an approximate functional equation. We can now use the correspondence between half-integral and integral weight forms a third time, namely by combining the Hecke eigenvalues into the half-integral weight coefficients by means of metaplectic Hecke relations. Finally, the Kuznetsov formula for the Kohnen plus space provides the desired geometric evaluation of the relative trace. This particular version of the Kuznetsov formula is also new and will be stated and proved in Section 5.
1.4. Mean values of L-functions. We highlight another ingredient of independent interest. This is a hybrid Lindelöf-on-average bound for central values of twisted L-functions, its proof is deferred to Section 8.
(a) We have where the sum is over an orthonormal basis of Hecke-Maaß cusp forms u with spectral parameter t u , and α(u) is any sequence of complex numbers, indexed by Maaß forms.

to conclude
Corollary 5. For T , D 1 and ε > 0 we have where the first sum runs over a basis of Hecke-Maaß cusp forms u with spectral parameter t u T .
Again this bound is completely uniform and best-possible in the D and T aspect. We give another interpretation of Proposition 4(a). For odd u, the root number of L(u × χ ∆ , s) is −1 (see [BFKMMS,Lemma 2.1]), so the central value vanishes. For even u the central L-values L(u × χ ∆ , 1/2), as in (4.9) below, are proportional to squares of Fourier coefficients b v (∆) of weight 1/2 Maaß forms v in Kohnen's subspace for Γ 0 (4), normalized as in (3.7). We refer to Section 3 for the relevant definitions. In particular, for the usual choice of the Whittaker function the normalized Fourier coefficientb v (∆) = e −π|tv|/2 |t v | sgn(∆)/4 |∆| 1/2 b v (∆) is of size one on average. In this way we conclude bounds for linear forms in half-integral weight Rankin-Selberg coefficients: (1.10) where the v-sum runs over an L 2 -normalized Hecke eigenbasis of non-exceptional weight 1/2 Maaß forms in Kohnen's subspace for Γ 0 (4) with spectral parameter t v . We refer to the remark after the proof of Lemma 8 for more details.
1.5. Organization of the paper. Section 2 -5 prepare the stage and compile all necessary automorphic information. New results include versions of the half-integral Kuznetsov formula and a Voronoi formula for Hurwitz class numbers. Proposition 1, Theorem 3, and Proposition 4 are proved in Sections 6, 7, 8 respectively. This is followed by an interlude on the analysis of oscillatory integrals.
In the remainder we complete the proof of Theorem 2. In Section 10 we first prove an upper bound N av (K) ≪ K ε by a preliminary argument. This will be useful to control certain auxiliary variables and error terms later. Due to several applications of certain spectral summation formulae, we have various diagonal and off-diagonal terms. Section 12 treats the total diagonal term that extracts the leading term 4 log K in Theorem 2. Sections 13 and 14 deal with the diagonal off-diagonal and the off-off-diagonal term.
We call an integer D ∈ Z \ {0} a discriminant if D ≡ 0 or 1 (mod 4). Every discriminant D can uniquely be written as D = ∆f 2 for some f ∈ N and some fundamental discriminant ∆ (possibly ∆ = 1). For each discriminant D, the map χ D is a quadratic character of modulus |D| that is induced by the character χ ∆ corresponding to the field Q( √ ∆). (If ∆ = 1, then χ ∆ is the trivial character.) Throughout, the letters D and ∆ are always reserved for discriminants resp. fundamental discriminants, usually negative.
The letter Γ is used for the gamma function and also for the group Γ = SL 2 (Z); confusion will not arise. We write Γ = PSL 2 (Z).
For a, b ∈ N we write a | b ∞ to mean that all prime divisors of a divide b. We also write (a, b ∞ ) = a/a 1 where a 1 is the largest divisor of a that is coprime to b. We use the usual exponential notation e(z) := e 2πiz for z ∈ C. The letter ε denotes an arbitrarily small positive constant, not necessarily the same at every occurrence. The Kronecker symbol δ S takes the value 1 if the statement S is true and 0 otherwise. The notation (σ) denotes a complex contour integral over the vertical line with real part σ. We use the usual Vinogradov symbols ≪ and ≫, and we use ≍ to mean both ≪ and ≫. We always assume that the number K in Theorem 2 is sufficiently large.

Holomorphic forms of degree one and two
For a positive integer k let S + k−1/2 (4) denote Kohnen's plus [Ko1] space of holomorphic cusp forms of weight k − 1/2 and level 4. These have a Fourier expansion of the form and form a finite-dimensional Hilbert space with the inner product This space is isomorphic (as a module of the Hecke algebra) to the space S 2k−2 of holomorphic cusp forms of weight 2k − 2 and level 1 [Ko1,Theorem 1]. We denote by f h ∈ S 2k−2 the (unique up to scaling) image of a newform h ∈ S + k−1/2 (4). The Hecke algebra on S + k−1/2 is generated by the operators T (p 2 ), p prime, and for p = 2 we follow Kohnen's definition [Ko1,p. 250] of T (4) that allows a uniform treatment of all primes including p = 2. If λ(p) are the Hecke eigenvalues of f h (normalized so that the Deligne's bound reads |λ(p)| 2), then for all primes p with the convention c h (x) = 0 for x ∈ {n ∈ N | (−1) k n ≡ 0, 3 (mod 4)}. Iterating this formula gives The space S + k−1/2 (4) can be characterized as an eigenspace of a certain operator acting on the space S k−1/2 (4) of all holomorphic cusp forms of weight k − 1/2 and level 4 [Ko1, Proposition 2]. It possesses Poincaré series P + n ∈ S + k−1/2 (4) satisfying the usual relation [Ko2,(4)] for all (−1) k n ≡ 0, 3 (mod 4) and all h ∈ S + k−1/2 (4) with Fourier expansion (2.1). These Poincaré series are the orthogonal projections of the Poincaré series P n ∈ S k−1/2 (4) onto S + k−1/2 (4) and their Fourier coefficients are computed explicitly in [Ko2,Proposition 4]. This gives us the following Petersson formula for Kohnen's plus space.
Lemma 6. Let k 3 be an integer, κ = k − 1/2. Let {h j } be an orthogonal basis of S + κ (4) with Fourier coefficients c j (n) as in (2.1). Let n, m be positive integers with (−1) k n, (−1) k m ≡ 0, 3 (mod 4). Then For a positive integer k we denote by S (2) k the space of Siegel cusp forms of degree 2 of weight k for the symplectic group Sp 4 (Z) with Fourier expansion for Z = X + iY ∈ H (2) on the Siegel upper half plane, where P(Z) is the set of symmetric, positive definite 2-by-2 matrices with integral diagonal elements and half-integral off-diagonal elements. This is a finite-dimensional Hilbert space with respect to the inner product The norm F 2 2 can be expressed in terms of the adjoint L-function at s = 1, a connection that has only very recently been proved by Chen and Ichino [ChIc]. There is a special family of Siegel cusp forms that are derived from elliptic cusp forms (Saito-Kurokawa lifts or Maaß Spezialschar). Let k be an even positive integer. Let h ∈ S + k−1/2 (4) be a Hecke eigenform of weight k − 1/2 with Fourier expansion as in (2.1), and let f h ∈ S 2k−2 denote the corresponding Shimura lift. The Saito-Kurokawa lift associates to h (or f h ) a Siegel cusp form F h of weight k for Sp 4 (Z) with Fourier expansion (2.4), where (2.5) a(T ) = d|(n,r,m) d k−1 c 4 det T d 2 , T = n r/2 r/2 m ∈ P(Z), see e.g. [EZ,§6]. If L(f h , s) is the standard L-function of f h (normalized so that the functional equation sends s to 1 − s), then the norms of F h and h are related by ( [KoSk,p. 551], [Br,Lemma 4.2 & 5.2 Remarks: 1) Note that the formula three lines after (4) in [KoSk] is off by a factor of 2.
2) This inner product relation was generalized to Ikeda lifts in [KK].
3) For future reference we note that for ℜs > 1 we have if λ(n) denotes the n-th Hecke eigenvalue of f h .

Non-holomorphic automorphic forms
We recall the spectral decomposition of L 2 (Γ\H) with Γ = SL 2 (Z), consisting of the constant function u 0 = 3/π, a countable orthonormal basis {u j , j = 1, 2, . . .} of Hecke-Maaß cusp forms and Eisenstein series E(., 1/2 + it), t ∈ R. As in the introduction we call the collection of these functions Λ and the subset of even members Λ ev , and we write Λ resp. Λev for the corresponding spectral averages. We also introduce the notation For t ∈ R let U ev t denote the space of even weight zero Maaß cusp forms for Γ with Laplacian eigenvalue 1/4 + t 2 . It is equipped with the inner product We write the Fourier expansion as with a(−n) = a(n), where W 0,it (4πy) = 2y 1/2 K it (2πy) is the Whittaker function. The Hecke operators T (n), normalized as in [KaSa,(1.1)], act on U ev t as a commutative family of normal operators. We call t = t u the spectral parameter of u. The Eisenstein series and an eigenfunction of the Laplacian with eigenvalue s(1 − s). We call (s − 1/2)/i the spectral parameter of E(., s). If u is an Eisenstein series or a Hecke-Maaß cusp form with Hecke eigenvalues λ u (n) we define the corresponding L-function L(u, s) = n λ u (n)n −s . In particular If u ∈ U ev t is a cuspidal Hecke eigenform with eigenvalues λ(n), then n 1/2 a(n) = a(1)λ(|n|), and by Rankin-Selberg theory (and [GR,6.576.4 |λ(n)| 2 |n| s π 1/2 Γ(s/2)Γ(s/2 − it)Γ(s/2 + it) (2π) s Γ((1 + s)/2) = 2|a(1)| 2 L(sym 2 u, 1) cosh(πt) . (3.4) We recall the Kuznetsov formula [Ku] and combine directly the "same sign" and the "opposite sign" formula to obtain a version for the even part of the spectrum. The conversion between Hecke eigenvalues and Fourier coefficients in the cuspidal case follows from (3.4).
Lemma 7. Let n, m ∈ N. Let h be an even holomorphic function in |ℑt| 1 Note that the measure du is dt/4π in the Eisenstein case which explains the factor 1/2 in the definition of L(E(., 1/2 + it)). 2 with the obvious interpretation in (3.5) for t = 0 We turn to half-integral weight forms. Let V + t (4) denote the ("Kohnen") space of weight 1/2 Maaß cusp forms for Γ 0 (4) with eigenvalue 1/4 + t 2 with respect to the weight 1/2 Laplacian and Fourier expansion The congruence condition on the indices can be encoded in an eigenvalue equation: the functions v ∈ V + t (4) are invariant under the operator L defined in [KaSa,(0.7), (0.8)], cf. also [Bi1,(A.1)]. The space V + t (4) is a finite-dimensional Hilbert space with respect to the inner product The Hecke operators T (p 2 ), p prime, act on V + t (4) as a commutative family of normal operators that commute with the weight 1/2 Laplacian (again we use Kohnen's modification for T (4) in order to treat all primes uniformly). Explicitly, if T (p 2 )v = λ(p)v, then (see [KaSa,(1.3)]) the Fourier coefficients of v satisfy for all primes p and all n ∈ Z \ {0} with n ≡ 0, 1 (mod 4) with the convention b(x) = 0 for x ∈ Z. If v ∈ V + t (4) is an eigenfunction of all Hecke operators T (p 2 ) with eigenvalues λ(p), the relation (3.9) can be captured in the identity for a fundamental discriminant ∆. Extending λ(p) to all n by the usual Hecke relations, we see that the denominator is just ν λ(p ν )p −νs , so that for a fundamental discriminant ∆ and f ∈ N.

Period formulae
Let v ∈ V + t (4). Katok and Sarnak proved in [KaSa,Proposition 4.1] that there is a linear map (a theta lift) S sending v to a non-zero element in U ev 2t if b(1) = 0 and to 0 otherwise. A calculation [KaSa, shows that if v is an eigenform of T (p 2 ), then S v is an eigenform of T (p) with the same eigenvalue, and this computation works verbatim for p = 2, too. Conversely, given an eigenform u ∈ U ev 2t with Hecke eigenvalues λ(p), by [BM2, Theorem 1.2] 3 there is a unique (up to scaling) v ∈ V + t (4) having eigenvalues λ(p) for T (p 2 ), p > 2, (and then automatically also for T (4), since T (4) commutes with the other operators) which may or may not satisfy b(1) = 0. In particular, for a given eigenform u ∈ U ev 2t there is at most one eigenform v ∈ V + t (up to scaling) with S v = u ∈ U ev 2t . If it exists, we normalize it to be L 2 -normalized and denote its Fourier coefficients b(n) as in 4 (3.7). If no such v exists, we define b(n) to be 0.
If u is a Hecke-Maaß cusp form or an Eisenstein series, the absolute square of the periods P (D; u) can be expressed in terms of central L-functions. We introduce the relevant notation. For a discriminant D = ∆f 2 with a fundamental discriminant ∆ let With ρ s as in (3.2) we can re-write this as Since ρ s = ρ 1−s , we see that L(D, s) satisfies the same type of functional equation as L(∆, s) namely The key point is that as one can check by a formal computation with Euler products using the Hecke relation for the eigenvalues λ u (which are identical for Maaß forms and Eisenstein series), see [KZ,. For later purposes we record the simple bound uniformly in ∆ and u, which follows from the Kim-Sarnak bound with 2 · 7/64 < 1/3. From (4.2), the fact that |L(χ ∆ , 1/2 + it)| 2 = L(E(., 1/2 + it), ∆, 1/2) and (4.5) we have (4.7) The next key lemma expresses the periods P (D; u) defined in (1.5) for cusp forms u as half-integral weight Fourier coefficients, and then their squares as L-functions. The first formula (4.8) is essentially a formula of Katok-Sarnak [KaSa,(0.16) & (0.19)], the passage from squares of metaplectic Fourier coefficients to L-functions in (4.9) is a Kohnen-Zagier type formula of Theorem 1.4]. The combination (4.10) of these two is a special case of a formula of Zhang [Zh1,Theorem 1.3.2] or [Zh2,Theorem 7.1], derived independently by a different method.
Remark: The exact shape of these formulas is an unexpectedly subtle matter, and the attentive reader might well be confused by the various and slightly contradictory versions in the literature. There are at least four sources of possible conflict: • the Whittaker functions can be normalized in different ways; • the inner products can be normalized in different ways; • the translation from adelic language to classical can cause problems; • there can be ambiguities related to the groups GL(2) vs. SL(2) vs. PSL(2).
The Katok-Sarnak formula exists in the literature with proofs given in at least in three different versions: [KaSa,(0.16)], [Bi2,Theorem A1] and [DIT,Theorem 4]. The original version of Katok-Sarnak was carefully revised by Biró, but the latter seems to be still off by a factor 2 compared to the version in Duke-Imamoglu-Toth, which was checked numerically. The Baruch-Mao formula [BM2,Theorem 1.4] is quoted in [DIT,(5.17)] with an additional factor 2. Zhang's result [Zh2,Theorem 7.1] (and also the remark after [Zh1,Theorem 1.3.2], the theorem itself being correct) is missing the stabilizer ǫ(z) in the period P (D; u). This formula is slightly incorrectly reproduced in [LMY] and several follow-up papers, based on a different normalization of the Whittaker function. Finally, neither combination of one of the three Katok-Sarnak formulae with the Baruch-Mao formula in [BM2,Theorem 1.4] coincides with Zhang's formula.
We therefore feel that these beautiful and important results should be stated with correct constants and normalizations. For the proof of Theorem 2 and its connection to the mass equidistribution conjecture this is absolutely crucial. As [DIT,Theorem 4] was checked numerically by the authors, we follow their version of the Katok-Sarnak formula. This gives (4.8). We verified and confirmed the constant in Zhang's formula independently by proving an averaged version in Appendix A. This gives (4.10). By backwards engineering, we established the numerical constant in the Baruch-Mao formula, which gives (4.9) and coincides with [DIT,(5.17)].
Note that (4.10) is essentially universal: the right hand side of (4.10) is independent of any normalization, the left hand side depends only on the normalization of the inner product (3.1) which is standard.
Proof. We start with the formula [KaSa,(0.16)] for a general discriminant D < 0, but use the numerical constants as in [DIT,Theorem 4] (proved only for fundamental discriminants there). This formula expresses P (D; u) for an arbitrary discriminant D < 0 as a sum over Fourier coefficients of all v with S v = u. By the above remarks, there is at most one such v. If there is none, then both sides of (4.8) and (4.10) vanish by [KaSa,(0.16), (0.19)] and our convention that b(n) = 0 in this case, and there is nothing to prove. Also note that the left hand side of (4.8) and both sides of (4.10) are independent of the normalization of u, so without loss of generality we may assume that u is Hecke-normalized as in [KaSa]. We obtain Next we insert [KaSa,(0.19)] (again keeping in mind the different normalization of (3.8) and observing that this is coincides with the numerically checked version of [DIT,Theorem 4]) getting (4.8).
If D is a fundamental discriminant, then (4.9) follows from [DIT,(5.17)] together with (3.4) with a(1) = 1 and 2t in place of t. By (3.10) and (4.5) this remains true for arbitrary discriminants. The formula (4.10) is a direct consequence of (4.8), (4.9) and well-known properties of the gamma function, and was proved independently by Zhang [Zh1,Theorem 1.3.2].

Remark:
The argument at the beginning of this proof shows that the u-sum in Proposition 4(a), up to terms of size 0, can be replaced with the v-sum in (1.10), using (4.9). This completes the proof of (1.10).
A similar result holds for Eisenstein series. If aX 2 + bXY + cY 2 is an integral quadratic form of where ζ(D, s) is defined 5 in [Za,(6)]. By [Za,Proposition 3 iii] (or [DIT,Theorem 3]) we obtain the following lemma in analogy to Lemma 8.
and hence Remarks: 1) The second formula follows from the first by (3.3) and (4.7).
2) Here the verification of the numerical constants is much easier than in the cuspidal case. Taking residues at s = 1 in (4.11) for a fundamental discriminant ∆ < 0 returns the class number formula for Q( √ ∆), which confirms the numerical constants. 3) For future reference we recall the standard bounds for ε > 0. This is in particular relevant to obtain upper bounds in (4.12) and (4.10).
We close this section by stating a standard approximate functional equation [IK,Theorem 5.3] for the L-functions occurring in the previous period formulae. For u ∈ U ev t and a fundamental discriminant ∆ (possibly ∆ = 1) we have (4.14) Note that W t depends on ∆ only in terms of its sign. If we want to emphasize this we write W + t and W − t with ± = sgn(∆).
5 Note that Zagier defines Γ = PSL 2 (Z), so his definition of equivalence coincides with ours. The quotient by {±1} in the u, v-sum is not spelled out explicitly in [Za,(6)], but implicitly used in the proof of [Za, Proposition 3] on p.

Half-integral weight summation formulae
In this section we compile the Voronoi summation and the Kuznetsov formula for half-integral weight forms. 5.1. Voronoi summation. As before let be a Maaß form of weight k ∈ {1/2, 3/2} and spectral parameter t for Γ 0 (4) with respect to the usual theta multiplier. We start with the Voronoi summation formula [By,Theorem 3].
with ǫ a as in (1.8).
The proof of the Voronoi formula (Lemma 10) follows from a certain vector-valued functional equation satisfied by the L-functions with coefficients b(±n)e(±an/c). The same functional equation holds if v is not cuspidal (this is clear from general principles and worked out explicitly in [DG] along the same lines), but in this case the L-functions are not entire; they have various poles. We use this observation for two non-cuspidal modular forms. The first is a half-integral weight Eisenstein series which transforms under Γ 0 (4) as a weight 1/2 automorphic form with theta multiplier; see [DIT,p. 964]. As usual, D runs over all discriminants. The other is Zagier's weight 3/2 Eisenstein series 7
For t = 0 one combines the ±-terms and takes the limit as t → 0. In our application, the values R ǫ (t, a/c) are irrelevant (as long as they are polynomial in c and t) since we apply the formula with a function φ that oscillates much more strongly that x ±it so that the integral is negligible.
We obtain a similar summation formula for Hurwitz class numbers. Although we do not need it for the present result, we compute in Appendix B the residues explicitly and get the following handsome formula.

Remark:
Observing that for negative D ≡ 0, 1 (mod 4) we have it is a straightforward exercise to conclude −X<D<0 D≡δ (mod 4) for δ = 0, 1. Further congruence conditions on D can be imposed, and the error term can be improved by a more careful treatment of the dual term in the Voronoi formula. See [Vi] for the corresponding result for the ordinary class number h(d).
The following table provides some numerical results (here we combined the cases δ = 0 and δ = 1). 5.2. The Kuznetsov formula. The Kuznetsov formula was generalized by Proskurin [Pr] to arbitrary weights and by Andersen-Duke [AD] to Kohnen's subspace. Interestingly, only the direction from Kloosterman sums to spectral sums appears to be in the literature, but no complete version in the other direction. Biró [Bi1,p. 151] has a version only valid for test functions on the spectral side whose spectral mean value is 0, Ahlgren-Andersen [AA, Section 3] use an approximate version. We take this opportunity to state and prove the relevant Kuznetsov formula both for the full space of half-integral weight forms and for Kohnen's subspace. For κ ∈ {1/2, 3/2} the relevant Kloosterman sums are The Eisenstein series belong to the two essential cusps a = ∞, 0. We normalize and denote their Fourier coefficients by φ am (1/2 + it) = φ (κ) am (1/2 + it) as in [Pr,[12][13][14]]. We denote by (κ) a sum over an orthonormal basis of the space of cusp forms of weight κ and label the members by v j , j = 1, 2, . . . with Fourier coefficients b j (n) as in (5.1) and spectral parameters by t j .
Proposition 13. Let κ ∈ {1/2, 3/2}, m, n > 0. Let h be an even function, holomorphic in |ℑt| Remark: Note that the space of weight 1/2 Maaß forms v with spectral parameter i/4 are in the kernel of the Maaß lowering operator. Hence y −1/4 v is holomorphic, so that v has no non-vanishing negative Fourier coefficients. This is consistent with the fact that the Eisenstein contribution vanishes in this case because of the gamma factors in the denominator.
Proof. By [Pr,Lemma 3] with σ = 1, t = 2τ ∈ R and the first formula in [Pr,Lemma 6] where x = 4π √ mn/c. Note that taking σ = 1 is admissible in the present situation because we have the same Weil-type bounds for the Kloosterman sums K κ (n, m, c) as for K + κ (n, m, c) in (1.9). Also note that there is a typo in [Pr,Lemma 6] in the upper limit of the integral.
For h as in the lemma and t ∈ R we have the following inversion formula This is the lemma on p.327 of [Ku] 8 which is readily proved by residue calculus. We now integrate the pre-Kuznetsov formula against Our assumptions on h ensure absolute convergence and the possibility to shift the contour up and down to ℑt = ±1/2 without crossing poles. In this way the δ-term becomes For the Kloosterman term we insert the definition in (1.6) getting We note that where the last equality follows from the recurrence relations [GR,8.471.1&2]. Substituting this, we can evaluate the y-integral by the fundamental theorem of calculus, arriving at after some elementary manipulations. We multiply the resulting expression by √ mn to obtain the first formula. Note that the c-sum is absolutely convergent by the power series expansion of the Bessel function contained in F (x, 2t, −κ) and the fact that h(±i/4) = 0, as we can shift the t-contour up and down to |ℑt| = 1/2 − ε.
There are two ways to derive the second formula from the first. We can either observe that in Proskurin's notation we can compute U m (., s 1 ), U n (.,s 2 ) instead of U m (., s 1 ), U n (.,s 2 ) . This changes the signs of the coefficients in the spectral expansion and has the effect of changing κ into −κ. Note that in this case we do not need the extra condition h(±i/4) = 0 to shift contours. Alternatively, we use the following fact (cf. [DFI,(4.17), (4.18), (4.27), (4.28), (4.64), p.507, p.509]): the map the weight lowering operator is a bijective isometry between weight κ and weight 2 − κ that exchanges positive and negative Fourier coefficients: This yields again the second formula for the first.
In order to get a corresponding formula for the Kohnen space, we apply the L operator 1 2(1 + i 2κ ) w mod 4 1 + w 1/4 4w 1 to the formula. As in the case of the Petersson formula (Lemma 6), this has the effect that • the cuspidal term is restricted to forms in the Kohnen space; • the δ-term is multiplied by 2/3; the reason for the number 2/3 is that the dimension of the Kohnen space is 1/3 of the full space, but only half of the coefficients appear; • the Kloosterman sums (5.6) are replaced with the Kloosterman sums (1.7) and the Kloosterman term is also multiplied by 2/3.
The hardest part is to compute the Eisenstein coefficients. All of this has been worked out in detail in [AD,Section 5]. The corresponding formula [AD,Theorem 5.3] can be inverted in the same way. In the following lemma let + denote a sum over an orthonormal basis of weight 1/2 Maaß cusp forms in Kohnen's space. We recall the definition (4.1) and (4.2) of L(D, s) for a discriminant D.

Harmonic analysis on positive definite matrices
Here we prove Proposition 1. We identify the Hilbert spaces so that the measures coincide. The group Γ = PSL 2 (Z) acts faithfully on P(R) and P(Z) by T → U ⊤ T U for U ∈ Γ. This is compatible with the action of Γ on H by Möbius transforms. Every smooth function f ∈ L 2 (Γ\H) has a spectral decomposition We recall the notion of the spectral parameter t u for u ∈ Λ; the constant function has spectral parameter i/2. Combining the spectral decomposition on Γ\H with Mellin inversion, we conclude that, for a smooth function Φ ∈ L 2 (Γ\P(R)), the spectral decomposition holds provided Φ is sufficiently rapidly decaying as r → 0 and r → ∞. Here, is the Mellin transform with respect to the r-variable. This gives the Parseval formula For an automorphic form u ∈ Λ and a Siegel cusp form F ∈ S (2) k with Fourier expansion (2.4) we define the twisted Koecher-Maaß series by is the stabilizer and ℜs is (initially) sufficiently large. This series is often defined in terms of GL 2 (Z)-equivalence instead of Γ-equivalence, but for us the present version is more convenient. This function has no Euler product, but it does have a functional equation. Let Let us assume that k is even. Then for all even u (including Eisenstein series and the constant function), the function L(F × u, s) has an analytic continuation to C that is bounded in vertical strips and satisfies the functional equation [Im,Theorem 3.5] The functional equation is a consequence of the following period formula. For ℜs sufficiently large [Im, we have Now splitting the T -sum into equivalence classes modulo Γ and unfolding the integral, this equals Note that it is important that the action of Γ is faithful. The last integral over P(R) was evaluated by Maaß [M, p. 85 and p. 94]: initially for ℜs sufficiently large, but then by analytic continuation for all s ∈ C. For odd u, the left hand side vanishes, since F (i · (., r)), u = 0 for every r. The Parseval formula (6.2) now implies Proposition 1 in the introduction.
In the special case where F is a Saito-Kurokawa lift, the Koecher-Maaß series simplifies.
Lemma 15. If k is even and F = F h ∈ S (2) k is a Saito-Kurokawa lift with Fourier expansion as in (2.4) and (2.5) and u ∈ Λ, then for ℜs sufficiently large and P (D; u) as in (1.5).
Remark: One would expect that c h (|D|) is roughly of size |D| Proof. We copy the argument from [Bo,p. 22]. Let ∆ be a negative fundamental discriminant, D = ∆f 2 a negative discriminant and T ∈ P(Z)/Γ. For such T = n r/2 r/2 m we write e(T ) = (n, r, m).
It follows from (2.5) that We combine Proposition 1 and Lemma 15 with (2.6) and use the notation of these formulas to derive the following basic spectral formula for the restricted norm N Proposition 16. Let k be even and let F = F h ∈ S (2) k be a Saito-Kurokawa lift with Fourier expansion as in (2.4) and (2.5). Let f h ∈ S 2k−2 denote the corresponding Shimura lift of h. Then and L(h, u, s) is the analytic continuation of (6.6) for ℜs sufficiently large.
The renormalized functions still satisfy the functional equation The inclusion of the gamma factor in (6.6) is motivated by the formula in Lemma 6.
From the Dirichlet series expansion and the functional equation we obtain an approximate functional equation, cf. [IK,Theorem 5.3].
k be a Saito-Kurokawa lift and u ∈ Λ with spectral parameter t u . For t, x ∈ R let Combining Proposition 16, Lemma 17 and (2.7) we obtain the following basic formula: (6.8)

A relative trace formula
In this section we prove a slightly more general formula than that stated in Theorem 3. Let D 1 = ∆ 1 f 2 1 , D 2 = ∆ 2 f 2 2 < 0 be two arbitrary negative discriminants and h as specified in Theorem 3. Combining (4.8) (with t/2 in place of t) and (4.11) we have By the argument of the proof of Lemma 8 we can re-write the sum over even cusp forms u as a sum over weight 1/2 cusp forms v in Kohnen's space. Thus the last two terms of the preceding display become Here, as in Lemma 14, (+) indicates a sum over an orthonormal basis of weight 1/2 cusp forms v j in Kohnen's space with spectral parameter t j and Fourier coefficients b j (D), and u j is the corresponding Shimura lift with spectral parameter 2t j = t u . If λ j (n) are the Hecke eigenvalues of u j , then by the approximate functional equations (4.14) and (4.16) with ∆ = 1 we can write with W t as in (4.15) with a = 0. Note that W 2t (x) is even and holomorphic in |ℑt| < 2/3, satisfying the uniform bound W 2t (x) ≪ (1 + |t| 2 )/x 2 in this region (by trivial bounds). Moreover W 2t (x) vanishes at t = ±i/4. We first deal with residue term in the formula for |ζ(1/2+2it)| 2 and substitute this back into the Eisenstein term. This gives We can slightly simplify this by applying in the plus-term the functional equation for L(D 1 , 1/2+2it) and changing t to −t, and in the minus-term the functional equation (4.3) for L(D 2 , 1/2 − 2it). In this way we see that the two terms are equal and after some simplification we obtain Our next goal is to use the half-integral weight Hecke relations to combine λ j (n)b j (D 1 ). For notational simplicity let us defineb j (D 1 ) = |D 1 |b j (D 1 ). From (3.10) we obtain In the last step we used (3.10) again together with Möbius inversion. This yields Comparing (3.10) and (4.2), we see that the same Hecke relations hold for Eisenstein series, and we therefore have We are now in a position to apply the second Kohnen-Kuznetsov formula in Lemma 14 with in place of h(t). This function satisfies the hypotheses of that formula (and decays rapidly enough in n and m), recall that W 2t (n) vanishes at t = ±i/4. The diagonal exists only if ∆ 1 = ∆ 2 and vwn = f 2 . For a function H we introduce the integral transform with F as in (1.6).
Remarks: 1) Specializing f 1 = f 2 = 1 we obtain Theorem 3. 2) Recall again that W t (x) = 0 for t = ±i/2, so that contour shifts in the t-integral ensure that the c, n-sum is absolutely convergent.
3) The first term on the right hand side corresponds to the constant function and is obviously indispensable. In all practical applications, the t-integral in the second term is of bounded length due to the factor exp((1/2 − it) 2 ), so that by subconvexity bounds for L(D, 1/2 + it) this term is dominated by the class number term. The last term can be analyzed as the off-diagonal term in the Kuznetsov formula except that it contains an extra n-sum of length ≈ |t| from the approximate functional equation, cf. (9.17) below. Contrary to its appearance, the diagonal term is symmetric in f 1 , f 2 (as it should be) and can be written as , v p (f 2 )) and β p = min(v p (f 1 ), v p (f 2 )) for the usual p-adic valuation v p .

Mean values of L-functions
This section is devoted to the proof of Proposition 4. To begin with, we recall Heath-Brown's large sieve in two variations [HB1,Corollaries 3 & 4] 9 9 In the original version of [HB1,Corollary 4], the n-sum is restricted to odd numbers n, but in the case of fundamental discriminants ∆, the symbol ( ∆ n ) is also defined for even n, and the proof works in the same way.
Lemma 19. a) Let N, Q 1, let S(Q) denote the set of real primitive characters of conductor up to Q and let (a n ) be a sequence of complex numbers with |a n | 1. Then χ∈S(Q) n N a n χ(n) for every ε > 0. b) Let D, N 1, (a n ), (b ∆ ) be two sequences of complex numbers with |a m |, |b ∆ | 1, where b ∆ is supported on the set of fundamental discriminants ∆. Then We start with part (a) of the proposition. As mentioned in the introduction, L(u × χ, 1/2) = 0 if u is odd for root number reasons. For even u we use the approximate functional equation (4.14) and write where a = 1 if ∆ < 0 and a = 0 if ∆ > 0. We can treat positive and negative discriminants separately, so that we may assume that G(s, t u ) is independent of ∆. Eventually we would like to apply the Cauchy-Schwarz inequality, the spectral large sieve inequality and Heath-Brown's large sieve for quadratic characters. The latter requires that the n-sum is restricted to odd squarefree integers. Therefore we uniquely factorise n = 2 α n 1 n 2 2 with n 1 , n 2 odd, n 1 squarefree and use the Hecke relations to write n λ u (n)χ ∆ (n) n 1/2+s = α λ u (2 α )χ ∆ (2 α ) 2 α(1/2+s) 2∤n1 µ 2 (n 1 )λ u (n 1 )χ ∆ (n 1 ) We use Möbius inversion to detect the condition (n 2 , ∆) = 1 and we observe that the α-sum depends only on ∆ modulo 8. Therefore where ∆ ′ f is restricted to negative fundamental discriminants and λ u (f 2 n 2 2 ) n 1+2s 2 ≪ f 2θ+ε uniformly in ℜs ε for θ = 7/64 by the Kim-Sarnak bound. In the above formula we define χ(δ, 2 α ) := χ ∆ (2 α ) for any ∆ ≡ δ (mod 8).) We substitute this back into (8.1). Shifting the contour to the far right, we can truncate the n 1 -sum at n 1 (DT ) 1+ε for |t u | T at the cost of a negligible error. Having done this, we shift the contour back to ℜs = ε, truncate the integral at |ℑs| (DT ) ε , again with a negligible error, so A priori, the right hand side is restricted to even u, but by positivity we can extend it to all u. Next we apply the Cauchy-Schwarz inequality. In the second factor we artificially insert 1/L(sym 2 u, 1) at the cost of a factor of T ε (by (4.13)) to convert the Hecke eigenvalues into Fourier coefficients and apply the spectral large sieve inequality [DI,Theorem 2]. This leaves us with bounding for N (DT ) 1+ε . For a given odd, squarefree d ∈ N, the n 1 -sum equals For odd squarefree n = 1, the map ∆ ′ → ( ∆ ′ n ) is a primitive quadratic character of conductor n, so that by Heath-Brown's large sieve for quadratic characters (Lemma 19a) this expression is bounded by Putting everything together, we complete the proof of Proposition 4(a).
The proof of part (b) is almost identical except that the spectral large sieve is replaced with the standard bound [IK,Theorem 9.1] for Dirichlet polynomials. Here we use the approximate functional equation where |ǫ(t)| = 1 and G(s, t) = e s 2 Γ(1/2 + a + s + it/2) 2 Γ(1/2 + a + it/2) 2 π s s We included the polynomial in order to counteract the pole at s = 1/2 − it of L(χ ∆ , s + 1/2 + it) 2 for ∆ = 1, so that no residual term arises in the approximate functional equation. The functionG has similar analytic properties as G above, and the divisor function τ satisfies the same Hecke relations as λ u . The proof is now almost literally the same, except that the factor (T 2 + N )/N in (8.2) is (T + N )/N . Thus the proof of Proposition 4 is concluded.

Interlude: special functions and oscillatory integrals
In this rather technical section we compile various sums and integrals over Bessel functions and other oscillatory integrals that we need as a preparation for the proof of Theorem 2. To start with, the following lemma is a half-integral weight version of [Iw3,Lemma 5.8], but with a somewhat different proof.
Lemma 20. Let x > 0 A 0, K > 1. Let w be a smooth function with support in [1, 2] satisfying w (j) (x) ≪ ε K jε for j ∈ N 0 . Then there exist smooth functions w 0 , w + , w − such that for every j ∈ N 0 we have The implied constants in (9.1) depend on the B-th Sobolev norm of w for a suitable B = B(A, j).
The functions w ± are explicitly given in (9.3) and (9.5).
Proof. We denote the left hand side of (9.2) by W (x). For k ∈ N, by [GR,8.411.13] we have We put The h = 0 term vanishes (as do all even h), and by partial integration the other terms are bounded by O n (K|h| −n (K −(1−ε)n + θ n )e −Kθ ) for any n ∈ N, so that Again by Poisson summation we have Since −1/4 < θ 3/4, we see by partial integration in the y-integral that the contribution of h = 0 is O A (K −A ). Let v be a smooth function with compact support in [−2, 2], identically equal to 1 on [−1, 1]. Then for h = 0 we can smoothly truncate the θ-integral by inserting the function v(θK 9/10 ), the error being again O A (K −A ) by partial integration. We obtain W + 1 (x) = W + 2 (x) + W 2 (x), where W 2 (x) ≪ A K −A and after changing variables In the following we frequently use the Taylor expansions sin(t) = t + O(t 3 ) and cos(t) = 1 + t 2 /2 + O(t 4 ).
We first extract smoothly the range |θ| In this way we obtain a contribution of to (9.4) for every n 0. This is easily seen to be for every A > 0. For the portion |θ| ≫ K 2 /x we integrate by parts in the y integral and apply trivial estimates to obtain a bound which is easily seen to be

The same analysis works for
We put w ± = W ± 2 and w 0 = W 1 + W 2 +W 2 , and the lemma follows on noting that 1 2 (i k + (−i) k ) = i k δ 2|k .
Remarks: 1) It is clear from the proof that if w depends on other parameters in a real-or complex-analytic way with control on derivatives, then w ± = W ± 2 , defined in (9.3), depends on these parameters in the same way. We will use this observation in Section 2 and (14).
2) The bound (9.1) remains true for A −1/2. In the case, the claim follows for x K 2 from the asymptotic formula [GR,8.451.1 & 7 & 8]. We state this for completeness, but we do not need it here.
We need a similar formula for the transforms occurring in (3.6) and (7.1).

Lemma 21. Let A, T 2 and let h be a smooth function with support in
For the first part we recall the uniform asymptotic formula [EMOT,7.13.2(17)].
for every M 0. The error term in [EMOT] is O(x M ), but for small x the error term O(|t| −M ) follows from the power series expansion [GR,8.440]. Partial integration in the form of [BKY,Lemma 8 and the claim follows. b) For the proof of the second part we distinguish 3 ranges. For x > 10T the claim follows easily from the rapid decay of the Bessel K-function and its derivatives. For x < T /10 we use the uniform asymptotic expansion [EMOT,7.13.2(19)] (along with the power series expansion [GR,8.485,8.445] for very small x) wheref ± M satisfies the analogous bounds in (9.6). Again integration by parts ( [BKY,Lemma 8.1] with U = Y = Q = T , R = arccosh(T /x) 1) confirms the claim in this range. Finally, for x ≍ T we use the integral representation [GR,8.432.4] This integral is not absolutely convergent, but partial integration shows that the tail is very small, and we can in fact truncate the integral at |u| ε log T at the cost of an admissible error O(T −A ). Thus we are left with bounding if B is chosen sufficiently large with respect to j.
For large arguments, the Bessel function J ir (y) behaves like an exponential. More precisely, by [GR,8.451.1 & 7 & 8] we have an asymptotic expansion which we will need later: for r ∈ R, x 1 and fixed n ∈ N. This is useful as soon as x r 2 .
The following lemma is essentially an application of Stirling's formula.
Proof. This is a standard application of Stirling's formula. First of all, since Γ(k + s) it suffices for both statements to treat the two cases s = σ ∈ R fixed and s = it ∈ iR. The first case is very simple, so we display the details for the second case. We have It is not hard to see that for some absolute constant c (in fact, c = (π − log 4)/4 = 0.438 . . . is the optimal constant). In particular, Γ(k + it)/Γ(k) is exponentially decreasing as soon as |t| k 1/2 . Moreover, by a Taylor argument we have This proves (9.9). To prove (9.8), we need to bound the derivatives of α and β which is most quickly done by using Cauchy's integral formula. Note that both α and β have a branch cut at the two rays ±t/k ∈ [i, i∞). We assume that k is sufficiently large (otherwise there is noting to prove) and we choose a circle C 1 about k of radius k/100 and a circle C 2 about t of radius √ k/10. Then w/z is away from the branch cuts for z ∈ C 1 , w ∈ C 2 , and we have for z ∈ C 1 , w ∈ C 2 . From Cauchy's integral formula we conclude for i, j ∈ N 0 . Combining (9.10), (9.11), (9.12) completes the proof of (9.8).
We apply this to the function G(k, t u , s) defined in (6.5).
Recalling the definition (6.7) of V t (x; k, t u ) we conclude from (9.13) and appropriate contour shifts the uniform bounds for A > 0, j ∈ N 4 0 . In a similar, but simpler fashion we also apply this to the weight function W t defined in (4.15) and state the bound

A weak version of Theorem 2
In this section we present a relatively soft argument that provides the upper bound N av (K) ≪ K ε . This will useful later in order to estimate certain error terms later. By (1.3) and (6.8) we have By (9.16) we have t, t u ≪ K 1/2+ε (up to a negligible error). We insert a smooth partition of unity into the t u -integral and attach a factor w(|t u |/T spec ) where w has support in [1, 2] unless T spec = 1, in which case w has support in [0, 2]. Let for ν = 0, 1, 2, . . . and T spec = 2 ν ≪ K 1/2+ε . This section is then devoted to the proof of the bound (10.1) N av (K; T spec ) ≪ ε 1 + T 2 spec K 1−ε for ε > 0. We will now sum over h using Lemma 6. This yields a diagonal term and an off-diagonal term that we treat separately in the following two subsection. Throughout, the letter D, with or without subscripts, shall always denote a negative discriminant unless stated otherwise. Let letter A shall denote an arbitrarily large fixed constant, not necessarily the same on every occurrence.
10.1. The diagonal term. The contribution to N av (K; T spec ) of the diagonal term from Lemma 6 is bounded by For the constant function u = 3/π we have P (D; 3/π) ≪ H(D). Recalling (9.16) and Lemma 24, this gives a total contribution of if T spec = 1 and otherwise the contribution vanishes.
Similarly, by (4.12), (3.3), (4.7) and (4.13), the Eisenstein spectrum contributes ≪ max We recall our convention that ∆ denotes a negative fundamental discriminant, D = ∆f 2 an arbitrary negative discriminant (where f here has nothing to do with f 1 , f 2 above). In the above bound we have already executed the sum over f . By Proposition 4(b) and a standard bound for the fourth moment of the Riemann zeta-function this is O(K −1/2+ε ). By (4.10), (4.5), (4.6) and (4.13), the contribution of the cuspidal spectrum is at most by Corollary 5. All of these bounds are consistent with (10.1).
10.2. The off-diagonal term: generalities. We now consider the off-diagonal term in Lemma 6 from the sum over h. Here we need to bound We first sum over k using Lemma 20. Up to a negligible error, we obtain for any A 0, j ∈ N 4 0 , cf. (9.16) and the remark after Lemma 20. In order to apply Voronoi summation, we open the Kloosterman sum and are left with bounding Integration by parts shows that for any A 0, j ∈ N 4 0 . The first and third factor on the right hand side of the last display imply |D 1 D 2 | = K 4+o(1) and c, f 1 , f 2 = K o(1) up to a negligible error. On the other hand, the last factor implies D 1 f 2 1 = D 2 f 2 2 (1 + O(1/K 1/2 )), so that in effect D 1 , D 2 = K 2+o(1) . In the following we treat the cuspidal part, the Eisenstein part and the constant function separately. In principle we could treat them on equal footing and we will do this in Section 14, but for now we keep the prerequisites as simple as possible.
By (4.1) and Proposition 4(b) along with a bound for the fourth moment of the Riemann zeta function we obtain the desired bound 10.4. The cuspidal contribution. Next we consider the cuspidal contribution and consider the following portion we freeze c, f 1 , f 2 and u for the moment. For notational simplicity we consider only the plus case, the minus case may be treated similarly. We insert (4.8) with t = t u /2 and re-write (10.6) as To the D 1 -sum we apply the Voronoi formula (Lemma 10) with weight function We recall that c, f 1 , f 2 ≪ K ε are essentially fixed from the decay conditions of V * , but we need to be uniform in |D 2 | = K 2+o(1) . We define as in (5.2) with r = t u /2 and obtain that (10.6) is equal to (10.8) where only in the above sum do we allow D to be either positive or negative. If D > 0, then the integral transform Φ((2π) 2 D/c 2 ) contains a factor (10.9) K itu (4π |xD|/c) Γ(3/4 + it u /2)Γ(3/4 − it u /2) , and we recall that |x| = K 2+o(1) , c ≪ K ε up to a negligible error. Thus the argument of the Bessel function is ≫ K 2−ε , while the index is ≪ K 1/2+ε . By the rapid decay of the Bessel K-function this contribution is easily seen to be negligible (we use (4.9) and bound b(D) trivially), and we may restrict from now on to D < 0. In this case x 1/2 . Using (9.7), up to a negligible error we can write with (10.10) x j ∂ j ∂x j f ± (x, r) ≪ j 1 for any j ∈ N 0 . We substitute this back into (10.8) which equals (10.6). We substitute this back into (10.3). In this way we see that the cuspidal contribution to (10.3) is at most By (10.5) and (10.10), each integration by parts with respect to x introduces an additional factor (10.12) cK 1/2 x( |D 2 | ± |D|) , and we conclude that for every A 0. Here only the negative part in the ± sign is relevant, since otherwise the expression is trivially negligible. The limiting factor for the size of the x-integral is the first factor in the second line of the previous display, so that we obtain for every A 0. It is not hard to see that this can be simplified as With this bound we return to (10.11), apply the simple bound |b(D)b(D 2 )| |b(D)| 2 + |b(D 2 )| 2 together with (4.9), getting an upper bound of the shape plus a similar expression that with L(u, D, 1/2)/|D| in place of L(u, D 2 , 1/2)/|D 2 | which can be treated in the same way. We sum over D, f 1 , f 2 , c and end up with (after changing the value of A) −A L(u, 1/2)L(u, D 2 , 1/2) L(sym 2 u, 1) .
We write D 2 = ∆f 2 with a fundamental discriminant ∆ and use (4.5), (4.6). Summing over f , we obtain We estimate the denominator L(sym 2 u, 1) by (4.13) and apply Corollary 5 to finally obtain the upper bound T 2 spec K ε−1 in agreement with (10.1). 10.5. The constant function. This is very similar to the preceding subsection, so we can be brief. In short, we win a factor T spec ≪ K 1+ε from the fact that the spectrum is reduced to one element, and we lose a factor |D| 1/2 ≪ K 1+ε since each class number is a factor |D| 1/4 bigger than the generic period P (D; u). The key point is that we end up with a pure bound without a K ε -power. This K ε -power is unavoidable when we apply Corollary 5, but for a sum over class numbers H(D) alone we can apply Lemma 24 below which avoids a K ε -power. The analogue of (10.6) is We apply the Voronoi formula (Lemma 12) to the D 1 -sum as before. Due to the oscillatory behaviour of φ in (10.7) the main terms are easily seen to be negligible, and as in the previous argument also one of the osciallatory terms is negligible due to the exponential decay of J − in (5.5). The behaviour of J + similar, but much simpler, as no asymptotic formula of a Bessel function is necessary. The analogue of (10.11) then becomes In the same way as above this leads to The last step is justified by the following simple lemma.
The bound (10.14) is in agreement with, and completes the proof of, (10.1).
We conclude this section with a brief discussion. The bound (10.1) along with T spec ≪ K 1/2+ε (from the decay of V t ) implies immediately the upper bound N av (K) ≪ K ε . The ε-power is unavoidable at this point because of the use of Heath-Brown's large sieve in the proof of Proposition 4. Except for the spectral large sieve implicit in proof of Proposition 4, we have not touched the spectral u-sum, so any further improvement must involve a treatment of this sum. This is precisely the purpose of the relative trace formula for Heegner periods given in Theorem 3. The weaker result (10.1) is nevertheless useful: it allows us to discard small eigenvalues t u ≪ K 1/2−ε and it allows us to estimate efficiently some error terms later. The following sections are devoted to the proof of Theorem 2.
11. Proof of Theorem 2: the preliminary argument By (1.3) and (6.8) we have Throughout we agree on the convention that D (with or without indices) denotes a negative discriminant and ∆ denotes a negative fundamental discriminant. We make two immediate manipulations. Fix some 0 < η < 1/100. By the concluding remark of the preceding section we can insert the function (11.1) ω(t u ) = 1 − e −(tu/K 1/2−η ) 10 6 /η (not to be confused with the constant ω in the previous display) into the u-integral, and we can truncate the n, m-sum at n, m ≪ K η .
Both transformations induce an admissible error, the former due to that ω(t u ) − 1 ≪ A K −A for every A > 0 and t u ≫ K 1 2 − η 2 . Note that ω is even, holomorphic, within [0, 1] for t u ∈ R ∪ {i/2, −i/2} and satisfies for j ∈ N 0 . In particular, up to a negligible error we may ignore the constant function u = 3/π with t u = i/2. As before we denote by * Λev a spectral sum/integral over the non-residual spectrum, i.e. everything except the constant function.
Note that λ(n) depends on h, as it is a Hecke eigenvalue of f h . Before we can sum over h using Lemma 6, we must first combine λ(n) with c(|D 2 |). To this end we recall (2.3) and recast N av (K), up to a small error, coming from the truncation of the n, m-sum and the u-integral, as We can now sum over h using Lemma 6, and we start with an analysis of the diagonal term which is given by The analysis of this term occupies this and the following two sections, and we will eventually show that N diag (K) = 4 log K + O(1). The discussion of the off-diagonal term is postponed to Section 14. We write d 2 = d 1 δ, n = d 1 δν, so that d 2 1 | ν 2 D. Since n is squarefree, this implies d 2 1 | D. We write d 1 = d and Dd 2 in place of D. With this notation we recast N diag (K) as From the Katok-Sarnak formula in combination with (3.10) in the cuspidal case and from (4.11) in combination with (4.2) in the Eisenstein case we conclude 10 for a fundamental discriminant ∆ where α u (f ) depends also on ∆, which we suppress from the notation. Using this notation along with (4.10) in the cuspidal case and (4.12) in the Eisenstein case we obtain where L(u) = L(sym 2 u, 1) if u is cuspidal and L(u) = 1 2 |ζ(1 + 2it)| 2 if u = E(., 1/2 + it) is Eisenstein (with the obvious interpretation in the case t = 0). With later transformations in mind, we also restrict the f -sum to f K η . By trivial estimates along with Corollary 5 and (9.16), this induces an error of O(K ε−η ). By the usual Hecke relations we have We summarize the previous discussion as The expression I depends also on f 2 νdf 1 f 2 , but we suppress this from the notation. We insert the approximate functional equations (4.14) and (4.16) getting Since the τ -integral is rapidly converging, it is easy to see that the polar term contributes at most O(K ε−1 ) to (11.4), so from now on we focus on the first term of the preceding display. By the Hecke relations we can recast it as (11.6) 4 d|r * Λev n,m This is now in shape to apply the Kuznetsov formula for the even spectrum, Lemma 7. We treat the three terms on the right hand side of (3.5) separately and start with the diagonal term to which the next section is devoted. The two off-diagonal terms are treated in Section 13.

The diagonal diagonal term
The diagonal contribution equals I diag (∆, t, k, r) = 4 d|r n χ ∆ (nr/d) Opening up the Mellin transform in the definition (4.15), this equals We shift the s 1 , s 2 -contours to ℜs 1 = ℜs 2 = −1/4 getting (12.1) We first deal with the error term and substitute it back into (11.4). Roughly speaking the factor |τ | 3/4 saves a factor K 1/8 from the trivial bound, while on average over ∆ the L-values on the lines 1/2 and 3/4 are still bounded. More precisely, recalling (9.16) the error term gives a total contribution of at most 1 By a standard mean value bound for the ∆-sum (e.g. [HB1, Theorem 2]), the previous display can be bounded by ≪ K −1/8+ε . We substitute the main term in (12.1) into (11.4) getting where we recall that h(τ ) is given by (11.5) and depends in particular on t, k and ∆ (as well as on f, f 1 , f 2 , d, ν). A trivial estimate at this point using (9.16) shows (by standard mean value results for L(χ ∆ , 1)), but eventually we want an asymptotic formula, not an upper bound. Our next goal is to show that the t-integral forces f 1 ν = f 2 d, up to a negligible error. To make this precise, we first observe that by the same computation as in (12.2) the portion |t| K 2/5 contributes at most O(K −1/10+ε ) to N diag,diag (K). We can therefore insert a smooth weight function that vanishes on |t| 1 2 K 2/5 and is one on |t| K 2/5 . Integrating by parts sufficiently often using (9.16), we can then restrict to up to a negligible error. It is then easy to see that the terms f 1 d = f 2 ν contribute O(K ε−2/5 ) to N diag,diag (K). Having excluded these, we re-insert the portion |t| K 2/5 to the t-integral, again at the cost of an error O(K ε−1/10 ). Finally we complete the d, δ, ν, m, f -sum at the cost of an error O(K ε−η ). Since (ν, d) = 1, the equation f 1 d = f 2 ν implies f 1 = dg, f 2 = νg for some g ∈ N.
Substituting all this, we recast N diag,diag (K) as where w in the present case denotes the Mellin transform and the left hand side comes from a contour shift to ℜs = −1/2 and the Conrey-Iwaniec [CoIw] subconvexity bound for real characters. We obtain We decompose the main term as S + S = depending on whether αn is a square or not. We first consider the portion S where n is restricted to n = α 2 k 2 with k ∈ N. This gives We decompose the main term as S odd + S even, 4 + S even, 8 depending on whether ∆ is odd, exactly divisible 4 or exactly divisible by 8. We have where χ 0 is the trivial character modulo 4 and χ −4 the non-trivial character modulo 4. For χ ∈ {χ 0 , χ −4 } we consider the Dirichlet series A standard application of Perron's formula (e.g. [Te,Corollary II.2.4]) shows now that We have S even, 4 = 0 and S even, 8 = 0 only if α is odd, which we assume from now on. Then and by the same computation we obtain Finally, µ 2 (m)χ 0 (m) and we conclude that L has analytic continuation to ℜv > −13/18 except for a simple pole at v = 0 and polynomial (in fact linear) bounds on vertical lines. If rad(n) denotes the squarefree kernel of n, then where we have implicitly computed the g-sum as ζ(2). Now a massive computation with Euler products, best performed with a computer algebra system, shows gigantic cancellation, and we obtain the beautiful formula With this we return to (12.3) and shift the v-contour to ℜv = −1/10. By (9.13) and trivial bounds the remaining integral expression is bounded by It remains to deal with the double pole at v = 0 whose residue is given by We can remove the factor ω(τ ) tanh(πτ ) at the cost of an error O(K −η/2 ), cf. the definition (11.1). Using the definition (6.5), at v = 0 we have the following Taylor expansion We have Γ ′ Γ (z) = log z + O(|z| −1 ) (for ℜz 1, say) and so for t, τ ≪ k 2/3 , say. Otherwise, the t and τ integrals are negligible outside this region. In this range we can insert (9.15) to conclude that (4) 16 πk 1/2 e −(4t 2 +τ 2 )/k |τ | dτ π 2 dt + O(1).
We have now detected the main term and we conclude this section by stating that 13. The diagonal off-diagonal term 13.1. Preparing the stage. We return to (11.6) and consider the off-diagonal terms on the right hand side of (3.5). We treat the first off-diagonal term in detail in the following three subsections. In Section 13.4 show the minor modifications to treat the second off-diagonal term. The first offdiagonal term is given by where h was defined in (11.5) and depends in particular on t, k and ∆. This needs to be inserted into (11.4) with r = f 2 dν/(d 1 d 2 d 2 3 ) K 4η . In (11.4) we apply a smooth partition of unity to the ∆-sum and consider a typical portion for a smooth function w with compact support in [1,2]. Our aim in this section is to prove the bound (13.1) J (1) (X, t, k, r) ≪ XK 1/2−η uniformly in k ≍ K, t K 1/2+ε , (13.2) X K 2+ε , r K 4η and f, f 1 , f 2 , d, ν ∈ N which are implicit in the definition (11.5). Taking (13.1) for granted, we estimate (11.4) trivially to obtain a contribution of O(K ε−η ), which is admissible. So it remains to show (13.1), and to this end we start with some initial discussion. The c-sum in I off-diag,1 (∆, t, k, r) is absolutely convergent, as can be seen by using the Weil bound for the Kloosterman sum and shifting the t-contour to ℜiτ = 1/3, say, without crossing any poles. By the power series expansion for the Bessel function [GR,8.440] we have J 2iτ (x) ≪ ℑτ x −2ℑτ e π|τ | (1 + |τ |) −1/2 , x 1 and we can therefore truncate the c-sum at c K 10 6 , say, at the cost of a very small error. Having done this, we can sacrifice holomorphicity of the integrand in the τ -integral, and we insert a smooth partition of unity into the τ -integral restricting to τ ≍ T , say, with otherwise h(τ ) is negligible by (11.5), (9.16) and (11.2). We insert smooth partitions of unity into the n, m, c-sums and thereby restrict to n ≍ N , m ≍ M c ≍ C, say, where (13.4) N T 1+ε , M XT 1+ε by (9.17) and initially C K 10 6 . Next we want to evaluate asymptotically the τ -integral. To this end we use Lemma 21 with the weight function h = h n,m,∆ given by where w is the weight function occurring in the smooth partition of unity of the τ -integral. By (9.17), (11.2) and (9.16), the function h is "flat" in all variables, i.e.
0 , uniformly in all other variables. Lemma 21a implies that we can restrict, up to a negligible error, to (13.5) C √ N M r 2 T 2 K ε , where r 2 = r/d, and up to a negligible error we are left with bounding for a smooth function W with compact support in [1, 2] 4 and bounded Sobolev norms with variables X, N, M, C, T satisfying (13.2), (13.4), (13.5), (13.3), respectively. The basic strategy is now to apply Poisson summation first in the n-sum and then in the m-sum in Section 13.2. This shortens the variables in generic ranges, so that a trivial bound turns out to be of size XK 1/2+2η+ε . This is very close to our target (13.1). In Section 13.3 we will extract a character sum from this expression where the Pólya-Vinogradov inequality produces the final saving, at least in generic ranges of the variables. In order to also treat non-generic ranges where some of the variables are relatively short, at each step we also apply trivial bounds along with Heath-Brown's large sieve. In particular, by Lemma 19b) we can bound (13.6) by (13.8) We consider the character sum This is non-zero only if (n, c) = (r 2 , c). We write (r 2 , c) = δ, r 2 = δr ′ 2 , c = δc ′ , n = δn ′ with (n ′ r ′ 2 , c ′ ) = 1 and recast (13.9) as * γ (mod c) γ≡−r ′ 2 n ′ (mod c ′ ) e mγ c .
Next we consider the x-integral in (13.8). The phase has a unique stationary point at x = r 2 m/n 2 if sgn(n) = ± and no stationary point if sgn(n) = ∓. If N r 2 m/n 2 2N and sgn(n) = ±, we can apply the stationary phase lemma [BKY,Proposition 8.2] to see that the integral is given by for a smooth function W 1 with compact support in [1, 2] 4 and bounded Sobolev norms, up to a negligible error from truncating the series in [BKY,(8.9)]. Otherwise we apply integration by parts in the form of [BKY,Lemma 8.1] with X = 1, U = Q = N , Y = R = √ N M r 2 /C to conclude that the integral is negligible.
Noting that with our previous notation for sgn(n) = ±, we can now apply the additive reciprocity formula e(1/ab) = e(ā/b)e(b/a) for (a, b) = 1 to conclude that J (1) r (X, N, M, C, T ) equals, up to a negligible error term, (13.10) Here we recall the notation conventions from Section 1.5 regarding expressions δ | c ∞ etc. For easier readability we remove all the dashes at the variables, and we define W 2 (x, y, z, w) = w 1/2 y −3/2 z 1/2 W 1 (x, z/y 2 , z, w).
Combining (13.27) and (13.26) we obtain Combining the previous two bounds, we obtain by (13.4) and (13.3). This is acceptable unless which we assume from now on, so that in particular n ≫ C(N δ 1 δ 2 )K −4η ≫ N 1/3−10η . By the same argument as in the previous subsection we can now extract certain square classes in the n-sum and then save from the Pólya-Vinogradov inequality. In effect, we replace the factor C from a trivial bound of the c 2 -sum by a factor K O(η) N/C of the square root of the conductor of c 2 → ( n c2 ). This leads to the final bound by (13.2), (13.3) and our assumption C K 2/3−2η . This is in agreement with (13.1) and completes the analysis of the the second diagonal off-diagonal term, hence the analysis of the complete diagonal term.
14. The off-diagonal term 14.1. Initial steps. We return to (11.3) and analyze the off-diagonal term in Lemma 6 applied to the h-sum. Here we are only interested in upper bounds, so dropping all numerical constants it suffices to estimate and our target bound is K −η . We recall that V t (x, k, τ ) was defined in (6.7) and besides the decay properties it is important to note that V t (x, k, τ ) is holomorphic in, say, |ℑτ | 1. Since we want to apply the trace formula (Theorem 18) to the spectral sum later, we must not destroy holomorphicity in the third variable.
As in Section 11 we write d 2 = d 1 δ, n = d 1 δν. Then d 2 1 | ν 2 D 2 and d 2 1 | D 2 since n is squarefree. Again we write d 1 = d and D 2 d 2 in place of D 2 and bound the preceding display as We sum over k using Lemma 20 and open the Kloosterman sum. As in Section 10.2, up to a negligible error we obtain the upper bound dδν,m K η 4|c f1,f2 where I off (K) = I off d,δ,ν,m,c,f1,f2,γ (K) is given by hereṼ satisfies (10.2) and is holomorphic in |ℑt u | 1. The bounds contained in (10.2) imply in particular c, f 1 , f 2 K η up to a negligible error. For notation simplicity we consider only the plus-case, the minus case being entirely similar.
As in Section 11 we start with a Voronoi step, but in the present situation (since we have already excluded the constant function that requires a very careful treatment) we can afford to lose small powers of K on the way. We introduce the notation for some constant c, not necessarily the same on every occasion. We always assume that η is sufficiently small.
A trivial bound using Cauchy-Schwarz and Proposition 4 gives I off 1 (K) 1, as in Section 10. In order to make progress and get additional savings, we must now treat the u-integral non-trivially. This is where the trace formula has its appearance.
We discuss the four terms on the right hand side of the trace formula.
1) The class number term gets immediately cancelled.
(Here we exchanged the roles of D 1 and D 2 in Theorem 18.) The general strategy is now as follows: We evaluate the t-integral by Lemma 21 and simplify the expression by using suitable Taylor expansions. It is a lucky coincidence that this step yields rational phases in the exponentials. We are then ready to apply Poisson summation in the long ∆ 2 -sum which will eventually give enough savings. We now make these ideas precise. We recall that Ω satisfies the conditions stated in (11.2) and is negligible for |t| ≫ K 1/2+ε . The n, m-sum is absolutely convergent by (9.17), and we can truncate it at rnvm K 1/2 at the cost of a negligible error. We split the n, m-sum into dyadic ranges N n 2N , M m 2M where (14.5) N M (rv) −1 K 1/2 .
We estimate the remaining part of the character sum (14.10) trivially by c 2 2 δd 1 vmτ . By the properties of the (essentially non-oscillating) weight functionsṼ x and H ± , the dual variables D can be truncated at D cδd 1 vmτ K 2 /(d 2 d 1 rτ vw) 2 , and so the ∆ 2 -sum in (14.9) can be bounded by K 2 /(d 2 d 1 rτ vw) 2 cδd 1 vmτ + 1 c 1+ε (c 1 , (d 2 vwn, d 2 d 1 rτ vwν) 2 )c 2 δd 1 vmτ = K 2 c ε (d 2 d 1 rτ vw) 2 + c 1+ε δd 1 vmτ c, (d 2 w) 2 (n, rν) 2 (2δd 1 vmτ ) ∞ using the notation explained in Section 1.5. The first term in the first parenthesis accounts for the not in the stabilizer is negligible. Combining (A.1), (A.2) and the class number formula in the case h ∆ = 1, we obtain for 4 | c, (a, c) = 1. As before, H(D) denotes the Hurwitz class number, and the series converges absolutely in ℜs > 5/4. The results are probably known to specialists, but do not seem to be in the literature and may be of independent interest. We recall the notation (1.8).