<figure><img src="image_1.png" /></figure>

Modular anomaly of BPS black holes

Sergey Alexandrov, Khalil Bendriss

► To cite this version:

Sergey Alexandrov, Khalil Bendriss. Modular anomaly of BPS black holes. Journal of High Energy Physics, 2024, 12, pp.180. 10.1007/JHEP12(2024)180. hal-04694631

HAL Id: hal-04694631

https://hal.science/hal-04694631v1

Submitted on 21 Mar 2025

**HAL** is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_2.png" /></figure>

Distributed under a Creative Commons Attribution 4.0 International License
<figure><img src="image_3.png" /></figure>

# Modular anomaly of BPS black holes

Sergei Alexandrov and Khalil Bendriss

Laboratoire Charles Coulomb (L2C), Université de Montpellier, CNRS,
F-34095, Montpellier, France

E-mail: sergey.alexandrov@umontpellier.fr,
khalil.bendriss@umontpellier.fr

**ABSTRACT:** Generating functions of BPS indices, counting states of D4-D2-D0 black holes in Calabi-Yau compactifications of type IIA string theory and identified with rank 0 Donaldson-Thomas invariants, are examples of mock modular forms. They have a quite complicated modular anomaly expressed as a sum over three different types of trees weighted by generalized error functions and their derivatives. We show that this anomaly can be significantly simplified, which in turn simplifies finding the corresponding mock modular generating functions.

**KEYWORDS:** Black Holes in String Theory, String Duality

ARXIV ePRINT: 2408.16819

JHEP12(2024)180
# Contents

<table><tr><td>1</td><td>Introduction</td><td>1</td></tr><tr><td>2</td><td>Expression for modular completion</td><td>3</td></tr><tr><td>2.1</td><td>Large τ<sub>2</sub> limit and vanishing Dirac products</td><td>6</td></tr><tr><td>3</td><td>Simplified anomaly</td><td>10</td></tr><tr><td>4</td><td>Conclusions</td><td>13</td></tr><tr><td>A</td><td>Generalized error functions</td><td>14</td></tr><tr><td>A.1</td><td>The limit of large argument</td><td>15</td></tr><tr><td>A.2</td><td>Identities</td><td>16</td></tr><tr><td>B</td><td>Coefficients a<sub>τ</sub> and e<sub>τ</sub></td><td>19</td></tr><tr><td>C</td><td>Irrational vs. rational coefficients</td><td>21</td></tr></table>

## 1 Introduction

Modularity is an extremely powerful tool to obtain exact results in situations where the modular group, typically SL(2, $Z$), is a symmetry of the system. A prominent example is the calculation of black hole entropy in compactified string theory, see, e.g., [1–5] for some classic works. In most of these classic examples, the generating function of black hole degeneracies turns out to be a modular form, sometimes involving a non-trivial multiplier system or of vector valued type. But this is not the only possibility as today we know examples where the generating function has a non-trivial modular anomaly. Usually, the anomaly is of a very specific form so that the generating function is still considered as a ‘nice’ modular object.

The first such example in the context of black holes was discovered in [6] where it was shown that the generating functions of degeneracies of immortal dyons, i.e. single centered $\frac{1}{4}$-BPS black holes appearing in compactifications of type II string theory on $K3 \times T^2$, the same that have been counted in [2], are *mock modular forms*. This is a particularly nice class of functions for which the modular anomaly is determined by an integral of another modular form called “shadow” [7, 8]. If the shadow is a product (or sum of products) of a holomorphic and anti-holomorphic modular forms, as is the case for [6], one says that the mock modular form is mixed.

A few years ago a much richer modular structure was discovered in the context of type IIA string theory on a Calabi-Yau (CY) threefold $\mathbb{Q}$). In [9] it was shown that the generating functions of BPS indices counting states of D4-D2-D0 black holes and identified with rank 0 Donaldson-Thomas (DT) invariants of $\mathbb{Q}$ are *higher depth* mock modular forms, with the depth determined by the D4-brane charge. This class of functions generalizes mixed mock modular forms and is defined recursively: a function is mock modular of depth $n$ if its shadow
is mock modular of depth $n-1$. In this terminology the usual modular and mock modular forms have depth 0 and 1, respectively.

The main physical reason for the appearance of mock modularity in both [6] and [9], which describe respectively string theory compactifications with $N=4$ and $N=2$ supersymmetry in 4 dimensions, is the existence of multi-centered black holes contributing to the index. In the $N=4$ context, the only multi-centered black holes are bound states of two $\frac{1}{2}$-BPS black holes, while in the $N=2$ setup they can have any number of constituents. This is why the depth of mock modularity is 1 in the first case and can take any value in the second.

The work [9] not only identified the mathematical nature of the generating functions, but also found the precise anomaly equation which they satisfy (the cases of depth 0 and 1 have been analyzed before in [10–12]). This equation takes the form of an expression for *modular completion*, a non-holomorphic modification of the corresponding mock modular form by terms that are suppressed in the limit $Im \tau \to \infty$ such that it transforms as usual modular form without any anomaly.

This result has already found several applications and has been extended beyond the original setup of $N=2$ supergravity. First, in [13] it has been generalized to include the so-called refinement, a one-parameter deformation corresponding physically to switching on the $\Omega$-background [14]. This extension has then been used to find generating functions and their completions of the (refined) $SU(N)$ Vafa-Witten invariants on $\mathbb{P}^2$, Hirzebruch and del Pezzo surfaces [15, 16], which coincide with the (refined) rank 0 DT invariants on the non-compact CY given by the total space of the canonical bundle over the complex surface [17–20]. The anomaly equation has also been extended to incorporate the cases with larger supersymmetry such as $N=4$ and $N=8$ [21], which allowed to reproduce and generalize the results of [6] on mock modularity of immortal dyons. Finally, in [22], using a solution of the modular anomaly found in [23], the generating functions of D4-charge 2 BPS indices for a few one-parameters CY threefolds have been explicitly found. This generalized the previous works [5, 24–27] where the case of the unit charge, corresponding to depth 0 or standard modular forms, was analyzed and provided the first examples of mock modular forms assigned to CY threefolds without any additional structures.

A further progress is however complicated by a highly involved form of the modular anomaly or, equivalently, of the modular completion of the generating functions. As we review in section 2, it is given by a sum over three different types of trees used to construct kernels of indefinite theta series from the so-called generalized error functions and their derivatives. The goal of this paper is to improve this situation. We show that the expression for the completion found in [9] can actually be significantly simplified. The new expression involves only two types of trees and much less terms than the original one. (Roughly, the main change is that the functions (2.10) are replaced by the functions (3.4).) We hope that this simplification will be helpful in solving the anomaly equations for higher depth cases.

The organization of the paper is as follows. In the next section we present the expression for the completion of generating functions obtained in [9]. We also find that this expression misses some subtle contributions which we determine using some remarkable identities satisfied by the generalized error functions. In section 3 we prove a simplified form of the completion. In section 4 we discuss our results. In appendix A we recall the definition
and derive some new properties of the generalized error functions, including a set of their identities. In appendix B we collect values of some coefficients entering the completion and prove also an identity which they satisfy. Finally, in appendix C we provide details on how one arrives at the representation in terms of these coefficients.

## 2 Expression for modular completion

We are interested in D4-D2-D0 BPS states characterized by charge vector ($p^a, q_a, q_0$) where $a = 1, \dots, b_2(\mathfrak{Z})$. The D4-brane charge $p^a$ is an element of the lattice $\Lambda = H_4(\mathfrak{Z}, \mathbb{Z})$, while the D2-brane charge $q_a$ belongs to the shifted dual lattice $\Lambda^* + \frac{1}{2}p$. Given the triple intersection numbers $\kappa_{abc}$ of $\mathfrak{Z}$ and D4-brane charge, we define a quadratic form $\kappa_{ab} = \kappa_{abc}p^c$. It allows to embed $\Lambda$ into $\Lambda^*$ and represent

$$q_a = \kappa_{ab}\epsilon^b + \mu_a + \frac{1}{2}\kappa_{ab}p^b, \qquad (2.1)$$

where $\epsilon \in \Lambda$ and $\mu \in \Lambda^*/\Lambda$ is the residue class which runs over $|\det \kappa_{ab}|$ values. The generating functions of D4-D2-D0 BPS indices depend only on the D4-charge $p^a$ and the residue class $\mu_a$ and will be denoted $h_{p,\mu}(\tau)$. According to the results of [3, 9–11], under the standard SL(2, $\mathbb{Z}$) transformations $\tau \mapsto \frac{a\tau+b}{c\tau+d}$, they behave as higher depth vector valued mock modular forms of weight $-\frac{1}{2}b_2 - 1$ and a multiplier system closely related to the Weil representation attached to the lattice $\Lambda$ (see [13], eq. (2.10)).

A more precise requirement is that the following non-holomorphic function

$$\hat{h}_{p,\mu}(\tau, \bar{\tau}) = h_{p,\mu}(\tau) + \sum_{n=2}^{n_{\max}} \sum_{\sum_{i=1}^{n} \tilde{\gamma}_i = \tilde{\gamma}} R_n(\{\tilde{\gamma}_i\}, \tau_2) e^{\pi i \tau Q_n(\{\tilde{\gamma}_i\})} \prod_{i=1}^{n} h_{p_i, \mu_i}(\tau) \qquad (2.2)$$

must transform as a modular form of the same weight and multiplier system as $h_{p,\mu}$. Here the sum runs over all ordered decompositions of $\hat{\gamma} = (p^a, \mu_a + \frac{1}{2}\kappa_{ab}p^b)$ into a sum of $n$ reduced<fnref n="1" /> charge vectors $\hat{\gamma}_i = (p_i^a, q_{i,a})$ where $q_{i,a}$ are expressed as in (2.1) with quadratic forms $\kappa_{i,ab} = \kappa_{abc}p_i^c$ and residue classes $\mu_i$, and the first components satisfy (using notation $(xyz) = \kappa_{abc}x^a y^b z^c$)

$$p^3 > 0, \quad (rp^2) > 0, \quad k_a p^a > 0, \qquad (2.3)$$

for all divisor classes $r \in H_4^+(\mathfrak{Z}, \mathbb{Z})$ and curve classes $k \in H_2^+(\mathfrak{Z}, \mathbb{Z})$. Physically, this sum corresponds to a sum over all possible bound states of a given charge $\hat{\gamma}$, and the upper limit $n_{\max}$ in the sum over the number of constituents $n$ is given by the number of irreducible components which the divisor corresponding to D4-charge $p^a$ can be decomposed in. Besides, in (2.2) we also used notation $Q_n$ for the following quadratic form

$$Q_n(\{\tilde{\gamma}_i\}) = \kappa^{ab} q_a q_b - \sum_{i=1}^{n} \kappa_i^{ab} q_{i,a} q_{i,b}, \qquad (2.4)$$

where $\kappa_i^{ab}$ is the inverse of $\kappa_{i,ab}$. Since $\kappa_{ab}$ is known to have signature $(1, b_2 - 1)$, the signature of the quadratic form $Q_n$ is $((n-1)(b_2 - 1), n - 1)$. Thus, the sum over D2-brane charges

<footnote n="1">¹We use notation $\tilde{\gamma}$ and call it ‘reduced charge’ because $\gamma$ is usually reserved for the full charge vector that includes also D6 and D0-charges.</footnote>
<figure><img src="image_4.png" /><figcaption>**Figure 1.** An example of Schröder tree contributing to $R_8$. Near each vertex we showed the corresponding factor using the shorthand notation $\gamma_{i+j} = \gamma_i + \gamma_j$.</figcaption></figure>

in (2.2) defines an indefinite theta series of that signature with the kernel given by the function $R_n$ which is the main non-trivial ingredient of the construction.

To define $R_n$, let $T_n^S$ be the set of the so called Schröder trees with $n$ leaves, which are rooted planar trees such that all vertices $v \in V_T$ (the set of vertices of $T$ excluding the leaves) have $k_v \ge 2$ children (see figure 1). We also denote the number of elements in $V_T$ by $n_T$, and the root vertex by $v_0$. The vertices of $T$ are labelled by charges so that the leaves carry charges $\hat{\gamma}_i$, whereas the charges assigned to other vertices are given recursively by the sum of charges of their children, $\hat{\gamma}_v \in \sum_{v' \in \text{Ch}(v)} \hat{\gamma}_{v'}$. On top of that, we consider a set of functions $\mathcal{E}_n(\{\check{\gamma}_i\}; \tau_2)$ which have a canonical decomposition

$$ \mathcal{E}_n(\{\check{\gamma}_i\}; \tau_2) = \mathcal{E}_n^{(0)}(\{\check{\gamma}_i\}) + \mathcal{E}_n^{(+)}(\{\check{\gamma}_i\}; \tau_2), \quad (2.5) $$

