FPSAC 2012, Nagoya, Japan DMTCS proc. AR, 2012, 229–240

Constructing combinatorial from

Samuele Giraudo1

1Institut Gaspard Monge, Universite´ Paris-Est Marne-la-Vallee,´ 5 Boulevard Descartes, Champs-sur-Marne, 77454 Marne-la-Vallee´ cedex 2, France

Abstract. We introduce a functorial construction which, from a , produces a set-. We obtain new (symmetric or not) operads as suboperads or quotients of the operad obtained from the additive monoid. These involve various familiar combinatorial objects: parking functions, packed words, planar rooted trees, generalized Dyck paths, Schroder¨ trees, Motzkin paths, integer compositions, directed animals, etc. We also retrieve some known operads: the magmatic operad, the commutative associative operad, and the diassociative operad. Resum´ e.´ Nous introduisons une construction fonctorielle qui, a` partir d’un mono¨ıde, produit une operade´ ensembliste. Nous obtenons de nouvelles operades´ (symetriques´ ou non) comme sous-operades´ ou quotients de l’operade´ obtenue a` partir du mono¨ıde additif. Celles-ci mettent en jeu divers objets combinatoires familiers : fonctions de parking, mots tasses,´ arbres plans enracines,´ chemins de Dyck gen´ eralis´ es,´ arbres de Schroder,¨ chemins de Motzkin, compositions d’entiers, animaux diriges,´ etc. Nous retrouvons egalement´ des operades´ dej´ a` connues : l’operade´ magmatique, l’operade´ commutative associative et l’operade´ diassociative.

Keywords: Operad; Monoid; Generalized Dyck path; Tree; Directed animal; Diassociative operad.

1 Introduction Operads are algebraic structures introduced in the 1970s by Boardman and Vogt [1] and by May [13] in the context of algebraic topology. Informally, an operad is a structure containing operators with n inputs and 1 output, for all positive integer n. Two operators x and y can be composed at ith position by grafting the output of y on the ith input of x. The new operator thus obtained is denoted by x ◦i y. In an operad, one can also switch the inputs of an operator x by letting a permutation σ act to obtain a new operator denoted by x · σ. One of the main relishes of operads comes from the fact that they offer a general theory to study in an unifying way different types of algebras, such as associative algebras and Lie algebras. In recent years, the importance of operads in combinatorics has continued to increase and several new operads were defined on combinatorial objects (see e.g., [3, 4, 9, 10]). The structure thereby added on combinatorial families enables to see these in a new light and offers original ways to solve some com- binatorial problems. For example, the dendriform operad [10] is an operad on binary trees and plays an interesting role for the understanding of the of Loday-Ronco of binary trees [8,11]. Besides, this operad is a key ingredient for the enumeration of intervals of the Tamari lattice [2, 3]. There is also a very rich link connecting combinatorial Hopf algebra theory and operad theory: various constructions produce combinatorial Hopf algebras from operads [5, 12]. 1365–8050 c 2012 Discrete Mathematics and Theoretical Computer Science (DMTCS), Nancy, France 230 Samuele Giraudo

In this paper, we propose a new generic method to build combinatorial operads. The starting point is to pick a monoid M. We then consider the set of words whose letters are elements of M. The arity of such words are their length, the composition of two words is expressed from the product of M, and permutations act on words by permuting letters. In this way, we associate to any monoid M an operad de- noted by TM. This construction is rich from a combinatorial point of view since it allows, by considering suboperads and quotients of TM, to get new operads on various combinatorial objects. This paper is organized as follows. In Section 2, we recall briefly the basics about set-operads. Section 3 is devoted to the definition of the construction associating an operad to a monoid and to establish its first properties. We show that this construction is a from the of monoids to the category of operads that respects injections and surjections. Finally we apply this construction in Section 4 on various monoids and obtain several new combinatorial (symmetric or not) operads on the following combinatorial objects: endofunctions, parking functions, packed words, permutations, planar rooted trees, generalized Dyck paths, Schroder¨ trees, Motzkin paths, integer compositions, directed animals, and segmented integer compositions. We conclude by building an operad isomorphic to the diassociative operad [10].

Acknowledgements The author would like to thank Florent Hivert and Jean-Christophe Novelli for their advice during the preparation of this paper. This work is based on computer exploration and the author used, for this purpose, the open-source mathematical software Sage [15] and one of its extensions, Sage-Combinat [14].

2 Preliminaries and notations 2.1 Permutations

Let us denote by [n] the set {1, . . . , n} and by Sn the set of permutations of [n]. Let σ ∈ Sn, ν ∈ Sm, 0 0 00 00 0 0 and i ∈ [n]. The substitution of ν into σ is the permutation Bi(σ, ν) := σ1 . . . σi−1ν1 . . . νmσi+1 . . . σn 0 0 00 where σj := σj if σj < σi and σj := σj + m − 1 otherwise, and νj := νj + σi − 1. For instance, one has B4(7415623, 231) = 941675823. 2.2 Operads U Recall that a set-operad, or an operad for short, is a set P := n≥1 P(n) together with substitution maps

◦i : P(n) × P(m) → P(n + m − 1), n, m ≥ 1, i ∈ [n], (1) a distinguished element 1 ∈ P(1), the unit of P, and a symmetric group action

· : P(n) × Sn → P(n), n ≥ 1. (2)

The above data has to satisfy the following relations:

(x ◦i y) ◦i+j−1 z = x ◦i (y ◦j z), x ∈ P(n), y ∈ P(m), z ∈ P(k), i ∈ [n], j ∈ [m], (3)

(x ◦i y) ◦j+m−1 z = (x ◦j z) ◦i y, x ∈ P(n), y ∈ P(m), z ∈ P(k), 1 ≤ i < j ≤ n, (4)

1 ◦1 x = x = x ◦i 1, x ∈ P(n), i ∈ [n], (5)

(x · σ) ◦i (y · ν) = (x ◦σi y) · Bi(σ, ν), x ∈ P(n), y ∈ P(m), σ ∈ Sn, ν ∈ Sm, i ∈ [n]. (6) Constructing combinatorial operads from monoids 231

The arity of an element x of P(n) is n. Let Q be an operad. A map φ : P → Q is an operad if it commutes with substitution maps and symmetric group action and maps elements of arity n of P to elements of arity n of Q.A non-symmetric operad is an operad without symmetric group action. The above definitions also work when P is a N-graded vector space. In this case, the substitution maps ◦i are linear maps, and the symmetric group action is linear on the left. 3 A combinatorial functor from monoids to operads 3.1 The construction 3.1.1 Monoids to operads U Let (M, •, 1) be a monoid. Let us denote by TM the set TM := n≥1 TM(n), where for all n ≥ 1,

TM(n) := {(x1, . . . , xn): xi ∈ M for all i ∈ [n]} . (7) We endow the set TM with maps

◦i : TM(n) × TM(m) → TM(n + m − 1), n, m ≥ 1, i ∈ [n], (8) defined as follows: For all x ∈ TM(n), y ∈ TM(m), and i ∈ [n], we set

x ◦i y := (x1, . . . , xi−1, xi • y1, . . . , xi • ym, xi+1, . . . , xn). (9) Let us also set 1 := (1) as a distinguished element of TM(1). We endow finally each set TM(n) with a right action of the symmetric group

· : TM(n) × Sn → TM(n), n ≥ 1, (10) defined as follows: For all x ∈ TM(n) and σ ∈ Sn, we set

x · σ := (xσ1 , . . . , xσn ) . (11) The elements of TM are words over M regarded as an alphabet. The arity of an element x of TM(n), denoted by |x|, is n. For the sake of readability, we shall denote in some cases an element (x1, . . . , xn) of TM(n) by its word notation x1 . . . xn. Proposition 3.1 If M is a monoid, then TM is a set-operad.

Proof: Let us respectively denote by • and 1 the product and the unit of M. First of all, thanks to (8) and (9), the maps ◦i are well-defined and are substitution maps of operads. Let us now show that TM satisfies (3), (4), (5), and (6). Let x ∈ TM(n), y ∈ TM(m), z ∈ TM(k), i ∈ [n], and j ∈ [m]. We have, using associativity of •, (x ◦i y) ◦i+j−1 z = (x1, . . . , xi−1, xi • y1, . . . , xi • ym, xi+1, . . . , xn) ◦i+j−1 z

= (x1, . . . , xi−1, xi • y1, . . . , xi • yj−1, (xi • yj) • z1,..., (xi • yj) • zk,

xi • yj+1, . . . , xi • ym, xi+1, . . . , xn)

= (x1, . . . , xi−1, xi • y1, . . . , xi • yj−1, xi • (yj • z1), . . . , xi • (yj • zk), (12)

xi • yj+1, . . . , xi • ym, xi+1, . . . , xn)

= x ◦i (y1, . . . , yj−1, yj • z1, . . . , yj • zk, yj+1, . . . , ym)

= x ◦i (y ◦j z), 232 Samuele Giraudo showing that ◦i satisfies (3). Let x ∈ TM(n), y ∈ TM(m), z ∈ TM(k), and i < j ∈ [n]. We have, (x ◦j z) ◦i y = (x1, . . . , xj−1, xj • z1, . . . , xj • zk, xj+1, . . . , xn) ◦i y,

= (x1, . . . , xi−1, xi • y1, . . . , xi • ym, xi+1, . . . , xj−1,

xj • z1, . . . , xj • zk, xj+1, . . . , xn) (13)

= (x1, . . . , xi−1, xi • y1, . . . , xi • ym, xi+1, . . . , xn) ◦j+m−1 z

= (x ◦i y) ◦j+m−1 z, showing that ◦i satisfies (4). The element 1 is the unit of TM. Indeed, we have 1 ∈ TM(1), and, for all x ∈ TM(n) and i ∈ [n],

x ◦i 1 = (x1, . . . , xi−1, xi • 1, xi+1, . . . , xn) = x, (14) since 1 is the unit for •, and

1 ◦1 x = (1 • x1,..., 1 • xn) = x, (15) for the same reason. That shows (5). Finally, since the symmetric group Sn acts by permuting the letters of a word (x1, . . . , xn) of TM(n), the maps ◦i and the action · satisfy together (6). 2 3.1.2 Monoids to operads morphisms Let M and N be two monoids and θ : M → N be a monoid morphism. Let us denote by Tθ the map Tθ : TM → TN, (16) defined for all (x1, . . . , xn) ∈ TM(n) by

Tθ (x1, . . . , xn) := (θ(x1), . . . , θ(xn)) . (17) Proposition 3.2 If M and N are two monoids and θ : M → N is a monoid morphism, then the map Tθ : TM → TN is an operad morphism.

Proof: Let us respectively denote by •M (resp. •N ) and 1M (resp. 1N ) the product and the unit of M (resp. N). Let x ∈ TM(n), y ∈ TM(m), and i ∈ [n]. Since θ is a monoid morphism, we have Tθ(x ◦i y) = Tθ (x1, . . . , xi−1, xi •M y1, . . . , xi •M ym, xi+1, . . . , xn)

= (θ(x1), . . . , θ(xi−1), θ(xi •M y1), . . . , θ(xi •M ym), θ(xi+1), . . . , θ(xn))

= (θ(x1), . . . , θ(xi−1), θ(xi) •N θ(y1), . . . , θ(xi) •N θ(ym), θ(xi+1), . . . , θ(xn))

= (θ(x1), . . . , θ(xn)) ◦i (θ(y1), . . . , θ(ym))

= Tθ(x) ◦i Tθ(y). (18)

Moreover, since (1M ) is by definition the unit of TM, we have

Tθ (1M ) = (θ (1M )) = (1N ) . (19)

Finally, since the symmetric group Sn acts by permuting letters, we have for all x ∈ TM(n) and σ ∈ Sn, Tθ(x · σ) = Tθ(x) · σ. The map Tθ satisfies the three required properties and hence, since by Proposition 3.1, TM and TN are operads, Tθ is an operad morphism. 2 Constructing combinatorial operads from monoids 233 3.2 Properties of the construction Proposition 3.3 Let M and N be two monoids and θ : M → N be a monoid morphism. If θ is injective (resp. surjective), then Tθ is injective (resp. surjective).

Proof: Assume that θ is injective and that there are two elements x and y of TM such that Tθ(x) = Tθ(y). Then, Tθ(x) = (θ(x1), . . . , θ(xn)) = (θ(y1), . . . , θ(yn)) = Tθ(y), (20) implying θ(xi) = θ(yi) for all i ∈ [n]. Since θ is injective, we have xi = yi for all i ∈ [n] and thus, x = y. Hence, since Tθ is, by Proposition 3.2, an operad morphism, it also is an injective operad morphism. Assume that θ is surjective and let y be an element of TN(n). Since θ is surjective, there are some elements xi of M such that θ(xi) = yi for all i ∈ [n]. We have

Tθ(x1, . . . , xn) = (θ(x1), . . . , θ(xn)) = (y1, . . . , yn). (21)

Hence, since (x1, . . . , xn) is by definition an element of TM(n), and since Tθ is, by Proposition 3.2, an operad morphism, it also is a surjective operad morphism. 2

Theorem 3.4 The construction T is a functor from the category of monoids with monoid morphisms to the category of set-operads with operad morphisms. Moreover, T respects injections and surjections.

Proof: By Proposition 3.1, T constructs a set-operad from a monoid, and by Proposition 3.2, an operad morphism from a monoid morphism. Let M be a monoid, θ : M → M be the identity morphism on M, and x be an element of TM(n). We have Tθ(x) = (θ(x1), . . . , θ(xn)) = (x1, . . . , xn) = x, (22) showing that Tθ is the identity morphism on the operad TM. Let (L, •L), (M, •M ), and (N, •N ) be three monoids, θ : L → M and ω : M → N be two monoid morphisms, and x be an element of TL(n). We have T(ω ◦ θ)(x) = (ω (θ(x1)) , . . . , ω (θ(xn)))

= Tω (θ(x1), . . . , θ(xn)) (23) = Tω (Tθ (x1, . . . , xn)) = (Tω ◦ Tθ)(x), showing that T is compatible with map composition. Hence, T is a functor, and by Proposition 3.3, T also respects injections and surjections. 2

4 Some operads obtained by the construction Through this Section, we consider examples of applications of the functor T. We shall mainly consider, given a monoid M, some suboperads of TM, symmetric or not, and generated by a finite subset of TM. We shall denote by N the additive monoid of integers, and for all ` ≥ 1, by N` the quotient of N consisting in the set {0, 1, . . . , ` − 1} with the addition modulo ` as the operation of N`. Note that since T is a functor that respects surjective maps (see Theorem 3.4), TN` is a quotient operad of TN. The operads constructed in this Section fit into the diagram of non-symmetric operads represented in Figure 1. Table 1 summarizes some information about these operads. 234 Samuele Giraudo

TN

TN2 End TN3

PF

PW FCat (3 )

Per Schr FCat (2 )

FCat (1 ) SComp

Comp Motz PRT DA

FCat (0 )

Figure 1: The diagram of non-symmetric suboperads and quotients of TN. Arrows  (resp. ) are injective (resp. surjective) non-symmetric operad morphisms.

4.1 Endofunctions, parking functions, packed words, and permutations Neither the set of endofunctions nor the set of parking functions, packed words, and permutations are suboperads of TN. Indeed, one has the following counterexample:

12 ◦2 12=134 , (24) and, even if 12 is a permutation, 134 is not an endofunction. Therefore, let us call a word u a twisted endofunction (resp. parking function, packed word, permuta- tion) if the word (u1 + 1, u2 + 1, . . . , un + 1) is an endofunction (resp. parking function, packed word, permutation). For example, the word 2300 is a twisted endofunction since 3411 is an endofunction. Let us denote by End (resp. PF , PW , Per) the set of endofunctions (resp. parking functions, packed words, permutations). Under this reformulation, one has the following result: Proposition 4.1 The sets End, PF , and PW are suboperads of TN. For example, we have in End the following substitution:

2123 ◦2 30313=24142423 , (25) and the following application of the symmetric group action:

11210 · 23514 = 12011. (26) Constructing combinatorial operads from monoids 235

Operad Generators First dimensions Combinatorial objects End — 1, 4, 27, 256, 3125 Endofunctions PF — 1, 3, 16, 125, 1296 Parking functions PW — 1, 3, 13, 75, 541 Packed words Per — 1, 2, 6, 24, 120 Permutations PRT 01 1, 1, 2, 5, 14, 42 Planar rooted trees FCat (k) 00, 01,..., 0k Fuss-Catalan numbers k-Dyck paths Schr 00, 01, 10 1, 3, 11, 45, 197 Schroder¨ trees Motz 00, 010 1, 1, 2, 4, 9, 21, 51 Motzkin paths Comp 00, 01 1, 2, 4, 8, 16, 32 Integer compositions DA 00, 01 1, 2, 5, 13, 35, 96 Directed animals SComp 00, 01, 02 1, 3, 27, 81, 243 Segmented integer compositions

Table 1: Generators, first dimensions, and combinatorial objects involved in the non-symmetric suboperads and quotients of TN.

Note that End is not a finitely generated operad. Indeed, the twisted endofunctions u := u1 . . . un satisfying ui := n − 1 for all i ∈ [n] cannot be obtained by substitutions involving elements of End of arity smaller than n. Similarly, PF is not a finitely generated operad since the twisted parking functions u := u1 . . . un satisfying ui := 0 for all i ∈ [n − 1] and un := n − 1 cannot be obtained by substitutions involving elements of PF of arity smaller than n. However, the operad PW is a finitely generated operad:

Proposition 4.2 The operad PW is the suboperad of TN generated, as a symmetric operad, by the elements 00 and 01. Let K be a field and let us from now consider that PW is an operad in the category of K-vector spaces, i.e., PW is the free K-vector space over the set of twisted packed words with substitution maps and the right symmetric group action extended by linearity. Let I be the free K-vector space over the set of twisted packed words having multiple occurrences of a same letter. Proposition 4.3 The vector space I is an operadic of PW . Moreover, the operadic quotient Per := PW /I is the free vector space over the set of twisted permutations. One has, for all twisted permutations x and y, the following expression for the substitution maps in Per: ( x ◦i y if xi = max x, x ◦i y = (27) 0K otherwise, where 0K is the null vector of Per and the map ◦i in the right member of (27) is the substitution map of PW . 4.2 Planar rooted trees Let PRT be the non-symmetric suboperad of TN generated by 01. One has the following characterization of the elements of PRT :

Proposition 4.4 The elements of PRT are exactly the words x on the alphabet N that satisfy x1 = 0 and 1 ≤ xi+1 ≤ xi + 1 for all i ∈ [|x| − 1]. 236 Samuele Giraudo

Proposition 4.4 implies that we can regard the elements of arity n of PRT as planar rooted trees with n nodes. Indeed, there is a bijection between words of PRT and such trees. Given a planar rooted tree T , one computes an element of PRT by labelling each node x of T by its depth and then, by reading its labels following a depth-first traversal of T . Figure 2(a) shows an example of this bijection.

0

1 1 1 ←→ ←→ 0112333212 ◦2 = 2 2 2

3 3 3 (a) A planar rooted tree and the corresponding element of PRT. (b) A substitution in PRT.

Figure 2: Interpretation of the elements and substitution of the non-symmetric operad PRT in terms of planar rooted trees.

This bijection offers an alternative way to compute the substitution in PRT : Proposition 4.5 Let S and T be two planar rooted trees and s be the ith visited node of S following its depth-first traversal. The substitution S ◦i T in PRT amounts to graft the subtrees of the root of T as leftmost sons of s. Figure 2(b) shows an example of substitution in PRT . Proposition 4.6 The non-symmetric operad PRT is isomorphic to the free non-symmetric operad gener- ated by one element of arity 2. Proposition 4.6 also says that PRT is isomorphic to the magmatic operad. Hence, PRT is a realization of the magmatic operad. Moreover, PRT can be seen as a planar version of the operad NAP of Livernet [9]. 4.3 Generalized Dyck paths Let k ≥ 0 be an integer and FCat (k) be the non-symmetric suboperad of TN generated by 00, 01,..., 0k. One has the following characterization of the elements of FCat (k): (k) Proposition 4.7 The elements of FCat are exactly the words x on the alphabet N that satisfy x1 = 0 and 0 ≤ xi+1 ≤ xi + k for all i ∈ [|x| − 1]. Let us recall that a k-Dyck path of length n is a path in N2 connecting the points (0, 0) and ((k +1)n, 0) and consisting in n up steps (1, k) and kn down steps (1, −1). It is well-known that k-Dyck paths are enumerated by Fuss-Catalan numbers [6]. Proposition 4.7 implies that we can regard the elements of arity n of FCat (k) as k-Dyck paths of length n. Indeed, there is a bijection between words of FCat (k) and such paths. Given a k-Dyck path P , one computes an element of FCat (k) by writing, from left to right, the ordinate of the starting point of each up step of P . Figure 3 shows an example of this bijection.

4 3 ←→ 2 ←→ 002413 1 0 0

Figure 3: A 2-Dyck path and the corresponding element of the non-symmetric operad FCat (2 ).

Note that the operad FCat (0 ) is the commutative associative operad. Next Theorem elucidates the structure of FCat (1 ): Constructing combinatorial operads from monoids 237

Theorem 4.8 The non-symmetric operad FCat (1 ) is the free non-symmetric operad generated by two elements and of arity 2, subject to the three relations

◦1 = ◦2 , (28) ◦1 = ◦2 . (30) ◦1 = ◦2 , (29) 4.4 Schroder¨ trees Let Schr be the non-symmetric suboperad of TN generated by 00, 01, and 10. One has the following characterization of the elements of Schr: Proposition 4.9 The elements of Schr are exactly the words x on the alphabet N that have at least one occurrence of 0 and, for all letter b ≥ 1 of x, there exists a letter a := b − 1 such that x has a factor aub or bua where u is a word consisting in letters c satisfying c ≥ b. Recall that a Schroder¨ tree is a planar rooted tree such that no node has exactly one child. The leaves of a Schroder¨ tree are the nodes without children. We call sector of a Schroder¨ tree T a triple (x, i, j) consisting in a node x and two adjacent edges i and j, where i is immediately on the left of j. Proposition 4.9 implies that we can regard the elements of arity n of Schr as Schroder¨ trees with n leaves. Indeed, there is a bijection between words of Schr and such trees. Given a Schroder¨ tree T , one computes an element of Schr by labelling each sector (x, i, j) of T by the depth of x and then, by reading the labels from left to right. Figure 4 shows an example of this bijection.

0 0 ←→ 1 1 1 ←→ 1132002122 2 2 2 2 3

Figure 4: A Schroder¨ tree and the corresponding element of the non-symmetric operad Schr.

Let us respectively denote by , , and the generators 00, 01, and 10 of Schr. Proposition 4.10 The generators , , and of Schr are subject, in degree 2, to the seven relations

◦1 = ◦2 , (31) ◦1 = ◦2 , (35) ◦1 = ◦2 , (32) ◦1 = ◦2 , (36) ◦1 = ◦2 , (33) ◦1 = ◦2 . (37) ◦1 = ◦2 , (34) 4.5 Motzkin paths Let Motz be the non-symmetric suboperad of TN generated by 00 and 010. Since 00 and 01 gener- (1 ) (1 ) ate FCat and since 010 = 00 ◦1 01, Motz is a non-symmetric suboperad of FCat . One has the following characterization of the elements of Motz: Proposition 4.11 The elements of Motz are exactly the words x on the alphabet N that begin and start by 0 and such that |xi − xi+1| ≤ 1 for all i ∈ [|x| − 1]. Recall that a Motzkin path of length n is a path in N2 connecting the points (0, 0) and (n, 0), and consisting in up steps (1, 1), down steps (1, −1), and stationary steps (1, 0). Proposition 4.11 implies that we can regard the elements of arity n of Motz as Motzkin paths of length n − 1. Indeed there is a bijection between words of Motz and such paths. Given a Motzkin path P , one computes an element 238 Samuele Giraudo of Motz by writing for each point p of P the ordinate of p, and then, by reading these labels from left to right. Figure 5 shows an example of this bijection.

3 2 2 2 1 1 1 1 ←→ 0 0 0 0 ←→ 001123221010

Figure 5: A Motzkin path and the corresponding element of the non-symmetric operad Motz.

Let us respectively denote by and the generators 00 and 010 of Motz. Proposition 4.12 The generators and of Motz are subject, in degree 2, to the four relations

◦1 = ◦2 , (38) ◦1 = ◦3 , (40)

◦1 = ◦2 , (39) ◦1 = ◦3 . (41) 4.6 Integer compositions (1 ) Let Comp be the non-symmetric suboperad of TN2 generated by 00 and 01. Since FCat is the non- symmetric suboperad of TN generated by 00 and 01, and since TN2 is a quotient of TN, Comp is a quotient of FCat (1 ). One has the following characterization of the elements of Comp : Proposition 4.13 The elements of Comp are exactly the words on the alphabet {0, 1} that begin by 0. Proposition 4.13 implies that we can regard the elements of arity n of Comp as integer compositions of n. Indeed, there is a bijection between words of Comp and integer compositions. Given a composition C := (C1,C2,...,C`), one computes the following element of Comp: 01C1−101C2−1 ... 01C`−1. (42) Encoding integer compositions by ribbon diagrams offers an alternative way to compute the substitution in Comp: Proposition 4.14 Let C and D be two ribbon diagrams, i be an integer, and c be the ith visited box of C by scanning it from up to down and from left to right. Then, the substitution C ◦i D in Comp returns to replace c by D if c is the upper box of its column, or to replace c by the transpose ribbon diagram of D otherwise. Figure 6 shows two examples of substitution in Comp.

◦4 = ◦5 =

(a) Substitution in an upper box of a column. (b) Substitution not in an upper box of a column.

Figure 6: Two examples of substitutions in the non-symmetric operad Comp.

Theorem 4.15 The non-symmetric operad Comp is the free non-symmetric operad generated by two elements and of arity 2, subject to the four relations

◦1 = ◦2 , (43) ◦1 = ◦2 , (45)

◦1 = ◦2 , (44) ◦1 = ◦2 . (46) Constructing combinatorial operads from monoids 239 4.7 Directed animals (1 ) Let DA be the non-symmetric suboperad of TN3 generated by 00 and 01. Since FCat is the non- symmetric suboperad of TN generated by 00 and 01, and since TN3 is a quotient of TN, DA is a quotient of FCat (1 ). From now, we shall represent by −1 the element 2 of N3. With this encoding, let φ : {−1, 0, 1}n → {−1, 0, 1}n−1, (47) be the map defined for all a, b ∈ {−1, 0, −1} by φ(a) :=  and φ(a · b · u) := (b − a) · φ(u). (48) For example, the element x := 011220201 of DA is represented by the word x0 := 011 −1 −10 −101 and we have φ(x0) = 10101 −111. Proposition 4.16 By interpreting letters −1 (resp. 0, 1) as down (resp. stationary, up) steps, the map φ induces a bijection between the elements of DA of arity n and the prefixes of Motzkin paths of length n−1. Recall that a directed animal is a subset A of N2 such that (0, 0) ∈ A and (i, j) ∈ A with i ≥ 1 or j ≥ 1 implies (i − 1, j) ∈ A or (i, j − 1) ∈ A. Using a bijection of Gouyou-Beauchamps and Viennot [7] between directed animals of size n and prefixes of Motzkin paths of length n−1, one obtains, by Proposition 4.16, a bijection between the elements of DA of arity n and directed animals of size n. Hence, DA is a non-symmetric operad on directed animals. 4.8 Segmented integer compositions (2 ) Let SComp be the non-symmetric suboperad of TN3 generated by 00, 01, and 02. Since FCat is the non-symmetric suboperad of TN generated by 00, 01, and 02, and since TN3 is a quotient of TN, SComp is a quotient of FCat (2 ). One has the following characterization of the elements of SComp: Proposition 4.17 The elements of SComp are exactly the words on the alphabet {0, 1, 2} that begin by 0.

Recall that a segmented integer composition of n is a sequence (S1,...,S`) of integers compositions such that S1 is an integer composition of n1,..., S` is an integer composition of n`, and n1 +···+n` = n. Proposition 4.17 implies that we can regard the elements of arity n of SComp as segmented integer compositions of n. Indeed, there is a bijection between words of SComp and segmented compositions since there are 3n−1 segmented compositions of n and also, by the above Proposition, 3n−1 elements of SComp of arity n. 4.9 The diassociative operad Let M be the submonoid of the multiplicative monoid restricted to the set {0, 1}. Let D be the non- symmetric suboperad of TM generated by 01 and 10. One has the following characterization of the elements of D: Proposition 4.18 The elements of D are exactly the words on the alphabet {0, 1} that contain exactly one 1. Recall that the diassociative operad [10] Dias is the non-symmetric operad generated by two ele- ments a and ` of arity 2, subject only to the relations a ◦ a = a ◦ a = a ◦ `, (49) 1 2 2 a ◦1 ` = ` ◦2 a . (51) ` ◦2 ` = ` ◦1 ` = ` ◦1 a, (50) 240 Samuele Giraudo

