# Partitioned Cacti: a Bijective Approach to the Cycle Factorization Problem

Gilles Schaeffer and Ekaterina Vassilieva

LIX – Laboratoire d'Informatique de l' Ecole Polytechnique, 91128 Palaiseau Cedex, FRANCE

**Abstract.** In this paper we construct a bijection for partitioned 3-cacti that gives raise to a new formula for enumeration of factorizations of the long cycle into three permutations with given number of cycles.

**Résumé.** Dans cet article, nous construisons une bijection pour 3-cacti partitionnés faisant apparaître une nouvelle formule pour l’énumération des factorisations d’un long cycle en trois permutations ayant un nombre donné de cycles.

**Keywords:** cacti, permutations, cactus trees, Jackson formula, Harer-Zagier formula

## 1 Introduction

Although counting the number of factorizations of a long cycle $\gamma_N = (12...N)$ as a product of $m$ permutations, $\alpha_1, \alpha_2, ..., \alpha_m$ with a given number of cycles $n_1, n_2, ..., n_m$ is a classical issue in combinatorics, use of combinatorial methods to solve this enumeration problem is so far limited to very specific cases. Factorizations of the long cycle as a product of a permutations and a fixed point free involution have been enumerated by Harer and Zagier in [5]. A combinatorial proof of this formula was given for the first time very recently by Lass in [6]. In [3], Goulden and Nica developed another combinatorial proof relying on a direct bijection. The first combinatorial approach of the case involving two general permutations was developed by Goupil and Schaeffer in [4]. Subsequently, Schaeffer and Vassilieva used a bijective method in [8] to address the same issue. So far, no combinatorial methods were applied to address the general case involving $m$ factors. Besides the fundamental formula in the field was derived by Jackson in [2] by means of techniques involving characters of symmetric groups and leaves little room for combinatorial interpretation. In this paper, we generalize the bijective method of [8] to give insights on the $m$-factor case. For the sake of simplicity, we focus on the case $m = 3$, highlighting the new difficulties that didn’t occur in the previous considerations.

As a main ingredient for our construction we interpret factorizations of the long cycle into three permutations $\alpha_1, \alpha_2$ and $\alpha_3$ in terms of unicellular 3-constellations often called 3-cacti which are special cases of maps (see [1] and [7]). A map is a 2-cell decomposition of an oriented surface into a finite number of vertices (0-cells), edges (1-cells) and faces (2-cells) homeomorphic to open discs. A 3-cactus is a map with a number of black faces and one white face such that all the black faces are triangles and are not adjacent to each other. Our main result can be stated as follows:
**Theorem 1.1** The numbers $M(n_1, n_2, n_3, N)$ of factorizations of a long cycle $\gamma_N = (12...N)$ into three permutations with $n_1, n_2, n_3$ cycles verify:

$$ \sum_{n_1, n_2, n_3 \ge 1} \frac{M(n_1, n_2, n_3, N)}{N!^2} x_1^{n_1} x_2^{n_2} x_3^{n_3} = \sum_{p_1, p_2, p_3 \ge 1} \binom{x_1}{p_1} \binom{x_2}{p_2} \binom{x_3}{p_3} \times \binom{N-1}{p_3-1} \sum_{a \ge 0} \binom{N-p_2}{p_1-1-a} \binom{N-p_3}{a} \binom{N-1-a}{N-p_2} (1) $$

The goal of this paper is to give a bijective proof of the result stated above. In view of construction of the underlying bijection we need to introduce some notations: *partitioned 3-cacti* and *cactus trees*. In what follows, we note $P_n(A)$ the set of unordered subset of set A containing exactly n elements and $OP_n(A)$ the set of ordered subsets of set A containing exactly n elements.

# 2 Partitioned Cacti and Cactus Trees

## 2.1 Partitioned 3-Cacti

### Definition

Let $CC(p_1, p_2, p_3, N)$ be the set of 5-tuples $(\pi_1, \pi_2, \pi_3, \alpha_1, \alpha_2)$ such that $\pi_1, \pi_2$ and $\pi_3$ are partitions of $[N]$ into $p_1, p_2$ and $p_3$ blocks and $\alpha_1, \alpha_2$ are permutations of $\Sigma_N$ such that:

* each block of $\pi_1$ is the union of cycles of $\alpha_1$,

* each block of $\pi_2$ is the union of cycles of $\alpha_2$,

* each block of $\pi_3$ is the union of cycles of $\alpha_3 = \alpha_2^{-1} \circ \alpha_1^{-1} \circ \gamma_N$.

Any such 5-uple is called a *partitioned 3-cactus* with N triangles, $p_1$ white, $p_2$ black and $p_3$ grey blocks.

### Graphical Representation

This last definition becomes clear as a 5-uples $(\pi_1, \pi_2, \pi_3, \alpha_1, \alpha_2)$ corresponds to a 3-cactus with N triangles:

* the cycles of $\alpha_1$ describe the white vertices of the cactus,

* the cycles of $\alpha_2$ describe the black vertices,

* the cycles of $\alpha_3 = \alpha_2^{-1} \circ \alpha_1^{-1} \circ \gamma_N$ describe the grey vertices,

* $\pi_1$ partitions the white vertices into $p_1$ subsets,

* $\pi_2$ partitions the black vertices into $p_2$ subsets,

* $\pi_3$ partitions the grey vertices into $p_3$ subsets.