where the first term $\mathcal{E}_n^{(0)}$ does not depend on $\tau_2$, whereas the second term $\mathcal{E}_n^{(+)}$ is exponentially suppressed as $\tau_2 \equiv \text{Im } \tau \to \infty$ keeping the charges $\hat{\gamma}_i$ fixed. The precise definitions of these functions will be given below. Given a Schröder tree $T$, we set $\mathcal{E}_v \equiv \mathcal{E}_{k_v}(\{\hat{\gamma}_{v'}\})$ (and similarly for $\mathcal{E}_v^{(0)}, \mathcal{E}_v^{(+)}$) where $v' \in \text{Ch}(v)$ runs over the $k_v$ children of the vertex $v$. In terms of these data, the functions $R_n$ are given by$^2$

$$ R_n(\{\check{\gamma}_i\}; \tau_2) = \text{Sym} \left\{ \frac{(-1)^{\sum_{i<j} \gamma_{ij}}}{2^{n-1}} \sum_{T \in T_n^S} (-1)^{n_T-1} \mathcal{E}_{v_0}^{(+)} \prod_{v \in V_T \setminus \{v_0\}} \mathcal{E}_v^{(0)} \right\}, \quad (2.6) $$

where Sym denotes symmetrization (with weight $1/n!$) with respect to the charges $\check{\gamma}_i$ and

$$ \gamma_{ij} = p_j^a q_{i,a} - p_i^a q_{j,a} \quad (2.7) $$

is the anti-symmetric Dirac product of charges. Note that since all $\gamma_{ij}$ are integer and mapped to each other up to sign under permutations, the first factor is not affected by the symmetrization and can be put in front.

It remains to define the functions $\mathcal{E}_n$. To this end, let $T_{n,m}^\ell$ be the set of marked unrooted labelled trees with $n$ vertices and $m$ marks where the marks are assigned to vertices and

<footnote>$^2$Comparing to ([9], eq. (5.34)), there is an additional factor $2^{1-n}(-1)^{\sum_{i<j} \gamma_{ij}}$. In [9] it was hidden in the functions $\mathcal{E}_n$, while here we prefer to move it to (2.6).</footnote>
each mark adds 2 labels to its vertex. For example, $|T_{2,1}^l| = 4$ with all trees having the same topology (2 vertices, one of which carries a mark), 4 labels (3 at the marked vertex and 1 at the non-marked vertex) and differing by the label assigned to the non-marked vertex. In our case the labels are identified with the charges. Thus, given a set {$\tilde{\gamma}_1, \dots, \tilde{\gamma}_{n+2m}$}, the trees are decorated in the following way. Let $m_v \in \{0, \dots, m\}$ be the number of marks carried by the vertex $v$, so that $\sum_v m_v = m$. Then a vertex $v$ with $m_v$ marks carries $1+2m_v$ charges $\tilde{\gamma}_{v,s}$, $s = 1, \dots, 1+2m_v$ and we set $\tilde{\gamma}_v = \sum_{s=1}^{1+2m_v} \tilde{\gamma}_{v,s}$. Given a tree $\mathcal{T} \in T_{n,m}^l$, we denote the set of its edges by $E_{\mathcal{T}}$, the set of vertices by $V_{\mathcal{T}}$, the source and target vertex<fnref n="3" /> of an edge $e$ by $s(e)$ and $t(e)$, respectively, and the two disconnected trees obtained from $\mathcal{T}$ by removing the edge $e$ by $T_e^s$ and $T_e^t$. Furthermore, we will use the boldface script to denote $nb_2$-dimensional vectors and assign to each edge the vector

$$v_e = \sum_{i \in V_{\mathcal{T}_e^s}} \sum_{j \in V_{\mathcal{T}_e^t}} v_{ij}, \qquad (2.8)$$

where $v_{ij}$ are the vectors with the following components

$$v_{ij,k}^a = \delta_{ki} p_j^a - \delta_{kj} p_i^a. \qquad (2.9)$$

Using these notations, we define ([9], eq. (5.32))

$$\Phi_n^\mathcal{E}(\mathbf{x}) = \frac{1}{n!} \sum_{m=0}^{[(n-1)/2]} \sum_{\mathcal{T} \in T_{n-2m,m}^l} \left[ \prod_{v \in V_{\mathcal{T}}} \mathcal{D}_{m_v}(\{p_{v,s}\}) \prod_{e \in E_{\mathcal{T}}} \mathcal{D}(v_{s(e)}t(e)) \right] \Phi_{\mathcal{T}}^E(\mathbf{x}). \qquad (2.10)$$

Here $\Phi_{\mathcal{T}}^E$ is a generalized error function defined by an unrooted labelled tree in terms of the usual (boosted) generalized error function $\Phi_n^E$ with parameters given by the vectors (2.8),

$$\Phi_{\mathcal{T}}^E(\mathbf{x}) = \Phi_{|E_{\mathcal{T}}|}^E(\{v_e\}; \mathbf{x}). \qquad (2.11)$$

The functions $\Phi_n^E$ are reviewed in appendix A and defined with respect to the bilinear form

$$\mathbf{x} \cdot \mathbf{y} = \sum_{i=1}^{n} \kappa_{abc} p_i^a x_i^b y_i^c. \qquad (2.12)$$

Besides, $\mathcal{D}(v)$ is the differential operator (A.5) and $\mathcal{D}_m(\{p_s\})$ is another differential operator associated with the existence of marks. It is given by a sum over unrooted labelled trees with $2m+1$ vertices. To write the precise formula, we need to introduce rational coefficients $a_{\mathcal{T}}$ determined recursively by the relation

$$a_{\mathcal{T}} = \frac{1}{n_{\mathcal{T}}} \sum_{v \in V_{\mathcal{T}}} (-1)^{n_v^+} \prod_{s=1}^{n_v} a_{\mathcal{T}_s(v)}, \qquad (2.13)$$

where $n_{\mathcal{T}}$ is the number of vertices, $n_v$ is the valency of the vertex $v$, $n_v^+$ is the number of incoming edges at the vertex, and $T_s(v)$ are the trees obtained from $\mathcal{T}$ by removing the vertex. The relation (2.13) is supplemented by the initial condition for the trivial tree consisting of

<footnote n="3">³The orientation of edges on a given tree can be chosen arbitrarily since the final result does not depend on this choice, although various intermediate quantities can flip sign under the flip of the orientation.</footnote>
one vertex, $a_\bullet = 1$, and one can show that $a_\mathcal{T} = 0$ for all trees with even number of vertices. (We provide a table of these coefficients for trees with $n_\mathcal{T} \le 7$ in appendix B.) Then we have

$$ \mathcal{D}_m(\{p_s\}) = \sum_{\mathcal{T} \in \mathcal{T}_{2m+1}^{\ell}} a_{\mathcal{T}} \prod_{e \in E_{\mathcal{T}}} \mathcal{D}(\mathbf{v}_{s(e)t(v)}). \qquad (2.14) $$

Note that all vectors entering the definition of $\mathcal{D}_{m_v}$ are orthogonal to the vectors appearing as parameters of the operators $\mathcal{D}$ and the generalized error functions in (2.10). Therefore, $\mathcal{D}_{m_v}$ do not actually act on those factors and can be replaced by usual functions obtained as $\mathcal{D}_{m_v} \cdot 1$.
In terms of the functions (2.10), we finally set

$$ \mathcal{E}_n(\{\check{\gamma}_i\}; \tau_2) = \frac{\Phi_n^{\mathcal{E}}(\mathbf{x})}{(\sqrt{2\tau_2})^{n-1}}, \qquad (2.15) $$

where $\mathbf{x}$ is a vector with components $x_i^a = \sqrt{2\tau_2} \kappa_i^{ab} q_{i,b}$. In particular, its scalar products with the vectors $\mathbf{v}_{ij}$ (2.9) reproduce the Dirac products (2.7), i.e. $\mathbf{v}_{ij} \cdot \mathbf{x} = \sqrt{2\tau_2}\gamma_{ij}$.

This completes the definition of the functions $R_n$ determining the modular anomaly of the generating functions via (2.2). Given that their building blocks $\mathcal{E}_n$ are constructed from the generalized error functions with parameters defined by charges $\check{\gamma}_i$, they have the meaning of kernels of indefinite theta series providing completions for holomorphic theta series constructed from sign functions of Dirac products of these charges.

## 2.1 Large $\tau_2$ limit and vanishing Dirac products

Although the above construction provides a complete definition of the functions $R_n$, to actually compute them, one should perform the split (2.5), which amounts to evaluating the large $\tau_2$ limit of the functions $\mathcal{E}_n$ (2.15). This has been done in ([9], eq. (5.29)) with the following result

$$ \begin{aligned} \mathcal{E}_n^{(0)}(\{\check{\gamma}_i\}) &\equiv \lim_{\tau_2 \to \infty} \mathcal{E}_n(\{\check{\gamma}_i\}; \tau_2) \\ &= \frac{1}{n!} \sum_{m=0}^{[(n-1)/2]} \sum_{\mathcal{T} \in \mathcal{T}_{n-2m,m}^{\ell}} \kappa_{\mathcal{T}}(\{\check{\gamma}_{\mathcal{T}}\}) \prod_{\mathcal{V} \in V_{\mathcal{T}}} \mathcal{V}_{m_{\mathcal{V}}}(\{\check{\gamma}_{\mathcal{V},s}\}) \prod_{e \in E_{\mathcal{T}}} \operatorname{sgn}(\Gamma_e), \end{aligned} \qquad (2.16) $$

where

$$ \Gamma_e = \sum_{i \in V_{\tau_e^s}} \sum_{j \in V_{\tau_e^t}} \gamma_{ij}, \qquad \kappa_{\mathcal{T}}(\{\check{\gamma}_{\mathcal{T}}\}) = \prod_{e \in E_{\mathcal{T}}} \gamma_{s(e)t(e)}, \qquad (2.17) $$

and

$$ \mathcal{V}_m(\{\check{\gamma}_s\}) = \sum_{\mathcal{T} \in \mathcal{T}_{2m+1}^{\ell}} a_{\mathcal{T}} \kappa_{\mathcal{T}}(\{\check{\gamma}_s\}). \qquad (2.18) $$

However, this result is not quite precise. It was derived from the fact that the generalized error functions $\Phi_n^E(\{\mathbf{v}_i\}; \mathbf{x})$ at large values of their argument $\mathbf{x}$ reduce to a product of sign functions (see appendix A below (A.2)). But along certain directions, characterized by vanishing of two or more scalar products $\mathbf{v}_i \cdot \mathbf{x}$, this is not true, at least if we accept the convention that $\operatorname{sgn}(0) = 0$.<fnref n="4" /> The correct limit is given by Proposition 2 in appendix A. From

<footnote n="4">⁴This issue has already been realized in [13] where an improved solution has been proposed in the refined case, but it was claimed that the unrefined case does not suffer from this problem. Our analysis shows that this claim was naive.</footnote>
<figure><img src="image_5.png" /><figcaption>Figure 2. Unrooted trees constructed from the same three subtrees.</figcaption></figure>

this result it is easy to derive a corrected version of (2.16). Essentially, the derivation given in the proof of ([9], Prop. 5) goes through upon replacing $\prod_{e \in E_{\mathcal{T}}} \operatorname{sgn}(\Gamma_e)$ by

$$S_{\mathcal{T}}(\{\check{\gamma}_v\}) = \sum_{\mathcal{J} \subseteq E_{\mathcal{T}}} e_{\mathcal{T}_{\mathcal{J}}}(\{v_e\}_{e \in \mathcal{J}}) \prod_{e \in \mathcal{J}} \delta_{\Gamma_e} \prod_{e \in E_{\mathcal{T}} \setminus \mathcal{J}} \operatorname{sgn}(\Gamma_e), \quad (2.19)$$

where<fnref n="5" />

$$e_{\mathcal{T}}(\{v_e\}) = \Phi_{\mathcal{T}}^{E}(0) \quad (2.20)$$

and $\mathcal{T}_{\mathcal{J}}$ is the tree obtained from $\mathcal{T}$ by contracting the edges $e \in E_{\mathcal{T}} \setminus \mathcal{J}$. The crucial observation for this is that the coefficients $e_{\mathcal{T}}$ satisfy

$$e_{\hat{\tau}_1} + e_{\hat{\tau}_2} - e_{\hat{\tau}_3} = -e_{\tau}, \quad (2.21)$$

where $\hat{\tau}_r$ ($r = 1, 2, 3$) are the trees constructed from arbitrary unrooted trees $\mathcal{T}_r$ as shown in figure 2, while $\mathcal{T}$ is obtained from any tree $\hat{\tau}_r$ by collapsing both edges $e_i$. This relation is direct consequence of the identity (A.17) for the generalized error functions specified to $x = 0$. As a result, one finds the following expression for the large $\tau_2$ limit of the functions $\mathcal{E}_n$:

$$\mathcal{E}_n^{(0)}(\{\check{\gamma}_i\}) = \frac{1}{n!} \sum_{m=0}^{[(n-1)/2]} \sum_{\mathcal{T} \in \mathcal{T}_{n-2m,m}^{\ell}} \left[ \prod_{v \in V_{\mathcal{T}}} \mathcal{V}_{m_v}(\{\check{\gamma}_v, s\}) \right] \kappa_{\mathcal{T}}(\{\check{\gamma}_v\}) S_{\mathcal{T}}(\{\check{\gamma}_v\}). \quad (2.22)$$

It is useful to note that the sum over marked trees can also be rewritten in terms of a sum over subsets of $\mathcal{L}_n = \{1, \dots, n\}$ and a single function given by the sum over non-marked trees. Namely, let us introduce

$$\mathcal{E}_n^{(0)}(\{\check{\gamma}_i\}) = \frac{1}{n!} \sum_{\mathcal{T} \in \mathcal{T}_n^{\ell}} \kappa_{\mathcal{T}}(\{\check{\gamma}_v\}) S_{\mathcal{T}}(\{\check{\gamma}_v\}), \quad (2.23)$$

where the sum goes over labelled trees without marks, which is nothing but the $m = 0$ part of $\mathcal{E}_n^{(0)}$. Let also $\{\mathcal{J}_j\}$ be a set of non-intersecting subsets of $\mathcal{L}_n$ of odd cardinality $|\mathcal{J}_j| \equiv 2m_j+1$, $m_j \in \mathbb{N}$, and $\check{\gamma}_j^{\mathcal{J}} = \sum_{i \in \mathcal{J}_j} \check{\gamma}_i$. Then it is easy to see that (2.22) is equivalent to

$$\mathcal{E}_n^{(0)}(\{\check{\gamma}_i\}; \tau_2) = \sum_{m=0}^{[(n-1)/2]} \sum_{\bigcup_{j=1}^{n-2m} \mathcal{J}_j = \mathcal{L}_n} \left[ \prod_{j=1}^{n-2m} \mathcal{V}_{m_j}(\{\check{\gamma}_i\}_{i \in \mathcal{J}_j}) \right] \mathcal{E}_{n-2m}^{(0)}(\{\check{\gamma}_j^{\mathcal{J}}\}; \tau_2). \quad (2.24)$$

<footnote n="5">⁵We left the dependence of the coefficients $e_{\mathcal{T}}$ on the vectors $v_e$ explicit to distinguish them from other coefficients $e_{\mathcal{T}}$ appearing below, which depend only on the tree topology, but not on its labelling by charges.</footnote>
A similar representation also exists for the full function $\mathcal{E}_n$ defined by (2.10) and (2.15), but we will not use it in this paper.

In principle, (2.22) or (2.24) solves the problem of correcting (2.16). Note, however, that while for even number of vertices (and hence odd number of edges) of $\mathcal{T}$ the coefficients $e_{\mathcal{T}}$ vanish due to the oddness of the corresponding generalized error functions (see (A.3)), in the opposite case they are, in general, irrational numbers.<fnref n="6" /> On the other hand, only rational numbers are expected to appear in the completion of a mock modular form with rational Fourier coefficients. This implies that there should exist an alternative representation and, on the basis of this expectation, we suggest the following

**Conjecture 1.**

$$ \mathcal{E}_n^{(0)}(\{\check{\gamma}_i\}) = \frac{1}{n!} \sum_{\mathcal{T} \in \mathcal{T}_n^\ell} \kappa_{\mathcal{T}}(\{\check{\gamma}_\mathcal{v}\}) S_{\mathcal{T}}(\{\check{\gamma}_\mathcal{v}\}), \qquad (2.25) $$

where

$$ S_{\mathcal{T}}(\{\check{\gamma}_{\mathcal{v}}\}) = \sum_{\mathcal{J} \subseteq E_{\mathcal{T}}} e_{\mathcal{T}_{\mathcal{J}}} \prod_{e \in \mathcal{J}} \delta_{\Gamma_e} \prod_{e \in E_{\mathcal{T}} \setminus \mathcal{J}} \operatorname{sgn}(\Gamma_e) \qquad (2.26) $$

and $e_{\mathcal{T}}$ are some rational numbers depending only on topology of $\mathcal{T}$.

It is clear that if this conjecture is true then a similar replacement of $S_{\mathcal{T}}$ by $S_{\mathcal{T}}$ can also be made in (2.22). In appendix C we provide an evidence in favor of this conjecture by explicitly analyzing the cases with $n \le 5$. In all these cases the equality of (2.23) and (2.25) follows from a set of remarkable identities satisfied by the generalized error functions (see section A.2) and hence by the coefficients $e_{\mathcal{T}}$. The simplest of them holds for the tree of trivial topology $\mathcal{T} = \bullet - \bullet - \cdots - \bullet - \bullet$ with odd $n_{\mathcal{T}}$ and takes the following form

$$ \sum_{\text{cyclic perm.}} e_{\mathcal{T}}(\{v_e\}) = 1, \qquad (2.27) $$

where the sum goes over the cyclic permutations of charges assigned to the vertices of $\mathcal{T}$. This identity implies that for this tree $e_{\mathcal{T}} = 1/n_{\mathcal{T}}$, consistently with the solution found in [13] in the refined case where the tree of linear topology is the only one contributing to the refined analogue of $\mathcal{E}_n$.

For practical purposes, Conjecture 1 is useless until one finds concrete values of the coefficients $e_{\mathcal{T}}$ for all unrooted trees. In fact, these coefficients are not even unambiguously defined because, as shown in appendix C, different terms in (2.25) are not independent. Nevertheless, as we will now explain, there is a way to determine (a possible set of) their values. To this end, we first prove

**Proposition 1.** If $\Gamma_e = 0$ for $\forall e \in E_{\mathcal{T}}$, then this is true for any unrooted tree with the same number of vertices labelled by the same set of charges, i.e. $\Gamma_e = 0$ for $\forall e \in E_{\mathcal{T}}'$ and $\forall \mathcal{T}'$ such that $n_{\mathcal{T}}' = n_{\mathcal{T}}$.

<footnote n="6">⁶For generic tree, $e_{\mathcal{T}}$ is irrational even being computed on the simplest set of charges all taken to be equal. A notable exception is the tree of linear topology $\bullet - \bullet - \cdots - \bullet - \bullet$ for which $e_{\mathcal{T}}$ is equal to $1/n_{\mathcal{T}}$ if $n_{\mathcal{T}}$ is odd and 0 otherwise, as has been observed in [13]. In fact, this is a consequence of the identity (2.27) which holds for arbitrary charges.</footnote>
<figure><img src="image_6.png" /><figcaption>Figure 3. A vertex and adjacent subtrees.</figcaption></figure>

*Proof.* Let us consider unrooted trees with $n$ vertices and think about $\gamma_{ij}$ as basis vectors in a $\frac{1}{2}n(n-1)$-dimensional vector space. Then for each tree $\mathcal{T} \in \mathcal{T}_n^\ell$, the set of $\Gamma_e$ spans a $(n-1)$-dimensional subspace. What we need to show is that this subspace is the same for all trees. In turn, this would follow if for any pair of trees, $\mathcal{T}$ and $\mathcal{T}'$, all $\Gamma'_e$ can be expressed as linear combinations of $\Gamma_e$. Moreover, due to the linear independence of these vectors for each tree, it is enough to show this for a fixed tree $\mathcal{T}'$.

Let us choose $\mathcal{T}'$ to be the tree where vertex $v_n$ is connected to all other vertices. (For example, in the table of appendix B, these are the trees $\mathcal{T}_{3,1}$, $\mathcal{T}_{5,3}$ and $\mathcal{T}_{7,8}$.) For such tree the edges can be labelled by the index of the vertex connected by the edge to $v_n$ and we have $\Gamma'_{e_i} = \sum_{j=1}^n \gamma_{ij}$, $i = 1, \dots, n-1$. On the other hand, for any other unrooted labelled tree $\mathcal{T}$, let

$$ M_{ie} = \begin{cases} 1 & \text{if } v_i = s(e), \\ -1 & \text{if } v_i = t(e), \\ 0 & \text{if } v_i \notin e. \end{cases} \qquad (2.28) $$

Then it is easy to realize that

$$ \Gamma'_{e_i} = \sum_{e \in E_{\mathcal{T}}} M_{ie} \Gamma_e. \qquad (2.29) $$

Indeed, let us denote the edges adjacent to $v_i$ by $e_r$, $r = 1, \dots, m = n_{v_i}$, and the subtree joint to $v_i$ via $e_r$ by $\mathcal{T}_r$ (see figure 3). With these notations, the definitions of $\Gamma_e$ (2.17) and the matrix $M_{ie}$ imply that

$$ \sum_{e \in E_{\mathcal{T}}} M_{ie} \Gamma_e = \sum_{r=1}^{m} \sum_{j \in V_{\mathcal{T}_r}} \left( \gamma_{ij} + \sum_{\substack{s=1 \\ s \neq r}}^{m} \sum_{k \in V_{\mathcal{T}_s}} \gamma_{kj} \right). \qquad (2.30) $$

The second term on the r.h.s. vanishes because $\gamma_{kj}$ is anti-symmetric, while the first equals $\Gamma'_{e_i}$. This proves (2.29), from which the Proposition follows according to the above reasoning. $\square$

Due to this proposition, the condition of vanishing of all $\Gamma_e$ is the same for all trees with a given number of vertices. Let us denote by $\tilde{\gamma}_i^*$ the charges satisfying this condition. We claim that

$$ \mathcal{E}_n^{(0)}(\{\tilde{\gamma}_i^*\}) = 0. \qquad (2.31) $$

This fact is a consequence of a (conjectural) formula (5.47) from [9] for $\mathcal{E}_n^{(0)}$. In this representation each product of sign functions is multiplied by a factor

$$ \sum_T d_T \kappa(T), \qquad \kappa(T) = (-1)^{n-1} \prod_{v \in V_T} (-1)^{\gamma_{L(v)R(v)}} \gamma_{L(v)R(v)}, \qquad (2.32) $$
where $d_T$ are some numerical coefficients and the sum goes over a subset of flow trees $T$ with $n$ leaves, which are rooted binary trees with vertices decorated by charges $\gamma_v$, such that the leaves of the tree carry charges $\gamma_i$, and the charges propagate along the tree according to $\gamma_v = \gamma_{L(v)} + \gamma_{R(v)}$ at each vertex, where $L(v)$, $R(v)$ are the two children of the vertex $v$. It is clear that the factor corresponding to the root vertex of a tree $T$ in the product $\kappa(T)$ coincides with one of $\Gamma_e$'s and hence all terms vanish for our choice of charges.

Applying the vanishing condition (2.31) to (2.22) with $S_T$ replaced by $S_T$ gives

$$ \sum_{m=0}^{[(n-1)/2]} \sum_{\mathcal{T} \in \mathcal{T}_{n-2m,m}^{\ell}} e_{\mathcal{T}} \kappa_{\mathcal{T}}(\{\check{\gamma}_{\mathcal{v}}^{*}\}) \prod_{\mathcal{v} \in V_{\mathcal{T}}} \mathcal{V}_{m_{\mathcal{v}}}(\{\check{\gamma}_{\mathcal{v},s}^{*}\}) = 0. \qquad (2.33) $$

Substituting (2.18), this can be rearranged as

$$ \sum_{\mathcal{T} \in \mathcal{T}_n^{\ell}} \left( \sum_{\bigcup_{k=1}^{m} \mathcal{T}_k \simeq \mathcal{T}} e_{\mathcal{T}/\{\mathcal{T}_k\}} \prod_{k=1}^{m} a_{\mathcal{T}_k} \right) \kappa_{\mathcal{T}}(\{\check{\gamma}_{\mathcal{v}}^{*}\}) = 0, \qquad (2.34) $$

where the second sum runs over all decompositions of $\mathcal{T}$ into a set of non-intersecting subtrees$^7$ and $\mathcal{T}/\{\mathcal{T}_k\}$ denotes the tree obtained from $\mathcal{T}$ by collapsing each subtree $\mathcal{T}_k$ to a single vertex. Although the factors $\kappa_{\mathcal{T}}(\{\check{\gamma}_{\mathcal{v}}^{*}\})$ are not all linearly independent, the condition (2.34) suggests a simple way to fix all the coefficients $e_{\mathcal{T}}$ by equating to zero each term in the sum. Then, taking into account that for $m = n_{\mathcal{T}}$ one has $\mathcal{T}_k = \bullet$ and $\mathcal{T}/\{\mathcal{T}_k\} = \mathcal{T}$, one obtains the following recursive formula

$$ e_{\mathcal{T}} = - \sum_{m=1}^{n_{\mathcal{T}}-1} \sum_{\bigcup_{k=1}^{m} \mathcal{T}_k \simeq \mathcal{T}} e_{\mathcal{T}/\{\mathcal{T}_k\}} \prod_{k=1}^{m} a_{\mathcal{T}_k}. \qquad (2.35) $$

It is easy to see that, similarly to $a_{\mathcal{T}}$, the coefficients vanish for even number of vertices. For trees with $n_{\mathcal{T}} \le 7$ we collected them in a table in appendix B and the resulting values are consistent with the analysis in appendix C. It is worth noting also that the coefficients $e_{\mathcal{T}}$ satisfy a relation analogous to (2.21):

$$ e_{\check{\tau}_1} + e_{\check{\tau}_2} - e_{\check{\tau}_3} = -e_{\mathcal{T}}, \qquad (2.36) $$

where the trees are as in figure 2. We provide its proof in appendix B.

## 3 Simplified anomaly

In this section we show that the expression for the modular completion reviewed in the previous section can be significantly simplified. While the equations (2.2) and (2.6) essentially remain intact, the simplification happens at the level of their building blocks given by the functions $\mathcal{E}_n$, which get replaced by simpler objects which we call $\mathcal{E}_n$. More precisely, we claim that the functions $R_n$ (2.6) can be rewritten as

$$ R_n(\{\check{\gamma}_i\}; \tau_2) = \mathrm{Sym} \left\{ \frac{(-1)^{\sum_{i<j} \gamma_{ij}}}{2^{n-1}} \sum_{T \in \mathcal{T}_n^S} (-1)^{n_T - 1} \mathcal{E}_{v_0}^{(+)} \prod_{v \in V_T \setminus \{v_0\}} \mathcal{E}_v^{(0)} \right\}, \qquad (3.1) $$

<footnote>$^7$We use the sign $\simeq$ because a tree contains more information than the union of its subtrees.</footnote>
where $\mathcal{E}_n^{(0)}$ and $\mathcal{E}_n^{(+)}$ are the constant and exponentially suppressed terms in a decomposition of the new functions $\mathcal{E}_n$,

$$ \mathcal{E}_n(\{\tilde{\gamma}_i\}; \tau_2) = \mathcal{E}_n^{(0)}(\{\tilde{\gamma}_i\}) + \mathcal{E}_n^{(+)}(\{\tilde{\gamma}_i\}; \tau_2), \quad (3.2) $$

These functions are defined, similarly to (2.15), as

$$ \mathcal{E}_n(\{\tilde{\gamma}_i\}; \tau_2) = \frac{\Phi_n^{\mathcal{E}}(\mathbf{x})}{(\sqrt{2\tau_2})^{n-1}}, \quad (3.3) $$

where $\Phi_n^{\mathcal{E}}(\mathbf{x})$ replace $\Phi_n^{\mathcal{E}}(\mathbf{x})$ and take the following form

$$ \Phi_n^{\mathcal{E}}(\mathbf{x}) = \frac{1}{n!} \sum_{\mathcal{T} \in \mathcal{T}_n^\ell} \left[ \prod_{e \in E_{\mathcal{T}}} \mathcal{D}(v_{s(e)t(e)}, \mathbf{y}) \right] \Phi_{\mathcal{T}}^E(\mathbf{x}) \bigg|_{\mathbf{y}=\mathbf{x}}, \quad (3.4) $$

written in terms of a differential operator generalizing the one in (A.5) and given by

$$ \mathcal{D}(\mathbf{v}, \mathbf{y}) = \mathbf{v} \cdot \left( \mathbf{y} + \frac{1}{2\pi} \partial_x \right). \quad (3.5) $$

Furthermore, the constant part of $\mathcal{E}_n$ coincides with the function $\mathcal{E}_n^{(0)}$ (2.25).

Comparing (3.4) and (2.25) to (2.10) and (2.24), we observe that the simplification consists in dropping all contributions generated by trees with non-vanishing number of marks and by the mutual action of the derivative operators $\mathcal{D}(\mathbf{v})$. The latter is achieved by the use of the operators (3.5) which do not act on each other in contrast to the original operators $\mathcal{D}(\mathbf{v})$. The price to pay for this is that the functions $\Phi_n^{\mathcal{E}}(\mathbf{x})$ are not eigenfunctions of the Vignéras operator (A.4) and therefore appear to spoil modularity. However, the claim is that all anomalies are cancelled in the combinations relevant for the completion.

The proof of the representation (3.1) proceeds in two steps. At the first step we note that the functions $\mathcal{E}_n$ (2.15) can be expressed as follows

$$ \mathcal{E}_n(\{\tilde{\gamma}_i\}; \tau_2) = \frac{1}{n!} \sum_{m=0}^{[(n-1)/2]} \frac{1}{(\sqrt{2\tau_2})^{n-2m-1}} \times \sum_{\mathcal{T} \in \mathcal{T}_{n-2m,m}^\ell} \left[ \prod_{\mathbf{v} \in V_{\mathcal{T}}} \mathcal{V}_{m_{\mathbf{v}}}(\{\hat{\gamma}_{\mathbf{v},s}\}) \prod_{e \in E_{\mathcal{T}}} \mathcal{D}(v_{s(e)t(e)}, \mathbf{y}) \right] \Phi_{\mathcal{T}}^E(\mathbf{x}) \bigg|_{\mathbf{y}=\mathbf{x}}, \quad (3.6) $$

where, as usual, $\mathbf{x}$ is a vector with components $x_i^a = \sqrt{2\tau_2} \kappa_i^{ab} q_{i,b}$. This relation generalizes the one in (2.22) to finite $\tau_2$. Comparing to the original representation using the functions $\Phi_n^{\mathcal{E}}(\mathbf{x})$ (2.10), there are two changes: the functions $\mathcal{D}_m$ (see the comment below (2.14)) are replaced by $(2\tau_2)^m \mathcal{V}_m$, and the operators $\mathcal{D}(\mathbf{v})$ are replaced by $\mathcal{D}(\mathbf{v}, \mathbf{y})$. The proof of this statement is completely analogous to the proof of Proposition 5 in [9] where instead of ([9], eq. (F.20)) one should use the identity (A.17) and make the replacement

$$ \prod_{e \in E_{\mathcal{T}}} (v_{s(e)t(e)}, \mathbf{x}) \operatorname{sgn}(v_e, \mathbf{x}) \rightarrow \left[ \prod_{e \in E_{\mathcal{T}}} \mathcal{D}(v_{s(e)t(e)}, \mathbf{y}) \right] \Phi_{\mathcal{T}}^{E}(\mathbf{x}) \bigg|_{\mathbf{y}=\mathbf{x}}. \quad (3.7) $$
<figure><img src="image_7.png" /><figcaption>**Figure 4.** Combination of two Schröder trees ensuring the cancellation of contributions generated by marked trees.</figcaption></figure>

The second step is essentially identical to the proof of Proposition 10 in [9]. Namely, let us consider the original representation of $R_n$ (2.6) and pick up the contribution generated by a non-trivial marked tree $\mathcal{T}$, i.e. a tree having more than one vertex and at least one mark, which appears in the sum over marked unrooted trees producing the factor assigned to a vertex $v$ of a Schröder tree $T$. We denote $k = n_v$ the number of children of the vertex $v \in V_T$ and $\gamma_i$ ($i = 1, \dots, k$) their charges. Let us focus on a vertex $v \in V_T$ with $m_v > 0$ marks and take $\gamma_s$ ($s = 1, \dots, 2m_v + 1$) to be the charges labelling this vertex, so that its weight to our contribution, due to (2.22) and (3.6), is given by $\mathcal{V}_{m_v}(\{\hat{\gamma}_s\})$. Note that $k \ge 2m_v + 2$ because the tree $\mathcal{T}$ has at least one additional vertex except $v$. Then it is easy to see that the contribution we described is exactly cancelled by the contribution coming from another Schröder tree, which is obtained from $T$ by adding an edge connecting the vertex $v$ to a new vertex $v'$, whose children are the $2m_v + 1$ children of $v$ in $T$ carrying charges $\gamma_s$ (see figure 4).<fnref n="8" /> Indeed, choosing in the sum over marked trees at vertex $v$ a tree $\mathcal{T}$ which is the same as before except that now it has 0 marks at vertex $v$, and in the sum at vertex $v'$ the trivial tree having one vertex and $m_v$ marks, one gets exactly the same contribution as before, but now with an opposite sign due to the presence of an additional vertex in the Schröder tree. Thus, all contributions from non-trivial marked trees are cancelled.

As a result, we remain only with the contributions generated by trivial marked trees, i.e. having only one vertex and $m_v$ marks. One has to distinguish two cases: either the corresponding vertex $v$ of the Schröder tree is the root or not. In the former case, this contribution is trivially cancelled in the difference $\mathcal{E}_{v_0} - \mathcal{E}_{v_0}^{(0)} = \mathcal{E}_{v_0}^{(+)}$ assigned to $v_0$ in (2.6). In the latter case, there are again two possibilities: whether the vertex $v$ of the unrooted tree $\mathcal{T}$ assigned to the parent of $v$, which carries the charge $\gamma_v$, has marks or not. If not, this is precisely the contribution used above to cancel the contributions from non-trivial marked trees. If $m_v > 0$, then $\mathcal{T}$ must be a trivial marked tree because the contributions corresponding to non-trivial ones have already been cancelled. But then we can apply the

<footnote n="8">⁸The new tree is of Schröder type because its vertex $v$ has $k - 2m_v \ge 2$ children and vertex $v'$ has $2m_v + 1 \ge 3$ children.</footnote>
same argument to this parent vertex. As a result, we continue in this way up to the root, but we already know that its weight $\mathcal{E}_{v_0}^{(+)}$ does not contain the contributions of trivial marked trees. Thus, all contributions generated by unrooted trees in (2.22) and (3.6) with at least one mark cancel and we arrive at the formula (3.1).

## 4 Conclusions

The main result of this paper is a simplified expression for the modular completion of generating series $h_{p,\mu}(\tau)$ of D4-D2-D0 BPS indices which are identical to rank 0 DT invariants of a CY threefold. This completion, which determines the modular anomaly of $h_{p,\mu}(\tau)$, is characterized by functions $R_n(\{\tilde{\gamma}_i\}, \tau_2)$ given by a sum over Schröder trees $T_n^S$. Before simplifications the weights $\mathcal{E}_n$ assigned to vertices of these trees were given themselves by a sum over marked unrooted labelled trees $T_{n,m}^\ell$, with the weights assigned to the marks also given by a sum over unrooted labelled trees $T_n^\ell$. After the simplification we remained only with a single sum over $T_n^\ell$, i.e. all contributions of marks have been cancelled, which significantly simplifies the final expression and makes it much easier to perform formal manipulations with the anomaly.

The equations determining the simplified completion are (2.2), (3.1), (3.3) and (3.4). Sometimes it is convenient to split the sum over reduced charges $\tilde{\gamma}_i$ appearing in (2.2) into sums over their magnetic and electric components, and to move the symmetrization over charges and the sign factor, appearing in (3.1) together with the sum over Schröder trees, to the sum over electric charges. Therefore, we give here an alternative version of the expression for the modular completion:

$$ \hat{h}_{p,\mu}(\tau) = h_{r,\mu}(\tau) + \sum_{n=2}^{n_{\max}} \sum_{\sum_{i=1}^n p_i=p} \sum_{\{\mu_i\}} R_{\mu,\{\mu_i\}}^{(\{p_i\})}(\tau, \bar{\tau}) \prod_{i=1}^n h_{p_i,\mu_i}(\tau), \quad (4.1) $$

where

$$ R_{\mu, \{\mu_i\}}^{(\{p_i\})}(\tau, \bar{\tau}) = \sum_{\sum_{i=1}^n q_i = \mu + \frac{1}{2}p} \mathrm{Sym} \left\{ (-1)^{\sum_{i<j} \gamma_{ij}} \mathcal{R}_n(\{\tilde{\gamma}_i\}; \tau_2) e^{\pi i \tau Q_n(\{\tilde{\gamma}_i\})} \right\} \quad (4.2) $$

and

$$ \mathcal{R}_n(\{\tilde{\gamma}_i\}; \tau_2) = \frac{1}{2^{n-1}} \sum_{T \in \mathcal{T}_n^S} (-1)^{n_T - 1} \mathcal{E}_{v_0}^{(+)} \prod_{v \in V_T \setminus \{v_0\}} \mathcal{E}_v^{(0)}. \quad (4.3) $$

Besides, we have found that the previous results on the large $\tau_2$ limit of the functions determining the weights assigned to vertices of Schröder trees in (4.3) must be corrected as they were missing contributions from certain degenerate charge configurations. The correct limit can be found in (2.25) and is given in terms of rational coefficients $e_\tau$ assigned to unrooted trees. Although we formulated it as a conjecture, we have verified it analytically for $n \le 5$ and also did some numerical tests for $n = 7$. For this purpose, we have derived new interesting identities between the generalized error functions, which are the main building blocks of our construction (see section A.2). It appears that all these non-trivial identities are consequences of a single identity (A.12).
These results are of direct interest for any attempt to find explicit expressions of the generating functions $h_{p,\mu}$, especially when magnetic charges are not small, so that the depth of mock modularity is not 0 or 1, and one cannot rely on generating functions of *refined* invariants, as is the case of *compact* CY threefolds where the precise mathematical definition of refined DT invariants remains obscure. In such cases we face the problem of solving the modular anomaly satisfied by $h_{p,\mu}$ and any its simplification might be important for this crucial step.

Finally, understanding the structure of the anomaly is important also for understanding the origin of the modularity from the pure mathematical point of view. While in string theory it comes from S-duality of type IIB string theory, only recently there was an advance in proving it for some simplest CYs and for the simplest case of unit magnetic charge [28] where there is no any modular anomaly (see also [29] for some recent discussion). It is an exciting challenge to reveal, without referring to the physics of string theory, why more general rank 0 DT invariants possess mock modular properties.

## Acknowledgments

The authors are grateful to the Abdus Salam International Centre for Theoretical Physics and the Galileo Galilei Institute for Theoretical Physics for the hospitality as well as the INFN for partial support during the completion of this work.

## A Generalized error functions

The generalized error functions have been introduced in [30, 31] (see also [32]). They are defined by

$$E_n(\mathcal{M}; \mathbf{u}) = \int_{\mathbb{R}^n} du' e^{-\pi \sum_{i=1}^n (u_i - u_i')^2} \operatorname{sgn}(\mathcal{M}^{\mathrm{tr}} \mathbf{u}'), \quad (A.1)$$

where $\mathbf{u} = (u_1, \dots, u_n)$ is $n$-dimensional vector, $\mathcal{M}$ is $n \times n$ matrix of parameters,<fnref n="9" /> and we used the shorthand notation $\operatorname{sgn}(\mathbf{u}) = \prod_{i=1}^n \operatorname{sgn}(u_i)$. They generalize the usual error function because at $n = 1$ one has $E_1(\mathbf{u}) = \operatorname{Erf}(\sqrt{\pi} \mathbf{u})$. Their main role is to provide modular completions of indefinite theta series with quadratic form of an indefinite signature.

To get kernels of indefinite theta series, we need however functions depending on a $d$ dimensional vector with $d \ge n$, rather than $n$-dimensional one, where $d$ plays the role of the dimension of a lattice and can be arbitrarily large. To define such functions, let $\mathbb{R}^d$ be endowed with a bilinear form $\mathbf{x} \cdot \mathbf{y}$ of signature $(n_+, n_-)$. Then for any<fnref n="10" /> $n \le n_+$ we take $\mathcal{V}$ to be a $d \times n$ matrix which can be viewed as a collection of $n$ vectors, $\mathcal{V} = (\mathbf{v}_1, \dots, \mathbf{v}_n)$, assumed to span a positive definite subspace in $\mathbb{R}^d$, i.e. $\mathcal{V}^{\mathrm{tr}} \cdot \mathcal{V}$ must be positive definite. We also introduce a $n \times d$ matrix $\mathcal{B}$ whose rows define an orthonormal basis for this subspace. Then we define a boosted version of generalized error functions

$$\Phi_n^E(\mathcal{V}; \mathbf{x}) = E_n(\mathcal{B} \cdot \mathcal{V}; \mathcal{B} \cdot \mathbf{x}). \quad (A.2)$$

<footnote n="9">⁹The information carried by $\mathcal{M}$ is in fact highly redundant. For example, for $n = 1$ the dependence on $\mathcal{M}$ drops out, whereas $E_2$ and $E_3$ depend only on 1 and 3 parameters, respectively.</footnote>

<footnote n="10">¹⁰In the conventions used to define the generalized error functions [30, 31] and which we follow here, the quadratic form appears in theta series with an additional minus, $e^{-\pi i \tau Q(k)}$, so the standard convergent theta series correspond to the negative definite signature $(0, d)$.</footnote>
The detailed properties of these functions can be found in [31]. Most importantly, they do not depend on $\mathcal{B}$, at generic<fnref n="11" /> large $x$ reduce to $\prod_{i=1}^n \operatorname{sgn}(v_i \cdot x)$, are odd/even for odd/even $n$,

$$ \Phi_n^E(\mathcal{V}; -\mathbf{x}) = (-1)^n \Phi_n^E(\mathcal{V}; \mathbf{x}), \qquad (A.3) $$

and annihilated by the Vignéras operator

$$ V_0 \cdot \Phi_n^E(\mathcal{V}; \mathbf{x}) = 0, \qquad V_\lambda = \partial_x^2 + 2\pi (\mathbf{x} \cdot \partial_x - \lambda). \qquad (A.4) $$

The latter property ensures that any linear combination of the boosted generalized error functions belonging to $L^2(\mathbb{R}^d)$ gives rise to an indefinite theta series which transforms as a modular form [33]. Thus, to construct a completion of a holomorphic theta series with a kernel given by a linear combination of products of sign functions, it is sufficient to replace each of these products, which all have the form $\prod_{i=1}^n \operatorname{sgn}(v_i \cdot x)$ with some vectors $v_i$, by $\Phi_n^E(\{v_i\}; \mathbf{x})$ [30].

An important role is played also by the operator

$$ \mathcal{D}(\mathbf{v}) = \mathbf{v} \cdot \left( \mathbf{x} + \frac{1}{2\pi} \partial_x \right). \qquad (A.5) $$

It commutes with the Vignéras operator in the following sense

$$ \mathcal{D}(\mathbf{v})V_\lambda = V_{\lambda+1}\mathcal{D}(\mathbf{v}), \qquad (A.6) $$

and thus it allows to construct new modular theta series. In particular, one can act by such operators on the generalized error functions and the result will still define an indefinite theta series transforming as a modular form.

## A.1 The limit of large argument

Here we provide a precise result on the large $x$ limit of the generalized error functions:

**Proposition 2.**

$$ \lim_{\lambda \to \infty} \Phi_n^E(\{v_i\}; \lambda \mathbf{x}) = \sum_{\mathcal{J} \subseteq \mathcal{Z}_n} \Phi_{|\mathcal{J}|}^E(\{v_k\}_{k \in \mathcal{J}}; 0) \prod_{k \in \mathcal{J}} \delta_{v_k \cdot \mathbf{x}} \prod_{i \in \mathcal{Z}_n \setminus \mathcal{J}} \operatorname{sgn}(v_i \cdot \mathbf{x}), \qquad (A.7) $$

where $\mathcal{Z}_n = \{1, \dots, n\}$ and $|\mathcal{J}|$ is the cardinality of the set.

*Proof.* First, we note that one can always choose the matrix $\mathcal{B}$ in the definition (A.2) as $\mathcal{B} = X^{-1/2}\mathcal{V}^{\mathrm{tr}}$ where $X = \mathcal{V}^{\mathrm{tr}} \cdot \mathcal{V}$ is a symmetric positive definite matrix and hence has a well defined square root. Substituting this into (A.2) and (A.1), one obtains

$$ \begin{aligned} \Phi_n^E(\mathcal{V}; \mathbf{x}) &= \int_{\mathbb{R}^n} du' e^{-\pi \left(X^{-\frac{1}{2}} \mathcal{V}^{\mathrm{tr}} x - u' \right)^{\mathrm{tr}} \left(X^{-\frac{1}{2}} \mathcal{V}^{\mathrm{tr}} x - u' \right)} \operatorname{sgn}\left(X^{\frac{1}{2}} u'\right) \qquad (A.8) \\ &= (\det X)^{-1/2} \int_{\mathbb{R}^n} du e^{-\pi \left(\mathcal{V}^{\mathrm{tr}} x - u\right)^{\mathrm{tr}} X^{-1} \left(\mathcal{V}^{\mathrm{tr}} x - u\right)} \operatorname{sgn}(u), \end{aligned} $$

where at the second step we have done the change of the integration variables $u' = X^{-\frac{1}{2}}u$.

<footnote n="11">¹¹This specification is important because, as discussed below in § A.1, if the limit is taken in the direction where one or several scalar products $v_i \cdot x$ vanish, the result is more subtle.</footnote>
Then let $\mathcal{J} \subseteq \mathcal{Z}_n$ be a subset such that $\mathbf{v}_i \cdot \mathbf{x} = 0$ for $i \in \mathcal{J}$ and does not vanish otherwise. We can always reorder the indices such that $\mathcal{J} = \mathcal{Z}_{|\mathcal{J}|}$. We will label this set by $a, b, \dots$, while the remaining indices will be labelled by $\alpha, \beta, \dots$. Accordingly, we can represent the matrix $X$ and its inverse in a block diagonal form

$$X = \begin{pmatrix} A & B \\ B^{\mathrm{tr}} & C \end{pmatrix}, \qquad X^{-1} = \begin{pmatrix} A^{-1} + A^{-1}BD^{-1}B^{\mathrm{tr}}A^{-1} & -A^{-1}BD^{-1} \\ -D^{-1}B^{\mathrm{tr}}A^{-1} & D^{-1} \end{pmatrix}, \qquad (A.9)$$

where $A_{ab} = \mathbf{v}_a \cdot \mathbf{v}_b$, $B_{a\alpha} = \mathbf{v}_a \cdot \mathbf{v}_{\alpha}$, $C_{\alpha\beta} = \mathbf{v}_{\alpha} \cdot \mathbf{v}_{\beta}$ and $D = C - B^{\mathrm{tr}}A^{-1}B$. Using this decomposition in (A.8), one obtains

$$\Phi_n^E(\mathcal{V}; \lambda \mathbf{x}) = (\det X)^{-1/2} \int_{\mathbb{R}^{|\mathcal{J}|}} \prod_a du_a e^{-\pi \sum_{a,b} (A^{-1})_{ab} u_a u_b} \prod_a \operatorname{sgn}(u_a) \times \int_{\mathbb{R}^{n-|\mathcal{J}|}} \prod_\alpha dw_\alpha e^{-\pi \sum_{\alpha,\beta} (D^{-1})_{\alpha\beta} (w-B^{\mathrm{tr}}A^{-1}u)_\alpha (w-B^{\mathrm{tr}}A^{-1}u)_\beta} \prod_\alpha \operatorname{sgn}(w_\alpha + \lambda \mathbf{v}_\alpha \cdot \mathbf{x}), \qquad (A.10)$$

where $w_\alpha = u_\alpha - \lambda \mathbf{v}_\alpha \cdot \mathbf{x}$. For large $\lambda$ the last factor given by the product of sign functions can be approximated by 1. As a result, the integral over $w_\alpha$ becomes Gaussian. Taking also into account that $\det X = \det A \det D$, one finds that

$$\lim_{\lambda \to \infty} \Phi_n^E (\{\mathbf{v}_i\}; \lambda \mathbf{x}) = (\det A)^{-1/2} \prod_{\alpha} \operatorname{sgn}(\mathbf{v}_{\alpha} \cdot \mathbf{x}) \int_{\mathbb{R}^{|\mathcal{J}|}} \prod_a du_a e^{-\pi \sum_{a,b=1} (A^{-1})_{ab} u_a u_b} \\ = \Phi_{|\mathcal{J}|}^E (\{\mathbf{v}_a\}; 0) \prod_{\alpha} \operatorname{sgn}(\mathbf{v}_{\alpha} \cdot \mathbf{x}). \qquad (A.11)$$

Combining together all possible cases corresponding to different subsets $\mathcal{J}$, we arrive at the statement of the Proposition. $\square$

## A.2 Identities

The generalized error functions satisfy an important identity, which generalizes the one given in ([9], eq. (D.13)):

**Proposition 3.**

$$\Phi_n^E (\{\mathbf{v}_i + \delta_{i,n} \mathbf{v}_{n-1}\}; \mathbf{x}) + \Phi_n^E (\{\mathbf{v}_i + \delta_{i,n-1} \mathbf{v}_n\}; \mathbf{x}) - \Phi_n^E (\{\mathbf{v}_i\}; \mathbf{x}) = \Phi_{n-2}^E (\{\mathbf{v}_i\}; \mathbf{x}), \quad (A.12)$$

where for $n=2$ on the r.h.s. we set by definition $\Phi_0^E = 1$.

*Proof.* Let us choose an orthonormal basis $\{\mathbf{b}_i\}$ in the positive definite subspace of $\mathbb{R}^d$ such that $\mathrm{Span}(\mathbf{b}_1, \dots, \mathbf{b}_k) = \mathrm{Span}(\mathbf{v}_1, \dots, \mathbf{v}_k)$ for all $k=1, \dots, n$. This is possible due to the assumption that $n$ vectors $\mathbf{v}_i$ span the same positive definite subspace as $\mathbf{b}_i$. Then, by construction, $\mathbf{v}_i \cdot \mathbf{b}_j = 0$ for $j > i$. Taking this property into account, identifying $\mathbf{b}_i$ with the rows of the matrix $\mathcal{B}$, and applying the definitions (A.2) and (A.1) to the l.h.s. of (A.12), one obtains the following expression

$$\int_{\mathbb{R}^n} du' e^{-\pi \sum_{i=1}^n (\mathbf{b}_i \cdot \mathbf{x} - u_i')^2} \prod_{i=1}^{n-2} \operatorname{sgn} \left( \mathbf{v}_i \cdot \sum_{j=1}^i \mathbf{b}_j u_j' \right) \times \left[ (\operatorname{sgn}(\mathbf{v}_{n-1} \cdot \mathbf{u}')} + \operatorname{sgn}(\mathbf{v}_n \cdot \mathbf{u}')} \right] \operatorname{sgn}((\mathbf{v}_{n-1} + \mathbf{v}_n) \cdot \mathbf{u}') - \operatorname{sgn}(\mathbf{v}_{n-1} \cdot \mathbf{u}') \operatorname{sgn}(\mathbf{v}_n \cdot \mathbf{u}') \qquad (A.13)$$
where we denoted $\boldsymbol{u}' = \sum_{j=1}^{n} \boldsymbol{b}_j u'_j$. Due to the sign identity

