Loïc Chaumont
email: loic.chaumont@univ-angers.fr

Rongli Liu
email: rongli.liu@gmail.com

CODING MULTITYPE FORESTS: APPLICATION TO THE LAW OF THE TOTAL POPULATION OF BRANCHING FORESTS

Keywords: . 2010 Mathematics Subject Classification. 60C05, 05C05 Multitype branching forest, coding, random walks, ballot theorem, total population, cyclic exchangeablity

By extending the breadth first search algorithm to any d-type critical or subcritical irreducible branching forest, we show that such forests can be encoded through d independent, integer valued, d-dimensional random walks. An application of this coding together with a multivariate extension of the Ballot Theorem which is obtained here, allow us to give an explicit form of the law of the total population, jointly with the number of subtrees of each type, in terms of the offspring distribution of the branching process.

Introduction

Let u 1 , u 2 . . . be the labeling in the breadth first search order of the vertices of a critical or subcritical branching forest with progeny distribution ν. Call p(u i ), the size of the progeny of the i-th vertex, then the stochastic process (X n ) n≥0 defined by, X 0 = 0 and X n+1 -X n = p(u n+1 ) -1 , n ≥ 0 is a downward skip free random walk with step distribution P (X 1 = n) = ν(n + 1), from which the entire structure of the original branching forest can be recovered. We will refer to this random walk as the Lukasiewicz-Harris coding path of the branching forest, see Section 6 of [START_REF] Harris | First passage and recurrence distributions[END_REF], Section 1.1 of [START_REF] Gall | Random trees and applications[END_REF] or Section 6.2 of [START_REF] Pitman | Combinatorial Stochastic Processes[END_REF]. A nice example of application of this coding is that the total population of the first k trees t 1 , t 2 , . . . , t k of the forest, see Figure 1, may be expressed as the first passage time T k of (X n ) n≥0 at level -k, that is,

T k = inf{i : X i = -k} .
This result combined with the following Kemperman's identity (also known as the Ballot Theorem, see [START_REF] Takács | A generalization of the ballot problem and its application in the theory of queues[END_REF], Lemma 5 in [START_REF] Bertoin | The structure of the allelic partition of the total population for Galton-Watson processes with neutral mutations[END_REF] or Section 6.2 in [START_REF] Pitman | Combinatorial Stochastic Processes[END_REF]):

P (T k = n) = k n P (X n = -k) ,
allows us to compute the law of the total population of t 1 , t 2 , . . . , t k in terms of the progeny distribution ν. Note that the total population is actually a functional of the associated branching process, (Z n , n ≥ 0), since the random variable Z n represents the number of individuals at the n-th generation in the forest. The expression of this law was first obtained by Otter [START_REF] Otter | The multiplicative process[END_REF] and Dwass [START_REF] Dwass | The total population in a branching process and a related random walk[END_REF].

Theorem 1.1 (Otter (49) and Dwass (69)). Let Z = (Z n ) be a critical or subcritical branching process. Let P k be its law when it starts from Z 0 = k ≥ 1 and denote by ν its progeny law. Let O be the total size of the population generated by Z, that is O = n≥0 Z n . Then for any n ≥ k,

(1.1)

P k (O = n) = k n ν * n (n -k) ,
where ν * n is the n-th iteration of the convolution product of the probability ν by itself. More generally, whenever a functional of the branching forest admits a 'nice' expression in terms of the Lukasiewicz-Harris coding path, we may expect to obtain an explicit form of its law. For instance, the law of the number of individuals with a given degree in the first k trees can be obtained in this way. We refer to Proposition 1.6 in [START_REF] Kortchemski | Invariance principles for Galton-Watson trees conditioned on the number of leaves[END_REF] where the law of the number of leaves, first obtained in [START_REF] Minami | On the number of vertices with a given degree in a Galton-Watson tree[END_REF], is derived from the Lukasiewicz-Harris coding.

The goal of this paper is to extend the above program to the multitype case. The Lukasiewicz-Harris coding will first be extended to multitype forests and will lead to the bijection stated in Theorem 2.7 between forests and some set of coding sequences. Then in order to obtain the multitype Otter-Dwass identity which is stated in Theorem 1.2, we first need the equivalent of the Ballot Theorem. This theorem together with its equivalent deterministic form, the multivariate Cyclic Lemma, are actually amongst the most important results of this paper. Both results require more preliminary notation and will be stated further in the text, see Lemma 3.3 and Theorem 3.4.

