Pattern Hopf Algebras

In this paper, we expand on the notion of combinatorial presheaf, first introduced explicitly by Aguiar and Mahajan in 2010 but already present in the literature in some other points of view. We do this by adapting the algebraic framework of species to the study of substructures in combinatorics. Afterwards, we consider functions that count the number of patterns of objects and endow the linear span of these functions with a product and a coproduct. In this way, any well-behaved family of combinatorial objects that admits a notion of substructure generates a Hopf algebra, and this association is functorial. For example, the Hopf algebra on permutations studied by Vargas in 2014 and the Hopf algebra on symmetric functions are particular cases of this construction. A specific family of pattern Hopf algebras of interest are the ones arising from commutative combinatorial presheaves. This includes the presheaves on graphs, posets and generalized permutahedra. Here, we show that all the pattern Hopf algebras corresponding to commutative presheaves are free. We also study a remarkable non-commutative presheaf structure on marked permutations, i.e. permutations with a marked element. These objects have a natural product called inflation, which is an operation motivated by factorization theorems for permutations. In this paper, we find new factorization theorems for marked permutations. We use these theorems to show that the pattern Hopf algebra for marked permutations is also free, using Lyndon words techniques.


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 A(h) from any given combinatorial presheaf h. By further considering an associative product on our objects, we can endow 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 = n≥0 H (n) is a filtered Hopf algebra with P (H) primitive space, computing the dimension of H (n) ∩ 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.

Pattern Hopf Algebras from Monoids in Presheaves
Let Set → be the category whose objects are finite sets and morphisms are injective maps between finite sets. Let also Set × be the category whose objects are finite sets and morphisms are bijective maps between finite sets. Write Set for the usual category of finite sets.
A species is a functor from Set × to 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 Set → to Set. A morphism of combinatorial presheaves is simply a natural transformation of functors. In this way, we have the category 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 res J : h[I] → h [J] for each inclusion J → I is a way that is functorial, that is if J 1 ⊆ J 2 , then res J2 • res J1 = res J1 . 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 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 ∈ h  Fix a field k with characteristic zero. Denote the family of functions A → B by F(A, B).
This definition only depends on the isomorphism classes of a and b; see Observation 3.1. Hence, we can consider {p a } a∈G(h) as a family of functions from G(h) to k, indexed by 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 that has characteristic zero.
If h is a combinatorial presheaf, then the linear span of the pattern functions is a linear subspace A(h) ⊆ F(G(h), Q) of the space of functions G(h) → Q. Theorem 1.3. The vector space A(h) is closed under pointwise multiplication and has a unit. It forms an algebra, called the pattern algebra. More precisely, if a, b ∈ G(h), where the coefficients c a,b are the number of "quasi-shuffles" of a, b that result in c, specifically, if we take c ∈ h[C] to be a representative of the equivalence class c, then: = |{(I, J) such that I ∪ J = C, c| I ∼ a, c| J ∼ b}| .
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 on the category of combinatorial presheaves, which associates to two combinatorial presheaves h and j the combinatorial presheaf The unit for this product is the unique presheaf that satisfies E[A] = ∅ for A = ∅, and E[∅] = { }. If f : h 1 ⇒ h 2 and g : j 1 ⇒ j 2 are natural transformations of presheaves, then f g is a natural transformation such that (f g) I is the natural mapping from h 1 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 h ⇒ h, and 1 ∈ h[∅] 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 G(h), which we denote by · for the sake of distinction; see Definition 3.5. With this, we introduce the following coproduct in the pattern algebra A(h): where the sum runs over coinvariants b, c such that a = b·c. The main property that motivates this operation in A(h) is that, under the natural identification of the function algebra 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 A(h), and relating 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 Δ A,B (a) = a| A × 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].

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 G ⊂ A is a generating set if the smallest subalgebra A containing G, written G , is A.
A set G ⊂ A is a (commutative) free set if for any finite collection y 1 , . . . , y k of elements in G and any non-zero polynomial in k commutative variables p = p(x 1 , . . . , x k ), the evaluation p(y 1 , . . . , y k ) is a non-zero element in A.
If an algebra A has a free generator set G, the algebra is free.
The first case that we want to explore is the one of commutative presheaves.
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.

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 ⊕-indecomposable permutations, see [5] for an introduction to combinatorics of Lyndon words.
In this paper, we explore other associative presheaves that are noncommutative. Taking the presheaf on permutations as our starting point, we wish to study monoidal structures that are more complex than the ⊕ product (see Example 2.8), but still allows us to establish the freeness property. We investigate the presheaf on marked permutations 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 A(MPat)). The pattern algebra A(MPat) is free.
To establish the freeness of A(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.

Species and Monoidal Functors
If h is a combinatorial presheaf, and if a ∈ h[I], we define the size of a as |a| := |I| and the indexing set of a as X(a) = I. Example 2.1 (The unit presheaf). The species E with only one object , 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 ≤ P · · · ≤ P a k } = {b 1 ≤ V · · · ≤ V b k }, then this defines a bijection via a i → b i in I. Conversely, for any bijection f on I, there are several pairs of orders (≤ P , ≤ V ) that correspond to the bijection f , all of which are isomorphic. If I → J, by restricting the orders on I to orders on J via the injective map →, we obtain a restriction to a permutation on J. The resulting presheaf structure is denoted by 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| × |I| grid so that the elements are placed horizontally according to the ≤ P order, and vertically according to the ≤ V order. For instance, the permutation π = {1 < P 2 < P 3, 2 < V 1 < V 3} in {1, 2, 3} can be represented as In this way, there are (n!) 2 elements in Per[n]. Up to relabeling, we can represent a permutation as a diagram with one dot in each column and row. Thus, G(Per) has n! isomorphism classes of permutations of size n, as expected.
If we consider a permutation π on a set I, that is, a pair (≤ P , ≤ V ) of total orders in I, we write X(π) = I. If f : J → I is an injective map, the preimage of each order ≤ P , ≤ V is well defined and is also a total order in J.