$$ (\operatorname{sgn}(x_1) + \operatorname{sgn}(x_2)) \operatorname{sgn}(x_1 + x_2) - \operatorname{sgn}(x_1) \operatorname{sgn}(x_2) = 1 - \delta_{x_1, x_2}, \quad (\text{A.14}) $$

which is valid with the convention $\operatorname{sgn}(0) = 0$, the square bracket can be replaced by 1 because the term with Kronecker symbols is a measure zero contribution. In the resulting integral, the integrations over $u'_{n-1}$ and $u'_n$ factorize and produce Gaussian integrals both equal to 1. Thus, we remain with

$$ \int_{\mathbb{R}^{n-2}} du' e^{-\pi \sum_{i=1}^{n-2} (b_i \cdot x - u'_i)^2} \prod_{i=1}^{n-2} \operatorname{sgn} \left( v_i \cdot \sum_{j=1}^{i} b_j u'_j \right) = \Phi_{n-2}^{E}(\{v_i\}; x), \quad (\text{A.15}) $$

which proves the Proposition. $\square$

In the case where the vectors $v_i$ correspond to the vectors $v_e$ (2.8) defined with respect to an unrooted labelled tree, the identity (A.12) has a nice geometric interpretation. Let us define generalized error functions labelled by such trees

$$ \Phi_{\mathcal{T}}^{E}(\boldsymbol{x}) = \Phi_{|\mathcal{E}_{\mathcal{T}}|}^{E}(\{\boldsymbol{v}_{e}\}; \boldsymbol{x}). \quad (\text{A.16}) $$

Then it is easy to see that the identity (A.12) implies<fnref n="12" />

$$ \Phi_{\hat{\mathcal{T}}_1}^{E}(\boldsymbol{x}) + \Phi_{\hat{\mathcal{T}}_2}^{E}(\boldsymbol{x}) - \Phi_{\hat{\mathcal{T}}_3}^{E}(\boldsymbol{x}) = -\Phi_{\mathcal{T}}^{E}(\boldsymbol{x}), \quad (\text{A.17}) $$

where the trees $\mathcal{T}$ and $\hat{\mathcal{T}}$, $r = 1, 2, 3$, are shown in figure 2.

It is instructive to make the identity (A.17) explicit for trees with 3 and 5 vertices. The resulting identities will then be used in appendix C. To write them, we denote different trees by $\mathcal{T}_{n,k}$ where $n$ is the number of vertices, while $k$ labels different topologies as in figure 5. Different assignments of charges will be denoted by permutations of the standard labelling shown in the same figure, and we will use notation $\Phi_{\mathcal{T}_{n,k}}^{(i_1 \cdots i_n)}$ for the generalized error function evaluated on tree $\mathcal{T}_{n,k}$ where the first vertex of the standard labelling carries charge $\tilde{\gamma}_{i_1}$, etc. If a vertex carries a sum of charges, it will be labelled by the sum of their indices, like $(i_1 + \cdots + i_\ell)$. $S_n$ and $C_n$ will denote the groups of arbitrary and cyclic permutations, respectively, of $n$ labels. To label their elements, we will use the result of their action on the standard labelling: $\sigma = (\sigma(1) \cdots \sigma(n))$. Finally, $\sigma_{ij}$ will denote a permutation of labels $i$ and $j$, and $\iota$ is the inversion $(1 \cdots n) \mapsto (n \cdots 1)$. We emphasize that in our conventions the inversion and cyclic permutations act on labels, not on their positions. For instance, $\iota(213) = (231)$ and $C_3 \ni \tau : (213) \mapsto (132)$.

With these notations, at $n = 3$ (A.17) generates a single identity which states that the sum over cyclic permutations of the labels on $\mathcal{T}_{3,1}$ is equal to 1,

$$ \Phi_{\mathcal{T}_{3,1}}^{(123)} + \Phi_{\mathcal{T}_{3,1}}^{(312)} + \Phi_{\mathcal{T}_{3,1}}^{(231)} = 1. \quad (\text{A.18}) $$

<footnote n="12">¹²The minus sign on the r.h.s. of (2.21) appears as follows. First, note that the vectors $v_e$ defined by the trees $\hat{\mathcal{T}}_r$ satisfy $v_{e_1}^{(1)} = v_{e_1}^{(3)} - v_{e_3}^{(3)}$, $v_{e_2}^{(1)} = v_{e_3}^{(3)}$, $v_{e_2}^{(2)} = v_{e_1}^{(3)}$ and $v_{e_3}^{(2)} = v_{e_3}^{(3)} - v_{e_1}^{(3)}$, where the upper index indicates the tree with respect to which the vector is defined. Comparing to (A.12), one can identity $v_{n-1} = v_{e_3}^{(3)}$ and $v_n = -v_{e_1}^{(3)}$, but then all terms on the l.h.s. of (A.12) and (A.17) have opposite signs.</footnote>
<figure><img src="image_8.png" /><figcaption>Figure 5. Standard labelling of unrooted trees with 3 and 5 vertices.</figcaption></figure>

At $n = 5$ one obtains already several possibilities which arise from different choices for the trees $\mathcal{T}_r$ in figure 2. Up to permutations, one has three possibilities: 1) $\mathcal{T}_1$ coincides with $\mathcal{T}_{3,1}$ and $\mathfrak{v}_1$ coincides with the third vertex of $\mathcal{T}_{3,1}$, while $\mathcal{T}_2 = \mathcal{T}_3 = \bullet$ are trivial; 2) $\mathcal{T}_1$ coincides with $\mathcal{T}_{3,1}$ and $\mathfrak{v}_1$ coincides with the second (middle) vertex of $\mathcal{T}_{3,1}$, while $\mathcal{T}_2 = \mathcal{T}_3 = \bullet$; 3) $\mathcal{T}_1$ and $\mathcal{T}_2$ coincide with the single tree consisting of two vertices, $\mathcal{T}_{2,1} = \bullet \bullet$, while $\mathcal{T}_3 = \bullet$. The corresponding identities can be written as

