1 Introduction and statement of results

Much of the motivation to study vertex operator algebras (VOAs) originates from work explaining observations originally made by McKay and Thompson [53, 54] on apparent relations between the representation theory of the Fischer–Griess Monster \({\mathbb {M}}\), the largest of the sporadic simple groups, and the modular J-function. Conway and Norton [16] later extended the original observations to the famous Monstrous moonshine conjecture. Frenkel, Lepowsky, and Meurman [30,31,32] were the first to construct a vertex operator algebra \(V^\natural \) whose character is the J-function and on which \({\mathbb {M}}\) acts as automorphisms. Borcherds [6] later confirmed that the graded characters of \(V^\natural \) coincide with certain Hauptmoduln identified by Conway and Norton [16]. Since then, VOAs and related structures have played a central role in various other instances of moonshine. The most illustrious cases of this include Norton’s generalized moonshine [46, 47], which has been proven in general by Carnahan [11]. A first special case of this, now called Baby Monster moonshine was established earlier by Höhn [37]. Other instances of moonshine related to VOAs include Conway moonshine [27] and various instances of umbral moonshine [3, 14, 26, 28].

In recent new developments of moonshine, new connections to the arithmetic of elliptic curves have been discovered [4, 23, 24]. In [23] for instance, the existence of a representation for the sporadic O’Nan group has been established, which controls ranks and p-torsion in Selmer groups or Tate-Shafarevich groups of quadratic twists of certain elliptic curves (for a precise statement, see [23, Theorems 1.3 and 1.4]. See also [25, Theorem 7.1].). Similar connections have been established for example in [4] using quasimodular forms of weight 2, along with a construction of the corresponding module as a VOA. In this work, we continue the mantra of connecting VOAs and arithmetic, but in a somewhat different vein.

In the context of classifying holomorphic, strongly rational VOAs of central charge 24 (see Sect. 2.1 for definitions of these terms) and proving the “completeness” of a list of 71 Lie algebras devised by Schellekens [49], which is now known to contain every possible \(V_1\)-space of such a VOA by work of various people (see for instance the introduction of [56] for references), van Ekeren, Möller, and Scheithauer [56] find a dimension formula for orbifold VOAs of central charge 24. A special case of their formula had previously been established by Möller in his thesis [45] and for the sake of simplicity, we only give this special case here. The reader is referred to Sect. 2.1 and the references given there for the relevant definitions.

Theorem

Let V be a holomorphic, strongly rational VOA additionally satisfying the positivity assumption and let \(G=\langle g\rangle \) be a cyclic group of automorphisms of V of order N with g of type \(N\{0\}\). Denote by \(V^G\) the fixed point VOA of V under the action of G and let \(V^{{\text {orb}}(g)}\) be the orbifold vertex operator algebra. Furthermore, assume that V has central charge \(c= 24\). Then for \(N= 2,3,5,7,13\), we have the dimension formula

$$\begin{aligned} \dim V_1 + \dim V^{{\text {orb}}(g)}_1= & {} 24 + (N+ 1) \dim V^G_1\\&-\frac{24}{N-1}\sum _{k=1}^{N-1} \sigma (N-k)\sum _{i\in {\mathbb {Z}}/N{\mathbb {Z}}\setminus \{0\}}\dim V(g^i)_{k/N}, \end{aligned}$$

where \(\sigma (m)=\sum _{d\mid m} d\) denotes the usual divisor sum function.

The proof of this result and of the extension of the result in [56] for all N such that the modular curve \(X_0(N)\) has genus 0, i.e. \(N\in \{2,\ldots ,10,12,13,16,18,25\}\), is essentially obtained by writing the character \({\text {ch}}_{V^G}\) explicitly in terms of the Hauptmodul for the group \(\Gamma _0(N)\).

Our main result is an extension of the dimension formula in [56] to levels N where there is no Hauptmodul, but rather where the modular curve \(X_0(N)\) has genus 1. In those cases, the modular curve is an elliptic curve E of conductor N defined over \({\mathbb {Q}}\), which (over \({\mathbb {C}}\)) is isomorphic to the torus \({\mathbb {C}}/\Lambda _E\) for a full lattice \(\Lambda _E\subset {\mathbb {C}}\) called the period lattice of E. Denote by \({\widehat{\zeta }}(\Lambda _E;z)\) the associated completed Weierstrass zeta function (see Sect. 2.4 for the precise definition). For simplicity, we state the theorem just for the prime levels in question. The analogous statement for square-free composite levels is given in Theorem 3.3.

Theorem 1.1

Let V be a holomorphic, strongly rational vertex operator algebra of central charge 24. Let \(G=\langle g \rangle \) be a cyclic group of automorphisms of V of order \(p\in \{11,17,19\}\) such that g is of type \(p\{0\}\). Further let \(E=X_0(p)\) be the \(\Gamma _0(p)\)-optimal elliptic curve of conductor p. Then with the assumptions and notations in Sect. 2.1, we have the following dimension formula:

$$\begin{aligned} \dim V_1+\dim V_1^{{\text {orb}}(g)}= & {} (p+1)\dim V_1^G-(p-1)C_E\\&+\,C_E\sum _{i=1}^{p-1}\sum _{j=1}^{p-1} \sigma (p-j)\dim V(g^i)_{j/p}, \end{aligned}$$

where we set

