1 Introduction

The notion of substructure is important in mathematics, and particularly in combinatorics. In graph theory, minors and induced subgraphs are the main examples of studied substructures. Substructures of other objects have been studied: set partitions, trees, paths and, to a larger extent, permutations, where the study of patterns leads to the concept of permutation classes.

A priori unrelated, it has been shown that Hopf algebras are a natural tool in algebraic combinatorics to study discrete objects, like graphs, set compositions and permutations. For instance, the celebrated Hopf algebra on permutations named after Malvenuto and Reutenauer sheds some light on the structure of shuffles in permutations. Other examples of Hopf algebras in combinatorics that are relevant to this work are the Hopf algebra on symmetric functions (described for instance in [16]), and the permutation pattern Hopf algebra introduced by Vargas in [20].

With that in mind, we build upon the notion of species with restrictions, as presented in [3] by Aguiar and Mahajan, to connect these two areas of algebraic combinatorics. Species with restrictions, or combinatorial presheaf, arise by enriching a species with restriction maps. With this combinatorial data, we produce a functorial construction of a pattern algebra \(\mathcal A (h)\) from any given combinatorial presheaf h. By further considering an associative product on our objects, we can endow \(\mathcal {A}(h)\) with a coproduct that makes it a bialgebra, and under specific circumstances a Hopf algebra. The main examples of combinatorial presheaves are words, graphs and permutations. Examples of associative products on combinatorial objects are the disjoint union on graphs or the direct sum on permutations.

The algebras obtained from a combinatorial presheaf are always commutative. In analyzing Hopf algebras, it is of particular interest to show that such algebras are free commutative (henceforth, we simply say free), and to construct free generators of the algebra structure. The fact that a Hopf algebra is a free algebra has several applications. For instance, in [6], it was shown that any graded free and cofree Hopf algebra is self dual. Moreover, self dual Hopf algebras are characterized by studying their primitive elements. The freeness of a Hopf algebra also allows us to gain some insight into the character group of the Hopf algebra; see for instance [17]. It can also be used under duality maps to establish cofreeness of Hopf monoids, as described in the methods of Möbius inversion in [14].

We will use tools from the combinatorics of words and Lyndon words. In fact, Lyndon words are commonly used to establish the freeness of algebras. Examples are the shuffle algebra in [13] (see also [8, Chapter 6]), the algebra of quasisymmetric functions in [9, Theorem 8.1], and the algebra on word quasisymmetric functions in non-commutative variables, in [4].

Computing the primitive space of a specific Hopf algebra is of interest. If the Hopf algebra \(H = \bigcup _{n\ge 0} H^{(n)}\) is a filtered Hopf algebra with P(H) primitive space, computing the dimension of \(H^{(n)} \cap P(H)\) is a classic problem, having applications for instance in establishing that a given Hopf algebra is not a Hopf subalgebra of another one. Thus, when we establish that a Hopf algebra is in fact a pattern Hopf algebra, we can use these tools to understand the primitive space and the coradical filtration of a Hopf algebra. Conversely, this also gives us a very flexible tool to establish that a given Hopf algebra is in fact a patter Hopf algebra. We use precisely this method to establish that the symmetric function Hopf algebra is a pattern Hopf algebra, and we conjecture that the same method gives us that the quasi-symmetric function Hopf algebra is also a pattern Hopf algebra.

In this paper, we show that any commutative combinatorial presheaf gives rise to a pattern algebra that is free commutative. We also study a non-commutative combinatorial presheaf on marked permutations, where we establish the freeness, construct the free elements with the help of Lyndon words, and enumerate the primitive elements of the pattern Hopf algebra on marked permutations. In the rest of this section, we present these results in more detail, and describe the methods for proving them.

1.1 Pattern Hopf Algebras from Monoids in Presheaves

Let \(\mathtt {Set}_{\hookrightarrow }\) be the category whose objects are finite sets and morphisms are injective maps between finite sets. Let also \(\mathtt {Set}_{\times }\) be the category whose objects are finite sets and morphisms are bijective maps between finite sets. Write \(\mathtt {Set}\) for the usual category of finite sets.

A species is a functor from \(\mathtt {Set}_{\times }\) to \(\mathtt {Set}\) (or equivalently, to itself). Hence, a species h is described by an assignment of each set I to a finite set h[I], together with some relabeling map for each bijection. Species occur very naturally in combinatorics as a way of describing the combinatorial structures on finite sets, for instance graph structures on a vertex set or a poset on a ground set.

Definition 1.1

(Combinatorial presheaves). A combinatorial presheaf (or a presheaf, for short) is a contravariant functor from \(\mathtt {Set}_{\hookrightarrow }\) to \(\mathtt {Set}\). A morphism of combinatorial presheaves is simply a natural transformation of functors. In this way, we have the category \(\mathtt {CPSh}\) of combinatorial presheaves. This was introduced in [3, Section 8.7.8.].

In this form, a presheaf is simply a species enriched with restriction maps \({{\,\mathrm{\mathbf {res}}\,}}_J : h[I] \rightarrow h[J] \) for each inclusion \(J\hookrightarrow I\) is a way that is functorial, that is if \(J_1\subseteq J_2\), then \({{\,\mathrm{\mathbf {res}}\,}}_{J_2} \circ {{\,\mathrm{\mathbf {res}}\,}}_{J_1} = {{\,\mathrm{\mathbf {res}}\,}}_{J_1}\). The notion of presheaves has been around in category theory and geometry for some time, where it generally refers to contravariant functors from the category of open sets of a topology with inclusions as morphisms. The main examples of combinatorial presheaves are graphs, set compositions, and permutations; see Example 2.2. In general, any combinatorial object that admits a notion of restriction admits a presheaf structure.

The category \(\mathtt {CPSh}\) and monoidal and bimonoidal structures thereof have been studied in [3]. We will explain the connections between this prior work and our results in Remark 1.5.

In presheaves, two objects \(a\in h[I], b\in h[J]\) are said to be isomorphic objects, or \(a\sim b\), if there is a bijection \(f:I\rightarrow J\) such that \(h[f](b)=a\). The set of equivalence classes in h[I] is denoted \(h[I]_{\sim }\). Let h[n] denote the objects of type h on the set \([n] = \{1, \dots , n\}\). The collection of equivalence classes of a presheaf h is denoted by \(\mathcal {G}(h) = \bigcup _{n\ge 0 } h[n]_{\sim }\). In this way, the set \(\mathcal G(h) \) is the collection of all the h-objects up to isomorphism.

If \(b \in h[I]\) and \(J \subseteq I\), we denote \(b|_J\) for \(h[\mathrm {inc}](b)\), where \(\mathrm {inc}: J \hookrightarrow I\) is the natural inclusion map.

Definition 1.2

(Patterns in presheaves). Let h be a presheaf, and consider two objects \(a\in h[I], b\in h[J]\). We say that \(J'\subseteq J \) is a pattern of a in b if \(b|_{J'} \sim a\). We define the pattern function

$$\begin{aligned}{{\,\mathrm{\mathbf {p}}\,}}_a( b) : = \left| \{J' \subseteq J \text { such that } {{\,\mathrm{\mathbf {res}}\,}}_{J'}(b) \sim a \} \right| . \end{aligned}$$

Fix a field k with characteristic zero. Denote the family of functions \(A \rightarrow B\) by \(\mathcal {F} (A, B)\).

This definition only depends on the isomorphism classes of a and b; see Observation 3.1. Hence, we can consider \(\{ {{\,\mathrm{\mathbf {p}}\,}}_a \}_{a\in \mathcal {G}(h)}\) as a family of functions from \(\mathcal {G}(h)\) to k, indexed by \(\mathcal {G}(h)\). In Example 2.2, we see an example of a presheaf structure on permutations.

In the following we will be using the field of rational numbers, but to the goals of this paper it is only relevant to pick a field \(\mathbb {k}\) that has characteristic zero.

If h is a combinatorial presheaf, then the linear span of the pattern functions is a linear subspace \(\mathcal {A}(h) \subseteq \mathcal {F}(\mathcal {G}(h) , \mathbb {Q}) \) of the space of functions \(\mathcal {G}(h) \rightarrow \mathbb {Q}\).

Theorem 1.3

The vector space \(\mathcal {A}(h)\) is closed under pointwise multiplication and has a unit. It forms an algebra, called the pattern algebra. More precisely, if \(a, b \in \mathcal G(h)\),

$$\begin{aligned} {{\,\mathrm{\mathbf {p}}\,}}_ a {{\,\mathrm{\mathbf {p}}\,}}_b = \sum _c \left( {\begin{array}{c}c\\ a, b\end{array}}\right) {{\,\mathrm{\mathbf {p}}\,}}_c, \end{aligned}$$
(1)

where the coefficients \(\left( {\begin{array}{c}c\\ a, b\end{array}}\right) \) are the number of “quasi-shuffles” of ab that result in c, specifically, if we take \(c\in h[C]\) to be a representative of the equivalence class c, then:

$$\begin{aligned} \left( {\begin{array}{c}c\\ a, b\end{array}}\right) = \left| \{(I, J) \, \text { such that } \, \, I \cup J = C,\, \, c|_{I} \sim a, \, c|_{J} \sim b \} \right| . \end{aligned}$$

Quasi-shuffles of objects have been studied in several contexts as a notion of merging objects together. For details on quasi-shuffles of combinatorial objects, the interested reader can see [3, 7, 10].

We introduce now the Cauchy product \(\odot \) on the category of combinatorial presheaves, which associates to two combinatorial presheaves h and j the combinatorial presheaf

$$\begin{aligned} h \odot j : I \mapsto \biguplus _{A\uplus B = I} h[A] \times j[B] \, . \end{aligned}$$

The unit for this product is the unique presheaf that satisfies \(\mathcal {E}[A] = \emptyset \) for \(A \ne \emptyset \), and \(\mathcal {E}[\emptyset ] = \{ \diamond \} \). If \(f:h_1 \Rightarrow h_2\) and \( g: j_1 \Rightarrow j_2 \) are natural transformations of presheaves, then \(f\odot g\) is a natural transformation such that \((f\odot g)_I\) is the natural mapping from \(h_1[A]\times j_1[B]\) to \(h_2[A] \times j_2[B]\), for each decomposition \(A\uplus B = I\).

Product structures on categories were examined in [12]. There, it was shown that the Cauchy product gives the category of presheaves a monoidal structure. We call an object in this monoidal category an associative presheaf.

This is a triple \((h, *, 1)\), where h is a combinatorial presheaf, \(*\) is a natural transformation \(h\odot h \Rightarrow h\), and \(1 \in h[\emptyset ] \) a unit that satisfy classical axioms of associativity and unit. We explain the details further in Sect. 2 below.

Examples of associative operations on combinatorial presheaves are the disjoint union of graphs and the direct sum of permutations. Another less standard example, which we study in this paper, is the inflation of marked permutations, defined below.

Observe that the associative product \(*\) in our combinatorial objects is a natural transformation. This means that the product is stable with respect to relabelings and restrictions, so we can also define the corresponding product on \(\mathcal {G}(h)\), which we denote by \(\cdot \) for the sake of distinction; see Definition 3.5. With this, we introduce the following coproduct in the pattern algebra \(\mathcal A (h)\):

$$\begin{aligned} \Delta {{\,\mathrm{\mathbf {p}}\,}}_ a = \sum _{\begin{array}{c} b, c\in \mathcal G (h) \\ a = b \cdot c \end{array}} {{\,\mathrm{\mathbf {p}}\,}}_b \otimes {{\,\mathrm{\mathbf {p}}\,}}_c. \end{aligned}$$
(2)

where the sum runs over coinvariants bc such that \(a = b \cdot c\). The main property that motivates this operation in \(\mathcal {A}(h)\) is that, under the natural identification of the function algebra \(\mathcal {F}(\mathcal G (h), \mathbb Q)^{\otimes 2} \) as a subspace of \(\mathcal {F}(\mathcal G (h) \times \mathcal G (h), \mathbb Q) \), we have

$$\begin{aligned} \Delta {{\,\mathrm{\mathbf {p}}\,}}_a (b, c) = {{\,\mathrm{\mathbf {p}}\,}}_a (b \cdot c). \end{aligned}$$
(3)

This is shown in Theorem 1.4. The relation (3) is central in establishing that the coproduct \(\Delta \) is compatible with the product in \(\mathcal A (h)\).

Theorem 1.4

Let \((h, *, 1) \) be an associative presheaf. Then the pattern algebra of h together with this coproduct, and a natural choice of counit, forms a bialgebra. If additionally \(| h[\emptyset ] | = 1 \), the pattern algebra forms a Hopf algebra.

Presheaves that satisfy \(|h[\emptyset ]| = 1\) are called connected. Connected algebraic structures are a classical resource in graded Hopf algebras, as in this way we can find an antipode through the so called Takeuchi formula, introduced in [19].

Some known Hopf algebras can be constructed as the pattern algebra of a combinatorial presheaf. An example is Sym, the Hopf algebra of symmetric functions. This Hopf algebra has a basis indexed by partitions, and corresponds to the pattern Hopf algebra of the presheaf on set partitions (see details in Sect. 4.4). The pattern Hopf algebra corresponding to the presheaf on permutations described above was introduced by Vargas in [20]. Some other Hopf algebras constructed here, like the ones on graphs and on marked permutations below, are new, and some we conjecture are isomorphic to known Hopf algebras like the pattern Hopf algebra on set compositions, which may be simply the Hopf algebra of quasi-symmetric functions; see Conjecture 4.14 below.

We also establish some general properties of pattern Hopf algebras, like describing their primitive elements, finding the inverse of the so-called pattern action in \(\mathcal {A}(h)\), and relating \(\mathcal A (h)\) with the Sweedler dual of an algebra generated by \(*\).

Remark 1.5

In the terminology of [3], a cocommutative comonoid in set species is precisely what we call here a combinatorial presheaf. This is done by identifying \(\Delta _{A, B}(a) = a|_A \times a|_B\) with the restrictions of a to the sets A and B. Furthermore, an associative presheaf is a cocomutative bimonoid in set species. The coalgebra structure of the pattern Hopf algebras that we construct here is a subcoalgebra of the dual algebra of the so called bosonic Fock functor of these comonoids in linearized set species. This is the subject of [3, Proposition 8.29]. However, the algebra structure is in general different.

Specifically, on the combinatorial presheaf on graphs introduced below, the corresponding coalgebra structure is the dual of the well known incidence Hopf algebra introduced in [15].

1.2 Commutative Presheaves

In this paper, we focus on the problem of proving the freeness of some pattern algebras.

Definition 1.6

(Free generators of an algebra). If A is a commutative algebra, a set \(\mathcal G \subset A\) is a generating set if the smallest subalgebra A containing \(\mathcal G\), written \(\langle \mathcal G \rangle \), is A.

A set \(\mathcal G \subset A\) is a (commutative) free set if for any finite collection \(y_1, \dots , y_k\) of elements in \(\mathcal G\) and any non-zero polynomial in k commutative variables \(p = p(x_1, \dots , x_k)\), the evaluation \(p(y_1, \dots , y_k)\) is a non-zero element in A.

If an algebra A has a free generator set \(\mathcal G\), the algebra is free.

The first case that we want to explore is the one of commutative presheaves. An associative presheaf \((h, *, 1)\) is called commutative if \(*\) is commutative, that is for any \(a\in h[I], b\in h[J]\) we have that \(a *b = b *a\); see Definition 2.3.

As it turns out, this is enough to guarantee the freeness of the pattern Hopf algebra. This is one of the main results of this paper.

Theorem 1.7

(Commutative combinatorial presheaves are free). The pattern Hopf algebra of an associative combinatorial presheaf with a commutative product \(*\) is free. The free generators are the pattern functions indexed by the irreducible objects with respect to \(*\).

The proof of this result is presented in Sect. 4. The main ingredient for this result is Corollary 4.4, a surprising structure result on associative presheaves, which shows that the structure of an associative presheaf can be described much in the same way as we can describe a group: by providing a set of generators and a set of relations that these generators must satisfy.

In the case of the graph pattern Hopf algebra, Theorem 1.7 was already proved in [21, Theorem 3], where a function on graphs that satisfies (1) is shown to be completely determined by its values on the connected graphs, that the remaining values are obtained via polynomial expressions, and that no other polynomial expressions hold for such a generic function.

1.3 Non-commutative Presheaves

As mentioned above, the pattern Hopf algebra on permutations is the one discussed by Vargas in [20], where it is shown that it is free. This is an example of a non-commutative associative presheaf. There, free generators were constructed. These generators correspond to Lyndon words of \(\oplus \)-indecomposable permutations, see [5] for an introduction to combinatorics of Lyndon words.

In this paper, we explore other associative presheaves that are non-commutative. Taking the presheaf on permutations as our starting point, we wish to study monoidal structures that are more complex than the \(\oplus \) product (see Example 2.8), but still allows us to establish the freeness property. We investigate the presheaf on marked permutations \(\mathtt {MPat}\), which is equipped with the inflation product. This product is motivated by the inflation procedure on permutations described in [1]. Its presheaf structure is presented below in Example 2.10. This is not a commutative presheaf, so Theorem 1.7 does not apply. However, we still have the following:

Theorem 1.8

(Freeness of \(\mathcal {A}(\mathtt {MPat})\)). The pattern algebra \(\mathcal {A}(\mathtt {MPat})\) is free.

To establish the freeness of \(\mathcal {A}(\mathtt {MPat})\) we present a unique factorization theorem on marked permutations with the inflation product in Corollary 5.12. This is an analogue of [1, Theorem 1]. With it, we find generators of the algebra on marked permutations, and use the Lyndon factorization of words in [5] to show that these generators are free generators.

In this way, the presheaf on marked permutations will be one main focus of this paper: Sect. 5 will be dedicated to the freeness problem on this presheaf, as well as enumerating the dimension of the primitive space of the pattern Hopf algebra, which corresponds to enumerating the marked permutations that are irreducible with respect to the inflation product.

2 Notation and Preliminaries

2.1 Species and Monoidal Functors

If h is a combinatorial presheaf, and if \(a \in h[I]\), we define the size of a as \(|a| := | I | \) and the indexing set of a as \(\mathbb {X}(a) = I\).

Example 2.1

(The unit presheaf). The species \(\mathcal {E} \) with only one object \(\diamond \), which has size zero, has a unique presheaf structure.

Example 2.2

(The presheaf on permutations). To fit the framework of presheaves, we use a rather unusual definition of permutations introduced in [2]. There, a permutation on a set I is seen as a pair of orders in I. This relates to the usual notion of a permutation as bijections in the following way: if we order the elements of \(I = \{a_1 \le _P \dots \le _P a_k \} = \{ b_1 \le _V \dots \le _V b_k \}\), then this defines a bijection via \(a_i \mapsto b_i \) in I. Conversely, for any bijection f on I, there are several pairs of orders \((\le _P, \le _V)\) that correspond to the bijection f, all of which are isomorphic. If \(I \hookrightarrow J\), by restricting the orders on I to orders on J via the injective map \(\hookrightarrow \), we obtain a restriction to a permutation on J. The resulting presheaf structure is denoted by \(\mathtt {Per}\).

It will be useful to represent permutations in I as square diagrams labeled by I. This is done in the following way: we place the elements of I in an \(|I| \times |I|\) grid so that the elements are placed horizontally according to the \(\le _P\) order, and vertically according to the \(\le _V\) order. For instance, the permutation \(\pi = \{1<_P2<_P3 , 2<_V1<_V3\}\) in \(\{1, 2, 3\}\) can be represented as

