# Counting smaller trees in the Tamari order

Grégory Chatel and Viviane Pons

Laboratoire d'Informatique Gaspard Monge, Université Paris-Est Marne-la-Vallée, France

**Abstract.** We introduce new combinatorial objects, the interval-posets, that encode intervals of the Tamari lattice. We then find a combinatorial interpretation of the bilinear form that appears in the functional equation of Tamari intervals described by Chapoton. Thus, we retrieve this functional equation and prove that the polynomial recursively computed from the bilinear form on each tree $T$ counts the number of trees smaller than $T$ in the Tamari order.

**Résumé.** Nous introduisons un nouvel objet, les intervalles-posets, pour encoder les intervalles de Tamari. Nous donnons ainsi une interprétation combinatoire à la forme bilinéaire qui apparaît dans l'équation fonctionnelle des intervalles de Tamari que donne Chapoton. De cette façon, nous retrouvons d'une nouvelle manière cette équation fonctionnelle et prouvons que le polynôme calculé récursivement à partir de la forme bilinéaire pour chaque arbre $T$ compte le nombre d'arbres plus petits que $T$ dans l'ordre de Tamari.

**Keywords:** binary trees, Tamari lattice, Tamari intervals

## 1 Introduction

The combinatorics of planar binary trees has already being linked with interesting algebraic properties. Loday and Ronco first introduced the **PBT** Hopf Algebra based on these objects [9]. It was re-built by Hivert, Novelli and Thibon [7] through the introduction of the sylvester monoid. The structure of **PBT** involves a very nice object which is linked to both algebra and classical algorithmics: the *Tamari lattice*.

This order on binary trees is based on the *right rotation* operation (see Figure 1), commonly used in sorting algorithms through binary search trees. The lattice itself first appeared in the context of the associahedron [8]. As its vertices are counted by Catalan numbers, the covering relations can be described by many combinatorial objects [10], two common ones being planar binary trees and Dyck paths. Recently Chapoton gave a formula for the number of intervals [4]:

$$I_n = \frac{2(4n + 1)!}{(n + 1)!(3n + 2)!}, \qquad (1)$$

where $I_n$ is the number of intervals of the Tamari lattice of binary trees of size $n$. This formula was very recently generalized to a new set of lattices, the *m*-Tamari lattices [3].

It has been known since Björner and Wachs [2] that linear extensions of a certain labelling of binary trees correspond to intervals of the weak order on permutations. This was more explicitly described in [7] with sylvester classes. The elements of the basis **P** of **PBT** are defined as a sum on a sylvester class of elements of **FQSym**. The **PBT** algebra also admits two other bases **H** and **E** which actually correspond
to respectively initial and final intervals of the Tamari order. They can be indexed by plane forests and, with a well chosen labelling, their linear extensions are intervals of the weak order on permutations corresponding to a union of sylvester classes. In this paper, we introduce a more general object, the Tamari interval-poset, which encodes a general interval of the Tamari lattice and whose linear extensions are exactly the corresponding sylvester classes (and so an interval of the weak order). This new object has nice combinatorial properties and allows to perform computations on Tamari intervals.

Thereby, we give a new proof of the formula of Chapoton (1). This proof is based on the study of a bilinear form that already appeared in [4] but was not explored yet. It leads to the definition of a new family of polynomials:

**Definition 1.1** Let $T$ be a binary tree, the polynomial $B_T(x)$ is recursively defined by

$$B_0 := 1 \qquad (2)$$

$$B_T(x) := x B_L(x) \frac{x B_R(x) - B_R(1)}{x-1} \qquad (3)$$

where $L$ and $R$ are respectively the left and right subtrees of $T$. We call $B_T(x)$ the Tamari polynomial of $T$ and the Tamari polynomials are the set of all polynomials obtained by this process.

This family of polynomials is yet unexplored in this context but a different computation made by Chapoton [5] on rooted trees seems to give a bivariate version. Our approach on Tamari interval-posets allows us to prove the following theorem:

