CM values of higher automorphic Green functions for orthogonal groups

Gross and Zagier conjectured that the CM values (of certain Hecke translates) of the automorphic Green function $G_s(z_1,z_2)$ for the elliptic modular group at positive integral spectral parameter $s$ are given by logarithms of algebraic numbers in suitable class fields. We prove a partial average version of this conjecture, where we sum in the first variable $z_1$ over all CM points of a fixed discriminant $d_1$ (twisted by a genus character), and allow in the second variable the evaluation at individual CM points of discriminant $d_2$. This result is deduced from more general statements for automorphic Green functions on Shimura varieties associated with the group $\mathrm{GSpin}(n,2)$. We also use our approach to prove a Gross-Kohnen-Zagier theorem for higher Heegner divisors on Kuga-Sato varieties over modular curves.


Introduction
The automorphic Green function for Γ = SL 2 (Z), also called the resolvent kernel function for Γ, plays an important role in the theory of automorphic forms, see e.g. [Fay77], [Hej83]. It can be defined as the infinite series G s (z 1 , z 2 ) = −2 γ∈Γ Q s−1 1 + |z 1 − γz 2 | 2 2ℑ(z 1 )ℑ(γz 2 ) , where Q s−1 (t) = ∞ 0 (t + √ t 2 − 1 cosh(u)) −s du denotes the classical Legendre function of the second kind. The sum converges absolutely for s ∈ C with ℜ(s) > 1, and z 1 , z 2 in the complex upper half-plane H with z 1 / ∈ Γz 2 . Hence G s is invariant under the action of Γ in both variables and descends to a function on (X × X) \ Z(1), where X = Γ\H and Z(1) denotes the diagonal. Along Z(1) it has a logarithmic singularity. The differential equation of the Legendre function implies that G s is an eigenfunction of the hyperbolic Laplacian in both variables. It has a meromorphic continuation in s to the whole complex plane and satisfies a functional equation relating the values at s and 1 − s.
1.1. The algebraicity conjecture. Gross and Zagier employed the automorphic Green function in their celebrated work on canonical heights of Heegner points on modular curves to compute archimedian height pairings of Heegner points [GZ86;GKZ87]. They also used it to derive explicit formulas for the norms of singular moduli, that is, for the CM values of the classical j-invariant. More precisely they computed the norms of the values of j(z 1 ) − j(z 2 ) at a pair of CM points z 1 and z 2 , by giving a formula for the prime factorization. The main point of their analytic proof of this result is that log |j(z 1 ) − j(z 2 )| is essentially given by the constant term in the Laurent expansion at s = 1 of G s (z 1 , z 2 ).
Gross and Zagier also studied the CM values of the automorphic Green function at positive integral spectral parameter s = 1 + j for j ∈ Z >0 and conjectured that these quantities should have striking arithmetic properties, which resemble those of singular moduli (see Conjecture 4.4 in [GZ86,Chapter 5.4], [GKZ87,Chapter 5.1], [Via11]). To describe their conjecture, let G m s (z 1 , z 2 ) = G s (z 1 , z 2 ) | T m = −2 γ∈Mat 2 (Z) det(γ)=m Q s−1 1 + |z 1 − γz 2 | 2 2ℑ(z 1 )ℑ(γz 2 ) (1.1) be the translate of G s by the m-th Hecke operator T m , acting on any of the two variables. Fix a weakly holomorphic modular form f = m c f (m)q m ∈ M ! −2j of weight −2j for Γ, and put For a discriminant d < 0 we write O d for the order of discriminant d in the imaginary quadratic field Q( √ d), and let H d be the corresponding ring class field.
Conjecture 1.1 (Gross-Zagier). Assume that c f (m) ∈ Z for all m < 0. Let z 1 be a CM point of discriminant d 1 , and let z 2 be a CM point of discriminant d 2 such that (z 1 , z 2 ) is not contained in Z(f ) = m>0 c f (−m)Z(m), where Z(m) is the m-th Hecke correspondence on X × X. Then there is an α ∈ H d 1 · H d 2 such that (d 1 d 2 ) j/2 G j+1,f (z 1 , z 2 ) = w d 1 w d 2 4 · log |α|, (1.3) where w d i = #O × d i . Gross, Kohnen, and Zagier proved an average version of the conjecture which roughly says that the sum of (d 1 d 2 ) j/2 G j+1,f (z 1 , z 2 ) over all CM points (z 1 , z 2 ) of discriminants d 1 and d 2 is equal to log |β| for some β ∈ Q. Moreover, they provided numerical evidence in several cases [GZ86,Chapter V.4], [GKZ87, Chapter V.1]. Mellit proved the conjecture for z 2 = i and j = 1 [Mel08]. For a pair of CM points that lie in the same imaginary quadratic field, the conjecture would follow from the work of Zhang on the higher weight Gross-Zagier formula [Zha97], provided that a certain height pairing of Heegner cycles on Kuga-Sato varieties is non-degenerate. Viazovska showed in this case that (1.3) holds for some α ∈Q and the full conjecture assuming that d 1 = d 2 is prime [Via11;Via19]. Recently, Li proved another average version of the conjecture for odd j [Li18]. When d 1 and d 2 are coprime fundamental discriminants, he showed that the average over the Gal(Q/F )-orbit of the CM point (z 1 , z 2 ) is given by the logarithm of an algebraic number in F = Q( √ d 1 d 2 ). In the present paper we prove stronger results, by only averaging over the CM points z 1 of one discriminant d 1 and allowing for z 2 individual CM points of discriminant d 2 . Let Q d 1 denote the set of integral binary positive definite quadratic forms of discriminant d 1 < 0. The group Γ acts on Q d 1 with finitely many orbits. For Q ∈ Q d 1 we write z Q for the corresponding CM point, i.e., the unique root of Q(z, 1) in H, and we let w Q be the order of the stabilizer Γ Q . The divisor on X is defined over Q. The Galois group Gal(H d 1 /Q) of the ring class field H d 1 acts on the points in the support of C(d 1 ) by the theory of complex multiplication.
Theorem 1.2. Let j ∈ Z >0 . Let d 1 < 0 be a fundamental discriminant, and let d 2 < 0 be a discriminant such that d 1 d 2 is not the square of an integer. If j is odd, let k = Q( √ d 1 , √ d 2 ) and H = H d 2 ( √ d 1 ). If j is even, let k = Q( √ d 2 ) and H = H d 2 . If z 2 is a CM point of discriminant d 2 , then there exists an algebraic number α = α(f, d 1 , z 2 ) ∈ H and an r ∈ Z >0 such that (d 1 d 2 ) j/2 G j+1,f (C(d 1 ), z σ 2 ) = 1 r log |α σ | for every σ ∈ Gal(H/k).
Remark 1.3. If j is even, then r depends only on d 2 but not on f, d 1 , z 2 . If j is odd, then r may depend on d 1 and d 2 , but not on f or z 2 . The two cases require slightly different proofs, which explains the differences in the results. We refer to Section 7 for details.
In the main text we will actually consider twists of the divisors C(d 1 ) by genus characters, and corresponding twisted versions of the above theorem (see Corollary 7.15). As a corollary we obtain the following result.
Corollary 1.4. Let d 1 < 0 be a fundamental discriminant and assume that the class group of O d 1 is trivial or has exponent 2. Let z 1 be any CM point of of discriminant d 1 and let z 2 be any CM point of discriminant d 2 < 0 (not necessarily fundamental), where z 1 = z 2 if d 1 = d 2 . Then, there is an α ∈ H d 1 · H d 2 and an r ∈ Z >0 such that (d 1 d 2 ) j/2 G j+1,f (z 1 , z 2 ) = 1 r log |α|.
Remark 1.5. Chowla [Cho34] showed that there exist only finitely many imaginary quadratic number fields of discriminant d 1 such that the class group of Q( √ d 1 ) has exponent 2. A quick computation using sage [Sag19] shows that out of the 305 imaginary quadratic fields of discriminant |d 1 | < 1000, a total of 52 have class number one or exponent 2.
We prove the above results by establishing an explicit formula for such CM values of automorphic Green functions. To simplify the exposition we assume in the rest of the introduction that j is even. Our approach is based on the realization of the modular curve X as an orthogonal Shimura variety and on the regularized theta correspondence. A key observation is that G s (C(d 1 ), z 2 ) can be obtained as the regularized theta lift of a weak Maass form of weight 1/2. The proof of this fact involves a quadratic transformation formula for the Gauss hypergeometric function, see Proposition 6.2.
Let L be the lattice of integral 2 × 2 matrices of trace zero equipped with the quadratic form Q given by the determinant. Let SO(L) + be the intersection of the special orthogonal group SO(L) with the connected component of the identity of SO(L R ). We write D for the Grassmanian of oriented negative definite planes in L R , and fix one connected component D + . The conjugation action of SL 2 (Z) on L induces isomorphisms PSL 2 (Z) ∼ = SO(L) + , and X ∼ = SO(L) + \D + .
Let U ⊂ L Q be a rational negative definite subspace of dimension 2. Then U together with the appropriate orientation determines a CM point z + U = U R ∈ D + . Moreover, we obtain even definite lattices N = L ∩ U, P = L ∩ U ⊥ of signature (0, 2) and (1, 0), respectively. The binary lattice N can be used to recover the corresponding CM point on H in classical notation. Both lattices determine holomorphic vector valued theta functions θ N (−1) and θ P of weight 1 and 1/2, where N(−1) denotes the positive definite lattice given by N as a Z-module but equipped with the quadratic form −Q. According to [BF04,Theorem 3.7] there exists a vector valued harmonic Maass form G N of weight 1 for Γ which maps to θ N (−1) under the ξ-operator, see Section 3.2.
Since θ P transforms with the Weil representation ρ P of Mp 2 (Z) on C[P ′ /P ], and G N transforms with the Weil representation ρ N on C[N ′ /N], their tensor product θ P ⊗ G N can be viewed as a nonholomorphic modular form for Mp 2 (Z) of weight 3/2 with representation ρ P ⊗ ρ N ∼ = ρ P ⊕N . More generally, the l-th Rankin-Cohen bracket [θ P , G N ] l defines a nonholomorphic modular form of weight 3/2+2l with the same representation, see Section 3.1.
Recall that for any fundamental discriminant d < 0 the d-th Zagier lift [DJ08] can be viewed as a map Za j d : M ! −2j −→ M ! 1 2 −j,ρ L , from weakly holomorphic modular forms of weight −2j for the group Γ to vector valued weakly holomorphic modular forms of weight 1/2 − j transforming with the complex conjugate of the Weil representation of Mp 2 (Z) on C[L ′ /L], see Section 7. The following result is stated (in greater generality) as Theorem 7.13 in the main text.
Theorem 1.6. Let f ∈ M ! −2j be as before and assume the above notation. Then G j+1,f (C(d 1 ), z + U ) = −2 j−1 CT Za j d 1 (f ), [θ P , G + N ] j/2 , where G + N denotes the holomorphic part of G N . Moreover, CT denotes the constant term of a q-series, ·, · the standard C-bilinear pairing on C[(P ⊕ N) ′ /(P ⊕ N)], and Za j d 1 (f ) is viewed as a modular form with representationρ P ⊕N via the natural intertwining operator of Lemma 3.7.
Note that this formula holds for any possible choice of the harmonic Maass form G N mapping to θ N (−1) under ξ. It is proved in [DL15;Ehl17] (and in greater generality in the appendix of the present paper) that there are particularly nice choices, for which the Fourier coefficients of G + N are given by logarithms of algebraic numbers in the ring class field H d 2 , where d 2 is the discriminant of the lattice N. By invoking such a nice choice of G N , Theorem 1.2 can be derived. We illustrate this result by an explicit example. First note that for j = 2, 4, 6, it is easily seen that G j+1 = G j+1,f for f = E 3−j/2 4 /∆, where E 4 ∈ M 4 is the normalized Eisenstein series of weight 4 and ∆ ∈ S 12 is the unique normalized cusp form of weight 12 for Γ.
First consider the case j = 2, d 1 = −4, and d 2 = −23. For the CM point 1+i  Table 1), we obtain the explicit value The prime factorization of the argument of the logarithm is given in Section 8.1. Its norm is 7 66 · 11 −80 · 19 −22 · 23 −23 . Further note that according to Theorem 1.6, the same form G N appears in the formula for G j+1 i, 1+i √ 23 2 for all even j, see Section 8.2.
1.2. Higher automorphic Green functions on orthogonal Shimura varietes. We shall actually consider orthogonal Shimura varieties of arbitrary dimension in greater generality as we now describe. Let (V, Q) be a quadratic space over Q of signature (n, 2), and let H = GSpin(V ). We realize the hermitian symmetric space associated with H as the Grassmannian of negative oriented planes in V R . For a compact open subgroup K ⊂ H(A f ), we consider the Shimura variety Let L ⊂ V be an even lattice and assume that K stabilizesL and acts trivially on the discriminant group L ′ /L. For µ ∈ L ′ /L and positive m ∈ Z + Q(µ), there is a special divisor Z(m, µ) on X K . The automorphic Green function associated with it is defined by for (z, h) ∈ X K \ Z(m, µ) and s ∈ C with ℜ(s) ≥ s 0 := n 4 + 1 2 , see Section 4 and [Bru02], [OT03]. The sum converges normally and defines a smooth function in this region with a logarithmic singularity along Z(m, µ). It has a meromorphic continuation in s to the whole complex plane and is an eigenfunction of the invariant Laplacian on X K .
In the special case when L is the even unimodular lattice of signature (2, 2), and K ⊂ H(A f ) is the stabilizer ofL, the Shimura variety X K is isomorphic to X×X and Φ m,0 (z, 1, s) is equal to the Hecke translate − 2 Γ(s) G m s (z 1 , z 2 ) of the automorphic Green function for SL 2 (Z) above, see Section 6.1.
The special values of automorphic Green functions at the harmonic point s = s 0 are closely related to logarithms of Borcherds products. The logarithm of the Petersson metric of any Borcherds product is a linear combination of the functions Φ m,µ (z, h, s 0 ). This implies in particular that the CM values of such a linear combination of Green functions are given by logarithms of algebraic numbers. In view of Conjecture 1.1 it is natural to ask whether the values of (suitable linear combinations) of automorphic Green functions at higher spectral parameter s 0 + j with j ∈ Z >0 are also given by logarithms of algebraic numbers. We shall prove this in the present paper for small CM points.
Let k = 1 − n/2 and let f ∈ H k−2j,ρ L be a harmonic Maass form of weight k − 2j for the conjugate Weil representationρ L . Applying the j-fold iterate raising operator to f we obtain a weak Maass form R j k−2j f of weight k. Recall that the Siegel theta function θ L (τ, z, h) associated with L has weight −k. We consider the regularized theta lift were F denotes the standard fundamental domain for the action of SL 2 (Z) on H, and the regularization is done as in [Bor98]. It turns out that Φ j (z, h, f ) has a finite value at every point (z, h). It defines a smooth function on the complement of a certain linear combination of special divisors, which is equal to an explicit linear combination of the 'higher' Green functions Φ m,µ (z, h, s 0 + j), see Proposition 4.7. Let U ⊂ V be a negative definite 2-dimensional subspace. Then T = GSpin(U) determines a torus in H, which is isomorphic to the multiplicative group of an imaginary quadratic field, and U R together with the choice of an orientation determines two points which is defined over Q. As in the signature (1, 2) case above, the subspace U determines definite lattices N = L ∩ U, P = L ∩ U ⊥ and their associated theta series.
As before, when the coefficients of f with negative index are integral, we may conclude that Φ j (z ± U , h, f ) = 1 r log |α| for some α ∈ H d and r ∈ Z >0 , where d = −|N ′ /N|. Moreover, the Galois action on α is compatible with the action on (z ± U , h) by Shimura reciprocity. Theorem 1.7 (and certain variants involving other regularized theta liftings) represents one of the main ingredients of the proof of Theorem 1.6. For the average values of higher Green functions at small CM cycles we obtain the following result (Theorem 5.4).
Here E + N denotes the holomorphic part of the harmonic Maass form E ′ N (τ, 0; 1), see (3.14), and L(g, U, s) is a certain convolution L-function of a cusp form g ∈ S 2−k+2j,ρ L and the theta series θ P , see Lemma 5.3.
Theorem 1.8 is very similar to one of the main results, Theorem 1.2, of [BY09]. In loc. cit. it was conjectured that this quantity is the archimedian contribution of an arithmetic intersection pairing of a linear combination of arithmetic special divisors determined by the principal part of f and the CM cycle Z(U) on an integral model of X K . Here the first quantity on the right hand side is the negative of the non-archimedean intersection pairing. This conjecture was proved in [And+17] for maximal even lattices. It would be very interesting to establish a similar interpretation of Theorem 1.8. Is it possible to define suitable cycles on fiber product powers of the Kuga-Satake abelian scheme over the canonical integral model of X K whose non-archimedian intersection pairing is given by the first quantity on the right hand side of (1.4)?
1.3. A higher weight Gross-Kohnen-Zagier theorem. In the special case when V has signature (1, 2) and X K is a modular curve such 'higher' Heegner cycles are defined in [Zha97], [Xue10]. We will use Theorem 1.8 to prove a Gross-Kohnen-Zagier theorem in this setting. Let M be a positive integer and let L be the lattice of signature (1, 2) and level 4M defined in (6.5). Taking K = GSpin(L) ⊂ H(A f ), the Shimura variety X K is isomorphic to the modular curve Γ 0 (M)\H. The special divisor Z(m, µ) agrees with the Heegner divisor of discriminant D = −4Mm of [GKZ87]. Moreover, the small CM cycle Z(U) agrees with a primitive Heegner divisor. In particular, when the lattice N has fundamental discriminant D 0 , then Z(U) is equal to a Heegner divisor Z(m 0 , µ 0 ), where D 0 = −4Mm 0 .
Let κ be an odd positive integer. For an elliptic curve E with complex multiplication by √ D, let Z(E) denote the divisor Γ−(E ×{0})+D({0}×E) on E ×E, where Γ is the graph of multiplication by √ D. Then Z(E) κ−1 defines a cycle of codimension κ − 1 in E 2κ−2 . By means of this construction Zhang and Xue defined higher Heegner cycles Z κ (m, µ) on the (2κ − 2)-tuple fiber product of the universal degree M cyclic isogeny of elliptic curves over the modular curve X 0 (M), see Section 6.3 for details. Zhang used the Arakelov intersection theory of Gillet and Soulé to define a height pairing of such higher Heegner cycles, which is a sum of local height pairings for each prime p ≤ ∞. The archimedian contribution to the global height pairing Z κ (m, µ), Z κ (m 0 , µ 0 ) is given by the evaluation of a higher Green function at Z(m 0 , µ 0 ), which can be computed by means of Theorem 1.8. The non-archimedian contribution can be calculated using results of [Xue10] and [BY09]. It turns out to agree with the negative of the first quantity on the right hand side of (1.4), yielding a formula for the global height pairing (Theorem 6.5). By invoking a refinement of Borcherds' modularity criterion, we obtain the following higher weight Gross-Kohnen-Zagier theorem (Theorem 6.11 and Corollary 6.12).
Theorem 1.9. Assume the above notation and that D 0 = −4Mm 0 is a fixed fundamental discriminant. The generating series is the Fourier expansion of a cusp form in S κ+1/2,ρ L (Γ 0 (D 2 0 )). Note that this result does not depend on any assumption regarding positive definiteness of the height pairing. We consider the generating series which only involves the Z κ (m, µ) with 4Mm coprime to D 0 in order to avoid improper intersections of Heegner cycles. It would be interesting to drop this restriction, which causes the additional level of the generating series.
The structure of this paper is as follows. In Section 2 we recall some background on orthogonal Shimura vareties and Siegel theta functions, and in Section 3 we collect some facts on weak Maass forms, differential operators, and Rankin-Cohen brackets. Section 4 deals with higher automorphic Green functions on orthogonal Shimura varieties, and in Section 5 the main formulas for their values at small CM cycles are derived. We also comment on potential analogues for big CM cycles, see Theorem 5.10. In Section 6 we specialize to signature (2, 2) and prove a refinement of the main result of [Via11]. We also specialize to signature (1, 2) and obtain some preliminary results towards Theorem 1.6. We use this to prove the higher weight Gross-Kohnen-Zagier theorem. In Section 7 we extend the results in the case of signature (1, 2) by looking at more general theta kernels which involve different Schwartz functions at the archimedian and non-archimedian places. In that way we prove (a generalization of) Theorem 1.6, from which we deduce Theorem 1.2 and Corollary 1.4. Section 8 deals with some numerical examples illustrating our main results. Finally, in the appendix we explain how the main results of [DL15; Ehl17] on harmonic Maass forms of weight 1 can be extended to more general binary lattices.
We thank Ben Howard, Claudia Alfes-Neumann, Yingkun Li and Masao Tsuzuki for helpful conversations and comments related to this paper.