Proposition 4.19 The non-symmetric operads D and Dias are isomorphic. The map φ : Dias → D defined by φ(a) := 10 and φ(`) := 01 is an isomorphism. Proposition 4.19 also says that D is a realization of the diassociative operad.

References [1] J. M. Boardman and R. M. Vogt. Homotopy invariant algebraic structures on topological spaces. Lect. Notes Math., 347, 1973.

[2] F. Chapoton. Sur le nombre d’intervalles dans les treillis de Tamari. Sem.´ Lothar. Combin., 55, 2006. [3] F. Chapoton. Operads and algebraic combinatorics of trees. Sem.´ Lothar. Combin., 58, 2008. [4] F. Chapoton and M. Livernet. Pre-Lie algebras and the rooted trees operad. Int. Math. Res. Notices, 8:395–408, 2001.

[5] F. Chapoton and M. Livernet. Relating two Hopf algebras built from an operad. Int. Math. Res. Notices, 2007. [6] A. Dvoretzky and Th. Motzkin. A problem of arrangements. Duke Math. J., 14:305–313, 1947. [7] D. Gouyou-Beauchamps and X. Viennot. Equivalence of the two-dimensional directed animal prob- lem to a one-dimensional path problem. Adv. Appl. Math., 9:334–357, 1988. [8] F. Hivert, J.-C. Novelli, and J.-Y. Thibon. The Algebra of Binary Search Trees. Theor. Comput. Sci., 339, Issue 1:129–165, 2005. [9] M. Livernet. A rigidity theorem for pre-Lie algebras. J. Pure Appl. Algebra, 1:1–18, 2006.

[10] J.-L. Loday. Dialgebras. Lect. Notes Math., 1763:7–66, 2001. [11] J.-L. Loday and M. Ronco. Hopf Algebra of the Planar Binary Trees. Adv. Math., 139:293–309, 1998. [12] J.-L. Loday and B. Vallette. Algebraic operads, 2011. Version 0.99, To appear.

[13] J. P. May. The geometry of iterated loop spaces. Lect. Notes Math., 271, 1972. [14] The Sage-Combinat community. Sage-Combinat: enhancing Sage as a toolbox for computer explo- ration in algebraic combinatorics, 2011. http://combinat.sagemath.org. [15] W. A. Stein et al. Sage Mathematics Software (Version 4.7.1). The Sage Development Team, 2011. http://www.sagemath.org.