The u-plane integral, mock modularity and enumerative geometry

We revisit the low-energy effective U(1) action of topologically twisted N=2\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${\mathcal {N}}=2$$\end{document} SYM theory with gauge group of rank one on a generic oriented smooth four-manifold X with nontrivial fundamental group. After including a specific new set of Q\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\mathcal Q$$\end{document}-exact operators to the known action, we express the integrand of the path integral of the low-energy U(1) theory as an anti-holomorphic derivative. This allows us to use the theory of mock modular forms and indefinite theta functions for the explicit evaluation of correlation functions of the theory, thus facilitating the computations compared to previously used methods. As an explicit check of our results, we compute the path integral for the product ruled surfaces X=Σg×CP1\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$X=\Sigma _g \times \mathbb {CP}^1$$\end{document} for the reduction on either factor and compare the results with existing literature. In the case of reduction on the Riemann surface Σg\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\Sigma _g$$\end{document}, via an equivalent topological A-model on CP1\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\mathbb {CP}^1$$\end{document}, we will be able to express the generating function of genus zero Gromov–Witten invariants of the moduli space of flat rank one connections over Σg\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\Sigma _g$$\end{document} in terms of an indefinite theta function, whence we would be able to make concrete numerical predictions of these enumerative invariants in terms of modular data, thereby allowing us to derive results in enumerative geometry from number theory.