Orthogonal Shimura varieties and theta functions
Throughout, we write A for the ring of adles over Q and A f for the finite adles. Moreover, we letẐ = p<∞ Z p be the closure of Z in A f . Let (V, Q) be a quadratic space over Q of signature (n, 2). We denote the symmetric bilinear form associated to Q by (x, y) = Q(x + y) − Q(x) − Q(y). Let H = GSpin(V ), and realize the corresponding hermitean symmetric space as the Grassmannian D of twodimensional negative oriented subspaces of V R . This space has two connected components, D = D + ⊔ D − , given by the two possible choices of an orientation. It is isomorphic to the complex manifold For a compact open subgroup K ⊂ H(A f ) we consider the quotient It is the complex analytic space of a Shimura variety of dimension n, which has a canonical model over Q.
There are natural families of special cycles which are given by embeddings of rational quadratic subspaces V ′ ⊂ V of signature (n ′ , 2) for 0 ≤ n ′ ≤ n. As in [BY09] we consider these cycles for n ′ = 0 and n ′ = n − 1. Let U ⊂ V be a negative definite 2-dimensional subspace. It defines a two point subset {z ± U } ⊂ D given by U R with the two possible choices of the orientation. The group T = GSpin(U) is isomorphic to the multiplicative group of an imaginary quadratic field. It embeds into H acting trivially on U ⊥ . If we put Here each point in the cycle is counted with multiplicity 2 w K,T , where w K,T = #(T (Q)∩K T ). The cycle Z(U) has dimension 0 and is defined over Q.
To define special divisors, we consider a vector x ∈ V with Q(x) > 0, and let H x ⊂ H be its stabilizer. The hermitean symmetric space of H x can be realized as the analytic divisor Then gives rise to a divisor Z(h, x) in X K . Given m ∈ Q >0 and a K-invariant Schwartz function ϕ ∈ S(V (A f )), we define a special divisor Z(m, ϕ) following [Kud97]: If there exists an If there is no such x, set Z(m, ϕ) = 0.
We write Γ ′ = Mp 2 (Z) for the metaplectic extension of SL 2 (Z) given by the two possible choices of a holomorphic square root on H of the automorphy factor j(γ, τ ) = cτ + d for γ = ( a b c d ) ∈ SL 2 (Z) and τ ∈ H. Let L ⊂ V be an even lattice and write L ′ for its dual. The discriminant group L ′ /L is a finite abelian group, equipped with a Q/Z-valued quadratic form. We write S L = C[L ′ /L] for the space of complex valued functions on L ′ /L. For µ ∈ L ′ /L we denote the characteristic function of µ by φ µ , so that (φ µ ) µ forms the standard basis of S L . This basis determines a C-bilinear pairing Recall that there is a Weil representation ρ L of Γ ′ on S L . In terms of the generators S = (( 0 −1 1 0 ) , √ τ ) and T = (( 1 1 0 1 ) , 1) it is given by see e.g. [Bor98], [BY09], [Bru02]. We frequently identify S L with the subspace of Schwartz-Bruhat functions S(V (A f )) which are translation invariant underL = L⊗ ZẐ and supported onL ′ . Then the representation ρ L can be identified with the restriction to Mp 2 (Z) of the complex conjugate of the usual Weil representation ω f on S(V (A f )) with respect to the standard additive character of A/Q.
If z ∈ D and x ∈ V (R) we write x z and x z ⊥ for the orthogonal projections of x to the subspaces z and z ⊥ of V (R), respectively. The positive definite quadratic form x → Q(x z ⊥ ) − Q(x z ) is called the majorant associated with z. For τ = u + iv ∈ H, (z, h) ∈ D × H(A f ), and ϕ ∈ S(V (A f )) we define a Siegel theta function by Moreover, we define a S L -valued theta function by As a function of τ it transforms as a (non-holomorphic) vector-valued modular form of weight n 2 − 1 with representation ρ L for Γ ′ . As a function of (z, h) it descends to X K if K stabilizesL and acts trivially onL ′ /L ∼ = L ′ /L.