$$ \Phi_{\mathcal{T}_{5,1}}^{(12345)} + \Phi_{\mathcal{T}_{5,1}}^{(12354)} - \Phi_{\mathcal{T}_{5,2}}^{(12345)} = \Phi_{\mathcal{T}_{3,1}}^{(12(3+4+5))}, \quad (A.19a) $$

$$ \Phi_{\mathcal{T}_{5,3}}^{(12345)} - \Phi_{\mathcal{T}_{5,2}}^{(45321)} - \Phi_{\mathcal{T}_{5,2}}^{(54321)} = \Phi_{\mathcal{T}_{3,1}}^{(1(3+4+5)2)}, \quad (A.19b) $$

$$ \Phi_{\mathcal{T}_{5,1}}^{(23451)} + \Phi_{\mathcal{T}_{5,2}}^{(23541)} + \Phi_{\mathcal{T}_{5,2}}^{(15342)} = \Phi_{\mathcal{T}_{3,1}}^{(1(3+4+5)2)}. \quad (A.19c) $$

To each of these identities one can apply a permutation of indices. The order of the permutation group $S_5$ is 120. But since, due to symmetries of the trees, the first identity is invariant under permutation $\sigma_{45}$, the second under $\sigma_{12}$ and $\sigma_{45}$, and the third under $\sigma_{12}\sigma_{35}$, permutations generate 60, 30 and 60 identities, respectively. One can check that among these 150 identities only 100 are mutually independent.