**Example 2.1** Figure (1) depicts the 5-tuple $(\pi_1, \pi_2, \pi_3, \alpha_1, \alpha_2) \in CC(2, 2, 2, 5)$ defined by
$\alpha_1 = (1)(24)(3)(5)$, $\alpha_2 = (1)(23)(45)$, $\alpha_3 = (15)(2)(3)(4)$, $\pi_1 = \{\pi_1^{(1)}, \pi_1^{(2)}\}$, $\pi_2 = \{\pi_2^{(1)}, \pi_2^{(2)}\}$,
$\pi_3 = \{\pi_3^{(1)}, \pi_3^{(2)}\}$ with:

$$ \pi_1^{(1)} = \{2, 4, 5\}, \quad \pi_1^{(2)} = \{1, 3\}, \quad \pi_2^{(1)} = \{1, 2, 3\}, \quad \pi_2^{(2)} = \{4, 5\}, \quad \pi_3^{(1)} = \{3\}, \quad \pi_3^{(2)} = \{1, 2, 4, 5\} $$

Similarly to [8], we associate a particular shape to each of the blocks of repartition.
<figure><img src="image_1.png" /><figcaption>Fig. 1: Example of a Partitioned 3-Cactus</figcaption></figure>

## Link with cacti

Partitioned 3-cacti and 3-cacti are linked through the following formula:

$$ |CC(p_1, p_2, p_3, N)| = \sum_{n_1 \ge p_1, n_2 \ge p_2, n_3 \ge p_3} S(n_1, p_1)S(n_2, p_2)S(n_3, p_3) |M(n_1, n_2, n_3, N)| \quad (2) $$

where $S(a, b)$, the Stirling number of the second kind, gives the number of partitions of a set of $a$ elements into $b$ nonempty, unordered sets. It follows:

$$ \sum_{n_1, n_2, n_3 \ge 1} |M(n_1, n_2, n_3, N)| |x_1^{n_1} x_2^{n_2} x_3^{n_3}| = \sum_{p_1, p_2, p_3 \ge 1} |CC(p_1, p_2, p_3, N)| |(x_1)_{p_1} (x_2)_{p_2} (x_3)_{p_3}| \quad (3) $$

with $(x)_l = x(x-1)(x-2)\dots(x-l+1)$.

In order to prove our main theorem, we now focus on a descriptive bijection of partitioned Cacti. First of all, we need to introduce some new objects.

## 2.2 Cactus Trees

A cactus embedded in the sphere (genus 0) is called a planar cactus or *cactus tree*. The bijective construction described in the following section partly relies on some particular 3-colored cactus trees with two kinds of polygons, triangles and usual edges. More specifically we consider the sets $CT(p_1, p_2, p_3, a, b, c)$ of rooted cactus trees with $p_1$ white vertices, $p_2$ black vertices, $p_3$ grey vertices, $a$ triangles rooted in a grey vertex, $b$ triangles rooted in a white vertex, $c$ triangles rooted in a black vertex such that:

* the root of the cactus tree is a white vertex

* a white vertex has black descendant vertices and/or descendant triangles rooted in this white vertex

* a black vertex has grey descendant vertices and/or descendant triangles rooted in this black vertex

* a grey vertex has white descendant vertices and/or descendant triangles rooted in this grey vertex

* triangles are composed of a white, a black and a grey vertex. Moving around triangles clockwise, these vertices are following each other in the white-black-grey-white cyclic order.

**Example 2.2** Figure (2) shows an example of a cactus tree of $CT(5, 4, 7, 1, 1, 2)$,
<figure><img src="image_2.png" /><figcaption>Fig. 2: Example of a Cactus-Tree</figcaption></figure>

**Lemma 2.3** The cardinality of the considered set of cactus trees is:

$$|CT(p_1, p_2, p_3, a, b, c)| = \frac{(a(b - p_3) + p_2p_3)}{p_1p_2p_3} \times \binom{p_1 + p_2 - 1 - a}{p_1 - 1, p_2 - a - b} \binom{p_2 + p_3 - 1 - b}{p_2 - 1, p_3 - b - c} \binom{p_1 + p_3 - 2 - c}{p_3 - 1, p_1 - 1 - a - c} \quad (4)$$

where

$$\binom{u}{v, w} = \frac{u!}{v!w!(u - v - w)!}$$

is a trinomial coefficient.

*Proof* – This result can be derived as a direct application of the Lagrange theorem for implicit functions.

## 3 A bijective description of partitioned cacti

In this section we construct a bijective mapping $\Theta_{N,p_1,p_2,p_3}$. Let $(\pi_1, \pi_2, \pi_3, \alpha_1, \alpha_2) \in CC(p_1, p_2, p_3, N)$ be a partitioned 3-cactus. Then we associate to it by $\Theta_{N,p_1,p_2,p_3}$ a 7-tuple $(\tau, S_0, S_1, S_2, \chi, \sigma_1, \sigma_2)$ composed of

* an ordered cactus tree $\tau \in CT(p_1, p_2, p_3, a, b, c)$ for a given triple $(a, b, c)$,

* unordered sets $S_0 \in P_{p_1-1+p_2-a}([N])$, $S_1 \in P_{p_1-1+p_3-1-c}([N-1])$, $S_2 \in P_{p_3+p_2-1-b}([N-1])$,

* an ordered set $\chi \in OP_{p_3-b-c}([N])$ such that $S_0 \cap \chi = \emptyset$

* and permutations $\sigma_1 \in \Sigma_{N-p_1+1-p_3+c}$, $\sigma_2 \in \Sigma_{N-p_2-p_3+b}$.

The remaining of the section is devoted to detailed description of these objects and of how each of them is obtained from initial partitioned 3-cactus.