**Theorem 1.2** Let $T$ be a binary tree. Its Tamari polynomial $B_T(x)$ counts the trees smaller than $T$ in the Tamari order according to the number of nodes on their left border. In particular, $B_T(1)$ is the number of trees smaller than $T$.

Symmetrically, if $\tilde{B}_T$ is defined by exchanging the role of left and right children in Definition 1.1, then it counts the number of trees greater than $T$ according to the number of nodes on their right border.

This theorem will be proven in Section 3.2. In Section 2, we recall some definitions and properties of the Tamari lattice and introduce the notion of interval-poset to encode a Tamari interval. In Section 3, we show the implicit bilinear form that appears in the functional equation of the generating functions of Tamari intervals. We then explain how interval-posets can be used to give a combinatorial interpretation of this bilinear form and thereby give a new proof of the functional equation. Theorem 1.2 follows naturally. In Section 4, we give two independent contexts in which our problem can be generalized: flows of rooted trees and $m$-Tamari intervals.

# 2 Definitions of Tamari interval-posets

## 2.1 Binary trees and Tamari order

A binary tree is recursively defined by being either the empty tree ($\emptyset$) or a pair of binary trees, respectively called left and right subtrees, grafted on an internal node. If a tree $T$ is composed of a root node $x$ with $A$ and $B$ as respectively left and right subtrees, we write $T = x(A, B)$. The number of nodes of a tree $T$ is called the size of $T$. The Tamari order is an order on trees of a given size using the rotation operation.
<figure><img src="image_1.png" /><figcaption>**Figure 1:** Right rotation on a binary tree.</figcaption></figure>

**Definition 2.1** Let $y$ be a node of $T$ with a non-empty left subtree $x$. The right rotation of $T$ on $y$ is a local rewriting which follows Figure 1, that is replacing $y(x(A, B), C)$ by $x(A, y(B, C))$ (note that $A, B$, or $C$ might be empty).

The Tamari order is the transitive and reflexive closure of the right rotation: a tree $T'$ is greater than a tree $T$ if $T'$ can be obtained by applying a sequence of right rotations on $T$. It is actually a lattice [8], see Figure 2 for some examples. One of the purposes of this article is to define combinatorial objects that correspond to Tamari intervals.

<figure><img src="image_2.png" /><figcaption>**Figure 2:** Tamari lattices of size 3 and 4.</figcaption></figure>

The Tamari lattice is a quotient of the weak order on permutations [7]. To understand the relation between the two orders, we need the notion of *binary search tree*.

**Definition 2.2** A binary search tree is a labelled binary tree where for each node of label $k$, any label in its left (resp. right) subtree is lower than or equal to (resp. greater than) $k$.

Figure 3 shows an example of a binary search tree. For a given binary tree $T$ of size $n$, there is a unique labelling of $T$ with $1, \dots, n$ such that $T$ is a binary search tree. Such a labelled tree can then be seen as a poset. For example, the tree

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

is the poset where 1 and 3 are smaller than 2. We write $1 \prec 2$ and $3 \prec 2$. A linear extension of this poset is a permutation where if $a \prec b$ in the poset, then the number $a$ is before $b$ in the permutation. The
linear extensions of the tree above are 132 and 312. The sets of permutations corresponding to the linear extensions of the binary trees of size n form a partition of $S_n$ and more precisely, each set is an interval of the right weak order on permutations called a *sylvester class* and the Tamari order is a lattice on these classes [7]. See Figures 3 for examples of sylvester classes.

<figure><img src="image_4.png" /><figcaption>**Figure 3:** On the left: a binary search tree and its corresponding sylvester class, and on the right: the sylvester classes of the weak order of size 3, with the corresponding binary search trees.</figcaption></figure>

## 2.2 Construction of interval-posets

We now introduce more general objects, called the *interval-poset*, that are in bijection with the intervals of the Tamari order. Let us first recall two bijections between binary search trees and forests of planar trees. A binary search tree *T* is a poset containing two kinds of relations: when *a* is in the left subtree of *b*, we have an increasing relation *a* < *b* and *a* ≺<sub>*T*</sub> *b* and when *b* is in the right subtree of *a*, we have a decreasing relation *b* > *a* and *b* ≺<sub>*T*</sub> *a*. The two bijections we define consist in keeping only increasing (resp. decreasing) relations of the poset.