(4)

In this way, there are \((n!)^2 \) elements in \(\mathtt {Per}[n]\). Up to relabeling, we can represent a permutation as a diagram with one dot in each column and row. Thus, \(\mathcal {G}(\mathtt {Per})\) has n! isomorphism classes of permutations of size n, as expected.

If we consider a permutation \(\pi \) on a set I, that is, a pair \((\le _P, \le _V) \) of total orders in I, we write \(\mathbb {X}(\pi ) = I\). If \(f:J \rightarrow I \) is an injective map, the preimage of each order \(\le _P, \le _V\) is well defined and is also a total order in J. This defines the permutation \(\mathtt {Per}[f](\pi )\).

A crucial observation is that this notion recovers the usual concept of permutation pattern already present in the literature. Specifically, the number of occurrences of a permutation \(\tau \) in \(\pi \) as described in [22] is precisely \({{\,\mathrm{\mathbf {p}}\,}}_{\tau }(\pi )\), and a permutation \(\pi \) avoids \(\tau \) in the sense describe in [11] if \({{\,\mathrm{\mathbf {p}}\,}}_{\tau }(\pi )=0\).

Recall that we are given a bifunctor \(\odot \) that endows the category of combinatorial presheaves with a monoidal category structure, as introduced in [3].

Definition 2.3

(Associative presheaf). An associative presheaf is a monoid in \(\mathtt {CPSh}\), that is, is a combinatorial presheaf h together with natural transformations \(\eta : h \odot h \Rightarrow h\) and \( \iota : \mathcal {E} \Rightarrow h\) that satisfy associativity and unit conditions. We use, for \(a\in h[I]\) and \(b\in h[J]\), the notation \(\eta _{I, J}(a, b) = a*b\). We also denote the unit by \(1 := \iota [\emptyset ](\diamond )\in h [ \emptyset ] \).

This is commutative if, for any \(a\in h[I], b\in h[J]\) with \(I\cap J =\emptyset \), we have \(a*b = b *a\).

Thus, a product on a presheaf simply describes how to merge objects of a certain type h that are based on disjoint sets.

Observation 2.4

(Naturality axioms in associative presheaves). The naturality of \(\eta \), the associativity and unit conditions correspond to the following properties:

  • For all IJ disjoint sets, all \(a\in h[I], b\in h[J]\) and all \(A\subseteq I, B\subseteq J\), we have \((a*b)|_{A\sqcup B} = a|_A *b|_B\).

  • For all IJK disjoint sets and all \(a\in h[I], b\in h[J], c\in h[K]\), we have \((a *b) *c = a *(b*c)\).

  • For any set I, and \(a\in h[I]\), we have \(a*1 = 1 *a = a\).

Remark 2.5

(Monoidal product and quasi-shuffle). In an associative presheaf \((h, *, 1)\), let \(a\in h[I], b \in h[J]\) with IJ disjoint sets. Then it is not always the case that \(a|_{\emptyset } = 1\), that \((a*b)|_I = a\) or that \( (a*b ) |_J = b\).

This is the case, however, when h is a connected presheaf. It follows that in an associative connected presheaf h, we have that \(\left( {\begin{array}{c}a *b\\ a, b\end{array}}\right) \ge 1\).

Definition 2.6

Let \((h, *_h, 1_h)\) and \((j, *_j, 1_j)\) be associative presheaves, and let f be a presheaf morphism between \((h, *_h, 1_h)\) and \((j, *_j, 1_j)\). This is an associative presheaf morphism if it maps unit to unit, and the associative product of the associative presheaves.

That is, \(f: h \Rightarrow j\) is an associative presheaf morphism if it is a presheaf morphism that satisfies \(f(1_h)=1_j\) and \(f(b' *_h c') = f(b') *_j f( c')\) for any \(b'\in h[I], c' \in h[J]\).

2.2 Preliminaries on Permutations, Graphs and Marked Permutations

Example 2.7

(Presheaf on graphs). There are many notions of patterns on graphs: minors, subgraphs and induced subgraphs are among some of those. The one that forms a presheaf is the one of induced subgraphs.

This forms a combinatorial presheaf \(\mathtt {Gr}\) that can be endowed with the associative product of disjoint union of graphs \(\uplus \). This is in fact a commutative product, so \(\mathcal A ( \mathtt {Gr} )\) is a free algebra, and the pattern functions of connected graphs are the free generators, that is:

Example 2.8

(Permutations and their pattern Hopf algebra). To the presheaf \(\mathtt {Per}\) there corresponds a pattern algebra \(\mathcal {A}(\mathtt {Per})\) as discussed above. We can further consider \(\mathtt {Per} \) with a monoid structure via the direct sum of permutations \(\oplus \), defined as follows: Suppose that \(\pi \in \mathtt {Per}[I], \tau \in \mathtt {Per}[J]\) are two permutations based on the disjoint sets IJ, respectively. The permutation \(\pi \oplus \tau \in \mathtt {Per}[I\sqcup J]\) is the pair of total orders \((\le _P^{\oplus }, \le _V^{\oplus }) \) extending both of the respective orders from \(\pi , \tau \) to \(I\sqcup J\) by forcing that \(i\le _P^{\oplus } j\) and \(i\le _V^{\oplus } j\) for any \(i\in I, j\in J\). Correspondingly, the diagram of \(\pi \oplus \tau \) results from the ones from \(\pi \), \(\tau \) as follows

We note that this is not a commutative presheaf: in general, \(\pi \oplus \tau \) is a different permutation than \(\tau \oplus \pi \).

We can write a permutation in its two-line notation, as \( \begin{array}{c} a_1, \dots , a_k \\ b_1 , \dots , b_k \end{array}\) where \(a_1 \le _V a_2 \le _V \dots \) and \(b_1 \le _P b_2 \le _P \dots \le _P b_k\). If we identify \(b_1 , \dots , b_k \) with \(1, \dots , k\), respectively, we can disregard the bottom line. This also disregards the indexing set I, and in fact any two isomorphic permutations have the same representation with the one line notation.

We call the unique permutation in the empty set the trivial permutation and denote it \(\emptyset \).

Definition 2.9

(The \(\ominus \) operation). Given two permutations, \(\pi , \sigma \), we have already introduced the product \(\pi \oplus \sigma \). We now define the permutation \(\pi \ominus \tau \in \mathtt {Per}[I\sqcup J]\) as the pair of total orders \((\le _P^{\ominus }, \le _V^{\ominus }) \) extending the respective ones from \(\pi , \tau \) to \(I\sqcup J\) by forcing that \(i\le _P^{\ominus } j\) and \(i\ge _V^{\ominus } j\) for any \(i\in I, j\in J\). Correspondingly, the diagram of \(\pi \ominus \tau \) results from the ones from \(\pi \), \(\tau \) as

It is a routine observation to check that both \(\oplus , \ominus \) are associative products on \(\mathtt {Per}\), and that \(\emptyset \) is the unit of both operations, by simply checking that all properties in Observation 2.4 are fulfilled.

Example 2.10

(Marked permutations and their pattern Hopf algebra). A marked permutation \(\pi ^*\) on I is a pair of orders \((\le _P, \le _V)\) on the set \(I \sqcup \{ * \}\). Intuitively, this gives us a rearrangement of the elements of \(I \sqcup \{ * \}\), where one element is special and marked. The relabelings and restriction maps are the natural ones borrowed from orders, giving us a combinatorial presheaf, that we call \(\mathtt {MPer}\). We can represent a marked permutation in a diagram, as we do for permutations. Note that in this case the marked element \(*\) never changes position after relabelings. Take for instance the marked permutations \(\pi ^* = (1<_P2<_P *, 2<_V1<_V* )\), \(\tau ^* = (*<_P1<_P2, 1<_V*<_V2)\), and \(\sigma ^* = (*<_P2<_P1, 2<_V*<_V1)\). Observe that there is no isomorphism between \(\pi ^* \) and \(\tau ^* \), whereas there is one between \(\tau ^* \) and \(\sigma ^* \), via the relabeling \(1 \mapsto 2, 2 \mapsto 1\).

In this way, there are \(((n+1)!)^2 \) elements in \(\mathtt {MPer}[n]\). Up to relabeling, we can represent a marked permutation as a diagram with one dot in each column and row, where a particular dot is the distinguished element \(*\). Therefore, \(\mathcal {G}(\mathtt {MPer})\) has \((n+1) \times (n+1)! \) isomorphism classes of marked permutations of size n.

Definition 2.11

(Marked permutations). If we consider a marked permutation \(\pi ^*\) on a set I, that is, a pair \((\le _P, \le _V) \) of total orders in \(I^*\), we write \(\mathbb {X}(\pi ^*) = I\). If \(f:J \rightarrow I \) is an injective map, this can be extended canonically to an injective map \(f^* : J^* \rightarrow I^*\). Thus, the preimage of each order \(\le _P, \le _V\) under \(f^* \) is well defined and is also a total order in \(J^*\). This defines the marked permutation \(\mathtt {MPer}[f](\pi ^* )\).

Note that a relabeling of the permutation \(\pi ^*\) in \(I^*\) is a relabeling of the corresponding marked permutation in I if the relabeling preserves the marked elements.

We can also write marked permutations in a one line notation, where we add a marker over the position of \(*\). The resulting notation only disregards the indexing set I, and so any two isomorphic marked permutations have the same one line notation. Note that for each permutation of size n it corresponds n different non-isomorphic marked permutations of size \(n-1\), one for each possible marked position.

Example 2.12

If we consider \((1<_P 2<_P *<_P 4,\, \, 1<_V *<_V 4 <_V 2)\), a marked permutation on \(\{ 1, 2, 4\}\), its representation with the one line notation is \(14\bar{2}3\).

The marked permutation \(\tau ^* = (73<_P x<_P *<_P 47, \, \, 73<_V *<_V x <_V 47 )\) is based on the set \(I= \{x, 47, 73 \}\) and has a one line representation \(13\bar{2}4\). Consider now \(\pi ^* = (1<_P *<_P 2, 1<_V * <_V 2) \) and \(\sigma ^* = (1<_P *<_P 2, *<_V 1<_V 2)\) marked permutations in \(\{1, 2 \}\) So the marked permutations \(\tau ^*, \pi ^*, \sigma ^*\) correspond to the one line notations below

(5)

Then, we have that \(\pi ^*, \sigma ^*\) are patterns of \( \tau ^* \), because \(J = \{73, 47 \}\) is an occurrence of \(\pi ^* \) in \(\tau ^* \), and \(J' = \{x, 47\}\) is an occurrence of \(\sigma ^* \) in \(\tau ^*\).

Definition 2.13

(Inflation product). The inflation product \(\star \) in marked permutations is defined as follows: Given two marked permutations \(\tau ^* \in \mathtt {MPer}[I]\) and \(\pi ^* \in \mathtt {MPer}[J]\) with IJ disjoint sets, the inflation product \(\tau ^* \star \pi ^* \in \mathtt {MPer}[I\sqcup J]\) is a marked permutation resulting from replacing in the diagram of \(\tau ^* \) the marked element with the diagram of \(\pi ^* \). Here is an example:

Remark 2.14

Note that if \(\pi ^* \star \tau ^* = \pi ^* \star \sigma ^*\), then \(\tau ^* = \sigma ^* \). Similarly, if \(\tau ^* \star \pi = \sigma ^* \star \pi ^*\), then \(\tau ^* = \sigma ^* \).

It is straightforward to observe that this is an associative presheaf with \(\mathtt {MPer}[\emptyset ] \), where the unit is the unique marked permutation on \(\emptyset \), denoted by \(\bar{1}\). We call it the presheaf of marked permutations. Hence, from Theorem 1.8, the algebra \(\mathcal {A}(\mathtt {MPat})\) is indeed a Hopf algebra.

2.3 Strategy for Establishing the Freeness of a Pattern Algebra

We now discuss the general strategy that we employ when establishing the freeness of a pattern Hopf algebra. In particular, we clarify what is the relation between unique factorization theorems and freeness of the algebra of interest. Let \(\mathcal {S}\subseteq \mathcal {G}(h)\) be a collection of objects in a presheaf h. Then the set \( \{{{\,\mathrm{\mathbf {p}}\,}}_s | s\in \mathcal {S} \} \) is a set of free generators of \(\mathcal {A}(h)\) if the set

$$\begin{aligned} \left\{ \prod _{s\in S} {{\,\mathrm{\mathbf {p}}\,}}_s \Big | S \text { multiset of elements of } \mathcal {S} \right\} , \end{aligned}$$

is a basis of \(\mathcal {A}(h)\). This is usually established by connecting this set with the set \(\left\{ p_a | a \in \mathcal {G}(h)\right\} \), which is known to be a basis by Remark 3.2. This connection is done with the following ingredients:

  • An order \(\preceq \) in \(\mathcal {G}(h) \).

  • A bijection f between \(\{ S \text { multiset of elements of } \mathcal {S} \}\) and \( \mathcal {G}(h) \), which is usually phrased in terms of a unique factorization theorem. See for instance Theorem 5.21.

  • The property that, for any S multiset of \(\mathcal {S}\),

    $$\begin{aligned} \prod _{s\in S} {{\,\mathrm{\mathbf {p}}\,}}_s = \sum _{t \preceq f(S)} c_{t, S} {{\,\mathrm{\mathbf {p}}\,}}_t, \end{aligned}$$
    (6)

    with non-negative coefficients \(c_{t, s}\) such that \(c_{f(S), S}\ne 0\).

These are enough to establish the desired freeness. In the commutative presheaf case, the unique factorization theorem is the one that we naively would expect; see Theorem 4.3. For the case of presheaf on permutations and the presheaf on marked permutations, the construction of the set \(\mathcal {S}\) is more technical.

Conjecture 2.15

The pattern Hopf algebra of any associative presheaf is free.

3 Substructure Algebras

In this section, we describe the construction of the pattern Hopf algebra mentioned in Theorem 1.4. We establish that for a combinatorial presheaf h, \(\mathcal {A}(h)\) is an algebra; see Theorem 1.3. Moreover, if h is connected and endowed with an associative structure, then \(\mathcal {A}(h)\) is a Hopf algebra; see Theorem 1.4. We also describe the space of primitive elements in \(\mathcal {A}(h)\), clarify that \(\mathcal {A}\) is in fact functorial; see Theorem 3.8, and find some identities and properties of the pattern functions in Propositions 3.11 and 3.12.

3.1 Coinvariants and Pattern Algebras

Given a combinatorial presheaf h, let \([n]=\{1, \dots , n\} \) for n non-negative integer. Then, recall that we define the coinvariants of h as the family

$$\begin{aligned} \mathcal {G}(h) = \biguplus _{n\ge 0} h[n]_{\sim }. \end{aligned}$$

For an object \(a\in \biguplus _J h[J] \), we defined the pattern function above in Definition 1.2. We have the following observation, that allows us to define pattern functions on equivalence classes.

Observation 3.1

This definition only depends on the isomorphism type of ab. That is, if \(a_1\in h[I_1], a_2\in h[I_2], b_1\in h[J_1], b_2\in h[J_2]\) are so that \(a_1\sim a_2, b_1\sim b_2\) then \({{\,\mathrm{\mathbf {p}}\,}}_{a_1}(b_1) = {{\,\mathrm{\mathbf {p}}\,}}_{a_2}(b_2)\).

This allows us to define the pattern functions \( {{\,\mathrm{\mathbf {p}}\,}}_a \) for \(a \in \mathcal {G}(h)\) as function in \( \mathcal {F}(\mathcal {G}(h), k)\).

Recall that we write

$$\begin{aligned} \mathcal {A}(h) : = {{\,\mathrm{\mathrm {span}}\,}}\{ {{\,\mathrm{\mathbf {p}}\,}}_a | \, a \in \mathcal {G}(h) \} \subseteq \mathcal {F}(\mathcal {G}(h), k ), \end{aligned}$$

for the linear space spanned by all pattern functions.

Remark 3.2

If two coinvariants ab are such that \(|a| \ge |b|\) and \(a\ne b\), then \({{\,\mathrm{\mathbf {p}}\,}}_a (b)=0\). We also have \({{\,\mathrm{\mathbf {p}}\,}}_b(b) = 1\). Hence, the set \(\{ {{\,\mathrm{\mathbf {p}}\,}}_a | a\in \mathcal {G}(h) \}\) is a basis of \(\mathcal {A}(h)\).

For ab objects and \(c \in h[C]\), we defined the quasi-shuffle number as follows:

$$\begin{aligned} \left( {\begin{array}{c}c\\ a, b\end{array}}\right) = \left| \{(I, J) \, \text { such that } \, \, I \cup J = C,\, \, c|_{I} \sim a, \, c|_{J} \sim b \} \right| . \end{aligned}$$
(7)

And a quasi-shuffle as a pair that contributes to the coefficient above. This is invariant under the equivalence classes of \(\sim \), as it can be show in a similar way to Observation 3.1.

In Theorem 1.3 we observe that \(\mathcal {A}(h) \) is a subalgebra of \(\mathcal {F}(\mathcal {G}(h), k)\) with the pointwise multiplication structure and unit \( \sum _{c \in h[\emptyset ]} {{\,\mathrm{\mathbf {p}}\,}}_c \). We present now the proof.

Proof

Fix \(x\in h[I]\), and note that \({{\,\mathrm{\mathbf {p}}\,}}_a(x) {{\,\mathrm{\mathbf {p}}\,}}_b(x) \) counts the following

$$\begin{aligned} \begin{aligned} {{\,\mathrm{\mathbf {p}}\,}}_a(x) {{\,\mathrm{\mathbf {p}}\,}}_b(x)&= \left| \{A \subseteq I \text { s.t. } x|_A \sim a \} \times \{B \subseteq I \text { s.t. } x|_B \sim b \}\right| \\&= \left| \{(A, B) \text { s.t. } A, B \subseteq I, \, x|_A \sim a, \, x|_B \sim b \} \right| \\&= \sum _{C\subseteq I} \left| \{(A, B) \text { s.t. } A \cup B = C, \, x|_A \sim a, \, x|_B \sim b, \} \right| \\&= \sum _{C\subseteq I} \left( {\begin{array}{c}x|_C\\ a, b\end{array}}\right) = \sum _{c\in \mathcal {G}(h)} \left( {\begin{array}{c}c\\ a, b\end{array}}\right) {{\,\mathrm{\mathbf {p}}\,}}_c(x). \end{aligned} \end{aligned}$$
(8)

Hence, the space \(\mathcal {A}(h) \) is closed for the product of functions. Further, it is easy to observe that \(\sum _{a \in h[\emptyset ] } {{\,\mathrm{\mathbf {p}}\,}}_a \) is the constant function equal to one, so this is a unit and \(\mathcal {A}(h)\) is an algebra, concluding the proof. \(\square \)

Corollary 3.3

(Products and quasi-shuffles). Let \(c\in h[I]\) and \(b_i\in h[J_i]\) for \(i=1, \dots , k\), and let

$$\begin{aligned} \left( {\begin{array}{c}a\\ b_1, \dots , b_k\end{array}}\right) \,{:}{=}\,\left| \left\{ (J_1, \dots , J_k) \text { s.t. } \bigcup _{i=1}^k J_i = I, \, \, a|_{J_i} \sim b_i \, \, \forall i=1, \dots , k \right\} \right| . \end{aligned}$$

Then we have that

$$\begin{aligned} \prod _{i=1}^k {{\,\mathrm{\mathbf {p}}\,}}_{b_i} = \sum _c \left( {\begin{array}{c}c\\ b_1, \dots , b_k\end{array}}\right) {{\,\mathrm{\mathbf {p}}\,}}_c. \end{aligned}$$

Definition 3.4

(Shuffles and quasi-shuffles). If an object a is such that \(\left( {\begin{array}{c}a\\ b_1, \dots , b_k\end{array}}\right) >0 \) we say that a is a quasi-shuffle of \(b_1, \dots , b_k\). In addition, if \(|a| = \sum _{i=1}^k |b_i|\), we say that a is a shuffle of \(b_1, \dots , b_k\).

3.2 Coproducts on Pattern Algebras

In this section, we consider an associative presheaf \((h, *, 1)\). Concretely, our combinatorial presheaf h is endowed with an associative product \(*\) and a unit \(1 \in h[\emptyset ]\).

Definition 3.5

(Product structure in \(\mathcal {G}(h)\)). If \((h, *, 1)\) is an associative presheaf, then \(\mathcal {G}(h)\) inherits an associative product. If a is an object, we denote its equivalence class under \(\sim \) by \(\bar{a}\) in this remark. The associative product in \(\mathcal {G}(h)\) is defined as follows:

Let \(a \in h[n_1], b \in h[n_2] \) and denote \([n_1+1, n_1 + n_2] = \{ n_1 +1, \dots , n_1 + n_2 \}\). Consider st the order preserving map \(st : [n_1+1, n_1 + n_2] \rightarrow [n_2]\), and let \(b' = h[st](b)\). Then we define the product in \(\mathcal {G}(h)\) as \(\bar{a}\cdot \bar{b} : = \overline{a *b'} \in h[n_1 + n_2]_{\sim } \).