This defines the permutation Per[f ](π).
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 τ in π as described in [22] is precisely p τ (π), and a permutation π avoids τ in the sense describe in [11] if p τ (π) = 0.
Recall that we are given a bifunctor 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 CPSh, that is, is a combinatorial presheaf h together with natural transformations η : h h ⇒ h and ι : E ⇒ h that satisfy associativity and unit conditions. We use, for a ∈ h[I] and b ∈ h[J], the notation η I,J (a, b) = a * b. We also denote the unit by 1 : Thus, a product on a presheaf simply describes how to merge objects of a certain type h that are based on disjoint sets.
This is the case, however, when h is a connected presheaf. It follows that in an associative connected presheaf h, we have that a * b a,b ≥ 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 ⇒ j is an associative presheaf morphism if it is a presheaf morphism that satisfies f (1 h ) = 1 j and

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 Gr that can be endowed with the associative product of disjoint union of graphs . This is in fact a commutative product, so A(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 Per there corresponds a pattern algebra A(Per) as discussed above. We can further consider Per with a monoid structure via the direct sum of permutations ⊕, defined as follows: Suppose that π ∈ Per[I], τ ∈ Per[J] are two permutations based on the disjoint sets I, J, respectively. The permutation π ⊕ τ ∈ Per[I J] is the pair of total orders (≤ ⊕ P , ≤ ⊕ V ) extending both of the respective orders from π, τ to I J by forcing that i ≤ ⊕ P j and i ≤ ⊕ V j for any i ∈ I, j ∈ J. Correspondingly, the diagram of π ⊕ τ results from the ones from π, τ as follows We note that this is not a commutative presheaf: in general, π ⊕ τ is a different permutation than τ ⊕ π.
We can write a permutation in its two-line notation, as a1,...,a k b1,...,b k where a 1 ≤ V a 2 ≤ V . . . and b 1 ≤ P b 2 ≤ P · · · ≤ P b k . If we identify b 1 , . . . , b k with 1, . . . , 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 ∅. Definition 2.9 (The operation). Given two permutations, π, σ, we have already introduced the product π ⊕ σ. We now define the permutation π τ ∈ Per[I J] as the pair of total orders (≤ P , ≤ V ) extending the respective ones from π, τ to I J by forcing that i ≤ P j and i ≥ V j for any i ∈ I, j ∈ J. Correspondingly, the diagram of π τ results from the ones from π, τ as It is a routine observation to check that both ⊕, are associative products on Per, and that ∅ 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 π * on I is a pair of orders (≤ P , ≤ V ) on the set I { * }. Intuitively, this gives us a rearrangement of the elements of I { * }, 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 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 π * = (1 < P 2 < P * , 2 < V 1 < V * ), τ * = ( * < P 1 < P 2, 1 < V * < V 2), and σ * = ( * < P 2 < P 1, 2 < V * < V 1). Observe that there is no isomorphism between π * and τ * , whereas there is one between τ * and σ * , via the relabeling 1 → 2, 2 → 1.
In this way, there are ((n+1)!) 2 elements in 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, G(MPer) has (n + 1) × (n + 1)! isomorphism classes of marked permutations of size n.

Definition 2.11 (Marked permutations).
If we consider a marked permutation π * on a set I, that is, a pair (≤ P , ≤ V ) of total orders in I * , we write X(π * ) = I. If f : J → I is an injective map, this can be extended canonically to an injective map f * : J * → I * . Thus, the preimage of each order ≤ P , ≤ V under f * is well defined and is also a total order in J * . This defines the marked permutation Note that a relabeling of the permutation π * 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.
, a marked permutation on {1, 2, 4}, its representation with the one line notation is 1423.

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 S ⊆ G(h) be a collection of objects in a presheaf h. Then the set {p s |s ∈ S} is a set of free generators of A(h) if the set s∈S p s S multiset of elements of S , is a basis of A(h). This is usually established by connecting this set with the set {p a |a ∈ G(h)}, which is known to be a basis by Remark 3.2. This connection is done with the following ingredients: • An order in G(h).
• A bijection f between {S multiset of elements of S} and 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 S, with non-negative coefficients c t,s such that c f (S),S = 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 S is more technical.
Conjecture 2.15. The pattern Hopf algebra of any associative presheaf is free.

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, A(h) is an algebra; see Theorem 1.3. Moreover, if h is connected and endowed with an associative structure, then A(h) is a Hopf algebra; see Theorem 1.4. We also describe the space of primitive elements in A(h), clarify that 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.

Coinvariants and Pattern Algebras
Given a combinatorial presheaf h, let [n] = {1, . . . , n} for n non-negative integer. Then, recall that we define the coinvariants of h as the family For an object a ∈ 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.
This allows us to define the pattern functions p a for a ∈ G(h) as function in F(G(h), k).
Recall that we write for the linear space spanned by all pattern functions. For a, b objects and c ∈ h[C], we defined the quasi-shuffle number as follows: And a quasi-shuffle as a pair that contributes to the coefficient above. This is invariant under the equivalence classes of ∼, as it can be show in a similar way to Observation 3.1. In Theorem 1.3 we observe that A(h) is a subalgebra of F(G(h), k) with the pointwise multiplication structure and unit c∈h[∅] p c . We present now the proof.
Hence, the space A(h) is closed for the product of functions. Further, it is easy to observe that a∈h[∅] p a is the constant function equal to one, so this is a unit and A(h) is an algebra, concluding the proof.

Corollary 3.3 (Products and quasi-shuffles). Let c ∈ h[I] and b
Then we have that

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 ∈ h[∅]. Definition 3.5 (Product structure in G(h)). If (h, * , 1) is an associative presheaf, then G(h) inherits an associative product. If a is an object, we denote its equivalence class under ∼ byā in this remark. The associative product in G(h) is defined as follows: It is a direct computation to see that a * b does not depend on the representative chosen for a and b. Thus we have a well defined operation in G(h).
Recall that in Eq. (2), we defined the coproduct in A(h) as We also introduce the counit : A(h) → k that sends p a to [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 A(h) instead of 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 Δ is trivially coassociative, from the associativity axioms of * described in Observation 2.4. That is a counit follows from the unit axioms on (h, * , 1).
We first claim that, for a, x, y ∈ G(h), Indeed, take representatives x ∈ h[n 1 ] and y ∈ h[n 2 ] with no loss of generality, and write B = [n 1 ], C = {n 1 + 1, . . . , n 1 + n 2 }. Let st be the order preserving map between C and [n 2 ]. Then Since both functions take the same values on G(h) 2 , we conclude that (9) holds.
The following are the bialgebra axioms that we wish to establish: The last three equations are direct computations. For the first equation, we use (9) as follows: take a, b, x, y ∈ G(h), then This concludes the first part of the proof. Now suppose that h is connected, so that the zero degree component A(h) 0 is one dimensional. From [19], because A(h) is commutative, it suffices to establish that the group-like elements of A(h) are invertible. Now it is a direct observation that any group-like element is in A(h) 0 , which is a one dimensional algebra, so all non-zero elements are invertible. This concludes that A(h) is a Hopf algebra.

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 ∈ H| Δa = a ⊗ 1 + 1 ⊗ a} the space of primitive elements, where 1 stands for the unit of the Hopf algebra.
The notion of irreducibility lifts to G(h). That is, Proposition 3.7 (Primitive space of pattern Hopf algebras). Let (h, * , 1 h ) be a connected associative presheaf, and I(h) the set of irreducible elements in G(h). Then the primitive space is given by: Thus we conclude that a is a linear combination of the set p f |f ∈ I(h) , as desired.

The Pattern Algebra Functor
In this section, we see that the mapping 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 ⇒ j is a morphism of combinatorial presheaves, then the following formula
defines an algebra map The sum in (11) is finite, so this functor is well defined.

Proof. The map A[f ] is linear and sends the unit a∈j
Hence, to establish that A[f ] is an algebra morphism, it suffices to show that it preserves the product on the basis, It is easy to see that this holds if we have that , then for any set I, by naturality Now suppose further that f is an associative presheaf morphism between (h, * h , 1 h ) and (j, This functor when restricted to the subcategory of associative presheaves is also a functor to bialgebras as A : Example 3.10 (Graph patterns in permutations). Consider again the associative presheaves (Gr, ⊕, ∅) on graphs and (Per, ⊕, ∅) on permutations. The inversion graph of a permutation is a presheaf morphism Inv : Per ⇒ Gr defined as follows: given a permutation π = (≤ P , ≤ V ) on the set I, we take the graph Inv(π) with vertex set I and an edge between It is a direct observation that this map is indeed an associative presheaf morphism. As a consequence, we have a Hopf algebra morphism A(Inv) : A(Gr) → A(Per).

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 : span G(h) → span G(h) given on the basis elements a ∈ G(h) by
and extended linearly to span G(h). Then the maps M, N 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]. Observe that this is a bijective correspondence, so we have

Proof. We start by proving a relation on pattern functions. Let a ∈ h[I], c ∈ G(h). Then we claim that
It follows that as desired.

The Sweedler Dual and Pattern Algebras
Let A be an algebra over a field K. Then the Sweedler dual A • is defined in [18] as where a cofinite ideal J of A is an ideal such that A/J is a finite dimensional vector space over K. There, it is established that A • 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 ∈ A * and a, b ∈ A, A description of A • is given in [18, Proposition 6.0.3], as all representable elements f ∈ A * , that is all f such that the vector space {f · b} b∈A is finite dimensional.
Let (h, * , 1) now be an associative presheaf, and consider the algebra generated by · in G(h): Then A(h) ⊆ Alg(h) * = F(G(h), k). In fact, the following proposition guarantees that we have A(h) ⊆ Alg(h) • . Observe that the coproduct in A(h) is precisely the transpose of the multiplication in span(G(h), ·), therefore A(h) ⊆ Alg(h) • 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
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 ∈ G(h): which is finite dimensional.

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

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 ∈ h   Set composition and set partition). Let I be a finite set. A set composition of I is a list (B 1 , . . . B k ), that can also be written as B 1 | . . . |B k , of pairwise disjoint nonempty subsets of I, such that I = i B i . We denote by Π I the family of set compositions of I. A set partition of I is a family π = {I 1 , . . . , I k } of pairwise disjoint nonempty sets, such that i I i = I. We write Σ I for the family of set partitions of I.
If π ∈ Π 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 λ( π).