Differential operators and weak Maass forms
Here we recall some differential operators acting on automorphic forms for Γ ′ and some facts about weak Maass forms.
3.1. Differential operators. Throughout we use τ as a standard variable for functions on the upper complex half plane H. We write τ = u + iv with u ∈ R and v ∈ R >0 for the decomposition into real and imaginary part. Recall that the Maass raising and lowering operators on smooth functions on H are defined as the differential operators The lowering operator annihilates holomorphic functions. Moreover, if g is a holomorphic function on H, then For any smooth function f : If the weight is clear from the context, we sometimes omit the subscript. The hyperbolic Laplacian in weight k is defined by It commutes with the weight k action of Γ ′ on functions on H. It can be expressed in terms of R k and L k by For j ∈ Z ≥0 we abbreviate The following lemma is an easy consequence of (3.3).
for the complex vector space of smooth functions f : H → C satisfying the transformation law f | k γ = f for all γ ∈ Γ ′′ . If f, g ∈ A k (Γ ′′ ) we define their Petersson inner product by provided the integral converges. Here dµ(τ ) = du dv v 2 is the usual invariant volume form. If f ∈ A k (Γ ′′ ) and g ∈ A l (Γ ′′ ), we have (3.5) In combination with (3.1) this identity implies the following lemma Lemma 3.2. Let h ∈ A k−2 (Γ ′′ ) and assume that h has moderate growth at the cusps. Then for any holomorphic cusp form g ∈ S k (Γ ′′ ) we have We will also need Rankin-Cohen brackets on modular forms. Let j ∈ Z ≥0 . If f ∈ A k (Γ ′′ ) and g ∈ A l (Γ ′′ ) we define the j-th Rankin-Cohen bracket by It is well known that the Rankin-Cohen bracket can also be expressed in terms of iterated raising operators as The latter identity implies that [f, g] j belongs to A k+l+2j (Γ ′′ ). Moreover, (3.6) implies that the Rankin-Cohen bracket takes (weakly) holomorphic modular forms to (weakly) holomorphic ones. 3.2. Weak Maass forms. As before let L ⊂ V be an even lattice. Recall the Weil representation ρ L of Γ ′ = Mp 2 (Z) on S L . Let k ∈ 1 2 Z. For γ = (g, σ) ∈ Γ ′ and a function f : H → S L we define the Petersson slash operator in weight k by A smooth function f : H → S L is called a weak Maass form of weight k with representation ρ L for the group Γ ′ (c.f. [BF04, Section 3]) if (1) f | k,ρ L γ = f for all γ ∈ Γ ′ ; (2) there exists a λ ∈ C such that ∆ k f = λf ; (3) there is a C > 0 such that f (τ ) = O(e Cv ) as v → ∞ (uniformly in u).
In the special case when λ = 0, the function f is called a harmonic weak Maass form 1 . The differential operator f (τ ) → ξ k (f )(τ ) := v k−2 L k f (τ ) defines an antilinear map from harmonic Maass forms of weight k to weakly holomorphic modular forms of dual weight 2 −k for the dual representation, see [BF04, Proposition 3.2]. As in [BY09] we write H k,ρ L for the vector space of harmonic Maass forms of weight k (with representation ρ L for Γ ′ ) whose image under ξ k is a cusp form. The larger space of all harmonic Maass forms of weight k is denoted by H ! k,ρ L . We write M ! k,ρ L , M k,ρ L , S k,ρ L for the subspaces of weakly holomorphic modular forms, holomorphic modular forms, and cusp forms, respectively. Then we have the chain of inclusions The special value at s 0 = 1 − k/2 is given by For any m > 0 the function M s,k (4πmv)e(−mu) is an eigenfunction of ∆ k with eigenvalue (s − k/2)(1 − k/2 − s).
For simplicity we assume here that 2k ≡ − sig(L) = 2 − n (mod 4). Then, for µ ∈ L ′ /L and m ∈ Z + Q(µ) with m > 0, the S L -valued function is invariant under the | k,ρ L -action of the stabilizer Γ ′ ∞ ⊂ Γ ′ of the cusp ∞. We define the Hejhal-Poincaré series of index (m, µ) and weight k by The series converges normally for ℜ(s) > 1 and defines a weak Maass form of weight k with representationρ L and eigenvalue (s −k/2)(1 −k/2 −s) for Γ ′ , see e.g. [Bru02, Theorem 1.9] and note that we work here with signature (n, 2) instead of signature (2, n). If k ≤ 1/2, then the special value F m,µ (τ, s 0 , k) at s 0 = 1−k/2 defines an element of H k,ρ L with Fourier expansion as v → ∞, see [Bru02, Proposition 1.10]. The next proposition describes the images of the Hejhal-Poincaré series under the Maass raising operator.
Corollary 3.5. For s = s 0 + j we have that The following lemma on Rankin-Cohen brackets of harmonic Maass forms will be crucial for us. To lighten the notation we formulate it here for scalar valued forms with respect to a congruence subgroup Γ ′′ ⊂ Γ ′ . An analogue also holds for vector valued forms.
Proposition 3.6. Let f be a harmonic Maass form of weight k and let g be a harmonic Maass form of weight l for Γ ′′ . For any non-negative integer j we have Proof. According to (3.7) we have In the first sum on the right hand side we consider the s = j term separately and in the second sum the s = 0 term. We obtain Since f is a harmonic Maass form, Lemma 3.1 and (3.3) imply for s ≤ j − 1 that Similarly, we have for s ≥ 1 that Now a straightforward computation shows that the two sums over s on the right hand side of (3.9) cancel. This implies the assertion.
Let M ⊂ L be a sublattice of finite index. A vector valued harmonic Maass form f ∈ H k,ρ L can be naturally viewed as a harmonic form in H k,ρ M . Indeed, we have the inclusions M ⊂ L ⊂ L ′ ⊂ M ′ , and therefore an inclusion Lemma 3.7. There is a natural map given by We refer to [BY09, Lemma 3.1] for a proof of the lemma and for more details about this construction.
3.3. Binary theta functions. In this subsection we assume that V is a definite quadratic space of signature (0, 2) and let L ⊂ V be an even lattice. Then the corresponding Grassmannian consists of the two points z ± V given by V R with the two possible choices of an orientation. The Siegel theta function θ L (τ, z, h) defined in (2.7) does not depend on z, and therefore we often drop this variable from the notation. This theta function is a non-holomorphic S L -valued modular form of weight −1 with representation ρ L . Because of (3.1), we have R −1 θ L (τ, h) = 0. Following [BY09, Section 2] we define an S L -valued Eisenstein series of weight ℓ by For the Maass operators we have the well known identities The following special case of the Siegel-Weil formula relates the average of Siegel theta functions over the genus of L and such an Eisenstein series, see e.g. Proposition 3.8. With the above normalization of the Haar measure, we have Using the identities which follow from (3.11), we see that the derivative E ′ L (τ, 0; 1) of the incoherent Eisenstein series of weight 1 is a preimage under the lowering operator of the average of binary theta functions on the left hand side of Proposition 3.8. Moreover, E L (τ ) = E ′ L (τ, 0; 1) is a harmonic Maass form of weight 1 with representation ρ L for Γ ′ . We write for its holomorphic part. The Fourier coefficients of E ′ L (τ, 0; 1) are computed in [KY10], see also [BY09, Theorem 2.6]. In particular, up to a common rational scaling factor, the κ(m, µ) with (m, µ) = (0, 0) are given by logarithms of positive rational numbers.
Later we will also need harmonic Maass forms of weight 1 that are preimages under the lowering operator of the individual binary theta functions θ L (τ, h), without taking an average over h. While the existence of preimages follows from the surjectivity of the ξoperator [BF04, Theorem 3.7], it was proved in [Ehl17] and [DL15] that there are actually preimages with nice arithmetic properties.
We let D be the discriminant of L and k D = Q( √ D) ∼ = V be the corresponding imaginary quadratic field. We write O D ⊂ k D for the order of discriminant D in k D . Note that Moreover, K =Ô × D stabilizes L as above and acts trivially on L ′ /L. Hence, θ L (τ, h) defines a function on By abusing notation, we will simply write the same symbol h for the element of H(A f ) and for its class in H(Q) In [DL15] lattices of prime discriminant and in [Ehl17] lattices of fundamental discriminant were considered. The following result generalizes Theorem 4.21 of [Ehl17] to arbitrary binary lattices and will be proved in the appendix (see Theorem A.4).
with the following properties: where r ∈ Z >0 only depends on L.