It is a direct computation to see that \(\overline{a*b}\) does not depend on the representative chosen for \(\overline{a}\) and \(\overline{b}\). Thus we have a well defined operation in \(\mathcal {G}(h)\).

Recall that in Eq. (2), we defined the coproduct in \(\mathcal A (h)\) as

$$\begin{aligned} \Delta {{\,\mathrm{\mathbf {p}}\,}}_a := \sum _{\begin{array}{c} b, c\in \mathcal {G}(h) \\ b \cdot c = a \end{array}} {{\,\mathrm{\mathbf {p}}\,}}_b \otimes {{\,\mathrm{\mathbf {p}}\,}}_c. \end{aligned}$$

We also introduce the counit \(\epsilon : \mathcal {A}(h) \rightarrow k\) that sends \({{\,\mathrm{\mathbf {p}}\,}}_a \) to \(\mathbb {1}[a = 1]\), where 1 stands for the unit in the associative presheaf h.

We recall and prove Theorem 1.4 here.

Remark that we refer to the pattern Hopf algebra of \((h, *, 1)\) simply by \(\mathcal {A}(h)\) instead of \(\mathcal {A}(h, *, 1)\), for simplicity of notation, whenever emphasis on the role of \(*\) is not needed.

Proof of Theorem 1.4

First, we note that \(\Delta \) is trivially coassociative, from the associativity axioms of \(*\) described in Observation 2.4. That \(\epsilon \) is a counit follows from the unit axioms on \((h, *, 1)\).

We first claim that, for \(a, x, y\in \mathcal {G}(h)\),

$$\begin{aligned} \Delta {{\,\mathrm{\mathbf {p}}\,}}_a (x, y ) = {{\,\mathrm{\mathbf {p}}\,}}_a (x\cdot y ), \end{aligned}$$
(9)

using the natural inclusion \(\mathcal {F}(\mathcal {G}(h), k)^{ \otimes 2} \subseteq \mathcal {F}(\mathcal {G}(h)^2, k)\).

Indeed, take representatives \(x\in ~h[n_1]\) and \(y\in ~h[n_2]\) with no loss of generality, and write \(B=[n_1]\), \(C = \{n_1+1, \dots , n_1+n_2\}\). Let st be the order preserving map between C and \([n_2]\). Then

$$\begin{aligned} \begin{aligned} {{\,\mathrm{\mathbf {p}}\,}}_a (x*y )&= \left| \{J \subseteq B\sqcup C \text { such that }(x*y)|_J \sim a \} \right| \\&= \left| \{J \subseteq B\sqcup C \text { such that } x|_{J\cap B} *y|_{J\cap C} \sim a \} \right| \\&= \sum _{\begin{array}{c} b, c\in \mathcal {G}(h) \\ a \sim b \cdot c \end{array}} \left| \{J \subseteq B\sqcup C \text { such that } x|_{J\cap B} \sim b, \, \, y|_{J\cap C} \sim c \} \right| \\&= \sum _{\begin{array}{c} b, c\in \mathcal {G}(h) \\ a \sim b \cdot c \end{array}} \left| \{J \subseteq B \text { s.t. } x|_J \sim b \} \times \{ J \subseteq C \text { s.t. } y|_{J} \sim c \} \right| \\&= \sum _{\begin{array}{c} b, c\in \mathcal {G}(h) \\ a \sim b \cdot c \end{array}} {{\,\mathrm{\mathbf {p}}\,}}_{b}(x){{\,\mathrm{\mathbf {p}}\,}}_{c}(y) = \Delta {{\,\mathrm{\mathbf {p}}\,}}_a(x, y). \end{aligned} \end{aligned}$$
(10)

Since both functions take the same values on \(\mathcal {G}(h)^2 \), we conclude that (9) holds.

The following are the bialgebra axioms that we wish to establish:

$$\begin{aligned} \Delta ({{\,\mathrm{\mathbf {p}}\,}}_a {{\,\mathrm{\mathbf {p}}\,}}_b )&= \Delta ({{\,\mathrm{\mathbf {p}}\,}}_a ) \Delta ({{\,\mathrm{\mathbf {p}}\,}}_b ), \\ \Delta \left( \sum _{a \in h[\emptyset ]} {{\,\mathrm{\mathbf {p}}\,}}_a \right)&= \left( \sum _{a \in h[\emptyset ]} {{\,\mathrm{\mathbf {p}}\,}}_a \right) \otimes \left( \sum _{a \in h[\emptyset ]} {{\,\mathrm{\mathbf {p}}\,}}_a \right) , \\ \epsilon ({{\,\mathrm{\mathbf {p}}\,}}_a {{\,\mathrm{\mathbf {p}}\,}}_b )&= \epsilon ( {{\,\mathrm{\mathbf {p}}\,}}_a ) \epsilon ({{\,\mathrm{\mathbf {p}}\,}}_b), \\ \epsilon \left( \sum _{a \in h[\emptyset ]} {{\,\mathrm{\mathbf {p}}\,}}_a \right)&= 1. \end{aligned}$$

The last three equations are direct computations. For the first equation, we use (9) as follows: take \(a, b, x, y\in \mathcal {G}(h)\), then

$$\begin{aligned} \Delta ({{\,\mathrm{\mathbf {p}}\,}}_a {{\,\mathrm{\mathbf {p}}\,}}_b )(x, y) = ({{\,\mathrm{\mathbf {p}}\,}}_a {{\,\mathrm{\mathbf {p}}\,}}_b )(x \cdot y) = {{\,\mathrm{\mathbf {p}}\,}}_a ( x \cdot y) {{\,\mathrm{\mathbf {p}}\,}}_b ( x \cdot y) = ( \Delta {{\,\mathrm{\mathbf {p}}\,}}_a \Delta {{\,\mathrm{\mathbf {p}}\,}}_b) (x, y). \end{aligned}$$

This concludes the first part of the proof.

Now suppose that h is connected, so that the zero degree component \(\mathcal {A}(h)_0\) is one dimensional. From [19], because \(\mathcal {A} ( h ) \) is commutative, it suffices to establish that the group-like elements of \(\mathcal {A} ( h ) \) are invertible. Now it is a direct observation that any group-like element is in \(\mathcal {A}(h)_0\), which is a one dimensional algebra, so all non-zero elements are invertible. This concludes that \(\mathcal {A}(h)\) is a Hopf algebra. \(\square \)

3.3 The Space of Primitive Elements

In this section, we give a description of the primitive elements of any pattern Hopf algebra. Denote by \(P_H \,{:}{=}\,\{a \in H | \, \Delta a = a\otimes 1 + 1 \otimes a \}\) the space of primitive elements, where 1 stands for the unit of the Hopf algebra.

Definition 3.6

(Irreducible objects). Let \((h, *, 1)\) be a connected associative presheaf. An object \(t\in h[I] \) with \(t\ne 1 \) is called irreducible if any two objects \(a \in h[A], b \in h[B]\) such that \(a *b = t \) and \(A\sqcup B = I\) have either \(a = 1\) or \(b = 1\).

The notion of irreducibility lifts to \(\mathcal {G}(h)\). That is, a coinvariant \(t \in \mathcal {G}(h)\) with \(t \ne 1\) is irreducible if any \(a, b\in \mathcal {G}(h)\) such that \(a \cdot b = t \) have either \(a = 1\) or \(b = 1\). We have that \(a\in h[I]\) is irreducible if and only if the corresponding equivalence class \(\bar{a} \in \mathcal {G}(h)\) is irreducible. The family of irreducible equivalent classes in \(\mathcal {G}(h)\) is denoted by \(\mathcal {I} (h) \subseteq \mathcal {G}(h)\).

Proposition 3.7

(Primitive space of pattern Hopf algebras). Let \((h, *, 1_h)\) be a connected associative presheaf, and \(\mathcal {I}(h)\) the set of irreducible elements in \(\mathcal {G}(h)\). Then the primitive space is given by:

$$\begin{aligned} P_{\mathcal {A}(h)} = {{\,\mathrm{\mathrm {span}}\,}}\{{{\,\mathrm{\mathbf {p}}\,}}_a | a \in \mathcal {I}(h)\}. \end{aligned}$$

Proof

If f is irreducible, it is straightforward to observe that \({{\,\mathrm{\mathbf {p}}\,}}_f\) is primitive. On the other hand, let \(a=\sum _{f\in \mathcal {G}(h)} c_{f } {{\,\mathrm{\mathbf {p}}\,}}_{f }\) be a generic primitive element from \(\mathcal {A}(h)\). Then, the equation \(\Delta a = a \otimes {{\,\mathrm{\mathbf {p}}\,}}_{1_h} + {{\,\mathrm{\mathbf {p}}\,}}_{1_h} \otimes \, a \) becomes

$$\begin{aligned} \sum _{g_1, g_2 \in \mathcal {G}(h) } c_{g_1 \cdot g_2 } {{\,\mathrm{\mathbf {p}}\,}}_{g_1}\otimes {{\,\mathrm{\mathbf {p}}\,}}_{g_2 } = \sum _{f} c_{f} ( {{\,\mathrm{\mathbf {p}}\,}}_{f} \otimes {{\,\mathrm{\mathbf {p}}\,}}_{1_h} + {{\,\mathrm{\mathbf {p}}\,}}_{1_h} \otimes {{\,\mathrm{\mathbf {p}}\,}}_{f } ). \end{aligned}$$

From Remark 3.2, \(\{{{\,\mathrm{\mathbf {p}}\,}}_{g_1} \otimes {{\,\mathrm{\mathbf {p}}\,}}_{g_2 }\}_{g_1, g_2\in \mathcal {G}(h) } \) is a basis of \(\mathcal {A}(h)^{\otimes 2}\), so we have that for any \(g_1\ne 1_h, g_2 \ne 1_h\),

$$\begin{aligned} c_{g_1\cdot g_2 } = 0. \end{aligned}$$

Thus we conclude that a is a linear combination of the set \(\left\{ {{\,\mathrm{\mathbf {p}}\,}}_{f} | f \in \mathcal {I}(h) \right\} \), as desired. \(\square \)

3.4 The Pattern Algebra Functor

In this section, we see that the mapping \(\mathcal {A}\) is in fact functorial, bringing the parallel between the pattern Hopf algebras and the Fock functors even closer.

Theorem 3.8

(Pattern algebra maps). If \(f: h\Rightarrow j \) is a morphism of combinatorial presheaves, then the following formula

$$\begin{aligned} \mathcal {A}[f]({{\,\mathrm{\mathbf {p}}\,}}_a) := \sum _{f(b) = a } {{\,\mathrm{\mathbf {p}}\,}}_b \in \mathcal {A}(h), \end{aligned}$$
(11)

defines an algebra map \(\mathcal {A}[f]: \mathcal {A}(j) \rightarrow \mathcal {A}(h)\).

Further, if f is a morphism of associative presheaves, then \(\mathcal {A}[f]\) is a bialgebra morphism. Consequently, if hj are connected, this is a Hopf algebra morphism.

The sum in (11) is finite, so this functor is well defined.

Proof

The map \(\mathcal {A}[f]\) is linear and sends the unit \(\sum _{a \in j[\emptyset ] } {{\,\mathrm{\mathbf {p}}\,}}_a \) of \(\mathcal {A}(j)\) to

$$\begin{aligned} \sum _{a \in j[\emptyset ] } \sum _{\begin{array}{c} b \in h[\emptyset ] \\ f(b) = a \end{array}} {{\,\mathrm{\mathbf {p}}\,}}_b = \sum _{b \in j[\emptyset ] } {{\,\mathrm{\mathbf {p}}\,}}_b. \end{aligned}$$

Hence, to establish that \(\mathcal {A}[f]\) is an algebra morphism, it suffices to show that it preserves the product on the basis, i.e. that \(\mathcal {A}[f]({{\,\mathrm{\mathbf {p}}\,}}_a {{\,\mathrm{\mathbf {p}}\,}}_b) = \mathcal {A}[f]({{\,\mathrm{\mathbf {p}}\,}}_a ) \mathcal {A}[f]({{\,\mathrm{\mathbf {p}}\,}}_b )\).

It is easy to see that this holds if we have that