Let us first set some definitions and notation in multitype branching processes. We set Z + = {0, 1, 2, . . . } and N = {1, 2, . . . }, and for any integer n ≥ 1, the set {1, . . . , n} will be denoted by [n]. In all the sequel of this paper, d will be an integer such that d ≥ 2. On a probability space (Ω, G, P ), we define a d-type branching process Z := {(Z + and ν * r i is the r-th iteration of the convolution product of ν i by itself, with ν * 0 i = δ 0 . For r = (r 1 , . . . , r d ) ∈ Z d + , we will denote by P r the probability law P ( • | Z 0 = r). The vector ν = (ν 1 , . . . , ν d ) will be called the progeny distribution of Z. According to this process, each individual of type i gives birth to a random number of children with law ν i , independently of the other individuals of its generation. The integer valued random variable Z (i) n is the total number of individuals of type i, at generation n. For i, j ∈ [d], let us define the rate

m ij = z∈Z d + z j ν i (z) ,
that corresponds to the mean number of children of type j, given by an individual of type i and let M := (m ij ) i,j∈[d] be the mean matrix of Z. Suppose that the extinction time T is a.s. finite, that is

(1.2) T = inf{n : Z n = 0} < ∞ , a.s.
Then let O i be the total number of individuals of type i which are born up to time T (including individuals of the first generation):

O i = T n=0 Z (i) n = n≥0 Z (i) n .
The vector (O 1 , . . . , O d ) will be called the total population of the multitype branching process.

Up to now, most of the results on the exact law of the total population of multitype branching processes concern non irreducible, 2-type branching processes. Let us now recall them. In the case where d = 2 and when m 12 > 0 and 0 < m 11 ≤ 1 but m 22 = m 21 = 0, it may be derived from Theorem 1 (ii) in [START_REF] Bertoin | The structure of the allelic partition of the total population for Galton-Watson processes with neutral mutations[END_REF], that the distribution of the total population of Z is given by (1.3)

P (r 1 ,0) (O 1 = n 1 , O 2 = n 2 ) = r 1 n 1 ν * n 1 1 (n 1 -r 1 , n 2 ) , 1 ≤ r 1 ≤ n 1 .
When m 12 > 0 and 0 < m 11 , m 22 ≤ 1 but m 21 = 0, after some elementary computation, combining the identities in (1.1) and (1.3), we obtain that for n 2 ≥ 1,

(1.4) P (r 1 ,0) (O 1 = n 1 , O 2 = n 2 ) = r 1 n 1 n 2 n 2 j=0 jν * n 1 1 (n 1 -r 1 , j)ν * n 2 2 (0, n 2 -j).
Note that (1.3) and (1.4) concern only the reducible case, when d = 2 and T < ∞, a.s.

As far as we know, those are the only situations where the law of the total population of multitype branching processes is known explicitly.

Recall that if M is irreducible, then according to Perron-Frobenius Theorem, it admits a unique eigenvalue ρ which is simple, positive and with maximal modulus. In this case, we will also say that Z is irreducible. If moreover, Z is non-degenarate, that is, if individuals have exactly one offspring with probability different from 1, then extinction, that is (1.2), holds if and only if ρ ≤ 1, see [START_REF] Harris | The theory of branching processes[END_REF], [START_REF]Mode: Multitype branching processes. Theory and applications[END_REF] and Chapter V of [START_REF] Athreya | Branching processes. Die Grundlehren der mathematischen Wissenschaften[END_REF]. If ρ = 1, we say that Z is critical and if ρ < 1, we say that Z is subcritical. The results of this paper will be concerned by the case where Z is irreducible, non-degenarate, and critical or subcritical so that (1.2) holds, that is the multitype branching process Z becomes extinct with probability 1. However, let us emphasize that this assumption is only made for simplicity reasons and that all the proofs can be adapted to the case where the process is supercritical and/or reducible.

The next result gives the joint law of the total population together with the total number of individuals of type j, whose parent is of type i, i = j, up to time T . Let us denote by A ij this random variable. We emphasize that the variables A ij are not functionals of the multitype branching process Z. So, their formal definition and the computation of their law require a more complete information provided by the forest. Theorem 1.1 and identity (1.4) are extended as follows:

Theorem 1.2. Assume that the d-type branching process Z is irreducible, non-degenarate and critical or subcritical. For i, j ∈ [d], let O i be the total number of individuals of type i, up to the extinction time T and for i = j, let A ij be the total number of individuals of type j, whose parent is of type i, up to time T .

Then for all integers r i ,

n i , k ij , i, j ∈ [d], such that r i ≥ 0, r 1 + • • • + r d ≥ 1, k ij ≥ 0, for i = j, -k jj = r j + i =j k ij , and n i ≥ -k ii , P r O 1 = n 1 , . . . , O d = n d , A ij = k ij , i, j ∈ [d], i = j = det(K) n1 n2 . . . nd d i=1 ν * n i i (k i1 , . . . , k i(i-1) , n i + k ii , k i(i+1) , . . . , k id ) , where r = (r 1 , . . . , r d ), ν * 0 i = δ 0 , ni = n i ∨ 1 and K is the matrix (-k ij ) i,j∈[d]
to which we removed the line i and the column i, for all i such that n i = 0.

Our proof of Theorem 1.2 uses a bijection, displayed in Theorem 2.7, between multitype forests and a particular set of multidimensional, integer valued sequences. A consequence of this result is that any critical or subcritical irreducible multitype branching forest is encoded by d independent, d-dimensional random walks, see Theorem 3.1. Then, in a similar way to the single type case, the total population, jointly with the number of subtrees of each type in the forest, is expressed as the first passage time of this multivariate process in some domain. The extension of the Ballot Theorem obtained in Theorem 3.4 allows us to conclude as in the single type case. Another analogy with the single type case is that the multivariate Lagrange inversion formula known as the Lagrange-Good formula, see [START_REF] Good | Generalizations to several variables of Lagrange's expansion, with applications to stochastic processes[END_REF], can be derived from Theorem 1.2 by applying this theorem to the generating function of the random vector (O 1 , . . . , O d ).

This paper is organized as follows. Section 2 is devoted to deterministic multitype forests. In Subsection 2.1, we present the space of these forests and in Subsection 2.2, we define the space of the coding sequences and we obtain the bijection between this space and the space of multitype forests. This result is stated in Theorem 2.7. Then in Section 3, we define the probability space of multitype branching forests, we display their multitype Lukasiewicz-Harris coding in Theorem 3.1 and we prove its application to the total population that is stated in Theorem 1.2. This result requires a multivariate extension of the Ballot Theorem, see Theorem 3.4, whose proof bears on the crucial combinatorial Lemma 3.3. The latter is proved in Section 4.

Multitype forests

2.1. The space of multitype forests. A plane forest, is a directed planar graph with no loops f ⊂ v × v, with a finite or infinite set of vertices v = v(f ), such that the outer degree of each vertex is equal to 0 or 1 and whose connected components, which are called the trees, are finite. A forest consisting of a single connected component is also called a tree. In a tree t, the only vertex with outer degree equal to 0 is called the root of t. It will be denoted by r(t). The roots of the connected components of a forest f are called the roots of f . For two vertices u and v of a forest f , if (u, v) is a directed edge of f , then we say that u is a child of v, or that v is the parent of u. The set of plane forests will be denoted by F. The elements of F will simply be called forests.

We will sometimes have to label the forests, which will be done in the following way. We first give an order to the trees of the forest f and denote them by t 1 (f ), t 2 (f ), . . . , t k (f ), . . . (we will usually write t 1 , t 2 , . . . , t k , . . . if no confusion is possible). Then each tree is labeled according to the breadth first search algorithm: we read the tree from its root to its last generation by running along each generation from the left to the right. This definition should be obvious from the example of Figure 1. If a forest f contains at least i vertices, then the i-th vertex of f is denoted by u i (f ). When no confusion is possible, we will simply denote the i-th vertex by u i .

Recall that d is an integer such that d ≥ 2. To each forest f ∈ F, we associate an application

c f : v(f ) → [d] such that in the labeling defined above, if u i , u i+1 , . . . , u i+j ∈ v(f ) have the same parent, then c f (u i ) ≤ c f (u i+1 ) ≤ • • • ≤ c f (u i+j ). For v ∈ v(f ), the integer c f (v) is called the type (or the color) of v. The couple (f , c f ) is called a d-type forest.
When no confusion is possible, we will simply write f . The set of d-type forests will be denoted by F d . We emphasize that although there is an underlying labeling for each forest, F and F d are sets of unlabeled forests. A 2-type forest is represented on Figure 2 A subtree of type i ∈ [d] of a d-type forest (f , c f ) ∈ F d is a maximal connected subgraph of (f , c f ) whose all vertices are of type i. Formally, t is a subtree of type i of (f , c f ), if it is a connected subgraph whose all vertices are of type i and such that either r(t) has no parent or the type of its parent is different from i. Moreover, if the parent of a vertex v ∈ v(t) c belongs to v(t), then c f (v) = i. Subtrees of type i of (f , c f ) are ranked according to the order of their roots in f and are denoted by t

(i) 1 , t (i) 2 , . . . , t (i) k , . . . . The forest f (i) := {t (i) 1 , t (i) 2 , . . . , t (i)
k , . . . } is called the subforest of type i of (f , c f ). It may be considered as an element of F. We denote by u

(i) 1 , u (i) 2 , . . . the elements of v(f (i) ), ranked
in the breadth first search order of f (i) . The subforests of type 1 and 2 of a 2-type forest are represented in Figure 3. Figure 3. Labeled subforests f (1) and f (2) associated with Figure 2. Beside each vertex, the first number corresponds to its rank in f (i) , i = 1, 2 and the second one is its rank in the original forest.

t (2) 1 1,4
To any forest (f , c f ) ∈ F d , we associate the reduced forest, denoted by (f r , c fr ) ∈ F d , which is the forest of F d obtained by aggregating all the vertices of each subtree of (f , c f ) with a given type, in a single vertex with the same type, and preserving an edge between each pair of connected subtrees. An example is given in Figure 4. let n i ≥ 0 be the number of vertices in the subforest f (i) of (f , c f ). Then let us define the d-dimensional chain x (i) = (x i,1 , . . . , x i,d ), with length n i and whose values belong to the set Z d , by x

(i) 0 = 0 and if n i ≥ 1, (2.5) x i,j n+1 -x i,j n = p j (u (i) n+1 ) , if i = j and x i,i n+1 -x i,i n = p i (u (i) n+1 ) -1 , 0 ≤ n ≤ n i -1 ,
where we recall that (u

(i) n ) n≥1
is the labeling of the subforest f (i) in its own breadth first search order. Note that the chains (x i,j n ), for i = j are nondecreasing whereas

(x i,i n ) is a downward skip free chain, i.e. x i,i n+1 -x i,i n ≥ -1, for 0 ≤ n ≤ n i -1.
The chain (x i,i n ) corresponds to the Lukasiewicz-Harris coding walk of the subforest f (i) , as defined in the introduction, see also Section 6.2 in [START_REF] Pitman | Combinatorial Stochastic Processes[END_REF] for a proper definition. In particular, if n i is finite, then n i = min{n : x i,i n = min 0≤k≤n i x i,i k }. These properties of the chains x (i) lead us to the following definition. Definition 2.1. Let S d be the set of Z d d -valued sequences, x = (x (1) , x (2) , . . . , x (d) ), such that for all i ∈ [d],

x (i) = (x i,1 , . . . , x i,d ) is a Z d -valued sequence defined on some interval of integers, {0, 1, 2, . . . , n i }, 0 ≤ n i ≤ ∞, which satisfies x (i) 0 = 0 and if n i ≥ 1 then (i) for i = j, the sequence (x i,j n ) 0≤n≤n i is nondecreasing, (ii) for all i, x i,i n+1 -x i,i n ≥ -1, 0 ≤ n ≤ n i -1. A sequence x ∈ S d will sometimes be denoted by x = (x i,j k , 0 ≤ k ≤ n i , i, j ∈ [d]
) and for more convenience, we will sometimes denote x i,j k by x i,j (k). The vector n = (n 1 , . . . , n d ) ∈ Z d + , where Z + = Z + ∪ {+∞} will be called the length of x. Relation (2.5) defines an application from the set F d to the set S d . Let us denote by Ψ this application, that is

Ψ : F d → S d (2.6) (f , c f ) → Ψ((f , c f )) = x . For x ∈ S d , set k i = -inf 0≤n≤n i x i,i
n and define the first passage time process of the chain

(x i,i n ) as follows: (2.7) τ (i) k = min{n ≥ 0 : x i,i n = -k} , 0 ≤ k ≤ k i , where τ (i) k i = ∞, if k i = ∞. If x is the image by Ψ of a forest (f , c f ) ∈ F d , i.e. x = Ψ((f , c f )),
then k i is the (finite or infinite) number of trees in the subforest f (i) and for k < ∞, the time τ

(i)
k is the total number of vertices which are contained in the first k trees of f (i) , i.e.

t (i) 1 , t (i) 2 , . . . , t (i)
k . This fact is well known and easily follows from the Lukasiewicz-Harris coding of the single type forest f (i) , see the introduction and Lemma 6.3 in [START_REF] Pitman | Combinatorial Stochastic Processes[END_REF]. Then for i, j ∈ [d], define the integer valued sequence

(2.8) xi,j k = x i,j (τ (i) k ) , 0 ≤ k ≤ k i . If x = Ψ((f , c f )), then we may check that when i = j, xi,j
k is the number of subtrees of type j whose root is the child of a vertex in t

(i) 1 , t (i) 2 , . . . , t (i) k .
Or equivalently, it is the number of vertices of type j whose parent is a vertex of t

(i) 1 , t (i) 2 , . . . , t (i) k . For each i ∈ [d],
we set

x(i) = (x i,1 , . . . , xi,d ) and x = (x (1) , x(2) , . . . , x(d) ) . Clearly for i = j, the sequence

(x i,j k ) 0≤k≤k i is nondecreasing and xi,i k = -k, for all i ∈ [d] and 0 ≤ k ≤ k i . Therefore x ∈ S d
and recalling the definition of the reduced forest, (f r , c fr ), see the end of Section 2.1, we may check that:

(2.9) Ψ((f r , c fr )) = x .
For a forest (f , c f ) ∈ F d with trees t 1 , t 2 , . . . , we will denote by c (f ,c f ) the sequence of types of the roots of t 1 , t 2 , . . . , i.e.

c (f ,c f ) := (c f (r(t 1 )), c f (r(t 2 )), . . . ) . Note that c (f ,c f ) ∈ ∪ 1≤r≤∞ [d] r and that c (f ,c f ) = c (fr,c fr ) .
When no confusion is possible, c (f ,c f ) will simply be denoted by c = (c 1 , c 2 , . . . ) and we will call it the root type sequence of the forest.

Then before we state the general result on the coding of multitype forests in Theorem 2.7, we first need to show that the sequences (x i,j ) i =j together with c = (c 1 , c 2 , . . . ) allow us to encode the reduced forest (f r , c fr ), i.e. this forest can be reconstructed from (x, c). This claim is stated in Lemma 2.5 below. In order to prove it, we first need to describe the set of sequences which encode reduced forests and to state the preliminary Lemma 2.2 regarding these sequences.

Recall that Z + = Z + ∪ {+∞} and let us define the following (non total) order in Z d + : for two elements q = (q 1 , . . . , q d ) and

q ′ = (q ′ 1 , . . . , q ′ d ) of Z d + we write q ≤ q ′ if q i ≤ q ′ i for all i ∈ [d]. Moreover we write q < q ′ if q ≤ q ′ and if there is i ∈ [d] such that q i < q ′ i . For an element x = (x i,j k , 0 ≤ k ≤ q i , i, j ∈ [d]
) of S d with length q = (q 1 , . . . , q d ), and r = (r 1 , . . . , r d ) ∈ Z d + , we say that the system of equations (r, x) admits a solution if there exists s = (s 1 , . . . , s d ) ∈ Z d + , such that s ≤ q and

(2.10)

r j + d i=1
x i,j (s i ) = 0 , j = 1, 2, . . . , d .

We will see in Lemma 2.5 and Theorem 2.7 that for any finite forest (f , c f ) ∈ F d with r i roots of type i, the length q of x = Ψ((f , c f )) is a solution of (r, x) and this solution is the smallest one in a sense that is specified in the following lemma.

Lemma 2.2. Let x ∈ S d and r = (r 1 , . . . , r d ) ∈ Z d + . Assume that the system (r, x) admits a solution, then (i) there exists a unique solution n = (n 1 , . . . , n d ) of the system (r, x) such that if n ′ is any solution of (r, x), then n ≤ n ′ . Moreover we have n i = min{n :

x i,i n = min 0≤k≤n i x i,i k }, for all i ∈ [d].
A solution such as n will be called the smallest solution of the system (r, x). (ii) Let r ′ ∈ Z d + be such that r ′ ≤ r. Then the system (r ′ , x) admits a solution. Let us denote its smallest solution by n ′ . Then the system (r -r ′ , x), where xi,j (k) =

x i,j (n ′ i + k) -x i,j (n ′ i ), 0 ≤ k ≤ n i -n ′ i , admits a solution, and its smallest solution is n -n ′ . A proof of this lemma is given in Section 4. For r = (r 1 , . . . , r d ) ∈ Z d + , with r = r 1 + • • • + r d ≥ 1, that is r > 0, we define, C r d = c ∈ [d] r : Card {j ∈ [r] : c j = i} = r i , i ∈ [d] .
We emphasize that the root type sequence of a forest (f , c f ) ∈ F d with r = r 1 + • • • + r d trees amongst which exactly r i trees have a root of type i is an element of C r d . Now we define the subsets of forests and reduced forests whose root type sequence is in C r d and that contain at least one vertex of each type. + be such that r > 0, then the mapping

Φ : Fr d → Sr d × C r d (f , c f ) → Ψ((f , c f )), c (f ,c f )
is a bijection.

Proof. Let (f , c f ) ∈ Fr d and let k i be the total number of subtrees of type i which are contained in (f , c f ). (Note that since (f , c f ) is a reduced forest, its subtrees are actually single vertices.) By definition,

k i ≥ 1, for each i. The fact that, c (f ,c f ) ∈ C r d follows from Definition 2.3 (ii). Then let us show that x = Ψ((f , c f )) ∈ Sr d . Since (f , c f ) is a reduced forest, then x = x. Besides, from (2.8), x has length k = (k 1 , . . . , k d ) and for j = i, x i,j (k i )
is the number of subtrees of type j whose root is a child of a vertex of t

(i) 1 , t (i) 2 , . . . , t (i) k i , i.e. of any subtree of type i in (f , c f ). Hence for j ∈ [d], i =j x i,j (k i ) is the total number of subtrees of type j in (f , c f ), whose root is a child of a vertex of type i ∈ [d], i = j.
Then in order to obtain the total number of subtrees of type j, it remains to add to i =j x i,j (k i ), the number of subtrees of type j whose root is one of the roots of t 1 , . . . , t r , where r = r 1 + • • • + r d . The latter number is r j , so that k j = r j + i =j x i,j (k i ). Since moreover from (2.8), x i,i k = -k, for all 0 ≤ k ≤ k i , we have proved that k is a solution of the system (r, x). It remains to prove that it is the smallest solution.

Let us first assume that r = (1, 0, . . . , 0), so that (f , c f ) consists in a single tree t 1 whose root has color c f (r(t 1 )) = 1. Then we can reconstruct, this tree from the d sequences (x

(i) k , 0 ≤ k ≤ k i ), i ∈ [d]
by inverting the procedure defined in (2.5) and this reconstruction procedure gives a unique tree. Indeed, by definition of the application Ψ, each sequence (x

(i) k , 0 ≤ k ≤ k i )
, is associated to a unique 'marked subforest', say f (i) , of type i whose vertices kept the memory of their progeny. More specifically, for k

∈ [k i ], the increment x (i) k -x (i)
k-1 gives the progeny of the k-th vertex of the subforest f (i) . This connection between marked subforests f (i) and sequences (x

(i) k , 0 ≤ k ≤ k i ) is illustrated on Figure 5.
Now let k ′ ≤ k be the smallest solution of the system (r, x). Let q = (q 1 , . . . , q d ) < k ′ and suppose that we have been able to perform the reconstruction procedure until q, that is from the sequences (x

(i) k , 0 ≤ k ≤ q i ), i ∈ [d].
Then since q is not a solution of (r, x), we see from what has been proved just above that the tree that is obtained is 'not complete'. That is, at least one of its leaves (say of type j) is marked, so that this leaf should still get children whose types and numbers are given by the next jump x (j)

q j +1 -x (j) q j , for q j < k ′ j ,
(f, c f ): x (1) :

△x (1) 1 = (-1, 2, 1), △x (1)
2 = (-1, 0, 0), △x

3 = (-1, 0, 0), △x x (2) :

(1) 4 = (-1, 0, 0). f (2)
△x (2) 1 = (1, -1, 0), △x (2)
2 = (0, -1, 0), △x (2)
3 = (0, -1, 0), △x Figure 5. A three types reduced forest (f , c f ), the three marked subforests f (1) , f (2) , f (3) of (f , c f ) and the coding sequences x (1) , x (2) , x (3) . Here we have set ∆x

(2) 4 = (0, -1, 2), △x (2) 5 = (0, -1, 0). f (3)
(i) k = x (i) k -x (i) k-1 .
according to the reconstruction procedure. Thus, doing so, we necessarily end up with a tree from the sequences (x

(i) k , 0 ≤ k ≤ k ′ i ), i ∈ [d],
and this tree is complete, that is none of its leaves is marked. Then since the reconstruction procedure obtained by inverting (2.5), gives a unique tree, we necessarily have k ′ = k.

Then let r = (r 1 , . . . , r d ) ∈ Z d + . Assume with no loss of generality that the root of the first tree t 1 of (f , c f ) has color 1. Let k 1 i be the number of subtrees of type i in t 1 . From Lemma 2.2, the system (r 1 , x), where r 1 := (1, 0, . . . , 0), admits a smallest solution. Moreover from the reconstruction procedure which is described above, this solution is

k 1 = (k 1 1 , . . . , k 1 d ).
Suppose now with no loss of generality that the second tree, t 2 in (f , c f ) has color 2. Let k 2 i be the number of subtrees of type i in t 2 . Then from the same arguments as for the reconstruction of the first tree, t 2 may be reconstructed from the system (r 2 , y), where r 2 := (0, 1, 0, . . . , 0) and y i,j (k) = x i,j (k

1 i + k) -x i,j (k 1 i ), k ≥ 0. Moreover (r 2 , y) admits k 2 = (k 2 1 , . . . , k 2
d ) as a smallest solution. Then from part (ii) of Lemma 2.2, k 1 +k 2 is the smallest solution of the system (r 1 +r 2 , x). So we have proved the result for the forest consisting of the trees t 1 and t 2 . Then by iterating these arguments for each tree of (f , c f ), we obtain that x ∈ Sr d .

Conversely, let c = (c 1 , . . . , c r ) ∈ C r d , x ∈ Sr d and let k = (k 1 , . . . , k d ) be the smallest solution of the system (r, x). Then let us show that there is a forest (f , c f ) ∈ Fr d such that Ψ((f , c f )) = x and c (f ,c f ) = c. Assume, without loss of generality that c 1 = 1. From Lemma 2.2 (ii), there is a smallest solution, say k 1 = (k 1 1 , . . . , k 1 d ), to the system (r 1 , x), where r 1 := (1, 0, . . . , 0). Then we may reconstruct a unique forest (t 1 , c t 1 ) ∈ F1 d (consisting in a single tree) such that Ψ((t

1 , c t 1 )) = (x i,j k , 0 ≤ k ≤ k 1 i , i, j ∈ [d]
) and c (t 1 ,c t 1 ) = 1 by inverting the procedure that is described in (2.5). Assume for instance that c 2 = 2 and set r 2 := (1, 1, 0, . . . , 0) ≤ r, then from Lemma 2.2 (ii), there is a smallest solution, say k 2 , to the system (r 2 , x). Moreover, k 3 = k 2 -k 1 is the smallest solution of the system (r 2 -r 1 , y), where y i,j (k) = x i,j (k

1 i + k) -x i,j (k 1 i ), k ≥ 0.
Then as before, we can reconstruct a unique tree (t 2 , c t 2 ) such that Ψ((t 2 , c t 2 )) = y and such that the forest

f = {t 1 , t 2 } satisfies Ψ(( f , c f )) = (x i,j k , 0 ≤ k ≤ k 2 i , i, j ∈ [d]
) and c ( f ,c f ) = (1, 1, 0, . . . , 0). Then iterating these arguments, we may reconstruct a unique forest n d ) and recall from (2.8), the definition of the associated sequence x, with length k = (k 1 , . . . , k d ), such that k i = -min 0≤n≤n i x i,i n . Lemma 2.6. Let r ∈ Z d + , such that r > 0 and x ∈ S d , with length n ∈ N d and set

(f , c f ) ∈ F r d such that Ψ((f , c f )) = x and c (f ,c f ) = c. ✷ Let x ∈ S d with length n = (n 1 , . . . ,
k i = -min 0≤n≤n i x i,i n , i ∈ [d].
If n is the smallest solution of the system (r, x) (i.e. x ∈ S r d ), then k = (k 1 , . . . , k d ) is the smallest solution of the system (r, x). Conversely, if

n i = τ (i) k i , for all i ∈ [d]
and if k is the smallest solution of (r, x), (i.e. x ∈ Sr d ), then n is the smallest solution of (r, x).

Proof. Assume that n is the smallest solution of the system (r, x). Then from part (i) of Lemma 2.2, n i = τ (i) k i , hence k is a solution of (r, x). Let k ′ ≤ k be such that

r j + d i=1 xi,j (k ′ i ) = 0 , j = 1, 2, . . . d .
Then by definition of x there is

n ′ ≤ n such that n ′ i = τ (i) k ′ i and r j + d i=1 x i,j (n ′ i ) = 0 , j = 1, 2, . . . d . So n ′ = n and hence k ′ = k.
The converse is proved in the same way. Suppose that

n i = τ (i) k i , i ∈ [d],
and that k is the smallest solution of (r, x). Then clearly, n is a solution of (r, x). Let n ′ be the smallest solution of (r, x). Then from Lemma 2.2, there is

k ′ such that n ′ i = τ (i) k ′ i
, hence k ′ is a solution of (r, x). This implies that k ≤ k ′ , so that n ≤ n ′ , hence n = n ′ . ✷ Now we extend the application Φ defined in Lemma 2.5 to the set F r d . Here is the main result of this section, that can be considered as an extension of Proposition 1.1 in [START_REF] Gall | Random trees and applications[END_REF].

Theorem 2.7. Let r = (r 1 , . . . , r d ) ∈ Z d + , be such that r > 0, then the mapping

Φ : F r d → S r d × C r d (f , c f ) → Ψ((f , c f )), c (f ,c f )
is a bijection.

Proof.

Let us first check that for any

(f , c f ) ∈ F r d , we have Φ((f , c f )) ∈ S r d × C r d . By definition 2.3, (i), c (f ,c f ) ∈ C r d . Now set x = Ψ((f , c f ))
and let (f r , c fr ) ∈ Fr d be the forest, (f , c f ) once reduced. Then from (2.9) and Lemma 2.5, this reduced forest is encoded by (x, c f ). Let k = (k 1 , . . . , k d ) be the number of subtrees of type i in this forest (this is actually the number of vertices of type i), then k is the length of x and it is the smallest solution of (r, x), i.e. x ∈ Sr d . Moreover n = (n 1 , . . . , n d ), where

n i = τ (i)
k i is the length of x, and from Lemma 2.6, it is the smallest solution of (r, x). So, we have proved that

Ψ((f , c f )) ∈ S r d . Conversely let (x, c) ∈ S r d × C r d .
From Lemma 2.5, to (x, c), we may associate a unique forest (f r , c fr ) ∈ Fr d . Then let k i be the number of vertices of type i in this forest. For

k ∈ [k i ], let u (i)
k be the k-th vertex of type i in the breadth first search order of (f r , c fr ). Then in (f r , c fr ), we replace the vertex u

(i)
k by the subtree of type i which is encoded by the Lukasiewicz-Harris path (x i,i (τ

(i) k-1 + l) + k -1 , 0 ≤ l ≤ τ (i) k -τ (i) k-1 )
. We know about the progeny of each vertex of this subtree, thanks to the chains (x i,j (τ

(i) k-1 + l) -x i,j (τ (i) k-1 ) , 0 ≤ l ≤ τ (i) k -τ (i) k-1
), so that we can graft at the proper place, on this subtree, all the corresponding subtrees of the other types which have been constructed from the same procedure. Proceeding this way, we construct a unique forest (f , c f ) ∈ F r d and we easily check that Ψ((f , c f )) = x. ✷

Multitype branching trees and forests

Let ν i , i ∈ [d] be distributions on Z d + , such that ν = (ν 1 , . . . , ν d )
is the progeny law of an irreducible, critical or subcritical, non-degenarate branching process, as defined in Section 1. Assume that we can define on the reference probability space (Ω, G, P ) introduced in Section 1, a family (P c ) c∈[d] ∞ of probability measures and an infinite sequence F = (T k ) k≥1 of independent random trees, such that for each c = (c 1 , c 2 , . . . ) ∈ [d] ∞ and k ≥ 1, under P c , T k is a branching tree, with progeny law ν, whose root has type r(T k ) = c k . In particular, for any random time α : (Ω, G) → N, the sequence {T 1 , . . . , T α } is an element of F d . The infinite sequence F will be called a d-type branching forest with progeny law ν.

Let us denote by F (i) the subforest of type i of F, as it is defined in subsection 2.1. From the properties of ν, it follows that for each i ∈ [d], the subforest F (i) is a.s. infinite, so that we may define a Z d valued infinite random sequence X (i) = (X i,1 , . . . , X i,d ), for i ∈ [d], in the same way as in (2.5), that is

X (i) 0 = 0 and (3.11) X i,j n+1 -X i,j n = p j (u (i) n+1 ) , if i = j and X i,i n+1 -X i,i n = p i (u (i) n+1 ) -1 , n ≥ 0 ,
where (u

(i) n ) n≥1
is the labeling of F (i) in its breadth first search order.

Theorem 3.1. Let F be a d-type branching forest with progeny law ν.

1. Then for any c = (c 1 , c 2 . . . ) ∈ [d] ∞ , under P c , the chains (3.12)

X (i) = (X i,1 , . . . , X i,d ) , i = 1, . . . , d
are independent random walks with step distribution P c X (i) 1 = (q 1 , . . . , q d ) = ν i (q 1 , . . . , q i-1 , q i + 1, q i+1 , . . . , q d ) .

In particular, their laws do not depend on c. For each i ∈ [d], X i,i is a downward skip free random walk such that lim inf n→+∞ X i,i n = -∞, a.s. and for j = i, X i,j is a renewal process. 2. For all integer r ≥ 1, almost surely there is r ∈ Z d + , with r = r 1 + • • • + r d and such that there is a smallest solution n to the system (r, X). 3. Conversely, let Y be a copy of X and c = (c 1 , c 2 . . . ) ∈ [d] ∞ . Then to Y and c, we may associate a unique d-type branching forest, with progeny law ν and root type sequence c, whose coding random walk is Y .

Proof. Part 1. just follows from the construction (3.11) of X. Since the order on the subforests F (i) does not depend on the particular topology of F, from the branching property, it is clear that the chains X (i) , i ∈ [d] are independent random walks. Then the expression of the law of X (i) is a direct consequence of (3.11). Recall that X i,i is the Lukasiewicz-Harris path of the subforest F (i) , see section 6.2 of [START_REF] Pitman | Combinatorial Stochastic Processes[END_REF]. Moreover, since from the properties of ν, each subforest F (i) is a.s. infinite, the random walk X i,i satisfies lim inf n→∞ X i,i n = -∞, a.s. The fact that X i,j , for i = j is a renewal process is obvious.

Then part 2 is a direct consequence of the construction of X and Theorem 2.7. Let r ≥ 1 and first assume that the finite forest {T 1 , . . . , T r } consisting in the first r trees of F contains at least one vertex of each type. Let r be the unique element of Z d such that {T 1 , . . . , T r } ∈ F r d . Then, by coding the forest {T 1 , . . . , T r } and by applying Theorem 2.7, we obtain that there is n ∈ N d which is the smallest solution of the system (r, X). Now if for instance n ∈ [d -1] types are missing in the first r trees of F, then we can apply the same arguments by replacing d by dn in Theorem 2.7.

Then part 3. is a consequence of part 2. For each r ≥ 1, we may associate a unique forest to Y with r trees. Since r can be arbitrarily large, the result is proved. ✷ In the same spirit as in [START_REF] Miermont | Invariance principles for spatial multitype Galton-Watson trees[END_REF], the Lukasiewicz-Harris type coding that is displayed in Theorem 3.1 might be used to obtain invariance principles, for any functional that can be encoded simply enough. Besides this result should provide a way to obtain a proper definition of continuous multitype branching trees and forests. Actually, it is natural to think that the latter objects are coded by d independent, d-dimensional Lévy processes, with d -1 increasing coordinates and a spectrally positive coordinate. Now we are going to apply our coding of multitype branching forests to the law of their total population and give a proof of Theorem 1.2. To that aim, we first need to establish the crucial combinatorial Lemma 3.3. Let E be Z + or a finite integer interval of the type {0, 1, . . . , m}, with m ≥ 1 and let g : E → Z d , be any application such that g(0) = 0. For n ∈ E such that n ≥ 1, the n-cyclical permutations of g are the n applications g q,n , q = 0, . . . , n -1 which are defined on E by: (3.13) g q,n (h)

(def) =          g(q + h) -g(q) if 0 ≤ h ≤ n -q , g(h -(n -q)) + g(n) -g(q) if n -q ≤ h ≤ n g(h) if h ≥ n .
Note that g 0,n ≡ g. The transformation g → g q,n consists in inverting the parts {g(h), 0 ≤ h ≤ q} and {g(h), q ≤ h ≤ n} in such a way that the new application, g q,n , has the same values as g at 0 and n, i.e. g q,n (0) = 0 and g q,n (n) = g(n).

Let x ∈ S d , with finite length n = (n 1 , . . . , n d ) ∈ N d and recall the notation x (i) = (x i,1 , . . . , x i,d ) from Definition 2.1. Then we define the n-cyclical permutations of x by (3.14) x q,n := (x (1) q 1 ,n 1 , . . . , x (d) q d ,n d ) , for all q = (q 1 , . . . , q d ) such that 0 ≤ q ≤ n -1 d , where we have set 1 d = (1, 1, . . . , 1). Each sequence x q,n will simply be called a cyclical permutation of x. Note that there are n 1 n 2 . . . n d , cyclical permutations of x. Let r = (r 1 , . . . , r d ) ∈ Z d + be such that r > 0 and assume that n is a solution of the system (r, x). Then note that n is also a solution of the system (r, x q,n ), for all q such that 0 ≤ q ≤ n-1 d , that is,

r j + d i=1 x i,j q,n (n i ) = 0 , j ∈ [d] .
This remark raises the question of the number of cyclical permutations x q,n of x, such that n is the smallest solution of the system (r, x q,n ).

Definition 3.2. Let x ∈ S d , with finite length n = (n 1 , . . . , n d ) ∈ N d . Let r = (r 1 , . . . , r d ) ∈ Z d
+ be such that r > 0 and assume that n is a solution of the system (r, x). For 0 ≤ q ≤ n -1 d , we say that x q,n is a good n-cyclical permutation of x with respect to r, if n is the smallest solution of the system (r, x q,n ), that is x q,n ∈ S r d . When no confusion is possible, we will simply say that x q,n is a good cyclical permutation of x.

This definition and the next lemma extend the following argument developed in [START_REF] Takács | A generalization of the ballot problem and its application in the theory of queues[END_REF] for the proof of the Ballot Theorem: For an integer valued sequence (x k , 0 ≤ k ≤ n) such that ∆x k ≥ -1 and x 0 = 0, x n = -k, there are exactly k cyclical permutations x q,n such that x q,n first hits -k at time n. Here is a generalisation of this result. + be such that r > 0. Assume that n is a solution of the system (r, x) such that x i,i (n i ) = 0, for all i ∈ [d]. Then the number of good cyclical permutations of x is det((-x i,j (n i )) i,j∈ [d] ). This lemma will be proved in Section 4. It is the essential argument for the proof of the following extension of the Ballot Theorem. Theorem 3.4 (Multivariate Ballot Theorem). Let Y = (Y (1) , . . . , Y (d) ) be a stochastic process defined on (Ω, G, P ), with

Y (i) = (Y i,j (h), j ∈ [d], h ∈ Z + ), i ∈ [d] and Y 0 = 0.
We assume that the coordinates Y i,j , for i = j are Z + valued, nondecreasing and that the coordinates Y i,i are Z valued and downward skip free. Fix n = (n 1 , . . . , n d ) ∈ N d , then we assume further that the process Y is n-cyclically exchangeable, that is for any

q = (q 1 , . . . , q d ) ∈ Z d + such that q ≤ n -1 d , Y q,n (law)
= Y , where Y q,n is defined as in (3.14) for deterministic functions. Then for any r = (r 1 , . . . , r d ) ∈

Z d + such that r > 0 and k ij , i, j ∈ [d], such that k ij ∈ Z + , for i = j and -k jj = r j + i =j k ij , P Y i,j n i = k ij , i, j ∈ [d] and n is the smallest solution of (r, Y ) = det(-k ij ) n 1 n 2 . . . n d P Y i,j n i = k ij , i, j ∈ [d] . (3.15)
On the other hand, since from Theorem 3.1, the random walks X (i) , i ∈ [d] are independent, we have

P c X i,j n i = k ij , i, j ∈ [d]
and n is the smallest solution of (r, X)

= det(-k ij ) n 1 n 2 . . . n d d i=1 P X i,j n i = k ij , j ∈ [d] .
Then from the expression of the law of X given in Theorem 3.1, we obtain

P c X i,j n i = k ij , i, j ∈ [d]
and n is the smallest solution of (r, X)

= det(-k ij ) n 1 n 2 . . . n d d i=1 ν * n i i (k i1 , . . . , k i(i-1) , n i + k ii , k i(i+1) , . . . , k id ) , (3.18)
and the result is proved in this case. Now with no loss of generality, let us assume that for some 0

< d ′ < d, we have n 1 , . . . , n d ′ ∈ N and n d ′ +1 = • • • = n d = 0.
We point out that from the assumption n j ≥ -k jj = r j + i =j k ij , in this case we necessarily have r j = 0 and k ij = 0, for all i ∈ [d] and j = d ′ + 1, . . . , d. Then provided we also have

k ij = 0, for all i = d ′ + 1, . . . , d and j ∈ [d], i = j, P c X i,j n i = k ij , d ′ + 1 ≤ i ≤ d, j ∈ [d] = d i=d ′ +1 ν * n i i (k i1 , . . . , k i(i-1) , n i + k ii , k i(i+1) , . . . , k id ) = 1 .
Define the chain X restricted to Z d ′ , by X ′ = (X ′ (1) , . . . , X ′ (d ′ ) ), where X

′ (i) = (X i,1 , . . . , X i,d ′ ), i ∈ [d ′ ].
Set also n ′ = (n 1 , . . . , n d ′ ) and r ′ = (r 1 , . . . , r d ′ ). Then under our assumption on the integers k ij , the following identity is satisfied,

X i,j n i = k ij , i, j ∈ [d]
and n is the smallest solution of (r, X)

= X ′i,j n i = k ij , i, j ∈ [d ′ ]
and n ′ is the smallest solution of (r ′ , X ′ ) and

X i,j n i = 0, 1 ≤ i ≤ d ′ , d ′ + 1 ≤ j ≤ d ,
so that identity (3.17) can be rewritten as,

P r O 1 = n 1 , . . . , O d = n d , A ij = k ij , i, j ∈ [d], i = j = P c X ′i,j n i = k ij , i, j ∈ [d ′ ]
and n ′ is the smallest solution of (r ′ , X ′ ) and

X i,j n i = 0, 1 ≤ i ≤ d ′ , d ′ + 1 ≤ j ≤ d .
Moreover, conditionally on the set

X ′i,j ′ n i = k ij ′ , X i,j n i = 0, i, j ′ ∈ [d ′ ], d ′ + 1 ≤ j ≤ d ,
the chain X ′ is cyclically exchangeable, so that we can conclude in the same way as above that

P r O 1 = n 1 , . . . , O d = n d , A ij = k ij , i, j ∈ [d], i = j = det((-k ij ) 1≤i,j≤d ′ ) n 1 n 2 . . . n d ′ d ′ i=1 ν * n i i (k i1 , . . . , k i(i-1) , n i + k ii , k i(i+1) , . . . , k id ) = det((-k ij ) 1≤i,j≤d ′ ) n 1 n 2 . . . n d ′ d i=1 ν * n i i (k i1 , . . . , k i(i-1) , n i + k ii , k i(i+1) , . . . , k id ) .
Finally, if k ij = 0, for some i = d ′ + 1, . . . , d and j ∈ [d], then the first and the third members of the above equality are equal to 0. So the proof is complete. ✷ 4. Proof of Lemmas 2.2 and 3.3

Proof of Lemma 2.2. Assume that there is a solution s = (s 1 , . . . , s d ) to the system (r, x), that is:

r j + d i=1 x i,j (s i ) = 0, j ∈ [d].
Let us write this equation in the following form:

r j + i =j
x i,j (s i ) + x j,j (s j ) = 0 , j = 1, . . . , d .

Then recall that for fixed j, when the k i 's increase, the term i =j x i,j (k i ) increases and when k j increases, the term x j,j (k j ) may decrease only by jumps of amplitude -1.

For k = (k 1 , . . . , k d ) = 0, we have r j + i =j x i,j (k i ) + x j,j (k j ) = r j , j ∈ [d].
So for the left hand side of the later equation to reach 0, each k i has to be at least τ (i) (r i ), where τ (i) has been defined in (2.7). (In this proof, we found it more convenient to use the notation

τ (i) (k) for τ (i) k .) Then either r j + i =j
x i,j (τ (i) (r i )) + x j,j (τ (j) (r j )) = 0 , j = 1, . . . , d , or all of the terms r j + i =j x i,j (τ (i) (r i )) + x j,j (τ (j) (r j )), j ∈ [d] are greater or equal than 0, at least one of them being strictly greater than 0.

Then in the latter case, for r j + i =j x i,j (k i ) + x j,j (k j ) to attain 0, each of the k j 's has to be at least τ (j) (r j + i =j x i,j (τ (i) (r i ))). This argument can be repeated until all of the terms r j + i =j x i,j (k i ) + x j,j (k j ) attain 0. More specifically, set v

(j) 1 = r j and for n ≥ 1, v (j) n+1 = r j + i =j x i,j (τ (i) (v (i) n )) ,
and set k

(n) j = τ (j) (v (j) n ). For n ≥ 1, either r j + i =j x i,j (k (n) i ) + x j,j (k (n) j ) = 0 , j = 1, . . . , d ,
or all of the terms r j + i =j x i,j (k

(n) i ) + x j,j (k (n) j ), j ∈ [d]
are greater or equal than 0, at least one of them being strictly greater than 0. In the later case, for all of the terms r j + i =j x i,j (k i ) + x j,j (k j ), j ∈ [d] to vanish, the index k has to be at least

k (n+1) = (k (n+1) 1 , . . . , k (n+1) d
). But since there is a solution s to the equation (r, x), there is necessarily a finite index n 0 such that k (n 0 ) ≤ s and

r j + i =j x i,j (k (n 0 ) i ) + x j,j (k (n 0 ) j ) = 0 . That is, for all j ∈ [d], k (n 0 ) j = τ (j) (r j + i =j x i,j (k (n 0 ) i
)). Hence k (n 0 ) is the smallest solution of the system (r, x). Moreover by definition, k

(n 0 ) i = min{n : x i,i n = min 0≤k≤k (n 0 ) i x i,i k }.
This proves the first part of the lemma.

Let r ′ = (r ′ 1 , . . . , r ′ d ) ∈ Z d + be such that r ′ ≤ r. Then we prove that there is a smallest solution to the system (r ′ , x) similarly. More specifically, since there is a smallest solution to the equation

r ′ j + i =j
x i,j (s i ) + x j,j (s j ) = r ′ jr j ≤ 0 , j = 1, . . . , d , then by the same arguments as in the first part, we prove that there is a smallest solution to the equation r ′ j + i =j

x i,j (s i ) + x j,j (s j ) = 0 , j = 1, . . . , d .

Let k and k ′ be respectively the smallest solutions of (r, x) and (r ′ , x). Then we have,

r j -r ′ j + r ′ j + d i=1 x i,j (k ′ i ) + d i=1 xi,j (k i -k ′ i ) = 0 .
Since r ′ j + d i=1 x i,j (k ′ i ) = 0, the above equation shows that k -k ′ is a solution of the system (r -r ′ , x). Moreover, if k ′′ was a strictly smaller solution of (r -r ′ , x), than k -k ′ (i.e. k ′′ < k -k ′ ) then we would have

r j -r ′ j + r ′ j + d i=1 x i,j (k ′ i ) + d i=1 xi,j (k ′′ i ) = r j + d i=1 x i,j (k ′ i + k ′′ i )
= 0 , so that k ′ + k ′′ would be a solution of (r, x), strictly smaller than k, which is a contradiction. ✷

Proof of Lemma 3.3. Recall from Lemma 2.5 that to each forest (f , c f ) ∈ Fr d , we can associate a system (r, x), with smallest solution k, where x ∈ Sr d . The matrix (k ij ) = (x i,j (k i )) of the last values of x will be called the LV-matrix of x or the LVmatrix of the forest (f , c f ). Recall that k j = -k jj = r j + i =j k ij and that for i = j, k ij is the total number of vertices in v(f ) with type j, whose parent has type i and that k i = -k ii is the total number of vertices of type i in v(f ).

For the next definition, we say that the integers a 1 , . . . , a n are ranked in the increasing order, up to a cyclical permutation, if there is a cyclical permutation σ of the set [n], such that a σ(1) , . . . , a σ(n) are ranked in the increasing order. Definition 4.1. Let r ∈ Z d + be such that r > 0. 1. An element (f , c f ) of Fr d is said to be a simple forest if for each type i ∈ [d], at most one vertex of type i in v(f ) has children (the others are leaves) and if its vertices are labelled in the following way: To each vertex of type i, we associate a different integer in [k i ] which is called its label. For each i, the sequence of appearance of labels of vertices of type i in the breadth first search of (f , c f ) is ranked in the increasing order, up to a cyclical permutation, see Figure 6. 2. For x ∈ Sr d , the system (r, x), with smallest solution k = (k 1 , . . . , k d ) is called a simple system if for all i ∈ [d], there is k ′ i ≤ k i -1, such that for all k = 0, . . . , k ′ i and i = j, x i,j (k) = 0 and for all k such that k

′ i + 1 ≤ k ≤ k i and i = j, x i,j (k) = x i,j (k i ).
In other words, simple systems are elements x ∈ Sr d such that for all i ∈ [d], the sequences x i,j , j ∈ [d] have at most one positive jump that occurs at the same point in {0, . . . , k i }.

Then we have the following straightforward result. Proposition 4.2. If a forest is simple, then its associated system (as defined in Lemma 2.5) is simple.

Proof.

Recall the notation of the beginning of Subsection 2.2. If (f , c f ) is a simple forest, then for each i, there is at most one index k = 0, . . . , k i -1 such that x i,j k+1x i,j k = p j (u

(i) k+1 ) > 0, for some j ∈ [d], (j = i). That is for all k ′ = k and j ∈ [d], x i,j k ′ +1 -x i,j k ′ = 0. ✷ Definition 4.
3. An elementary forest is a forest of F d that contains exactly one vertex of each type. In particular, each elementary forest contains exactly d vertices and is coded by the d couples (j i , i), i ∈ [d], where j i is the type of the parent of the vertex of type i. If the vertex of type i is a root, then we set j i = 0. We define the set D of vectors (j 1 , . . . , j d ), 0 ≤ j i ≤ d such that (j i , i), i ∈ [d] codes an elementary forest. + such that r > 0 and let (r, x) be a simple system with smallest solution k = (k 1 , . . . , k d ) ∈ N d , then the number of good cyclical permutations of x is

(4.19) (j 1 ,...,j d )∈D d i=1 k j i i ,
where for i, j ∈ [d], k ij = x i,j (k i ) and where we have set k 0i = r i .

Proof.

The proof will be performed by reasoning on forests. Let (r, x) be as in the statement. From Lemma 2.5 we can associate to (r, x) a forest (f , c f ) of Fr d such that for each type i ∈ [d], at most one vertex of type i in v(f ) has children (the others are leaves). Then by labeling all the vertices of this forest in the breadth first search order, we obtain a simple forest, see Definition 4.1. Note that for each good cyclical permutation x q,k of x, the system (r, x q,k ) is simple itself and to each one, we may associate a unique simple forest which is obtain by cyclical permutations of the vertices of type i in (f , c f ), for each i. Conversely, recall Proposition 4.2, then the simple system (r, y) which is associated to each simple forest with LV-matrix (k ij ) through Lemma 2.5 is necessarily obtained from a good cyclical permutation of x. Indeed the corresponding sequences y i,j , for i = j, have exactly one jump and are such that y i,j (k i ) = k ij . So y is nothing but a cyclical permutation of x. These arguments prove that the number of good cyclical permutations of x is equal to the number of simple forests with LV-matrix (k ij ).

Then we are going to prove that the number of simple forests with LV-matrix (k ij ) is (j 1 ,...,j d )∈D d i=1 k j i i . We make the additional assumption that for each i, there is exactly one vertex who has children. Then observe that to each simple forest, we can associate a unique elementary forest in the following way: the vertex of type j in the elementary forest is the parent of the vertex of type i if, in the simple forest the parent of the vertex of type i that has children has type j (recall that j = 0 if the vertex of type i is a root). An example of an elementary forest associated to a simple forest is given in Figure 6. Then let (j 1 , . . . , j d ) ∈ D. We easily see that the monomial d i=1 k j i i is the number of simple forests such that for each i, the parent of the vertex of type i who has children has type j i . Indeed, there are k j i i possibilities to choose the vertex of type i that has children. In other words, d i=1 k j i i is the number of all possible simple forests to which we can associate the same elementary forest which is coded by (j i , i), i ∈ [d]. Then in order to obtain the total number of simple forests with LV-matrix (k ij ), it remains to perform the summation of these monomials over all the possible elementary forests. So we obtained the formula of the statement, under our additional assumption.

Then we have proved the result for simple systems such that for all i ∈ [d], there is j = i with k ij > 0. Now assume that for all i ∈ [d -1], there is j = i such that k ij > 0 and that k dj = 0, for all j ∈ [d]. Then in such a system, we have x (d) ≡ 0. Let us consider the system (r ′ , x ′ ), where r ′ = (r 1 , . . . , r d-1 ) and x ′ = (x (1) , . . . , x (d-1) ). From what has just been proved, the number of good cyclical permutation of (r

′ , x ′ ) is h d-1 := (j 1 ,...,j d-1 )∈D ′ d-1 i=1 k j i i
where D ′ is the set that is defined in Definition 4.3 and where we replaced d by d -1. Then in order to obtain all the good cyclical permutations of x it remains to consider the k d cyclical permutations of the sequence x (d) . Since the latter are all identical, we have actually k d ×h d-1 good cyclical permutations of x. Then we conclude by noticing that k

d ×h d-1 = (j 1 ,...,j d )∈D d i=1 k j i i , since k d = r d + i =d k id = d i=0, i
= r j + i =j k ij , j ∈ [d], det(-k ij ) = (j 1 ,...,j d )∈D d i=1 k j i i ,
where the set D is defined in Definition 4.3 and k 0i = r i .

Proof. The proof is a direct consequence of the matrix tree theorem for directed graphs, due to Tutte [START_REF] Tutte | The dissection of equilateral triangles into equilateral triangles[END_REF], see Section 3.6, page 470 therein. However, Theorem 3.1 in [START_REF] Moon | Some determinant expansions and the matrix-tree theorem[END_REF] that implies Tutte's theorem is actually easier to apply, since it uses a setting which is closer to ours. Let us consider a set {v 0 , v 1 , . . . , v d } of d + 1 vertices and in the notations of [START_REF] Moon | Some determinant expansions and the matrix-tree theorem[END_REF], set W = L = {v 0 }. Then the family F W,L that is described in Theorem 3.1 of [START_REF] Moon | Some determinant expansions and the matrix-tree theorem[END_REF] is in bijection with the set of elementary forests, or equivalently with the set D, and identity (3.2) in this theorem is exactly det(-k ij ) = (j 1 ,...,j d )∈D + be such that r > 0 and assume that k is a solution of the system (r, x). Assume moreover that x i,i k = -k, for all k = 0, . . . , k i and i ∈ [d]. Then the number of good cyclical permutations of x is det((x i,j (k i )) i,j∈ [d] ).

Proof. Let x be as in the statement. If for all i ∈ [d], the sequences x i,j , j ∈ [d] have at most one positive jump that occurs at the same point in {0, . . . , k i }, then from Definition 4.1, Lemma 4.4 and Lemma 4.5, there is a cyclical permutation x ′ of x such that (r, x ′ ) is a simple system and the result follows in this case. In general, let us prove that there is a simple system, with LV-matrix (x i,j (k i )), and whose number of good cyclical permutations is the same as this of x.

Fix any index m ∈ [d] and assume without loss of generality, that m = 1, and

x m,1 (k m )x m,1 (k m -1) > 0.

From x, we define a new sequence x ∈ S d with length k as follows: All the other coordinates remain unchanged, that is, xi,j (k) = x i,j (k) , i, j = 1, . . . , d , k = 1, . . . , k i , i = m .

The sequence x is obtained from x by decreasing by one unit, the last jump of the coordinate x m,1 , that is x m,1 (k m )x m,1 (k m -1). (Therefore the jump x m,1 (k m -1)x m,1 (k m -2) is increased by one unit.) Denote by N r,x the number of good cyclical permutations of x. We claim that (4.21) N r,x ≥ N r,x .

To achieve this aim, first observe that k is a solution of the system (r, x), that is

r j + d i=1
xi,j (k i ) = 0 , j = 1, . . . , d , and note the straightforward inequality, xi,j (k) ≥ x i,j (k) , i, j = 1, . . . , d , k = 1, . . . , k i .

Therefore, if k is the smallest solution of (r, x) then it is also the smallest solution of (r, x). Moreover, for q = (q 1 , . . . , q d ) ∈ N d satisfying q m < k m -1, one easily checks that the same inequality holds, that is xi,j q,k (k) ≥ x i,j q,k (k) , i, j = 1, . . . , d , k = 1, . . . , k i , so that if k is the smallest solution of (r, x q,k ) (i.e. x q,k is a good cyclical permutation of x) then it is also the smallest solution of (r, xq,k ).

Now it remains to study the case where q m = k m -1. Assume that x q,k is a good cyclical permutation of x, but that xq,k is not a good cyclical permutation of x. Then in order to obtain the inequality (4.21), we have to find a good cyclical permutation xl,k of x such that x l,k is not a good cyclical permutation of x. Let us define the sequence x ∈ S d with length k, which is obtained by decreasing by one unit the first coordinate of x

(m) q,k , that is    x(i) ≡ x (i) q,k , i = m , x(m) (k) = x (m)
q,k (k)e 1 , k ≥ 1 , where e 1 = (1, 0, • • • , 0), is the d dimensional unit vector. Since k is the smallest solution of (r, x q,k ), then k is the smallest solution of (r + e 1 , x) by the definition of x. Moreover, from Lemma 2.2 (ii), the system (e 1 , x) admits a smallest solution which is less than k. Let us call p this solution. Then p > 0 and from Lemma 2.2 (ii), k -p is the smallest solution of (r, xp,k ).

Then let us consider the cyclical permutation of xq,k at p. It is a cyclical permutation of x that we shall denote by xl,k . Note that x and xq,k only differ from the last jump of xm,1 and xm,1 q,k , more specifically, xq,k (k m ) -xq,k (k m -1) = x(k m ) -x(k m -1) + 1. Then from the above constructions, we can see that xl,k is obtained as follows: Moreover, also from the construction of (r, xl,k ), since p is the smallest solution of (e 1 , x), the only solution of (r, xl,k ) on the interval [k -p, k] is k. Therefore, the smallest solution of (r, xl,k ) is k.

x(i) l,k (k) =              x(i) p,k (k), k ≤ k i -p i , i = m, x(m) p,k (k), k < k m -p m , x(i) p,k (k i -p i ) + x(i) (k -(k i -p i )), k i -p i ≤ k ≤ k i , i = m, x (m
On the other hand, note the following identity

x i,j l,k (k), i, j ∈ [d], k ∈ [k i -p i ] = xi,j p,k (k), i, j ∈ [d], k ∈ [k i -p i ] ,
which can be seen directly from the definition of x. It follows that k -p is the smallest solution of the system (r, x l,k ). But since p > 0, the sequence x l,k is not a good permutation of x, and the inequality (4.21) is proved.

Let q = (0, . . . , 0, k m -1, 0 . . . , 0), where k m -1 is the m-th coordinate of q and set y := xq,k , then by applying the same arguments as above to the chain y, we obtain that N r,ỹ ≥ N r,y = N r,x ≥ N r,x ,

Figure 1 .

 1 Figure 1. A forest labeled according to the breath first search order and the associated Lukasiewicz-Harris coding path.

  n ), n ≥ 0}, as a Z d + valued Markov chain with transition probabilities:P (Z n+1 = (k 1 , . . . , k d ) | Z n = (r 1 , . . . , r d )) = ν * r 1 1 * • • • * ν * r d d (k 1 , . . . , k d ), where ν i are distributions on Z d

  below.

3 22Figure 2 .

 32 Figure 2. A two type forest labeled according to the breath first search order. Vertices of type 1 (resp. 2) are represented in white (resp. black).

  t

Definition 2 . 3 .

 23 Let r = (r 1 , . . . , r d ) ∈ Z d + , such that r > 0. (i) We denote by F r d , the subset of F d of forests (f , c f ) with r 1 + • • • + r d trees, which contain at least one vertex of each type, and such that c (f ,c f ) ∈ C r d . (ii) We denote by Fr d the subset of F r d , of reduced forests. More specifically, (f , c f ) ∈ Fr d if (f , c f ) ∈ F r d and if for each i, vertices of type i ∈ [d] in v(f ) have no child of type i. Then we define the sets of coding sequences related to F r d and Fr d . Definition 2.4. Let r = (r 1 , . . . , r d ) ∈ Z d + be such that r > 0. (i) We denote by S r d the subset of S d of sequences x whose length belongs to N d and corresponds to the smallest solution of the system (r, x) defined in (2.10). (ii) We denote by Sr d the subset of S r d consisting in sequences, such that x i,i k = -k, for all k and i. Then we first establish a bijection between the sets Fr d and Sr d × C r d . Recall the definition of Ψ in (2.6). Lemma 2.5. Let r = (r 1 , . . . , r d ) ∈ Z d

type 1 type 2 x ( 3 )

 23 : △x(3) 1 = (0, 1, -1), △x

Lemma 3 . 3 (

 33 Multivariate Cyclic Lemma). Let x ∈ S d , with length n = (n 1 , . . . , n d ) ∈ N d and let r = (r 1 , . . . , r d ) ∈ Z d

Lemma 4 . 4 .

 44 Let r = (r 1 , . . . , r d ) ∈ Z d

4 ⇓Figure 6 .

 46 Figure 6. A simple forest and its associated elementary forest.

d i=1 k j i i . ✷ Lemma 4 . 6 .

 46 Let x ∈ S d , with length k = (k 1 , . . . , k d ) ∈ N d . Let r = (r 1 , . . . , r d ) ∈ Z d

  xm,j (k) = x m,j (k) , j = 2, . . . , d, k = 1, . . . , k m , xm,1 (k) = x m,1 (k) , k = 1, . . . , k m -2, k m , xm,1 (k m -1) = x m,1 (k m -1) + 1.

  ) p,k (k mp m ) + x(m) (k -(k mp m )) + e 1 , k mp m ≤ k ≤ k m .Since k -p is the smallest solution of (r, xp,k ) and since xl,k is strictly greater than xp,k at point k -p, there is no solution to (r, xl,k ), on the (multidimensional) interval [0, k -p].

  =d k id . The general case where k ij = 0, for all j ∈ [d], for other types i is obtained in the same manner.Lemma 4.5. For any r ∈ Z d + and any integer valued matrix (k ij ) i,j∈[d] , such that k ij is nonnegative for i = j and -k jj