Of particular interest are identities that do not involve generalized error functions of lower ranks. There are two ways to obtain them from (A.19). The most obvious one is to apply any permutation on labels (345), which leaves the r.h.s. invariant, and take a difference. In this way we get

$$ \begin{aligned} \Phi_{\mathcal{T}_{5,1}}^{(12345)} + \Phi_{\mathcal{T}_{5,1}}^{(12354)} - \Phi_{\mathcal{T}_{5,2}}^{(12345)} &= \Phi_{\mathcal{T}_{5,1}}^{(12435)} + \Phi_{\mathcal{T}_{5,1}}^{(12453)} - \Phi_{\mathcal{T}_{5,2}}^{(12435)} \\ &= \Phi_{\mathcal{T}_{5,1}}^{(12543)} + \Phi_{\mathcal{T}_{5,1}}^{(12534)} - \Phi_{\mathcal{T}_{5,2}}^{(12543)}, \end{aligned} \quad (A.20a) $$

$$ \begin{aligned} \Phi_{\mathcal{T}_{5,3}}^{(12345)} - \Phi_{\mathcal{T}_{5,2}}^{(45321)} - \Phi_{\mathcal{T}_{5,2}}^{(54321)} &= \Phi_{\mathcal{T}_{5,3}}^{(12435)} - \Phi_{\mathcal{T}_{5,2}}^{(35421)} - \Phi_{\mathcal{T}_{5,2}}^{(53421)} \\ &= \Phi_{\mathcal{T}_{5,3}}^{(12543)} - \Phi_{\mathcal{T}_{5,2}}^{(43521)} - \Phi_{\mathcal{T}_{5,2}}^{(34521)} \end{aligned} \quad (A.20b) $$

$$ = \Phi_{\mathcal{T}_{5,1}}^{(23451)} + \Phi_{\mathcal{T}_{5,2}}^{(23541)} + \Phi_{\mathcal{T}_{5,2}}^{(15342)} = \Phi_{\mathcal{T}_{5,1}}^{(24351)} + \Phi_{\mathcal{T}_{5,2}}^{(24531)} + \Phi_{\mathcal{T}_{5,2}}^{(15432)} \quad (A.20b) $$

$$ = \Phi_{\mathcal{T}_{5,1}}^{(25431)} + \Phi_{\mathcal{T}_{5,2}}^{(25341)} + \Phi_{\mathcal{T}_{5,2}}^{(13542)} = \Phi_{\mathcal{T}_{5,1}}^{(23541)} + \Phi_{\mathcal{T}_{5,2}}^{(23451)} + \Phi_{\mathcal{T}_{5,2}}^{(14352)} $$

$$ = \Phi_{\mathcal{T}_{5,1}}^{(24531)} + \Phi_{\mathcal{T}_{5,2}}^{(24351)} + \Phi_{\mathcal{T}_{5,2}}^{(13452)} = \Phi_{\mathcal{T}_{5,1}}^{(25341)} + \Phi_{\mathcal{T}_{5,2}}^{(25431)} + \Phi_{\mathcal{T}_{5,2}}^{(14532)}. $$