$$\begin{aligned} \left( {\begin{array}{c}f(c')\\ a, b\end{array}}\right) = \sum _{\begin{array}{c} a', b'\in \mathcal {G}(h) \\ f(a') = a, f(b')=b \end{array}} \left( {\begin{array}{c}c'\\ a', b'\end{array}}\right) , \end{aligned}$$

for any \(a, b \in \mathcal {G}(j), c' \in \mathcal {G}(h)\).

Indeed, if \(a\in j[A], b\in j[B] \) and \(c'\in h[C]\), then for any set I, by naturality of f, we have \(f(c')|_I = f(c'|_I)\). Then

$$\begin{aligned} \left( {\begin{array}{c}f(c')\\ a, b\end{array}}\right)&= \left| \Big \{ (I, J) \text { s.t. } f(c')|_I \sim a, \, f(c')|_J\sim b, \, I\cup J = C\Big \} \right| \\&= \sum _{\begin{array}{c} a', b' \in \mathcal {G}(h) \\ f(a') = a, \, f(b') = b \end{array} } \left| \Big \{ (I, J) \text { s.t. } c'|_I \sim a', \, c'|_J\sim b', \, I\cup J = C \Big \} \right| \\&= \sum _{\begin{array}{c} a', b' \in \mathcal {G}(h) \\ f(a') = a, \, f(b') = b \end{array} }\left( {\begin{array}{c}c'\\ a', b'\end{array}}\right) . \end{aligned}$$

Now suppose further that f is an associative presheaf morphism between \((h, *_h, 1_h)\) and \((j, *_j, 1_j)\). That \(\mathcal {A}[f]\) preserves counit follows from \(f(1_h) = 1_j\). That \(\mathcal {A}[f]\) preserves \(\Delta \) follows because both \(\mathcal {A}[f]^{\otimes 2} (\Delta {{\,\mathrm{\mathbf {p}}\,}}_a) \) and \(\Delta (\mathcal {A}[f] {{\,\mathrm{\mathbf {p}}\,}}_a ) \) equal

$$\begin{aligned} \sum _{\begin{array}{c} b', c' \in \mathcal {G}(h)\\ f(b' \cdot _h c') = a \end{array}} {{\,\mathrm{\mathbf {p}}\,}}_{b'} \otimes {{\,\mathrm{\mathbf {p}}\,}}_{c'}, \end{aligned}$$

since \(f(b' *_h c') = f(b') *_j f( c')\), concluding the proof. \(\square \)

Definition 3.9

(The pattern algebra functor). Because of Theorem 3.8, we can define the pattern algebra contravariant functor \(\mathcal {A}:\mathtt {CPSh} \rightarrow \mathtt {Alg}_{k}\).

This functor when restricted to the subcategory of associative presheaves is also a functor to bialgebras as \(\mathcal {A}:Mon(\mathtt {CPSh}) \rightarrow \mathtt {BiAlg}_{k}\).

Example 3.10

(Graph patterns in permutations). Consider again the associative presheaves \((\mathtt {Gr}, \oplus , \emptyset )\) on graphs and \((\mathtt {Per}, \oplus , \emptyset )\) on permutations. The inversion graph of a permutation is a presheaf morphism \(\mathtt {Inv}:\mathtt {Per} \Rightarrow \mathtt {Gr}\) defined as follows: given a permutation \(\pi = ( \le _P, \le _V)\) on the set I, we take the graph \(\mathtt {Inv}(\pi )\) with vertex set I and an edge between \(i, j\in I\), \(i \ne j\) if

$$\begin{aligned} i\le _P j\Leftrightarrow j\le _V i. \end{aligned}$$

It is a direct observation that this map is indeed an associative presheaf morphism. As a consequence, we have a Hopf algebra morphism \(\mathcal {A}(\mathtt {Inv}):\mathcal {A}(\mathtt {Gr}) \rightarrow \mathcal {A}(\mathtt {Per})\).

3.5 Magnus Relations and Representability

The goal of the following two sections is to show that arithmetic properties of the permutation pattern algebra that are established in [20] are actually general properties of pattern algebras.

Proposition 3.11

(Magnus inversions). Let h be a combinatorial presheaf, and consider the maps \(M, N: {{\,\mathrm{\mathrm {span}}\,}}\mathcal {G}(h) \rightarrow {{\,\mathrm{\mathrm {span}}\,}}\mathcal {G}(h) \) given on the basis elements \(a\in \mathcal {G}(h)\) by

$$\begin{aligned}&M: a \mapsto \sum _{b\in \mathcal G (h) } {{\,\mathrm{\mathbf {p}}\,}}_{b }(a) b,\\&N: a \mapsto \sum _{b\in \mathcal G (h) } (-1)^{|a|+|b|} {{\,\mathrm{\mathbf {p}}\,}}_{b }(a) b, \end{aligned}$$

and extended linearly to \({{\,\mathrm{\mathrm {span}}\,}}\mathcal {G}(h)\). Then the maps MN are inverses of each other.

This result was already known in the context of words in [10] and [3] and in the context of permutations in [20].

Proof

We start by proving a relation on pattern functions. Let \(a\in h[I], c\in \mathcal G (h)\). Then we claim that

$$\begin{aligned} \sum _{b \in \mathcal {G}(h)} (-1)^{|b|} {{\,\mathrm{\mathbf {p}}\,}}_b(a){{\,\mathrm{\mathbf {p}}\,}}_c(b) = (-1)^{|a|} \mathbb {1}[a \in c ]. \end{aligned}$$

Indeed, for each pair of sets (JB) such that \(J \subseteq B \subseteq I \) and \(a|_J \in c\) it corresponds an object \(b = a|_B\), and the patterns B of b in a, and J of c in b. Observe that this is a bijective correspondence, so we have

$$\begin{aligned}&\sum _{b \in \mathcal {G}(h)} (-1)^{|b|} {{\,\mathrm{\mathbf {p}}\,}}_b(a){{\,\mathrm{\mathbf {p}}\,}}_c(b) \\&\quad = \sum _{\begin{array}{c} J \subseteq I\\ a|_J \in c \end{array}} \sum _{J\subseteq B \subseteq I } (-1)^{|B|} = (-1)^{|I|} \mathbb {1}[ a|_I \in c ] = (-1)^{|a|} \mathbb {1}[a \in c ]. \end{aligned}$$

It follows that

$$\begin{aligned} N(M(a))&= N \left( \sum _{b \in \mathcal {G}(h)} {{\,\mathrm{\mathbf {p}}\,}}_b(a ) b\right) = \sum _{b \in \mathcal {G}(h)} {{\,\mathrm{\mathbf {p}}\,}}_b(a) \sum _{c \in \mathcal {G}(h)} (-1)^{|b|+|c|} {{\,\mathrm{\mathbf {p}}\,}}_c(b) \\&= \sum _{c \in \mathcal {G}(h)} c (-1)^{|c|} \sum _{b \in \mathcal {G}(h)} (-1)^{|b|} {{\,\mathrm{\mathbf {p}}\,}}_b(a) {{\,\mathrm{\mathbf {p}}\,}}_c(b) \\&= \sum _{c \in \mathcal {G}(h)} c (-1)^{|c|} (-1)^{|a|} \mathbb {1}[a= c ] = a, \end{aligned}$$

and that

$$\begin{aligned} M(N(a))&= M \left( \sum _{b \in \mathcal {G}(h)} (-1)^{|a|+|b|} {{\,\mathrm{\mathbf {p}}\,}}_b(a ) b\right) = \sum _{b \in \mathcal {G}(h)} {{\,\mathrm{\mathbf {p}}\,}}_b(a) \sum _{c \in \mathcal {G}(h)} (-1)^{|a|+ |b|} {{\,\mathrm{\mathbf {p}}\,}}_c(b) \\&= \sum _{c \in \mathcal {G}(h)} c (-1)^{|a|} \sum _{b \in \mathcal {G}(h)} (-1)^{|b|} {{\,\mathrm{\mathbf {p}}\,}}_b(a) {{\,\mathrm{\mathbf {p}}\,}}_c(b) \\&= \sum _{c \in \mathcal {G}(h)} c (-1)^{|a|} (-1)^{|a|} \mathbb {1}[a= c ] = a, \end{aligned}$$

as desired. \(\square \)

3.6 The Sweedler Dual and Pattern Algebras

Let A be an algebra over a field \(\mathbb {K}\). Then the Sweedler dual \(A^{\circ }\) is defined in [18] as

$$\begin{aligned} A^{\circ } \,\,{:}{=}\,\,\{ g \in A^* | \ker g \text { contains a cofinite ideal} \}, \end{aligned}$$

where a cofinite ideal J of A is an ideal such that A/J is a finite dimensional vector space over \(\mathbb {K}\). There, it is established that \(A^{\circ }\) is a coalgebra, where the coproduct map is the transpose of the product map.

Consider the following right action of A on \(A^*\): for \(f\in A^*\) and \(a, b\in A\),

$$\begin{aligned} (f \cdot b) (a) \,\,{:}{=}\,\, f(a b). \end{aligned}$$
(12)

A description of \(A^{\circ }\) is given in [18, Proposition 6.0.3], as all representable elements \(f\in A^*\), that is all f such that the vector space \(\{f \cdot b\}_{b\in A}\) is finite dimensional.

Let \((h, *, 1)\) now be an associative presheaf, and consider the algebra generated by \(\cdot \) in \(\mathcal {G}(h)\):

$$\begin{aligned} {{\,\mathrm{\mathrm {Alg}}\,}}( h) \,\,{:}{=}\,\,{{\,\mathrm{\mathrm {span}}\,}}(\mathcal {G}(h), \cdot ). \end{aligned}$$

Then \(\mathcal {A}(h) \subseteq {{\,\mathrm{\mathrm {Alg}}\,}}(h)^* = \mathcal {F} (\mathcal {G}(h), k)\). In fact, the following proposition guarantees that we have \(\mathcal {A}(h) \subseteq {{\,\mathrm{\mathrm {Alg}}\,}}(h)^{\circ }\). Observe that the coproduct in \(\mathcal {A}(h)\) is precisely the transpose of the multiplication in \({{\,\mathrm{\mathrm {span}}\,}}(\mathcal {G}(h), \cdot )\), therefore \(\mathcal {A}(h) \subseteq {{\,\mathrm{\mathrm {Alg}}\,}}(h)^{\circ }\) is an inclusion of coalgebras.

Proposition 3.12

(Pattern algebra and the Sweedler dual). Let h be an associative presheaf. Then, its pattern algebra satisfies \(\mathcal {A}(h) \subseteq {{\,\mathrm{\mathrm {Alg}}\,}}(h)^{\circ }\).

Proof

We claim that each pattern function is representable, which concludes the proof according to [18, Proposition 6.0.3]. In fact, for \(a, b, c\in \mathcal G (h)\):

$$\begin{aligned} {{\,\mathrm{\mathbf {p}}\,}}_a \cdot \, b \, (c)&= {{\,\mathrm{\mathbf {p}}\,}}_a ( b \cdot c) = \Delta {{\,\mathrm{\mathbf {p}}\,}}_a (b, c)\\&= \sum _{\begin{array}{c} a_1, a_2 \in \mathcal G (h) \\ a=a_1 \cdot a_2 \end{array}}{{\,\mathrm{\mathbf {p}}\,}}_{a_1}(b) {{\,\mathrm{\mathbf {p}}\,}}_{a_2}(c) \end{aligned}$$

That is, \({{\,\mathrm{\mathbf {p}}\,}}_a \cdot \, b = \sum _{ a=a_1 \cdot a_2 }{{\,\mathrm{\mathbf {p}}\,}}_{a_1}(b) {{\,\mathrm{\mathbf {p}}\,}}_{a_2} \). It follows that

$$\begin{aligned} {{\,\mathrm{\mathrm {span}}\,}}\{{{\,\mathrm{\mathbf {p}}\,}}_a \cdot \, b\}_{b\in \mathcal {G}(h)} \subseteq {{\,\mathrm{\mathrm {span}}\,}}\{{{\,\mathrm{\mathbf {p}}\,}}_{a_2} \}_{\begin{array}{c} a_2\in \mathcal {G}(h) \\ |a_2| \le |a| \end{array}}, \end{aligned}$$

which is finite dimensional. \(\square \)

4 Freeness of Commutative Presheaves

We start this section with a discussion of factorization theorems for combinatorial presheaves. We will observe that the factorization of an object in a connected associative presheaf into irreducibles is unique up to some possible commutativity. This is a general fact for associative presheaves, and is a central point in establishing freeness of any pattern Hopf algebra so far in the literature.

We also dedicate some attention to commutative presheaves. An almost immediate consequence of the general fact discussed above is that the pattern algebra of a commutative presheaf is free.

We also explore specific combinatorial presheaves that can be endowed with a commutative structure. The main examples are graphs, already studied in [21], marked graphs (see Sect. 4.3), set partitions (see Sect. 4.4), simplicial complexes and posets.

4.1 Relations in General Connected Associative Presheaves

Consider a connected associative presheaf \((h, *, 1)\). In this section we will not assume that h is commutative. Recall that for objects \(a\in h[I], b\in h[J]\), if \(A \subseteq I\sqcup J\) then \((a*b)|_A = a|_{A\cap I} *a|_{A\cap J}\), as described in Observation 2.4. We recall as well that an object \(t\in h[I]\) is called irreducible if \(t\ne 1\) and if \(t = a *b\) only has trivial solutions.

Definition 4.1

(Set composition and set partition). Let I be a finite set. A set composition of I is a list \((B_1, \dots B_k)\), that can also be written as \(B_1 | \dots | B_k\), of pairwise disjoint nonempty subsets of I, such that \(I = \bigcup _i B_i\). We denote by \(\Pi _I\) the family of set compositions of I. A set partition of I is a family \(\varvec{\pi } = \{I_1, \dots , I_k\}\) of pairwise disjoint nonempty sets, such that \(\bigcup _i I_i = I\). We write \(\Sigma _I \) for the family of set partitions of I.

If \(\mathbf {\varvec{\pi }}\in \Pi _I\) is a set composition, we can define its underlying set partition of I by disregarding the order of the list. We denote it by \(\varvec{\lambda } (\mathbf {\varvec{\pi }})\).

Definition 4.2

(Factorization of objects and coinvariants). Consider an associative presheaf h that is connected, and an object \(o\in h[I]\). A factorization of o is a word \((x_1, \dots , x_k)\) of objects such that \(x_1 *\dots *x_k = o\).

A factorization \((x_1, \dots , x_k)\) of o is a factorization into irreducibles when each \(x_i\) is an irreducible object for \(i=1, \dots , l\).

A factorization of a coinvariant \(a\in \mathcal {G}(h)\) is a decomposition of the form \(a = s_1 \cdots s_k\). This factorization is into irreducibles if each \(s_i\) is irreducible.

It is clear that an object is irreducible if and only if its coinvariant is irreducible.

To a factorization \((x_1, \dots , x_k)\) of \(o\in h[I]\), there is a corresponding set composition \(\mathbf {\varvec{\pi }}= (I_1, \dots , I_k) \models I\), where \(x_i \in h[I_i]\). This is indeed a set composition of I by the definition of \(*\). This correspondence between factorizations and set compositions is injective. Indeed, because the presheaf is connected, \(o|_{A_i} = x_i \).

Conversely, not all set compositions yield a factorization. The irreducible elements are precisely the ones where only the trivial set composition with one block yields a factorization.

Theorem 4.3

Let h be an associative presheaf and \(o \in h[I]\) an object. If \(\mathbf {\varvec{\pi }}_1, \mathbf {\varvec{\pi }}_2\) are factorizations into irreducibles of o, then their underlying set partitions \(\varvec{\lambda }(\mathbf {\varvec{\pi }}_1)\) and \(\varvec{\lambda }(\mathbf {\varvec{\pi }}_2)\) are the same.

In particular, the number of irreducible factors j(o) and the multiset of irreducible factors \(\mathfrak {fac}(o)\) of an object are well defined and do not depend on the factorization into irreducibles at hand.

Proof

Suppose that o has two distinct factorizations

$$\begin{aligned} o = l_1 *\ldots *l_{k} = r_1 *\ldots *r_s, \end{aligned}$$
(13)

where \(\mathbf {\varvec{\pi }}_1 = A_1 | \dots | A_{k} \) and \(\mathbf {\varvec{\pi }}_2 = B_1 | \dots | B_s \) are set compositions of X such that \(l_i = o|_{A_i}\) and \(r_i = o|_{B_i}\). Note that

$$\begin{aligned} l_j = o|_{A_j} = r_1|_{B_1\cap A_j} *\ldots *r_s|_{B_s\cap A_j}. \end{aligned}$$

Because \(l_j\) is irreducible, for each j there is exactly one i such that \(B_i\cap A_j \ne \emptyset \), so \(A_j \subseteq B_i\), and \(\varvec{ \tau }(\mathbf {\varvec{\pi }}_1) \) is coarser than \(\varvec{ \tau }(\mathbf {\varvec{\pi }}_2) \). By a symmetrical argument, we obtain that \(\varvec{ \tau }(\mathbf {\varvec{\pi }}_1) \) is finer than \(\varvec{ \tau }(\mathbf {\varvec{\pi }}_2) \), so we conclude that \(\varvec{ \tau }(\mathbf {\varvec{\pi }}_1) = \varvec{ \tau }(\mathbf {\varvec{\pi }}_2) \). It follows that the number of factors and the multiset of factors are well defined. \(\square \)

This implies the following for factorizations on \(\mathcal {G}(h)\):

Corollary 4.4

Consider an associative presheaf \((h, *, 1)\), together with the usual product in \(\mathcal {G}(h)\), denoted by \(\cdot \). Consider also \(a \in \mathcal {G}(h)\). If \(a=x_1\cdots x_l = s_1 \cdots s_s \) are two factorizations into irreducibles, then the multisets \(\{x_1, \dots , x_l\}\) and \(\{s_1, \dots , s_t\}\) coincide.

In particular, the number of irreducible factors j(a) and the multiset of irreducible factors \(\mathfrak {fac}(a)\) of a coinvariant are well defined and do not depend on the factorization into irreducibles at hand.

Given an alphabet \(\Omega \), denote the set of words on \(\Omega \) by \(\mathcal {W}(\Omega )\).

Problem 4.5

(Factorization theorems in associative presheaves). Given an associative presheaf \((h, *, 1)\), describe \(\mathcal {E}(h)\), the collection of fibers of the map

$$\begin{aligned} \Pi : \mathcal {W}(\mathcal {I}(h)) \rightarrow \mathcal {G}(h), \end{aligned}$$

defined by taking the product of the letters of a word in \(\mathcal G (h)\).

The fibers of this map, that is, the sets of words \(\Pi ^{-1}(a)\), correspond to the different factorizations of an object \(a \in \mathcal {G}(h)\). In general, according to Corollary 4.4, a fiber consists of a set of words of irreducible elements that result from one another by permuting its letters. Whenever h is a commutative presheaf, Corollary 4.7 tells us that the fibers are as big as possible, restricted to Corollary 4.4. This means that, in this case, each fiber is a set of words resulting from a permutation of a word in \(\mathcal {W}(\mathcal {I} (h) )\).

Take the example of the combinatorial presheaf \(\mathtt {Per}\), where no non-trivial rearrangement of the irreducible factors of a factorization of an object yields a distinct factorization of the same object. In this example, the fibers \(\Pi ^{-1}(a)\) are singletons. In the case of marked permutations, in Theorem 5.8 we show that only transpositions of specific irreducible marked permutations remain factorizations of the same coinvariant a.

Remark 4.6

It can be seen that the freeness proof in Theorem 4.8 depends solely on the corresponding unique factorization theorem, that is, on \(\mathcal {E} (h)\). That is also the case in the proof given in [20] for the presheaf on permutations, and the proof below for marked permutations.

This motivates Conjecture 2.15, as it seems that the freeness of the pattern Hopf algebra only depends on the description of the fibers \(\mathcal {E} (h)\). In this way, for instance, we can immediately see that the pattern Hopf algebra \(\mathcal A (\mathtt {SComp})\), defined below, is free. This follows because it has a unique factorization theorem of the type of the one in the associative presheaf on permutations.

4.2 Proof of Freeness on Commutative Presheaves

Recall that a commutative presheaf is an associative presheaf \((h, *, 1)\) such that \(*_{A, B} = *_{B, A} \circ \text { twist}_{A, B} \); see Definition 2.3. In the case of commutative presheaves, we have that any rearrangement of a factorization of an object o yields another factorization of o. For this reason, in the context of commutative presheaves, a set partition is also referred to as a factorization, and we have the following.

Corollary 4.7

Let \((h, *, 1)\) be a connected commutative presheaf, and \(a \in \mathcal {G}(h) \) an object. Then, a has a unique factorization into irreducibles \(l_1, \dots , l_{j(a)} \in \mathcal {I}(h) \) up to commutativity of factors. Equivalently, if \(a \in h[X]\), there is a unique set partition that corresponds to a factorization of o into irreducibles.

Theorem 4.8

(Freeness of pattern algebras with commutative products). Let \((h, *, 1)\) be a connected commutative presheaf. Consider \(\mathcal {I} (h)\subseteq \mathcal {G}(h) \) the family of irreducible elements of h.

Then \(\mathcal {A}(h)\) is free commutative, and \( \{{{\,\mathrm{\mathbf {p}}\,}}_{\iota } | \, \iota \in \mathcal {I} (h) \} \) is a set of free generators of \(\mathcal {A}(h)\).

Proof

We will show that the family

$$\begin{aligned} \Bigg \{ \prod _{\iota \in \mathcal {L}} {{\,\mathrm{\mathbf {p}}\,}}_\iota \Big | \mathcal {L} \text { multiset of elements in } \mathcal {I}(h) \Bigg \}, \end{aligned}$$
(14)

is a basis for \(\mathcal {A}(h)\). The proof follows the strategy described in Sect. 2.3, by building an order \(\le \) in \(\mathcal {G}(h) \) that is motivated in the unique factorization theorem in Theorem 4.3.

Define the following partial strict order \(<_p \) in \(\mathcal {G}(h) \): we say that \(\alpha <_p \beta \) if:

  • \(| \alpha | < | \beta |\), or

  • \(| \alpha | = | \beta |\) and \(j(\alpha ) < j(\beta )\).

In this way, \(\le _p\) is the order that we use to establish freeness.

Consider \(\alpha \in \mathcal {G}(h)\) with \(\alpha = \iota _1 \cdots \iota _{j(\alpha )} \) its unique factorization into irreducibles. Then we claim

$$\begin{aligned} \prod _{i=1}^k {{\,\mathrm{\mathbf {p}}\,}}_{\iota _i} =\sum _{\beta \in \mathcal {G}(h)} \left( {\begin{array}{c}\beta \\ \iota _1, \dots , \iota _{j(\alpha )}\end{array}}\right) {{\,\mathrm{\mathbf {p}}\,}}_{\beta } = \sum _{\beta \le _p \alpha } c_{\beta } {{\,\mathrm{\mathbf {p}}\,}}_{\beta }, \end{aligned}$$
(15)

where \(c_a \ge 1\). This implies that (14) is a basis of \(\mathcal {A}(h)\), and gives us the result.

Let us prove (15). Pick representatives \(l_i \) for \(\iota _i\) such that \(l_i \in h[A_i]\) and let also \(a = l_1*\dots *l_{j(\alpha )}\) be an object. Observe that the coinvariant of a is \(\alpha \).

First, observe that a is a quasi-shuffle of \(l_1, \dots , l_{j(\alpha )} \) by considering the patterns \(A_1, \dots , A_{j(\alpha )}\); see Remark 2.5. Thus we have \(c_{\alpha } \ge 1\).

To show that any term \(\beta \) in (15) with \(c_{\beta } \ne 0\) has \( \beta \le _p \alpha \), consider the maximal \( \beta \in \mathcal G (h) \) that is a quasi-shuffle of \(l_1, \dots , l_{j(\alpha )} \), and let b be a representative in \(\beta \), such that \(b\in h[Y]\). By maximality, we have that \( \beta \ge \alpha \). Our goal is to show that \(b \sim a\). Let \(b= s_1 *\dots *s_{j(b)}\) be the unique factorization of b into irreducibles, corresponding to the set partition \(\{ C_1, \dots , C_{j(b)} \}\). Because b is a quasi-shuffle of \(l_1, \dots , l_{j(\alpha )} \), we can consider \(B_1, \dots , B_{j(\alpha )} \subseteq Y \) sets such that \(\bigcup _i B_i = Y\) and

$$\begin{aligned} b|_{B_i} \sim l_i \, \, \, \text { for } i=1, \dots , j(\alpha ). \end{aligned}$$

In particular, we have that

$$\begin{aligned} l_i \sim b|_{B_i} = s_1|_{C_1\cap B_i}*\dots *s_{j(b)}|_{C_{j(b)}\cap B_i}, \end{aligned}$$

for \(i=1, \dots , j(\alpha )\).

By indecomposability of \(l_i\), we have that, for each i, there is exactly one j such that \(C_{j}\cap B_i\ne \emptyset \). From \(\sqcup _j C_j = \bigcup _i B_i = Y\), we get that each \(B_i\) is contained in some \(C_j\). So we can define a map \(f:[j(\alpha )] \rightarrow [j(b)] \) such that \( B_i \subseteq C_{f(i)}\). Thus, we have that \(C_i = \bigcup _{k \in f^{-1}(i)} B_k \).

First observe that \(|a|= \sum _i | A_i |= \sum _i |l_i | = \sum _i | B_i| \) and \(|b| = \sum _j | C_j | \) but \(|b | = |Y| \le \sum _j \sum _{i\in f^{-1}(j)} | B_i | = |a|\). However, from \(b \ge _p a\) we have that \(|b| \ge |a|\) and thus we have \(|b| = |a|\) and that the family \(\{ B_1, \dots , B_{j(\alpha )} \}\) is disjoint. Further, f is a surjection, so we immediately have that \(j(\alpha ) \ge j(b)\) and because \(b \ge _p a\), we must have an equality. Thus, f is a bijective map and we conclude that \(C_{f(i)} = B_i \) for each \(i=1, \dots , j(\alpha ) = j(b)\).

We then conclude that

$$\begin{aligned} s_i = b|_{B_i} = b|_{C_{f(i)}} \sim l_{f(i)}, \end{aligned}$$

and so, by commutativity,

$$\begin{aligned} b = s_1 *\dots *s_{j(b)} = l_1 *\dots *l_{j(\alpha )} = a, \end{aligned}$$

as desired. \(\square \)

4.3 Marked Graphs

Definition 4.9

(Marked graphs and two products). For a finite set I, a marked graph \(G^*\) on I is a graph on the vertex set \(I \sqcup \{*\}\). This defines a combinatorial presheaf \(\mathtt {MGr}\) via the usual notion of relabeling and induced subgraphs.

We can further endow the combinatorial presheaf \(\mathtt {MGr}\) with two different associative presheaf structures.

First, the joint union, \(\vee \), which is defined as follows: If \(G_1^*\in \mathtt {MGr}[I], G_2^* \in \mathtt {MGr}[J]\) with \(I\cap J = \emptyset \), then \(G_1^*\vee _{I, J} G_2^*\) has no edges between I and J, and the marked vertices are merged.

The second product, the inflation product \( \star \) is defined as follows: If \(G_1^*\in \mathtt {MGr}[I], G_2^* \in \mathtt {MGr}[J]\) with \(I\cap J = \emptyset \), then \(G_1^*\star _{I, J} G_2^*\) results from \(G_1^*\vee _{I, J} G_2^*\) by adding the following edges: two vertices \(i\in I, j\in J\) are connected in \(G_1^*\star _{I, J} G_2^*\) if i and \(*\) are connected in \(G_1^*\). The unit of both products is the marked graph 1 with a unique vertex and no edges.

Remark 4.10

The graphs that are irreducible with respect to the \(\vee \) product are the graphs \(G^* \) such that the graph resulting from removing the marked vertex and its incident edges is a connected graph. In this case, we say that \(G^* \) is \(\vee \)-connected.

In Fig. 1 we have an example of a \(\vee \) -connected marked graph and a \(\vee \)-disconnected marked graph.

Fig. 1
figure 1

A marked graph \(G_1\) with three \(\vee \)-connected components and a \(\vee \)-connected graph \(G_2\)

Observe that \(G_1^*\vee _{I, J} G_2^* = G_2^*\vee _{J, I} G_1^*\), so \(\vee \) is a commutative operation, whereas \(\star \) is not. It follows from Theorem 4.8 that both \(\mathcal {A}(\mathtt {MGr}, \vee , 1 ) \) and \(\mathcal {A}(\mathtt {MGr}, \star , 1 ) \) are free algebras (their product structure is the same). This is something that cannot be shown directly in \(\mathcal {A}(\mathtt {MGr}, \star , 1 ) \). Indeed, a unique factorization theorem on this associative presheaf has not yet been found, and only small irreducible marked graphs can be constructed; see Fig. 2. It is worthwhile to observe that the fibers under the map \(\Pi \) described in Problem 4.5 are non-trivial, as an example of a non-trivial relation can be seen in Fig. 3

Fig. 2
figure 2

The \(\star \)-irreducible marked graphs of size up to three

Fig. 3
figure 3

The first relations between irreducible marked graphs over \(\star \)

4.4 Set Partitions

We define here associative presheaves on set partitions \(\mathtt {SPart}\) and set compositions \(\mathtt {SComp}\), and show that Sym, the Hopf algebra of symmetric functions, is the pattern Hopf algebra on set partitions. The functoriality of \(\mathcal A \) also gives us a Hopf algebra morphism \(Sym \rightarrow \mathcal A (\mathtt {SComp})\).

Definition 4.11

(The presheaf on set partitions). If \(\varvec{\pi }\) is a set partition of I and \(J \subseteq I\), then \(\varvec{\pi }|_J = \{I_1 \cap J, \dots , I_k \cap J\} \) is a set partition of J, after disregarding the empty sets. This defines a presheaf structure \(\mathtt {SPart}\) with \(\mathtt {SPart}[I] = \Sigma _I\), the family of set partitions of I.

We further endow \(\mathtt {SPart}\) with an associative structure \(\uplus \) as follows: if \(\varvec{\pi } = \{I_1, \dots , I_q\}\), \(\varvec{\tau } = \{J_1, \dots , J_p\}\) are set partitions of the disjoint sets IJ, respectively, let \(\varvec{\pi } \uplus \varvec{ \tau } = \{I_1, \dots , I_q, J_1, \dots , J_p\}\) be a set partition of \(I\sqcup J\). It is straightforward to observe that \((\mathtt {SPart}, \uplus , \emptyset )\) is a commutative connected presheaf.

Note that by Theorem 4.8, the pattern Hopf algebra \(\mathcal {A}(\mathtt {SPart})\) is free and the generators correspond to the irreducible elements of \(\mathcal {G} (\mathtt {SPart} )\). These correspond to the set partitions with only one block, and up to relabeling there is a unique such set partition of each size. We write \(\mathcal {I}(\mathtt {SPart}) = \{ \{[n]\} | n\ge 1\}\).

Proposition 4.12

Let \(\zeta : \mathcal {A} (\mathtt {SPart} ) \rightarrow Sym\) be the unique algebra morphism mapping \(\zeta : {{\,\mathrm{\mathbf {p}}\,}}_{ \{[n]\}} \mapsto p_n\), where \(p_n\) is the power sum symmetric function. This defines a Hopf algebra isomorphism.

Proof

As \(\zeta \) sends a free basis to a free basis, it is an isomorphism of algebras. Furthermore, we observe that both \({{\,\mathrm{\mathbf {p}}\,}}_{ \{[n]\}} \) and \(p_n\) are primitive elements in their respective Hopf algebras, so the described map is a bialgebra morphism. Because the antipode is unique, it must send the antipode of \(\mathcal {A} (\mathtt {SPart} )\) to the one of Sym. Thus, this is a Hopf algebra isomorphism. \(\square \)

Definition 4.13

(The presheaf on set compositions). Let I be a finite set, and recall the definition of a set composition in Definition 4.1. If \(J \subseteq I\) and \(\mathbf {\varvec{\pi }}= ( I_1, \dots , I_k ) \) is a set composition of I, then \(\mathbf {\varvec{\pi }}|_J = ( I_1 \cap J, \dots , I_k \cap J ) \) is a set composition of J, after disregarding the empty sets. This defines a presheaf structure \(\mathtt {SComp}\) with \(\mathtt {SComp}[I] = \Pi _I\), the family of set compositions of I.

We further endow \(\mathtt {SComp}\) with an associative structure \(\uplus \) as follows: if \(\mathbf {\varvec{\pi }}= (I_1, \dots , I_q)\), \(\mathbf {\varvec{\tau }}= (J_1, \dots , J_p)\) are set partitions of the disjoint sets IJ, respectively, let \(\mathbf {\varvec{\pi }}\uplus \mathbf {\varvec{\tau }}= (I_1, \dots , I_q, J_1, \dots , J_p)\) be a set composition of \(I\sqcup J\).

It is straightforward to observe that \((\mathtt {SComp}, \uplus , \emptyset )\) is an associative connected presheaf. Further, we can also observe that the map \(\varvec{\lambda } :\mathtt {SComp} \Rightarrow \mathtt {SPart}\) is an associative presheaf morphism.

From the map \(\varvec{\lambda } :\mathtt {SComp} \Rightarrow \mathtt {SPart} \) we get a Hopf algebra morphism

$$\begin{aligned} \mathcal {A} (\varvec{\lambda } ) : Sym \rightarrow \mathcal {A}(\mathtt {SComp}). \end{aligned}$$

Observe that \( \mathcal {A}(\mathtt {SComp} )\) is a free algebra, because it has a unique factorization theorem of the same type of permutations under the \(\oplus \) product, so according to Remark 4.6 the proof in [20] holds also in this associative presheaf. This is also the case for the well known Hopf algebra QSym, where it was established that it is free in [9], and when we regard both Hopf algebras as filtered Hopf algebras, the enumeration of generators for each degree coincide with the number of Lyndon words of a given size.

Conjecture 4.14

(The algebraic structure of \( \mathcal {A}(\mathtt {SComp})\)). The Hopf algebra \( \mathcal {A}(\mathtt {SComp} )\) isomorphic to QSym.

5 Hopf Algebra Structure on Marked Permutations

In this section, we consider the algebra structure of \(\mathcal {A}(\mathtt {MPer} )\), and show that this pattern algebra on marked permutations is freely generated. This will be done using a factorization theorem on marked permutations on the inflation product.

Our strategy is as follows: we describe a unique factorization of marked permutations with the inflation product, in Corollary 5.12. This unique factorization theorem describes all possible factorizations of a marked permutation into irreducibles.

We further consider the Lyndon words on the alphabet of irreducible marked permutations, as introduced in [5]. This leads us to a notion of stable Lyndon marked permutations \(\mathcal {L}_{SL}\), in Definition 5.19. Finally, we prove the following result, which is the main theorem of this section, as a corollary of Theorem 5.24:

Theorem 5.1

The algebra \(\mathcal {A}(\mathtt {MPerm})\) is freely generated by \(\{{{\,\mathrm{\mathbf {p}}\,}}_{\iota ^*} | \iota ^*\in \mathcal {L}_{SL} \}\).

In the end of this section, we compute the dimension of the space of primitive elements of the pattern Hopf algebra on marked permutations. This, according to Proposition 3.7, can be done by enumerating the irreducible elements in \(\mathcal {G}(\mathtt {MPer})\).

This section is organized as follows: we start in Sect. 5.1 and in Sect. 5.2 by establishing a unique factorization theorem in marked permutations. In Sect. 5.3 we state and prove the main theorem of this section. The proofs of technical lemmas used in these sections are left to Sects. 5.5 and 5.4. Finally, in Sect. 5.6, we enumerate the irreducible marked permutations.

5.1 Unique Factorizations

We work on the combinatorial presheaf of permutations \((\mathtt {Per}, \oplus , \emptyset )\) and on the combinatorial presheaf of marked permutations \((\mathtt {MPer}, \star , \bar{1})\), introduced in Example 2.2 and Definition 2.11.

Definition 5.2

(Decomposability on the operations \(\oplus \) and \(\ominus \)). We say that a permutation is \(\oplus \)-indecomposable if it has no non-trivial decomposition of the form \(\tau _1\oplus \tau _2 \), and \(\oplus \)-decomposable otherwise. We say that a marked permutation is \(\oplus \)-indecomposable if it has no decomposition of the form \(\tau \oplus \pi ^* \) or \(\pi ^*\oplus \tau \), where \(\pi ^*\) is a marked permutation and \(\tau \) is a non-trivial permutation, and \(\oplus \)-decomposable otherwise. Similar definitions hold for \(\ominus \). A permutation (resp. a marked permutation) is indecomposable if it is both \(\oplus \) and \(\ominus \)-indecomposable, and is decomposable otherwise.

We remark that a permutation is \(\oplus \)-indecomposable whenever it is irreducible on the associative presheaf \((\mathtt {Per}, \oplus , \emptyset )\) according to Definition 3.6. For marked permutations, Definition 3.6 specializes to the definition of irreducible marked permutations as follows:

Definition 5.3

(Irreducible marked permutations). A marked permutation \(\pi ^* \) is called irreducible if any factorization \(\pi ^* = \tau ^*_1 \star \tau _2^* \) has either \(\tau ^*_1 = \bar{1}\) or \(\tau ^*_2 = \bar{1}\).

Example 5.4

Examples of irreducible marked permutations include \(\bar{1}423, 23\bar{1}\) and \(31\bar{4}2\); see Fig. 4. These marked permutations are respectively an \(\oplus \)-decomposable, \(\ominus \)-decomposable and an indecomposable irreducible marked permutation.

Fig. 4
figure 4

Irreducible marked permutations

Remark 5.5

(Decomposable irreducible marked permutations). If \(\pi \) is an \(\oplus \)-indecomposable permutation, then \(\bar{1}\oplus \pi \) and \(\pi \oplus \bar{1} \) are irreducible marked permutations. Similarly, if \(\tau \) is an \(\ominus \)-indecomposable permutation, then \(\bar{1}\ominus \tau \) and \(\tau \ominus \bar{1} \) are irreducible marked permutations.

These are precisely the decomposable (resp. \(\oplus \)-decomposable, \(\ominus \)-decomposable) irreducible marked permutations.

These decomposable irreducible marked permutations play an important role in the description of a free basis of \(\mathcal {A}(\mathtt {MPer})\), because they are the only ones that get in the way of a unique factorization theorem for the inflation product. In the following, we carefully unravel all these issues.

Remark 5.6

(\(\oplus \)-relations and \(\ominus \)-relations). Consider \(\tau _1, \tau _2 \) \(\oplus \)-indecomposable permutations. Then we have the following relations, called \(\oplus \)-relations

$$\begin{aligned} ( \bar{1}\oplus \tau _1 ) \star ( \tau _2 \oplus \bar{1} ) = ( \tau _2 \oplus \bar{1} ) \star ( \bar{1}\oplus \tau _1 ) = \tau _2 \oplus \bar{1} \oplus \tau _1. \end{aligned}$$

Consider now \(\pi _1, \pi _2 \) permutations that are \(\ominus \)-indecomposable. Then we have the following relation, called \(\ominus \)-relations

$$\begin{aligned} ( \bar{1}\ominus \pi _1 ) \star ( \pi _2 \ominus \bar{1} ) = ( \pi _2 \ominus \bar{1} ) \star ( \bar{1}\ominus \pi _1 ) = \pi _2 \ominus \bar{1}\ominus \pi _1. \end{aligned}$$

We wish to establish in Theorem 5.8 that these generate all the inflation relations between irreducible marked permutations.

We define the alphabet \(\Omega : = \{\text {irreducible marked permutations} \}\), and consider the set \(\mathcal {W}(\Omega ) \) of words on \(\Omega \). This set forms a monoid under the usual concatenation of words (we denote the concatenation of two words \(w_1, w_2\) as \(w_1 \cdot w_2\)). When \(w\in \mathcal {W}(\Omega ) \), we write \(w^*\) for the consecutive inflation of its letters. So for instance \((\bar{1}2, \bar{2}1)^* = \bar{1}2 \star \bar{2}1 = \bar{2}13\). We use the convention that the inflation of the empty word on \(\Omega \) is \(\bar{1}\). This defines the star map, a morphism of monoids \( \star : \mathcal {W}(\Omega ) \rightarrow \mathcal {G}(\mathtt {MPer})\).

For the sake of clarity, we avoid any ambiguity in the notation \(a^*\) by using Greek letters for marked permutations, lowercase Latin letters to represent words on any alphabet, and upper case Latin letters to represent sets with an added marked element; see Definition 2.11.

Definition 5.7

(Monoidal equivalence relation on \(\mathcal {W}(\Omega ) \)). We now define an equivalence relation on \(\mathcal {W}(\Omega ) \). For a word \(w \in \mathcal {W}(\Omega ) \), if \(w = (\xi _1^* , \dots , \xi ^*_k)\) is such that \(\xi _i^* \star \xi _{i+1}^* = \xi _{i+1}^* \star \xi _i^* \) is an \(\oplus \)-relation or an \(\ominus \)-relation, we say that \(w \sim (\xi _1^* , \dots \xi _{i-1}^*, \xi _{i+1}^*, \xi _i^*, \dots , \xi ^*_k) \).

We further take the transitive and reflexive closure to obtain an equivalence relation on \(\mathcal {W}(\Omega ) \).

We trivially have that if \(w_1 \sim w_2\) and \(z_1 \sim z_2\), then \(w_1\cdot z_1 \sim w_2\cdot z_2\). This means that the set of equivalence classes \(\mathcal {W}(\Omega )_{\sim }\) is a monoid. Further, because of Remark 5.6, the star map factors to a monoid morphism \( \mathcal {W}(\Omega )_{\sim } \rightarrow \mathcal {G}(\mathtt {MPer})\).

Theorem 5.8

The star map \( \star : w \mapsto w^*\) defines an isomorphism from \( \mathcal {W}(\Omega ) /_{ \sim }\) to the monoid of marked permutations with the inflation product.

We postpone the proof of Theorem 5.8 to Sect. 5.4, and explore its consequences here.

Informally, this theorem states that any two factorizations of a marked permutation \(\pi ^* \) into irreducible marked permutations are related by \(\sim \). As a consequence, we recover the following corollary, which was already obtained in Corollary 4.4 in a more general context:

Corollary 5.9

Consider \(\alpha ^* \) a marked permutation, together with factorizations \(\alpha ^* = \xi _1^* \star \dots \star \xi _k^* = \rho _1^* \star \dots \star \rho _j^* \) into irreducible marked permutations. Then \(k= j\) and \( \{\xi _1^* , \dots , \xi _k^* \} = \{ \rho _1^* , \dots , \rho _j^* \}\) as multisets.

As we did in Sect. 4, we define \(j(\alpha ^* ) \) to be the number of irreducible factors in any factorization of \(\alpha ^*\) into irreducible factors, and define \(\mathfrak {fac}(\alpha ^*) \) as the multiset of irreducible factors of \(\alpha ^*\) in \(\mathcal {G}(\mathtt {MPer})\). These are well defined as a consequence of Corollary 5.9.

Definition 5.10

(Stability conditions). A factorization of a marked permutation \(\alpha ^* \) into irreducible marked permutations,

$$\begin{aligned} \alpha ^* = \xi _1^* \star \dots \star \xi _j^*, \end{aligned}$$

or the corresponding word \((\xi _1^* , \dots , \xi _j^*)\) in \(\mathcal {W}(\Omega )\), is

  • i-\(\oplus \)-stable if there are no \(\pi , \tau \) \(\oplus \)-indecomposable permutations such that

    $$\begin{aligned} \xi _i^* = \bar{1}\oplus \pi \quad \text {and}\quad \xi _{i+1}^* = \tau \oplus \bar{1} \, ; \end{aligned}$$
  • i-\(\ominus \)-stable if there are no \(\pi , \tau \) \(\ominus \)-indecomposable permutations such that

    $$\begin{aligned} \xi _i^* = \tau \ominus \bar{1} \quad \text {and}\quad \xi _{i+1}^* = \bar{1}\ominus \pi . \end{aligned}$$

Such a factorization or word is \(\oplus \)-stable (resp. \(\ominus \)-stable) if it is i-\(\oplus \)-stable (resp. i-\(\ominus \)-stable ) for any \(i = 1, \dots , j-1\). Finally, such a factorization or word is stable if it is both \(\oplus \)-stable and \(\ominus \)-stable.

Remark 5.11

(Stability reduction). If we are given a factorization of \(\alpha ^* = \xi _1^* \star \dots \star \xi _j^*\) that is not i-\(\oplus \)-stable or i-\(\ominus \)-stable for some \(i= 1, \dots , j-1\), we can perform an i-reduction, that maps \((\xi _1^*, \dots , \xi _i^*, \xi _{i+1}^*, \dots \star \xi _j^*)\) to \( (\xi _1^*, \dots , \xi _{i+1}^*, \xi _i^*, \dots \star \xi _j^*)\).

It is immediate to see that this procedure of finding some i and applying an i-reduction always terminates. The final word is stable and is independent of the order in which we apply the reductions.

Because of the above, any equivalence class in \(\mathcal {W}(\Omega ) _{\sim } \) admits a unique stable word, and a consequence of Theorem 5.8 is the following.

Corollary 5.12

(Unique stable factorization). Let \(\alpha ^* \) be a marked permutation. Then, \(\alpha ^*\) has a unique stable factorization into irreducible marked permutations. We refer to it as the stable factorization of \(\alpha ^*\).

5.2 Lyndon Factorization on Marked Permutation

We introduce an order on permutations, two orders on marked permutations and an order in \(\mathcal {W}(\Omega )\).

Definition 5.13

(Orders on marked permutations). The lexicographic order on permutations is the lexicographic order when reading the one-line notation of permutations, and is written \(\pi \le _{per} \tau \).

Recall that, for a marked permutation \(\alpha ^* = (\le _P, \le _V)\) in I, we define its rank \(\mathfrak {rk}(\alpha ^* )\) as the rank of \(*\) in \(I \sqcup \{* \}\) with respect to the order \(\le _P\). We also write \(\alpha \) for referring to the corresponding permutation in the set \(I\sqcup \{*\}\). We define the lexicographic order on marked permutations, also denoted \(\le _{per} \), as follows: we say that \(\pi ^* \le _{per} \tau ^* \) if \(\pi <_{per} \tau \) or if \(\pi = \tau \) and \(\mathfrak {rk} (\pi ^*)\le \mathfrak {rk}(\tau ^*)\).

This in particular endows our alphabet \(\Omega \) of irreducible marked permutations with an order. When we compare words on \(\mathcal {W}(\Omega )\) we order them lexicographically according to \(\le _{per}\), and denote it simply as \(\le \).

We define the factorization order \(\le _{fac}\) on marked permutations as follows: Let \(\pi ^*= \xi _1^* \star \dots \star \xi _k^* \) and \(\tau ^* = \tau _1^* \star \dots \star \tau _j^* \) be the respective unique stable factorizations of \(\pi ^*\) and \(\tau ^*\). Then, we say that \(\pi ^* \le _{fac} \tau ^* \) if \((\xi _1^*, \dots , \xi _k^*)\le (\tau _1^*, \dots , \tau _j^*)\) in \(\mathcal {W}(\Omega )\).

Example 5.14

On permutations we have \(12345 \le _{per} 132 \le _{per} 231 \le _{per} 4123\). Observe that the empty permutation is the smallest permutation.

On marked permutations, we have \(1\bar{3}2 \le _{per} 13\bar{2} \le _{per} \bar{2}31 \le _{per} 412\bar{3} \). Observe that the trivial marked permutation \(\bar{1} \) is the smallest marked permutation.

On words, we have the following examples: \((24\bar{1}3, 31\bar{4}2) \le (31\bar{4}2, 24\bar{1}3) \), \( (\bar{1}32 , 21\bar{3} ) \le (\bar{1}432) \) and \((2\bar{4}13, \bar{1}423, 2\bar{4}13) \le (2\bar{4}13, 2\bar{4}13, \bar{1}423)\).

On marked permutations, because \((24\bar{1}3, 31\bar{4}2)\) and \((31\bar{4}2, 24\bar{1}3) \) are stable, we have that \( 24\bar{1}3 \star 31\bar{4}2 \le _{fac} 31\bar{4}2 \star 24\bar{1}3 \). Notice however, that \((\bar{1}32 , 21\bar{3} ) \) is not a stable word, as it does not satisfy the 1-\(\oplus \)-stability condition. Instead, we have \((\bar{1}32 , 21\bar{3} )^* = 21\bar{3} \star \bar{1}32 \ge _{fac} \bar{1}432\).

Sometimes the orders \(\le _{per}\) and \(\le _{fac}\) on marked permutations do not agree, as exemplified in Fig. 5.

Fig. 5
figure 5

Two marked permutations and their order relations

Remark 5.15

If \(w_1 \ge w_2\) are stable words in \(\mathcal {W}(\Omega ) \), then these correspond precisely to the stable irreducible factorizations of \(w_1^*, w_2^*\). Thus, \(w_1^* \ge _{fac} w_2^*\).

Remark 5.16

If a word \(w = (\rho _1^*, \dots , \rho _k^*)\) in \(\mathcal {W}(\Omega )\) is not i-\(\oplus \)-stable or i-\(\ominus \)-stable, then \(\rho _i^* <_{per}\rho _{i+1}^*\). Thus, from Theorem 5.8 and Remark 5.11, for a fixed marked permutation \(\alpha ^*\), among all words w on irreducible marked permutations such that \(w^* = \alpha ^* \), the stable factorization is the biggest one in the lexicographical order.

We start the discussion on the topic of Lyndon words. This is useful because the unique factorization theorem obtained in Corollary 5.12 for marked permutations is not enough to establish the freeness of \(\mathcal {A}(\mathtt {MPer})\) and, as in [20], Lyndon words are the tool that allows us to describe an improved unique factorization theorem in Theorem 5.21.

Definition 5.17

(Lyndon words). Given an alphabet A with a total order, a word \(l \in \mathcal {W}(A) \) is a Lyndon word if, for any concatenation factorization \(l = a_1 \cdot a_2\) into non-empty words, we have that \(a_2\ge l \).

Example 5.18

(Examples of Lyndon words). Consider the (usual) alphabet

$$\begin{aligned} \Omega = \{\bar{1}<_{per } \bar{1}2<_{per } \bar{1}32<_{per } \dots<_{per } 23\bar{1}<_{per } 24\bar{1}3 <_{per } \dots \} \, ,\end{aligned}$$

then \((\bar{1}2, \bar{1}32, \bar{1}2 , 24\bar{1}3)\) is a Lyndon word in this alphabet. Meanwhile, \((\bar{1}, \bar{1})\) is not a Lyndon word.

Definition 5.19

(Stable Lyndon marked permutations). A word on irreducible marked permutations \(w = (\xi _1^*, \dots , \xi _j^*) \in \mathcal {W}(\Omega ) \) is called stable Lyndon, or SL for short, if it is a Lyndon word and satisfies the stability conditions introduced in Definition 5.10.

A marked permutation \(\pi ^*\) is called stable Lyndon, or SL for short, if there exists an SL word \(l =(\xi _1^*, \dots , \xi _j^*)\) such that \(l^* = \pi ^*\). We write \(\mathcal {L}_{SL} \) for the set of SL marked permutations. Observe that, from Corollary 5.12, if such an SL word exists it is unique.

We see latter in Theorem 5.24 that \(\mathcal {L}_{SL} \) is precisely the set that indexes a free basis of \(\mathcal {A}(\mathtt {MPer})\). To establish the unique factorization theorem in the context of marked permutations, we first recall a classical fact in Lyndon words.

Theorem 5.20

(Unique Lyndon factorization theorem, [5]). Consider a finite alphabet A with a total order. Then any word has a unique factorization, in the concatenation product, into Lyndon words \(l_1, \dots ,l_k\) such that \(l_1 \ge \dots \ge l_k\) for the lexicographical order in \(\mathcal {W}(A)\).

This theorem is central in establishing the freeness of the shuffle algebra in [13]. So is the unique factorization into Lyndon marked permutations below, in establishing the freeness of \(\mathcal {A}(\mathtt {MPer})\).

Theorem 5.21

(Unique stable Lyndon factorization theorem). Let \(\alpha ^* \) be a marked permutation. Then there is a unique sequence of SL words on \(\Omega \), \(l_1, \dots , l_k \) such that \(l_i \ge l_{i+1}\) and \( \alpha ^* = l_1^* \star \dots \star l_k^* \).

We refer to such a sequence of words as the SL factorization of \(\alpha ^*\).

Proof

The existence follows from Corollary 5.12 and Theorem 5.20. Indeed, for any marked permutation \(\alpha ^*\), there is a unique stable factorization \(\xi _1^*, \dots , \xi _{j(\alpha ^*)}^*\), and from the Lyndon factorization theorem, the word \((\xi _1^*, \dots , \xi _{j(\alpha ^*)}^*)\in \mathcal {W}(\Omega )\) admits a factorization into Lyndon words \(l_1, \dots , l_k \) such that \(l_i \ge l_{i+1}\). These words are stable because \((\xi _1^*, \dots , \xi _{j(\alpha ^*)}^*)\) is stable, and from \((\xi _1^*, \dots , \xi _{j(\alpha ^*)}^*) = l_1 \cdots l_k\) we have that \(\alpha ^* = l_1^* \star \dots \star l_k^*\). We then obtain the desired sequence of SL words \(l_1, \dots , l_k\).

For the uniqueness of such a factorization, suppose we have SL words \(m_1 \ge \dots \ge m_{k'} \) that form an SL factorization of \(\alpha ^*\). We wish to show that this is precisely the sequence \(l_1, \dots , l_k\) constructed above. Write \(m_k = (\rho _{k, 1}^*, \dots , \rho _{k, z_k}^*) \) for \(v=1, \dots , k'-1\), where \(z_v = |m_v|\) and, for readability purposes, consider as well the re-indexing \(m_1 \cdots m_{k'} = (\rho _1^*, \dots , \rho _z^*) \).

First observe that from \(\alpha ^* = m_1^* \star \dots \star m_{k'}^*\) we get that \(\rho _1^* \star \dots \star \rho _z^* \) is a factorization of \(\alpha ^*\) into irreducibles. Further, because each \(m_j\) is stable, the i-\(\oplus \)-stability and i-\(\ominus \)-stability of this factorization is given for any i that is not of the form \(z_1 + \dots + z_v\), for some \(v=1, \dots , k'-1\). On the other hand, it follows from the Lyndon property that \(\rho ^*_{k, z_k} >_{per} \rho ^*_{k, 1}\); further, because \(m_k \ge m_{k+1} \), we have that \( \rho ^*_{k, 1}\ge _{per} \rho ^*_{k+1, 1} \). We conclude that \(\rho ^*_{k, z_k} >_{per} \rho ^*_{k+1, 1}\). Comparing with Remark 5.16, we have the i-\(\oplus \)-stability and i-\(\ominus \)-stability condition for any i that is of the form \(z_1 + \dots + z_v\), for some \(v=1, \dots , k'-1\).

Thus, \(\rho _1^* \star \dots \star \rho _z^* \) is the stable factorization of \(\alpha ^*\), so that \((\rho _1^*, \dots , \rho _z^* ) = (\xi _1^*, \dots , \xi ^*_k ) \). Further, the sequence \(m_1\ge \dots \ge m_{k'} \) is the Lyndon factorization of \((\rho _1^*, \dots , \rho _z^* )\), so \((m_1, \dots , m_{k'}) = (l_1, \dots , l_k)\) by the uniqueness in Theorem 5.20. \(\square \)

We define \(k(\alpha ^* )\) to be the number of factors in the stable Lyndon factorization of \(\alpha ^*\). Note that for any marked permutation \(\alpha ^* \), \(k(\alpha ^* ) \le j(\alpha ^* )\) where we recall that \(j(\alpha ^* ) \) is the number of irreducible factors in a factorization of \(\alpha ^*\) into irreducible marked permutations.

Definition 5.22

(Word shuffle). Consider \(\Omega \) an alphabet, and let \(w, l_1, \dots , l_k\in \mathcal {W}(\Omega )\). We say that \(w=(w_1, \dots , w_j)\) is a word shuffle of \( l_1, \dots , l_k\) if [j] can be partitioned into k many disjoint sets \(\{q_1^{(i)}< \dots < q^{(i)}_{|l_i|} \}\), where i runs over \(i=1, \dots , k\), such that

$$\begin{aligned} l_i = (w_{q_1^{(i)}}, \dots , w_{q_{|l_i|}^{(i)}} ) \, , \end{aligned}$$

for all \(i=1 , \dots , k\).

The following theorem is proven in [13, Theorem 2.2.2] and is the main property of Lyndon factorizations on words that we wish to use here. This is also the main ingredient in showing that the shuffle algebra is free.

Theorem 5.23

(Lyndon shuffles—[13]). Take \(\Omega \) an ordered alphabet, and \(l_1\ge \dots \ge l_k\) Lyndon words on \(\mathcal {W}(\Omega )\). Consider \(w\in \mathcal {W}(\Omega )\), and assume that w is a word shuffle of \(l_1, \dots , l_k\). Then \(w \le l_1 \cdots l_k\).

We remark that there are substantial notation differences: particularly, in [13] a prime factorization is what we call here the Lyndon factorization. Our notation follows [8].

5.3 Freeness of the Pattern Algebra in Marked Permutations

In this section we state the main steps of the proof of Theorem 5.1. The proof of the technical lemmas is postponed to Sect. 5.5.

We consider the set of SL marked permutations \(\mathcal {L}_{SL}\), which play the role of free generators, and consider a multiset of SL marked permutations \(\{\iota _1^* \ge _{fac} \dots \ge _{fac} \iota _k^* \}\) and the marked permutation \(\alpha ^* = \iota _1^* \star \dots \star \iota _k^* \).

Then, all the terms that occur on the right hand side of

$$\begin{aligned} \prod _{i=1}^{k} {{\,\mathrm{\mathbf {p}}\,}}_{\iota _i^*} = \sum _{\beta ^* }\left( {\begin{array}{c}\beta ^*\\ \iota _1^*, \dots , \iota _k^*\end{array}}\right) {{\,\mathrm{\mathbf {p}}\,}}_{\beta ^* }, \end{aligned}$$
(16)

correspond to quasi-shuffles of \(\iota _1^*, \dots , \iota _k^* \). Below we establish that the marked permutation \(\alpha ^* = \iota _1^* \star \dots \star \iota _k^*\) is the biggest such marked permutation occurring on the right hand side of (16), with respect to a suitable total order related to \(\le _{fac}\).

Theorem 5.24

Let \(\alpha ^* \) be a marked permutation, and suppose that \(\iota _1^*, \dots , \iota _k^* \) is its Lyndon factorization. Then there are coefficients \(c_{\beta ^* } \ge 0\) such that

$$\begin{aligned} \prod _{i=1}^k {{\,\mathrm{\mathbf {p}}\,}}_{\iota _i^*} = \sum _{|\beta ^*|< |\alpha ^* | } c_{\beta ^* } {{\,\mathrm{\mathbf {p}}\,}}_{\beta ^* } + \sum _{\begin{array}{c} |\beta ^*| = |\alpha ^*| \\ j(\beta ^*) < j(\alpha ^* ) \end{array}} c_{\beta ^* } {{\,\mathrm{\mathbf {p}}\,}}_{\beta ^* } + \sum _{\begin{array}{c} |\beta ^*| = |\alpha ^*| \\ j(\beta ^*) = j(\alpha ^* ) \\ \beta ^* \le _{fac} \alpha ^* \end{array}} c_{\beta ^* } {{\,\mathrm{\mathbf {p}}\,}}_{\beta ^* }. \end{aligned}$$
(17)

Furthermore, \(c_{\alpha ^* } \ge 1\).

With this, the linear independence of all products of the form \(\prod _{i=1}^{k} {{\,\mathrm{\mathbf {p}}\,}}_{\iota _i^*}\) follows from the linear independence of , established earlier in Remark 3.2. In other terms, Theorem 5.24 implies Theorem 5.1. The technical lemmas necessary to prove Theorem 5.24 are the following:

Lemma 5.25

Let \(\beta ^*\) be a quasi-shuffle of the marked permutations \(\iota _1^*, \dots , \iota _k^*\). Then, \(|\beta ^* | \le |\alpha ^*|\). Furthermore, if \(|\beta ^* | = |\alpha ^*|\), then \(j(\beta ^*) \le j(\alpha ^*)\).

Lemma 5.26

(Factor breaking lemma). Let \(\beta ^*\) be a quasi-shuffle of the marked permutations \(\iota _1^*, \dots , \iota _k^*\), such that \( |\beta ^*| = |\alpha ^*|\) and \( j(\beta ^*) = j(\alpha ^* ) \). Then \(\mathfrak {fac} (\beta ^* ) = \mathfrak {fac} (\alpha ^* ) \).

Furthermore, if for each \(i=1, \dots , k\),

$$\begin{aligned} \iota _i^*= \zeta _{1, i}^* \star \dots \star \zeta _{j(\iota _i^*), i}^* \end{aligned}$$

is the stable factorization of \(\iota _i^*\), then there is a marked permutation \(\gamma ^*\) with a factorization into irreducibles given by \(\gamma ^* = \tau _1^* \star \dots \star \tau _{j(\gamma ^*) }^*\) such that

  • we have \(\mathfrak {fac}(\gamma ^* ) = \mathfrak {fac}(\beta ^* )\). In particular, \( |\gamma ^*| = |\beta ^*| = |\alpha ^*|\) and \(j(\gamma ^*) = j(\beta ^*) = j(\alpha ^* ) \);

  • we have \(\gamma ^* \ge _{fac} \beta ^*\);

  • the word \((\tau _1^*, \dots ,\tau _{j(\gamma ^*) }^*)\) is a word shuffle of the words \(\{(\zeta _{1, i}^* , \dots , \zeta _{j(\iota _i^*), i}^*)\}_{i=1, \dots , k}\).

These lemmas will be proven below, in Sect. 5.5. We remark that, here, the chosen ordering \(\le _{per}\) on the irreducible marked permutations plays a role. That is, in proving that \(\gamma ^* \ge _{fac} \beta ^*\) we use properties of the order \(\le _{per}\) introduced above, like Remark 5.16. This is unlike the work in [20], where any order in the \(\oplus \)-indecomposable permutations gives rise to a set of free generators.

Lemma 5.27

(Factor preserving lemma). Let \(\gamma ^*\) be a marked permutation with a factorization into irreducibles given by \(\gamma ^* = \tau _1^* \star \dots \star \tau _{j(\gamma ^* )}^*\), and let \(l_1, \dots , l_k\) be SL words, such that

  • \(l_i \ge l_{i+1}\) for each \(i=1, \dots , k-1\) and;

  • The word \((\tau _1^*, \dots ,\tau _{j(\gamma ^*) }^*)\) is a word shuffle of the words \(\{ l_i\}_{i=1, \dots , k}\).

Then, \(\gamma ^* \le _{fac} l_1^* \star \dots \star l_k^*\).

In the remaining of the section, we assume these lemmas and conclude the proof of the freeness of the pattern algebra, by establishing Theorem 5.24.

Proof of Theorem 5.24

Because a product is a quasi-shuffle of its factors, it follows from Remark 2.5 and from \(\alpha ^* = \iota ^*_1 \star \dots \star \iota ^*_k\) that \(c_{\alpha ^* } \ge 1\). We will complete the proof if we show that any \(\beta ^* \) that is a quasi-shuffle of \(\iota _1^* \dots , \iota _k^* \) satisfies either

  • \(|\beta ^*| < |\alpha ^* |\);

  • or \(|\beta ^*| = | \alpha ^*|\) and \(j(\beta ^*) < j(\alpha ^*) \);

  • or \(|\beta ^*| = |\alpha ^* |\), \(j(\beta ^*) = j(\alpha ^*) \) and \(\beta ^* \le _{fac} \alpha ^* \).

Suppose that \(\beta ^* \) is a quasi-shuffle of \(\iota _1^* , \dots , \iota _k^*\). For each \(i=1, \dots k\), let \(l_i\) be the SL word corresponding to the SL marked permutation \(\iota _i^*\). From Lemma 5.25 we only need to consider the case where \(|\beta ^*| = |\alpha ^* |\) and \(j(\beta ^*) = j(\alpha ^*) \).

From Lemma 5.26 we have that in this case, \(\mathfrak {fac}(\beta ^*) = \mathfrak {fac}(\alpha ^*)\), and there is a marked permutation \(\gamma ^* \) that satisfies \(\mathfrak {fac}(\gamma ^*) = \mathfrak {fac}(\beta ^*)\), \(\gamma ^* \ge _{fac} \beta ^*\), and also has a factorization into irreducibles that is a word shuffle of \(l_1 , \dots , l_k\). Thus, from Lemma 5.27 we have that \(\gamma ^* \le _{fac} l_1^* \star \dots \star l_k^* = \alpha ^*\). It follows that \(\beta ^* \le _{fac} \gamma ^* \le _{fac} \alpha ^*\), as desired. \(\square \)

5.4 Proof of Unique Factorization Theorem

We start this section with the concept of DC intervals and DC chains of a marked permutation \(\alpha ^*\). We will see that these are closely related to factorizations of \(\alpha ^*\), and we will exploit this correspondence to prove Theorem 5.8.

Recall that if \(\beta ^* \) is a marked permutation in X, and \(I\subseteq X\), we denote \(I^* \,{:}{=}\,I \sqcup \{ * \}\) for simplicity of notation. We also write \(\mathbb {X}(\beta ^* ) = X\).

Definition 5.28

Let \(\beta ^* \) be a marked permutation on the set X, i.e. \(\beta ^* = (\le _P, \le _V)\) is a pair of orders on the set \(X^*\). A doubly connected interval on \(\beta ^* \), or a DC interval for short, is a set \(I \subseteq X \) such that \(I^* \) is an interval on both orders \(\le _P, \le _V\). A proper DC interval is a DC interval I such that \(I \ne X\).

Note that X and \(\emptyset \) are always DC intervals. Note as well that if \(I_1, I_2\) are DC intervals, then \(I_1\cup I_2\) is also a DC interval.

Remark 5.29

Suppose that \(\beta ^* = (\le _P, \le _V ) \) is a marked permutation, and I is a DC interval of \(\beta ^*\). Consider \(m_P, M_P\in X^*\) the minimal, respectively maximal, element for the order \(\le _P\). If \(m_P, M_P \in I^*\), then \(I = X\).

Symmetrically, if \(m_V, M_V\in X^* \) are the minimal, respectively maximal, elements for the order \(\le _V\), and \(m_V, M_V \in I^*\), then \(I = X\).

For a marked permutation \(\beta ^*\), we use the notation \(m_P, M_P, m_V, M_V \) in the remaining of the section to refer to its respective extremes, as in Remark 5.29.

Definition 5.30

For a DC interval I of a marked permutation \(\alpha ^* =(\le _P, \le _V)\), we define the permutation \(\alpha ^* \setminus _{I^*} \) in the set \( I^c\) resulting from the restriction of the orders \(\le _P, \le _V\) to the set \(I^c \). Alternatively, this is the permutation resulting from the removal of the marked element in \(\alpha ^*|_{I^c}\).

Remark 5.31

If \(\alpha ^* = a_1^* \star a_2^* \), then \(\mathbb {X}(a_2^*) \) is a DC interval in \(\alpha ^* \). On the other hand, if I is a DC interval of \(\alpha ^*\), then \(\alpha ^* = \alpha ^*|_{I^c} \star \alpha ^*|_{I}\), so right factors of \(\alpha ^* \) are in bijection with DC intervals of \(\alpha ^*\). Furthermore, I is a maximal proper DC interval of \(\alpha ^* \) if and only if \(\alpha ^*|_{I^c}\) is irreducible.

To a factorization \(\beta ^* = \rho _1^* \star \dots \star \rho _j^*\) of a marked permutation \(\beta ^* \in \mathtt {MPer}[X]\) it corresponds a chain of DC intervals

$$\begin{aligned} \emptyset = J_{j+1} \subsetneq J_j \subsetneq \dots \subsetneq J_1 = X. \end{aligned}$$

The chain is defined by \(J_k = \mathbb {X} (\rho _k^* \star \dots \star \rho _j^*)\) and satisfies \(\beta ^*|_{J_k \setminus J_{k+1} } = \rho _k^* \) for any \(k = 1, \dots , j\). This chain of DC intervals is maximal if and only if the original factorization has only irreducible factors.

Remark 5.32

The marked permutation \(\alpha ^* \) is \(\oplus \)-decomposable if and only if there is a DC interval I of \(\alpha ^* \) such that \(I^*\) contains both \(m_P, m_V\), or contains both \(M_P, M_V\).

In the first case, \(\alpha ^*\) factors as \(\beta ^*_1 \oplus \beta _2\), where \(\beta _1^* = \alpha ^*|_I \) and \(\beta _2 = \alpha ^*\setminus _{I^*}\). In the second case, \(\alpha ^*\) factors as \(\beta _1 \oplus \beta _2^*\), where \(\beta _1 = \alpha ^*\setminus _{I^*} \) and \(\beta _2^* = \alpha ^*|_{I}\).

Similarly, \(\alpha ^* \) is \(\ominus \)-decomposable if and only if there is a DC interval I of \(\alpha ^* \) such that \(I^*\) contains both \(M_P, m_V\), or contains both \(m_P, M_V\).

In the first case, \(\alpha ^*\) factors as \(\beta ^*_1 \ominus \beta _2\), where \(\beta _1^* = \alpha ^*|_I \) and \(\beta _2 = \alpha ^*\setminus _{I^*}\). In the second case, \(\alpha ^*\) factors as \(\beta _1 \ominus \beta _2^*\), where \(\beta _1 = \alpha ^*\setminus _{I^*} \) and \(\beta _2^* = \alpha ^*|_I\).

This characterization of \(\oplus \)-decomposable marked permutations will be useful in the proof of the classification of the factorizations below, specifically in Lemma 5.37. It is also useful to characterize all \(\oplus \)-decomposable marked permutations that are irreducible in Sect. 5.6.

Observation 5.33

(\(\oplus \) -factorization in marked permutations). Let \(\alpha ^*\) be a marked permutation. Then there are unique \(\oplus \)-indecomposable permutations \(\epsilon _1, \dots , \epsilon _k\), \(\lambda _1, \dots , \lambda _j\) and \(\beta ^* \) an \(\oplus \)-indecomposable marked permutation such that

$$\begin{aligned} \alpha ^* = \epsilon _1 \oplus \dots \oplus \epsilon _k \oplus \beta ^* \oplus \lambda _j \oplus \dots \oplus \lambda _1. \end{aligned}$$

In this case, we say that \(\alpha ^* \) is q-\(\oplus \)-decomposable, where \(q=k+j\).

Example 5.34

(q-\(\oplus \)-decomposition). Consider the marked permutation \(21\bar{3}54\). This is a 2-decomposable marked permutation, as it admits the \(\oplus \)-factorization

$$\begin{aligned} 21\bar{3}54 = 21 \oplus \bar{1} \oplus 21. \end{aligned}$$

A marked permutation is \(\oplus \)-indecomposable if and only if it is 0-\(\oplus \)-decomposable.

Lemma 5.35

(Irreducible \(\oplus \)-factor lemma). Suppose that \(\alpha ^* \) is a marked permutation that has the following \(\oplus \)-factorization

$$\begin{aligned} \alpha ^* = \epsilon _1 \oplus \dots \oplus \epsilon _u \oplus \beta ^* \oplus \lambda _v \oplus \dots \oplus \lambda _1, \end{aligned}$$

where \(u+v > 0\). Consider any factorization \(\alpha ^* = \sigma ^* \star \gamma ^* \), where \(\sigma ^* \) is an irreducible marked permutation.

  • If both \(u>0\) and \(v>0\), then either \(\sigma ^* = \bar{1}\oplus \lambda _1 \) or \(\sigma ^* = \epsilon _1 \oplus \bar{1}\).

  • If \(u=0\), then \(\sigma ^* = \bar{1}\oplus \lambda _1 \).

  • If \(v=0 \), then \(\sigma ^* = \epsilon _1 \oplus \bar{1}\).

Proof

Let us deal with the case where both \(u > 0 \) and \(v > 0\) first. Assume that neither \(\sigma ^* = \bar{1}\oplus \lambda _1 \) nor \(\sigma ^* = \epsilon _1 \oplus \bar{1}\). Consider the following DC intervals, which are all distinct

$$\begin{aligned} Y_1= & {} \mathbb {X}(\epsilon _2\oplus \dots \oplus \epsilon _u \oplus \beta ^* \oplus \lambda _v \oplus \dots \oplus \lambda _1 ),\\ Y_2= & {} \mathbb {X}(\epsilon _1\oplus \dots \oplus \epsilon _u \oplus \beta ^* \oplus \lambda _v \oplus \dots \oplus \lambda _2 ),\\ Y= & {} \mathbb {X}(\gamma ^* ). \end{aligned}$$

Note that \(m_P \in Y_2^*\setminus Y_1^*\) and \(M_P\in Y_1^*\setminus Y_2^*\) by construction. Note also that \(\alpha ^*|_{Y_1^c} = \epsilon _1\oplus \bar{1} \) and \( \alpha ^*|_{Y_2^c} = \bar{1} \oplus \lambda _1\) are irreducible marked permutations, so both \(Y_1, Y_2\) are maximal proper DC intervals. Furthermore, Y is also a maximal proper DC interval. This maximality gives us that \(Y \cup Y_1 = X = Y\cup Y_2 \).

From \(Y \cup Y_1 = X\) and \(m_P\not \in Y_1^* \), we have that \(m_P \in Y^*\), and from \(Y\cup Y_2 = X \) and \(M_P\not \in Y_2^* \) we get that \(M_P \in Y^*\). From Remark 5.29, this is a contradiction with the fact that Y is a proper DC interval, thus contradicting the assumption that neither \( \sigma ^* = \bar{1}\oplus \lambda _1 \) nor \( \sigma ^* = \epsilon _1 \oplus \bar{1} \), as desired.

Now suppose that \(u=0\), and \(v > 0 \). Assume for the sake of contradiction that \(\sigma ^* \ne \bar{1}\oplus \lambda _1\), and define the following distinct DC intervals

$$\begin{aligned} Y_2 = \mathbb {X}(\beta ^* \oplus \lambda _v \oplus \dots \oplus \lambda _2 ) \text { and } Y = \mathbb {X}(\gamma ^* ). \end{aligned}$$

Because both \(\sigma ^* \) and \( \bar{1}\oplus \lambda _1 \) are irreducible, the DC intervals \(Y_2, Y \) are both maximal proper, so \(X = Y \cup Y_2\). Further, \(m_P \in Y_2^* \) by construction, so \(M_P\in Y^* \) by Remark 5.29. Consider the DC interval \(I = \mathbb {X}(\beta ^* ) \), and notice that \(m_P \in I^* \) by construction. Thus we have that \(I^* \cup Y^* = X^* \), and \(Y^c \subseteq I\).

Fig. 6
figure 6

A decomposition of \(\beta ^*\), whenever the DC interval Y is proper

We have the following decomposition, depicted in Fig. 6:

$$\begin{aligned} \beta ^* = \alpha ^*\setminus _{Y^*} \oplus \alpha ^*|_{I\cap Y}. \end{aligned}$$

Notice that \( \alpha ^*\setminus _{Y^*}\) is not the empty permutation, because Y is a proper DC interval. This is a contradiction with the fact that \(\beta ^*\) is \(\oplus \)-indecomposable, so \(\sigma ^* = \bar{1}\oplus \lambda _1\).

The case where \(u> 0 \) and \(v=0\) is done in a similar way, so the result follows. \(\square \)

Corollary 5.36

Consider a marked permutation \(\alpha ^*\) that is q-\(\oplus \)-decomposable, so that \( \alpha ^* = \epsilon _1\oplus \dots \oplus \epsilon _u \oplus \beta ^* \oplus \lambda _v \oplus \dots \oplus \lambda _1 \) is the \(\oplus \)-decomposition of \(\alpha ^* \). If \(\sigma _1^* \star \dots \star \sigma _j^*\) is a factorization of \(\alpha ^*\) into irreducibles, then \(j\ge q\) and

  1. (1)

    \(\sigma _{q+1}^*\star \dots \star \sigma _j^* = \beta ^* \).

  2. (2)

    By applying \(\oplus \)-relations to \((\sigma _1^*, \dots , \sigma _q^*)\) we can obtain

    $$\begin{aligned} (\bar{1}\oplus \lambda _1, \dots , \bar{1}\oplus \lambda _v, \epsilon _1\oplus \bar{1}, \dots , \epsilon _u\oplus \bar{1} ). \end{aligned}$$

Proof

We use induction on q. The base case is \(q=0\), where there is nothing to establish in 2. and we need only to show that

$$\begin{aligned} \sigma _{1}^* \star \dots \star \sigma _j^* = \beta ^*, \end{aligned}$$

which follows because \( \sigma _{1}^* \star \dots \star \sigma _j^* = \alpha ^* = \beta ^* \).

Now for the induction step, we assume that \(q\ge 1\). From Lemma 5.35, \(\sigma _1^* \) is either \(\epsilon _1 \oplus \bar{1} \) or \(\bar{1} \oplus \lambda _1\), thus according to Remark 2.14\(\zeta ^* := \sigma _2^* \star \dots \star \sigma _k^* \) is either

$$\begin{aligned} \epsilon _2\oplus \dots \oplus \epsilon _u \oplus \beta ^* \oplus \lambda _v \oplus \dots \oplus \lambda _1, \end{aligned}$$

or

$$\begin{aligned} \epsilon _1\oplus \dots \oplus \epsilon _u \oplus \beta ^* \oplus \lambda _v \oplus \dots \oplus \lambda _2. \end{aligned}$$

Without loss of generality, assume the first case. Then \(\zeta ^* \) is \((q-1)\)-\(\oplus \)-decomposable, so the induction hypothesis applies to the factorization of \(\zeta ^* \). That is, we have that

$$\begin{aligned} \sigma _{q+1}^* \star \dots \star \sigma _j^* = \beta ^*. \end{aligned}$$

Furthermore, the induction case gives us that \( (\bar{1}\oplus \lambda _1, \dots , \bar{1}\oplus \lambda _v, \epsilon _2\oplus \bar{1}, \dots , \epsilon _u\oplus \bar{1} ) \) can be obtained from \((\sigma _2^*, \dots , \sigma _q^* )\) by a series of \(\oplus \)-relations.

So, by only using the \(\oplus \)-relations and the inductive hypothesis we deduce that:

$$\begin{aligned} \begin{aligned}&(\bar{1}\oplus \lambda _1, \dots , \bar{1}\oplus \lambda _v, \epsilon _1\oplus \bar{1} , \epsilon _2\oplus \bar{1}, \dots , \epsilon _u\oplus \bar{1} ) \\&\quad \sim ( \epsilon _1\oplus \bar{1}, \bar{1}\oplus \lambda _1, \dots , \bar{1}\oplus \lambda _v, \epsilon _2\oplus \bar{1}, \dots , \epsilon _u\oplus \bar{1} ) \\&\quad \sim (\sigma _1^*, \sigma _2^*, \dots , \sigma _q^* ) \end{aligned} \end{aligned}$$
(18)

concluding the the proof. \(\square \)

We remark that Observation 5.33, Lemma 5.35, and Corollary 5.36 have counterparts for the \(\ominus \) operation.

Lemma 5.37

(Indecomposable irreducible factor lemma). Suppose that \(\alpha ^* \) is a non-trivial marked permutation that is both \(\oplus \)-indecomposable and \(\ominus \)-indecomposable. Consider two factorizations of \(\alpha ^* \), \( \sigma _1^* \star \beta ^*_1 \) and \( \sigma _2^* \star \beta _2^* \), where \(\sigma _1^* , \sigma _2^* \) are irreducible marked permutations. Then \(\sigma _1^* = \sigma _2^* \) and \(\beta _1^* = \beta _2^*\).

Proof

According to Remark 5.31, it suffices to see that \(\alpha ^* \) only has one maximal proper DC interval. Suppose otherwise, that there are \(Y_1, Y_2\) distinct proper maximal DC intervals, for the sake of contradiction. Further, consider \(m_P, M_P, m_V, M_V\) the usual maximal and minimal elements in \( \mathbb {X}(\alpha ^* )^* \).

We have that \(Y_1 \cup Y_2 = X\), so \(m_P, M_P, m_V, M_V \in Y_1^* \cup Y_2^* \). Without loss of generality suppose that \(m_P\in Y_1^*\). We know that \(\{m_V, M_V\} \not \subseteq Y_2^*\), so there are only two cases to consider:

  • We have that \(m_P, m_V \in Y_1^* \). Then \(\alpha ^* \) is \(\oplus \)-decomposable, according to Remark 5.32.

  • We have that \(m_P, M_V \in Y_1^* \). Then \(\alpha ^* \) is \(\ominus \)-decomposable, according to Remark 5.32.

In either case, we reach a contradiction. It follows that \(\beta ^*_1 = \beta ^*_2 \) and \(\sigma _1^* = \sigma ^*_2\). \(\square \)

Proof of Theorem 5.8

Consider a marked permutation \(\alpha ^*\), and take words \(w_1 = (\xi _1^*, \dots , \xi _k^*)\) and \(w_2 = (\rho _1^* , \dots , \rho _j^*)\) in \(\mathcal {W}(\Omega )\) such that

$$\begin{aligned} \xi _1^* \star \dots \star \xi _k^* = \rho _1^* \star \dots \star \rho _j^* =: \alpha ^*, \end{aligned}$$
(19)

and assume for the sake of contradiction that these can be chosen with \(w_1 \not \sim w_2\). Further choose such words minimizing \(k+j = | w_1| + | w_2|\). We need only to consider four cases:

The marked permutation \(\alpha ^* = \bar{1}\) is trivial: then by a size argument we have that both words \( w_1 \) and \(w_2 \) are empty. Thus \( w_1 = w_2 \).

The marked permutation \(\alpha ^* \) is indecomposable: in this case, from Lemma 5.37 we know that \(\xi _1^* = \rho ^*_1\) and that \(\xi _2^* \star \dots \star \xi _k^* = \rho _2^* \star \dots \star \rho _j^* \). Thus, by minimality, \((\xi _2^*, \dots , \xi _k^*) \sim ( \rho _2^*, \dots , \rho _j^*)\), which implies \((\xi _1^*, \dots , \xi _k^*)\sim ( \rho _1^*, \dots , \rho _j^*) \) and that is a contradiction.

The marked permutation \(\alpha ^* \) is \(\oplus \) -decomposable: Assume now that \(\alpha ^* \) is q-\(\oplus \)-decomposable, for some \(q>0\). That is, there are \(\oplus \)-indecomposables such that

$$\begin{aligned} \alpha ^* = \epsilon _1 \oplus \dots \oplus \epsilon _u \oplus \beta ^* \oplus \lambda _v \oplus \dots \oplus \lambda _1, \quad u+v = q. \end{aligned}$$

Then Corollary 5.36 tells us that \(q \le k, j\) and that

$$\begin{aligned} \xi _{q+1}^* \star \dots \star \xi _k^* = \beta ^* = \rho _{q+1}^* \star \dots \star \rho _j^*. \end{aligned}$$
(20)

Further, we also have that

$$\begin{aligned} (\xi _1^* , \dots , \xi _q^*) \sim (\bar{1}\oplus \lambda _1, \dots , \bar{1}\oplus \lambda _v, \epsilon _1\oplus \bar{1}, \dots , \epsilon _u\oplus \bar{1} ) \sim (\rho _1^* , \dots , \rho _q^* ). \end{aligned}$$
(21)

Because \(q > 0\), from (20) and the minimality of \((\xi _1^*, \dots , \xi _k^*), ( \rho _1^*, \dots , \rho _j^*) \) we have that

$$\begin{aligned} (\xi _{q+1}^*, \dots , \xi _k^*)\sim ( \rho _{q+1}^*, \dots , \rho _j^*). \end{aligned}$$

This, together with (21) gives us \((\xi _1^*, \dots , \xi _k^*)\sim ( \rho _1^*, \dots , \rho _j^*) \) and that is a contradiction.

The marked permutation \(\alpha ^* \) is \(\ominus \) -decomposable: This case is similar to the previous one.

We conclude that a factorization of a marked permutation into irreducibles is unique up to the relations in Remark 5.6. \(\square \)

5.5 Proofs of Lemmas 5.25 to 5.27

We start by fixing some notation. Consider a multiset \(\{\iota _1^* \ge \dots \ge \iota _k^* \}\) of SL marked permutations, and let \(\alpha ^*\) be the marked permutation with Lyndon factorization \((\iota _1^*, \dots , \iota _k^*)\) which exists and is unique by Theorem 5.21, and has \(\alpha ^* = \iota _1^* \star \dots \star \iota _k^*\).

Note that \(\mathcal {S} := \biguplus _{i=1}^k \mathfrak {fac} ( \iota _i^*) = \mathfrak {fac}(\alpha ^* )\) as multisets, from Corollary 5.9.

Proof of Lemma 5.25

Let \(\beta ^* \) be a marked permutation in X. By Definition 3.4, there are sets \(I_1, \dots , I_k \) such that:

$$\begin{aligned} I_1 \cup \dots \cup I_k = X \text { and } \beta ^*|_{I_i} \sim \iota _i^* \, \, \, \forall i =1, \dots , k. \end{aligned}$$
(22)

Suppose that \(\beta ^* \) has stable factorization \(\beta ^* = \rho _1^* \star \dots \star \rho _j^*\), where \(j = j(\beta ^*)\), with a corresponding maximal DC interval chain

$$\begin{aligned} \emptyset = J_{j+1} \subsetneq J_j \subsetneq \dots \subsetneq J_1 = X, \end{aligned}$$

as given in Remark 5.31, so that \( \beta ^*|_{J_p \setminus J_{p+1}}= \rho _p \) for \(p=1, \dots , j\).

Since \(\beta ^* \) is a quasi-shuffle of \(\iota _1^*, \dots , \iota _k^*\), the sets \(I_1, \dots , I_k \) cover X and so

$$\begin{aligned} |\beta ^* | = | X |\le \sum _{i=1}^k | I_i| = \sum _{i=1}^k |\iota _i^* | = |\alpha ^* |, \end{aligned}$$
(23)

so we conclude that \(|\beta ^* | \le |\alpha ^* |\).

Now, assume that we have \(|\beta ^* | = |\alpha ^* |\), so we have equality in (23), thus the sets \(I_i\) are mutually disjoint. Recall that \(j(\alpha ^* ) = \sum _i j(\iota _i^* )\), as shown in Corollary 5.9. Therefore, we only need to establish that \(\sum _i j(\iota _i^* ) \ge j\). For each \(i= 1, \dots , k \), the following is a DC interval chain of \(\iota _i^*\), which is not necessarily a maximal one:

$$\begin{aligned} \emptyset = J_{j+1}\cap I_i \subseteq J_j\cap I_i \subseteq \dots \subseteq J_1\cap I_i = I_i, \end{aligned}$$
(24)

so let us consider the set \(U_p:=\{i\in [ k ] | J_{p+1}\cap I_i \ne J_p \cap I_i \}\).

First it is clear that each \(U_p\) is non empty, as otherwise we would have

$$\begin{aligned} J_{p+1} = \bigcup _i J_{p+1}\cap I_i = \bigcup _i J_p \cap I_i = J_p. \end{aligned}$$

On the other hand, the length of the DC chain is given precisely by the number of strict inequalities in (24), that is by \(| \{p \in [j] | i \in U_p\} |\). From Corollary 5.9 and Remark 5.31, this is at most \(j(\beta ^*|_{I_i} ) = j(\iota _i^*)\), so

$$\begin{aligned} \sum _i j(\iota _i^* ) \ge \sum _i |\{p \in [j] | i \in U_p\}| = \sum _{p=1}^j | U_p | \ge j. \end{aligned}$$
(25)

So we conclude that \(j(\alpha ^*) \ge j(\beta ^*)\). \(\square \)

Proof of Lemma 5.26

Assume now that \(|\beta ^* | = |\alpha ^* |\) and \(j(\beta ^*) = j(\alpha ^*)\). As a corollary of the proof above, and using the same notation, we have that the sets \(I_i\) are pairwise disjoint, and we obtain equality all through (25), so that each \(U_p\) is in fact a singleton.

We wish to split the indexing set \([j(\gamma ^*)]\) into k many disjoint increasing sequences \(q_1^{(i)}< \dots < q_{j(\iota _i^*)}^{(i)} \) for \(i=1, \dots , k\) such that

$$\begin{aligned} \iota _i^*= \tau _{q_{1}^{(i)}}^* \star \dots \star \tau _{q_{j(\iota _i^*)}^{(i)}}^*, \end{aligned}$$
(26)

is precisely the stable factorization of each \(\iota _i^*\).

Define the map \( \zeta : [j] \rightarrow [k] \) that sends p to the unique element in \(U_p\). This map will give us the desired increasing sequences. It satisfies

$$\begin{aligned} | \zeta ^{-1} ( i )| = |\{p \in [j] | i \in U_p\}| = j(\iota _i^* ) \quad \text {for } \, i=1 , \dots , k. \end{aligned}$$

Write \(\zeta ^{-1}(i)=\{q^{(i)}_1< \dots < q^{(i)}_{j(\iota _i^*) } \}\subseteq [j]\) and set \(q^{(i)}_{j(\iota _i^*) + 1 }= j+1\). In the following, we identify the marked permutations \(\iota _i^*\) and \(\beta ^*|_{I_i}\) in order to find a factorization of \(\iota ^*\) into irreducibles. Specifically, we get that

$$\begin{aligned} \iota _i^* = \beta ^*|_{I_i} = \rho _1^*|_{I_i\cap J_1\setminus J_2} \star \dots \star \rho _j^*|_{I_i\cap J_j\setminus J_{j+1}} \end{aligned}$$
(27)

is a factorization of \(\iota _i^*\). Because each \(U_p\) is a singleton, \(I_i\cap J_p\setminus J_{p+1} \) is either \(J_p\setminus J_{p+1}\) or \(\emptyset \), thus \(\rho _p^*|_{I_i\cap J_p\setminus J_{p+1}} \) is either \(\rho _p^*\) of \(\bar{1}\), and the factorization in (27), after removing the trivial terms, becomes the following factorization into irreducibles:

$$\begin{aligned} \iota _i = \rho _{q^{(i)}_1}^*\star \dots \star \rho _{q^{(i)}_{j(\iota ^*_i)}}^*. \end{aligned}$$
(28)

Then, we indeed have that \(\mathfrak {fac}(\beta ^* ) = \biguplus _{i=1}^k \mathfrak {fac}(\iota _i^*)\). We now construct the desired marked permutation \(\gamma ^* \).

According to Corollary 5.9, for each i, the unique stable factorization of \(\iota _i^*\) results from \(\iota _i^* = \rho _{q^{(i)}_1}^* \star \dots \star \rho _{q^{(i)}_{j(\iota _i^*)}}^*\) by a permutation of the factors. Thus, for each i we can find indices \(p^{(i)}_1, \dots , p^{(i)}_{j(\iota _i^*)}\) such that \(\{p^{(i)}_1, \dots , p^{(i)}_{j(\iota _i^*)}\} = \{ q^{(i)}_1, \dots , q^{(i)}_{j(\iota _i^*)} \}\) and

$$\begin{aligned} \iota ^*_i = \rho _{q^{(i)}_1}^* \star \dots \star \rho _{q^{(i)}_{j(\iota _i^*)}}^* = \rho _{p^{(i)}_1}^* \star \dots \star \rho _{p^{(i)}_{j(\iota _i^*)}}^* \end{aligned}$$

is the stable factorization of \(\iota ^*_i\).

For each \(s\in [j]\), if \( s = q_u^{(i)}\) for some integers iu, define \(\tau _s \,{:}{=}\,\rho _{p_u^{(i)}}^*\) and finally define

$$\begin{aligned} \gamma ^* = \tau _1^* \star \dots \star \tau _j^*. \end{aligned}$$
Fig. 7
figure 7

Example of construction of \(\gamma ^* \) for \(j=8\)

A graphical description of this construction for \(j=8\) is given in Fig. 7. We claim that \(\gamma ^* \) satisfies the three conditions described in the lemma. First, it is clear that \(\mathfrak {fac}(\beta ^* ) = \biguplus _{i=1}^k \mathfrak {fac}(\iota _i^*) = \mathfrak {fac}(\gamma )\), and that the disjoint increasing sequences \(q_1^{(i)}< \dots < q^{(i)}_{j(\iota ^*_i)}\) are such that

$$\begin{aligned} \tau _{q_1^{(i)}}^* \star \dots \star \tau _{q_{j(\iota _i^*)}^{(i)}}^* = \rho _{p_1^{(i)}}^* \star \dots \star \rho _{p_{j(\iota _i^*)}^{(i)}}^* \end{aligned}$$

is precisely the stable factorization of \(\iota ^*_i\). Thus, we need only to establish that \(\beta ^* \le _{fac} \gamma ^*\).

We claim that \((\tau _1^*, \dots , \tau _j^* ) \ge (\rho _1^* , \dots , \rho _j^*)\). Indeed, \((\tau _1^*, \dots , \tau _j^* ) \) is obtained from \((\rho _1^* , \dots , \rho _j^*)\) by the stabilization procedure in its subwords. From the stabilization procedure we obtain bigger words in the lexicographical order, according to Remark 5.16. This still holds true even if only applied to a subword, thus the resulting word \((\tau _1^*, \dots , \tau _j^* ) \) is lexicographically bigger than \((\rho _1^* , \dots , \rho _j^*)\).

Now, if \(\gamma ^* = \epsilon _1^* \star \dots \star \epsilon _j^* \) is the stable factorization of \(\gamma ^*\), because \(\gamma ^* = \tau _1^* \star \dots \star \tau _j^* \) we have that from Remark 5.16 that

$$\begin{aligned} (\tau _1^*, \dots , \tau _j^* ) \le (\epsilon _1^* , \dots , \epsilon _j^*). \end{aligned}$$

Thus

$$\begin{aligned} (\rho _1^* , \dots , \rho _j^*) \le (\epsilon _1^* , \dots , \epsilon _j^*) \, , \end{aligned}$$

and so \(\beta ^* \le _{fac} \gamma ^*\), as desired. \(\square \)

In the following proof, we will start by showing that the given factorization of \(\gamma ^* \) can be assumed to be the stable factorization. Then, we use Theorem 5.20 and the fact that the factorization of \(\gamma ^* \) is a shuffle of Lyndon words to establish the desired inequality.

Proof of Lemma 5.27

Write \(j=j(\gamma ^*)\). We first see that if \(\gamma ^* \) has some factorization that is a word shuffle of stable words \(l_1, \dots , l_k\), then the stable factorization is also a word shuffle of these words.

Indeed, take a factorization \(\tau _1^* \star \dots \star \tau _j^* \) such that \((\tau _1^* , \dots , \tau _j^*)\) is a word quasi-shuffle of \(l_1, \dots , l_k\), and say that there is some \(u \in \{1, \dots , j-1 \}\) such that this factorization is not u-\(\oplus \)-stable or is not u-\(\ominus \)-stable. According to Remark 5.11, to show that the stable factorization is also a word shuffle of \(l_1, \dots , l_k\), it suffices to show that the word resulting from swapping \(\tau _u^*\) and \(\tau _{u+1}^*\) in \((\tau _1^* , \dots , \tau _j^*)\) is still a word quasi-shuffle of \(l_1, \dots , l_k\).

When we apply a u-stability reduction (see Remark 5.11), we can still find a suitable partition of [j] into k many disjoint increasing sequences. Say that [j] is partitioned into the blocks \(\{q^{(i)}_1< \dots < q^{(i)}_{j(\iota ^*_i)} \}\), then there are integers \(i_1, i_2, v_1, v_2\) such that \(u= q^{(i_1)}_{v_1}\) and \(u+1=q^{(i_2)}_{v_2}\). Because \((\tau ^*_{q^{(i)}_1}, \dots , \tau ^*_{q^{(i)}_{j(\iota ^*_i)}})\) is stable for each i, we cannot have \(i_1 = i_2\). Therefore, by swapping the elements \(u, u+1\) we obtain a new partition for the new factorization, thus showing that it is a word quasi-shuffle of \(l_1, \dots , l_k\).

Now let \( \rho _1^* \star \dots \star \rho _j^* \) be the stable factorization of \(\gamma ^* \). Since \((\rho _1^* , \dots , \rho _j^*)\) is a word shuffle of \( l_1 , \dots , l_k\), which are Lyndon words in \(\mathcal {W}(\Omega )\), we have from Theorem 5.23 that \((\rho _1^* , \dots , \rho _j^*) \le l_1 \cdots l_k\), and so \(\gamma ^* \le _{fac} l_1^* \star \dots \star l_k^*\). \(\square \)

5.6 Primitive Elements, Growth Rates and Asymptotic Analysis

Recall that in Sect. 3.3 we define the space of primitive elements P(H) of a Hopf algebra H is the subspace of H given by \(\{a \in H | \Delta a = a \otimes 1 + 1 \otimes a\}\). In the particular case of the pattern Hopf algebra \(\mathcal {A}(\mathtt {MPer})\), its primitive space is spanned by \(\left\{ {{\,\mathrm{\mathbf {p}}\,}}_{\pi ^* } | \pi ^* \text { is irreducible marked permutation} \right\} \), according to Proposition 3.7. So, we are interested in enumerating the irreducible marked permutations. We consider some generating functions:

  • The power series \(P^*(x) = \sum _{\pi ^* \text { marked permutation} } x^{|\pi ^*|}= \sum _{n\ge 1} n \cdot n!\, x^{n-1} \) counts marked permutations.

  • The power series \(P(x) = \sum _{\pi \text { permutation}} x^{|\pi |}= \sum _{n\ge 0} n! \, x^n \) counts permutations.

  • The power series \(S^*(x) = \sum _{k\ge 0 } s_k x^k = \sum _{\pi ^* \text { irreducible marked permutation}} x^{|\pi ^*|}\) counts irreducible marked permutations. This is the main generating function that we aim to enumerate here.

  • The power series \(S_o^*(x) = \sum _{k\ge 0 } so_k x^k = \sum _{\begin{array}{c} \pi ^* \text { irreducible and indecomposable}\\ \text { marked permutation } \end{array}} x^{|\pi ^*|} \) counts irreducible marked permutations that are indecomposable, that is neither \(\oplus \)-decomposable nor \(\ominus \)-decomposable.

  • The power series \(P^{\oplus }(x) = \sum _{\pi \text { is } \oplus - \text { decomposable }} x^{|\pi |}\) counts permutations that are \(\oplus \)-indecomposable. This also counts the permutations that are \(\ominus \)-indecomposable.

Because we have a unique factorization theorem on permutations under the \(\oplus \) product, the coefficients of \(P^{\oplus }(x)\) can be easily extracted via the following power series relation

$$\begin{aligned} \frac{1}{1 - P^{\oplus }(x)} = P(x) = \sum _{n\ge 0 } n! x^n, \text { which implies } P^{\oplus } (x) = 1 -P(x)^{-1}. \end{aligned}$$

Observation 5.38

Any \(\oplus \)-decomposable irreducible marked permutation is either of the form \(\bar{1}\oplus \pi \) or of the form \(\pi \oplus \bar{1} \) for \(\pi \) an \(\oplus \)-indecomposable permutation, and symmetrically for \(\ominus \)-decomposable irreducible marked permutations.

Thus, we have

$$\begin{aligned} S^*(x) - S_o^*(x) = 4P^{\oplus } (x). \end{aligned}$$
(29)

The following proposition allows us to enumerate easily the irreducible marked permutations and the irreducible indecomposable marked permutations, as done in Table 1.

Proposition 5.39

(Power series of irreducible marked permutations).

$$\begin{aligned} S^*(x)= & {} 3 + \frac{2}{P(x)^2} - \frac{1}{P'(x)} - \frac{4}{P(x)}.\\ S_o^*(x)= & {} -1 + \frac{2}{P(x)^2} - \frac{1}{P'(x)}. \end{aligned}$$

We compare this result with the enumeration of simple permutations in [1, Equation 1], where the power series enumerating simple permutations is given as the solution of a functional equation that is not rational. Thus, we expect it to be simpler to compute the coefficients explicitly.

Table 1 First elements of the sequences \(so_n\) and \(s_n \)

Lemma 5.40

Let \(\pi ^* \) be a marked permutation. Then, there are four cases

  • There are unique marked permutations \(\sigma ^*\) and \(\alpha ^* \) such that \(\sigma ^*\) is indecomposable and irreducible, and \(\pi ^* = \sigma ^* * \alpha ^* \).

  • The marked permutation \(\pi ^*\) is \(\oplus \)-decomposable.

  • The marked permutation \(\pi ^*\) is \(\ominus \)-decomposable.

  • \(\pi ^* = \bar{1}\).

In particular, we have the following equation

$$\begin{aligned} P^*(x) =S_o^*(x) P^*(x) + 2 ( P(x) - P^{\oplus } (x) )' +1. \end{aligned}$$
(30)

Proof

If \(\pi ^* \) is indecomposable, then, either \(\pi ^* = \bar{1}\), or there are unique marked permutations \(\sigma ^*\) and \(\alpha ^* \) such that \(\sigma ^*\) is indecomposable and irreducible, and \(\pi ^* = \sigma ^* * \alpha ^* \), according to Lemma 5.37. This concludes the first part of the lemma.

Further, we observe that

$$\begin{aligned} ( P(x) - P^{\oplus } (x) )' \end{aligned}$$

counts the marked permutations that are \(\oplus \)-decomposable (and by symmetry, the ones that are \(\ominus \)-decomposable). \(\square \)

Proof of Proposition 5.39

From (30) along with the fact that \(P^*(x) = P'(x)\), we have that

$$\begin{aligned} S_o^*(x)= & {} -1 + 2P(x)^{-2} - P'(x)^{-1},\\ S^*(x)= & {} 3 + 2 P(x)^{-2} - P'(x)^{-1} - 4P(x)^{-1}, \end{aligned}$$

as desired. \(\square \)