**Definition 2.3** The increasing forest⁽¹⁾ (noted $F_≤$) of a binary search tree *T* is a forest poset on the nodes of *T* containing only increasing relations and such that:

$$ a \prec_{F_{\le}(T)} b \Leftrightarrow a < b \text{ and } a \prec_T b. \qquad (4) $$

It is equivalent to the following construction:

* if a node labelled *x* has a left son labelled *y* in *T* then the node *x* has a son *y* in *F*;

* if a node labelled *x* has a right son labelled *y* in *T* then the node *x* has a brother *y* in *F*.

In the same way, one can define the decreasing forest (noted $F_≥$) by switching the roles of the right and left son in the previous construction or, in terms of posets:

$$ b \prec_{F_{\ge}(F)} a \Leftrightarrow a < b \text{ and } b \prec_T a. \qquad (5) $$
<figure><img src="image_5.png" /><figcaption>**Figure 4:** A tree with its corresponding increasing and decreasing forests.</figcaption></figure>

In Figure 4, we can see a tree $T$ with its decreasing and increasing forests. The linear extensions of the decreasing and increasing forests are actually initial and final intervals of the weak order.

**Proposition 2.4** *The linear extensions of the increasing forest of a tree $T$ is the union of the linear extensions of all trees lower than or equal to $T$ (initial interval) and the linear extensions of the decreasing forest of $T$ is the union of the linear extensions of all trees greater than or equal to $T$ (final interval).*

**Proof (sketch):** We just need to recall that $\sigma \le \mu$ in the weak order means that $\text{coinv}(\sigma) \subseteq \text{coinv}(\mu)$, where $\text{coinv}(\sigma) := \{(\sigma(i), \sigma(j)); i < j, \sigma(i) > \sigma(j)\}$. It is then easy to see that the linear extension with maximal (resp. minimal) number of co-inversions is the same for $T$ than for $F_{\le}(\text{resp. } F_{\ge})$. Conversely, if the co-inversions of a permutation $\mu$ are included in the co-inversions of the maximal linear extension of a tree for the weak order, then $\mu$ is a linear extension of $F_{\le}$. The same reasoning can be made for $F_{\ge}$. $\square$

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

<figure><img src="image_7.png" /><figcaption>**Figure 5:** A tree with the maximum of its sylvester class and its increasing forest.</figcaption></figure>