Introduction, summary and plan
The role of topological quantum field theory in modern physics and mathematics is unambiguously important. One example is Donaldson-Witten (DW) theory, which is a topological formulation of the N = 2 supersymmetric Yang-Mills theory on an oriented smooth four-manifold X . Its equivalent IR (long distance) counterpart is an abelian theory where Seiberg-Witten (SW) geometry dictates the physics [1]. Due to an electric-magnetic duality in the IR, characteristic functions of the theory enjoy powerful modular properties [2]. In the seminal paper [3], the solution of the IR theory was derived using the technique of lattice reduction for simply connected X . In the same paper, the famous relation was found, where Z SW denotes the generating function of SW invariants of the fourmanifold [4], while Z u denotes the contribution to Z DW from the Coulomb branch of the low-energy effective U (1) theory, the so-called u-plane. The u-plane and its contribution to the path integral were studied in detail in [3,[5][6][7]. The u-plane integral Z u is of particular interest since it is non-vanishing only for four-manifolds with b + 2 (X ) ∈ {0, 1}. In turn, such four-manifolds are of particular interest since they are the only candidate topologies that probe the Coulomb branch B of the theory.
Recently, interest in DW theory and in particular the u-plane integral was revived due to observations relating the latter for special four-manifolds to the theory of mock theta functions and harmonic Maass forms [8,9]. For more generic, but simply connected, compact four-manifolds it was later reformulated in terms of the modular completion of a mock modular form [10][11][12]. In this series of papers, the possibility to add Q-exact operators to the action without affecting the correlation functions was studied in detail. In particular, a specific new Q-exact operator related to the 2-cycles of the background geometry was added to the action of the low-energy U (1) theory, which makes the connection to mock modular forms apparent and elegant [10,12]. This technique circumvents the cumbersome method of lattice reduction and allows to evaluate correlation functions efficiently. To the best of our knowledge, all of the recent results relating Z u and mock modular forms are restricted to the case where the low-energy U (1) theory is formulated on simply connected four-manifolds.
Taking inspiration from [7], we ask the natural question how these recent results carry over to the case when the four-manifold X has a non-trivial fundamental group and nonzero first Betti number b 1 (X ). When the four-manifold is non-simply connected, the theory is more complicated. This is due to the fact that the manifold now admits more structures, in the form of 1-form fields and 1-and 3-cycles, which are not present in the simply connected case. These cycles give rise to further contact terms in the low-energy U (1) action [5,7]. As a result, we consider more general Q-exact operators related to these cycles. Below, we give a summary of the paper highlighting our results.
Summary of the paper In this paper, we present a natural extension of the recent results [10,12] to the case of non-simply connected four-manifolds with b + 2 = 1. Specifically, we introduce a number of new Q-exact operators in the low-energy effective U (1) theory that allow us to express the integrand of the u-plane integral elegantly as the non-holomorphic completion of a mock modular form. This further allows us to derive a closed-form expression for the u-plane integral for any such four-manifold and for arbitrary period point J , as is evident from the result of this paper, Eq. (52). This solution depends on H 1 (X ), a fact that is easily seen in the case of product ruled surfaces where it manifests as a genus dependence, while when H 1 (X ) is trivial, (52) reduces to Eq. (4.10) of [10]. As a byproduct of our computations, we present a complete classification of all Q-exact operators that the theory admits.
DW theory on product ruled surfaces X = CP 1 × g , with g a genus g Riemann surface, has been argued to be equivalent to a 2d topological A-model on CP 1 in the limit of vanishing volume for g [5,13,14]. In this paper, we present a concrete derivation of this equivalence and in turn show that due to the relation between DW theory and its low-energy U (1) effective theory as given by Eq. (1), a connection between Gromov-Witten (GW) theory (realised physically by the A-model) and mock modular forms (appearing in the low-energy effective action) exists, such that one can compute GW invariants using modular data originating from the 4d theory, thereby deriving results in enumerative geometry from number theory. As an example, we make concrete numerical predictions of the genus zero GW invariants of the moduli space of flat SU (2)-connections on 2 via their relation to an indefinite theta function. The GW invariants studied here involve local and non-local operators which, as far as we know, have not been studied.
Plan of the paper The plan of the paper is as follows. In Sect. 2, we review the effective DW theory and the low-energy SW geometry. We further discuss the new specific Q-exact operators that we add to the action.
In Sect. 3, we rederive the u-plane integral Z u by including the Q-exact operators and show how Z u can be written in terms of a mock modular form.
In Sect. 4, we apply our results to the two possible reductions of the product ruled surfaces X = CP 1 × g and check them towards existing literature [7,15]. The second reduction, where the volume of g shrinks, will be related to the genus zero GW invariants realised by the correlation functions of the A-model on CP 1 .
In Sect. 5, we discuss the A-model on CP 1 , and perform the computations that produce the generating function of GW invariants. Together with the findings of Sect. 4, we make concrete numerical predictions of the genus zero GW invariants of the moduli space of flat SU (2)-connections on 2 via modular data. In Sect. 6, we conclude our paper, where useful appendices follow thereafter.

Effective DW theory
DW theory is the topologically twisted formulation of the pure N = 2 supersymmetric Yang-Mills theory with gauge group G of rank r G = 1 on a smooth four-manifold X [1]. In the IR, the theory becomes a U (1) gauge theory that depends on the complexified effective gauge coupling τ = θ π + 8πi g 2 ∈ H, where H denotes the Poincaré half-plane. DW theory contains a scalar fermionic BRST operator Q := ȦḂ QȦḂ that obeys Q 2 = 0. 1 The field content of the theory is a collection of bosonic and fermionic degree 0, 1 and 2 operator valued differential forms on X , where the degree of the differential form is equal to the ghost number of the physical operator. In Table 1 we summarise the field content of the DW theory. The BRST transformations on these fields are The physical observables of the theory belong to the Q-cohomology. We are interested in computing the path integral of the theory, the u-plane integral or Coulomb branch integral, when evaluated on a non-simply connected four-manifold. To this end, let us first introduce some notation. Let b j := b j (X ) = dim H j (X ) be the Betti numbers of the smooth, closed and oriented four-manifold X with b 2 (X ) = b + 2 (X ) + b − 2 (X ), where the first (second) summand corresponds to the number of positive (negative) eigenvalues of the quadratic form Q of X . For a ∈ H i (X ) and b ∈ H 4−i (X ) we define For a ∈ H 2 (X ) the quadratic form Q of X corresponds to Q(a) := B(a, a). (4) Furthermore, the signature of X is defined as σ (X ) = b + 2 (X ) − b − 2 (X ). Hereafter we consider four-manifolds with b + 2 (X ) = 1. By Poincaré duality, we have that b 0 = b 4 , b 1 = b 3 . We can assume b 1 to be even, since the correlation function of the theory are known to vanish unless 1 − b 1 + b + 2 is even [3]. The Coulomb branch integral is the path integral of the low-energy U (1) theory with the insertion of the observables arising from the descent formalism as well as contact terms and Q-exact operators. It takes the form where = {a,ā, A, η, ψ, χ, D} is the collection of fields of the theory (as in Table 1). Below, Sects. 2.1-2.5 are devoted to reviewing and explaining in detail all the ingredients of the u-plane integral (5). Finally, in Sect. 2.6 we introduce the new Qexact operators I S following [10] as well as its generalisation I (S, Y ) that will allow us to reformulate Z u as an integral over a mock modular form.

Seiberg-Witten geometry
In the seminal papers [2,16], Seiberg and Witten found the exact low-energy solution of N = 2 supersymmetric Yang-Mills with gauge group SU (2). The N = 2 vector multiplet consists of a gauge field A, a scalar φ and Weyl fermions λ and ψ, all in the adjoint representation. The potential of the theory is V (φ) = 1 g 2 Tr[φ, φ † ] 2 and we are interested in the moduli space of flat directions. These are found by setting φ = aσ 3 , with σ 3 the third Pauli matrix and a a complex parameter. However, note that the Weyl group of SU (2) acts on a by a → −a. We can then construct a gauge invariant parameter as This serves as a good coordinate on the moduli space. There are two strong coupling singularities in the gauge theory, located at u = ± 2 , where a monopole and a dyon become massless, respectively [2]. Here, is the dynamical scale of the theory, which is generated by the renormalisation group flow. This will be set equal to one later in the paper. The central charge of a dyonic state with electric and magnetic charges (n e , n m ) is given by where a D is the magnetic dual of a, a D = ∂F ∂a , with F the prepotential of the theory. The quantum moduli space of the gauge theory can be described in terms of a certain family of elliptic curves, the so-called Seiberg-Witten (SW) curves, The complex structure of the curve is identified with the complex coupling τ of the gauge theory. The fields a and a D can be determined from the SW differential λ SW as where A and B are the canonical basis of homology cycles on the elliptic curve. By relating the j-invariant of the SW curve (8) to that of the Weierstraß curve, we can solve for u in terms of Jacobi theta functions, where q = e 2πiτ . See Appendix A for the definitions of the theta functions. Using this formula it is straightforward to show that u is a modular function for the congruence subgroup 0 (4) ⊂ SL(2, Z). The fundamental domain of this group is shown in Fig. 1. The cusp at τ =i∞ corresponds to weak coupling, while the cusps at τ = 0 and τ = 2 correspond to the monopole and dyon singularities, respectively. From the curve (8) we can directly find other quantities that will be important for the analysis in the paper, such as du da or du dτ . See for example [17] for a more detailed discussion on how these quantities can be retrieved from the curve. These expressions and their transformation properties under 0 (4) are collected in Appendix A.2.
The u-plane integral can also be formulated for theories other than pure N = 2 SYM with gauge group SU (2). For pure N = 2 SYM with gauge group SU (N ) and N > 2, integrals over the respective Coulomb branches have been performed in [18]. The modular structure for those theories is, however, much more involved, as was recently elaborated in [19]. More tractable Coulomb branches are rank one theories with matter hypermultiplets, such as N = 2 * (with one adjoint hypermultiplet) and N = 2 supersymmetric QCD (with N f ≤ 4 fundamental hypermultiplets), both with gauge group SU (2) [16]. Rank 1 Argyres-Douglas theories are non-Lagrangian examples of N = 2 theories with 1-dimensional Coulomb branches [20,21]. The partition function has been studied only for the simplest of those, the (A 1 , A 2 ) theory [22]. The extension of such Coulomb branch integrals to manifolds with b 1 (X ) > 0 is interesting because the ghost number selection rule admits the possibility of an infinite number of non-vanishing correlation functions, in sharp contrast to the case b 1 (X ) = 0. The u-plane integral for N = 2 * theory has been formulated in [23] and evaluated in [24], based on the Coulomb branch geometry found in [25]. The modular structure of N = 2 QCD on the other hand has been established much more recently [17]. Integration over those Coulomb branches has yet to be completed [26].

Effective Lagrangian
The low-energy U (1) effective Lagrangian L of the twisted theory is given in [3,(2.15)]. The Q-exact terms as well as the kinetic terms do not contribute since the zero modes are constant in DW theory on a four-manifold X with b + 2 (X ) = 1. For such manifolds there is a useful fact stating that for any β 1 , β 2 , β 3 , β 4 ∈ H 1 (X , Z), we have [27] We will make extensive use of this fact below. Let us define L as the part of the zero-mode low-energy U (1) effective Lagrangian that contributes to the u-plane integral. It is given by [3] where F ± = 4π k ± and for any two-form x we abbreviate B(x, x) = x 2 as defined in Eq. (3). In L , we disregard any summands of L containing Q-exact terms, exact differential forms and ∧-products of four 1-forms. Here and throughout the rest of the paper we use units where the dynamical scale of the low-energy effective U (1) theory is equal to one. The gravitational contributions to L are described in the following section.

Measure factors
Assuming X is connected, the (holomorphic) measure factor [3,28] is Here we used χ(X ) + σ (X ) = 4 − 2b 1 to eliminate the Euler character of X , χ(X ). This expression reduces to Eq. (2.9) in [10] if we take b 1 = 0. For the simply connected theory one can use the microscopic definition of the theory to determine the effective gravitational couplings (e.g. by considering expansions of the Nekrasov partition function) [29,30]. The zero modes of the one-forms ψ live in the tangent space of a b 1 -dimensional which corresponds to isomorphism classes of invertible sheaves (for X a smooth complex variety that is holomorphic line bundles) on X which are topologically trivial. We can expand ψ in zero modes as ψ = b 1 i=1 c i β i with β i an integral basis of harmonic one-forms, and c i Grassmann variables. We then have the measure The photon partition function will also include an integration over b 1 zero modes of the gauge field corresponding to flat connections [7]. These zero modes span the tangent space of T b 1 . As a consequence of this, the photon partition function will have an overall factor of y 1 2 (b 1 −1) [31]. Combining this with the measure factor (14) we see that in the end there will only be a factor of y −1/2 surviving.
We can also consider the c j in the expansion of ψ as a basis of one-forms β # j ∈ H 1 (T b 1 , Z), dual to β j , such that A useful fact about four-manifolds with b + 2 = 1 is that the image of the map is generated by a single rational cohomology class, which we denote as W [27]. 2 This means that we can write β i ∧ β j = a i j W , i, j = 1, . . . , b 1 , where a i j is an anti-symmetric matrix. This further implies that the two-form on T b 1 can be written where Below, we will study four-manifolds of the type X = CP 1 × g with g a genus g Riemann surface. For these manifolds we have that W = [CP 1 ] and vol(T b 1 ) = 1 [7]. Using the analysis above we can now write ψ ∧ ψ = 2(W ⊗ ) [7]. This will be very useful later on when we want to perform the integral over T b 1 for the product ruled surfaces.

Observables
Q-invariant observables can be constructed using the celebrated descent formalism. By starting with the zero-form operator O (0) = 2u, we find all k-form valued observables O (k) for k = 1, 2, 3, 4 that are Q-invariant modulo exact forms by solving the descent equations inductively. This ensures that for a k-cycle (k) ∈ H k (X ) in X , the integrals (k) O (k) are Q-invariant and only depend on (k) . Fortunately, there is a canonical solution to the descent equations: Due to the fact that the translation generator is Q-exact, there is the one-form valued descent operator K , which satisfies d = {Q, K } [3]. This implies that (19) can be solved by , where the iterated (anti)-commutators are implicit. The action of the operator K can be inferred from the BRST transformations (2) as [3] [K , a] = 1 Let us study the insertion of all possible observables. For ease of notation, let us denote p = (0) a point class, γ = (1) a 1-cycle, S = (2) a 2-cycle and Y = (3) a 3-cycle. The cycles γ , S and Y can be expanded in formal sums as where γ i , S i and Y i are a basis of one-, two-and three-cycles, respectively, λ i are complex numbers, while ζ i and θ i are Grassmann variables. By the common abuse of notation, we use the same notation for the 3-, 2-and 1-forms Poincaré dual to the cycles and use the convention The most general Q-invariant observable we can add is then

Contact terms
The existence of the canonical solution to the descent equations allows to map an observable of the UV theory to the low-energy U (1) effective theory on the u-plane. For instance, the operator I (S) = S K 2 u of the UV theory is mapped to the same observ-ableĨ (S) = S K 2 u in the IR. This is not quite true for products I (S 1 )I (S 2 ) · · · I (S n ) of such operators for distinct Riemann surfaces S i ∈ H 2 (X , Z). At the intersection of the surfaces, contact terms will appear [3,5]. When mapping a product of surface operators to the IR, the product is corrected by a sum over the intersection points. Due to the Q-invariance, the inserted operator is holomorphic and the point at which it is inserted is irrelevant.
Such contact terms appear for all cycles in X that can intersect. They have been classified and the corresponding contact terms have been found in [7,Equations (2.8)-(2.12)], Here τ 0 is the deformation parameter of the prepotential, related to the dynamical scale by 4 = e πiτ 0 . The coefficient functions can all be expressed as quasi-modular functions on the u-plane. For instance, the contact term for S ∩ S is In terms of the prepotential F, it is given by [32]. It furthermore satisfies the identities [7] 4πi We can use the action (20) to find The intersection constants can be obtained from duality invariance [7] a 1 = π − Due to the identity (11), the two last terms in (25) vanish and we can disregard them. Thus, from (25) and (28) we see that all terms in I ∩ except for one are only integrated over ψ and τ , which we do in a later step. The remaining term is to be integrated over D, χ and η.

Q-exact operators
As we will later see, the photon path integral combines with the insertion of the surface observable to a Siegel-Narain theta function J μ (τ, z). See (47) for the definition. This function can be expressed as a total derivative to a non-holomorphic modular completion of an indefinite theta function, as has been previously shown in the simply connected case [10,12]. To facilitate the calculation further the authors of those papers add the Q-exact operator I S . 4 In this section we will generalise this operator insertion to simplify the calculations also in the case of non-simply connected manifolds. This then allows us to evaluate correlation functions efficiently using mock modular forms [10][11][12].
Since our computations should be valid for any b 1 ≥ 0 and in particular b 1 = 0, this suggests that it is instructive to add the same Q-exact operator [10,(2.11) and (2.12)] The u-plane integrand (5) with I S inserted can also in the case where b 1 = 0 be written as an anti-holomorphic derivative. However, it does not give the same kind of Siegel-Narain theta function as in the simply connected case. The reason is that the putative elliptic argument z of J μ does not couple to H 2 − (X ) symmetrically to how its conjugatez couples to H 2 + (X ). The insertion of I S in the case b 1 = 0 can be viewed as the unique correction to the path integral that symmetrises the couplings to H 2 ± (X ). Without such an insertion, the resulting theta functions are not symmetric, see for instance [3,Equation (3.18)].
As we demonstrate below, for b 1 = 0 this issue can be cured by introducing additional Q-exact operators. More precisely, the new observables and related contact terms require three new Q-exact terms. The first two compensate the observables (23). From the collection of contact terms (25), only the one from the intersection Y ∩ Y gives a term (30) that is integrated over D, η and χ . This term requires the addition of the Q-exact operator We can note that, according to (29),ā 33 = −a 33 . The sum of these additional Q-exact terms can be compactly written as where we introduced the 2-form This 2-form has the property that yω is holomorphic and thus yω is anti-holomorphic. The form of (32) is derived in Appendix C, where we furthermore show that its onepoint function evaluates to zero, such that it is safe to include it into the path integral, following the analysis in [11,12]. We furthermore find it useful to follow [10] and introduce the notation Anticipating the result as a Siegel-Narain theta function, the elliptic variable will turn out to be z = ρ + 2i yω, which is a 2-form with holomorphic coefficients. In terms of this variable, the sum of all Q-exact insertions (31), (32) and (33) combine nicely as It is clear that this is purely anti-holomorphic. The operator I (S, Y ) is then included into the path integral, as in (5).

The u-plane integral for 1 (X) = 0
The u-plane integral (5) can be expressed as where Pic(X ) denotes a sum over isomorphism classes of line bundles, equivalent to a sum over H 2 (X , Z), followed by an integration over T b 1 . 5 The ψ zero modes are tangent to Pic(X), so the integral over these modes is understood as the integral of a differential form on Pic(X) [3]. At this point let us make a remark. The Q-exact operator I (S, Y ) is not strictly required in order to derive our end result (52). As a matter of fact, as shown in [12] this operator can be added freely as α I (S, Y ), with α any number. 6 However, the case of α = 1 makes the analysis simpler and more elegant, why we choose to include it. Let us perform the integrals above in steps, using an economical notation. We integrate first over the auxiliary field D, and then over the fermionic 0-and 2-forms, η and χ .

Integration over D, Á and
Using (35) and (36), we can expand the terms in the exponential of (38) that are affected by the integrals over D, η and χ as (ignoring the remaining terms for now) At any point we discard terms that vanish identically, such as 4-fermion terms or any instance of (11) such as This can be found by differentiating (39) with respect to D and setting it to zero. Inserting D in (39) gives 7 The third line are the only terms involving η and χ , which we will integrate over next. Before, we can combine those terms in the expression Integrating over η and χ , we can rewrite this in a compact way as a total antiholomorphic derivative times an overall factor that, as we discuss below, cancels with contributions from the rest of the measure, where ∂τ acts on everything to its right and is the normalised self-dual harmonic form on X . This result follows directly from the identities 7 If we integrate over D instead of inserting the equations of motion we get an additional factor of 2πi 2 y in front of the integral [11]. The result of the integration does not change otherwise since both methods agree for Gaußian integrals up to an overall factor of π ai , if we integrate e a D 2 over D. It is the same factor as in the simply connected case because the quadratic D-term is the same. According to [3,p. 68] the D determinant should be ignored because it cancels in any case with the fermionic determinants.
As previously discussed, the photon path integral together with the measure for the zero modes of ψ contains a sum over all fluxes times a factor of 1/ √ y and additionally contributes (−1) B(k,K ) , where K is the canonical class of X [31]. The 1/ √ y factor is thus absorbed by the √ y on the rhs of (43).
Using the change of variables provided by (10), we can further integrate over dτ ∧ dτ rather than over da ∧ dā. This motivates the definition of the transformed measurẽ such that da ∧ dā ν = dτ ∧ dτ dā dτν . The factor dā dτ cancels with the dτ dā of (43).

Siegel-Narain theta function
Let us demonstrate that the u-plane integrand for π 1 (X ) = 0, as in the simply connected case [10], evaluates to a Siegel-Narain theta function. To this end, let us define with q = e 2πiτ and β = Imz y ∈ L ⊗ R, where L = H 2 (X , Z). For the elliptic variable z = ρ + 2i yω, we have β = b + ω +ω (here, we use that yω is holomorphic). Both variables appear naturally in (41) and (43). In fact, we can combine everything to find Here, and are the (holomorphic) remainders of the collections of 0, . . . , 3-form observables and their contact terms that has not yet been integrated over, and we eliminated all terms that do not contribute. Let us check that (48) is indeed true from the computations in Sect. 3.1. Aside from the ψ ∧ ψ term, the exponential of the first two lines in (41) immediately combine into the definition (47) with said parameters, z = ρ + 2i yω andz =ρ − 2i yω. Everything not exponentiated is given by theτ derivative term in (43), which precisely gives the derivative term in (47). This proves (48).
The expression (48) generalises the result of the u-plane integral [12,(4.32)] to four-manifolds X with b 1 (X ) > 0 by giving a decomposition of the integrand into a holomorphic and metric-independent measureν e I O +I ∩ and a metric-dependent, nonholomorphic component J μ (τ, z). Therefore, the evaluation techniques of [12] apply. Namely, we can express the integrand of the u-plane integral as an anti-holomorphic derivative, The holomorphic exponential e I O +I ∩ does not affect the anti-holomorphic derivative, and thus, the extension to π 1 (X ) = 0 is simply through the elliptic argument z = ρ + 2i yω.
Once H J μ (τ,τ ) is found, we can use coset representatives of SL(2, Z)/ 0 (4) to map the six images of F = SL(2, Z)\H back to F (see Fig. 1). The regularisation and renormalisation of such integrals originating from insertions of Q-exact operators has been rigorously established in [11], and we review it in Appendix B. This then allows to evaluate the partition function as where by | q 0 we denote the q 0 coefficient of the resulting Fourier expansion, and the τ -integrand of (48) is given by 8 The prefactors in (52) can be recognised as the widths of the cuspsi∞, 0 and 1 of the modular curve 0 (4)\H.
To derive a suitable anti-derivative H J μ (τ,τ ), it is auxiliary to choose a convenient period point J . The u-plane integral for a different choice J is then related to the one for J by a wall-crossing formula, given explicitly in [7]. It is shown in [12] that for convenient choices of J , J μ (τ, z) factors into holomorphic and anti-holomorphic terms, and the anti-derivative H J μ can be found for both L even and odd. Furthermore, the u-plane integral can be evaluated using mock modular forms for point observables p ∈ H 0 (X ) and Appell-Lerch sums for surface observables z ∈ H 2 (X ) [12].
In [11] it is furthermore shown that in the above mentioned renormalisation, any Q-exact operator (such as I (S, Y )) decouples in DW theory. However, it is clear that the insertion of I (S, Y ) crucially changes the integrand, making the Siegel-Narain theta function symmetric. Instead of inserting I (S, Y ), we can contemplate adding α I (S, Y ) for an arbitrary constant α. It was noticed in [12] that the Siegel-Narain theta function J µ,α for b 1 = 0 with the insertion α I S remains finite at weak coupling (Imτ → ∞) if and only if α = 1. This can be seen from the exponential prefactor in (47), whose exponent is negative definite if and only ifz (which we suppress in the notation) is the complex conjugate of z.

Single-valuedness of the integrand
An essential requirement, for the consistency of the theory, is that the path integral (48) is single-valued. For this it is advantageous to first change variables in the ψ-integral as This is because the coefficient function of ψ ∧ψ in yω is modular, while the ψ ∧Y and Y ∧ Y coefficients of yω are only quasi-modular. Such shifts (54) leave the measure of [dψ] invariant, as dψ = dψ . Due to the order of integration in (48), the change of variables (54) is well-defined. Since Y is also Grassmann-odd, ψ and Y ∧-commute. Using (29) and (27), this gives Let us use the notation of Appendix A.2. It is argued in [7] that ψ transforms as (−1, 1) (1,0) . Using (112), one then finds that yω = (−1, 1) (−1,0) transforms precisely is a modular form and transforms exactly as in the π 1 (X ) = 0 case. Furthermore, it is auxiliary to define [7,(2.14)] It is well-defined, as S = (1, 1) (0,0) is fully invariant. In contrast to (54), this is not a change of variables or a redefinition, but rather a substitution to simplify some expressions. For instance, the elliptic variable now reads which takes the same form (36) as in the simply connected case.
By incorporating the shift of ψ → ψ together with (56), we find that the contact terms and observables in (49) and (50) can be written as All terms but S 2 T are modular functions with trivial multipliers. Due to (57), the quasi-modular shift of T combines precisely with the one of (τ, z).

Measure factor
Since ∝ We find that under the generators of 0 (4), . For this we have used that σ + b 2 = 2 and that b 1 is even.
We also need to consider the fermion measure. As we have discussed earlier, this comes with an overall factor of y − b 1 2 which gets absorbed by a similar factor coming from the photon partition function. This leaves us with b 1 i=1 dc i , which has weight (−b 1 , 0), since ψ has weight (1, 0) [31]. So after the integration over D, η and χ , and after changing integration variables from da ∧ dā to dτ ∧ dτ , the measure of the integral will have weight (−2 − b 1 , −2), and we thus need the rest of the integrand to have weight (2 + b 1 , 2). Finally, the transformations of the Siegel-Narain theta function J μ (τ, z) can be found in Appendix A.3. The integrand of the u-plane integral (48) reads Since it is integrated over the fundamental domain of 0 (4), in order to check whether the integral is well-defined J J μ must transform as a modular function for 0 (4) with no phases. In Table 2 we collect the phases and weights of the individual factors as discussed above. This shows that the integral is indeed well-defined.

Computation for product ruled surfaces
As an interesting application of our results we can study the u-plane integral for a four-manifold of the type X = CP 1 × g , where g is a genus g Riemann surface.
This is a product ruled surface with b + 2 (X ) = 1 (see Appendix D.1). 9 The DW theory for these manifolds was worked out in [7,15] and we can use these results as a check of our formula. By shrinking the size of the Riemann surface g we get a topological σmodel, more specifically the topological A-model, on CP 1 [13]. By calculating certain correlation functions on both sides, we will be able to make an indirect connection between mock modular forms and the topological σ -model on CP 1 in Sect. 5.
The product ruled surfaces that we consider have b 1 = 2g, b 2 = 2, b + 2 = 1, K X = 0, which in turn means that σ = 0 and χ = 4(1 − g) [7]. We consider a general period point where [CP 1 ] and [ g ] are the cohomology classes that generate H 2 (X , Z) [7]. 10 For these manifolds we further have that the rational cohomology class W, discussed in Sect. 2.3, is simply given by W = [CP 1 ] [27]. The intersection matrix is The scalar curvature for this metric is 8π(e θ − e −θ (g − 1)). We see that this is positive for e 2θ > g − 1, such that we do not get any contributions from the Seiberg-Witten 9 One could alternatively consider products g × h of Riemann surfaces; however, those have b + 2 = 1 if and only if either g = 0 or h = 0, such that for g, h ≥ 1 the u-plane integral vanishes. 10 Sometimes we will be sloppy and write simply CP 1 and g for these classes and hope that this does not confuse the reader. invariants in these chambers. In particular, this is true when the volume of CP 1 is small, since this has θ large and positive.
The connection to the topological σ -model is made in the chamber where we shrink the volume of g [13]. For completeness, we will calculate the u-plane integral in both chambers, where either of the factors shrink. The calculations are similar in both cases and we will start with the chamber where the volume of CP 1 is small.
From Eq. (13) we find that the measure factor for these manifolds simplifies tõ For these manifolds we also have that the J μ of (48) can be written as a total derivative of the indefinite theta function [34] J J where k 2 = k 2 + + k 2 − , J is a reference vector 11 lying in the negative cone such that Q(J ) < 0, and is a reparametrisation of the error function. See also Appendix A.4 for more details on these indefinite theta functions. This means that we can take as H J μ (τ,τ ) in (53) For the evaluation of the u-plane integral using this H J μ , one may replace J J μ in (68) after the modular transformations as in (52) with the mock modular form J J μ defined in Appendix A.4. This is also in line with the approach in [10].

Shrinking CP 1
Let us start by analysing the chamber where the volume of CP 1 is small. In this chamber we fix the primitive null vector to be J = [CP 1 ] = W . Due to (62), with this choice we have that B(ψ ∧ ψ, J ) = 0, and in particular B(S , J ) = B(S, W ). As above, we denote z = ρ + 2i yω and β = b + ω +ω. We can introduce the split k = m + nW , with m chosen such that With this split the mock modular form J J μ coming from (68) can be written as where, in the second equality, we performed the sum over n. This is an Appell-Lerch sum [34].
We note that these are independent of ψ. The u-plane integral in this chamber can now be written as with J W μ as above. If we only include point and surface observables it is straightforward to do the integral over the torus. The final result is where we also defined S = s[ g ] + t[CP 1 ]. 12

Shrinking 6 g
We now go on to discuss the chamber where we instead shrink the volume of g . For this chamber we pick the primitive null vector to be J = [ g ]. The procedure is similar to the above. However, note that now B(ψ ∧ ψ, J ) = 0. We start as before by splitting k = m + n g with m chosen such that Let us start by looking at the contribution from infinity. After performing the sum over n we find that the indefinite theta function becomes This is again an Appell-Lerch sum [34]. Following [15] we now pick ω 2 (E) = [CP 1 ] + [ g ], with = 0, 1. For this flux there is no contribution from infinity, as can be seen from the above by realising that there are now no solutions to the conditions on m. We therefore turn to the other cusps. For the monopole cusp at τ = 0 we can use the formulas in the appendix to define the dual indefinite theta function as where we used that K X = 0 and b 2 (X ) = 2 together with the transformation formulas of the appendix. Following the procedure from above, splitting and summing over n, and simplifying by only including point and surface observables, we eventually find that Here we have used that B(μ, g ) = 1 2 and that ψ ∧ ψ = 2W ⊗ together with the explicit expressions for ω when only including points and surfaces as observables. We also continue to denote dual functions with a subscript D. The explicit expressions for these are given in the appendix, Eq. (115).
Next, we want to integrate over the torus. If we only write down the parts that are actually dependent on ψ, or equivalently , the integral over the torus is A neat trick we can use is to realise that where Li n (y) is the polylogarithm [15]. Using this and again splitting S = s[ g ] + t[CP 1 ] we find that the integral over the torus evaluates to where we dropped the first term coming from (79) since this does not contribute to the u-plane integral (it will give a term whose q-series starts with a positive exponent).
Combining this with the other terms in the u-plane integral, we find that the contribution from the cusp at τ = 0 is given by The contribution from the other cusp is easily calculated using the same procedure. The result is The full u-plane integral in this chamber is then the sum of these two terms. 13

Genus one
For g = 1 the Seiberg-Witten contributions vanish and the only contributions comes from the u-plane integral [15]. The above expressions can be simplified to where we introduced f D = du da D to keep the expressions shorter. We can make various expansions for this. For example, if s = t = 0 we get For p = 0 we instead find (expanding in small t) , 13 These expressions again differ from that of the older literature [15] by an overall phase (−1) −i g .

Genus two
For g = 2 we find where by a D we actually mean˚ı π , by use of the relation (114) [35]. For s = t = 0 we simply get zero, but for p = 0 we get For g = 2 there will also be the Seiberg The first few terms in the expansion for small s and t, and p = 0, are and

Revisiting the A-model computations
The previous discussion is focused on the low-energy U (1) effective action of DW theory on a generic oriented and non-simply connected four-manifold X , i.e. the u-plane formalism. There were indications that for X a product ruled surface, the correlation functions calculated in the previous section are related to Gromov-Witten invariants [13][14][15][36][37][38], that correspond to correlation functions of an N = (2, 2) topological A-model in two dimensions, at the limit where the volume of one of the factors of X vanishes. The aim of this section is to obtain Gromov-Witten invariants, i.e., values of correlation functions of an N = (2, 2) topological A-model in two dimensions, by direct comparison with results obtained from the previous section. There, an explicit calculation was carried out in the case of a product four-manifold, X = CP 1 × g with g = 2, where both the u-plane and Seiberg-Witten terms contribute, shown in (87), (89) and (90). These expressions are the ones we shall use to obtain Gromov-Witten invariants.
Using the fact that the twisted N = 2 gauge theory is topological, we are free to shrink g . We thus obtain an effective 2d theory on CP 1 : the N = (2, 2) topological A-model on worldsheet CP 1 , with the target space being the moduli space M flat ( g ) of flat SU (2) connections on g . As a consequence, flat SU (2) connections along the directions tangent to g are required to prevent the effective 2d action from blowing up when the limit of small g is taken. This result is rederived in Appendix E, following [13].
There is, however, a subtle point about the relation of the 2d A-model to both 4d theories, in that the relation should hold only within the limit of g → 0. More will be said about this further on. Nevertheless, what we can achieve with this relation are predictions for Gromov-Witten invariants via coefficients from the expansion of a 4d low-energy U (1) effective theory. This also offers an alternative approach in the calculation of Gromov-Witten invariants from 4d theories via physical principles, as illustrated in Fig. 2.
We will now proceed to obtain Gromov-Witten invariants in a similar fashion to the steps in the previous sections in obtaining the u-plane integral. The N = (2, 2) topologically twisted A-model has the action with z,z as worldsheet coordinates and i,ī etc, are coordinates on M flat ( g ) for the map ϕ : CP 1 → M flat ( g ). In Eq. (91), e denotes the gauge coupling and θ the instanton theta angle. The last term is a pullback of a Kähler form ω that directly descends from the instanton term of F ∧ F in 4d. The bosonic field is the worldsheet scalar ϕ, and fermionic fields are the scalar χ and 1-form ρ. The covariant derivative on the worldsheet is defined as ∇ z χ¯i = ∂ z χ¯i + χ¯j ījk ∂ z ϕk and R ijkl is the Riemann curvature tensor on M flat ( g ). The BPS condition of the A-model localises (91) to a moduli space of holomorphic maps with the condition coming directly from that of the 4d theory, namely F + = 0. Here, β is the homology class of the map ϕ into the moduli space of flat connections on g : The class β can be further indexed as β I according to the dimension of each stratum of M flat that is where I = dim(M flat ).
Since we wish to obtain the Gromov-Witten invariants by comparison with coefficients from (87), (89) and (90) as obtained via calculations in the u-plane from the previous sections, only the dimensionally reduced version of the 4d surface operators on g × CP 1 as S = s[ g ] + t[CP 1 ] will be considered in this section. Note that surface operator insertions on g are non-local operators in 4d (on g ), but get reduced to local point operators in 2d on CP 1 as g → 0.
The surface operator inserted is Tr s (ψ μ ψ ν + φ F μν )dx μ ∧ dx ν . When inserted on S ∈ g , it becomes a point operator on CP 1 , as mentioned: Here F ww = 0 was used, where w,w are complex coordinates on g , and ω i j is the Kähler form (see Appendix E). Note that O (0) is consistent with the features required for being a point operator on the worldsheet, since it does not contain worldsheet indices. The presence of worldsheet indices requires a contraction with the worldsheet metric g zz , thereby making the operator Q-exact. Hence, this operator is indeed Qclosed. The ghost number of O (0) is two, reflecting the fact that it is a 2-form on M maps .
On the other hand, when inserted into S ∈ CP 1 , it remains as a surface operator: Here the ψ z , ψz drop out since they do not survive the reduction, while F zz contains the components of the gauge field A z , Az on CP 1 which are auxiliary fields (see Eq. (187)). The fermionic parts of A z , Az do not contribute since there are no ρ zero modes, to be explained below). Using , F zz can then be written in terms of ϕ i , ϕ¯i . Next, we have to look at which fermionic zero modes exist in the 2d theory after dimensional reduction. The self-dual 2-form fermions χ μν descend down to ρ iz , ρ¯i z , which are one-forms over CP 1 . This dimensional reduction is coming from the high energy theory, in which the gauge group SU (2) is still left unbroken. Connections in this regime then remain irreducible and regular [1], and hence, we should not expect ρ zero modes. The only other fermionic zero modes are from the χ fields from the vertex operators, which can be absorbed by the measure of the fermionic zero modes in the path integral. The path integral that generates the GW invariants takes the form where represents all fields we integrate over and we also perform a discrete sum over β. This is equivalent to summing over the 4d instanton numbers k.
In the evaluation of Eq. (97), all fields will have both zero and fluctuating modes. However, due to the independence of (97) on the coupling, we are free to take the weak coupling limit. The functional integral over the fluctuating modes in the action then equals ±1 and zero modes for both bosons and fermions are annihilated in the kinetic terms in the action when we take the quadratic approximation. With this approximation, fluctuating modes in the operators O (0) and O (2) can be suppressed, and we are then left with fields in terms of zero modes only. These shall henceforth be labelled as O (0) and O (2) as well. It is necessary to have fields only in terms of zero modes since both bosonic and fermionic zero modes correspond to tangent vectors in M maps .
The resulting fields should then correspond to differential forms in this moduli space which, when combined together to obtain the correct index for the absorption of fermionic zero modes give us a top form on M maps to be integrated over. In particular, recall that the ghost numbers of O (0) and O (2) are two, reflecting their degree as differential forms in M maps . To achieve that, we expand the vertex operators in powers of O (i) from the vertex to soak up the extra zero modes of χ i and χ¯i in the measure. We then obtain correlation functions, for each β, that localises on M maps . Only the terms which allow for the correct absorption of fermionic zero modes give a nonzero contribution to Eq. (97). In the end, we obtain the usual Gromov-Witten invariants associated with a 2d topological A-model. From the relation in dotted lines in Fig. 2, we are able to conclude, in the limit of small g : On both sides of Eq. (98), we have generating functions which contain terms that are graded by the instanton numbers. This is because the instanton term in the 4d action also descends down to a corresponding term in the 2d effective action. One can thus identify terms on both sides of (98) and we can then see that modular forms appearing in the u-plane integral can play an indirect (computation facilitating) role in Gromov-Witten invariants for holomorphic maps to the moduli space of flat connections on a Riemann surface.
With regard to wall-crossing, despite the condition of b + 2 = 1, where wall-crossing phenomena are expected in Z u + Z SW , we should not expect to see wall-crossing behaviour for Z GW . This is due to the fact that in shrinking g , we are restricting ourselves to the chamber of small g and we should not expect any walls within a chamber, by definition. Hence the relation (98) should only be understood to hold within this particular chamber.
We can make a further comparison of (98) in another way: looking at how the operators O (0) and O (2) in 2d were derived, we see that they come from dimensional reduction of the operators in the four-dimensional high-energy theory. As mentioned, we consider only surface operators on g ×CP 1 as S = s[ g ]+t[CP 1 ]. The Gromov-Witten generating functional Eq. (97) with only (4d) surface operators inserted will then be where S = S 0 + B(ω, β) and B(ω, β) as the instanton contribution to the action. Expanding the generating function (99), we can then compare Gromov-Witten invariants with Z u + Z SW for different powers of s and t. In the genus two case 14  In the s 3 term, we have We can also look at the less commonly studied non-local surface operators. Collecting the s 3 t 2 terms, we require terms from (99) to have a total of index 10: In (100) and (101), β 6 and β 10 are the homology classes for terms of index 6 and 10, respectively. We can identify β I with d, the degree of the map. From [36,37,39], the given formula for the index I = dim(M maps ) and degree d ≥ 0 of ϕ : CP 1 → M maps ( 2 ) is I = 6 + 4d. This formula relates dim(M maps ) to the instanton number (degree of the map). The example in (101) then corresponds to an invariant Hence, for an index 14 term, we can have of (H 0 for M maps of a degree 3 map. At first glance, the existence of a negative sign in (102) might be a surprise, since these numbers actually represent values of correlation functions between operators, i.e. scattering amplitudes. The Amodel considered, however, is non-unitary [40], implying the existence of negative norm states.
As a consistency check, we can see that the lowest dimension of M maps is 6, which agrees with (87), (89) and (90) since the lowest combined power of s and t is cubic, which have an index of I = 6. This is because terms with I < 6 (equivalently, maps of negative degree d < 0) vanish. In fact, a quick examination of the combined powers of s and t of various terms in (87), (89) and (90) show that the index of all terms obey the formula. This thus provides further evidence of having a direct correspondence between values obtained via computations in the 4d low-energy regime from previous sections and that of the 2d A-model.

Conclusions
In this paper, we studied the low-energy U (1) path integral of DW theory evaluated on non-simply connected four-manifolds. Following the analysis of [10,11], we derived the full solution for the correlation functions of the theory in terms of the modular completion of a mock modular form. The result can be readily extended to the case with surface defects [41] or theories with matter hypermultiplets [3,5,16,17,24,26,42,43] and even class S theories [44,45], although we leave this for future work.
We also presented a concrete reduction of the theory on CP 1 × g over g , whence we obtained a topological A-model on CP 1 , thereby demonstrating a novel connection between mock modular forms and genus zero Gromov-Witten invariants.
We can also consider four-manifolds of the form X = M 3 × M 1 with suitable topological numbers that allow probing the Coulomb branch. We expect that the mock modular form reformulation of Z u can be applied in this case too, whence relations between mock modular forms and topological invariants of 3-manifolds M 3 can be precisely formulated, thereby allowing us to derive results in geometric topology from number theory. We will leave this for future work as well.
Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article's Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article's Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creativecommons.org/licenses/by/4.0/.

A Automorphic forms
In this appendix, we collect some important aspects of modular and automorphic forms.

A.1 Modular forms
The Jacobi theta functions ϑ j : H → C, j = 2, 3, 4, are defined as with q = e 2πiτ . They transform under SL(2, Z) in the following way: Under the generators T 4 , ST −1 S of 0 (4), they transform as The Eisenstein series E k : H → C for even k ≥ 2 are defined as the q-series with σ k (n) = d|n d k the divisor sum. For k ≥ 4, E k is a modular form of SL(2, Z) of weight k. On the other hand E 2 is a quasi-modular form, which means that the SL(2, Z) transformation of E 2 includes a shift in addition to the weight, (108)

A.2 Ingredients of the u-plane integrand
In this section, we give explicit modular expressions for the ingredients of the u-plane integrand. The integrand transforms under the duality group 0 (4), which is generated by T 4 and S −1 T −1 S. Let us introduce the shorthand f = (φ 1 , φ 2 ) (k,l) if a function f is a non-holomorphic modular form of weight (k, l) for 0 (4) with multipliers, i.e. transforms as It is clear that since |φ i | = 1. The functions transform as The derivative d 2 u da 2 is invariant under T 4 but quasi-modular, We also have that [35,46] a =i π We will also need what we call the dual expressions for the above quantities. These are the expressions for the dual variable τ D = −1/τ , disregarding the modular weights. They are as well as

A.3 Siegel-Narain theta function
Siegel-Narain theta functions form a large class of theta functions of which the Jacobi theta functions are a special case (see [10]) . We restrict here to a specific Siegel-Narain theta function for which the associated lattice L is a uni-modular lattice of signature (1, n − 1) (or a Lorentzian lattice). We denote the bilinear form by B(x, y) and the quadratic form B(x, x) ≡ Q(x) ≡ x 2 . Let K be a characteristic vector of L, such that Q(k) + B(k, K ) ∈ 2Z for each k ∈ L.
Given an element J ∈ L ⊗ R with Q(J ) > 0, we may decompose the space L ⊗ R in a positive definite subspace L + spanned by J , and a negative definite subspace L − , orthogonal to L + . Let J = J / √ Q(J ) be the normalisation of J . The projections of a vector k ∈ L to L + and L − are then given by Given this notation, we can introduce the Siegel-Narain theta function of our interest J μ : H × C → C. Let J be as discussed above (117) and μ ∈ L ⊗ R. Then J μ is defined by 15 where b = Im(z)/y ∈ L ⊗ R.
One finds for the modular transformations of J μ under the generators of SL(2, Z) the following identities For μ ∈ L/2 one can show that J μ is a modular form of the congruence subgroup 0 (4). The action of the generators of 0 (4) on J μ with μ ∈ L/2 is given by Notice that for = 4 we can use that 2μ 2 + B(μ, K ) ∈ Z.

A.4 Indefinite theta functions
In this appendix we present various aspects of indefinite theta functions and their modular completions. We assume that the associated lattice L is unimodular and of signature (1, n − 1). To define the indefinite theta function, we choose two positive definite vectors J and J ∈ L ⊗ R with B(J , J ) > 0, such that they both lie in the same positive cone of L. Let J and J be their normalisations as before. The arguments of theta function are τ ∈ H, z ∈ L ⊗ C and μ ∈ L ⊗ R. We let b = Im(z)/y ∈ L ⊗ R. In terms of this data, the indefinite theta function J J μ is defined as It is possible to show that the sum over L is convergent [34]. However, J J μ does only transform as a modular form after the addition of certain non-holomorphic terms. References [34,47] explain that the modular completion J J μ of J J μ is obtained by substituting (rescaled) error functions for the sgn-functions in (123). The completion J J μ then transforms as a modular form of weight n/2 and is explicitly given by where E is a reparametrisation of the error function (67). Note that in the limit y → ∞, E in (124) approaches the original sgn-function of (123), lim y→∞ E 2y u = sgn(u).
If we analytically continue E to a function with complex argument, then this limit is only convergent for − π 4 < Arg(u) < π 4 . The transformation properties under SL(2, Z) follow from chapter 2 of Zwegers' thesis [34] or Vignéras [48]. One finds for the action of the generators on J J μ+K /2 (τ, z) For our application, theτ -derivative of J J μ is of particular interest. This gives the "shadow" of J J μ , whose modular properties are easier to determine than those of J J μ . We obtain here with J μ defined in (118). The modular properties of J μ are given in (119) and can be obtained using standard Poisson resummation.
The completion (124) may simplify if the lattice L contains vectors k 0 ∈ L with norm k 2 0 = 0. For such lattices J and/or J can be chosen to equal such a vector, and careful analysis of the limit shows that the error function reduces to the original sgn-function [34]. We assume now that J ∈ L such that (J ) 2 = 0. To ensure convergence of the sum, one needs to require furthermore that B(k + b, J ) = 0 for any k ∈ L + K /2 + μ, except if one also has B(k + b, J ) = 0. Then the completion J J μ is given by with shadow

B Regularising the u-plane integral
The u-plane integrand can diverge at the cusps. We therefore need to be careful about regularising the integral. This procedure was worked out in detail in [11] for the simply connected case, but the analysis goes through without alteration when allowing for π 1 (X ) = 0. For completeness, we summarise the important steps and refer the reader to [11] for more details.
We are interested in evaluating integrals on the form (52) or (161). To make the analysis simpler, we map these integrals over the fundamental domain H/ 0 (4) to integrals over the ordinary key-hole domain F of SL(2, Z) by mapping the six copies of F in H/ 0 (4) back to F (see Fig. 1). This means that the integrals now take the form where f (τ,τ ) is a non-holomorphic modular form for SL(2, Z) of weight (2−s, 2−s), and it corresponds to the sum of the six transformations of the corresponding integrands by the elements of SL(2, Z)/ 0 (4). It has a Fourier expansion with c(m, n) only nonzero for m − n ∈ Z. These coefficients are bounded for some constant K > 0 and the sum over m and n is therefore absolute convergent for y < ∞. The integral does, however, diverge when m + n ≤ 0. Which is the domain of our integrals when considering addition of the Q-exact operators. To deal with this we start by compactifying F to a domain F Y by introducing a cut-off Y ≥ y for τ →i∞ and some Y 1 and defining the integral We can now regularise our integrals by using the generalised exponential integral E l (z), defined by where for non-integral l, the branch of t −l is fixed by restricting the argument of any complex number ρ ∈ C * to lie in the domain (−π, π]. The regularised integral is Now, to evaluate the integrals we can make use of Stokes theorem. Since in our case we have ∂τĥ = y −s f for someĥ a modular form of weight 2 and f as in the above. This can be integrated using E l (z) to givê for s = 1 and when s = 1 we need to change the terms with n = 0 in the sum to Here, h is a (weakly) holomorphic function with Fourier expansion and h(τ ) is uniquely determined by the coefficients d(m) with m < 0. We can now use Stokes theorem and the integral over F Y becomes and regularising this as in (134) we find that the only contribution of the regularised integral is the constant term of h(τ ), In Appendix C.3 we demonstrate that the correlation function of the Q-exact operator I (S, Y ) that we add can be written as where We then have that which in the above prescription allow us to identify F I with someĥ 1 +ĥ 2 , where bothĥ 1 andĥ 2 are of the form (135) but with s replaced by s + 1 in the later case. But, since F I is a modular form of weight 2 the sum h 1 + h 2 should vanish, as there is no such holomorphic modular form, and in particular the sum of the constant terms d 1 (0) + d 2 (0) = 0, which in term shows us that I (S, Y ) = 0. We can thus safely add this operator to the action.

C Construction of I(S, Y)
In this appendix, we explain the construction of the Q-exact operator I (S, Y ) in (37), which aids the evaluation of the u-plane integral using mock modular forms. A constructive approach is to classify all Q-exact operators in DW theory, add all of them to the path integral, evaluate the path integral and solve for all coefficient functions that lead to the desired properties. For two reasons, this is fortunately not necessary. First, it is convenient that most such operators do not even alter the u-plane integrand after integrating out the fermions and the auxiliary field. Second, the path integral can be performed without insertions of any additional operators, or with the insertion of just I S as was done in the case that b 1 (X ) = 0 [10]. Such calculations lead to integrands that do not contain the Siegel-Narain theta function J μ (τ, z) for any z; however, only a few terms are missing with an educated guess of z. Only very specific Q-exact operators can provide the necessary terms for the new integrands to complete into J μ (τ, z). In Sect. C.1, we classify all possible Q-exact operators that contribute to the uplane integrand. In Sect. C.2 we demonstrate how the correct Q-exact operators can be selected, for the simplified example where the intersection Y ∩ Y is empty (such that there is no intersection term for Y ∩ Y ). In Sect. C.3 we finally show that the Q-exact operators we add do not alter the u-plane integral.

C.1 Q-exact observables
Let us complete the result of [11] by computing the all Q-exact observables on a four-manifold X with π 1 (X ) = 0. Let us first collect These are all 1 . . . 4-forms that can be constructed out of the field content in Table 1. Since any operator must be gauge invariant, we do not use the 1-form A to construct operators but only F = d A. Furthermore, some operators are identically zero due to fermion saturation. The sets C k are then generating sets for the spaces of k-form observables [11], Here, f X , j (a,ā) are real-analytic functions without singularities away from strong and weak coupling. The most generic 0-form observable Let us restrict now to the Q-exact k-observables [Q, O k } that survive integration. These do in particular either contain ηχ or neither, since otherwise they would not survive the fermionic integration, and they do not contain any derivative term d X , as we consider b + 2 (X ) = 1 and thus their zero modes vanish.
The general Q-exact observable [Q, O k } from (143) is very tedious to compute, luckily in [Q, O k } generally not many terms survive. Furthermore, (143) has 2|C k | terms; however, due to (2) and (144) These are all Q-exact operators in DW theory. The following Q-exact terms can then be added to the action

C.2 Solution for I Y
By adding only I S as suggested in [10,11,41], the u-plane integrand can be written as a total derivative; however, it does not complete to a Siegel-Narain theta function. Let us construct the operator I Y such that this becomes true. For simplicity, we ignore the contact terms I ∩ . This is possible since all contact terms other than the Y ∩ Y are integrated over ψ and τ only and therefore do not affect the path integral calculation. For simplicity and only in this section, we take the intersection Y ∩ Y to be empty. We therefore aim to find the functions f 1 , . . . f 5 . In the case π 1 (X ) = 0, the total integrand must go back to (38). If f 4 and f 5 are nonzero, this is not the case since they alter the integral. 16 We therefore set f 4 = f 5 = 0. Thus, in the simply connected case, we have I 2 = I S , which implies f 1 = − 1 4π dū dā . We shall therefore consider adding the correction to the exponential in (38). The terms ψ ∧ Y and ψ ∧ ψ are precisely the terms that lead to the problems if only I S is added. We can organise h : Inserting it into the path integral we find After integrating out D, this produces new terms to (41) (notice that ω ∧ h = h ∧ h = 0). The first term is only integrated over ψ and τ , so it will not play a role immediately. The second and third terms yield after the fermionic integration, In view of (43) and the above discussion, we can aim this new contribution to give the missing factor such that the Siegel-Narain theta function has an elliptic variable z = ρ + 2i yω and β = b + ω +ω. 17 Motivated by the computation (44), we make the ansatz h =icyω, with c ∈ C some number. From this it follows that y∂τω = −˚ı c ∂τ h −˚ı 2ω . Notice that h is purely anti-holomorphic, whileω is not. We find that (153) equals (154) precisely for c = 1. From this, it is easy to find In the simply connected case, the correction I 2 = I S is necessary in order for the surface observableĨ − (S) to combine into a Siegel-Narain function such that the uplane integral is a total derivative. In the case π 1 (X ) = 0, an analogous procedure is required for the 3-cycle Y , which combines to a 2-form as ψ ∧ Y . In the π 1 (X ) = 0 Lagrangian (12) there is a new term ψ ∧ ψ that is integrated over η, χ and D, such that the u-plane integral is a total derivative but does not contain a SN theta function. After the insertion of an anti-holomorphic Q-exact 4-form operator, the integrand indeed becomes a Siegel-Narain theta function. 17 Another possibility would be to choose h to be holomorphic and cancelling the ω inside the derivative. This is possible, however, the ω dependence does not drop from the SN theta function.

C.3 Ward-Takahashi identity for I Y
In [11] it was shown that the vacuum expectation value of any Q-exact operators vanish in the simply connected case. This then allows one to safely add such operators to the u-plane integral. In this appendix we only consider the operator insertion I Y , the analyses is similar for the other factors in I (S, Y ). To this end, we will demonstrate that I Y can be written as an integral where the integrand can be written as a total derivative. We can then use the renormalisation procedure of [11], as discussed in Sect. B, to show that I Y = 0, such that the insertion of this operator does not change the u-plane integral.
To see that the one-point function can be written as a total derivative we start from with L as in (12) and ν(τ ) as in (13). The integration over D yields where now Next, we integrate over η and χ . This yields where by k 2 + and ψ 4 we mean B(k + , k + ) and B(ψ ∧ ψ, ψ ∧ ψ) and we now have and its now straightforward to recognise that we indeed can write the integrand as a total derivative We can now use the renormalisation procedure of [11] to show that I Y in fact vanishes. The broad strokes are summarised in Sect. B, and further details can be found in [11,Sec. 5].

D Classical topological invariants
Let X and Y be topological spaces, and consider the homology over a field K. The Künneth theorem states that there exists an isomorphism Written in terms of Poincaré polynomials p X (z) := ∞ k=0 b k (X )z k , that is, generating functions of Betti numbers b k (X ) := rank H k (X ), we have The Betti numbers are then related as Example. Note that p X (−1) = χ(X ) gives the Euler characteristic of X .
Example. The circle S 1 has Betti numbers b 0 (S 1 ) = b 1 (S 1 ) = 1 and all other zero. We therefore have p S 1 (z) = 1 + z (more generally, p S n (z) = 1 + z n ). For the torus T n := (S 1 ) ×n , it follows from (163) that that is, b k (T n ) = n k .

D.2 Gromov-Witten invariants as A-model correlation functions
For a smooth projective variety X , GW invariants essentially count, in a refined way, algebraic curves with certain incidence conditions. Physically, GW invariants are given in terms of specific correlation functions in the topological A-model and count specific holomorphic curves. This construction is well known [39] but we will provide a small review in this section.
The action of the A-model is written explicitly in (91) for our case of interest in the main body of the paper. For the purposes of this subsection, we can recast it as with V = g ij (ρ¯i z ∂zϕ j + ∂ z ϕ¯i ρ j z ) and ϕ : → X where is the worldsheet and X is the target space. The second summand corresponds to the pullback of the Kähler form of X and it only depends on the cohomology class of ω as well as the homotopy type of ϕ making it invariant under continuous deformations of g = g( ). As discussed in the main body of the paper, the correlation functions are given in the form: The fixed loci of the supersymmetry transformations (see [39]) are given as and ϕ that satisfy these equations are called worldsheet instantons. For an image of ϕ( ) in X , there is a class β ∈ H 2 (X , Z) whose basis is given by {c 1 , . . . , c m }, m = dim(H 2 (X , Z)) = b 2 (X ). Restricting to the bosonic part S bos of (169) for worldsheet instantons, it is possible to show that S bos = B(ω, β) which corresponds to the volume of the image of the worldsheet, where ω is the Kähler form. Then Taking → 0, we see that only the terms O (2)Ab with mixed indices survive. Repeating the same process for the inner product of 1-forms gives us O (1)a , where only 1-forms with a small index survives. Note also that the scalar interaction terms [φ, φ † ] 2 and η [φ, η] in (181) do not survive when the metric is deformed.
Upon reduction on C for M 4 = × C, the fields φ, φ † , η and A have no derivatives on , and become auxiliary fields which can be integrated out. What is left of the fermionic fields are ψ C and χ C which can be interpreted as a 0-form, 1-form on , respectively. The bosonic field left will be the gauge field A C . From (182), we see that deformation of the metric forces us to have O (2)ab = 0. For the field strength F μν , we thus have Since A C is the only leftover bosonic field on , we must have configurations of A C that gives us SU (2) flat connections on C. We can thus take A C to be a map A C : → M C , where M C is the moduli space of flat connections on C. We can express variations of A C about configurations that give flat connections on C in terms of basis cotangent vectors α I C on M C by where E I are connections on M C , and the indices i,ī etc, are for collective complex coordinates on M C , z,z are complex coordinates on , and w,w are complex coordinates on C. The connection E i helps define a covariant derivative on M C , The remaining fermionic fields ψ C and χ C , being cotangent vectors on M C , can be expressed as linear combinations of α iw , α¯i w : ψw = χ i α iw , ψ w = χ¯i α¯i w χ zw = ρ¯i z α¯i w , χzw = ρ iz α iw .
Next, we integrate out the fields in 4d that do not depend on derivatives on , namely φ, φ † , η and A z . The equation of motion for A z gives [13,49] (and corresponding terms for Az) where ij is the curvature on M C , defined by For φ and φ † , we obtain D w Dwφ =i ψ w , ψw , D w Dwφ † =i g zz χ zw , χ¯zw .
Since the moduli spaces of flat connections on Riemann surfaces are Kähler manifolds, we introduce a metric (symmetric in its indices) and symplectic form on M C as respectively. Given these two objects, we can also obtain the connection coefficients and the Riemann tensor on M C k i j = ∂ j G ik = C d 2 w Tr(αk w ∇ j α iw ) , These (and the conjugates with barred indices) are the only components of the connection and the Riemann tensor due to the fact that M C is a Kähler manifold.
We now use (187) and the constraints from integrating η out to obtain the field strength as where the relation Dw ij = ∇¯j α iw has been used. Next, with the identity [αw i , α wk ] =i Dw D w ik and (189), we obtain Dealing with the kinetic terms in the 4d theory, we can substitute (193) into D w φ Dwφ † , and together with the square of the second term in (192) that comes from F ∧ F, we will obtain the Riemann tensor of M C as shown in (191). Similarly, the square of the first term in (192) with the Kähler metric will give the kinetic term for the bosonic field in the 2d A-model. The only fermionic kinetic term left in 4d after reduction on C is χ zw Dzψw and χzw D z ψ w . Since there is a covariant derivative on , we make use of the expression for A z in (187), and together with the cross terms of (192) from F ∧ F, we obtain the kinetic terms for the fermion fields χ i , χ¯i , ρ¯i z and ρ iz . In particular, we obtain the covariant derivative on as ∇zχ i = ∂zχ i + χ j i jk ∂zϕ i .
One can also add an instanton term˚ı θ 8π 2 M 4 Tr (F ∧ F) to the DW action in (181), which then translates to the pullback of the Kähler form in the A-model [50].
At the end, we obtain the A-model, whose action is Explicitly, the pullback of the Kähler form goes as (with I , J as real coordinates on M C )i θ ϕ * ω =i θ 2π 2 g zz ω I J ∂ z ϕ I ∂zϕ J .
This term is the same as the corresponding one in the purely bosonic nonlinear sigma model, even after adding supersymmetry. There are no fermions despite it being supersymmetric. This is due to the fact that it is a topological term which does not change under small continuous variations of the fields. Hence, there are neither bosonic nor fermionic degrees of freedom which allows it to remain supersymmetric. We can compare the fields from both theories in Table 3. Fields that become auxiliary after reduction are left out from the 2d side of the table. On the 2d side, the bosonic field is the map X : → M C and from the ghost charge, can be identified with the leftover gauge field A C . Similarly, we can identify the corresponding fermionic fields as well.