Automorphic Green functions
Throughout we assume that the compact open subgroup K ⊂ H(A f ) stabilizesL and acts trivially on L ′ /L. Let f : H → S L be a weak Maass form of weight k = 1 − n/2 with representationρ L for Γ ′ . For z ∈ D and h ∈ H(A f ) we consider the regularized theta integral Here F denotes the standard fundamental domain for the action of SL 2 (Z) on H and dµ(τ ) = du dv v 2 . The regularization is done as in [Bor98]. It turns out that Φ(z, h, f ) has a finite value at every point (z, h). It defines a smooth function on the complement of a certain cycle in X K (see Proposition 4.1 below), and it is locally integrable on X K .
Let µ ∈ L ′ /L and m ∈ Z + Q(µ) with m > 0. For the Hejhal-Poincare series of index (m, µ) defined in (3.8), the lift is studied in detail in [Bru02]. It turns out to be an automorphic Green function in the sense of [OT03] and is therefore of particular significance. .
The sum converges normally on the above region and defines a smooth function there. In s it has a meromorphic continuation to the whole complex plane. At s = s 0 it has a simple pole with residue proportional to the degree of Z(m, µ). Let ∆ be the SO(V )(R)-invariant Laplace operator on D induced by the Casimir element of the Lie algebra of SO(V )(R), normalized as in [Bru02]. Note that ∆ is a negative operator in this normalization, and that it is equal to −8 times the Laplacian in [OT03]. According to [Bru02,Theorem 4.6], for (z, h) ∈ X K \ Z(m, µ) and ℜ(s) > s 0 , the Green function is an eigenfunction of ∆, more precisely The behavior of Φ m,µ (z, h, s) near the divisor Z(m, µ) is described by the following proposition.
Proposition 4.1. For any z 0 ∈ D there exists a neighborhood U ⊂ D such that the function Here the regularized integral is defined as the constant term at s ′ = 0 in the Laurent expansion of the meromorphic continuation in We note that the latter integral exists if ℜ(s ′ ) is large and has a meromorphic continuation in s ′ because of the asymptotic expansion of the M-Whittaker function, see (13.5.1) in [AS84]. Hence the regularized integral exists and has a finite value for all s. Moreover, we note that the sum over λ in Proposition 4.1 is finite, since z ⊥ 0 is a positive definite subspace of V (R). In particular we see that Φ m,µ (z, h, s) has a well defined finite value even on the divisor Z(m, µ). However, it is not continuous along Z(m, µ). The proof of the proposition can be given as in [Bor98, Theorem 6.2].
We may use the asymptotic behavior of the M-Whittaker function to analyze the regularized integral further. We have for v > 0 that as v → ∞. We extend the incomplete Γ-function Γ(0, t) = ∞ 1 e −tv dv v to a function on R ≥0 by defining it as the regularized integral, that is, as the constant term of the Laurent expansion at s ′ = 0 of the meromorphic continuation of Using (4.3), it is easily seen that the function is continuous in z. Taking into account higher terms of the asymptotic expansion, one can also describe the behavior of the derivatives in z.
Corollary 4.2. For any z 0 ∈ D there exists a neighborhood U ⊂ D such that the function is continuous on U.
Since Γ(0, t) = − log(t) + Γ ′ (1) + o(t) as t → 0, we see that Φ m,µ (z, h, s) is locally integrable on X K and defines a current on compactly supported smooth functions on X K . To describe it, we first fix the normalizations of invariant measures. Using the projective model (2.1), we see that there is a tautological hermitean line bundle L over D. Orthogonal modular forms of weight w can be identified with sections of L w . The first Chern form We fix the corresponding invariant volume form Ω n on X K and the volume form Ω n−1 on any divisor on X K . Theorem 4.3. As a current on compactly supported smooth functions we have Here δ Z(m,µ) denotes the Dirac current given by integration over the divisor Z(m, µ) with respect to the measure Ω n−1 .
This is essentially [OT03, Corollary 3.2.1], for the comparison of the normalizations of measures see also [BK03,Theorem 4.7].
The Green function can be characterized as follows.
Proposition 4.5. Assume that ℜ(s) > 3 4 n > 3 2 . Let G(z, h, s) be a smooth function on X K \ Z(m, µ) which is square integrable and satisfies the current equation of Theorem 4.3.
Proof. We consider the function It satisfies the current equation Hence, by a standard regularity argument, g extends to a smooth function on all of X K . By the hypothesis g belongs to L 2 (X K ). Since ∆ is a negative operator on L 2 (X K ) and ℜ(s) > s 0 = n 4 + 1 2 , the eigenvalue equation (4.4) implies that g = 0. Remark 4.6. Similar characterizations of Φ m,µ (z, h, s) can also be obtained for n ≤ 2 and ℜ(s) > s 0 by imposing additional conditions on the growth at the boundary of X K , see e.g. Section 6.1 and [Zha97, Section 3.4].

4.2.
Positive integral values of the spectral parameter. Recall that k = 1 − n/2 and s 0 = n 4 + 1 2 . In the present paper we are mainly interested in the Green function Φ m,µ (z, h, s) when the spectral parameter s is specialized to s 0 + j for j ∈ Z ≥0 . These special values can be described using lifts of harmonic Maass forms.
Proposition 4.7. Let µ ∈ L ′ /L and m ∈ Z + Q(µ) with m > 0. For j ∈ Z >0 let F m,µ (τ, k − 2j) ∈ H k−2j,ρ L be the unique harmonic Maass form whose principal part is given by Proof. The assertion is an immediate consequence of (4.1) and Corollary 3.5.

CM values of higher Green functions
Recall that k = 1 − n/2. Proposition 4.7 suggests to study for any harmonic Maass form f ∈ H k−2j,ρ L its 'higher' regularized theta lift Denote the Fourier coefficients of f by c ± (m, µ) for µ ∈ L ′ /L and m ∈ Z − Q(µ). Then Φ j (z, h, f ) is a higher Green function for the divisor Here we compute the values of such regularized theta lifts at small CM cycles.
Let U ⊂ V be a subspace of signature (0, 2) which is defined over Q and consider the corresponding CM cycle defined in (2.2). For (z, h) ∈ Z(U) we want to compute the CM value Φ j (z, h, f ). Moreover, we are interested in the average over the cycle Z(U), . In this case Lemma 3.1 of [BY09] implies for the C-bilinear pairings on S L and S N ⊕P , that where f P ⊕N is defined by Lemma 3.7. Hence we may assume in the following calculation that L = P ⊕ N if we replace f by f P ⊕N . For h ∈ T (A f ) the CM value we are interested in is given by the regularized integral To compute it, we first replace the regularized integral by a limit of truncated integrals. If S(q) = n∈Z a n q n is a Laurent series in q (or a holomorphic Fourier series in τ ), we write CT(S) = a 0 (5.5) for the constant term in the q-expansion.
Proof. This result is proved in the same way as [BY09,Lemma 4.5]. In addition we use the fact that for a polynomial By means of (5.4) and the Siegel-Weil formula in Proposition 3.8, we obtain the following corollary.
Corollary 5.2. We have For any g ∈ S 1+n/2+2j,ρ L we define an L-function by means of the convolution integral Here the Petersson scalar product is antilinear in the second argument. The meromorphic continuation of the Eisenstein series E N (τ, s; 1) can be used to obtain a meromorphic continuation of L(g, U, s) to the whole complex plane. At s = 0, the center of symmetry, L(g, U, s) vanishes because the Eisenstein series E N (τ, s; 1) is incoherent.
Lemma 5.3. Let g ∈ S 1+n/2+2j,ρ L and denote by g = m,µ b(m, µ)q m φ µ the Fourier expansion. Write θ P = m,µ r(m, µ)q m φ µ . Then L(g, U, s) can also be expressed as Morerover, it has the Dirichlet series representation Proof. We rewrite the Petersson scalar product (5.6) using Lemma 3.3 and Lemma 3.2. We obtain According to (3.10) we have and therefore The latter scalar product can be computed by means of the usual unfolding argument. We obtain Inserting this into (5.7), we obtain the claimed Dirichlet series representation.
Proof. According to Corollary 5.2 we have We use the 'self-adjointness' of the raising operator (which follows from (3.5) for the regularized integral, see also [Bru02,Lemma 4.2]), to rewrite this as Since R −1 E N (τ, 0; −1) = 0 and because of (3.13), we have Hence, we obtain for the integral The second summand on the right hand side can be interpreted as the Petersson scalar product of [θ P , E ′ N (·, 0; 1)] j and the cusp form ξ k−2j (f ). The first summand can be computed by means of Stokes' theorem. We get As in the proof of [BY09, Theorem 4.7] we find that the first term on the right hand side is equal to 2 CT f + , [θ P , E + N ] j . Putting this into (5.8) and inserting (5.6), we obtain . This concludes the proof of the theorem.
In the same way one proves the following result for the values at individual CM points.
By taking the particulary nice preimages G N (τ, h) from Theorem 3.9, we obtain the following algebraicity statement. We use the same notation as in Theorem 3.9, in particular, D < 0 denotes the discriminant of N, k D = Q( √ D), and we write H D for the ring class field of the order O D ⊂ k D of discriminant D.
Corollary 5.6. Assume that f ∈ M ! k−2j,ρ L has only integer coefficients in its principal part and that Z(f ) is disjoint from Z(U). For where r ∈ Z >0 is a constant that only depends on L, D and j (but not on f and h); (2) The algebraic numbers α U,f (h) satisfy the Shimura reciprocity law Proof. Recall that we assume that L = P ⊕ N holds. According to [MP16, Lemma 2.6], the group GSpin(L) is the maximal subgroup of H(A f ) that preserves L and acts trivially on L ′ /L. Hence f is GSpin(L)-invariant and we can assume that K = GSpin(L). We now However, by the maximality of GSpin(N), the other inclusion follows as well. Now we can apply Theorem 3.9 and the statement of the corollary follows.
5.1. General CM cycles. Let d ∈ Z ≥0 , and let F be a totally real number field of degree d+1 with real embeddings σ 0 , . . . , σ d . Let (W, Q F ) be a quadratic space over F of dimension 2 with signature (0, 2) at the place σ 0 and signature (2, 0) at the places σ 1 , . . . , σ d . Let Then W Q is a quadratic space over Q of signature (2d, 2). In this subsection we assume that there is an isometric embedding i : (W Q , Q Q ) → (V, Q), which we fix throughout. This gives an orthogonal decomposition Let T ⊂ H be the inverse image under the natural map of the subgroup Res F/Q SO(W ) of SO(W Q ). Then T is a torus in H, fitting into the commutative diagramm Together with the choice of an orientation it determines two points z ± σ 0 in D. The image of natural map It is equal to a certain Hecke translate of the CM cycle Z(W i , σ i ), where W 0 = W , and (W i , Q F,i ) is the quadratic space over F such that (W i,v , Q i ) ∼ = (W v , Q F ) for all primes (finite and infinite) v = σ 0 , σ i , and W i,σ 0 is positive definite and W i,σ i is negative definite. Notice that there is an isometry of quadratic spaces W Q ∼ = W i,Q over Q. The specific Hecke translate is given in [BKY12, Section 2] and is related to the choices of isomorphisms W Q ∼ = W i,Q and W f ∼ = W i,f . We refer to [BKY12] for details. Hence the CM cycle is defined over Q. We remark that different i's might give the same Galois conjugate, in such a case Z(W ) is a multiple of the formal sum of the Galois conjugates of Z(W, σ 0 ). When F = Q, Z(W ) is a small CM cycle as defined before. When V 0 = 0, i.e., V ∼ = W Q , it is a big CM cycle studied in [BKY12]. The general case is studied by Peng Yu in his thesis [Yu17]. Let N = L ∩ W Q and P = L ∩ V 0 , and let θ P (τ ) be the Siegel-theta function of weight Here L 1,i is the Maass lowering operator with respect to the variable τ i . In particular, if we denote by H → H d+1 , τ → τ ∆ = (τ, . . . , τ ) the diagonal embedding, we have The same argument as in Corollary 5.2 (see also [Yu17] or [BKY12]) leads to the following proposition.
Proposition 5.7. Let the notation be as above, and let f ∈ H k−2j,ρ L . Then the CM value of the higher Green function Φ j (z, h, f ) is given by In order to derive an explicit formula for this CM value analogous to Theorem 5.4, we need to find an explicit modular form G on H (smooth and with possible 'poles' at cusps) such that Here we need to have some information about the algebraicity properties of the Fourier coefficients of G. In the case of small CM cyles, that is, for d = 0 we could use (5.9) for this purpose.
There is one further case, in which we can determine a function G, this is the case when d = 1 and V 0 = 0, which we assume for the rest of this subsection. These conditions imply that F is real quadratic, V = Res F/Q (W ) has signature (2, 2), L = N, and k = 0. The function G is obtained using a Cohen operator on Hilbert modular forms, which is a slight variant of the Rankin-Cohen bracket considered in Section 3.1. Let g : H 2 → C be a smooth Hilbert modular form of weight (k 1 , k 2 ) for some congruence subgroup of SL 2 (F ). Define the j-th Cohen operator as Then C j (g) is a smooth function on H which is modular in weight k 1 + k 2 + 2j for some congruence subgroup. The following result generalizes Proposition 3.6.
Proposition 5.8. Let g be a smooth Hilbert modular form of weight (k 1 , k 2 ) for the real quadratic field F . Assume that, as a function of the first variable, g is annihilated by ∆ k 1 , and, as a function of the second variable, g is annihilated by ∆ k 2 . Then for any non-negative integer j we have Applying this for g = E ′ N (τ 1 , τ 2 , 0, 1) we find: Corollary 5.9. Assume that d = 1 and V = Res F/Q (W ) as above. Then . Hence the function C j (E ′ N (·, 0, 1)) on the left hand side has essentially the property that is required in (5.13) for the function G, except for the sign (−1) j which appears in addition on the right hand side. However, this sign can be fixed by slightly redefining the CM cycle by putting Z j (W ) = Z(W 1 , σ 1 ) + (−1) j Z(W 0 , σ 0 ). (5.15) Now the analogue of Theorem 5.4 in this case is as follows.
Theorem 5.10. Assume that d = 1 and V = Res F/Q (W ) as above.
Here E + L denotes the 'holomorphic part' of E ′ L ( τ , 0; 1) (see [BKY12,Proposition 4.6]), that is, the part of the Fourier expansion which is indexed by totally positive ν ∈ F together with the holomorphic contribution of the constant term. The Cohen operator is taken with respect to the parallel weight (1, 1).
We omit the proof since it is analogous to the one of Theorem 5.4 with Proposition 3.6 replaced by Corollary 5.9.
The second term on the right hand side is the central derivative of the Rankin-Selberg type integral L(g, W, s) = C j (E L (·, s; 1)), g Pet .
for a cusp form g ∈ S 2−2j,ρ L , similarly as in [GKZ87, Section III]. When f is weakly holomorphic, this contribution vanishes, and Theorem 5.10 gives an explicit formula for the value of the higher Green function Φ j (z, h, f ) at the CM cycle Z j (W ). Using the explicit formulas for the coefficients of E ′ L of we see that for a constant C ∈ Q only depending on L and a positive rational number α whose prime factorization can be determined explicitly. Here d F denotes the discriminant of F .
It would be very interesting to generalize this result to general d ≥ 0. The crucial point would be to obtain an analogue of Corollary 5.9 or some other variant of (5.13). While there are Cohen operators for higher degree Hilbert modular forms (see e.g. [Lee04]) there does not seem to be a direct analogue of Corollary 5.9.