An example of this construction can be found in Figure 4 and another example of an increasing forest is given in Figure 5 with its maximal linear extension. If two trees $T$ and $T'$ are such that $T \le T'$, then $F_{\ge}(T)$ and $F_{\le}(T')$ share some linear extensions (by Proposition 2.4). More precisely, we have $\text{ExtL}(F_{\ge}(T)) \cap \text{ExtL}(F_{\le}(T')) = [\text{Min}(\text{ExtL}(T)), \text{Max}(\text{ExtL}(T'))]$. This set corresponds exactly to the linear extensions of the trees of the interval $[T, T']$ in the Tamari order. It is then natural to construct

<footnote>(i) Note that what we call increasing means increasing labels from the leaf to the root and not from the root to the leaf as it is often the case.</footnote>
a poset that would contain relations of both $F_{\ge}(T)$ and $F_{\le}(T')$, see Figure 6 for an example. We give a characterization of these posets.

**Definition 2.5** An interval-poset *P* is a poset such that the following conditions hold:

* $a \prec_P c$ implies that for all $a < b < c$, we have $b \prec_P c$,

* $c \prec_P a$ implies that for all $a < b < c$, we have $b \prec_P a$.

<figure><img src="image_8.png" /><figcaption>**Figure 6:** Two trees *T* and *T'*, their decreasing and increasing forest and the interval-poset [*T*, *T*′]. The linear extensions of the interval-poset correspond to the interval [2134, 4231] of the weak order and 2134 (resp. 4231) is the minimal (resp. maximal) linear extension of *T* (resp. *T*′).</figcaption></figure>

**Proposition 2.6** The interval-posets are exactly the posets whose linear extensions correspond to Tamari intervals for the weak order.

Indeed, it is easy to see that from an interval-poset, one can build $F_{\le}(\text{resp. } F_{\ge})$ by only considering the increasing relations (resp. decreasing relations). Conditions of Definition 2.5 are necessary and sufficient to obtain well-defined increasing (resp. decreasing) forests that correspond to proper binary search trees.

## 2.3 Combinatorial properties of interval-posets

Many operations on intervals can be easily done on interval-posets, all with trivial proofs.

**Proposition 2.7** (i) The intersection between two intervals $I_1$ and $I_2$ is given by the interval-poset $I_3$ containing all relations of $I_1$ and $I_2$. If $I_3$ is a valid poset (there is no cycle in the union of $I_1$ and $I_2$), then it is a valid interval-poset, otherwise the intersection is empty.

(ii) An interval $I_1 := [T_1, T'_1]$ is contained into an interval $I_2 := [T_2, T'_2]$, i.e., $T_1 \ge T_2$ and $T'_1 \le T'_2$, if and only if all relations of the interval-poset $I_1$ are satisfied by the interval-poset $I_2$.

(iii) If $I_1 := [T_1, T'_1]$ is an interval, then $I_2 = [T_2, T'_2]$, $T_2 \ge T_1$, if and only if all relations of the interval-poset $I_1$ are satisfied by $I_2$ and all new relations of $I_2$ are decreasing. Symmetrically, $I_3 = [T_1, T_3]$, $T_3 \le T'_1$, if and only if all relations of the interval-poset $I_1$ are satisfied by $I_3$ and all new relations of $I_3$ are increasing.
# 3 Tamari polynomials

## 3.1 Bilinear form and enumeration

Let $\phi(y)$ be the generating function of Tamari intervals,

$$ \phi(y) = 1 + y + 3y^2 + 13y^3 + 68y^4 + \dots \qquad (6) $$

where $y$ counts the number of nodes in the trees or equivalently the number of vertices in the interval-posets. In [4], Chapoton gives a refined version of $\phi$ with a parameter $x$ that counts the number of nodes on the left border of the smaller tree of the interval,

$$ \Phi(x, y) = 1 + xy + (x + 2x^2)y^2 + (3x + 5x^2 + 5x^3)y^3 + \dots \qquad (7) $$

We know that an interval-poset $I$ of $[T, T']$ is formed by two forest posets of respectively decreasing relations of $T$ and increasing relations of $T'$. The number of nodes in the left border of $T$ can then be seen as the number of trees in $F_{\ge}(T)$, i.e., the poset formed by the decreasing relations of $I$. This way, one can interpret the refined generating function (7) directly on interval-posets. In [4, formula (6)], Chapoton gives a functional equation on $\Phi^{(ii)}$

$$ \Phi(x, y) = xy\Phi(x, y) \frac{x\Phi(x, y) - \Phi(1, y)}{x - 1} + 1. \qquad (8) $$

The generating function $\Phi$ is then the solution of

$$ \Phi = B(\Phi, \Phi) + 1 \qquad (9) $$

where $B$ is the bilinear form

$$ B(f, g) = xyf(x, y) \frac{xg(x, y) - g(1, y)}{x - 1}. \qquad (10) $$

By expanding (9), one obtains

$$ \Phi = 1 + B(1, 1) + B(B(1, 1), 1) + B(1, B(1, 1)) + \dots \qquad (11) $$

$$ = \sum_{T} \mathcal{B}_{T}, \qquad (12) $$

sum over all binary trees $T$, with $\mathcal{B}_T$ recursively defined by $\mathcal{B}_\emptyset := 1$ and $\mathcal{B}_T := B(\mathcal{B}_L, \mathcal{B}_R)$ where $L$ and $R$ are respectively the left and right children of $T$. Using a combinatorial interpretation of $B$, we actually prove that $\mathcal{B}_T$ counts the number of trees smaller than $T$ in the Tamari order. We also obtain a new way of generating intervals and thus prove in a new way that the generating function of the interval satisfies the functional equation (8). Let us define an operation on interval-posets:

**Definition 3.1** Let $I_1$ and $I_2$ be two interval-posets of respective sizes $k_1$ and $k_2$. Then $\mathbb{B}(I_1, I_2)$ is the formal sum of all interval-posets of size $k_1 + k_2 + 1$ where,

<footnote>(ii) Our equation is slightly different from the one of [4, formula (6)]. Indeed, the definition of the degree of $x$ differs by one and in our case $\Phi$ also counts the interval of size 0.</footnote>
(i) the relations between vertices $1, \dots, k_1$ are exactly the ones from $I_1$,

(ii) the relations between $k_1 + 2, \dots, k_1 + k_2 + 1$ are exactly the ones from $I_2$ shifted by $k_1 + 1$,

(iii) we have $i < k_1 + 1$ for all $i \le k_1$,

(iv) there is no relation $k_1 + 1 < j$ for all $j > k_1 + 1$.

We call this operation the composition of intervals and extend it by bilinearity to all linear sums of intervals.

<figure><img src="image_9.png" /><figcaption>**Figure 7:** Composition of interval-posets: the three terms of the sum are obtained by adding respectively no, 1, and 2 decreasing relations between the second poset and the vertex 4. For the last term, two decreasing relations have been added: $5 < 4$ and $6 < 4$, the $5 < 4$ relation has been dashed as it is implicit through transitivity.</figcaption></figure>

The sum we obtain by composing interval-posets actually corresponds to all possible ways of adding decreasing relations between the second poset and the new vertex $k_1 + 1$, as seen on Figure 7. Especially, there is no relations between vertices $1, \dots, k_1$ and $k_1 + 2, \dots, k_1 + k_2 + 1$. Indeed, condition (iii) makes it impossible to have any relation $j < i$ with $i < k_1 + 1 < j$ as this would imply by Definition 2.5 that $k_1 + 1 < i$. And condition (iv) makes it impossible to have $i < j$ as this would imply $k_1 + 1 < j$.

**Proposition 3.2** Let $I_1$ and $I_2$ be two interval-posets. Let $\mathcal{P}$ be the linear function that associates with an interval-poset its monomial $x^{\text{trees}}y^{\text{size}}$ where the power of $y$ is the number of vertices and the power of $x$ the number of trees obtained by keeping only decreasing relations. Then

$$ \mathcal{P}(\mathbb{B}(I_1, I_2)) = B(\mathcal{P}(I_1), \mathcal{P}(I_2)). \qquad (13) $$

As an example, in Figure 7, $\mathcal{P}(I_1) = \mathcal{P}(I_2) = x^2y^3$. And we have $\mathcal{P}(\mathbb{B}(I_1, I_2)) = x^5y^7 + x^4y^7 + x^3y^7 = B(x^2y^3, x^2y^3)$.

**Proof:** If $I_1$ and $I_2$ are two interval-posets of size respectively $k_1$ and $k_2$, we have by definition that all interval-posets of $\mathbb{B}(I_1, I_2)$ are of size $k_1 + k_2 + 1$. Thus the power of $y$ is the same in $B(\mathcal{P}(I_1), \mathcal{P}(I_2))$ and in $\mathcal{P}(\mathbb{B}(I_1, I_2))$ and we only have to consider the polynomial in $x$.

Let us assume that $I_1$ and $I_2$ contain respectively $n$ and $m$ trees formed by decreasing relations. The $n$ trees of $I_1$ are kept unchanged on all terms of the result as no decreasing relation is added to the vertices $1, \dots, k_1$. Now, we call $v_1 < \dots < v_m$ the root vertices of the trees of $I_2$ shifted by $k_1 + 1$. By construction, $k_1 + 1 < v_1$, and this new vertex can either become a new root or a root to some of the previous trees. If we have $v_j < k_1 + 1$, by definition of an interval-poset, we also have $v_i < k_1 + 1$ for all $i < j$. The $m$ trees of $I_2$ can then be replaced by either $m + 1, m, \dots, 2$, or $1$ trees, which mean the monomial $x^m$ of $\mathcal{P}(I_2)$ becomes $x + x^2 + \dots + x^{m+1}$ in the composition. So,
$$ \mathcal{P}(\mathbb{B}(I_1, I_2)) = y(x^n y^{k_1}) y^{k_2} x^{\frac{x^{m+1}-1}{x-1}} \quad (14) $$

$$ = B(\mathcal{P}(I_1), \mathcal{P}(I_2)). \quad (15) $$

□

To prove now that the generating function of the intervals is the solution of the bilinear equation (9), we only need the following proposition.

**Proposition 3.3** Let $I$ be an interval-poset, then, there is exactly one pair of intervals $I_1$ and $I_2$ such that $I$ appears in the composition $\mathbb{B}(I_1, I_2)$.

**Proof:** Let $I$ be an interval-poset of size $n$ and let $k$ be the vertex of $I$ with maximal label such that $i \prec k$ for all $i < k$. The vertex 1 satisfies this property, so one can always find such a vertex. We prove that $I$ only appears in the composition of $I_1$ by $I_2$, where $I_1$ is formed by the vertices and relations of $1, \dots, k-1$ and $I_2$ is formed by the re-normalized vertices and relations of $k+1, \dots, n$. Note that one or both of these intervals can be of size 0.

Conditions (i), (ii), and (iii) of Definition 3.1 are clearly satisfied by construction. If condition (iv) is not satisfied, it means that we have a relation $k \prec j$ with $j > k$. Then, by definition of an interval-poset, we also have $\ell \prec j$ for all $k < l < j$ and by definition of $k$, we have $i \prec k \prec j$ for all $i < k$, so for all $i < j$, we have $i \prec j$. This is not possible as $k$ has been chosen to be maximal among vertices with this property.

This proves that $I$ appears in the composition of $I_1$ by $I_2$. Now, if $I$ appears in $\mathbb{B}(I'_1, I'_2)$, the vertex $k' = |I'_1| + 1$ is by definition the vertex where for all $i < k'$, we have $i \prec k'$ and for all $j > k'$, we have $k' \not\prec j$, this is exactly the definition of $k$. So $k' = k$ which makes $I'_1 = I_1$ and $I'_2 = I_2$. □

## 3.2 Main result

This composition operation on intervals is an analogue of the usual composition of binary trees that adds a root node to two given binary trees. In our case, a tree $T$ is replaced by a sum of intervals $[T', T]$.

**Proposition 3.4** Let $T := k(T_1, T_2)$ be a binary tree and $S := \sum_{T' \preceq T} [T', T]$. Then, if $S_1 := \sum_{T'_1 \preceq T_1} [T'_1, T_1]$ and $S_2 := \sum_{T'_2 \preceq T_2} [T'_2, T_2]$, we have $S = \mathbb{B}(S_1, S_2)$.

With this new proposition, Theorem 1.2 would be fully proven by induction on the size of the tree. The initial case is trivial, and then if we assume that $\mathcal{P}(S_1) = \mathcal{B}_{T_1}(x)$ and $\mathcal{P}(S_2) = \mathcal{B}_{T_2}(x)$, Proposition 3.2 tells us that $\mathcal{P}(\mathbb{B}(S_1, S_2)) = \mathcal{B}(\mathcal{B}_{T_1}, \mathcal{B}_{T_2})$.

**Proof:** Let $T$ be a binary tree of size $n$. The initial interval $T = [T_0, T]$, is given by the increasing bijection of Definition 2.3, it is a poset containing only increasing relations. By Proposition 2.7, (iii), the sum of all intervals $[T', T]$ is given by all possible ways of adding decreasing edges to the poset $T$.

The increasing poset $T$ can be formed recursively from the increasing posets $T_1$ and $T_2$ of the subtrees $T_1$ and $T_2$ as shown in Figure 8. The new vertex $k = |T_1| + 1$ is placed so that $i \prec k$ for all $i \in T_1$ and the vertices of $T_2$ are just shifted by $k$. Now, let $I$ be an interval of the sum $S$, $I$ contains the poset $T$ and some extra decreasing relations. Let $I_1$ and $I_2$ be the subposets formed respectively by vertices $1, \dots, k-1$,
and $k+1, \dots, n$. By construction, the posets $I_1$ and $I_2$ contain respectively the forest posets $\mathcal{T}_1$ and $\mathcal{T}_2$ and some extra decreasing relations. This means that $I_1$ appears in $S_1$ and $I_2$ appears in $S_2$. And we have that $I$ appears in $\mathbb{B}(I_1, I_2)$. Indeed, conditions (i) and (ii) of Definition 3.1 are true by construction and conditions (iii) and (iv) are true because the increasing relations of $I$ are exactly the ones of $\mathcal{T}$.

<figure><img src="image_10.png" /><figcaption>**Figure 8:** The recursive construction of $\mathcal{T}$ from $\mathcal{T}_1$ and $\mathcal{T}_2$.</figcaption></figure>

Conversely, if $I_1$ and $I_2$ are two elements of respectively $S_1$ and $S_2$, their increasing relations are exactly the ones from respectively $\mathcal{T}_1$ and $\mathcal{T}_2$ which makes all interval-posets $I$ of $\mathbb{B}(I_1, I_2)$ an element of $S$. Indeed, by definition of the composition, the increasing relations of $I$ are exactly the ones of $\mathcal{T}$. $\square$

For a given tree $T$ (with increasing poset $\mathcal{T}$), the coefficient of the monomial with maximal degree in $x$ in $B_T$ is always 1. It corresponds to the minimal tree of the Tamari order, or to the interval with no decreasing relations, i.e., $\mathcal{T}$. The interval with the maximal number of decreasing relations corresponds to $[T, T]$. An example of $B_T$ and of the computation of smaller trees is presented in Figure 9.

# 4 Final comments

## 4.1 Bivariate polynomials

In some very recent work [5], Chapoton computed some bivariate polynomials that seem to be similar to the ones we study. By computing the first polynomials of [5, formula (7)], one notices [6] that for $b = 1$ and $t = 1 - 1/x$ is equal to $B_T(x)$, where $T$ is a binary tree with no left subtree. The non planar rooted tree corresponding to $T$ is the non planar version of the tree given by the decreasing bijection of Definition 4, i.e., transforming left children of a node into its brothers.

A $b$ parameter can be also be added to our formula. For an interval $[T', T]$, it is either the number of nodes in $T'$ which have a right subtree, or in the interval-poset the number of nodes $x$ with a relation $y \prec x$ and $y > x$. By a generalization of the linear function $\mathcal{P}$, one can associate a monomial in $b, x$, and $y$ with each interval-poset. The bilinear form now reads:

$$B(f,g) = y \left( xbf \frac{xg - g_{x=1}}{x-1} - bxfg + xfg \right), \qquad (16)$$
<figure><img src="image_11.png" /><figcaption>**Figure 9:** Example of the computation of $\mathcal{B}_T$ and list of all smaller trees with associated intervals</figcaption></figure>

where $f$ and $q$ are polynomials in $x$, $b$, and $y$. Proposition 3.2 still holds, since a node with a decreasing relation is added in all terms of the composition but one. As an example, in Figure 7, one has $B(y^3x^2b, y^3x^2b) = y^7(x^5b^2 + x^4b^3 + x^3b^3)$.

With this definition of the parameter $b$, the bivariate polynomials $\mathcal{B}_T(x, b)$ where $T$ has no left subtree seem to be exactly the ones computed by Chapoton in [5] when taken on $t = 1 - 1/x$. This correspondence and its meaning in terms of algebra and combinatorics should be explored in some future work.

## 4.2 m-Tamari

The Tamari lattice on binary trees can also be described in terms of Dyck paths. A Dyck path is a path on the grid formed by north and east steps, starting at (0, 0) and ending at (n, n) and never going under the diagonal. One obtains a Dyck path from a binary tree by reading it in postfix order and writing a north step for each empty tree (also called leaf) and an east step for each node, and by ignoring the first leaf. As an example, the binary tree of Figure 9 gives the following path: $N, N, E, E, N, E, N, N, E, N, E, E$. The rotation consists in switching an east step $e$ (immediately followed by a north step) with the shortest translated Dyck path starting right after $e$. One can now consider paths that end in $(mn, n)$ and stay above the line $x = my$, called *m-ballot* paths and the same rotation operation will also give a lattice [1].

It is called the *m*-Tamari lattice, a formula counting the number of intervals was conjectured in [1] and was proven recently in [3]. The authors use a functional equation that is a direct generalization of (9). Let $\Phi_m(x, y)$ be the generating function of intervals of the *m*-Tamari lattice where $y$ is the size $n$ and $x$ a
statistic called number of contacts, then [3, formula (3)] reads

$$ \Phi_m(x, y) = x + B_m(\Phi, \Phi, \dots, \Phi), \qquad (17) $$

where $B_m$ is a $m$-linear form defined by

$$ B_m(f_1, \dots, f_m) := xyf_1 \Delta(f_2 \Delta(\dots \Delta(f_m))) \dots, \qquad (18) $$

$$ \Delta(g) := \frac{g(x, y) - g(1, y)}{x - 1}. \qquad (19) $$

Expanding (8), we obtain a sum of $m$-ary trees. A process is described in [3] to associate a $m$-ballot path with a $m$-ary tree: the tree is read in prefix order, from the right to the left and each leaf (resp. node) is coded by an east (resp. north) step. Note that this process is not consistent with the classical bijection between Dyck path and binary trees: a different definition of the rotation is given which slightly changes the Tamari lattice and could be generalized to $m$-Tamari. However, by computer exploration, one notices that the analog of Theorem 1.2 seems to hold: for a given Dyck path, the polynomials obtained by the postfix and prefix tree interpretations of the path are equal. More generally, given a $m$-ballot path $D$, let $T$ be the $m$-ary tree obtained by a prefix reading. Then the polynomial $B_{m,T}$ of $T$ where $B_m$ is applied to the nodes and $x$ to the leafs counts the number of $m$-ballot paths lower than $D$ in the $m$-Tamari order. We shall prove this result in future work.

## References

[1] F. Bergeron and L.-F. Preville-Ratelle. Higher Trivariate Diagonal Harmonics via generalized Tamari Posets. *ArXiv preprint, to appear in J. Combinatorics*, May 2011. arXiv:1105.3738.

[2] A. Björner and M. L. Wachs. Permutation statistics and linear extensions of posets. *J. Combin. Theory Ser. A*, 58(1):85–114, 1991.

[3] M. Bousquet-Mélou, E. Fusy, and L.-F. Préville-Ratelle. The number of intervals in the $m$-Tamari lattices. *Electron. J. Combin.*, 18(2):Paper 31, 26, 2011.

[4] F. Chapoton. Sur le nombre d'intervalle dans les treillis de Tamari. *Sém. Lothar. Combin.*, 55:Art. B55f, 18 pp., 2005/07.

[5] F. Chapoton. Flows on rooted trees and the Menous-Novelli-Thibon idempotents. *ArXiv preprint*, 2012. arXiv:1203.1780.

[6] F. Chapoton, J.-C. Novelli, and J.-Y. Thibon. Private communication.

[7] F. Hivert, J.-C. Novelli, and J.-Y. Thibon. The algebra of binary search trees. *Theoret. Comput. Sci.*, 339(1):129–165, 2005.

[8] S. Huang and D. Tamari. Problems of associativity: A simple proof for the lattice property of systems ordered by a semi-associative law. *J. Combinatorial Theory Ser. A*, 13:7–13, 1972.

[9] J.-L. Loday and M. O. Ronco. Hopf algebra of the planar binary trees. *Adv. Math.*, 139(2):293–309, 1998.

[10] R.P. Stanley. *Enumerative combinatorics. Vol. 2*. Cambridge University Press, Cambridge, 1999.