$$\begin{aligned} C_E:=-\frac{3-\#E({\mathbb {F}}_2)}{2}-{\widehat{\zeta }}\left( \Lambda _E;L(E,1)\right) . \end{aligned}$$

In particular, this dimension formula relates invariants of the underlying modular curve to the theory of VOAs. We can now exploit knowledge about arithmetic properties of these invariants to derive a simpler dimension formula in the following way.

To the best of the authors’ knowledge the question of the rationality of the value \({\widehat{\zeta }}\left( \Lambda _E;L(E,1)\right) \) has not been investigated so far. It is known due to a classical result of Schneider [50, Chapter II, §4, Satz 15] that the value of the uncompleted zeta function \(\zeta \left( \Lambda _E;L(E,1)\right) \) is in fact transcendental. Since all the other quantities in the above dimension formula are clearly rational, we obtain the following immediate corollary.

Corollary 1.2

Assume the notations as in Theorem 1.1. If we have

$$\begin{aligned} \sum _{i=1}^{p-1}\sum _{j=1}^{p-1} \sigma (p-j)\dim V(g^i)_{j/p}\ne p-1 \end{aligned}$$

for some VOA V as in Theorem 1.1, then the value \({\widehat{\zeta }}\left( \Lambda _E;L(E,1)\right) \) is rational.

Computing the zeta values in Corollary 1.2 numerically, we find that within computational precision \({\widehat{\zeta }}\left( \Lambda _E;L(E,1)\right) =17/5,\ 2,\ 4/3\) for \(p=11,\ 17,\ 19\), respectively.

In a very recent preprint [44], Möller, and Scheithauer independently find a completely general dimension formula like the one in Theorem 1.1 with no restriction on the order of the cyclic group G using expansions of vector-valued Eisenstein series. In particular, their general result simplifies to the statement of the Theorem from [45] quoted above for all primes p.

In the proof of Theorem 4.12 of loc. cit., Möller and Scheithauer show that if the order of the automorphism group G is any prime p such that the genus of \(X_0(p)\) is greater than zero, one obtains the lower bound

$$\begin{aligned} \sum _{i=1}^{p-1}\sum _{j=1}^{p-1} \sigma (p-j)\dim V(g^i)_{j/p}\ge p-1. \end{aligned}$$

As Möller and Scheithauer informed us, they have produced—using both computer calculations and theoretical considerations based on work by Chenevier and Lannes [13] on p-neighbours of Niemeier lattices—explicit examples of suitable VOAs for which the above inequality is strict, wherefore according to Corollary 1.2 the values \({\widehat{\zeta }}\left( \Lambda _E;L(E,1)\right) \) are indeed rational. In fact, comparing to the (extended) version of Möller’s result and using the examples Möller and Scheithauer have constructed, one finds the stronger statement that we have indeed the following identity for the constant \(C_E\) from Theorem 1.1,

$$\begin{aligned} C_E=-\frac{24}{p-1}. \end{aligned}$$
(1.1)

From the proof of Theorem 1.1 we can infer the following dimension formula as well, which looks similar to that in Corollary 1.2. The proof relies on the so-called Bruinier–Funke pairing (see Proposition 2.5).

Theorem 1.3

Assume the hypotheses and notation from Theorem 1.1, except that p may now denote any prime number, and let \(f(\tau )=\sum _{n=1}^\infty a(n)e^{2\pi in\tau }\in S_2(p)\) be a newform with Atkin-Lehner eigenvalue \(\varepsilon \in \{\pm 1\}\). Then we have

$$\begin{aligned} \sum _{i=1}^{p-1}\sum _{j=1}^{p-1} a(p-j)\dim V(g^i)_{j/p}=-\varepsilon p-a(p). \end{aligned}$$

Essentially, the formula in Theorem 1.3 also appears on [44, p. 24], but was proven using a different kind of pairing. We note that loosely speaking, one may interpret Theorem 1.1 in view of Theorem 1.3 as the case where one replaces the newform f by the weight 2 Eisenstein series in \(M_2(p)\).

Our proof of Theorem 1.1 relies on the following result which states that one can express any harmonic Maaß form (in the given levels) essentially in terms of Weierstrass mock modular forms and Hecke operators (see Sects. 2.3 and 2.4 for details).

Theorem 1.4

Let E denote the strong Weil curve of conductor

$$\begin{aligned} N\in \{11,14,15,17,19,21\}. \end{aligned}$$

Then any harmonic Maaß form of weight 0 for \(\Gamma _0(N)\) is is a linear combination of images of the completed Weierstrass mock modular form \({\widehat{{\mathfrak {Z}}}}_E\) associated to the \(\Gamma _0(N)\)-optimal elliptic curve E—i.e. in the cases considered E is a model for the modular curve \(X_0(N)\)—under the Hecke operators \(T_m\) and Atkin-Lehner involutions , or in other words:

$$\begin{aligned} H_0(N)\le {\text {span}}_{\mathbb {C}}\left\{ {\widehat{{\mathfrak {Z}}}}_E|W_Q|T_m|B_d \, :\, m\in {\mathbb {N}}_0,\ Q\mid N,\ d\mid N\right\} \!, \end{aligned}$$

where the operators \(B_d\) are defined in Proposition 2.8.

Remark 1.5

It is essential in Theorem 1.4 that the elliptic curves under consideration are indeed models for the modular curve \(X_0(N)\), where N is the respective conductor. In particular, the genus of \(X_0(N)\) must be equal to 1. There are six further levels N with this property, namely \(N\in \{20,24,27,32,36,49\}\), but our proof does not work in these cases for reasons we explain in Sects. 2.3 and 3.1.

Remark 1.6

As our proof will show, the statement of Theorem 1.4 remains valid for all square-free levels N if one replaces \({\widehat{{\mathfrak {Z}}}}_E\) by the Maaß-Poincaré series for \(\Gamma _0(N)\) which has exactly one simple pole at the cusp \(\infty \). In particular, one may immediately generalize Theorem 1.1 to arbitrary primes p and Theorem 3.3 to arbitrary square-free numbers N in this fashion. This way, one may obtain rationality results for the constant terms of these series in analogy to Corollary 1.2. It is however not known to the authors whether these constant terms are directly related to special values of interesting functions like the Weierstrass zeta function.

The rest of this paper is organized as follows. In Sect. 2 we recall some background material on orbifold constructions of VOAs, Weierstrass mock modular forms, and operators on modular forms. Section 3 contains the proofs of Theorems 1.1, 1.3, and 1.4 as well as a more general version of Theorem 1.1 and its proof.

2 Preliminaries

2.1 Orbifold VOAs

The construction of the moonshine module \(V^{\natural }\) [30,31,32] has greatly motivated the study of vertex operator algebras (VOAs). The problem of orbifolding a conformal field theory with respect to an automorphism rose to prominence contemporaneously in physics [17, 18]. The construction of \(V^{\natural }\) was subsequently interpreted as the first example of an orbifold model that is not equivalent to a lattice vertex operator algebra [32]. For G a group of automorphisms of V, the study of the fixed point sub-VOA \(V^G\) and its representation theory is referred to as orbifold theory. We refer the reader to [19, 45, 55] for details on cyclic orbifold theory for holomorphic VOAs and give a short summary below.

We first recall some basic definitions and properties of VOAs and their twisted modules. We refer the reader to [29, 32, 40] for more details.

A VOA V is a complex vector space equipped with two distinguished vectors \(\mathbf {1}\) and \(\omega \) called the vacuum element and the conformal vector, respectively. Further, for each vector \(v\in V\) there is a map \(Y(\cdot , z): V \rightarrow \text {End}(V)\llbracket z, z^{-1}\rrbracket \) assigning a formal power series \(Y(v, z):=\sum _{n\in {\mathbb {Z}}} v(n) z^{-n-1}\) (which we call a vertex operator) to v. The tuple \((V,\mathbf{{1}},\omega , Y)\) must satisfy several axioms (see Sect. 8.10 of [32]). In particular, the coefficients of the vertex operator attached to the conformal vector generate a copy of the Virasoro algebra of central charge c. In other words, if \(Y(\omega , z):=\sum _{n\in {\mathbb {Z}}} L(n) z^{-n-2}\) then \([L(m),L(n)]=(m-n)L(m+n)+ \frac{1}{12}(m^3-m)\delta _{m+n,0}c ,\) and we refer to c as the central charge of V. VOAs admit a \({\mathbb {Z}}\)-grading (bounded from below) so that \(V=\bigoplus _{n\in {\mathbb {Z}}} V_n\). This grading on V comes from the eigenspaces of the L(0) operator, by which we mean that \(V_n:=\{ v\in V \mid L(0)v=nv \}\). The smallest n for which \(V_n\ne 0\) is called the conformal weight of V and is denoted \(\rho (V)\). We say V is of CFT-type if \(\rho (V)=0\) and \(V_0={\mathbb {C}}{} \mathbf{{1}}\).

A V-module is a vector space M equipped with an operation \(Y_M : V \rightarrow \text {End} M \llbracket z^{\pm 1}\rrbracket \) which assigns to each \(v\in V\) a formal power series \(Y_M(v, z):=\sum _{n\in {\mathbb {Z}}} v^{M}(n) z^{-n-1}\) subject to several axioms (see Sect. 5.1 of [29]). A module M whose only submodules are 0 and itself is called simple or irreducible. A VOA V for which every admissible V-module decomposes into a direct sum of (ordinary) irreducibles is called rational and we say that V is holomorphic if it is rational and has a unique irreducible module (which must necessarily be V itself). Given a V-module W with a grading, it is possible to define a V-module \(W'\), that is (as a vector space) the graded dual space of W (for a definition of the dual module we refer to Sect. 5.2 of [33]). We say a vertex algebra V is self-dual if the module V is isomorphic to its dual \(V'\) (as a V-module). In [57], Zhu introduced a finiteness condition on a VOA V, we say V is \(C_2\)-cofinite if \(C_2(V ) := \text {span}\{v(2)w \mid v, w \in V \}\) has finite codimension in V. A VOA is called strongly rational if it is rational, \(C_2\)-cofinite, self-dual, and of CFT-type.

For G a finite group of automorphisms of V and \(g\in G\), one can define a g-twisted module V(g) of V (see Sect. 3 of [21]). By [21], for V a \(C_2\)-cofinite holomorphic VOA and \(G=\langle g \rangle \) a cyclic group of automorphisms of V, V posesses a unique simple \(g^i\)-twisted V-module, which we call \(V(g^i)\), for each \(i\in {\mathbb {Z}}/N{\mathbb {Z}}\) for N the order of g. By Proposition 4.2.3 of [45] (see also [21]) there is a representation

$$\begin{aligned} \phi _i:G\rightarrow \text {Aut}_{{\mathbb {C}}}(V(g^i)) \end{aligned}$$

of G on the vector space \(V(g^i)\) such that \(\phi _i(g)Y_{V(g^i)}(v,z)\phi _i^{-1}(g)= Y_{V(g^i)}\) for all \(i\in {\mathbb {Z}}/N{\mathbb {Z}}\) and \(v\in V\). This representation is unique up to an N-th root of unity. The eigenspace of \(\phi _i(g)\) in \(V(g^i)\) corresponding to the eigenvalue \(e^{(2\pi i)j/N}\) is denoted by \(W^{(i,j)}\) and as \({\mathbb {C}}[G]\)-modules, we have that \(V(g^i)=\bigoplus _jW^{(i,j)}\).

The fixed point sub-VOA \(V^G=W^{(0,0)}\) of V is defined to be the vectors in V which are fixed pointwise under the action of G.

The main theorem of orbifold theory [12, 20, 42] is that if V is strongly rational and G is a finite, solvable group of automorphisms of V, then the fixed-point VOA \(V^G\) is strongly rational as well.

For all \(i,j\in {\mathbb {Z}}/N{\mathbb {Z}}\), the \(W^{(i,j)}\) are irreducible \(V^G\)-modules [43] and further, by the classification of irreducible modules in [45], there are exactly \(n^2\) irreducible \(V^G\)-modules (namely, the \(W^{(i,j)}\)). We make the additional assumption that g has type \(N\{0\}\) (a certain condition on the conformal weights of the g-twisted modules, see Definition 4.7.4 of [45]), which gives us that the conformal weights obey \(\rho (V (g)) \in (1/N){\mathbb {Z}}\). This enables us to choose representations \(\phi _i\) such that the conformal weights of \(W^{(i,j)}\) obey \(\rho (W^{(i,j)}) \in (ij/N){\mathbb {Z}}\).

For V with central charge divisible by 24, the characters of the irreducible \(V^G\)-modules \(\text {ch}_{W^{(i,j)}}(\tau )= \text {tr}_{W^{(i,j)}} q^{L(0)-c/24}\) are holomorphic on the upper half-plane and modular of weight 0 for \(\Gamma _0(N)\) ([55, Theorem 5.1]).

We also assume that \(V^G\) satisfies the positivity assumption, which states that for a simple VOA V, the conformal weights of any irreducible V-module \(W\ne V\) are positive and the conformal weight of V is zero.

If \(V^G\) satisfies the positivity assumption, the orbifold VOA of V with respect to g is defined to be

$$\begin{aligned} V^{\text {orb}(g)}:=\bigoplus _{i\in {\mathbb {Z}}/N{\mathbb {Z}}} W^{(i,0)}. \end{aligned}$$

Note that if V is strongly rational, then \(V^{\text {orb}(g)}\) has the structure of a holomorphic, strongly rational VOA of the same central charge as V.

We refer to work by Zhu [57], Dong–Li–Mason [21], and Dong–Lin–Ng [22] for details on the modular invariance of irreducible (twisted) modules for \(C_2\)-cofinite VOAs. We recall the following results from [55, 56].

Proposition 2.1

The characters \({\text {ch}}_{W^{(i,j)}}(\tau )\) form a vector-valued modular form of weight 0 for the Weil representation associated to the finite quadratic module \(({\mathbb {Z}}/N{\mathbb {Z}})\times ({\mathbb {Z}}/N{\mathbb {Z}})\) endowed with the quadratic form \(q((i,j))=ij/N+{\mathbb {Z}}\). In particular, their transformation properties under the standard generators \(S=\left( \begin{array}{cc} 0 &{} -1 \\ 1 &{} 0\end{array}\right) \) and \(T=\left( \begin{array}{cc} 1 &{} 1 \\ 0 &{} 1\end{array}\right) \) of \({\text {SL}}_2({\mathbb {Z}})\) are given by

$$\begin{aligned} {\text {ch}}_{W^{(i,j)}}(S.\tau )=\frac{1}{n} \sum \limits _{k,\ell \in {\mathbb {Z}}/N{\mathbb {Z}}} e^{(2\pi i) (i\ell +jk)/N}{} ch _{W^{(k,\ell )}}(\tau ), \end{aligned}$$

and

$$\begin{aligned} {\text {ch}}_{W^{(i,j)}}(T.\tau )= e^{(2\pi i) ij/N}{} ch _{W^{(i,j)}}(\tau ). \end{aligned}$$

From equation (7) of [56], we have the following transformation property.

Proposition 2.2

The character \(ch _{V^G}(\tau )\) is a modular function for \(\Gamma _0(N)\) and moreover, for a matrix \(\gamma = \left( \begin{array}{cc} a &{} b \\ c &{} d \end{array} \right) \in {\text {SL}}_2({\mathbb {Z}})\), sending \(\infty \) to the cusp \({\mathfrak {a}}=a/c\) with \(c\mid N\) and \(\gcd (a,c)=1\), we haveFootnote 1

$$\begin{aligned} {\text {ch}}_{W^{(0,0)}}(\gamma .\tau )=\frac{c}{N} \sum \limits _{i, j\in {\mathbb {Z}}/(N/c){\mathbb {Z}}} e^{(2\pi i) dcij/N}{} ch _{W^{(ci,cj)}}(\tau ). \end{aligned}$$

For a cusp \({\mathfrak {a}}\) of \(\Gamma _0(N)\), van Ekeren, Möller, and Scheithauer [56] define the function

$$\begin{aligned} F_{\mathfrak {a}}(\tau ):=\sum \limits _{\begin{array}{c} \gamma \in \Gamma _0(N)\setminus {\text {SL}}_2({\mathbb {Z}})\\ \gamma .\infty ={\mathfrak {a}} \end{array}} \text {ch}_{W^{(0,0)}}(\gamma .\tau ). \end{aligned}$$
(2.1)

In [56, Proposition 3.6], they give the following general identity for this function \(F_{\mathfrak {a}}\) which is essential in establishing the dimension formulas.

Proposition 2.3

The function \(F_{\mathfrak {a}}\) defined in (2.1) satisfies the identity

$$\begin{aligned} \sum _{{\mathfrak {a}}} F_{\mathfrak {a}}(\tau )=\sum \limits _{d\mid N} \dfrac{\varphi (\gcd (d,N/d))}{\gcd (d,N/d)}{\text {ch}}_{V^{{\text {orb}}(g^d)}}(\tau ), \end{aligned}$$

where the sum over \({\mathfrak {a}}\) runs over a set of representatives of cusps of \(\Gamma _0(N)\) and \(\varphi (n):=\#({\mathbb {Z}}/n{\mathbb {Z}})^*\) denotes Euler’s totient function.

2.2 Mock modular forms and harmonic Maaß forms

In this section, we briefly recall some basic definitions and facts about mock modular forms and harmonic Maaß forms. For more detailed information as well as references to original works, the reader may consult for example the book [8].

A harmonic Maaß form of weight \(k\in {\mathbb {Z}}\) for the group \(\Gamma _0(N)\) is a smooth function \(f:{\mathfrak {H}}\rightarrow {\mathbb {C}}\) satisfying the following three conditions:

  1. 1.

    f is invariant under the weight k slash operator,

    $$\begin{aligned} f|_k\left( \begin{array}{cc} a &{} b \\ c &{} d \end{array}\right) :=(c\tau +d)^{-k} f\left( \frac{a\tau +b}{c\tau +d}\right) =f(\tau )\quad \text {for all } \tau \in {\mathfrak {H}}, \left( \begin{array}{cc} a &{} b \\ c &{} d \end{array}\right) \in \Gamma _0(N). \end{aligned}$$
  2. 2.

    f is annihilated by the weight k hyperbolic Laplacian (\(\tau =x+iy\)),

    $$\begin{aligned} \Delta _k f := \left[ -y^2\left( \frac{\partial ^2}{\partial x^2}+\frac{\partial ^2}{\partial y^2}\right) +iky\left( \frac{\partial }{\partial x}+i\frac{\partial }{\partial y}\right) \right] f\equiv 0. \end{aligned}$$
  3. 3.

    f has at most linear exponential growth at the cusps, i.e. there exists a polynomial \(H\in {\mathbb {C}}[X]\) such that \(f-H(q^{-1})\) has exponential decay towards infinity and analogous conditions hold at all other cusps.

The space of these forms is denoted by \(H_k(N)\). The subspaces \(S_k(N)\subseteq M_k(N)\subseteq M_k^!(N)\subseteq H_k(N)\) denote the spaces of cusp forms, modular forms, and weakly holomorphic modular forms. It is sometimes convenient to relax the conditions to allow poles in the upper half-plane, in which case we speak of polar harmonic Maaß forms.

These functions naturally split into a holomorphic and a non-holomorphic part [8, Lemma 4.3], \(f=f^++f^-\). The holomorphic part of a harmonic Maaß form is called a mock modular form. If f is a polar harmonic Maaß form we call \(f^+\) a polar mock modular form. Vice versa, given a mock modular form f, we refer to the harmonic Maaß form \({{\widehat{f}}}\) having it as its holomorphic part as the (modular) completion of f.

The non-holomorphic part of a harmonic Maaß form is related to a cusp form called the shadow of the corresponding mock modular form [8, Theorem 5.10].

Proposition 2.4

The operator \(\xi _k=2iy^k\overline{\frac{\partial }{\partial {\overline{\tau }}}}\) defines a surjective \({\mathbb {C}}\)-antilinear map

$$\begin{aligned} H_k(N)\twoheadrightarrow S_{2-k}(N) \end{aligned}$$

with kernel \(M_k^!(N)\).

An important tool obtained from the \(\xi \)-operator is the so-called Bruinier–Funke pairing, defined by

$$\begin{aligned} \{\cdot ,\cdot \}: M_k(N)\times H_{2-k}(N)\rightarrow {\mathbb {C}},\ \{g,f\}:=\langle g,\xi _{2-k}f\rangle , \end{aligned}$$

where for \(g_1,g_2\in M_k(N)\) such that \(g_1g_2\) is a cusp form we define

$$\begin{aligned} \langle g_1,g_2\rangle :=\frac{1}{[{\text {SL}}_2({\mathbb {Z}}):\Gamma _0(N)]}\int _{\Gamma _0(N)\setminus {\mathfrak {H}}} g_1(\tau )\overline{g_2(\tau )}y^k\frac{dxdy}{y^2} \end{aligned}$$

as the classical Petersson scalar product. With this we have the following important result (see [8, Proposition 5.10]), which follows essentially from an application of Stokes’s Theorem.

Proposition 2.5

Let \(g\in M_k(N)\) and \(f\in H_{2-k}(N)\). For a cusp \({\mathfrak {a}}\) of \(\Gamma _0(N)\) of width h, fix \(\gamma \in {\text {SL}}_2({\mathbb {Z}})\) with \(\gamma .(i\infty )={\mathfrak {a}}\) and consider the Fourier expansions

$$\begin{aligned} (g|\gamma )(\tau )=\sum _{n=0}^\infty a_{\mathfrak {a}}(n)q^{n/h}\quad \text {and}\quad (f|\gamma )^+(\tau )=\sum _{m\gg -\infty } b_{\mathfrak {a}}(n)q^{n/h}. \end{aligned}$$

Then we have

$$\begin{aligned} \{g,f\}=\sum _{\mathfrak {a}}\sum _{n\le 0} a_{\mathfrak {a}}(-n)b_{\mathfrak {a}}(n). \end{aligned}$$

An easy and well-known consequence of this is the following corollary.

Corollary 2.6

A harmonic Maaß form in \(H_{2-k}(N)\) with no pole at any cusp is a holomorphic modular form.

2.3 Operators on modular forms

Hecke operators are certainly the most important operators on modular forms. We first review their definition and some basic properties. For this, consider for any \(N,m\in {\mathbb {N}}\) the set

$$\begin{aligned} {\mathcal {M}}_m(N)=\left\{ M=\left( \begin{array}{cc} a &{} b \\ c &{} d \end{array}\right) \in {\mathbb {Z}}^{2\times 2}\, :\, \det M=m,\ N\mid c,\ \gcd (a,N)=1\right\} . \end{aligned}$$

The group \(\Gamma _0(N)\) acts on \({\mathcal {M}}_m(N)\) by left-multiplication and we let \(\beta _1,\ldots ,\beta _s\) denote a set of coset representatives of this action. For any function \(f:{\mathfrak {H}}\rightarrow {\mathbb {C}}\) transforming like a modular form of weight \(k\in {\mathbb {Z}}\) under \(\Gamma _0(N)\) we then define the m-th Hecke operator acting on f by

$$\begin{aligned} f|T_m^{(N)}=f|T_m=m^{k/2-1}\sum _{\beta \in \Gamma _0(N)\setminus {\mathcal {M}}_m(N)} f|_k\beta , \end{aligned}$$
(2.2)

where we extend the action of the weight k slash operator to matrices with positive discriminant in the usual way by

$$\begin{aligned} (f|_k\gamma )(\tau )=(\det \gamma )^{k/2}(c\tau +d)^{-k}f\left( \frac{a\tau +b}{c\tau +d}\right) . \end{aligned}$$

We usually omit the indication of the level of the Hecke operator if it is clear from context or not relevant for the action.

These operators form a commutative algebra and they are multiplicative, i.e. one has \(T_mT_n=T_{mn}\) for any coprime mn. Their action on Fourier expansions is particularly easy to describe when \(m=p\) is prime. Then we have

$$\begin{aligned} f|T_p={\left\{ \begin{array}{ll} f|U_p+p^{k-1}f|B_p &{} \text {if }p\not \mid N \\ f|U_p &{} \text {if }p\mid N\end{array}\right. } \end{aligned}$$

where for \(f(\tau )=\sum _{n\in {\mathbb {Z}}}a_f(n,y)q^n\) we set

$$\begin{aligned} (f|B_m)(\tau )=f(m\tau )=\sum _{n\in {\mathbb {Z}}} a_f(n,y)q^{mn}\qquad \text {and}\qquad (f|U_m)(\tau )=\sum _{n\in {\mathbb {Z}}} a_f(mn,y/m)q^n. \end{aligned}$$

We record the following easy corollary ([15, Corollary 13.3.10]) of the Multiplicity 1-Theorem (see for instance [15, Theorem 13.3.9]).

Lemma 2.7

Let H be an operator on the space \(S_k(N)\) of weight k cusp forms for \(\Gamma _0(N)\) which commutes with all Hecke operators \(T_p\) for \(p\not \mid N\). Then any newform is an eigenfunction of H.

Another important set of operators is given by the Atkin–Lehner involutions. For any exact divisor Q of N, i.e. \(Q\mid N\) and \(\gcd (Q,N/Q)=1\), we define the Atkin-Lehner operator via the matrix

$$\begin{aligned} W_Q=\frac{1}{\sqrt{Q}}\begin{pmatrix} Qx &{} y \\ Nz &{} Qt \end{pmatrix}, \end{aligned}$$
(2.3)

where \(x,y,z,t\in {\mathbb {Z}}\) are chosen so that \(\det W_Q=1\). In the following proposition, we collect several well-known properties of these operators which will become important in the proof of Theorem 1.4. These can be found for instance in [15, Lemma 6.6.4, Proposition 13.2.6].

Proposition 2.8

Let \(m\in {\mathbb {N}}\) and \(Q,Q'\) exact divisors of N and let \(f:{\mathfrak {H}}\rightarrow {\mathbb {C}}\) be a function transforming like a modular form of weight \(k\in 2{\mathbb {Z}}\) for \(\Gamma _0(N)\). Then the following are true.

  1. (i)

    As matrices, we have \(W_Q=B_Q^{-1}\gamma =\gamma 'B_Q\) for \(\gamma ,\gamma '\in \Gamma _0(N/Q)\) and where we set \(B_m:=\frac{1}{\sqrt{m}}\left( \begin{array}{cc} m &{} 0 \\ 0 &{} 1\end{array}\right) \).

  2. (ii)

    \(W_Q\) normalizes \(\Gamma _0(N)\).

  3. (iii)

    We have \(W_Q^2\in \Gamma _0(N)\) and \(f|W_Q|W_{Q'}=f|W_{Q'}|W_Q=f|W_{QQ'}\)

  4. (iv)

    For \(\gcd (m,Q)=1\) we have \(f|W_Q|T_m=f|T_m|W_Q\).

  5. (v)

    For \(\gcd (m,Q)=1\) we have \(f|W_Q|B_m=f|B_m|W_Q\).

  6. (vi)

    If \(Q=p\) is prime, then \(f|U_p+p^{k/2-1}f|W_p\) transforms like a modular form for \(\Gamma _0(N/p)\).

2.4 Weierstrass mock modular forms

In this section, we briefly recall the construction of Weierstrass mock modular forms. The idea for this construction is due to Guerzhoy [34, 35] and was developed further by Alfes et al. [1].

Let E be an elliptic curve defined over \({\mathbb {Q}}\) of conductor N defined by the Weierstrass equation

$$\begin{aligned} E:\,y^2=4x^3-g_2x-g_3. \end{aligned}$$

As mentioned in the introduction, this curve (considered over \({\mathbb {C}}\)) is isomorphic to a flat torus \(C/\Lambda _E\), where \(\Lambda _E\subset {\mathbb {C}}\) is a 2-dimensional \({\mathbb {Z}}\)-lattice. This isomorphism is given by

$$\begin{aligned} {\mathbb {C}}/\Lambda _E\rightarrow E,\, z+\Lambda _E\mapsto {\left\{ \begin{array}{ll} (\wp (\Lambda _E;z),\wp '(\Lambda _E;z)) &{} \text {if }z\notin \Lambda _E \\ {\mathcal {O}}&{} \text {otherwise},\end{array}\right. } \end{aligned}$$

where

$$\begin{aligned} \wp (\Lambda _E;z)= \frac{1}{z^2}+\sum _{\omega \in \Lambda _E\setminus \{0\}} \left( \frac{1}{(z-\omega )^2}-\frac{1}{\omega ^2}\right) \end{aligned}$$

denotes the Weierstrass \(\wp \)-function and \({\mathcal {O}}\in E\) denotes the point at infinity. Recall that \(\wp (\Lambda _E;z+\omega )=\wp (\Lambda _E;z)\) for all \(\omega \in \Lambda _E\) and in fact the field of all elliptic functions, i.e. meromorphic functions with this exact periodicity property, is given by \({\mathbb {C}}(\wp )[\wp ']\), where \(\wp \) satisfies the differential equation

$$\begin{aligned} (\wp ')^2=4\wp ^3-g_2-g_3. \end{aligned}$$

The \(\wp \)-function has poles of order 2 with residue 0 at all lattice points by construction. Its Laurent expansion around 0 is given by

$$\begin{aligned} \wp (\Lambda _E;z)=\frac{1}{z^2}+\sum _{n=2}^\infty (2n-1)G_{2n}(\Lambda _E)z^{2n-2}, \end{aligned}$$

where for integers \(k>2\), \(G_{2n}(\Lambda _E)=\sum _{\omega \in \Lambda _E\setminus \{0\}} \omega ^{-k}\) denotes the weight k Eisenstein series of \(\Lambda _E\), which is of course 0 if k is odd. The negative antiderivative of the Weierstrass \(\wp \)-function, called the Weierstrass \(\zeta \)-function, therefore has simple poles at all lattice points and nowhere else and is given by

$$\begin{aligned} \zeta (\Lambda _E;z)=\frac{1}{z} +\sum _{\omega \in \Lambda _E\setminus \{0\}}\left( \frac{1}{z-\omega }+\frac{1}{\omega }+\frac{z}{\omega ^2}\right) =\frac{1}{z} -\sum _{n=2}^{\infty } G_{2n}(\Lambda _E)z^{2n-1}. \end{aligned}$$

However, by Liouville’s famous theorems on elliptic functions, there cannot be an elliptic function with simple poles only at lattice points and nowhere else, so \(\zeta (\Lambda _E;z)\) is not quite an elliptic function. It was first observed by Eisenstein (in a special case) that there is a canonical way to complete the Weierstrass \(\zeta \)-function to a function which has the periodicity behaviour of an elliptic function at the expense of no longer being holomorphic. In order to define Eisenstein’s completed Weierstrass \(\zeta \)-function let

$$\begin{aligned} G_2^*(\Lambda _E)=\lim _{s\rightarrow 0} \sum _{\omega \in \Lambda _E\setminus \{0\}} \omega ^{-2}|\omega |^{-2s} \end{aligned}$$

denote the completedFootnote 2 Eisenstein series of weight 2. By the famous modularity theorem, there is a newform \(f_E\in S_2(N)\) with integer Fourier coefficients associated to E such that the L-functions of E and \(f_E\) agree, which by Eichler-Shimura theory yields a polynomial map

$$\begin{aligned} \phi _E:X_0(N)\rightarrow {\mathbb {C}}/\Lambda _E, \end{aligned}$$

the modular parametrization of E. Then the non-holomorphic function

$$\begin{aligned} {\widehat{\zeta }}(\Lambda _E;z)=\zeta (\Lambda _E;z)-G_2^*(\Lambda _E)z-\frac{\deg \phi _E}{4 \pi \Vert f_E\Vert ^2}{\overline{z}}, \end{aligned}$$

where \(\Vert \cdot \Vert \) denotes the Petersson norm, satisfies \({\widehat{\zeta }}(\Lambda _E;z+\omega )={\widehat{\zeta }}(\Lambda _E;z)\) for all \(z\in {\mathbb {C}}\setminus \Lambda _E\) and \(\omega \in \Lambda _E\).

The newform \(f_E\) has a Fourier expansion \(f_E(\tau )=\sum _{n=1}^\infty a_E(n)q^n\) with \(q=e^{2\pi i\tau }\). Denoting by

$$\begin{aligned} {\mathcal {E}}_E(\tau )=-2\pi i\int _\tau ^{\infty } f_E(t)dt =\sum _{n=1}^\infty \frac{a_E(n)}{n}q^n \end{aligned}$$

the Eichler integral of \(f_E\), one finds the following result [1, Theorem 1.1].

Theorem 2.9

The function

$$\begin{aligned} {\mathfrak {Z}}_E(\tau )=\zeta (\Lambda _E;{\mathcal {E}}_E(\tau ))-G_2^*(\Lambda _E){\mathcal {E}}_E(\tau ), \end{aligned}$$

called the Weierstrass mock modular form is a polar mock modular form of weight 0 for the group \(\Gamma _0(N)\). To be more precise, there exists a meromorphic modular function \(M_E\) for \(\Gamma _0(N)\) such that the function

$$\begin{aligned} {\widehat{{\mathfrak {Z}}}}_E(\tau )={\widehat{\zeta }}(\Lambda _E;{\mathcal {E}}_E(\tau ))-M_E(\tau ) \end{aligned}$$

is a harmonic Maaß form of weight 0 for \(\Gamma _0(N)\).

It is immediately clear from the definition that the function \({\mathfrak {Z}}_E\) has poles precisely where the value of the Eichler integral \({\mathcal {E}}_E(\tau )\) lies in the period lattice \(\Lambda _E\). It is an open problem to classify those points \(\tau \) in the complex upper half-plane \({\mathfrak {H}}\) where this occurs, but the following lemma, whose proof can be found for example in [2], allows us to rule out poles in the situation where E and the modular curve \(X_0(N)\) are actually isomorphic, so where the degree of \(\phi _E\) is 1.

Lemma 2.10

Let E be the strong Weil curve of conductor N such that \(X_0(N)\) has genus 1, i.e. \(N\in \{11,14,15,17,19,20,21,24,27,32,36,49\}\). Then the Weierstrass mock modular form \({\mathfrak {Z}}_E\) has no poles in \({\mathfrak {H}}\).

For the purpose of this paper, it is important to consider the behaviour of the (completed) Weierstrass mock modular form at other cusps than infinity. For this, we need the following slight generalization of [1, Theorem 1.2].

Proposition 2.11

Let \(\nu \in {\textsf {N}}(\Gamma _0(N))\), the normalizer of \(\Gamma _0(N)\) in \({\text {SL}}_2({\mathbb {R}})\), which commutes with all Hecke operators \(T_p\) with prime \(p\not \mid N\). Then we have

$$\begin{aligned} \left( {\widehat{{\mathfrak {Z}}}}_E|_0\nu \right) (\tau )={\widehat{\zeta }} (\Lambda _E;\lambda _\nu ({\mathcal {E}}_E(\tau )-\Omega _{\nu ^{-1}}(f_E))) \end{aligned}$$

where \(\Omega _\nu (f_E)=-2\pi i\int _{\nu ^{-1}\infty }^\infty f_E(t)dt\) and \(\lambda _\nu \) is the eigenvalue of \(f_E\) under \(\nu \) (see Lemma 2.7). In particular for \(-\lambda _\nu \Omega _\nu (f_E)\notin \Lambda _E\) we find the asymptotic

$$\begin{aligned} ({\mathfrak {Z}}_E|_0\nu )(iy)\sim {\widehat{\zeta }}(-\lambda _\nu \Omega _\nu (f_E))+\exp (-\alpha y)\qquad \text {as } y\rightarrow \infty , \end{aligned}$$

for some \(\alpha >0\).

Proof

In [1, Theorem 1.2], the result is stated for \(\nu \) an Atkin-Lehner involution. The exact same proof goes through, only applying Lemma 2.7 in the substitutions. In fact, the computation goes through even for any elliptic curve \(E/{\mathbb {Q}}\) and matrix \(\sigma \in {\text {SL}}_2({\mathbb {R}})\) such that \(\sigma \Gamma _0(N)\sigma ^{-1}\cap \Gamma _0(N)\) has finite index in \(\Gamma _0(N)\): One finds

$$\begin{aligned} ({\widehat{{\mathfrak {Z}}}}_E|_0\sigma )(\tau )= & {} {\widehat{\zeta }}\left( \Lambda _E;-2\pi i\int _{\sigma .\tau }^{i\infty } f_E(z)dz\right) \nonumber \\= & {} {\widehat{\zeta }}\left( \Lambda _E;-2\pi i\int _{\tau }^{i\infty } (f_E|_2\sigma )(z)dz+2\pi i\int _{\sigma ^{-1}.(i\infty )}^{i\infty } (f_E|_2\sigma )(z)dz\right) \nonumber \\= & {} {\widehat{\zeta }}\left( \Lambda _E;-2\pi i\int _{\tau }^{i\infty } (f_E|_2\sigma )(z)dz+\Omega _{\sigma ^{-1}}(f_E)\right) . \end{aligned}$$
(2.4)

The claim then follows immediately using Lemma 2.7. \(\square \)

Remark

In the case of interest to us, the space \(S_2(N)\) is one-dimensional. Since \({\textsf {N}}(\Gamma _0(N))\) acts on the space of cusp forms, a cusp form in those levels must be an eigenfunction under any element of the normalizer, so the proof goes through here without the appeal to the Multiplicity-one theorem and Lemma 2.7.

Corollary 2.12

For all levels \(N\in \{11,14,15,17,19,20,21,24,27,32,36\}\), the completed Weierstrass mock modular form \({\widehat{{\mathfrak {Z}}}}_E\) for the strong Weil curve E of conductor N has a simple pole at \(\infty \) and is constant at all other cusps.

Proof

For the given N, the normalizer \({\textsf {N}}(\Gamma _0(N))\) acts transitively on the cusps of \(\Gamma _0(N)\). Note that for the square-free levels, it is well-known that the Atkin-Lehner operators already act transitively on the cusps. By computing the relevant periods \(\Omega _\nu (f_E)\) explicitly,Footnote 3 we see that none of them are in \(\Lambda _E\) and the claim follows. \(\square \)

Remark

For the remaining level 49, the normalizer does not act transitively on cusps. However, one can use the fact that

$$\begin{aligned} \frac{1}{2\pi i}\frac{\partial }{\partial \tau }{\widehat{{\mathfrak {Z}}}}_E(\tau )=\frac{1}{g_{49}(\tau )}\left( \frac{1}{2400}E_4(7\tau )-\frac{2401}{2400}E_4(49\tau )+G_{49}(\tau )\right) , \end{aligned}$$

where \(g_{49}(\tau )=q + q^2 - q^4 - 3q^8 - 3q^9 + O(q^{11})\) denotes the unique newform in \(S_2(49)\) and \(G_{49}(\tau )=-q + q^3 - q^4 - q^5 - q^6 + 49/10q^7 + 5q^8+q^{9}-6q^{10}+O(q^{11})\in S_{4}(49)\), is a weakly holomorphic modular form of weight 2. The fact that the derivative of \({\widehat{{\mathfrak {Z}}}}_E\) is a weakly holomorphic modular form is a general consequence of Bol’s identity and for the identification one notices that by (2.4), the function \({\widehat{{\mathfrak {Z}}}}_E\) and therefore its derivative can have at most a simple pole at any cusp, so that \(\frac{1}{2\pi i}\frac{\partial }{\partial \tau }{\widehat{{\mathfrak {Z}}}}_E\cdot g_{49}\) is a holomorphic modular form of level 49. Due to this identity, it can be checked that its only pole is at infinity (in fact, it vanishes at all other cusps), wherefore, since differentiation commutes with the action of \({\text {SL}}_2({\mathbb {R}})\) in weight 0 and doesn’t introduce or add any poles, Corollary 2.12 is also true for \(N=49\). The same argument would of course also work in the cases covered by Corollary 2.12.

3 Proofs

3.1 Proof of Theorem 1.4

Before proceeding to the proof of Theorem 1.4, we require a general result on the action of Hecke operators on Poincaré series. Recall that one may formally define a Poincaré series of weight k for the group \(\Gamma \le {\text {SL}}_2({\mathbb {Z}})\) by averaging a suitably periodic seed function \(\varphi :{\mathfrak {H}}\rightarrow {\mathbb {C}}\) over the coset representatives \(\Gamma _\infty {\setminus }\Gamma \) where \(\Gamma _\infty ={\text {Stab}}_\Gamma (\infty )\) denotes the stabilizer of the cusp \(\infty \), i.e.

$$\begin{aligned} {\mathcal {P}}(\Gamma ,k,\varphi ):=\sum _{\gamma \in \Gamma _\infty \setminus \Gamma } \varphi |_k\gamma . \end{aligned}$$

If the defining series converges absolutely, this defines a function which transforms like a modular form of weight k under \(\Gamma \) (see for instance [48, Lemma 8.2] and the references therein). Restricting to the case of \(\Gamma =\Gamma _0(N)\), one can compute their Fourier expansions fairly explicitly, especially in the most important cases for our purposes, where the seed function is either the exponential function \(\varphi (\tau )=\exp (2\pi im\tau )\), \(m\in {\mathbb {Z}}\), or a modified version of the Whittaker function (see [48, Section 8] for details) yielding harmonic Maaß forms. In those cases, the Fourier coefficients of the mth Poincaré take the general form

$$\begin{aligned} a_m^{(N,k)}(n)=C_k(n/m)^{(k-1)/2}\sum _{c=1}^\infty \frac{K(m,n,Nc)}{Nc}{\mathcal {J}}_k\left( \frac{\sqrt{mn}}{Nc}\right) , \end{aligned}$$
(3.1)

where \(C_k\) is some constant depending on the weight k, \({\mathcal {J}}_k\) is a suitable test functionFootnote 4 so that the sum converges absolutely, and K(mnc) denotes the Kloosterman sum

$$\begin{aligned} K(m,n,c)=\sum _{d\,(c)^*}\exp \left( 2\pi i\frac{m{{\overline{d}}}+nd}{c}\right) , \end{aligned}$$
(3.2)

where the sum runs over all d modulo c with \(\gcd (c,d)=1\) and \(d{{\overline{d}}}\equiv 1\pmod c\). Kloosterman sums satisfy the so-called Selberg identity,

$$\begin{aligned} K(m,n,c)=\sum _{d\mid \gcd (m,n,c)} dK(1,mn/d^2,c/d). \end{aligned}$$
(3.3)

This identity was first noted without proof by Selberg [51]. The first published proof was found by Kuznetsov [39] using his famous summation formula, and an elementary proof was found by Matthes [41]. Using this, we can show the following general result.

Proposition 3.1

Let \(k\le 0\), and \(N,\nu \in {\mathbb {N}}\). Further denote the \(\nu \)th Maaß-Poincaré series of weight k and level N normalized so that its principal part at \(\infty \) is given by \(q^{-\nu }+O(1)\) by \(P^{(N,k)}_\nu (\tau )\). Then we have that

$$\begin{aligned} P^{(N,k)}_\nu =\sum _{d\mid \gcd (N,\nu )} (\nu /d)^{1-k}P^{(N/d,k)}_1|T_{\nu /d}^{(N/d)}|B_d. \end{aligned}$$
(3.4)

Proof

The action of Hecke operators in level N may be solely defined on the space of one-periodic holomorphic functions together with a weight k slash action of \({\text {SL}}_2({\mathbb {R}})\) via their actions on Fourier expansions: For a function \(f(\tau )=\sum _{n\in {\mathbb {Z}}} a(n)q^n\), we have (see for instance [15, Proposition 10.2.5]) \((f|T_m^{(N)})=\sum _{n\in {\mathbb {Z}}} b(n)q^n\) where

$$\begin{aligned} b(n)=\sum _{\begin{array}{c} d\mid \gcd (m,n) \\ \gcd (d,N)=1 \end{array}} d^{k-1}a(mn/d^2). \end{aligned}$$
(3.5)

Since a harmonic Maaß form is uniquely determined by its holomorphic part, we restrict our attention to the holomorphic part of the right-hand side of (3.4). Using (3.5), this is given by

$$\begin{aligned} \sum _{d\mid \gcd (N,\nu )} (\nu /d)^{1-k}\sum _{n\in {\mathbb {Z}}} \left[ \sum _{\begin{array}{c} t\mid \gcd (\nu /d,n) \\ \gcd (N/d,t)=1 \end{array}} t^{k-1}a^{(N/d,k)}_1\left( \frac{n\nu /d}{t^2}\right) \right] q^{dn}. \end{aligned}$$

The principal part of the holomorphic part is easily seen to equal \(q^{-\nu }\) as desired, since the only term then surviving in the sum is the one with \(d=\gcd (N,\nu )\) and \(t=\nu /d\). The nth coefficient for \(n>0\) is given by

$$\begin{aligned} \nu ^{1-k}\sum _{d\mid \gcd (N,\nu ,n)} \left[ \sum _{\begin{array}{c} t\mid \gcd (\nu /d,n/d) \\ \gcd (N/d,t)=1 \end{array}} (dt)^{k-1}a^{(N/d,k)}_1\left( \frac{n\nu }{(dt)^2}\right) \right] . \end{aligned}$$

Plugging in the definition of the coefficient \(a^{(N/d,k)}_1\left( \frac{n\nu }{(dt)^2}\right) \) then yields

$$\begin{aligned} \begin{aligned}&C_k\nu ^{1-k}\sum _{d\mid \gcd (N,\nu ,n)}\sum _{\begin{array}{c} t\mid \gcd (\nu /d,n/d) \\ \gcd (N/d,t)=1 \end{array}} (\nu n)^{(k-1)/2}\sum _{c=1}^\infty \frac{K\left( 1, \frac{\nu n}{(dt)^2},\frac{N}{d} c\right) }{\frac{N}{d} c}{\mathcal {J}}_k \left( \frac{\sqrt{\frac{\nu n}{(dt)^2}}}{\frac{N}{d} c}\right) \\&\quad = C_k(n/\nu )^{(k-1)/2}\sum _{d\mid \gcd (N,\nu ,n)}\sum _{\begin{array}{c} t\mid \gcd (\nu /d,n/d) \\ \gcd (N/d,t)=1 \end{array}} \sum _{c=1}^\infty (dt)\frac{K\left( 1,\frac{\nu n}{(dt)^2},\frac{N(ct)}{dt}\right) }{N(ct)}{\mathcal {J}}_k\left( \frac{\sqrt{\nu n}}{N (ct)}\right) . \end{aligned} \end{aligned}$$

We may and do assume without loss of generality that the defining series for the coefficient \(a_1^{N,k}\) is absolutely convergent, since in the cases of interest to us, this can be achieved essentially by a Hecke-trick-like argument and analytic continuation (see for instance [10, Chapter 1] for details). Noticing further that every common divisor of \(Nc,\nu ,n\) can be uniquely factored into a common divisor d of \(N,\nu ,n\) and a common divisor t of \(c,\nu /d,n/d\) which is coprime to N/d, we may rearrange the above sum to obtain the expression

$$\begin{aligned} C_k(n/\nu )^{(k-1)/2}\sum _{c=1}^\infty \left[ \sum _{d\mid \gcd (Nc,\nu ,n)}dK\left( 1,\frac{\nu n}{d^2},\frac{Nc}{d}\right) \right] \frac{{\mathcal {J}}_k\left( \frac{\sqrt{\nu n}}{N c}\right) }{Nc}. \end{aligned}$$

By the Selberg identity (3.3) we see by comparing to (3.1) that this is exactly the coefficient \(a_\nu ^{(N,k)}(n)\). The constant terms may be compared through a similar but easier argument, which we refrain from carrying out here, therefore completing the proof. \(\square \)

For levels \(N\in \{1,\ldots ,10,12,13,16,18,25\}\), where the modular surface \(X_0(N)\) has genus 0, and weight \(k=0\), the above result has been shown using ad hoc methods in [5, Lemma 2.11], the result for general levels in weight 0 is stated for \(\gcd (N,\nu )=1\) and (incorrectly) for \(\nu \mid N\) in [9, Theorem 1.1] (see also [7]). In [38, Theorem 1.1], Jeon, Kang, and Kim give a slightly different proof of Proposition 3.1 for the case of weight 0, which is not an important restriction, and use it to prove congruences for the Fourier coefficients of modular functions for genus 1 levels (see loc. cit., Theorem 1.6). The analogous statement for cuspidal Poincaré series may also be obtained from the Petersson coefficient formula together with the fact that Hecke operators are Hermitian with respect to the Petersson inner product on the space of cusp forms, see [15, Proposition 10.3.19] for the case \(N=1\), but which is easily generalized to higher levels.

Proof of Theorem 1.4

According to Corollary 2.12, the Weierstrass mock modular form is (up to a possible additive constant which is of no importance here) the first Maaß-Poincaré series in the respective level with its only pole at the cusp \(\infty \). Proposition 3.1 shows how to obtain harmonic Maaß forms with arbitrarily high pole orders at infinity by the application of Hecke operators, provided that we are able to express the lower-level Poincaré series needed in (3.4) in terms of functions of the form \({\widehat{{\mathfrak {Z}}}}_E|W_Q|T_m|B_d\), as required in the theorem.

We therefore need to show first that we can generate the Poincaré series \(P_1^{(d,0)}\) for all divisors \(d\mid N\) for the relevant levels \(N\in \{11,14,15,17,19,21\}\). By Proposition 2.8 (vi), we know that \(pf|U_p+f|W_p\) transforms under \(\Gamma _0(N/p)\) for any function f transforming like a modular function for \(\Gamma _0(N)\). Applying this to the function \(P_1^{(N,0)}|W_p\) shows that \(P_1^{N,0}+p P_1^{N,0}|W_p|U_p\) is a harmonic Maaß form on \(\Gamma _0(N/p)\). Viewed as a harmonic Maaß form for \(\Gamma _0(N)\), this function has a principal part \(q^{-1}+O(1)\) at \(\infty \) and by applying the Atkin-Lehner operator \(W_p=\gamma \cdot \left( \begin{array}{cc} \sqrt{p} &{} 0 \\ 0 &{} 1/\sqrt{p}\end{array}\right) \) (cf. Proposition 2.8 (i)) to it once more, we see that it has principal part \({(q^{1/p})}^p+O(1)\) at the cusp N/p of \(\Gamma _0(N)\). The same is true for the Poincaré series \(P_1^{N/p,0}\) viewed as a harmonic Maaß form for \(\Gamma _0(N)\), so the two functions can only differ by a constant by Corollary 2.6. Since N is square-free by assumption, we can repeat this process to obtain all Poincaré series \(P_1^{d,0}\) in this fashion, keeping in mind the commutation rules for Hecke and Atkin-Lehner operators in Proposition 2.8.

Since the Atkin-Lehner operators act transitively on the cusps of \(\Gamma _0(N)\), we have shown now that any harmonic Maaß form of level N for the given N can be written as a linear combination of functions of the form \(P_1^{(N,0)}|W_Q|T_m|B_d|W_{Q'}\) for \(Q,Q'\mid N\), \(m\in {\mathbb {N}}_0\), where we set \(f|T_0:=1\) for any function for convenience, and \(d\mid N\). In order to complete the proof, we need to show that the application of \(W_{Q'}\) may be avoided. The harmonic Maaß form in \(H_0(N)\) which has a pole of order m at the cusp \(W_p\infty \) for a prime \(p\mid N\) and nowhere else is given by

$$\begin{aligned} P_m^{(N,0)}|W_p=\sum _{d\mid \gcd (N,m)} (m/d)P^{(N/d,0)}_1|T_{m/d}^{(N/d)}|B_d|W_p \end{aligned}$$

by Proposition 3.1. For a common divisor d of m and N not divisible by p the operators \(B_d\) and \(W_p\) commute (see e.g. [15, Proposition 13.2.6 (d)]). Furthermore, we can write \(T_{m/d}^{(N/d)}=U_{p^\ell }T_{m'/d}^{(N/d)}\) with \(m=p^\ell m'\) and \(p\not \mid m'\). The Atkin-Lehner operator \(W_p\) commutes with the Hecke operator \(T_{m'/d}^{(N/d)}\) and we have for any function f which is invariant under \(\Gamma _0(N/d)\) and any integer \(r>0\) that

$$\begin{aligned} f|U_{p^r}|W_p=f|U_{p^r}|B_p+\frac{1}{p}f|U_{p^{r-1}}|W_p|B_p-\frac{1}{p} f|U_{p^{r-1}}, \end{aligned}$$
(3.6)

which is an immediate consequence of Proposition 2.8 (i) and (vi). By induction on r this shows that we may write \(P_1^{(N/d,0)}|T_{m/d}^{(N/d)}|W_p\) as a linear combination of functions of the form \(P_1^{(N/d,0)}|W_p^\varepsilon |T_{{\tilde{m}}}^{(N/d)}|B_d\) for \(\varepsilon \in \{0,1\}\) and suitable \({\tilde{m}}\in {\mathbb {N}}_0\). Since \(P_1^{(N/d,0)}\) may be written as a linear combination of functions of the form \(P_1^{(N,0)}|W_Q|T_Q\), the same argument as just used shows that also \(P_1^{(N/d,0)}|T_{m/d}^{(N/d)}|W_p\) can be written in the form claimed in the theorem.

For a common divisor d of m and N which is divisible by p, we note that we can write \(W_p=\left( \frac{1}{\sqrt{p}}\left( \begin{array}{cc} p &{} 0 \\ 0 &{} 1\end{array}\right) \right) ^{-1}\gamma \) for a suitable \(\gamma \in \Gamma _0(N/p)\). Therefore we have that

$$\begin{aligned} P_1^{(N/d,0)}|T_{m/d}^{(N/d)}|B_d|W_p=P_1^{(N/d,0)}|T_{m/d}^{(N/d)}|B_{d/p}|\gamma =P_1^{(N/d,0)}|T_{m/d}^{(N/d)}|B_{d/p} \end{aligned}$$

since \(P_1^{(N/d,0)}|T_{m/d}^{(N/d)}|B_{d/p}\in H_0(\Gamma _0(N/p))\), so that also these summands are of the desired form. In summary, this proves the theorem for all square-free levels N, since the Atkin-Lehner involutions \(W_p\), \(p\mid N\) generate the group of all Atkin-Lehner involutions, which act transitively on the cusps. \(\square \)

Remark

It is essential in the above proof of Theorem 1.4 that the Atkin-Lehner involutions \(W_Q\) commute with all Hecke operators \(T_m\) with \(\gcd (Q,m)=1\). One could try to extend the the above proof to levels where the full normalizer \({\textsf {N}}(\Gamma _0(N))\) acts transitively on the cusps (which is true in addition for levels \(20,\ 24,\ 27,\ 32,\ 36\), but not 49, among those where \(X_0(N)\) has genus 1). For levels 20 and 24 it is even true that the normalizer commutes with all Hecke operators \(T_m\) with \(\gcd (m,N)=1\). Unfortunately, the behaviour with respect to the U-operator (see (3.6)) is not such that the above proof immediately generalizes. We point out however that the first part of the proof that one can express all the Poincaré series \(P_1^{(d,k)}\) for \(d\mid N\) using only elements in the normalizer and Hecke operators together with B-operators, works for levels 20 and 24.

3.2 Proof of the dimension formulas

We now proceed to the proof of Theorem 1.1 and indicate the extension for composite levels.

Proof of Theorem 1.1

Let \(N=p\) be a prime number such that \(E:=X_0(p)\) has genus 1, i.e. \(p\in \{11,17,19\}\). From Proposition 2.1 we know that \({\text {ch}}_{V^G}\) is a modular function for \(\Gamma _0(p)\) without poles in \({\mathfrak {H}}\) and furthermore the transformation behaviour

$$\begin{aligned} {\text {ch}}_{V^G}(S.\tau )=\frac{1}{p}q^{-1}\sum _{n=0} \dim V^G_{n} q^n+\frac{1}{p}q^{-1}\sum _{i=1}^{p-1}\sum _{n=0}^\infty \dim V(\sigma ^i)_{n/p}q^{n/p}. \end{aligned}$$
(3.7)

Using this together with Theorem 1.4, we can express \({\text {ch}}_{V^G}\) solely in terms of Weierstrass mock modular forms, the Fricke involution \(W_p\), and Hecke operators, more precisely we find, using that \(\dim V_0=1\),

$$\begin{aligned} {\text {ch}}_{V^G}= & {} {\widehat{{\mathfrak {Z}}}}_E+\frac{1}{p} \sum _{i=1}^{p-1} \sum _{j=1}^{p-1} (p-j)\dim V(g^i)_{j/p}{\widehat{{\mathfrak {Z}}}}_E|W_p|T_{p-j}\nonumber \\&+\frac{1}{p}\left( (p{\widehat{{\mathfrak {Z}}}}_E|U_p+{\widehat{{\mathfrak {Z}}}}_E|W_p)|B_p+p{\widehat{{\mathfrak {Z}}}}_E|W_p|U_p\right) +(\dim V_1^G-C), \end{aligned}$$
(3.8)

with

$$\begin{aligned} C= & {} \dim V_1^G-\left( c_E(0)+\frac{c_{E,W_p}(0)}{p}\sum _{i=1}^{p-1} \sum _{j=1}^{p-1}\sigma _1(p-j)\dim V(g^i)_{j/p}\right. \nonumber \\&+\left. \frac{1}{p}\left[ pc_E(0)+(p+1)c_{E,W_p}(0)\right] \right) , \end{aligned}$$
(3.9)

where \(c_E(0)=-a_E(2)/2\) and \(c_{E,W_p}(0)={\widehat{\zeta }}(\Lambda _E;L(E,1))\) denote the constant terms of \({\widehat{{\mathfrak {Z}}}}_E\) and \({\widehat{{\mathfrak {Z}}}}_E|W_p\) respectively, see Sect. 2.4. Therefore we find, using the relation \(S=W_pB_p^{-1}\) and the fact that both \(p{\widehat{{\mathfrak {Z}}}}_E|U_p+{\widehat{{\mathfrak {Z}}}}_E|W_p\) and \({\widehat{{\mathfrak {Z}}}}_E+p{\widehat{{\mathfrak {Z}}}}_E|W_p|U_p\) transform like modular forms of level 1 by Proposition 2.8 (vi) and hence are invariant under S,

$$\begin{aligned} {\text {ch}}_{V^G}|S= & {} {\widehat{{\mathfrak {Z}}}}_E|W_p|B_p^{-1}+\frac{1}{p} \sum _{i=1}^{p-1} \sum _{j=1}^{p-1} (p-j)\dim V(g^i)_{j/p}{\widehat{{\mathfrak {Z}}}}_E|T_{p-j}|B_p^{-1}\nonumber \\&+\frac{1}{p}\left( p{\widehat{{\mathfrak {Z}}}}_E|U_p|B_p^{-1}+{\widehat{{\mathfrak {Z}}}}_E|B_p^{-1}+p{\widehat{{\mathfrak {Z}}}}_E|W_p|U_p|B_p^{-1}\right) +(\dim V_1^G-C).\nonumber \\ \end{aligned}$$
(3.10)

Now Proposition 2.3 implies that

$$\begin{aligned} {\text {ch}}_{V^{{\text {orb}}(g^P)}}+{\text {ch}}_{V^{{\text {orb}}(g)}}=F_0+F_\infty , \end{aligned}$$

for \(F_{\mathfrak {a}}\) as in (2.1). By definition we have \(F_\infty ={\text {ch}}_{V^G}\), so its constant term equals \(\dim V_1^G\). The constant term of \(F_0\) equals p times that of \({\text {ch}}_{V^G}|S\), since we can write \(F_0=\sum _{j=0}^{p-1} {\text {ch}}_{V^G}|(ST^j)\) and all summands have the same constant term. Therefore by comparing constant terms we obtain after some simplification

$$\begin{aligned} \dim V_1+\dim V_1^{{\text {orb}}(g)}= & {} (p+1)\dim V_1^G-(p-1)\left( c_E(0)-c_{E,W_p}(0)\right) \nonumber \\&+\left( c_E(0)-c_{E,W_p}(0)\right) \sum _{i=1}^{p-1}\sum _{j=1}^{p-1} \sigma (p-j)\dim V(g^i)_{j/p}.\nonumber \\ \end{aligned}$$
(3.11)

Plugging in the definitions of \(c_E(0)\) and \(c_{E,W_p}(0)\), we arrive at the dimension formula stated in Theorem 1.1\(\square \)

We now proceed to the proof of Theorem 1.3.

Proof of Theorem 1.3

Since \({\text {ch}}_{V^G}\) is a modular function, its image under the \(\xi \)-operator (see Proposition 2.4) must be 0. Hence, applying the Bruinier-Funke pairing with the newform f must yield zero as well. Since we have \({\text {ch}}_{V^G}(\tau )=q^{-1}+O(1)\) and the expansion at the cusp 0 as given in (3.7) together with \((f_E|W_p)(\tau )=\varepsilon f(\tau )\) with \(\varepsilon \in \{\pm 1\}\), we can apply Proposition 2.5 and obtain

$$\begin{aligned} a(1)+\varepsilon \left( \frac{a(p)}{p}+\frac{1}{p}\sum _{i=1}^{p-1}\sum _{j=1}^{p-1} a(p-j)V(\sigma ^i)_{j/p}\right) =0. \end{aligned}$$

Since \(a(1)=1\), the formula claimed in Theorem 1.3 follows. \(\square \)

To conclude, we formulate the dimension formula for the square-free composite levels N such that the modular curve \(X_0(N)\) has genus 1, i.e. \(N\in \{14,15,21\}\). In what follows, we always write \(N=p_1p_2\) where \(p_1\) and \(p_2\) are primes. In view of Remark 1.6, we point out that it is not essential that N has exactly two prime factors and in principle, the method of proof would go through for arbitrary square-free numbers N. However, for the sake of simplicity of the exposition and since all the cases under consideration here are of this form, we restrict to the situation of precisely two distinct prime factors. Before stating the result, we record the following lemma about expansions at other cusps, which is essentially the same as [5, Corollary 2.7] and also follows easily from (3.6).

Lemma 3.2

Let N be any square-free number and let \(f\in H_0(N)\) be a harmonic Maaß form satisfying \(f(\tau )=q^{-\nu }+c+O(\exp (-\alpha y))\) and \((f|W_Q)(\tau )=c_Q+O(\exp (-\alpha y))\) for all (exact) divisors \(Q\mid N\), where \(\alpha >0\) and \(c,c_Q\in {\mathbb {C}}\). Then if \(p\mid N\) is a prime wit \(p\not \mid \nu \) and \(a\in {\mathbb {Z}}_{>0}\), then the function \(-p^{a+1}f|U_{p^{a+1}}|W_p\) has only a pole at the cusp \(\infty \) and we have the expansion

$$\begin{aligned} -p^{a+1}(f|U_{p^{a+1}}|W_p)(\tau )=q^{p^a\nu }-(p-1)\sigma (p^a)c-c_p+O(\exp (-\alpha y)). \end{aligned}$$

We now state the dimension formula for composite N.

Theorem 3.3

With the notation and hypotheses as in Theorem 1.1, only that the group \(G=\langle g\rangle \) has order \(N=p_1p_2\), we have the following dimension formula:

$$\begin{aligned} \begin{aligned}&\dim V^{{\text {orb}}(g)}_1+\dim V^{{\text {orb}}(g^{p_1})}_1 +\dim V^{{\text {orb}}(g^{p_2})}_1+\dim V_1\\&\quad =[{\text {SL}}_2({\mathbb {Z}}):\Gamma _0(N)]\dim V^G_1+Nc_{E,N}+p_1c_{E,p_1}+p_2c_{E,p_2}\\&\quad \quad +\sum _{m=0}^{N-1}\sum _{\begin{array}{c} i,j\in {\mathbb {Z}}/N{\mathbb {Z}}\\ ij\equiv m\,(N) \end{array}} \sigma ((N-m)')\dim W^{(i,j)}_{m/N} \left[ c_{E,N}(0)+p_2^{b_m+1}c_{E,p_1}(0)\right. \\&\quad \quad \left. +(p_1^{a_m+1}+p^{a_m})c_{E,p_2}(0)-(p_1^{a_m+1} +p_1^{a_m}+p_2^{b_m+1}+p_2^{b_m})c_E(0)\right] \\&\quad \quad +\sum _{m=0}^{p_2-1}\sum _{\begin{array}{c} i,j\in {\mathbb {Z}}/p_{2}{\mathbb {Z}}\\ p_{1}ij\equiv m\,(p_2) \end{array}} \sigma ((N-p_1m)')\dim W^{(p_1 i,p_1 j)}_{m/p_2}\left[ \frac{p_1}{p_2}c_N+p_1 \left( p_2^{b_{p_1m}+1}+p_2^{b_{p_1m}}-\frac{1}{p_2}\right) c_{E,p_1}(0)\right. \\&\quad \quad \left. -\left( p_1^{a_{p_1m}+2}+p_1^{a_{p_1m}+1}+\frac{p_1}{p_2} \right) c_{E,p_2}(0)+\left( (p_1+1)(p_1^{a_{p_1m}+1}-p_2^{b_{p_1m}+1}) +\frac{p_1}{p_2}\right) c_{E}(0)\right] \\&\quad \quad +\sum _{m=0}^{p_1-1}\sum _{\begin{array}{c} i,j\in {\mathbb {Z}}/p_{1}{\mathbb {Z}}\\ p_{2}ij\equiv m\,(p_1) \end{array}} \sigma ((N-p_2m)')\dim W^{(p_2 i,p_2 j)}_{m/p_1} \left[ \frac{p_2}{p_1}c_N-p_2\left( p_2^{b_{p_2m}+1}+p_2^{b_{p_2m}} -\frac{1}{p_1}\right) c_{E,p_1}(0)\right. \\&\quad \quad \left. +p_2\left( p_1^{a_{p_2m}+1}+p_1^{a_{p_2m}}-\frac{1}{p_1} \right) c_{E,p_2}(0)\right. \\&\quad \quad \left. +\left( (p_2+1)p_2^{b_{p_2m}+1} -p_2(p_1^{a_{p_2m}+1}+p_1^{a_{p_2m}})+\frac{p_2}{p_1}\right) c_{E}(0)\right] . \end{aligned} \end{aligned}$$

where \(c_E(0)=-a_E(2)/2\) denotes the constant term at infinity of \({\widehat{{\mathfrak {Z}}}}_E\) and \(c_{E,Q}(0)\) denotes the constant term of \({\widehat{{\mathfrak {Z}}}}_E|W_Q\).

Proof

We fix our Atkin-Lehner operators as \(W_{p_\ell }=\left( \begin{array}{cc} * &{} * \\ p_\ell &{} p_{\ell \pm 1}\end{array}\right) B_{p_\ell }\), where the first matrix, which we denote by \(\gamma _{p_\ell }\), is in \(\Gamma _0(p_\ell )\), and \(W_N=S B_N\). By Proposition 2.3 we obtain the following expansions of \({\text {ch}}_{V^G}\) at the cusps of \(\Gamma _0(N)\):

$$\begin{aligned} \begin{aligned} ({\text {ch}}_{V^G}|S)(\tau )&=\frac{1}{N}\sum _{m=0}^\infty \sum _{\begin{array}{c} i,j\in {\mathbb {Z}}/N{\mathbb {Z}}\\ ij\equiv m\,(N) \end{array}} \dim W^{(i,j)}_{m/N} q^{m/N-1}\\ ({\text {ch}}_{V^G}|\gamma _{p_\ell })(\tau )&=\frac{1}{p_{\ell \pm 1}}\sum _{m=0}^\infty \sum _{\begin{array}{c} i,j\in {\mathbb {Z}}/p_{\ell \pm 1}{\mathbb {Z}}\\ p_{\ell }^2ij\equiv m\,(N) \end{array}} \dim W^{(p_\ell i,p_\ell j)}_{m/N} q^{m/N-1} \end{aligned} \end{aligned}$$

Note that in the formula for \({\text {ch}}_{V^G}|\gamma _{p_\ell }\) only those summands survive where m is divisible by \(p_\ell \).

Using Corollary 2.12, Proposition 3.1, and Lemma 3.2 we can express the unique (up to additive constants) harmonic Maaß form in \(H_0(N)\) having a pole of order \(m=p_1^ap_2^bm'\), \(\gcd (N,m')=1\), at \(\infty \) and nowhere else as

$$\begin{aligned}&p_1p_2m({\widehat{{\mathfrak {Z}}}}_E|T_{m'}|U_{p_1^{a+1}}|W_{p_1}|U_{p_2^{b+1}}|W_{p_2})(\tau )\nonumber \\&\quad =q^{-m}+\sigma (m')\left( (p_1^{a+1}-1)(p_2^{b+1}-1)c_E(0)+(p_2^{b+1}-1) c_{E,p_1}(0)\right. \nonumber \\&\quad \quad \left. +(p_1^{a+1}-1)c_{E,p_2}(0)+c_{E,N}(0)\right) +O(\exp (-\alpha y)) \end{aligned}$$
(3.12)

for some suitable \(\alpha >0\) and \(c_E(0)\) and \(c_{E,Q}(0)\) denoting the constant terms of \({\widehat{{\mathfrak {Z}}}}_E\) and \({\widehat{{\mathfrak {Z}}}}_E|W_Q\), respectively. For reference, we also give the following expansions which are needed in order to express \({\text {ch}}_{V^G}\) in terms of Weierstrass mock modular forms,

$$\begin{aligned}&p_1p_2m({\widehat{{\mathfrak {Z}}}}_E|T_{m'}|U_{p_1^{a+1}}|U_{p_2^{b+1}})(\tau ) =p_1^{a+1}p_2^{b+1}\sigma (m')c_E(0) +O(\exp (-\alpha y)), \end{aligned}$$
(3.13)
$$\begin{aligned}&p_1p_2m({\widehat{{\mathfrak {Z}}}}_E|T_{m'}|U_{p_1^{a+1}}|U_{p_2^{b+1}}|W_{p_2})(\tau )\nonumber \\&\quad =p_1^{a+1}\sigma (m')\left( (p_2^{b+1}-1)c_E(0)+c_{E,p_2}(0)\right) +O(\exp (-\alpha y)), \end{aligned}$$
(3.14)

and

$$\begin{aligned}&p_1p_2m({\widehat{{\mathfrak {Z}}}}_E|T_{m'}|U_{p_1^{a+1}}|W_{p_1}|U_{p_2^{b+1}})(\tau )\nonumber \\&\quad =p_2^{b+1}\sigma (m')\left( (p_1^{a+1}-1)c_E(0)+c_{E,p_1}(0)\right) +O(\exp (-\alpha y)). \end{aligned}$$
(3.15)

Hence we may write

$$\begin{aligned} \begin{aligned} {\text {ch}}_{V^G}&={\widehat{{\mathfrak {Z}}}}_E+\frac{1}{N} \sum _{m=0}^{N-1}\sum _{\begin{array}{c} i,j\in {\mathbb {Z}}/N{\mathbb {Z}}\\ ij\equiv m\,(N) \end{array}} \dim W^{(i,j)}_{m/N}(-p_2^{b_m+1}(-p_1^{a_m+1}((N-m)'{\widehat{{\mathfrak {Z}}}}_E|T_{(N-m)'})\\&\quad \times |U_{p_1^{a_m+1}}|W_{p_1})|U_{p_2^{b_m+1}}|W_{p_2})|W_N\\&\quad +\frac{1}{p_2}\sum _{m=0}^{p_2-1}\sum _{\begin{array}{c} i,j\in {\mathbb {Z}}/p_{2}{\mathbb {Z}}\\ p_{1}ij\equiv m\,(p_2) \end{array}} \dim W^{(p_1 i,p_1 j)}_{m/p_2}(-p_2^{b_{p_1m}+1}(-p_1^{a_{p_1m}+1}((N-p_1m)'{\widehat{{\mathfrak {Z}}}}_E|T_{(N-p_1m)'})\\&\quad \times |U_{p_1^{a_{p_1m} +1}}|W_{p_1})|U_{p_2^{b_{p_1m}+1}}|W_{p_2})|W_{p_1}\\&\quad +p_2\sum _{m=0}^{p_1-1}\sum _{\begin{array}{c} i,j\in {\mathbb {Z}}/p_{1}{\mathbb {Z}}\\ p_{2}ij\equiv m\,(p_1) \end{array}} \dim W^{(p_2 i,p_2 j)}_{m/p_1} (-p_2^{b_{p_2m}+1}(-p_1^{a_{p_2m}+1}((N-p_2m)'{\widehat{{\mathfrak {Z}}}}_E|T_{(N-p_2m)'})\\&\quad \times |U_{p_1^{a_{p_2m}+1}}|W_{p_1}) |U_{p_2^{b_{p_2m}+1}}|W_{p_2})|W_{p_2}\\&\quad +\dim V_1^G-C \end{aligned} \end{aligned}$$
(3.16)

where we write \(N-m=p_1^{a_m}p_2^{b_m}(N-m)'\) with \(\gcd (N,(N-m)')=1\) and the constant C is defined by

$$\begin{aligned} C= & {} c_E(0)+\frac{1}{N}\sum _{m=1}^{N-1}\sum _{\begin{array}{c} i,j\in {\mathbb {Z}}/N{\mathbb {Z}}\\ ij\equiv m\,(N) \end{array}} \dim W^{(i,j)}_{m/N} p_1^{a_m+1}p_2^{b_m+1}\sigma ((N-m)')c_E(0)\nonumber \\&\quad +\frac{1}{p_2}\sum _{m=0}^{p_2-1}\sum _{\begin{array}{c} i,j\in {\mathbb {Z}}/p_{2}{\mathbb {Z}}\\ p_{1}ij\equiv m\,(p_2) \end{array}} \dim W^{(p_1 i,p_1 j)}_{m/p_2} p_1^{a_{p_1m}+1} \sigma ((N-p_1m)')\left[ (p_2^{b_{p_1m}+1}-1)c_E(0)+c_{E,p_2}(0)\right] \nonumber \\&\quad +\frac{1}{p_1}\sum _{m=0}^{p_1-1}\sum _{\begin{array}{c} i,j\in {\mathbb {Z}}/p_{1}{\mathbb {Z}}\\ p_{2}ij\equiv m\,(p_1) \end{array}} \dim W^{(p_2 i,p_2 j)}_{m/p_1} p_2^{b_{p_2m}+1}\sigma ((N-p_2m)')\left[ (p_1^{a_{p_2m}+1}-1)c_E(0)+c_{E,p_1}(0)\right] .\nonumber \\ \end{aligned}$$
(3.17)

As in the proof of Theorem 1.1, we compute also the expansions of \({\text {ch}}_{V^G}\) at all other cusps, which is fairly straightforward from the expression in (3.16) using once more the known commutation relations among Hecke and Atkin-Lehner operators in Proposition 2.8, so we refrain from giving these expansions explicitly for the sake of brevity.

By Proposition 2.3, we have that

$$\begin{aligned} \sum _{{\mathfrak {a}}} F_{\mathfrak {a}}(\tau )={\text {ch}}_{V^{{\text {orb}}(g)}}(\tau )+{\text {ch}}_{V^{{\text {orb}}(g^{p_1})}}(\tau ) +{\text {ch}}_{V^{{\text {orb}}(g^{p_2})}}(\tau )+{\text {ch}}_{V}(\tau ), \end{aligned}$$

where the sum runs over a complete set of representatives of cusps of \(\Gamma _0(N)\), which we may and do fix as \(\{1/N(\equiv \infty ),1/p_1,1/p_2,1(\equiv 0)\}\). It is easy to see that the constant term of \(F_{\mathfrak {a}}\) is precisely the constant term of \({\text {ch}}_{V^G}|W_{N{\mathfrak {a}}}\) multiplied by the width of the cusp, which in this case is \(N{\mathfrak {a}}\). Using this observation, we obtain the dimension formula stated in the theorem after some simplification steps. \(\square \)