The Gross-Zagier conjecture and higher Heegner cycles
Here we consider examples of our main results for n = 1, 2. These can be used to prove certain cases of an algebraicity conjecture of Gross and Zagier and a higher weight version of the Gross-Kohnen-Zagier theorem.
The automorphic Green function (4.2) can be interpreted as a function on H × H. Using the fact that Here we have dropped the subscript µ from the notation in Φ m,µ (z, h, s), since L is unimodular, and the argument h ∈ H(A f ), since we have evaluated at h = 1. With the above formula for (λ z , λ z ) we get . z 2 ), where G m s (z 1 , z 2 ) denotes the Green function defined the introduction in (1.1). In particular, for m = 1 we obtain the resolvent kernel G s = G 1 s for the hyperbolic Laplacian. It has the following properties, see [Hej83], [GZ86, Chapter 2.2]. ( is the hyperbolic Laplacian in the variable z i for i = 1, 2; (iii) we have G s (z 1 , z 2 ) = e z 2 log |z 1 − z 2 | 2 + O(1) as z 1 → z 2 , where e z 2 denotes the order of the stabilizer of z 2 in PSL 2 (Z); (iv) G s (z 1 , z 2 ) = O(y 1−s 1 ) as y 1 → ∞ for fixed z 2 . When ℜ(s) > 1, these properties characterize G s uniquely, see [Zha97,Section 3.4]. Here, property (iv) replaces the integrality condition in the analogous result Proposition 4.5.
Let j ∈ Z >0 . For m > 0, let f m ∈ H −2j,ρ L be the unique harmonic Maass form whose Fourier expansion starts with f m = q −m + O(1) as v → ∞. Then according to (5.1) and Proposition 4.7 we have It is easy to see that the two-dimensional, positive definite subspaces of V (Q) are in oneto-one correspondence to pairs (z 1 , z 2 ) of CM points lying in the same imaginary quadratic field.
Consequently, Theorem 5.4 and Theorem 5.5 lead to formulas and algebraicity statements for CM values of the Green functions G m 1+j (z 1 , z 2 ) when evaluated at two different CM points z 1 and z 2 , such that Q(z 1 ) = Q(z 2 ). In particular, Corollary 5.6 implies the following theorem, which is a strengthening of a result due to Viazovska [Via11, Theorem 7].
Theorem 6.1. Let z 1 , z 2 ∈ X(1) be different CM points corresponding to CM orders of discriminant D 1 = f 2 1 D 0 and D 2 = f 2 2 D 0 in the same imaginary quadratic field k D 0 = Q( √ D 0 ). Moreover, let j > 0 and suppose that f ∈ M ! −2j has only integer coefficients in its principal part. Then there is an Let L be the lattice The dual lattice is given by : a, b, c ∈ Z . (6.6) We frequently identify Z/2MZ with L ′ /L via r → µ r = diag(r/2M, −r/2M). Here the quadratic form on L ′ /L is identified with the quadratic form x → −x 2 on Z/2MZ. The level of L is 4M. We fix the compact open subgroup K = GSpin(L) ⊂ H(A f ). Then the complex space of the corresponding Shimura variety X K is isomorphic to the modular curve Γ 0 (M)\H.
∈ L ′ with Q(λ) = m, we denote the associated CM point by Using a similar calculation as in Section 6.1, we obtain The automorphic Green function (4.2) can be interpreted as the function on H given by .  Proof. We employ the quadratic transformation formula for the Gauss hypergeometric function Applying (6.2) and (6.7) to the right hand side we get Inserting this into (6.8), we obtain This concludes the proof of the proposition.
To state Theorem 5.4 in the present case, we first interpret the L-function L(g, U, s) following [BY09, Section 7.2]. Let x 0 ∈ L ′ be primitive and assume that m 0 = Q(x 0 ) > 0. We let µ 0 = x 0 + L ∈ L ′ /L. Throughout we assume that D 0 = −4Mm 0 is a fundamental discriminant. We consider the CM cycle Z(U) associated with the negative definite subspace U = V ∩ x ⊥ 0 . The corresponding negative definite lattice N = L ∩ U has determinant |D 0 |. Since D 0 is fundamental, we have Z(U) = Z(m 0 , µ 0 ).
Proof. According to Lemma 5.3 we have where we view g as a modular form with representation ρ P ⊕N via Lemma 3.7. Using (6.11) and the fact that b(Q(λ), λ) = 0 for λ ∈ P ′ unless λ ∈ P ′ ∩ L ′ = Zx 0 , we obtain This implies the claimed formula with .
Simplifying this gamma factor we obtain the first formula.
Combining Theorem 5.4 and Lemma 6.3, we obtain the following result.
Theorem 6.4. Let f ∈ H 1/2−2j,ρ L and use the above notation. The value of the higher Green function Φ j (z, f ) at the CM cycle Z(U) is given by Here E + N denotes the holomorphic part of the harmonic Maass form E ′ N (τ, 0; 1), see (3.14). Let j ∈ Z >0 and let f m,µ ∈ H 1/2−2j,ρ L be the unique harmonic Maass form, whose Fourier expansion starts with q −m (φ µ + φ −µ ) + O(1) as v → ∞. Then according to Proposition 4.7 and Proposition 6.2 we have ). (6.13) Hence Theorem 6.4 and Theorem 5.5 can be applied to obtain algebraicity results for CM values of the higher Green function on the right hand side. We will come back to this topic and some refinements in Section 7.