**Cactus Tree** Let $\pi_1^{(1)}, \dots, \pi_1^{(p_1)}, \pi_2^{(1)}, \dots, \pi_2^{(p_2)}$ and $\pi_3^{(1)}, \dots, \pi_3^{(p_3)}$ be the blocks of the partitions $\pi_1, \pi_2$ and $\pi_3$ respectively, where the indexing of the blocks is subject only to the condition that $1 \in \pi_1^{(p_1)}$. Denote by $m_1^{(i)}$ the maximal element of the block $\pi_1^{(i)}$ ($1 \le i \le p_1$), by $m_2^{(j)}$ the maximal element of the set $\alpha_3^{-1}(\pi_2^{(j)})$ ($1 \le j \le p_2$) and by $m_3^{(k)}$ the maximal element of $\pi_3^{(k)}$ ($1 \le k \le p_3$). First we build the last passage 3-colored labeled tree $T$ with $p_1$ white, $p_2$ black and $p_3$ grey vertices verifying:
• the root of $T$ is white vertex $p_1$

• for $j = 1, \dots, p_2$, the black vertex $j$ is a descendant of the white vertex $i$ if

$$m_2^{(j)} = \max(\alpha_3^{-1} \circ \alpha_2^{-1}(\pi_2^{(j)})) \in \alpha_3^{-1} \circ \alpha_2^{-1}(\pi_1^{(i)})$$

• for $k = 1, \dots, p_3$, the grey vertex $k$ is a descendant of the black vertex $j$ if

$$m_3^{(k)} = \max(\alpha_3^{-1}(\pi_3^{(k)})) \in \alpha_3^{-1}(\pi_2^{(j)})$$

• for $i = 1, \dots, p_1 - 1$, the white vertex $i$ is a descendant of the grey vertex $k$ if

$$m_1^{(i)} \in \pi_3^{(k)}$$

• If two grey vertices $k_1$ and $k_2$ are both descendants of a black vertex $j$, then $k_1$ is to the left of $k_2$ when

$$\alpha_3^{-1} \circ \alpha_2^{-1} \circ \alpha_3(m_3^{(k_1)}) < \alpha_3^{-1} \circ \alpha_2^{-1} \circ \alpha_3(m_3^{(k_2)})$$

• if two black vertices $j_1, j_2$ are both descendants of a white vertex $i$, then $j_1$ is to the left of $j_2$ when

$$\alpha_2 \circ \alpha_3(m_2^{(j_1)}) < \alpha_2 \circ \alpha_3(m_2^{(j_2)})$$

• if two white vertices $i_1, i_2$ are both descendants of a grey vertex $k$, then $i_1$ is to the left of $i_2$ when

$$\alpha_3^{-1}(m_1^{(i_1)}) < \alpha_3^{-1}(m_1^{(i_2)})$$

One can prove that the labeled 3-colored tree $T$ is correctly defined. Remove the labels from $T$ to obtain the 3-colored ordered tree $t$. Next step is to construct the 3-colored cactus tree $\tau$. To that purpose we connect each vertex in $t$ with the rightmost descendant of its rightmost descendant if and only if these three vertices belong to the same triangle within the initial partitioned cactus (one can easily show that this condition can be verified only by the rightmost descendants). Following this construction we have:

• a triangle rooted in a grey vertex when :

$$\alpha_2 \circ \alpha_3(m_2^{(j)}) = m_1^{(i)} \qquad (5)$$

• a triangle rooted in a white vertex when :

$$\alpha_3^{-1} \circ \alpha_2^{-1} \circ \alpha_3(m_3^{(k)}) = m_2^{(j)} \qquad (6)$$

• a triangle rooted in a black vertex when :

$$\alpha_3^{-1}(m_1^{(i)}) = m_3^{(k)} \qquad (7)$$
**Example 3.1** Let us continue Example 2.1. Since $m_2^{(1)} = \max\{2, 3, 5\} = 5 \in \alpha_3^{-1} \circ \alpha_2^{-1}(\pi_1^{(2)}) = \{2, 5\}$, the black circle 1 is a descendant of the root triangle 2. As $m_3^{(1)} = 3 \in \alpha_3^{-1}(\pi_2^{(1)}) = \{2, 3, 5\}$ and $m_3^{(2)} = 5 \in \alpha_3^{-1}(\pi_2^{(1)}) = \{2, 3, 5\}$, the grey rhombus 1 and the grey square 2 are both descendants of the black circle 1. Moreover, since $\alpha_3^{-1} \circ \alpha_2^{-1} \circ \alpha_3(m_3^{(1)}) = 2 < \alpha_3^{-1} \circ \alpha_2^{-1} \circ \alpha_3(m_3^{(2)}) = 5$ the grey rhombus 1 is to the left of the grey square 2. The white hexagon 1 is a descendant of the grey square 2 since $m_1^{(1)} = 5 \in \pi_3^{(2)} = \{1, 2, 4, 5\}$ and the black pentagon 2 is in its turn a descendant of the white hexagon 1 as $m_2^{(2)} = \max\{1, 4\} = 4 \in \alpha_3^{-1} \circ \alpha_2^{-1}(\pi_1^{(1)}) = \{1, 3, 4\}$. This is how we construct first the tree T. Then by removing the labels and shapes from T we get the tree t. As $\alpha_3^{-1} \circ \alpha_2^{-1} \circ \alpha_3(m_3^{(2)}) = m_2^{(1)} = 5$ we create a triangle rooted in the root vertex of t connecting the root vertex of t with its right grey vertex and, as $\alpha_2 \circ \alpha_3(m_2^{(2)}) = m_1^{(i)} = 5$ we construct a triangle rooted in this last grey vertex connecting it with the top black vertex of t. Finally, we obtain the cactus tree $\tau$ from the tree t (see Figure 3).