The second way is to sum 3 identities (A.19) such that on the r.h.s. one can apply (A.18). There are many ways to write the resulting identity which are all equivalent due to (A.20).
For example, we have

$$ \Phi_{\tau_{5,1}}^{(12345)} + \Phi_{\tau_{5,1}}^{(12354)} + \Phi_{\tau_{5,1}}^{(21543)} + \Phi_{\tau_{5,1}}^{(21534)} - \Phi_{\tau_{5,2}}^{(12345)} \\ - \Phi_{\tau_{5,2}}^{(21543)} - \Phi_{\tau_{5,2}}^{(45321)} - \Phi_{\tau_{5,2}}^{(54321)} + \Phi_{\tau_{5,3}}^{(12345)} = 1. \qquad (A.21) $$

Of course, to each of the identities (A.20), (A.21) one can also apply an arbitrary permutation. As a result, there are in total 81 independent identities.

Once the full set of identities is identified, it is possible to show that they have a linear combination that is a direct generalization of (A.18):

$$ \sum_{\tau \in C_5} \Phi_{\tau_{5,1}}^{\tau} = 1, \qquad (A.22) $$

where the sum goes over cyclic permutations applied to the labelling (12345). This suggests that a similar identity holds for any odd $n$, namely, that the cyclic permutations of the tree of linear topology $\mathcal{T}_{n,1} = \bullet-\bullet-\cdots-\bullet-\bullet$ with odd number of vertices always sum to one,

$$ \sum_{\tau \in C_n} \Phi_{\tau_{n,1}}^{\tau} = 1, \quad \text{for odd } n. \qquad (A.23) $$

We did not attempt to prove this identity analytically, but we have done extensive numerical checks of (A.23) and all above identities.

## B Coefficients $a_{\tau}$ and $e_{\tau}$

<table><thead><tr><th>Name</th><th>Tree</th><th>a<sub>τ</sub></th><th>e<sub>τ</sub></th></tr></thead><tbody><tr><td>T<sub>1,1</sub></td><td>•</td><td>1</td><td>1</td></tr><tr><td>T<sub>3,1</sub></td><td>•—•—•—•</td><td>-1/3</td><td>1/3</td></tr><tr><td>T<sub>5,1</sub></td><td>•—•—•—•—•</td><td>2/15</td><td>1/5</td></tr><tr><td>T<sub>5,2</sub></td><td>•—•—•—•—•—•</td><td>-1/15</td><td>1/15</td></tr><tr><td>T<sub>5,3</sub></td><td>•—•—•—•—•—•—•</td><td>1/5</td><td>7/15</td></tr><tr><td>T<sub>7,1</sub></td><td>•—•—•—•—•—•—•—•</td><td>-17/315</td><td>1/7</td></tr><tr><td>T<sub>7,2</sub></td><td>•—•—•—•—•—•—•—•</td><td>8/315</td><td>3/35</td></tr><tr><td>T<sub>7,3</sub></td><td>•—•—•—•—•—•—•—•</td><td>-1/35</td><td>1/35</td></tr><tr><td>T<sub>7,4</sub></td><td>•—•—•—•—•—•—•—•</td><td>8/105</td><td>-1/7</td></tr></tbody></table>

<table><thead><tr><th>Name</th><th>Tree</th><th>a<sub>τ</sub></th><th>e<sub>τ</sub></th></tr></thead><tbody><tr><td>T<sub>7,5</sub></td><td>•—•—•—•—•—•—•—•</td><td>-1/105</td><td>-13/105</td></tr><tr><td>T<sub>7,6</sub></td><td>•—•—•—•—•—•—•—•</td><td>-1/63</td><td>11/105</td></tr><tr><td>T<sub>7,7</sub></td><td>•—•—•—•—•—•—•—•</td><td>-1/35</td><td>-53/105</td></tr><tr><td>T<sub>7,8</sub></td><td>•—•—•—•—•—•—•—•</td><td>1/7</td><td>-31/21</td></tr><tr><td>T<sub>7,9</sub></td><td>•—•—•—•—•—•—•—•</td><td>-2/35</td><td>-1/105</td></tr><tr><td>T<sub>7,10</sub></td><td>•—•—•—•—•—•—•—•</td><td>-1/21</td><td>19/105</td></tr><tr><td>T<sub>7,11</sub></td><td>•—•—•—•—•—•—•—•</td><td>2/105</td><td>-23/105</td></tr></tbody></table>
**Proof of the identity (2.36).** To prove the identity (2.36), we will rely on a similar identity satisfied by the coefficients $a_T$ [9]:

$$a_{\hat{T}_1} + a_{\hat{T}_2} - a_{\hat{T}_3} = a_{T_1} a_{T_2} a_{T_3}, \qquad (B.1)$$

where the trees $T_r$ and $\hat{T}_r$ are drawn in figure 2. We will proceed by induction.

At $n=3$ there is a single identity of the form (2.36) corresponding to the trivial trees $T_r$ consisting of one vertex. Then it is easy to check that the identity holds for the values given in the above table. (One should take into account that under a flip of the orientation of an edge, the coefficient flips the sign.)

Then let us assume that the identity (2.36) holds for all trees $\hat{T}_r$ with $n' < n$ vertices. To treat the case of $n$ vertices, we use the formula (2.35) in the l.h.s. of (2.36) to get