A Gross-Kohnen-Zagier theorem for higher weight Heegner cycles.
Here we employ Theorem 6.4 together with some results of [Zha97] and [Xue10], to prove a Gross-Kohnen-Zagier theorem for Heegner cycles on Kuga-Sato varieties over modular curves, see Theorem 6.11.
We begin by recalling some basic facts on Kuga-Sato varieties and their CM cycles following Zhang [Zha97] and [Xue10]. Let κ > 1 be an integer, and let D < 0 be a discriminant. For an elliptic curve E with complex multiplication by where P 2κ−2 denotes the symmetric group of 2κ−2 letters which acts on E 2κ−2 by permuting the factors, and c is a real number such that the self-intersection of S κ (E) on each fiber is (−1) κ−1 .
When M is a product of two relatively prime integers bigger than 2, it can be shown that the universal elliptic curve over the non-cuspidal locus of the modular curve X (M) (over Z) with full level M can be extended uniquely to a regular semi-stable elliptic curve E(M) over the whole X (M). The Kuga-Sato variety Y = Y κ (M) is defined to be a certain canonical resolution of the (2κ − 2)-tuple fiber product of E(M) over X (M), see [Zha97, Section 2]. If y is a CM point on X (M), the CM-cycle S κ (y) over y is defined to be S κ (E y ) in Y.
For a general integer M ≥ 1, we choose a positive integer M ′ such that M|M ′ and M ′ is the product of two co-prime integers bigger than 2. Let π : X (M ′ ) → X 0 (M) be the natural projection. If x is a CM point on X 0 (M), then π * (x) = w(x) 2 i x i with π(x i ) = x and w(x) = | Aut(x)|. The CM-cycle S κ (x) over x is defined to be i S κ (x i )/ √ deg π. Let X 0 (M) and Y be the generic fibers of X 0 (M) and Y. For a CM point x ∈ X 0 (M), let x be its Zariski closure in X 0 (M). It is proved in [Zha97] that S κ (x) has zero intersection with any cycle of dimension κ in Y which is supported in the special fibers, and that the class of S κ (x) in H 2κ−2 (Y (C), C) vanishes. Therefore, there is a Green current g κ (x) on Y (C), unique up to the image of ∂ and∂, such that where the current on the right hand side is the Dirac current given by integration over S κ (x), and g κ (x)η = 0 for any ∂∂-closed form η on Y (C). The arithmetic CM-cycleŜ κ (x) over x, in the sense of Gillet and Soulé [GS90], is the arithmetic codimension κ cycle on Y defined bŷ S κ (x) = (S κ (x), g κ (x)). (6.14) Now let x and y be two different CM points on X 0 (M). Then the height pairing of the CM cycles S κ (x) and S κ (y) on Y is defined as the arithmetic intersection According to [Zha97, Section 3.2], it decomposes into local contributions Here the last identity is [Zha97, Proposition 3.4.1], and G M,κ (x, y) is the higher Green function defined in [GZ86, Eq. (2.10)]. Let U and m 0 be as in Section 6.2. Following [Xue10], we define higher Heegner divisors for X 0 (M) as It is our goal to compute the height pairing of these divisors in the case of proper intersection. Let m 1 ∈ Q >0 and let µ 1 ∈ L ′ /L such that Q(µ 1 ) ≡ m 1 (mod 1). Then D 1 := −4Mm 1 ∈ Z is a negative discriminant which is a square modulo 4M. Assume that D 1 and D 0 are coprime, and assume that D 0 = −4Mm 0 is fundamental (such that Z κ (U) = Z κ (m 0 , µ 0 )). As in (3.14) let κ(m, µ) denote the (m, µ)-th Fourier coefficient of E + N (τ ). Theorem 6.5. Let the notation be as above and assume that κ = 1 + 2j > 1 is an odd integer. Let f m 1 ,µ 1 ∈ H 3/2−κ,ρ L be the unique harmonic Maass form, whose Fourier expansion starts with q −m 1 (φ µ 1 + φ −µ 1 ) + O(1).
(1) One has (2) The global height pairing is given by Proof. By (6.17), (6.13), and Theorem 6.4, we have Using Propositions 6.7, 6.9 and Lemma 6.8 below, we find that Hence, we obtain for the global height pairing: Moreover, a simple calculation shows that Inserting these expressions, we obtain the asserted formula.
We now provide the three auxiliary results that were used in the proof of Theorem 6.5.
Proposition 6.7. Let the notation be as above and assume that κ = 1 + 2j > 1 is odd.
With these formulas, we can split Now it is straightforward to verify the following identities for j − m ≤ s ≤ j: x (m+1) Notice that the right hand side is independent of s. Adding them together, we see that b 2m satisfies the recursion formula (6.18). This proves that β j (x) = P 2j (x).
We thank Ruixiang Zhang for showing one of us (T.Y.) the proof of the above lemma.
Proposition 6.9. Let the notation be as before. In particular, assume that D 0 is fundamental and (D 0 , D 1 ) = 1. Then To prove this proposition, we need some preparation. For every finite prime p we compute the local height pairing Z κ (m 1 , µ 1 ), Z κ (U) p at p. The case when p is split in Q( √ D i ) for some i is trivial as both sides are zero. Now fix a prime p which is non-split in Q( √ D i ) for i = 0, 1, and let B = B p be the division quaternion algebra over Q ramified exactly at p and ∞. For an integer n ≡ r 0 r 1 (mod 4M) with n 2 ≤ D 0 D 1 , let S [D 0 ,2n,D 1 ] ⊂ B p be the Clifford order Z + Zα 0 + Zα 1 + Zα 0 α 1 with α i = r i +e i 2 ∈ B p , e 2 i = D i (we will simply denote e i = √ D i ), and e 0 e 1 + e 1 e 2 = 2 tr(α 0 α 1 ) − r 1 r 2 = 2n.
Let W p be the Witt ring ofF p , and letx i ∈ Z(m i , µ i )(W p ), where Z(m i , µ i ) is the Zariski closure of Z(m i , µ i ) in X 0 (M). Writex i for the reduction ofx i modulo p. If x 1 ,x 0 p = 0 with z =x 1 =x 0 ∈ Z(m 1 , µ 1 ) ∩ Z(m 0 , µ 0 )(F p ), then End(z) is an Eichler order of B p containing S [D 0 ,2n,D 1 ] with n given by the above equation. We require the following results.
Proposition 6.10. Let the notation be above.
(1) One has (2) One has Proof. The first assertion is proved in [ Proof of Proposition 6.9. We are now ready to prove Proposition 6.9. Let I n,p be the subcycle of Z(m 0 , µ 0 )(F p )∩Z(m 1 , µ 1 )(F p ) consisting of elements z =x 0 =x 1 in the intersection such that S [D 0 ,2n,D 1 ] ⊂ End(z). Let C be the moduli stack of CM elliptic curves (E, ι) with complex multiplication by be the isomorphism defined in [BY09,Lemma 7.10]. Then [BY09,Lemma 7.12] asserts that Here Z(m, a, µ) is the 0-cycle in C defined in [KY13] (see also [BY09, Section 6]) for a fractional ideal a of Q( √ D 0 ), µ ∈ 1 √ D 0 a/a, and m ≡ − N(µ)/ N(a) (mod Z). Identifying j * Z(m 1 , µ 1 ) with Z(m 1 , µ 1 ) ∩ Z(m 0 , µ 0 ), one sees that Moreover, under the identification, we have (x 1 ·x 0 ) p = deg C j * x 1 . With these preparations and Proposition 6.10, we obtain Here the last identity is a consequence of [BY09, Theorem 6.4]. Since n+r 1 , we have proved the proposition.
As before, let κ = 1 + 2j > 1 be an odd integer. We consider the generating series In analogy with the Gross-Kohnen-Zagier theorem [GKZ87] it is expected that A κ (τ, U) is a cusp form in S κ+1/2,ρ L , or equivalently a cuspidal Jacobi form of weight κ+1 and index M for the full Jacobi group. Note that the height pairings Z κ (m, µ), Z(U) may involve improper intersections of higher Heegner cycles on Kuga-Sato varieties when (4Mm, D 0 ) = 1, a technical problem which we do not consider in the present paper. Here we prove the following version of the Gross-Kohnen-Zagier theorem.
Proof. The theorem is a direct consequence of Corollary 6.6 and the modularity criterion Proposition 6.15 below.
By means of Lemma 6.13 below, we obtain the following consequence.
Proof. This can be proved in the same way as [Sch16, Proposition 3.1].

Partial averages
In this section, we will use the higher automorphic Green functions for SO(1, 2) to evaluate certain partial averages of the resolvent kernel for SL 2 (Z) at positive integral spectral parameter as considered in Section 6.1. To this end we employ and generalize and Theorem 5.5 and Theorem 6.4 of Section 6.2. Throughout this section, we let V , L, and K be as in Section 6.2 but we restrict to level 1 for simplicity. Thus, X K is isomorphic to the modular curve SL 2 (Z)\H.
The general idea of this section is to fix a fundamental discriminant d 1 and to consider the partial average G j+1,f (C(d 1 ), z 2 ), where we use the same notation as in the Introduction. We shall prove that at any CM point z 2 of discriminant d 2 the CM value G j+1,f (C(d 1 ), z 2 ) is equal to (d 1 d 2 ) j−1 2 log |α| for some α ∈Q (see Corollary 7.15 below). This result proves Conjecture 1.1 in the case when the class group of Q(d 1 ) is trivial. 7.1. Twisted special divisors. To obtain a stronger result, and to make this approach work at all for odd j as well, we also consider twisted partial averages, which we will now define.
Definition 7.1. Let ∆ ∈ Z be a fundamental discriminant and p be a prime. For λ ∈ V (Q p ), we put χ ∆,p (λ) = 0 unless In the latter case, we let Here, (a, b) p denotes the p-adic Hilbert symbol. Finally, for λ = (λ p ) p ∈ V (A f ), we put The following lemma is a local variant of [GKZ87, I.2, Proposition 1] and we leave the (completely analogous) proof to the reader.
Lemma 7.2. The function χ ∆,p is well-defined. Moreover, for p | ∆ and λ = b/2 −a c −b/2 ∈ L ′ p with 4Q(λ) ∈ ∆Z p , we have the following explicit formula: Using this formula it is easy to see that for λ ∈ L ′ , we have This shows that on L, our definition of χ ∆ agrees with the (generalized) genus character as in [GKZ87;BO10]. In the following lemma, we write h · λ = hλh −1 for the action of h ∈ GSpin ∼ = GL 2 on λ ∈ V .
Proof. Let S = ( 0 1 −1 0 ) and putL = LS. For λ ∈ L ′ p , we write andλ = λS. Theñ λ is symmetric and Q(λ) = Q(λ). The group GL 2 (Z p ) acts onL via h ·λ = hλh t for h ∈ GL 2 (Z p ). Moreover, we have It is clear that n is represented by the quadratic form associated toλ (i. e., [a, b, c]) if and only if n is repesented by the form associated to h ·λ for any h ∈ GL 2 (Z p ). This implies the statement of the lemma.
This is the case if and only if the corresponding binary quadratic form [a, b, c] is positive definite.
We let For ∆ = 1, we have K ∆ = K = GSpin(L), and then K ∆ has index 2 in K. Now assume that ∆ = 1. Since H(A f ) = H(Q) + K, the Shimura variety X K ∆ then has two connected components which are both isomorphic to X K ∼ = SL 2 (Z)\H.
To describe this isomorphism, let Γ 1 = K ∆ ∩ H(Q) + = SL 2 (Z), choose ξ ∈ K such that ξ ∈ K ∆ and put Γ ξ = (ξK ∆ ξ −1 ) ∩ H(Q) + = SL 2 (Z). Then (det(ξ), ∆) A f = −1 and We obtain an isomorphism For h ∈ H(A f ), we denote by c(λ, h) the "connected" cycle [Kud97] corresponding to λ on the component corresponding to the class of h. That is, we obtain the cycle (which is really just a weighted point in our case) c(λ, h) as the image of λ is the unique point in D + , such that (D + λ , λ) = 0. Each point in the image is weighted by 2/|Γ h,λ |. We keep the same notation for ∆ = 1, where X K ∆ = X K has only one connected component.
Definition 7.5. We define the following twisted divisors on X K ∆ (cf. also [BO10]). Let r ∈ Z with ∆ ≡ r 2 mod 4 and let µ ∈ L ′ /L with sgn(∆)Q(µ) ≡ m mod Z. Define Note that since we restricted to the level one case, µ ∈ L ′ /L is uniquely determined by the condition sgn(∆)Q(µ) ≡ m mod Z and therefore we dropped µ from the notation. Also note that by definition, the cycle Z ∆ (m, h) is supported on the connected component corresponding to the class of h in H(Q)\H(A f )/K ∆ .
Remark 7.6. For ∆ = 1, we have Z 1 (m, h) = C(D) = P D,s , where D = −4m, s 2 ≡ D mod 4 and P D,s is the Heegner divisor defined in [GKZ87]. 7.2. Twisted Siegel and Millson theta functions. For the partial averages in the case of odd j, we also need the Millson theta function. For and z ∈ H ⊔H ∼ = D we let is a normalized (i.e., (X 1 (z), X 1 (z)) = 1) generator of the positive line X(z) ⊥ , and X(z) is defined in (6.4). Now suppose that M is an even lattice of signature (1, 2), and fix an isometric embedding σ : M ⊗ R → V (R). Then we define for τ ∈ H, z ∈ D, and h ∈ H(A f ). The Millson theta function has weight 1/2 in τ and transforms with the representation ρ M .
For the twisted partial averages, we also need twisted variants of the Siegel and the Millson theta functions. Let r ∈ Z with ∆ ≡ r 2 (mod 4). If M is any lattice with quadratic form Q, we write M ∆ for the rescaled lattice M ∆ = ∆M with the quadratic form Q ∆ = Q |∆| . Note that we have M ′ ∆ = M ′ and thus M ′ ∆ /M ∆ = M ′ /∆M. Following [AE13], we let If ∆ > 0, this map is an intertwining operator for the Weil representation ρ L on S L and ρ L ∆ on S L ∆ . If ∆ < 0, it intertwinesρ L on S L and ρ L ∆ on S L ∆ (see [AE13, Proposition 3.2] and [BO10, Proposition 4.2]). The twisted Siegel theta function for the lattice L is defined as By the intertwining property of ψ ∆ , it transforms as a vector valued modular form of weight −1/2 in τ for the Weil representation ρ L if ∆ > 0 and forρ L if ∆ < 0. Explicitly, we have To define the twisted Millson theta function, we embed (L ∆ , Q ∆ ) isometrically into V (R) via σ(λ) = 1 √ |∆| λ and let θ M L ∆ (τ, z) be as in (7.3). We then define the twisted Millson theta function as It transforms of weight 1/2 withρ L if ∆ < 0 and with ρ L if ∆ > 0 and is also K ∆ -invariant.
Remark 7.7. Note that in our level 1 case, the function θ L,∆ vanishes if ∆ < 0. Similarly, θ M L,∆ = 0 if ∆ > 0. For higher level, this is not the case. Moreover, note that for ∆ = 1, the map ψ ∆ is the identity on L ′ /L.
A straightforward calculation shows that the theta lift against any of the twisted theta functions can in fact be obtained by twisting the input function using ψ ∆ , which simplifies many calculations. The analogous formula holds with θ L,∆ replaced by θ M L,∆ and θ L ∆ replaced by θ M L ∆ . 7.3. Twisted theta lifts. Let j be an even positive integer, and let ∆ > 0 be a fundamental discriminant. For f ∈ H 1/2−j,ρ L we consider the twisted theta lift Let f m ∈ H 1/2−j,ρ L be the unique harmonic Maass form whose Fourier expansion starts with f m = q m φ µ + O(1) as v → ∞. We now identify the theta lift with a twisted partial average of the higher Green function. Fix h ∈ H(A f ). We then identify the connected component Γ h \D + of X K ∆ with SL 2 (Z)\H. The divisor Z ∆ (m, h) is supported on this component and corresponds to the divisor (det (h), z λ ∈ H is the CM point corresponding to λ, and w(λ) is the order of the stabilizer of λ in SL 2 (Z). We denote by G 1+j (Z ∆ (m, h), z) the function on SL 2 (Z)\H defined by We can evaluate this function at points (z, h) that lie on the connected component corresponding to h as follows: write h = γh 0 k with γ ∈ H(Q), k ∈ K ∆ , such that γ −1 z ∈ D + ∼ = H and h 0 = 1 or h 0 = ξ and put Using Lemma 7.3, it is straightforward to check that the analogous identity to (6.13) holds: , where the additional factor 2 is a result of the condition λ > 0 in the definition of the twisted divisor (7.1). See also the analogous proof of Theorem 7.9 below which takes the twist into account.
We now turn to the case of odd positive j. For a negative fundamental discriminant ∆ < 0 and a weak Maass form of weight −1/2 with representation ρ L we may consider the regularized theta lift For µ ∈ L ′ /L and m ∈ Z − Q(µ) with m > 0, let F m,µ (τ, s, −1/2) be the Hejhal Poincaré series of weight −1/2 defined in (3.8) but withρ L replaced by ρ L . We put By the usual argument it can be shown that the regularized theta integral is well defined and smooth outside the special divisor Z ∆ (m, 1) + Z ∆ (m, ξ). The following result gives an explicit formula for it analogous to Proposition 6.2.
Inserting this, we find ).
In particular, at the harmonic point s = 5/4 (note that the input form has weight −1/2), we get Φ M ∆,m (z, h, 5/4) = 8 √ mG 2 (Z ∆ (m, h), (z, h)). Let f m ∈ H 1/2−j,ρ L be the unique harmonic Maass form whose Fourier expansion starts with f m = q m φ µ + O(1) as v → ∞. Then the analogue of (6.13) for odd j states Completing the definiton ofΦ j ∆ (z, h, f m ) in (7.5) we define the twisted theta lift of f ∈ H 1/2−j for odd j as Theorem 7.10. Let j ∈ Z >0 and let d be a fundamental discriminant with (−1) j d < 0. There is a linear map Za j d : H −2j → H 1 2 −j,ρ L , such that Za j d (f ) is the unique harmonic Maass form in H 1 2 −j,ρ L with principal part (not including the constant term) given by Here, for any x ∈ Z we write φ x = φ (x mod 2) . Furthermore, (1) If f is weakly holomorphic, then so is Za j d (f ). Proof. First of all, we note that both, [ANS18, Theorem 1.1] and [DJ08, Theorem 1] are stated for scalar-valued modular forms. Using the isomorphism , we obtain the translation of their results to our vector-valued setting.
By Theorem 1.1 in [ANS18], the definition of Za j d then agrees with the dth Millson theta lift, up to the normalizing factor |d| −j/2 . Restricted to weakly holomorphic forms, it agrees with the dth Zagier lift defined by Duke and Jenkins. Therefore, (1) follows from [DJ08] and the generalization (2) follows from [ANS18].
Write −2j = 12ℓ + k ′ , where ℓ ∈ Z and k ′ ∈ {0, 4, 6, 8, 10, 14} are uniquely determined. Let A = 2ℓ if ℓ is even and A = 2ℓ − (−1) j if ℓ is odd. In Section 2 of [DJ08], a basis (f m ) m for M ! 1/2−j is constructed, where for all m ≥ −A with (−1) j−1 m ≡ 0, 1 mod 4, the basis element f m has a Fourier expansion of the form a(m, n)q n/4 φ n and it is shown that a(m, n) ∈ Z for all m and n.
Since the principal part of |d| j/2 Za j d (f ) contains only integer coefficients, it must be an integral linear combination of the f m , and thus all Fourier coefficients are integral.
Theorem 7.11. Let j ∈ Z ≥0 . Let d 1 and ∆ be fundamental discriminants with (−1) j d 1 < 0 and (−1) j ∆ > 0, and put m 1 = |d 1 |/4. For f ∈ H −2j we have Proof. By (7.13) together with (7.7) for even j and (7.10) for odd j, we obtain that We need to compare the sum on the right-hand side with G j+1,f (Z ∆ (m 1 ), (z, h)), which is by definition equal to According to [GKZ87,p. 508], we have (7.14) and this finishes the proof.
Note that we have U ∼ = Q( √ d 2 ) and both CM points (z + U , 1) and (z + U , ξ) correspond to the point −r 2 + √ d 2 2 on each connected component of X K ∆ if identified with SL 2 (Z)\H. As in Section 5, we have the two lattices P = L ∩ U ⊥ and N = L ∩ U. Explicitly, they are given by which implies that P ′ = Z 2−r 2 |d 2 | x 2 . Hence, the discriminant group P ′ /P is cyclic of order 2|d 2 | if r 2 = 1 and of order |d 2 |/2 if r 2 = 0. The lattice N has discriminant d 2 and is described below in Lemma 7.12, which is a special case of Lemma 7.1 in [BY09].
and this defines a 2-dimensional lattice of discriminant d 2 with the quadratic form Q ]. Recall that we put T = GSpin(U) and This can either be seen as in Corollary 5.6 or alternatively verified using the embedding given in Lemma 7.12. Consequently, the cycle Z(U) K on X K is in bijection to two copies of the ring class group Cl(O d 2 ), see Section 3.3.
We are now able to obtain a formula for the twisted partial averages at CM points. At the point z U , we obtain two definite lattices N ∆ = ∆L ∩ U and P ∆ = ∆L ∩ U ⊥ , both equipped with the quadratic form Q |∆| . Theorem 7.13. Let (z + U , h) ∈ Z(U) be a CM point and let (1) If j ∈ Z >0 is even, (2) and if j ∈ Z >0 is odd, we have whereθ P ∆ (τ ) is the weight 3/2 theta functioñ Remark 7.14. Note that in both cases, the right-hand side in Theorem 7.13 is well-defined even if (z ± U , h) is contained in any of the divisors Z ∆ (m 1 , h) | T m for m > 0 with c f (−m) = 0. These are in fact the values of the (non-continuous) extension of the higher Green function to the divisor obtained from realizing it as a regularized theta lift in Theorem 7.11.
Proof of Theorem 7.13. The proof is analogous to Theorem 5.4. First suppose that j is even. By virtue of Theorem 7.11, (7.5), and Lemma 7.8, we obtain From here, the proof continues parallel to the one of Theorem 5.4. For odd j, we can perform the analogous calculation using the definition in (7.11) and the splitting of the Millson theta function . Corollary 7.15. Let j ∈ Z ≥0 . Let d 1 and ∆ be fundamental discriminants with (−1) j d 1 < 0 and (−1) j ∆ > 0, and assume that d 1 d 2 ∆ is not a square of an integer. Put m 1 = |d 1 |/4, and let f ∈ H −2j with integral principal part and such that L(ξ −2j (f ), χ d 1 , j + 1) = 0. Then we have for any (z + U , h) ∈ Z(U) that the value |d 1 d 2 ∆| j/2 G j+1,f (Z ∆ (m 1 , h), (z + U , h)) can be expressed as a finite integral linear combination of Fourier coefficients of G + N ∆ . In particular, where α U,f,∆ (h) ∈ H d 2 ( √ ∆) × and t ∈ Z >0 only depends on d 2 and ∆. Moreover, we have Note that even when d 1 d 2 ∆ is a square, the statement of the corollary remains valid if (z + U , h) is not contained in any of the Hecke translates Z ∆ (m 1 , h) | T m for m > 0 with c + f (−m) = 0. For the proof of Corollary 7.15, we need the following Lemma. Lemma 7.16. Let , ∆) A f = 1} and its fixed field under the Artin map is H d 2 ( √ ∆).
Proof of Corollary 7.15. By Theorem 7.10 (3), all Fourier coefficients of |d 1 | j/2 Za j d 1 (f ) are integral. The Fourier coefficients of the Rankin-Cohen brackets [θ P ∆ (τ ), G + N ∆ (τ, h)] j/2 and |d 2 ∆|[θ P ∆ (τ ), G + N ∆ (τ, h)] (j−1)/2 can be expressed as rational linear combinations of the Fourier coefficients of G + N ∆ (τ, h). The denominator of the rational numbers appearing in this linear combination can be bounded by (4|d 2 ∆|) j/2 when j is even and by (4|d 2 ∆|) j−1 2 · 2 when j is odd (the additional factor 2 is obtained from p z (λ) if r 2 = 1). In any case, taking into account the factor 2 j−1 in Theorem 7.13, and the factor |d 1 d 2 ∆| j/2 in the statement of the corollary, we are left with a factor of 2 in the denominator.
This remaining 2 in the denominator is also cancelled which can be seen as follows: If we write the constant term on the right-hand side of Theorem 7.13 as a sum of the form where a(m, µ) are the Fourier coefficients of ψ ∆ (Za j d 1 (f )) P ∆ ⊕N ∆ and b(m, µ) the Fourier , then we can rewrite this sum as Collecting all factors, we obtain that |d 1 d 2 ∆| j/2 G j+1,f ((z ± U , h), Z ∆ (m 1 )) is equal to an integral linear combination of the Fourier coefficients c + N ∆ (h, m, µ) of G + N ∆ (τ, h). By Theorem 3.9, we have for all (m, µ) = (0, 0) and with α N ∆ (h, m, µ) ∈ H × d 2 ∆ 2 and n ∈ Z >0 . Moreover, t ′ only depends on N ∆ which means it only depends on d 2 and ∆. Thus, we obtain that However, the left-hand side is invariant under the h → h ′ h for h ′ ∈ K T,∆ and the field H d 2 ( √ ∆) is fixed by these elements according to Lemma 7.16. By virtue of the Shimura reciprocity law (Theorem 3.9, (3)) and the invariance under K T,∆ , we obtain This implies that for all σ ∈ Gal(H d 2 ∆ 2 /H d 2 ( √ ∆)), there is a root of unity ζ σ such that Therefore, the constant term of the minimal polynomial ofα (h)  We finish this section by rewriting the CM cycle Z(U) in classical terms and give a proof of Conjecture 1.1 when one of the class groups has exponent 2.
Lemma 7.17. The image of Z(U) K on X K ∼ = SL 2 (Z)\H is given as follows.
Let Q 0 d 2 be the set of primitive integral binary quadratic forms [a, b, c] of discriminant d 2 . For each such Q = [a, b, c] we denote by z Q the unique root of az 2 + bz + c = 0 in H. For simplicity, we also denote its image in SL 2 (Z)\H by z Q . We have where w d 2 denotes the number of roots of unity contained in O d 2 .
Corollary 7.18. Let D ′ < 0 be a fundamental discriminant and assume that the class group of O D ′ is trivial or has exponent 2. Let f ∈ M ! −2j with integral principal part and let z ∈ H be any CM point of discriminant D < 0 (not necessarily fundamental) and where t ∈ Z >0 only depends on D and D ′ (but not on f or j).
Proof. For the proof, we work with one of the connected components of X K ∆ and identify it with SL 2 (Z)\H. Thus, we can work with the divisors Z ∆ (m 1 ) defined in (7.6). For each decomposition of D ′ into D ′ = d 1 ∆ with d 1 and ∆ fundamental discriminants and (−1) j d 1 < 0 as well as (−1) j ∆ > 0, we have shown in Corollary 7.15 that for any z of discriminant D, we have where α ∆ (z) ∈ H D ( √ ∆) × and t ∆ ∈ Z >0 . We let C be the class group of O D ′ . For any fundamental discriminant ∆ | D ′ , we let d 1 = D ′ /∆ and and m 1 = |d 1 |/4. The splitting D ′ = ∆ d 1 determines a genus character where we write z [a] for the CM point corresponding to a on SL 2 (Z)\H.
Since C has exponent 1 or 2 by assumption, its order is exactly 2 s−1 , where s is the number of prime divisors of D ′ and every class group character can be obtained as a genus character. Note that there are exactly s splittings D ′ = ∆∆ where ∆ and∆ are both fundamental discriminants and (−1) j ∆ > 0 since D ′ < 0. We denote the fundamental discriminants satisfying these criteria by ∆ 1 , . . . , ∆ s . Note that {χ ∆ 1 , . . . , χ ∆s } is a full set of representatives of the class group characters of k D ′ . Hence, the individual value corresponding to an ideal class [a] can be obtained as Since the class group of k D ′ has exponent 2, we have . . , √ ∆ s ) and the claim follows.