✷

It is known that expression (4.19) is a determinant, see for instance the remark after Proposition 7 in

[START_REF] Bernardi | Counting trees using symmetries[END_REF]

. This determinant is specified in the following lemma. The proof which is given here essentially aims at quoting some references from which this result can be derived.

This work was supported by MODEMAVE research project from the Région Pays de la Loire. Ce travail a bénécié d'une aide de l'Agence Nationale de la Recherche portant la référence ANR-09-BLAN-0084-01.

Proof. If P (Y i,j n i = k ij , i = j) = 0, then the result is clearly true. Suppose that it is not the case and let y = (y (1) , . . . , y (d) ) be a deterministic function such that for all i, j ∈ [d], y i,j is defined on Z + , y i,j (0) = 0, y i,j (n i ) = k ij and (3. [START_REF] Takács | A generalization of the ballot problem and its application in the theory of queues[END_REF] P (Y (i) (h), 0 ≤ h ≤ n i )) = (y (i) (h), 0 ≤ h ≤ n i ) > 0 .

For h = (h 1 , . . . , h d ) ∈ Z d + , we set Y (h) := (Y (1) (h 1 ), . . . , Y (d) (h d )) and for 0 ≤ q ≤ n -1 d , using the notation of (3.14), we set y q,n (h) := (y (1)

Then we obtain the result by summing the identity

over all functions y satisfying (3.16) and with different sets E y,n of cyclical permutations. Finally, if k ii = 0, for some i ∈ [d], then since n i ≥ 1, we can see that both members of identity (3.15) are equal to 0. ✷ Proof of Theorem 1.2: Let r, n and k ij be as in the statement. Let F be a d-type branching forest with progeny law ν, as defined at the beginning of this section and such that the first r trees have root type sequence (c 1 , . . . , c r ) ∈ C r d . Let X be the coding random walk of F, as defined in (3.11). Recall the notation of Theorem 1.2, then from the coding of Subsection 2.2 and Theorem 3.1, we may check that

and n is the smallest solution of (r, X) .

Assume first that n ∈ N d , then since X is clearly cyclically exchangeable in the sense of Theorem 3.4, we obtain by applying this theorem,

and n is the smallest solution of (r, X)

with obvious notations. But by reiterating k m times this operation, we obtain again the chain x. This shows that equality holds in (4.21), that is N r,x = N r,x . Finally, let z ∈ S d be a chain with length k, such that z i,j (k i ) = x i,j (k i ), for all i, j ∈ [d], and such that for all i ∈ [d], the sequences z i,j , j ∈ [d] have at most one positive jump that occurs at the same point in {0, . . . , k i }. Then it is easy to see that the chain x can be obtained after several cyclical permutations and iterations of the transformation (4.20) applied to z, at any coordinate. Therefore N r,z = N r,x . Assume that there is a good cyclical permutation z ′ of z. Then (r, z ′ ) is a simple system. Therefore, from Lemma 4.4 and Lemma 4.5, N r,z ′ = N r,z = N r,x = det(x i,j (k i )). ✷ Lemma 4.7. Let x ∈ S r d and let x be the sequence of Sr d which is associated to x, as in (2.8). Then x and x have the same number of good cyclical permutations.

Proof.

Let k and n be the respective lengths of x and x. In particular, we have

q i ,k i be the cyclical permutation of the sequence τ (i) , as defined in (3.13). Then from the construction of y, we can check that

, m ≤ k i , from which we derive (4.22). Moreover, since ȳ is a good cyclical permutation of x, we deduce from Lemma 2.6 that y is a good cyclical permutation of x.

Conversely, let q < n -1 d such that x q,n is a good cyclical permutation of x. Then from part (i) of Lemma 2.2, we must have n i = min{n : x i,i q i ,n i (n) = -k i }. Therefore, there exists p < k, such that q i = τ (i) p i . Again, by setting y = x q,n , we check that ȳ = xp,k and we deduce from Lemma 2.6 that ȳ is a good cyclical permutation of x. ✷

Then we end the proof of Lemma 3.3. Let x ∈ S d be as in this lemma, that is x has finite length n = (n 1 , . . . , n d ) ∈ N d and n is a solution of the system (r, x), where r =

Then n ′ ≤ n, so that we can define the cyclical permutation y = x n ′ ,n of x. By construction, the sequence ȳ has length k, where k i = -x i,i (n i ) and ȳi,j (k i ) = x i,j (n i ), i, j ∈ [d]. Note that k i ≥ 1, from the assumption x i,i (n i ) = 0. Moreover, k is a solution of the system (r, ȳ). So, thanks to Lemma 4.6, the number of good cyclical permutations of ȳ is det(x i,j (n i )) and from Lemmas 2.6 and 4.7 this is also the number of good cyclical permutations of y, the latter being clearly the number of good cyclical permutations of x. ✷