$$- \sum_{\cup \mathcal{T}'_k \simeq \hat{T}_1} e_{\hat{T}_1/\{\mathcal{T}'_k\}} \prod_{k=1}^{m} a_{\mathcal{T}'_k} - \sum_{\cup \mathcal{T}'_k \simeq \hat{T}_2} e_{\hat{T}_2/\{\mathcal{T}'_k\}} \prod_{k=1}^{m} a_{\mathcal{T}'_k} + \sum_{\cup \mathcal{T}'_k \simeq \hat{T}_3} e_{\hat{T}_3/\{\mathcal{T}'_k\}} \prod_{k=1}^{m} a_{\mathcal{T}'_k}, \qquad (B.2)$$

where we recall that in each decomposition there should be at least one non-trivial tree (having more than one vertex). For each tree $\hat{T}_r$, its decomposition can be of three types:

1. both edges $e_i$ belong to one of the trees of the decomposition;

2. only one of the two edges $e_i$ belongs to a tree of the decomposition;

3. neither of the edges $e_i$ belongs to the decomposition trees.

We will show below that the contributions of type 2 cancel each other, the contributions of type 3 are canceled by contributions of type 1, while the remaining contributions of type 1 give exactly $-e_T$.

We start with the type 2 contributions and consider a decomposition $\cup \mathcal{T}'_k$ of $\hat{T}_1$ such that $e_2 \subset \mathcal{T}'_k$. It is clear that $\mathcal{T}'_k \subset \mathcal{T}_1 \cup e_2 \mathcal{T}_3$, i.e. it is a subtree of the tree formed by $\mathcal{T}_1$ and $\mathcal{T}_3$ joint by $e_2$, while all other trees $\mathcal{T}'_k, k \neq k_0$, are subtrees of $\mathcal{T}_1, \mathcal{T}_2$ or $\mathcal{T}_3$. This implies that the same set of subtrees provides a decomposition of $\hat{T}_2$. Extracting the contribution of these two decompositions from (B.2), one finds

$$- \left( e_{\hat{T}_1/\{\mathcal{T}'_k\}} + e_{\hat{T}_2/\{\mathcal{T}'_k\}} \right) \prod_{k=1}^{m} a_{\mathcal{T}'_k}. \qquad (B.3)$$

After collapsing all subtrees $\mathcal{T}'_k$, the edge $e_2$ disappears, while $e_1 \subset \hat{T}_1$ and $e_3 \subset \hat{T}_2$ remain. But now they connect the same vertices and differ only by orientation. Therefore, $e_{\hat{T}_1/\{\mathcal{T}'_k\}} = -e_{\hat{T}_2/\{\mathcal{T}'_k\}}$ and the combination (B.3) vanishes. In exactly the same way one can show the vanishing of all other type 2 contributions.

Next we consider a type 3 decomposition. In this case each subtree $\mathcal{T}'_k$ also belongs to one of the trees $\mathcal{T}_s$. Therefore, we can split them into 3 subsets $\{\mathcal{T}'_{s,l}\}$ such that $\cup_l \mathcal{T}'_{s,l} \simeq \mathcal{T}_s$. It is also clear that $\cup_{s,l} \mathcal{T}'_{s,l} \simeq \hat{T}_r$ for all $r$. Therefore, the contribution of such decomposition into (B.2) is given by

$$- \left( e_{\hat{T}_1/\{\mathcal{T}'_{s,l}\}} + e_{\hat{T}_2/\{\mathcal{T}'_{s,l}\}} - e_{\hat{T}_3/\{\mathcal{T}'_{s,l}\}} \right) \prod_{s=1}^{3} \prod_{l=1}^{m_s} a_{\mathcal{T}'_{s,l}}. \qquad (B.4)$$
The crucial observation is that the trees $\hat{T}_r/\{\mathcal{T}'_{s,l}\}$ are constructed from the three trees $\mathcal{T}_s/\{\mathcal{T}'_{s,l}\}$ exactly as in figure 2. Since the number of their vertices is less than $n$ (because at least one of $\mathcal{T}'_{s,l}$ must be non-trivial), they are subject to the induction hypothesis and the contribution (B.4) is equal to

$$e_{\mathcal{T}/\{\mathcal{T}'_{s,l}\}} \prod_{s=1}^{3} \prod_{l=1}^{m_s} a_{\mathcal{T}'_{s,l}}. \qquad (B.5)$$

Let us now construct a type 1 decomposition that is associated with the type 3 decomposition $\{\mathcal{T}'_{s,l}\}$ just analyzed. Denote $l_s$ the index such that $v_s \in \mathcal{T}'_{s,l_s}$. Using the three trees $\mathcal{T}'_{s,l_s}$ in place of $\mathcal{T}_s$, one can construct the three trees $\hat{T}'_r = \cup_{e_i} \mathcal{T}'_{s,l_s}$ as in figure 2. Then $\{\hat{T}'_r, \mathcal{T}'_{s,l}\}_{s,l \neq l_s}$ provide decompositions of $\hat{T}_r$ of type 1. Their contribution to (B.2) is given by

$$-e_{\mathcal{T}'/\{\mathcal{T}'_{s,l}\}}_{s,l \neq l_s} (a_{\hat{T}'_1} + a_{\hat{T}'_2} - a_{\hat{T}'_3}) \prod_{s=1}^{3} \prod_{l \neq l_s} a_{\mathcal{T}'_{s,l}}, \qquad (B.6)$$

where $\mathcal{T}' = \hat{T}_r/\hat{T}'_r$ is independent of $r$. Furthermore, $\mathcal{T}' = \mathcal{T}/\{\mathcal{T}'_{s,l_s}\}$ so that the $e$-coefficients in (B.5) and (B.6) coincide. On the other hand, applying (B.1) to the expression in brackets in (B.6) one gets the missing factor $\prod_{s=1}^3 a_{\mathcal{T}'_{s,l_s}}$. As a result, the two contributions (B.5) and (B.6) cancel each other.

However, for each $\hat{T}_r$ there is one type 1 decomposition that was not accounted for by the above construction. It consists of a single non-trivial tree obtained by joining the two edges $e_i$ and a set of trivial subtrees, i.e. given by a single vertex. Such a decomposition can be obtained from a type 3 decomposition where all $\{\mathcal{T}'_{s,l}\}$ are trivial, but as we know, it is excluded from the sum in (B.2). Thus, we remain with the following contribution

$$-e_{\mathcal{T}}(a_{(e_1,e_2)} + a_{(e_2,e_3)} - a_{(e_1,e_3)}) = -e_{\mathcal{T}}\left(\frac{1}{3} + \frac{1}{3} + \frac{1}{3}\right) = -e_{\mathcal{T}}, \qquad (B.7)$$

which completes the proof.

## C Irrational vs. rational coefficients

In this appendix we verify Conjecture 1 for a few low values of $n$. We will extensively use notations $e_{\mathcal{T}_{n,k}}^{(i_1 \dots i_n)} = \Phi_{\mathcal{T}_{n,k}}^{(i_1 \dots i_n)}(0)$ and $\kappa_{\mathcal{T}_{n,k}}^{(i_1 \dots i_n)}$, similar to the ones introduced in § A.2. See also the paragraph above (A.18) for our conventions on permutations acting on labels of these objects.

The first non-trivial case happens at $n=3$. The function (2.23) then reads

$$\mathcal{E}_3^{(0)} = \frac{1}{6} \sum_{\text{cyclic perm.}} \gamma_{12}\gamma_{23} \left( \operatorname{sgn}(\gamma_{1,2+3}) \operatorname{sgn}(\gamma_{1+2,3}) + \delta_{123} \mathcal{E}_{3,1}^{(123)} \right), \qquad (C.1)$$

where we denoted $\delta_{123} = \delta_{\gamma_{1,2+3}}\delta_{\gamma_{1+2,3}}$, while $\mathcal{T}_{3,1}$ is the single unrooted tree with 3 vertices as shown in the table of appendix B. It is easy to check that $\gamma_{12}\gamma_{23}\delta_{123}$ is invariant under cyclic permutations. Therefore, one can apply the identity (2.27), which in this case is a specification of (A.18) to $x=0$ and allows to replace the coefficients $e_{\mathcal{T}_{3,1}}$ by $1/3$. This
results in the representation (2.25) with $e_{\mathcal{T}_{3,1}} = 1/3$ in agreement with the Conjecture and the value given in appendix B.

For $n = 4$ the calculation is almost the same as at this order there are no new non-trivial coefficients $e_{\mathcal{T}}$. In this case it is enough to consider the contribution to $\mathcal{E}_4^{(0)}$ where two of three $\Gamma_e$'s vanish. One can show that it is given by

$$ \frac{1}{4 \cdot 4!} \sum_{\text{perm.}} \left[ \delta_{12(3+4)} \gamma_{34} \operatorname{sgn}(\gamma_{1+2+3,4}) \sum_{\substack{\text{cyclic perm.} \\ \text{of } 1,2,3+4}} \gamma_{12} \gamma_{2,3+4} e_{\mathcal{T}_{3,1}}^{(12(3+4))} \right]. \quad (C.2) $$

The second sum is the same as in (C.1) so that the coefficients $e_{\mathcal{T}_{3,1}}$ can again be replaced by $1/3$ consistently with the Conjecture.

For $n = 5$ there are three types of trees contributing to (2.23) and shown in figure 5. It is convenient to rewrite the sum over different labellings of each tree as a sum over all permutations of labels divided by the symmetry factor of the tree:

$$ \mathcal{E}_5^{(0)} = \frac{1}{5!} \sum_{\sigma \in S_5} \sigma \left[ \frac{1}{2} \kappa_{\mathcal{T}_{5,1}} S_{\mathcal{T}_{5,1}} + \frac{1}{2} \kappa_{\mathcal{T}_{5,2}} S_{\mathcal{T}_{5,2}} + \frac{1}{24} \kappa_{\mathcal{T}_{5,3}} S_{\mathcal{T}_{5,3}} \right]. \quad (C.3) $$

Then to prove the Conjecture, we need to consider two cases where each tree has either two or all four edges with vanishing $\Gamma_e$. (For an odd number of vanishing $\Gamma_e$'s the corresponding coefficients $e_{\mathcal{T}}$ vanish and there is nothing to prove.) We will start with the first case which is simpler and goes along the same lines as for $n = 3$ and $4$.

The contribution to $S_{\mathcal{T}_{5,k}}$ corresponding to two vanishing $\Gamma_e$'s can be written as

$$ \sum_{e_1, e_2 \in E_{\mathcal{T}_{5,k}}} e_{\mathcal{T}_{\{e_1, e_2\}}} \delta_{\Gamma_{e_1}} \delta_{\Gamma_{e_2}} \operatorname{sgn}(\Gamma_{e_1'}) \operatorname{sgn}(\Gamma_{e_2'}), \quad (C.4) $$

where $\{e_1', e_2'\} = E_{\mathcal{T}} \setminus \{e_1, e_2\}$ and $\mathcal{T}_{\{e_1, e_2\}}$ is the tree obtained from $\mathcal{T}_{5,k}$ by contracting the edges $e_1'$ and $e_2'$, which topologically always coincides with $\mathcal{T}_{3,1}$. Then using permutations and the conditions implied by the Kronecker symbols, one can show that in the corresponding contribution to (C.3) all terms can be made proportional just to the following two combinations

$$ \begin{aligned} \Delta_1^{(12345)} &= \delta_{\gamma_{1,2+3+4+5}} \delta_{\gamma_{2,1+3+4+5}} \operatorname{sgn}(\gamma_{3,1+2+4+5}) \operatorname{sgn}(\gamma_{5,1+2+3+4}), \\ \Delta_2^{(12345)} &= \delta_{\gamma_{1+2+3,4+5}} \delta_{\gamma_{1,2+3+4+5}} \operatorname{sgn}(\gamma_{2,1+3+4+5}) \operatorname{sgn}(\gamma_{5,1+2+3+4}). \end{aligned} \quad (C.5) $$

The resulting expression reads

$$ \begin{aligned} & -\frac{1}{2 \cdot 5!} \sum_{\sigma \in S_5} \sigma \left[ \Delta_1^{(12345)} \left( \left( \kappa_{\mathcal{T}_{5,1}}^{(12345)} + \kappa_{\mathcal{T}_{5,1}}^{(34521)} - \kappa_{\mathcal{T}_{5,2}}^{(12435)} \right) e_{\mathcal{T}_{3,1}}^{(12(3+4+5))} \right. \\ & \qquad \left. + \left( \kappa_{\mathcal{T}_{5,1}}^{(15432)} + \kappa_{\mathcal{T}_{5,2}}^{(15432)} + \kappa_{\mathcal{T}_{5,2}}^{(13425)} - \kappa_{\mathcal{T}_{5,2}}^{(54321)} + \kappa_{\mathcal{T}_{5,3}}^{(12435)} \right) e_{\mathcal{T}_{3,1}}^{(1(3+4+5)2)} \right) \\ & \qquad + \Delta_2^{(12345)} \left( 2 \left( \kappa_{\mathcal{T}_{5,1}}^{(12345)} + \kappa_{\mathcal{T}_{5,2}}^{(54321)} \right) e_{\mathcal{T}_{3,1}}^{1(2+3)(4+5)} + \kappa_{\mathcal{T}_{5,1}}^{(23145)} e_{\mathcal{T}_{3,1}}^{(2+3)1(4+5)} \right) \end{aligned} \quad (C.6) $$

Note that the factors (C.5) possess the following symmetry properties: $\Delta_1^{(12345)}$ is invariant under permutations $\sigma_{12}$ and $\sigma_{35}$, while $\Delta_2^{(12345)}$ is antisymmetric under $\sigma_{23}$ and $\sigma_{45}$. Using these properties again together with the conditions implied by the Kronecker symbols, one
can recombine the factors of Dirac products of charges defined in (2.17) to rewrite (C.6) in the following form

$$ -\frac{1}{4 \cdot 5!} \sum_{\sigma \in S_5} \sigma \left[ \left( \Delta_1^{(12345)} \gamma_{12}^2 \gamma_{34} \gamma_{45} \left( e_{\tau_{3,1}}^{(12(3+4+5))} + e_{\tau_{3,1}}^{(1(3+4+5)2)} + e_{\tau_{3,1}}^{((3+4+5)12)} \right) + \frac{1}{2} \Delta_2^{(12345)} \gamma_{1,4+5}^2 \gamma_{23} \gamma_{45} \left( e_{\tau_{3,1}}^{1(2+3)(4+5)} + e_{\tau_{3,1}}^{(2+3)1(4+5)} + e_{\tau_{3,1}}^{(2+3)(4+5)1} \right) \right] \quad (C.7) $$

This allows to apply the identity (2.27) and replace the coefficients $e_{\tau_{3,1}}$ by $1/3$, as required by the Conjecture.

The second case to be analyzed is where all edges have vanishing $\Gamma_e$. Then $S_{\tau_{5,k}}$, defined in (2.19), reduces to $e_{\tau_{5,k}} \delta_{12345}$ where $\delta_{12345} = \prod_{e \in E_{\tau_{5,k}}} \delta_e$ and, due to proposition 1, it is independent both of the topology of the tree (labelled by $k$) and of its labelling. Thus, the corresponding contribution to (C.3) is given by

$$ \frac{1}{2 \cdot 5!} \delta_{12345} \sum_{\sigma \in S_5} \sigma \left[ \kappa_{\tau_{5,1}} e_{\tau_{5,1}} + \kappa_{\tau_{5,2}} e_{\tau_{5,2}} + \frac{1}{12} \kappa_{\tau_{5,3}} e_{\tau_{5,3}} \right] \quad (C.8) $$

The idea, which allows to prove the Conjecture, i.e. to replace all $e_{\tau_{5,k}}$ by some rational numbers, is to recombine these coefficients so that one could apply identities similar to the cyclic identity that was used above. To this end, we use the fact that, given the conditions implied by the Kronecker symbols, the factors $\kappa_{\tau_{5,k}}$ also satisfy numerous relations. We apply them to reduce the number of appearing structures and this will automatically produce the combinations of $e_{\tau_{5,k}}$ subject to the mentioned identities.

We start by noticing the following two relations

$$ \kappa_{\tau_{5,3}}^{(12345)} + \kappa_{\tau_{5,2}}^{(12345)} + \kappa_{\tau_{5,2}}^{(14352)} + \kappa_{\tau_{5,2}}^{(15324)} \stackrel{\delta}{=} 0, \quad (C.9a) $$

$$ \kappa_{\tau_{5,1}}^{(12345)} - \kappa_{\tau_{5,1}}^{(51234)} - \kappa_{\tau_{5,2}}^{(43215)} + \kappa_{\tau_{5,2}}^{(12345)} \stackrel{\delta}{=} 0, \quad (C.9b) $$

where the sign $\stackrel{\delta}{=}^*$ indicates that they hold in the presence of $\delta_{12345}$. The first one can be used in (C.8) to exclude $\kappa_{\tau_{5,3}}$. Moreover, since the permutations appearing in the last three terms in (C.9a) leave $e_{\tau_{5,3}}^{(12345)}$ invariant, we have

$$ \frac{1}{12} \sum_{\sigma \in S_5} \sigma \left[ \kappa_{\tau_{5,3}} e_{\tau_{5,3}} \right] \stackrel{\delta}{=} -\frac{1}{4} \sum_{\sigma \in S_5} \sigma \left[ \kappa_{\tau_{5,2}} e_{\tau_{5,3}} \right] \quad (C.10) $$

The second relation (C.9b) is used to produce a sum over cyclic permutations of $e_{\tau_{5,1}}$. Applying it four times on $\kappa_{\tau_{5,1}}^{(12345)}$ and its cyclic permutations, one finds

$$ \kappa_{\tau_{5,1}}^{(12345)} = \frac{1}{5} \sum_{\tau \in C_5} \tau \left[ \kappa_{\tau_{5,1}}^{(12345)} \right] - \frac{1}{5} \left[ 2\kappa_{\tau_{5,2}}^{(12345)} + 2\kappa_{\tau_{5,2}}^{(54321)} + \kappa_{\tau_{5,2}}^{(51234)} + \kappa_{\tau_{5,2}}^{(15432)} - \kappa_{\tau_{5,2}}^{(34512)} - \kappa_{\tau_{5,2}}^{(32154)} - 2\kappa_{\tau_{5,2}}^{(23451)} - 2\kappa_{\tau_{5,2}}^{(43215)} \right] \quad (C.11) $$

Substituting (C.10) and (C.11) into (C.8) and shifting the sum over permutations so that to bring the labels of each factor $\kappa_{\tau_{5,k}}$ to the standard form (12345), one obtains

$$ \frac{1}{2 \cdot 5!} \delta_{12345} \sum_{\sigma \in S_5} \sigma \left[ \frac{1}{5} \kappa_{\tau_{5,1}} \sum_{\tau \in C_5} e_{5,1}^{\tau} + \kappa_{\tau_{5,2}} \check{e}_{5,2} \right] \quad (C.12) $$
where we denoted

$$ \check{e}_{\mathcal{T}_{5,2}} = e_{\mathcal{T}_{5,2}}^{(12345)} - \frac{1}{4} e_{\mathcal{T}_{5,3}}^{(12345)} + \frac{2}{5} \left( 2e_{\mathcal{T}_{5,1}}^{(51234)} + e_{\mathcal{T}_{5,1}}^{(45123)} - 2e_{\mathcal{T}_{5,1}}^{(12345)} - e_{\mathcal{T}_{5,1}}^{(23451)} \right) \quad (C.13) $$

and used the fact that $e_{\mathcal{T}_{5,1}}^{(12345)} = e_{\mathcal{T}_{5,1}}^{(54321)}$. The advantage of (C.12) is that the coefficients $e_{\mathcal{T}_{5,1}}$ appear in the combination that is subject to the identity (2.27), which for $n = 5$ is (A.22) evaluated at $x = 0$. This implies that all $e_{\mathcal{T}_{5,1}}$ can be replaced by $e_{\mathcal{T}_{5,1}} = 1/5$, in agreement with the value given in the table of appendix B.

Thus, it remains to analyze only the last term in (C.12). As a first step, we apply the symmetry of $\kappa_{\mathcal{T}_{5,2}}^{(12345)}$ under permutation $\sigma_{45}$ to rewrite this term as

$$ \sum_{\sigma \in S_5} \sigma[\kappa_{\mathcal{T}_{5,2}} \check{e}_{\mathcal{T}_{5,2}}] = -\frac{1}{20} \sum_{\sigma \in S_5} \kappa_{\mathcal{T}_{5,2}}^{\sigma} + C_{5,2}, \quad C_{5,2} = \sum_{\sigma \in S_5} \sigma[\kappa_{\mathcal{T}_{5,2}} \hat{e}_{\mathcal{T}_{5,2}}] \quad (C.14) $$

where

$$ \hat{e}_{\mathcal{T}_{5,2}} = \frac{1}{2} \left( \check{e}_{\mathcal{T}_{5,2}}^{(12354)} + \check{e}_{\mathcal{T}_{5,2}}^{(12354)} \right) + \frac{1}{20}. \quad (C.15) $$

Here we subtracted $e_{\mathcal{T}_{5,2}} - \frac{1}{4}e_{\mathcal{T}_{5,3}} = -\frac{1}{20}$, which is the rational number expected to replace $\check{e}_{\mathcal{T}_{5,2}}$ according to appendix B, so that now we need to prove that the contribution $\delta_{12345}C_{5,2}$ actually vanishes. This would complete the proof of the Conjecture at $n = 5$.

Let us return to the identity (C.9a). From the symmetry of the tree $\mathcal{T}_{5,3}$ it follows that the first term is invariant under any permutation of labels (1245). This fact can be used to derive relations that involve only $\mathcal{T}_{5,2}$:

$$ \begin{aligned} \kappa_{\mathcal{T}_{5,2}}^{(12345)} + \kappa_{\mathcal{T}_{5,2}}^{(14352)} + \kappa_{\mathcal{T}_{5,2}}^{(15324)} &\stackrel{\delta}{=} \kappa_{\mathcal{T}_{5,2}}^{(21345)} + \kappa_{\mathcal{T}_{5,2}}^{(24351)} + \kappa_{\mathcal{T}_{5,2}}^{(25314)} \\ &\stackrel{\delta}{=} \kappa_{\mathcal{T}_{5,2}}^{(42315)} + \kappa_{\mathcal{T}_{5,2}}^{(41352)} + \kappa_{\mathcal{T}_{5,2}}^{(45321)} \\ &\stackrel{\delta}{=} \kappa_{\mathcal{T}_{5,2}}^{(52314)} + \kappa_{\mathcal{T}_{5,2}}^{(51342)} + \kappa_{\mathcal{T}_{5,2}}^{(54321)}. \end{aligned} \quad (C.16) $$

Then we split the coefficient of $\kappa_{\mathcal{T}_{5,2}}$ as $1 = \frac{3}{4} + \frac{1}{12} + \frac{1}{12} + \frac{1}{12}$, leave the first term intact and apply the three relations (C.16) to the last three terms. Substituting the resulting expression in $C_{5,2}$ and, as before, shifting the sum over permutations so that to bring the labels of each factor $\kappa_{\mathcal{T}_{5,2}}$ to the standard form (12345), one obtains

$$ C_{5,2} \stackrel{\delta}{=} \sum_{\sigma \in S_5} \sigma[\kappa_{\mathcal{T}_{5,2}} \check{e}_{\mathcal{T}_{5,2}}], \quad (C.17) $$

where

$$ \begin{aligned} \check{e}_{\mathcal{T}_{5,2}} = \frac{3}{4} \hat{e}_{\mathcal{T}_{5,2}}^{(12345)} - \frac{1}{4} (\hat{e}_{\mathcal{T}_{5,2}}^{(14325)} + \hat{e}_{\mathcal{T}_{5,2}}^{(15324)}) + \frac{1}{12} \left( \sum_{\tau \in C_3(124)} \tau [\hat{e}_{\mathcal{T}_{5,2}}^{(51324)}] \right. \\ \left. + \sum_{\tau \in C_3(145)} \tau [\hat{e}_{\mathcal{T}_{5,2}}^{(21345)}] + \sum_{\tau \in C_3(125)} \tau [\hat{e}_{\mathcal{T}_{5,2}}^{(41325)}] \right), \end{aligned} \quad (C.18) $$

where $C_3(ijk)$ is the group of cyclic permutations of the labels $i, j, k$. Although the new coefficients $\check{e}_{\mathcal{T}_{5,2}}$ have complicated expressions in terms of the original ones $e_{\mathcal{T}_{5,k}}$, they turn
out to satisfy a very simple identity, which can be shown to be a linear combination of the identities (A.20), (A.21) at $x = 0$,

$$ \sum_{\tau \in C_5} \tau \circ (1 + i) [\hat{e}_{\tau_5, 2}] = 0, \qquad (C.19) $$

where $i$ is the inversion of labelling introduced in section A.2.

Unfortunately, the identity (C.19) is not sufficient to show the vanishing of $C_{5,2}$. Nevertheless, it suggests a strategy to do this. Let us denote $O_A$, $A = 1, \dots, 12$, the orbits of the group $C_5 \cup i$ inside $S_5$ (defined by its action from the right). Let $\sigma_A$ be a representative of $O_A$, which we take to be the permutation labelled by $(i_1i_23i_4i_5)$ with 1 either on the first or second position. We order the orbits according to the natural ordering of the representatives (see (C.27)). It is clear also that $O_A$ splits into two orbits of $C_5$: $O_A^+ = \{\sigma_A \circ \tau, \tau \in C_5\}$ and $O_A^- = O_A^+ \circ i$.<fnref n="13" /> With these notations, the identity (C.19) implies 12 equalities

$$ s_A^+ = -s_A^-, \qquad s_A^\pm = \sum_{\tau \in O_A^\pm} \hat{e}_{\tau_5, 2}^\tau. \qquad (C.20) $$

Next, we note that, upon summing over cyclic permutations of the relation (C.9b), all terms $\kappa_{\tau_{5,1}}$ vanish and one gets a relation very similar to (C.19):

$$ \sum_{\tau \in C_5} \tau \circ (1 - i) [\kappa_{\tau_5, 2}] \stackrel{\delta}{=} 0. \qquad (C.21) $$

Of course, we can also write it as in (C.20), but instead we will first use the symmetry of $\kappa_{\tau_{5,2}}$ under $\sigma_{45}$. Then we get the following 12 relations

$$ \mathcal{K}_A \equiv k_A^+ - k_A^- \stackrel{\delta}{=} 0, \qquad k_A^\pm = \frac{1}{2} \sum_{\sigma \in O_A^\pm} \tau \circ (1 + \sigma_{45}) [\kappa_{\tau_5, 2}]. \qquad (C.22) $$

Let us subtract them all from (C.17) after multiplication by some coefficients $c_A$ to be determined later. In other words, we consider

$$ C_{2,5} \stackrel{\delta}{=} \sum_{\sigma \in S_5} \sigma [\kappa_{\tau_{5,2}} \hat{e}_{\tau_{5,2}}] - \sum_{A=1}^{12} c_A \mathcal{K}_A = \sum_{\sigma \in S_5} \sigma [\kappa_{\tau_{5,2}} \hat{e}_{\tau_{5,2}}], \qquad (C.23) $$

where at the last step we introduced new coefficients $\hat{e}_{\tau_{5,2}}$. One can realize that they can be written as

$$ \hat{e}_{\tau_{5,2}}^\sigma = \hat{e}_{\tau_{5,2}}^\sigma - \frac{1}{2} (\epsilon(\sigma)c_{A(\sigma)} + \epsilon(\sigma \circ \sigma_{45})c_{A(\sigma \circ \sigma_{45})}), \qquad (C.24) $$

where $A(\sigma)$ is the label of the orbit to which $\sigma$ belongs and $\epsilon(\sigma) = \pm 1$ if it is $O_A^\pm$, respectively.

To fix the coefficients $c_A$ we impose the condition that the cyclic averages of $\hat{e}_{\tau_{5,2}}$, similar to the ones introduced in (C.20), identically vanish. From (C.24), it is easy to see that

$$ \sum_{\tau \in O_A^\pm} \hat{e}_{\tau_{5,2}}^\tau = s_A^\pm \mp \frac{1}{2} \sum_{B=1}^{12} M_{AB} c_B, \qquad M_{AB} = 5\delta_{AB} + m_{AB}, \qquad (C.25) $$

<footnote n="13">¹³Note that for $\tau \in C_5$ one has $\iota \circ \tau = \tau^{-1} \circ \iota$.</footnote>
where

$$m_{AB} = \epsilon \left( (\mathcal{O}_A^+ \circ \sigma_{45}) \cap \mathcal{O}_B \right) \qquad (C.26)$$

and the $\epsilon$-function is defined to be 0 if the intersection is empty.<fnref n="14" /> With the ordering of orbits specified above, the matrix $m_{AB}$ is given by

$$ \begin{array}{c} A \qquad \sigma_A \\ \hline 1 : \quad (12345) \\ 2 : \quad (12354) \\ 3 : \quad (14325) \\ 4 : \quad (14352) \\ 5 : \quad (15324) \\ 6 : \quad (15342) \\ 7 : \quad (21345) \\ 8 : \quad (21354) \\ 9 : \quad (41325) \\ 10 : \quad (41352) \\ 11 : \quad (51324) \\ 12 : \quad (51342) \end{array} \qquad m = \begin{pmatrix} 0 & 1 & -1 & 0 & 0 & -1 & 1 & 0 & 0 & 0 & 1 & 0 \\ 1 & 0 & 0 & -1 & -1 & 0 & 0 & 1 & 1 & 0 & 0 & 0 \\ -1 & 0 & 0 & 1 & -1 & 0 & 0 & 0 & 1 & 0 & 0 & 1 \\ 0 & -1 & 1 & 0 & 0 & -1 & 1 & 0 & 0 & 1 & 0 & 0 \\ 0 & -1 & -1 & 0 & 0 & 1 & 0 & 0 & 0 & 1 & 1 & 0 \\ -1 & 0 & 0 & -1 & 1 & 0 & 0 & 1 & 0 & 0 & 0 & 1 \\ 1 & 0 & 0 & 1 & 0 & 0 & 0 & 1 & -1 & 0 & 0 & 1 \\ 0 & 1 & 0 & 0 & 0 & 1 & 1 & 0 & 0 & 1 & -1 & 0 \\ 0 & 1 & 1 & 0 & 0 & 0 & -1 & 0 & 0 & 1 & 1 & 0 \\ 0 & 0 & 0 & 1 & 1 & 0 & 0 & 1 & 1 & 0 & 0 & -1 \\ 1 & 0 & 0 & 0 & 1 & 0 & 0 & -1 & 1 & 0 & 0 & 1 \\ 0 & 0 & 1 & 0 & 0 & 1 & 1 & 0 & 0 & -1 & 1 & 0 \end{pmatrix}, \qquad (C.27) $$

Then one can show that $\mathcal{M}$ is an invertible matrix with

$$ \mathcal{M}_{AB}^{-1} = \frac{1}{20} (5\delta_{AB} - m_{AB}). \qquad (C.28) $$

Therefore, requiring the vanishing of (C.25) results in

$$ c_A = \pm \frac{1}{10} \sum_{B=1}^{12} (5\delta_{AB} - m_{AB}) s_B^{\pm}, \qquad (C.29) $$

The two solutions are mutually consistent due to the identities (C.20). Picking any of them, by means of (C.13), (C.15), (C.18) and (C.24), one gets an explicit expression of $\mathring{e}_{\tau_{5,2}}$ in terms of $e_{\tau_{5,k}}$. Then, using Mathematica, we found that the resulting expression is actually a linear combination of the identities (A.20) and (A.21) at $x = 0$ and thus vanishes, as required by the Conjecture.

Let us remark in the end that this derivation fixes only a linear combination of two coefficients: $e_{\tau_{5,2}} - \frac{1}{4}e_{\tau_{5,3}} = -\frac{1}{20}$. The ambiguity comes from the fact that, in the presence of $\delta_{12345}$, the factors $\kappa_{\tau_{5,k}}$ are not independent and satisfy various relations. It is conceivable that the ambiguity is resolved at higher orders. However, the calculations at higher $n$ become extremely cumbersome and we refrain from doing them. What is important is that the values predicted by the general solution (2.35) in the main text are consistent with the above constraint.

**Data Availability Statement.** This article has no associated data or the data will not be deposited.

<footnote n="14">¹⁴It is well defined because it is impossible to have non-empty intersection with both $\mathcal{O}_B^{\pm}$ at the same time.</footnote>
**Code Availability Statement.** This article has no associated code or the code will not be deposited.

**Open Access.** This article is distributed under the terms of the Creative Commons Attribution License (CC-BY4.0), which permits any use, distribution and reproduction in any medium, provided the original author(s) and source are credited.

## References

[1] A. Strominger and C. Vafa, *Microscopic origin of the Bekenstein-Hawking entropy*, Phys. Lett. B **379** (1996) 99 [hep-th/9601029] [INSPIRE].

[2] R. Dijkgraaf, E.P. Verlinde and H.L. Verlinde, *Counting dyons in $N = 4$ string theory*, Nucl. Phys. B **484** (1997) 543 [hep-th/9607026] [INSPIRE].

[3] J.M. Maldacena, A. Strominger and E. Witten, *Black hole entropy in $M$ theory*, JHEP **12** (1997) 002 [hep-th/9711053] [INSPIRE].

[4] A. Dabholkar, F. Denef, G.W. Moore and B. Pioline, *Precision counting of small black holes*, JHEP **10** (2005) 096 [hep-th/0507014] [INSPIRE].

[5] D. Gaiotto, A. Strominger and X. Yin, *The $M^5$-Brane Elliptic Genus: Modularity and BPS States*, JHEP **08** (2007) 070 [hep-th/0607010] [INSPIRE].

[6] A. Dabholkar, S. Murthy and D. Zagier, *Quantum Black Holes, Wall Crossing, and Mock Modular Forms*, arXiv:1208.4074 [INSPIRE].

[7] S. Zwegers, *Mock theta functions*, Ph.D. thesis, Utrecht University, Utrecht, the Netherlands (2002).

[8] D. Zagier, *Ramanujan's mock theta functions and their applications (after Zwegers and Ono-Bringmann)*, Séminaire Bourbaki **2007/2008** (2009) exposés 982 [Astérisque **326** (2009) 986].

[9] S. Alexandrov and B. Pioline, *Black holes and higher depth mock modular forms*, Commun. Math. Phys. **374** (2019) 549 [arXiv:1808.08479] [INSPIRE].

[10] S. Alexandrov, J. Manschot and B. Pioline, *$D_3$-instantons, Mock Theta Series and Twistors*, JHEP **04** (2013) 002 [arXiv:1207.1109] [INSPIRE].

[11] S. Alexandrov, S. Banerjee, J. Manschot and B. Pioline, *Multiple $D_3$-instantons and mock modular forms I*, Commun. Math. Phys. **353** (2017) 379 [arXiv:1605.05945] [INSPIRE].

[12] S. Alexandrov, S. Banerjee, J. Manschot and B. Pioline, *Multiple $D_3$-instantons and mock modular forms II*, Commun. Math. Phys. **359** (2018) 297 [arXiv:1702.05497] [INSPIRE].

[13] S. Alexandrov, J. Manschot and B. Pioline, *S-duality and refined BPS indices*, Commun. Math. Phys. **380** (2020) 755 [arXiv:1910.03098] [INSPIRE].

[14] N.A. Nekrasov, *Seiberg-Witten prepotential from instanton counting*, Adv. Theor. Math. Phys. **7** (2003) 831 [hep-th/0206161] [INSPIRE].

[15] S. Alexandrov, *Vafa-Witten invariants from modular anomaly*, Commun. Num. Theor. Phys. **15** (2021) 149 [arXiv:2005.03680] [INSPIRE].

[16] S. Alexandrov, *Rank $N$ Vafa-Witten invariants, modularity and blow-up*, Adv. Theor. Math. Phys. **25** (2021) 275 [arXiv:2006.10074] [INSPIRE].
[17] J.A. Minahan, D. Nemeschansky, C. Vafa and N.P. Warner, *E strings and N = 4 topological Yang-Mills theories*, Nucl. Phys. B 527 (1998) 581 [hep-th/9802168] [INSPIRE].

[18] M. Alim et al., *Wall-crossing holomorphic anomaly and mock modularity of multiple M5-branes*, Commun. Math. Phys. 339 (2015) 773 [arXiv:1012.1608] [INSPIRE].

[19] A. Gholampour and A. Sheshmani, *Generalized Donaldson-Thomas invariants of 2-dimensional sheaves on local $P^2$, Adv. Theor. Math. Phys.* **19** (2015) 673 [arXiv:1309.0056] [INSPIRE].

[20] A. Gholampour, A. Sheshmani and S.-T. Yau, *Localized Donaldson-Thomas theory of surfaces*, Am. J. Math. **142** (2020) 405 [arXiv:1701.08902] [INSPIRE].

[21] S. Alexandrov and S. Nampuri, *Refinement and modularity of immortal dyons*, JHEP 01 (2021) 147 [arXiv:2009.01172] [INSPIRE].

[22] S. Alexandrov, S. Feyzbakhsh, A. Klemm and B. Pioline, *Quantum geometry and mock modularity*, arXiv:2312.12629 [INSPIRE].

[23] S. Alexandrov, N. Gaddam, J. Manschot and B. Pioline, *Modular bootstrap for D4-D2-D0 indices on compact Calabi-Yau threefolds*, Adv. Theor. Math. Phys. **27** (2023) 683 [arXiv:2204.02207] [INSPIRE].

[24] D. Gaiotto and X. Yin, *Examples of M5-Brane Elliptic Genera*, JHEP 11 (2007) 004 [hep-th/0702012] [INSPIRE].

[25] A. Collinucci and T. Wyder, *The Elliptic genus from split flows and Donaldson-Thomas invariants*, JHEP 05 (2010) 081 [arXiv:0810.4301] [INSPIRE].

[26] W. Van Herck and T. Wyder, *Black Hole Meiosis*, JHEP 04 (2010) 047 [arXiv:0909.0508] [INSPIRE].

[27] S. Alexandrov et al., *Quantum geometry, stability and modularity*, Commun. Num. Theor. Phys. **18** (2024) 49 [arXiv:2301.08066] [INSPIRE].

[28] V. Baranovsky, L. Katzarkov, M. Kontsevich and A. Sheshmani, *Shifted symplectic structures on derived Quot Schemes, Degenerations and Categorification of DT invariants*, talk by A. Sheshmani at the *International Congress of Basic Sciences, BIMSA*, Beijing, China (2024).

[29] S. Feyzbakhsh and R.P. Thomas, *Curve counting and S-duality*, EPIGA **7** (2023) 11306 [arXiv:2007.03037] [INSPIRE].

[30] S. Alexandrov, S. Banerjee, J. Manschot and B. Pioline, *Indefinite theta series and generalized error functions*, Selecta Math. **24** (2018) 3927 [arXiv:1606.05495] [INSPIRE].

[31] C. Nazaroglu, *r-Tuple Error Functions and Indefinite Theta Series of Higher-Depth*, Commun. Num. Theor. Phys. **12** (2018) 581 [arXiv:1609.01224] [INSPIRE].

[32] S. Kudla, *Theta integrals and generalized error functions*, Manuscripta Math. **155** (2018) 303.

[33] M.-F. Vignéras, *Séries thêta des formes quadratiques indéfinies*, Lect. Notes Math. **627** (1977) 227.