Definition 4.2 (Factorization of objects and coinvariants). Consider an associative presheaf h that is connected, and an object o ∈ h[I].
A factorization of o is a word (x 1 , . . . , x k ) of objects such that x 1 * · · · * x k = o.
A factorization (x 1 , . . . , x k ) of o is a factorization into irreducibles when each x i is an irreducible object for i = 1, . . . , l.
A factorization of a coinvariant a ∈ G(h) is a decomposition of the form a = s 1 · · · 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 ( there is a corresponding set composition π = (I 1 , . . . , . 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, 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.
where π 1 = A 1 | . . . |A k and π 2 = B 1 | . . . |B s are set compositions of X such that l i = o| Ai and r i = o| Bi . Note that Because l j is irreducible, for each j there is exactly one i such that B i ∩ A j = ∅, so A j ⊆ B i , and τ ( π 1 ) is coarser than τ ( π 2 ). By a symmetrical argument, we obtain that τ ( π 1 ) is finer than τ ( π 2 ), so we conclude that τ ( π 1 ) = τ ( π 2 ). It follows that the number of factors and the multiset of factors are well defined.
This implies the following for factorizations on G(h):  The fibers of this map, that is, the sets of words Π −1 (a), correspond to the different factorizations of an object a ∈ 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 W(I(h)).
Take the example of the combinatorial presheaf 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 Π −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 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 E(h). In this way, for instance, we can immediately see that the pattern Hopf algebra A(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.

Proof of Freeness on Commutative Presheaves
Recall that a commutative presheaf is an associative presheaf (h, * , 1) such that * A,B = * B,A • 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.  Proof. We will show that the family is a basis for A(h). The proof follows the strategy described in Sect. 2.3, by building an order ≤ in G(h) that is motivated in the unique factorization theorem in Theorem 4.3. Define the following partial strict order < p in G(h): we say that α < p β if: • |α| < |β|, or • |α| = |β| and j(α) < j(β).
In this way, ≤ p is the order that we use to establish freeness. Consider α ∈ G(h) with α = ι 1 · · · ι j(α) its unique factorization into irreducibles. Then we claim where c a ≥ 1. This implies that (14) is a basis of A(h), and gives us the result. Let us prove (15). Pick representatives l i for ι i such that l i ∈ h[A i ] and let also a = l 1 * · · · * l j(α) be an object. Observe that the coinvariant of a is α.
To show that any term β in (15) with c β = 0 has β ≤ p α, consider the maximal β ∈ G(h) that is a quasi-shuffle of l 1 , . . . , l j(α) , and let b be a representative in β, such that b ∈ h[Y ]. By maximality, we have that β ≥ α. Our goal is to show that b ∼ a. Let b = s 1 * · · · * s j(b) be the unique factorization of b into irreducibles, corresponding to the set partition {C 1 , . . . , C j(b) }. Because b is a quasi-shuffle of l 1 , . . . , l j(α) , we can consider B 1 , . . . , B j(α) ⊆ Y sets such that i B i = Y and b| Bi ∼ l i for i = 1, . . . , j(α).
In particular, we have that By indecomposability of l i , we have that, for each i, there is exactly one First observe that |a| = i |A i | = i |l i | = i |B i | and |b| = j |C j | but |b| = |Y | ≤ j i∈f −1 (j) |B i | = |a|. However, from b ≥ p a we have that |b| ≥ |a| and thus we have |b| = |a| and that the family {B 1 , . . . , B j(α) } is disjoint. Further, f is a surjection, so we immediately have that j(α) ≥ j(b) and because b ≥ 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, . . . , j(α) = j(b). G 1 G 2 Figure 1. A marked graph G 1 with three ∨-connected components and a ∨-connected graph G 2 We then conclude that and so, by commutativity, as desired.   10. The graphs that are irreducible with respect to the ∨ 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 ∨-connected.

Marked Graphs
In Fig. 1 we have an example of a ∨ -connected marked graph and a ∨-disconnected marked graph. Observe that G * 1 ∨ I,J G * 2 = G * 2 ∨ J,I G * 1 , so ∨ is a commutative operation, whereas is not. It follows from Theorem 4.8 that both A(MGr, ∨, 1) and A(MGr, , 1) are free algebras (their product structure is the same). This is something that cannot be shown directly in A (MGr, , 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 Π described in Problem 4.5 are non-trivial, as an example of a non-trivial relation can be seen in Fig. 3

Set Partitions
We define here associative presheaves on set partitions SPart and set compositions SComp, and show that Sym, the Hopf algebra of symmetric functions, is the pattern Hopf algebra on set partitions. The functoriality of A also gives us a Hopf algebra morphism Sym → A(SComp).  Proof. As ζ sends a free basis to a free basis, it is an isomorphism of algebras. Furthermore, we observe that both 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 A(SPart) to the one of Sym. Thus, this is a Hopf algebra isomorphism. We further endow SComp with an associative structure as follows: if π = (I 1 , . . . , I q ), τ = (J 1 , . . . , J p ) are set partitions of the disjoint sets I, J, respectively, let π τ = (I 1 , . . . , I q , J 1 , . . . , J p ) be a set composition of I J.
It is straightforward to observe that (SComp, , ∅) is an associative connected presheaf. Further, we can also observe that the map λ : SComp ⇒ SPart is an associative presheaf morphism.
From the map λ : SComp ⇒ SPart we get a Hopf algebra morphism

A(λ) : Sym → A(SComp).
Observe that A(SComp) is a free algebra, because it has a unique factorization theorem of the same type of permutations under the ⊕ 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.

Hopf Algebra Structure on Marked Permutations
In this section, we consider the algebra structure of A(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 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 A(MPerm) is freely generated by
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 G(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.

Unique Factorizations
We work on the combinatorial presheaf of permutations (Per, ⊕, ∅) and on the combinatorial presheaf of marked permutations (MPer, ,1), introduced in Example 2.2 and Definition 2.11. Definition 5.2 (Decomposability on the operations ⊕ and ). We say that a permutation is ⊕-indecomposable if it has no non-trivial decomposition of the form τ 1 ⊕ τ 2 , and ⊕-decomposable otherwise. We say that a marked permutation is ⊕-indecomposable if it has no decomposition of the form τ ⊕π * or π * ⊕τ , where π * is a marked permutation and τ is a non-trivial permutation, and ⊕decomposable otherwise. Similar definitions hold for . A permutation (resp. a marked permutation) is indecomposable if it is both ⊕ and -indecomposable, and is decomposable otherwise.
We remark that a permutation is ⊕-indecomposable whenever it is irreducible on the associative presheaf (Per, ⊕, ∅) according to Definition 3.6. For marked permutations, Definition 3.6 specializes to the definition of irreducible marked permutations as follows:
These decomposable irreducible marked permutations play an important role in the description of a free basis of A(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.
We wish to establish in Theorem 5.8 that these generate all the inflation relations between irreducible marked permutations.
We define the alphabet Ω := {irreducible marked permutations}, and consider the set W(Ω) of words on Ω. 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 · w 2 ). When w ∈ W(Ω), we write w * for the consecutive inflation of its letters. So for instance (12,21) * =12 2 1 =213. We use the convention that the inflation of the empty word on Ω is1. This defines the star map, a morphism of monoids : W(Ω) → G(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 W(Ω)). We now define an equivalence relation on W(Ω). For a word w ∈ W(Ω)
. We further take the transitive and reflexive closure to obtain an equivalence relation on W(Ω).
We trivially have that if w 1 ∼ w 2 and z 1 ∼ z 2 , then w 1 · z 1 ∼ w 2 · z 2 . This means that the set of equivalence classes W(Ω) ∼ is a monoid. Further, because of Remark 5.6, the star map factors to a monoid morphism W(Ω) ∼ → G(MPer).
Theorem 5.8. The star map : w → w * defines an isomorphism from W(Ω)/ ∼ 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 π * into irreducible marked permutations are related by ∼. 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 α * a marked permutation, together with factorizations As we did in Sect. 4, we define j(α * ) to be the number of irreducible factors in any factorization of α * into irreducible factors, and define fac(α * ) as the multiset of irreducible factors of α * in G(MPer). These are well defined as a consequence of Corollary 5.9.

Definition 5.10 (Stability conditions).
A factorization of a marked permutation α * into irreducible marked permutations, Such a factorization or word is ⊕-stable (resp. -stable) if it is i-⊕-stable (resp. i--stable ) for any i = 1, . . . , j − 1. Finally, such a factorization or word is stable if it is both ⊕-stable and -stable.
Remark 5.11 (Stability reduction). If we are given a factorization of α * = ξ * 1 · · · ξ * j that is not i-⊕-stable or i--stable for some i = 1, . . . , j −1, we can perform an i-reduction, that maps (ξ * 1 , . . . , 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 W(Ω) ∼ admits a unique stable word, and a consequence of Theorem 5.8 is the following. Corollary 5.12 (Unique stable factorization). Let α * be a marked permutation. Then, α * has a unique stable factorization into irreducible marked permutations. We refer to it as the stable factorization of α * .

Lyndon Factorization on Marked Permutation
We introduce an order on permutations, two orders on marked permutations and an order in W(Ω).

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 π ≤ per τ .
Recall that, for a marked permutation α * = (≤ P , ≤ V ) in I, we define its rank rk(α * ) as the rank of * in I { * } with respect to the order ≤ P . We also write α for referring to the corresponding permutation in the set I { * }. We define the lexicographic order on marked permutations, also denoted ≤ per , as follows: we say that π * ≤ per τ * if π < per τ or if π = τ and rk(π * ) ≤ rk(τ * ).
This in particular endows our alphabet Ω of irreducible marked permutations with an order. When we compare words on W(Ω) we order them lexicographically according to ≤ per , and denote it simply as ≤.
Sometimes the orders ≤ per and ≤ fac on marked permutations do not agree, as exemplified in Fig. 5.
Thus, from Theorem 5.8 and Remark 5.11, for a fixed marked permutation α * , among all words w on irreducible marked permutations such that w * = α * , 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 A(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 ∈ W(A) is a Lyndon word if, for any concatenation factorization l = a 1 · a 2 into non-empty words, we have that a 2 ≥ l.

Example 5.18 (Examples of Lyndon words). Consider the (usual) alphabet
then (12,132,12,2413) is a Lyndon word in this alphabet. Meanwhile, (1,1) is not a Lyndon word. Lyndon marked permutations). A word on irreducible marked permutations w = (ξ * 1 , . . . , ξ * j ) ∈ W(Ω) is called stable Lyndon, or SL for short, if it is a Lyndon word and satisfies the stability conditions introduced in Definition 5.10.

Definition 5.19 (Stable
A marked permutation π * is called stable Lyndon, or SL for short, if there exists an SL word l = (ξ * 1 , . . . , ξ * j ) such that l * = π * . We write 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 L SL is precisely the set that indexes a free basis of A(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 , . . . , l k such that l 1 ≥ · · · ≥ l k for the lexicographical order in 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 A(MPer).
We refer to such a sequence of words as the SL factorization of α * .
We define k(α * ) to be the number of factors in the stable Lyndon factorization of α * . Note that for any marked permutation α * , k(α * ) ≤ j(α * ) where we recall that j(α * ) is the number of irreducible factors in a factorization of α * into irreducible marked permutations.
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.
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].

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.
Furthermore, if for each i = 1, . . . , k, is the stable factorization of ι * i , then there is a marked permutation γ * with a factorization into irreducibles given by These lemmas will be proven below, in Sect. 5.5. We remark that, here, the chosen ordering ≤ per on the irreducible marked permutations plays a role. That is, in proving that γ * ≥ fac β * we use properties of the order ≤ per introduced above, like Remark 5.16. This is unlike the work in [20], where any order in the ⊕-indecomposable permutations gives rise to a set of free generators. Lemma 5.27 (Factor preserving lemma). Let γ * be a marked permutation with a factorization into irreducibles given by γ * = τ * 1 · · · τ * j(γ * ) , and let l 1 , . . . , l k be SL words, such that • l i ≥ l i+1 for each i = 1, . . . , k − 1 and; • The word (τ * 1 , . . . , τ * j(γ * ) ) is a word shuffle of the words {l i } i=1,...,k . Then, γ * ≤ fac l * 1 · · · 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 Unique Factorization Theorem
We start this section with the concept of DC intervals and DC chains of a marked permutation α * . We will see that these are closely related to factorizations of α * , and we will exploit this correspondence to prove Theorem 5.8.
Recall that if β * is a marked permutation in X, and I ⊆ X, we denote I * := I { * } for simplicity of notation. We also write X(β * ) = X.
Definition 5.28. Let β * be a marked permutation on the set X, i.e. β * = (≤ P , ≤ V ) is a pair of orders on the set X * . A doubly connected interval on β * , or a DC interval for short, is a set I ⊆ X such that I * is an interval on both orders ≤ P , ≤ V . A proper DC interval is a DC interval I such that I = X.
Note that X and ∅ are always DC intervals. Note as well that if I 1 , I 2 are DC intervals, then I 1 ∪ I 2 is also a DC interval. Remark 5.29. Suppose that β * = (≤ P , ≤ V ) is a marked permutation, and I is a DC interval of β * . Consider m P , M P ∈ X * the minimal, respectively maximal, element for the order ≤ P . If m P , M P ∈ I * , then I = X.
Symmetrically, if m V , M V ∈ X * are the minimal, respectively maximal, elements for the order ≤ V , and m V , M V ∈ I * , then I = X.
For a marked permutation β * , 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 α * = (≤ P , ≤ V ), we define the permutation α * \ I * in the set I c resulting from the restriction of the orders ≤ P , ≤ V to the set I c . Alternatively, this is the permutation resulting from the removal of the marked element in α * | I c .
Remark 5.31. If α * = a * 1 a * 2 , then X(a * 2 ) is a DC interval in α * . On the other hand, if I is a DC interval of α * , then α * = α * | I c α * | I , so right factors of α * are in bijection with DC intervals of α * . Furthermore, I is a maximal proper DC interval of α * if and only if α * | I c is irreducible.
Similarly, α * is -decomposable if and only if there is a DC interval I of α * such that I * contains both M P , m V , or contains both m P , M V .
Proof. Let us deal with the case where both u > 0 and v > 0 first. Assume that neither σ * =1 ⊕ λ 1 nor σ * = 1 ⊕1. Consider the following DC intervals, which are all distinct Note that m P ∈ Y * 2 \ Y * 1 and M P ∈ Y * 1 \ Y * 2 by construction. Note also that α * | Y c 1 = 1 ⊕1 and α * | Y c 2 =1⊕λ 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 From Y ∪ Y 1 = X and m P ∈ Y * 1 , we have that m P ∈ Y * , and from Y ∪ Y 2 = X and M P ∈ Y * 2 we get that M P ∈ 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 σ * =1 ⊕ λ 1 nor σ * = 1 ⊕1, as desired.
These regions are empty because T is a DC interval Figure 6. A decomposition of β * , whenever the DC interval Y is proper Now suppose that u = 0, and v > 0. Assume for the sake of contradiction that σ * =1 ⊕ λ 1 , and define the following distinct DC intervals Y 2 = X(β * ⊕ λ v ⊕ · · · ⊕ λ 2 ) and Y = X(γ * ).
Because both σ * and1 ⊕ λ 1 are irreducible, the DC intervals Y 2 , Y are both maximal proper, so X = Y ∪ Y 2 . Further, m P ∈ Y * 2 by construction, so M P ∈ Y * by Remark 5.29. Consider the DC interval I = X(β * ), and notice that m P ∈ I * by construction. Thus we have that I * ∪ Y * = X * , and Y c ⊆ I.
We have the following decomposition, depicted in Fig. 6: Notice that α * \ Y * is not the empty permutation, because Y is a proper DC interval. This is a contradiction with the fact that β * is ⊕-indecomposable, so σ * =1 ⊕ λ 1 . The case where u > 0 and v = 0 is done in a similar way, so the result follows.
We have that Without loss of generality suppose that m P ∈ Y * 1 . We know that {m V , M V } ⊆ Y * 2 , so there are only two cases to consider: • We have that m P , m V ∈ Y * 1 . Then α * is ⊕-decomposable, according to Remark 5.32.
Proof of Theorem 5.8. Consider a marked permutation α * , and take words w 1 = (ξ * 1 , . . . , ξ * k ) and and assume for the sake of contradiction that these can be chosen with w 1 ∼ w 2 . Further choose such words minimizing k + j = |w 1 | + |w 2 |. We need only to consider four cases: The marked permutation α * =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 α * is -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.
Since β * is a quasi-shuffle of ι * 1 , . . . , ι * k , the sets I 1 , . . . , I k cover X and so so we conclude that |β * | ≤ |α * |. Now, assume that we have |β * | = |α * |, so we have equality in (23), thus the sets I i are mutually disjoint. Recall that j(α * ) = i j(ι * i ), as shown in Corollary 5.9. Therefore, we only need to establish that i j(ι * i ) ≥ j. For each i = 1, . . . , k, the following is a DC interval chain of ι * i , which is not necessarily a maximal one: so let us consider the set First it is clear that each U p is non empty, as otherwise we would have 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 ∈ [j]|i ∈ U p }|. From Corollary 5.9 and Remark 5.31, this is at most j(β * | Ii ) = j(ι * i ), so So we conclude that j(α * ) ≥ j(β * ).
Proof of Lemma 5.26. Assume now that |β * | = |α * | and j(β * ) = j(α * ). 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(γ * )] into k many disjoint increasing sequences q is precisely the stable factorization of each ι * i . Define the map ζ : [j] → [k] that sends p to the unique element in U p . This map will give us the desired increasing sequences. It satisfies |ζ −1 (i)| = |{p ∈ [j]|i ∈ U p }| = j(ι * i ) for i = 1, . . . , k.
is precisely the stable factorization of ι * i . Thus, we need only to establish that β * ≤ fac γ * .
In the following proof, we will start by showing that the given factorization of γ * can be assumed to be the stable factorization. Then, we use Theorem 5.20 and the fact that the factorization of γ * is a shuffle of Lyndon words to establish the desired inequality.
Proof of Lemma 5.27. Write j = j(γ * ). We first see that if γ * has some factorization that is a word shuffle of stable words l 1 , . . . , l k , then the stable factorization is also a word shuffle of these words.
Indeed, take a factorization τ * 1 · · · τ * j such that (τ * 1 , . . . , τ * j ) is a word quasi-shuffle of l 1 , . . . , l k , and say that there is some u ∈ {1, . . . , j − 1} such that this factorization is not u-⊕-stable or is not u--stable. According to Remark 5.11, to show that the stable factorization is also a word shuffle of l 1 , . . . , l k , it suffices to show that the word resulting from swapping τ * u and τ * u+1 in (τ * 1 , . . . , τ * j ) is still a word quasi-shuffle of l 1 , . . . , 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  ) 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 , . . . , l k . Now let ρ * 1 · · · ρ * j be the stable factorization of γ * . Since (ρ * 1 , . . . , ρ * j ) is a word shuffle of l 1 , . . . , l k , which are Lyndon words in W(Ω), we have from Theorem 5.23 that (ρ * 1 , . . . , ρ * j ) ≤ l 1 · · · l k , and so γ * ≤ fac l * 1 · · · l * k .

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 ∈ H|Δa = a ⊗ 1 + 1 ⊗ a}. In the particular case of the pattern Hopf algebra A(MPer), its primitive space is spanned by {p π * |π * is irreducible marked permutation}, 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) = π * marked permutation x |π * | = n≥1 n · n! x n−1 counts marked permutations. • The power series P (x) = π permutation x |π| = n≥0 n! x n counts permutations. • The power series S * (x) = k≥0 s k x k = π * irreducible marked permutation x |π * | counts irreducible marked permutations. This is the main generating function that we aim to enumerate here. • The power series S * o (x) = k≥0 so k x k = π * irreducible and indecomposable marked permutation x |π * | counts irreducible marked permutations that are indecomposable, that is neither ⊕-decomposable nor -decomposable. • The power series P ⊕ (x) = π is ⊕− decomposable x |π| counts permutations that are ⊕-indecomposable. This also counts the permutations that are -indecomposable. Because we have a unique factorization theorem on permutations under the ⊕ product, the coefficients of P ⊕ (x) can be easily extracted via the following power series relation 1 1 − P ⊕ (x) = P (x) = n≥0 n!x n , which implies P ⊕ (x) = 1 − P (x) −1 .
Observation 5.38. Any ⊕-decomposable irreducible marked permutation is either of the form1⊕π or of the form π ⊕1 for π an ⊕-indecomposable permutation, and symmetrically for -decomposable irreducible marked permutations. Thus, we have The following proposition allows us to enumerate easily the irreducible marked permutations and the irreducible indecomposable marked permutations, as done in Table 1. We compare this result with the enumeration of simple permutations in [1,Equation 1], where the power series enumerating simple permutations is Table 1. given as the solution of a functional equation that is not rational. Thus, we expect it to be simpler to compute the coefficients explicitly. Lemma 5.40. Let π * be a marked permutation. Then, there are four cases • There are unique marked permutations σ * and α * such that σ * is indecomposable and irreducible, and π * = σ * * α * . • The marked permutation π * is ⊕-decomposable.
Proof. If π * is indecomposable, then, either π * =1, or there are unique marked permutations σ * and α * such that σ * is indecomposable and irreducible, and π * = σ * * α * , according to Lemma 5.37. This concludes the first part of the lemma. Further, we observe that (P (x) − P ⊕ (x)) counts the marked permutations that are ⊕-decomposable (and by symmetry, the ones that are -decomposable).
Proof of Proposition 5.39. From (30) along with the fact that P * (x) = P (x), we have that

Acknowledgements
The author is thankful for the support of the SNF grant number 200020-172515. The author is also grateful for conversations with Yannic Vargas about pattern Hopf algebras and his insightful comments, and to the anonymous referees. He is also thankful for conversations with Valentin Féray, and the great guidance throughout the process of development of this paper.

Funding Information Open access funding provided by University of Zurich
Open Access. This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article's Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article's Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creativecommons. org/licenses/by/4.0/.
Publisher's Note Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.