From now to the end of this section, we will denote by $a$ the number of triangles rooted in grey vertices, by $b$ the number of triangles rooted in white vertices and by $c$ the number of triangles rooted in black vertices.

<figure><img src="image_3.png" /><figcaption>Fig. 3: Labeled Tree T, tree t and Cactus Tree τ</figcaption></figure>

Relabeled support sets

(i) Relabeling permutations.

Using a similar approach as in [8], we construct three relabeling permutations $\lambda_1, \lambda_2, \lambda_3$. First we consider the reverse-labelled tree $T'$ resulting from the labelling of $t$, based on three independent reverse-labelling procedures for white, black and grey vertices. The root is labelled $p_1$, the white vertices at level 3 are labeled from right to left, beginning with $p_1 - 1$, proceeding by labelling from right to left white vertices at level 5 and all the other white levels until reaching the leftmost white vertex at the top white level labelled by 1. We proceed in the same way to label black and grey vertices. Next step consists in relabeling the blocks (white, black and grey) by using the new indices from $T'$. If a white vertex is labeled $i$ in $T$ and $i'$ in $T'$, we note:

$$\pi_1^{i'} = \pi_1^{(i)}$$
Black and grey blocks are relabeled in the similar way. Let $\omega^i, \upsilon^j, \nu^k$ be the strings given by writing the elements of $\pi_1^i, \alpha_3^1(\pi_2^j), \pi_3^k$ in increasing order. Denote $\omega = \omega^1 \dots \omega^{p_1}, \upsilon = \upsilon^1 \dots \upsilon^{p_2}, \nu = \nu^1 \dots \nu^{p_3}$, concatenations of the strings defined above. We define $\lambda_1 \in \Sigma_N$ by setting $\omega$ the first line and $[N]$ the second line of the two-line representation of this permutation. Similarly, we define $\lambda_2$ and $\lambda_3$.

(ii) Support sets

we now define the unordered set $S_0 \subset [N]$ of size $|S_0| = p_1 - 1 + p_2 - a$ as:

$$S_0 = \lambda_1(\{m_1^i, \alpha_2 \circ \alpha_3(m_2^{j'}) | 1 \le i \le p_1 - 1, 1 \le j \le p_2\})$$

the set $S_1 \subset [N - 1]$ of size $|S_1| = p_1 - 1 + p_3 - 1 - c$, where

$$S_1 = \lambda_3(\{m_3^k, \alpha_3^{-1}(m_1^i) | 1 \le k \le p_3 - 1, 1 \le i \le p_1 - 1\})$$

(obviously $N = \lambda_3(m_3^{p_3})$), the set $S_2 \subset [N - 1]$ of size $|S_2| = p_2 - 1 + p_3 - b$, where

$$S_2 = \lambda_2(\{m_2^{j'}, \alpha_3^{-1} \circ \alpha_2^{-1} \circ \alpha_3(m_3^k) | 1 \le j \le p_2 - 1, 1 \le k \le p_3\})$$

**Example 3.2** Let us go back to our Example 3.1 and construct relabeling permutations and support sets. Using a reverse labeling of trees $T$ we can set:

$$\pi_1^1 = \pi_1^{(1)}, \pi_1^2 = \pi_1^{(2)}, \pi_2^1 = \pi_2^{(2)}, \pi_2^2 = \pi_2^{(1)}, \pi_3^1 = \pi_3^{(1)}, \pi_3^2 = \pi_3^{(2)}$$

Then the strings $\omega^i, \upsilon^j$ and $\nu^k$ are defined by:

$$\omega^1 = 245, \omega^2 = 13, \upsilon^1 = 14, \upsilon^2 = 235, \nu^1 = 3, \nu^2 = 1245$$

Let us construct now the relabelling permutations $\lambda_1, \lambda_2$ and $\lambda_3$:

$$\lambda_1 = \left( \begin{array}{ccc|ccc} 2 & 4 & 5 & 1 & 3 & 4 \\ 1 & 2 & 3 & 4 & 5 & 1 \end{array} \right) \quad \lambda_2 = \left( \begin{array}{ccc|ccc} 1 & 4 & 2 & 3 & 5 & 1 \\ 1 & 2 & 3 & 4 & 5 & 2 \end{array} \right) \quad \lambda_3 = \left( \begin{array}{ccc|ccc} 3 & 1 & 2 & 4 & 5 & 3 \\ 1 & 2 & 3 & 4 & 5 & 1 \end{array} \right)$$

Then relabeled support sets are defined by:

$$S_0 = \lambda_1(\{1, 5\}) = \{3, 4\}, S_1 = \lambda_3(\{1, 3, 5\}) = \{1, 2, 5\}, S_2 = \lambda_2(\{2, 4, 5\}) = \{2, 3, 5\}$$

**Relabeled ordered support complement set.**

We now define an ordered set

$$\chi = (\lambda_1 \circ \alpha_3(m_3^k), 1 \le k \le p_3 \mid \alpha_3(m_3^k) \notin \{m_1^i, 1 \le i \le p_1 - 1, \alpha_2 \circ \alpha_3(m_2^{j'}) \mid 1 \le j \le p_2\})$$

of size $|\chi| = p_3 - b - c + 1$. The relation $S_0 \cap \chi = \emptyset$ is clearly verified.

**Example 3.3** The support complement set $\chi$ for our previous Example 3.2 is defined as follows:

$$\chi = (\lambda_1(\{1, 3\} \setminus \{1\})) = \lambda_1(3) = 5$$
## Permutations

We need two additional objects to end our construction. We proceed in a two step process:

### (i) Partial Permutations

First we define the sets $E_1 = [N] \setminus \lambda_1\{m_1^i, \alpha_3(m_3^k) \mid 1 \le i \le p_1 - 1, 1 \le k \le p_3\}$ and $E_2 = [N] \setminus \lambda_1\{\alpha_2 \circ \alpha_3(m_2^{j'})$, $\alpha_3(m_3^k) \mid 1 \le i \le p_2, 1 \le k \le p_3\}$ We construct partial permutations $\tilde{\sigma}_1$ and $\tilde{\sigma}_2$ defined respectively on $E_1$ and $E_2$ in the following way:

$$ \tilde{\sigma}_1: \quad \begin{array}{ccc} E_1 & \to & [N-1] \setminus S_1 \\ u & \mapsto & \lambda_3 \circ \alpha_3^{-1} \circ \lambda_1^{-1}(u) \end{array} $$

$$ \tilde{\sigma}_2: \quad \begin{array}{ccc} E_2 & \to & [N-1] \setminus S_2 \\ u & \mapsto & \lambda_2 \circ \alpha_3^{-1} \circ \alpha_2^{-1} \circ \lambda_1^{-1}(u) \end{array} $$

### (ii) Permutations

For the second step, we define the ordered set $\overline{E_1}$ with all the elements of $E_1$ sorted in increasing order and $\rho_1$ the labeling function which associates to each element of $E_1$ its position index in $\overline{E_1}$. As a direct consequence, we have $\rho_1(E_1) = [N - p_1 + 1 - p_3 + c]$. Similarly we define $\rho_2$ to label the elements of $E_2$, $\rho_3$ to label the elements of $[N - 1] \setminus S_1$ and $\rho_4$ to label the elements of $[N - 1] \setminus S_2$. We can now state the definition of permutations $\sigma_1$ and $\sigma_2$ as:

$$ \sigma_1: \quad \begin{array}{ccc} [N - p_1 + 1 - p_3 + c] & \to & [N - p_1 + 1 - p_3 + c] \\ u & \mapsto & \rho_3 \circ \tilde{\sigma}_1 \circ \rho_1^{-1}(u) \end{array} $$

$$ \sigma_2: \quad \begin{array}{ccc} [N - p_2 - p_3 + b] & \to & [N - p_2 - p_3 + b] \\ u & \mapsto & \rho_4 \circ \tilde{\sigma}_2 \circ \rho_2^{-1}(u) \end{array} $$

**Example 3.4** Let us continue the previous Example 3.3. The sets $E_1$ and $E_2$ are equal to:

$$ E_1 = [5] \setminus \{1, 3, 5\} = \{2, 4\}, \quad E_2 = [5] \setminus \{1, 3, 5\} = \{2, 4\} $$

Then the partial permutations $\tilde{\sigma}_1$ and $\tilde{\sigma}_2$ are given by:

$$ \tilde{\sigma}_1 = \begin{pmatrix} 1 & 2 \\ 3 & 4 \end{pmatrix} \quad \tilde{\sigma}_2 = \begin{pmatrix} 1 & 2 \\ 5 & 4 \end{pmatrix} $$

Finally, we obtain desired permutations $\sigma_1$ and $\sigma_2$:

$$ \sigma_1 = \begin{pmatrix} 1 & 2 \\ 1 & 2 \end{pmatrix} \quad \sigma_2 = \begin{pmatrix} 1 & 2 \\ 2 & 1 \end{pmatrix} $$
## 4 Derivation of the main formula

Let $I(p_1, p_2, p_3, N)$ be the set of 7-uple as defined in the previous section. We have:

$$ I(p_1, p_2, p_3, N) = \{(\tau, S_0, S_1, S_2, \chi, \sigma_1, \sigma_2) \in \bigcup_{a,b,c \ge 0} \{CT(p_1, p_2, p_3, a, b, c) \times P_{p_1-1+p_2-a}([N]) \\ \times P_{p_1-1+p_3-1-c}([N-1]) \times P_{p_3+p_2-1-b}([N-1]) \times OP_{p_3-b-c}([N]) \\ \times \Sigma_{N-p_1+1-p_3+c} \times \Sigma_{N-p_2-p_3+b} \mid S_0 \cap \chi = \emptyset\} $$

We prove our main theorem by showing:

**Theorem 4.1** *The mapping $\Theta$ defined by:*

$$ \begin{aligned} CC(p_1, p_2, p_3, N) &\to I(p_1, p_2, p_3, N) \\ (\pi_1, \pi_2, \pi_3, \alpha_1, \alpha_2) &\longmapsto (\tau, S_0, S_1, S_2, \chi, \sigma_1, \sigma_2) \end{aligned} $$

is actually a bijection.

The proof of this theorem is detailed in the next section. Theorem 1.1 is a direct consequence of theorem 4.1. Indeed, we have the following lemma:

**Lemma 4.2** *The cardinality of the image set of $\Theta$ verifies:*

$$ | I(p_1, p_2, p_3, N) | = \frac{N!^2}{p_1! p_2! p_3!} \binom{N-1}{p_3-1} \sum_{a \ge 0} \binom{N-p_2}{p_1-1-a} \binom{N-p_3}{a} \binom{N-1-a}{N-p_2} \quad (8) $$

*Proof* – Cardinality of $CT(p_1, p_2, p_3, a, b, c)$ has already been stated in lemma 2.3. The number of way to choose the unordered subset $S_0, S_1$ and $S_2$, is defined by the binomial coefficients

$$ \binom{N}{p_1-1+p_2-a}, \binom{N-1}{p_1-1+p_3-1-c}, \binom{N-1}{p_3+p_2-1-b} $$

Then, since $S_0 \cap \chi = \emptyset$, the number of way to choose $\chi$ is

$$ \binom{N-p_1+1-p_2+a}{p_3-b-c} (p_3-b-c)! $$

The number of permutations $\sigma_1, \sigma_2$ is $(N-p_1+1-p_3+c)!(N-p_2-p_3+b)!$

Combining everything and summing over $(a, b, c)$ gives:

$$ \begin{aligned} | I(p_1, p_2, p_3, N) | = & \sum_{a,b,c \ge 0} \frac{(a(b-p_3)+p_2p_3)}{p_1p_2p_3} \binom{p_1+p_2-1-a}{p_1-1, p_2-a-b} \binom{p_2+p_3-1-b}{p_2-1, p_3-b-c} \\ & \times \binom{p_1+p_3-2-c}{p_3-1, p_1-1-a-c} \binom{N}{p_1-1+p_2-a} \binom{N-1}{p_1-1+p_3-1-c} \\ & \times \binom{N-1}{p_3+p_2-1-b} \binom{N-p_1+1-p_2+a}{p_3-b-c} (p_3-b-c)! \\ & \times (N-p_1+1-p_3+c)!(N-p_2-p_3+b)! \end{aligned} \quad (9) $$
Equation 9 leaves room for a lot of simplifications on the binomial coefficients. We get:

$$ | I(p_1, p_2, p_3, N) | = \frac{(N-1)!^2}{p1!p2!p3!} \sum_{a,b,c \ge 0} (a(b-p_3) + p_2p_3) \times \binom{N}{a, b, c, p_1-1-a-c, p_2-a-b, p_3-b-c} \quad (10) $$

Where the final element on the right hand side of the equation is a multinomial coefficient. The computation is conducted to the final result by arranging properly the terms depending on b and c, and summing over these two parameters with the help of Vandermonde's convolution. (This result can as well be derived using Jackson's Formula [2])

# 5 Proof of the bijection

## Injectivity

For the first step of the proof we focus on injectivity of $\Theta$. Let $(\tau, S_0, S_1, S_2, \chi, \sigma_1, \sigma_2)$ be the image by $\Theta$ of $(\pi_1, \pi_2, \pi_3, \alpha_1, \alpha_2) \in CC(p_1, p_2, p_3, N)$. Our aim is to show that $(\pi_1, \pi_2, \pi_3, \alpha_1, \alpha_2)$ is uniquely determined by $(\tau, S_0, S_1, S_2, \chi, \sigma_1, \sigma_2)$. We proceed step by step.

* First we note that $S_0$ and $\tau$ determines the value of $\lambda_1(\{m_1^i, \alpha_2 \circ \alpha_3(m_2^{j'}) | 1 \le i \le p_1-1, 1 \le j \le p_2\})$ since $S_0$ gives the set of values of all these elements (by construction) and $\tau$ gives the relations of order (including equalities). Indeed, according to the construction of $\tau$ and $\lambda_1$, the $\lambda_1(m_1^l)$'s are sorted in increasing order with respect to the reverse label order in $\tau$, the $\lambda_1(\alpha_2 \circ \alpha_3(m_2^{l'}))$'s associated with black vertices descendant of the same white vertex are sorted in increasing order from left to right.

If the $j$-th black vertex in the reverse labeling of $\tau$ is the descendant of the $i$-th white vertex, we have necessarily: $\lambda_1(\alpha_2 \circ \alpha_3(m_2^{j'})) \in \lambda_1(\pi_1^i)$ and henceforth $\lambda_1(\alpha_2 \circ \alpha_3(m_2^{j'})) > \lambda_1(m_1^l)$ if $l < i$, $\lambda_1(\alpha_2 \circ \alpha_3(m_2^{j'})) < \lambda_1(m_1^l)$, if $i < l$ and $\lambda_1(\alpha_2 \circ \alpha_3(m_2^{j'})) = \lambda_1(m_1^i)$ if the $j$-th black vertex and the $i$-th white vertex belong to the same triangle rooted in grey vertex.

* Similarly the sets $\lambda_3(\{m_3^k, \alpha_3^{-1}(m_1^i) | 1 \le k \le p_3, 1 \le i \le p_1-1\})$ and $\lambda_2(\{m_2^{j'}, \alpha_3^{-1} \circ \alpha_2^{-1} \circ \alpha_3(m_3^k) | 1 \le j \le p_2, 1 \le k \le p_3\})$ are uniquely determined.

* Looking at the triangles rooted in a white or a black vertex within $\tau$ we can determine $\lambda_1(\alpha_3(m_3^k)) | \lambda_1(\alpha_3(m_3^k)) \in S_0$. The complementary ordered set $\chi$ uniquely determines the $\lambda_1(\alpha_3(m_3^k)) | \lambda_1(\alpha_3(m_3^k)) \notin S_0$.

* The following step is to notice that elements so far reconstructed uniquely determines the supports of the partial permutation $\tilde{\sigma}_1$ and $\tilde{\sigma}_2$ and the partial permutations themselves. Then we can define $\overline{\sigma}_1 = \lambda_3 \circ \alpha_3^{-1} \circ \lambda_1^{-1}$ and $\overline{\sigma}_2 = \lambda_2 \circ \alpha_3^{-1} \circ \alpha_2^{-1} \circ \lambda_1^{-1}$ extensions of $\tilde{\sigma}_1$ and $\tilde{\sigma}_2$ on the whole set $[N]$ by setting: $\overline{\sigma}_1(i) = \tilde{\sigma}_1(i)$ if $i$ belongs to the support of $\tilde{\sigma}_1$ and $\lambda_3(m_3^k) = \overline{\sigma}_1(\lambda_1(\alpha_3(m_3^k)))$ or $\lambda_3(\alpha_3^{-1}(m_1^i)) = \overline{\sigma}_1(\lambda_1(m_1^i))$ otherwise. (We have a similar construction for $\overline{\sigma}_2$).

* The partition $\lambda_1(\pi_1)$ is now uniquely determined as well since:

$$ \lambda_1(\pi_1^1) = [\lambda_1(m_1^1)], \quad \lambda_1(\pi_1^i) = [\lambda_1(m_1^i)] \setminus [\lambda_1(m_1^{i-1})] \text{ for } 2 \le i \le p_1 $$
Similar reconstruction applies to $\lambda_2(\alpha_3^{-1}\pi_2)$ and $\lambda_3(\pi_3)$.

* By applying $\overline{\sigma_1^{-1}}$ to $\lambda_3(\pi_3)$ we uniquely determine $\lambda_1(\pi_3)$.

* By applying $\overline{\sigma_2^{-1}}$ to $\lambda_2(\alpha_3^{-1}\pi_2)$ we uniquely determine $\lambda_1(\pi_2)$.

* Then we show by induction that the relabeling permutations $\lambda_1, \lambda_2, \lambda_3$ are uniquely determined. $\lambda_1(1)$ is uniquely determined as the minimum element of $\lambda_1(\pi_1^{p_1})$.

Assume that $\lambda_1(l), \lambda_2(l-1)$ and $\lambda_3(l-1)$ have been uniquely determined for $l = 1..i$ for a given $i < N$. As $\lambda_3$ is an increasing function on the blocks of $\pi_3$, necessarily the element $\lambda_3(i)$ is the minimal (not yet attributed within the procedure) one of $\lambda_3(\pi_3^{k_i})$ where $k_i$ is the index of the grey block such that $\lambda_1(i) \in \lambda_1(\pi_3^{k_i})$ and is hence uniquely determined. We proceed by computing $\lambda_1(\alpha_3(i)) = \overline{\sigma_1^{-1}(\lambda_3(i))}$. Then we identify $\lambda_2(i)$ as being the minimal (not yet attributed within the procedure) element of $\lambda_2(\alpha_3^{-1}(\pi_2^{j_i}))$ where $j_i$ is the index of the black block such that $\lambda_1(\alpha_3(i)) \in \lambda_1(\pi_2^{j_i})$. We compute $\lambda_1(\alpha_2\alpha_3(i)) = \overline{\sigma_2^{-1}(\lambda_2(i))}$. Then we identify $\lambda_1(i+1)$ as being the minimal (not yet attributed within the procedure) element of $\lambda_1((\pi_1^{l_i}))$ where $l_i$ is the index of the white block such that $\lambda_1(\alpha_2\alpha_3(i)) \in \lambda_1(\pi_1^{l_i})$ (as $\pi_1$ is stable by $\alpha_1$, $i+1 = \alpha_1\alpha_2\alpha_3(i)$ belongs to the same white block as $\alpha_2\alpha_3(i)$ and $\lambda_1(i+1)$ is uniquely determined. Finally, $\lambda_2(N)$ and $\lambda_3(N)$ are uniquely determined.

* As a direct consequence, the partitioned cactus is uniquely determined since:

$$ \pi_1 = \lambda_1^{-1}(\lambda_1(\pi_1)), \quad \pi_2 = \lambda_1^{-1} \circ \overline{\sigma_2^{-1}}(\lambda_2(\alpha_3^{-1}(\pi_2))), \quad \pi_3 = \lambda_1^{-1} \circ \overline{\sigma_1^{-1}}(\lambda_3(\pi_3)) \quad (11) $$

$$ \alpha_1 = \gamma_N \circ \lambda_2^{-1} \circ \overline{\sigma_2} \circ \lambda_1, \quad \alpha_2 = \lambda_1^{-1} \circ \overline{\sigma_2^{-1}} \circ \lambda_2 \circ \lambda_3^{-1} \circ \overline{\sigma_1} \circ \lambda_1 \quad (12) $$

## Surjectivity

The final step of this proof is to show that $\Theta(p_1, p_2, p_3, N)$ is a surjection. Let $(\tau, S_0, S_1, S_2, \chi, \sigma_1, \sigma_2)$ be any 7-uple of $I(p_1, p_2, p_3, N)$. Provided that $S_0 \cap \chi = \emptyset$ we can always define the partitions $\lambda_1(\pi_1)$, $\lambda_2(\alpha_3^{-1}(\pi_2))$ and $\lambda_3(\pi_3)$ and the permutations $\overline{\sigma_1}$ and $\overline{\sigma_2}$ according to the reconstruction procedure we pointed out in the previous subsection. As a direct consequence, we can always define $\lambda_1(\pi_2)$ and $\lambda_1(\pi_3)$ using:

$$ \lambda_1(\pi_2) = \overline{\sigma_2^{-1}}(\lambda_2(\alpha_3^{-1}(\pi_2))), \quad \lambda_1(\pi_3) = \overline{\sigma_1^{-1}}(\lambda_3(\pi_3)) $$

To prove surjectivity of $\Theta$ we simply need to show that the iterative reconstruction of $\lambda_1, \lambda_2, \lambda_3$ defined in the injectivity proof can always be fulfilled and always gives valid objects as an output. The main difficulty lies in the boundary condition. As a first remark, we can obviously always define $\lambda_1(1)$ as the minimal element of $\lambda_1(\pi_1^{p_1})$.

Suppose now that we were able to reconstruct $\lambda_1(l)$ for $l = 1..h$, ($h < N$) as well as $\lambda_2(l)$ and $\lambda_3(l)$ $l = 1..h-1$. We wouldn't be able to reconstruct $\lambda_3(h)$ if and only if all the elements of $\lambda_3(\pi_3^{k_h})$ such that $\lambda_1(h) \in \lambda_1(\pi_3^{k_h})$ have already been allocated during the procedure. Clearly it would mean that $|\lambda_1(\pi_3^{k_h})| + 1$ different elements would belong to the set $\lambda_1(\pi_3^{k_h})$ which is an obvious contradiction.

Then, impossibility of reconstructing $\lambda_2(h)$ would be equivalent to the fact that all the elements of $\lambda_2(\pi_2^{j_h})$ with $\overline{\sigma_1^{-1}(\lambda_3(h))} \in \lambda_1(\pi_2^{j_h})$ have already been allocated. Since $\overline{\sigma_1}$ is a bijection, this leads to a similar contradiction.

Same argument applies with reconstruction of $\lambda_1(h+1)$ if $\overline{\sigma_2^{-1}(\lambda_2(h))} \in \lambda_1(\pi_1^{i_{h+1}})$ with $i_{h+1} \neq p_1$.
If $\overline{\sigma_2}^{-1}(\lambda_2(h)) \in \lambda_1(\pi_1^{p_1})$ we can only tell that $|\lambda_1(\pi_1^{p_1})|$ different integers belongs to $\lambda_1(\pi_1^{p_1})$ since $\lambda_1(1)$ was not constructed in the same way as the other $\lambda_1(l)$. However according to our construction, if the black vertex in $\tau$ corresponding to a given block $\pi_2^u$ is the direct descendant of the white vertex associated with $\pi_1^v$ then $\overline{\sigma_2}^{-1}(\lambda_2(m_2'^u)) \in \lambda_1(\pi_1^{(v)})$. Hence, if all the elements of $\lambda_1(\pi_1^{(v)})$ have been used for the reconstruction process, the maximum elements (and therefore all the elements) of all the blocks $\lambda_2(\alpha_3^{-1}(\pi_2^u))$ corresponding to descendant vertices of the white vertex associated with $\lambda_1(\pi_1^{(v)})$ have been used during this process. Similarly we can show that for any vertex of any color, if all of the elements of the corresponding block have been used during the reconstruction process, all the elements of the block corresponding to descendant vertices have been used for the reconstruction process.

Since $\pi_1^{p_1}$ is associated with the root of the cactus tree $\tau$, if all the elements of $\lambda_1(\pi_1^{p_1})$ have been used for the reconstruction process, it means that all the elements of all the blocks have been used as well. As a conclusion, the reconstruction process came to its expected end and $h = N$ which is a contradiction with our hypothesis. Let us show that the objects reconstructed by our process are valid 5-uple of $CC(p_1, p_2, p_3, N)$. Our objects are valid if and only if the stability conditions of the partitions by the permutation are respected. If we have $l \in \pi_1^i$, then according to our reconstruction procedure $\lambda_1^{-1} \circ \overline{\sigma_2}^{-1} \circ \lambda_2(l-1) \in \pi_1^i$ for $l \ge 2$. Besides, we showed that $\lambda_1^{-1} \circ \overline{\sigma_2}^{-1} \circ \lambda_2(N) \in \pi_1^{p_1}$ with $1 \in \pi_1^{p_1}$. Hence, whatever the integer $l$, $l$ and $\lambda_1^{-1} \circ \overline{\sigma_2}^{-1} \circ \lambda_2 \gamma_N^{-1}(l)$ belongs to the same block of $\pi_1$. In other words, the blocks of $\pi_1$ are stable by $\alpha_1^{-1}$ or equivalently by $\alpha_1$. With similar point, one can show that $\pi_2$ is stable by $\alpha_2$. Trivially, $\pi_3$ is stable by $\alpha_3$ defined by $\alpha_3 = \alpha_2^{-1} \circ \alpha_1^{-1} \circ \gamma_N$ since $\alpha_2^{-1} \circ \alpha_1^{-1} \circ \gamma_N(\pi_3) = \lambda_1^{-1} \circ \overline{\sigma_1}^{-1}(\lambda_3(\pi_3)) = \pi_3$ according to our definition.

## References

[1] R. CORI, A. MACHI, *Maps, hypermaps and their automorphisms: a survey I, II, III*, Expositiones Math., **10**, 403–427, 429–447, 449–467, 1992

[2] D.M. JACKSON, *Some combinatorial problems associated with products of conjugacy classes of the symmetric group*, J. Combinatorial Theory (A) **49**, 363–369, 1988

[3] I.P. GOULDEN AND A. NICA, *A direct bijection for the Harer-Zagier formula*, J. Combinatorial Theory (A) **111**, 224–238, 2005

[4] A. GOUPIL, G. SCHAEFFER, *Factoring n-cycles and counting maps of given genus*, Europ. J. Combinatorics, **19**(7), 819-834, 1998

[5] J. HARER AND D. ZAGIER, *The Euler characteristic of the moduli space of curves*, Inventiones Mathematicae, **85**, 457–486, 1986

[6] B. LASS, *Démonstration combinatoire de la formule de Harer-Zagier*, C. R. Acad. Sci. Paris, **333**, Série I, 155–160, 2001

[7] G. SCHAEFFER, *Conjugaison d'arbres et cartes combinatoires aléatoires*, Ph.D. Thesis, l'Université Bordeaux I, 1998

[8] G. SCHAEFFER AND E. VASSILIEVA, *A bijective proof of Jackson's formula for the number of factorizations of a cycle*, J. Combinatorial Theory (A), to appear.