Numerical examples
Here we provide some numerical examples to illustrate the results of Section 7. In particular we demonstrate how our main results in Section 7 and the Appendix can be implemented to obtain explicit formulas for the algebraic numbers determining the CM values of higher Green functions. 8.1. Example 1. We start with an example for j = 2, which is a bit simpler than j = 1 since we can work with ∆ = 1.
Note that for k = j + 1 = 3, we have that S 2k = S 6 = {0}. Therefore, the algebraicity conjecture concerns the individual values of G 3 at pairs of CM points in this case. The function G 3 (z 1 , z 2 ) is obtained as the higher theta liftΦ 1 (f, z), where f ∈ M ! −4 is the unique weakly holomorphic modular form for the full modular group whose Fourier expansion starts with f = q −1 + O(1). It is explicitly given by where E 8 (τ ) ∈ M 8 is the normalized Eisenstein series of weight 8 for SL 2 (Z) and ∆(τ ) ∈ S 12 is the discriminant function.
We consider the case d 2 = −23. In the notation of the previous section, we have r = 1 and The CM cycle Z(U) for U = V (Q) ∩ x ⊥ 2 then consists of the three points The discriminant group P ′ /P is isomorphic to Z/46Z with quadratic form x 2 /92 and, according to Lemma 7.12, the lattice N is isomorphic to the ring of integers O −23 ⊂ k −23 = Q( √ −23) with quadratic form given by the negative of the norm form. Numerical approximations for the CM values can be obtained by using the Fourier expansion of G 3 , for instance G 3 (i, z 1 ) ≈ −1.000394556341. Note that, given m ∈ Z, there are exactly two cosets ±µ m , such that m ≡ Q(µ m ). If m ∈ Z, then µ = 0 is the only possibility. We now let G + N (τ ) = m c(m)q m φ m be the holomorphic part of a harmonic Maass form G N ∈ H 1,ρ N with the property that L 1 (G N (τ )) = θ N (τ, 1). To lighten the notation, we drop the index of the component µ and simply write c(m) for c(m, µ) and φ m = φ µm + φ −µm for m ∈ Z and φ m = φ 0 for m ∈ Z. We require the additionally that c(m) = 0 for m < −1/23, which can be satisfied because the space S 1,ρ N is one-dimensional and spanned by a cusp form whose Fourier expansion starts with q 1/23 . These conditions then characterize G N uniquely, since M 1,ρ N = {0}. The lattice P is spanned by 2x 2 and P ′ by x 2 /7. According to Theorem 7.13, we have The lattice N −3 is isomorphic to the order O −63 in k −7 = Q( √ −7) of discriminant −63. We take the basis (1, 3 1+ the algebraic numbers, which allows for some simplifications. In this regard, the results of [Ehl17] are stronger than Theorem 3.9. However, Theorem 3.9 is much more general as it does not put any restriction on N, whereas in [Ehl17] the assumption was that the discriminant of N is an odd fundamental discriminant. A.1. Weakly holomorphic modular forms. In this section, we basically follow [Ehl17, Section 4.3] to define a convenient basis of the space of weakly holomorphic modular forms. The setup for this section is more general than for the rest of the appendix. For simplicity, we make the following assumptions: we let (N, Q) be any even lattice of even signature and let k ∈ Z such that 2k ≡ sgn(N) mod 4. First consider the space of holomorphic modular forms M k,ρ N (Q) with rational coefficients and its dual M k,ρ N (Q) ∨ . Let (m 1 , µ 1 ), . . . , (m r , µ r ) ∈ Q ≥0 × N ′ /N such that the linear maps α 1 , . . . , α r ∈ M k,ρ N (Q) ∨ defined by form a basis of M k,ρ N (Q) ∨ . We fix these indices once and for all and let G 1 , . . . , G r ∈ M k,ρ N (Q) be the dual basis, i.e., G i satisfies c G i (m j , µ j ) = δ i,j .
Note that f m,µ , g n,ν ∈ M ! 2 , which implies that its constant term vanishes. The relation (A.5) and the fact that weakly holomorphic modular forms with rational Fourier coefficients have bounded denominators implies the following lemma.
Lemma A.2. For every n 0 ∈ Q there is an A ∈ Z >0 , only depending on N, k, and n 0 , such that for all n ≤ n 0 , and all ν, m, µ, we have A · a m,µ (n, ν) ∈ Z and A · b n,ν (m, µ) ∈ Z.
(3) For every m ∈ Q and µ ∈ N ′ /N with Q(µ) ≡ m mod Z, we have Proof. Arguing as in Proposition 2.12 of [ES18], there is anG ∈ H ! k satisfying (1). To ensure thatG satisfies (2), we can subtract suitable multiples of the G i fromG without changing the image under the lowering operator. Now let G N (τ, h) be a harmonic Maass form with L k (G N (τ, h)) = θ N (τ, h) satisfying (1) and (2). Note that these conditions uniquely characterize G N (τ, h). By Theorem 5. where we have used (1) in the second line. By condition (2), the first sum on the right-hand side vanishes. Finally, by (A.2), the second sum on the right-hand side vanishes as well and this finishes the proof.
A.2. Special preimages of binary theta functions. In this section we restrict to the case q = 2, i.e., N has signature (0, 2) and k = 1. Let U = N ⊗ Q be the corresponding rational quadratic space and write θ N (τ, h) for the Siegel theta function attached to N. We put T := GSpin(U). As in Section 3.3, we let D be the discriminant of N, and write O D ⊂ k D = Q( √ D) ∼ = U for the order of discriminant D in k D . For convenience of the reader, we recall the statement of Theorem 3.9, which we will now prove. (1) We have L 1 (G N (τ, h)) = θ N (τ, h).
(2) Let µ ∈ L ′ /L and m ∈ Q with m ≡ Q(µ) mod Z and (m, µ) = (0, 0). There is an algebraic number α(h, m, µ) ∈ H × D such that For the proof, we consider the lattice L := P ⊕ N of signature (1, 2), where P = Z with the quadratic form x 2 . We put V = L ⊗ Q and let D be the asociated symmetric domain. We let H = GSpin(V ) and K = GSpin(L), so that the theta lift Φ L (z, h, f ) of any f ∈ M ! 1/2,ρ L defines a meromorphic modular form on X K . We view Z(U) as a CM cylce on X K as in Section 2. For m ∈ Q and µ ∈ N ′ /N with m ≡ Q(µ) mod Z, we let f m,µ ∈ M ! 1,ρ N (Q) be as in the previous section. Remark A.5. We remark that all of the following arguments can easily be adopted to work with any lattice L of signature (1, 2) such that we have a primitive isometry N ֒→ L.
In [Ehl17] we used the lattice for Γ 0 (|D|) for odd squarefree D to obtain more precise information about the algebraic numbers appearing in Theorem A.4 (for instance integrality and the prime factorization), and for computational purposes it can also be useful to tweak the choice of L. For the purposes of proving the statements of Theorem A.4, however, our simple choice suffices.
Proof. We follow the argument given in Theorem 6.6 of [Via19] and Section 4.2 of [Ehl17] (here the special case for A = 1 in [Ehl17] is sufficient). For any integer k, the space M ! k−1/2,ρ P is isomorphic to the space of J ! k,1 of weakly holomorphic Jacobi forms of weight k and index 1 via the theta expansion of Jacobi forms [EZ85].
Finally, to obtain the bound, note that ψ 0,1 has integral Fourier coefficients and a principal part equal to q −1/4 φ 1/2+Z . Let A be the bound in Lemma A.2 such that Aa m,µ (n, ν) ∈ Z for all n ≤ n 0 + 1/4. Then Aψ 0,1 ⊗ f m,µ has integral Fourier coefficients, up to q n 0 .
Corollary A.7. There is a constant A 0 ∈ Z >0 , only depending on N, such that for all m and µ, the Borcherds product Ψ L (z, h, A 0 F m,µ ) defines a meromorphic function on X K which is defined over Q.
Proof. We use n 0 = 1 in Proposition A.6 to obtain a bound B on the denominator of the Fourier coefficients of F m,µ , up to q 1 . By [HP17, Theorem A], there is a constant A 0 with B | A 0 such that Ψ L (z, h, A 0 F m,µ ) is defined over Q. An inspection of the proof of [HP17, Theorem A] shows that A 0 can be chosen indepently of m and µ.