Permutations avoiding bipartite partially ordered patterns have a regular insertion encoding

We prove that any class of permutations defined by avoiding a partially ordered pattern (POP) with height at most two has a regular insertion encoding and thus has a rational generating function. Then, we use Combinatorial Exploration to find combinatorial specifications and generating functions for hundreds of other permutation classes defined by avoiding a size 5 POP, allowing us to resolve several conjectures of Gao and Kitaev and of Chen and Lin.


Introduction
A permutation of size n is a linear ordering of the elements {1, . . ., n}.When we want to refer to individual entries in a permutation π of size n, we write π = π(1)π(2) • • • π(n).We say that a permutation π of size n contains a permutation σ of size k ≤ n if π contains a (not necessarily consecutive) subword π(i 1 )π(i 2 ) (m); in other words, this subword is order-isomorphic to σ.In this context, we often refer to σ as a pattern.For example, the permutation 3714652 of size 7 contains the pattern 132 because the subword π(3)π( 6)π(7) = 152 is order-isomorphic to 132.There are eight other occurrences of 132 in π as well.On the other hand, π avoids (i.e., does not contain) the pattern 3124.
This containment relation on permutations defines an infinite poset on the set of all permutations of all sizes.Sets of permutations that are downward closed in this poset are called permutation classes.Each permutation class can be uniquely described by the (possibly infinite) minimal set of permutations that it does not contain, called its basis.We use the notation Av(B) to denote the class with basis B. Permutation classes have been extensively studied; we refer the interested reader to 1 Kitaev's book on the subject [Kit11] and Vatter's comprehensive survey [Vat15].
A partially ordered pattern (POP) of size k is a poset on k elements labeled with the symbols {1, . . ., k}.We say that a permutation π of size n contains a POP P of size k if π contains a (not necessarily consecutive) subword π(i 1 )π(i 2 ) Compare this to the definition of pattern avoidance above; for two elements ℓ and m that are incomparable in P, there is no restriction on the relative order of the values π(i ℓ ) and π(i m ) in an occurrence of the pattern P in π.
If σ is a permutation that contains a POP P and π is a permutation that contains σ, then π also contains P.This implies that the set of permutations that avoid a given POP is downward closed in the permutation containment order and therefore is a permutation class.We use the notation Av(P) to denote the class of permutations avoiding the POP P. It will always be clear in context whether we are using this Av(P) notation or the earlier Av(B) notation for the permutations avoiding the basis B.
It turns out that it is easy to compute the basis of Av(P), as Gao and Kitaev [GK19] implicitly observe.A linear extension of a poset is a total order on its elements that obeys the relations of the poset.
Theorem 1.1.For a POP P, the basis of the permutation class Av(P) is the set of permutations that are the (group-theoretic) inverse of a linear extension of P.
Before proving Theorem 1.1, we present an example demonstrating why inverses of permutations need to be considered.Let P = 2 3 1 4 .As P is already a total order, its only linear extension is itself.
Proof.Let P be a POP and let {L 1 , L 2 , . . ., L N } be the set of linear extensions of P. We first claim that a permutation avoids P if and only if it avoids each L i .To see this, first assume that the permutation π contains an occurrence of P at the subword Therefore T is a linear extension of P. Conversely, assume π contains some linear extension T of P.An occurrence of T in π is also an occurrence of P because the relations of P are a subset of the relations of T. This completes our first claim, and we can now conclude that the set of permutations avoiding P is equal to the set of permutations that avoid all linear extensions of P.
For a total order L = ℓ 1 < ℓ 2 < • • • < ℓ k , we define perm(L) to be the permutation (ℓ We now claim that π contains the total order T = τ(1) < τ(2) < • • • < τ(k) if and only if π contains the pattern perm(T).To this end, assume ).Let σ denote the pattern contained in π at these same indices.Since the smallest entry of this occurrence is π(i τ( 1) Of the entries in the subword, the one with the smallest value is π(i σ −1 (1) ), while the next smallest value is π(i σ −1 (2) ) and so on.Therefore, and therefore the subword is an occurrence of the total order σ −1 (1) From the two preceding claims, it follows that permutations avoiding P are precisely those avoiding the inverse of all linear extensions of P, and therefore the basis of Av(P) is {perm(L 1 ), perm(L 2 ), We call a permutation class C a POP class if C = Av(P) for some POP P.Not all permutation classes are POP classes, e.g., there is no poset P such that Av(P) = Av(1234Av( , 1432)).Theorem 1.1 gives an easy test for whether a class is a POP class.Given any permutation class Av(B), form the total orders labeled by the inverses of the permutations in B. Let P be the intersection of these total orders (i.e., the intersection of the sets of relations each implies).If Av(B) is a POP class, then P must be its associated poset, and so Theorem 1.1 can be used to check whether the basis of Av(P) is B. The Sage [The23] script in the Github repository https://github.com/jaypantone/bipartite-popscan be used to check if a permutation class is a POP class.
The number of permutation classes avoiding a subset of patterns of size n is, of course, 2 n! , but the number of POP classes of size n is given by the sequence 1, 1, 3, 19, 219, 4231, 130023, . . .(starting with n = 0), which is A001035 in the OEIS [Slo].Section 3 explores the topic of the number of POP classes taking certain symmetries into account.
In 2005, Kitaev [Kit05] introduced the notion of partially ordered patterns (POPs) as a way of studying generalized permutations and other objects.Later, in 2019, Gao and Kitaev [GK19] studied the version of POP classes that we defined above, in particular determining the enumeration of several infinite families of POP classes and many specific POP classes whose posets have size 4.They included several tables of conjectural links between POP classes whose posets have size 4 or 5 and other combinatorial objects.Several of these conjectures were later proved by Yap, Wehlau, and Zaguia [YWZ21].Recently, Kitaev and Pyatkin [KP23], among other things, enumerated many POP classes whose poset has height (length of the longest chain) at most 2. They call such posets bipartite and so we will use the same terminology, but this should not be confused with the notion of a bipartite graph.Every bipartite poset has a Hasse diagram whose graph is bipartite, but not every poset with a bipartite Hasse graph has height at most 2.
In Section 2, we show that the generating function of any POP class whose poset is bipartite can be algorithmically computed using techniques from the field of permutation patterns, proving the following theorem.
Figure 1: The four vertical juxtapositions used to characterize permutation classes with a regular insertion encoding.
and compute generating functions for all POP classes of size 4 and many non-bipartite POP classes whose posets have size 5. Section 5 addresses six conjectures of Gao and Kitaev [GK19].Within Subsection 5.4, we prove a conjecture of Chen and Lin [CL24] regarding the enumeration of nine permutation classes.

Bipartite POP Classes Have Regular Insertion Encodings
The insertion encoding, introduced by Albert, Linton, and Ruškuc [ALR05], is a language-theoretic approach that describes how a permutation is built by repeatedly adding a new maximum element.When this language is regular, Vatter [Vat12] gave an algorithm for computing the rational generating function.A simple test determines whether a permutation class has a regular insertion encoding.In order to describe the test, we need the following definition.
The vertical juxtaposition of two classes C and D is the set of permutations for which there is some value i such that the entries strictly below i form a permutation in C and the entries above and including i form a permutation in D. For example, Figure 1 shows the four juxtapositions relevant to this work.The vertical juxtaposition J 1 contains the set of permutations consisting of an increasing sequence on top of an increasing sequence.The juxtaposition of two permutation classes is a permutation class, and Atkinson [Atk99] gave a method for computing its basis.This method shows J 1 = Av(321, 2143Av(321, , 2413)), J 2 = Av(123,3142,3412), J 3 = Av(132, 312), and J 4 = Av(213,231).
Theorem 2.1 ([ALR05, Proposition 13]).A class C = Av(B) has a regular insertion encoding if and only if each of the four permutation classes J 1 , J 2 , J 3 , and J 4 contains at least one basis element In other words, the class C = Av(B) has a regular insertion encoding if among the elements of B, at least one is the juxtaposition of two increasing sequences, at least one is the juxtaposition of two decreasing sequences, at least one is the juxtaposition of an increasing sequence on top of a decreasing sequence, and at least one is the juxtaposition of a decreasing sequence on top of an increasing sequence.
We prove Theorem 1.2 in two parts.
Theorem 2.2.If a POP class has a regular insertion encoding, its associated poset is bipartite.
Proof.Suppose C = Av(B) is a POP class associated with a non-bipartite poset P, implying that P contains a chain with three elements, a < b < c.Thus, for every element β ∈ B, we must have β(a) < β(b) < β(c).This implies that the subword at indices a, b, and c of each basis element is an occurrence of the same pattern.
As there exists some size three permutation that is contained in every β ∈ B, and as all six size 3 permutations appear in one of the bases of J 1 , J 2 , J 3 , and J 4 , it must be the case that one of these four classes contains no element of B. Therefore C does not have a regular insertion encoding.
For example, the class associated with the poset 3 1 2 4 5 has a basis containing the six permutations of size 5 that have the value 1 at index 3, have the value 2 at index 1, and the values 3, 4, and 5 in any order at the indices 2, 4, 5; the six permutations are 23145, 23154, 24135, 24153, 25134, and 25143.Now consider the chain 3 < 1 < 5.The existence of this chain implies that the subword β( 1)β( 3)β( 5) is an occurrence of 213 in all six basis elements.Since 213 is a basis element of J 4 , it follows that J 4 does not contain any of the six basis elements.
Theorem 2.3.A POP class whose associated poset is bipartite has a regular insertion encoding.
Proof.Let C = Av(B) be a POP class with associated bipartite poset P with n elements.Let L denote the elements of P that are the lower elements in a chain of size two and let U denote the remaining elements.Assume |L| = k.We will construct, for each class J 1 , J 2 , J 3 , and J 4 , a linear extension of P whose corresponding permutation is in the class.
Any permutation in which the entries at the indices in L have the values {1, . . ., k} and the entries at the indices in U have the values {k + 1, . . ., n} is in B. (Note that B contains other permutations as well.)The permutation in which the entries at indices in L are increasing, and the entries at indices in U are increasing is in J 1 .Similarly, by swapping one or both of the increasing sequences for a decreasing sequence, we find permutations in B from each of J 2 , J 3 , and J 4 .Therefore, by Theorem 2.1, C has a regular insertion encoding.
We illustrate this proof with an example as well.Let C be the POP class with the associated poset .In this case L = {2, 4, 6} and U = {1, 3, 5}.We then construct the four permutations 415263 ∈ J 1 , 615243 ∈ J 2 , 435261 ∈ J 3 , and 635241 ∈ J 4 .These are the four permutations with the entries 123 or 321 at the indices in L and the entries 456 or 654 at the indices in U.
Theorems 2.2 and 2.3 together prove our main result, Theorem 1.2.
Vatter [Vat12] describes an algorithm to determine the generating function of any class with a regular insertion encoding.The Combinatorial Exploration framework [ABC + 22], which we discuss in the next section, can perform this computation more efficiently.Consequently, we can use Theorem 1.2 to rederive some of the enumerative results in [GK19], and [KP23] in a uniform manner and address several of their open questions.
In light of Theorem 1.2 it is natural to wonder if perhaps tripartite POPs (those whose longest chain has length 3) have some similarly nice characterization of their generating functions.This is unlikely, given the class Av(1234, 1324) = Av

Symmetric Equivalence
The reverse of a permutation π = π(1)π( 2 1), the complement of π is the permutation π C defined by π C (i) = n + 1 − π(i), and we have already discussed the inverse π −1 .These three operations preserve pattern containment, e.g., if σ is contained in π, then σ R is contained in π R .We extend these operations to permutation classes by defining, for example, C R = {π R : π ∈ C}.If C = Av(B), then C R = Av({β R : β ∈ B}), and similarly for complement and inverse.
If C can be obtained from D by some sequence of these three operations, then we say that C is symmetrically equivalent to D, and it's easy to see that in this case C and D have the same counting sequence.The resulting equivalence classes have sizes 1, 2, 4, or 8.
While there are 2 n! permutation classes avoiding a (possibly empty) subset of permutations of size n, the number of equivalence classes under symmetry is, of course, smaller, approximately oneeighth the size.Starting with n = 1, the counting sequence starts 2, 3, 21, 2139264, and the OEIS sequence A277086 gives a triangle of numbers that refines these numbers by the size of the basis; the numbers above is the sequence of row sums of that triangle.When restricting only to those permutation classes that are POP classes, the counting sequence for the number of equivalence classes under symmetry starting with n = 1 is 1, 2, 7, 64, 1068, 32651.We added this sequence to the OEIS as entry A366705, but have not found a formula to quickly compute further terms.
Gao and Kitaev [GK19] give two operations on a poset P that produce a new poset P ′ such that that Av(P) and Av(P ′ ) are symmetrically equivalent.First, complementing the labels of a poset P of size n, by which we mean replacing each label i with n + 1 − i, gives a poset P ′ such that Av(P ′ ) = Av(P) R .Second, forming P ′ by reversing each relation of P (i.e., if a < b in P, then b < a in P ′ ), we have that Av(P ′ ) = Av(P) C .These operations are insufficient to generate the complete equivalence classes under symmetry of each POP class.For example, the class C = Av(1342Av( , 1432) ) is a POP class with poset P = 2 , which does not correspond to either of the two operations described by Gao and Kitaev.We therefore pose the following question.
Question 3.1.When is the inverse of a POP class also a POP class?When it is, is there an operation on posets that can be defined in a uniform way to transform the poset of one class into the poset of its inverse, without an intermediate translation into a set of permutations.
This question is trivial for classes defined by avoiding a single permutation since these POP classes are defined by posets that are chains.However, Av(123,132,231) is a POP class, while its inverse Av(123,132,312) is not.

Wilf Equivalence
Two permutation classes are Wilf-equivalent if they have the same number of permutations of each size.Clearly, symmetrically equivalent classes are Wilf-equivalent, but there are many examples of non-symmetrically equivalent classes that are also Wilf-equivalent, a classic example being Av(123) and Av(132).When we are interested in computing the generating function of many POP classes, we can therefore restrict ourselves to one POP class from each symmetry class.
Gao and Kitaev [GK19] noted several examples of Wilf-equivalence among non-symmetrically equivalent POP classes, and later Kitaev and Pyatkin [KP23] provided a complete classification of the Wilf-equivalence classes of POP classes whose poset has the shape , which they call Npatterns.They later ask whether a similar classification can be performed for M-patterns, those with posets of the shape .As these posets are all bipartite, Theorem 1.2 shows that their generating functions can be algorithmically computed, and this extends to what we will call zigzag classes of arbitrary size, those whose poset has shape • • • .If P is a zig-zag poset of size n, then the size of the basis of the class Av(P) is the nth Euler number, as proved by Stanley [Sta97,Exercise 3.66(c)].The number of zig-zag classes of size n is n! when n is even and n!/2 when n is odd.
We have performed the computation necessary to determine the Wilf-equivalence classes for zigzag classes of size 5 (M-classes) and of size 6 using the Tilescope software package [BEM + 21] developed by Albert, Bean, Claesson, Nadeau, Pantone, and Ulfarsson [ABC + 22], which we describe in more detail in the next section.Figure 2 shows the classification of the 60 M-classes into 23 Wilf-equivalence classes.The 720 zig-zag classes of size 6 split into 177 Wilf-equivalence classes, of which only five are non-trivial.These five are shown in Figure 3.A list of all Wilf-equivalence classes for size 5 and 6 zig-zag classes and their generating functions can be found at the Github repository https://github.com/jaypantone/bipartite-pops.
In contrast to the situation for general POP classes described in Section 3.1, we conjecture that the two operations described by Gao and Kitaev fully describe all symmetry classes of zig-zag classes.
Conjecture 3.1.If two zig-zag classes are symmetrically equivalent, then one is formed by complementing the labels of the other or by reversing all of the relations of the other, or both.
If this conjecture is true, then the number of symmetry classes of zig-zag classes is given by sequence A262480 in the OEIS.

Using Tilescope to enumerate size 5 POP classes
Combinatorial Exploration introduced by Albert, Bean, Claesson, Nadeau, Pantone, and Ulfarsson [ABC + 22] is a domain-agnostic algorithmic framework for discovering combinatorial specifications for sets of combinatorial objects.A combinatorial specification is a way of describing the structure of a set of objects, and from a specification, one can often derive many useful results, including a generating function of the set, polynomial counting algorithms, random sampling routines, and more.This framework is experimental because you are not always guaranteed to find a specification in finite time; however, it is verifiably correct once such a result is found.
The Tilescope software package [BEM + 21] is an implementation of Combinatorial Exploration for the field of permutation patterns.Although Tilescope is guaranteed to find a specification for every permutation class with a regular insertion encoding (which was used to produce Figures 2  and 3), there is no such guarantee in general.In [ABC + 22] Tilescope was used to enumerate every permutation class whose basis contained only size 4 patterns except for Av(1324), which has no known polynomial-time enumeration formula.As a result, one can consider all size 4 POP classes to have been enumerated except Av(1324).All of the enumerative results of [ABC + 22] are cataloged on the Permutation Pattern Avoidance Library (PermPAL) [ABC + ], which can be found 24253 54x 3 +17x 4 +40x 5 −51x 6 +40x 7 −26x 8 +4x  24391 Table 1: The number of POPs of size 5 with a given degree of minimal polynomial.
We applied TileScope to size 5 POP classes.In total there are 4231 size 5 POP classes, but only 1068 after considering symmetric equivalence.Of these 1068 classes, 223 have a regular insertion encoding, so TileScope was able to find a specification for these, and we were able to compute the rational generating functions for these POPs.For the remaining 845, TileScope found a specification for 590 of them.We computed the generating function for 223 of these 590 using automatic kernel method style techniques.For the other 367 of the 590, we could not derive a generating function either because the system of equations has more than one catalytic variable or because our automatic methods exceeded available memory or time.Even in these cases, the specification still produces a polynomial-time algorithm that can be used to generate terms of the counting sequence.
Table 1 shows the order of the minimal polynomials of the 446 size 5 POP classes for which Tilescope finds a specification and we are able to solve the resulting system of equations.For example, there are five size 5 POP classes for which we found an algebraic generating function with minimal polynomial of order 10.One example is Av(13542, 14523, 14532, 15324, 15423, 15432, 24513, 25314, 25413) for which the minimal polynomial is It is notable that all of the size 5 POP classes for which we found a rational generating function are bipartite and thus have a regular insertion encoding guaranteeing this rationality.This leads us to conjecture that all POPs with a rational generating function have a regular insertion encoding.
Conjecture 4.1.A POP class has a rational generating function if and only if it is bipartite.
The proof of Theorem 2.1 shows that every permutation class that does not have a regular insertion encoding has a subclass Av(σ) where σ is a permutation of size 3.This subclass has an algebraic generating function.This, however, does not prove that such a class cannot have a rational generating function; consider for example the result of Albert, Brignall, and Vatter [ABV13] that says every proper permutation class is the subclass of a permutation class with a rational generating function.

Resolving some conjectures of Gao and Kitaev
In Gao and Kitaev [GK19], Table 5 lists six different POP classes of size 5 that do not a regular insertion encoding and for each one makes a conjecture that their counting sequence is the same as an existing OEIS sequence.We have reproduced their Table 5 below, here labeled Table 2.For ease of reference, we will refer to their conjectures as Conjecture GK.1 through Conjecture GK.6 according to their row in the table.Through the use of Tilescope to enumerate many size 5 POP Table 2: A reproduction, in part, of Table 5 from [GK19] listing the six conjectures addressed here.

Conjecture GK.1
Conjecture GK.1 involves the class G 1 = Av 2 3 4 Av(31425, 31524, 32415, 32514, 41235, 41325, 42135, 42315, 43125, 43215) and the OEIS sequence A216879 defined as the solution to an equation involving Jacobi theta functions.The conjecture that the counting sequence for G 1 is (a shift of) A216879 is incorrect.One can use a software library like Permuta [AAB + 21] or PermLab [Alb14] to quickly check that the number of permutations of size 10 in G 1 is 443, 592, while the corresponding term in A216879 is 443, 594.
Furthermore, Tilescope was able to find a combinatorial specification for G 1 .1This allows us to determine that the generating function for G 1 is algebraic, satisfying the minimal polynomial The counting sequence for this class has been added to the OEIS as entry A366706.
Tilescope found a combinatorial specification for G 22 that leads to a univariate system of 136 equa- tions that can be solved to derive the generating function which matches the generating function given in the OEIS sequence, thus confirming Conjecture GK.2.Tilescope has also found a combinatorial specification for the class described by the OEIS sequence. 3.
The PermPAL database actually contains six additional permutation classes with this same generating function, plus two more whose generating function we could not find but whose enumeration matches up to at least size 100, leading us to conjecture that they are also Wilf-equivalent.
Table 3 lists these ten classes, all of which turn out to be POPs. 4On PermPAL, all classes are stored using the symmetry with the lexicographically smallest basis.That symmetry may not be a POP, so here we choose a symmetry of each that is a POP and in most cases gives the same shape.The PermPAL entry for each class can be accessed at the url "http://permpal.com/perms/[PermPALID]" where "[PermPAL ID]" is replaced by the ID given in the table.Note that the first row is the class in the definition of the OEIS sequence and the second to last row is the POP that Conjecture GK.2 is concerned with.

Conjecture GK.3
Conjecture GK.3 involves the class G 3 = Av 4 5 2 3 1 = Av(51423, 51432, 52413, 52431, 53412, 53421, 54312, 54321) and the OEIS sequence A118376 defined as the "number of trees of weight n where nodes have positive integer weights and the sum of the weights of the children of a node is equal to the weight of the node."Tilescope finds a specification for G 35 that leads to a bivariate system of 26 equations that can be solved with kernel method techniques to find the generating function 5 − 4x − √ 1 − 8x + 8x 2 4 − 4x which matches (a shift of) the generating function given for A118376.
In fact, there are sixteen classes in the PermPAL database that appear to have this same enumeration, shown in Table 4.For twelve of these, we can solve the resulting system of equations to find the generating function shown above.The remaining four have either bivariate systems of equations that are too big for us to solve or trivariate systems of equations for which no solving method is known; for these four we confirm using their specifications that their enumerations match A118376 up to size 100.

Conjecture GK.4
Conjecture GK.4 involves the class G 4 = Av 3 4 5 1 2 = Av(45123,45213,54123,54213) and the OEIS sequence A212198 defined as the "leading diagonal of triangle in A211321", which itself is defined as enumerating "marked mesh patterns of type R (2,0,2,0) n " as defined by Kitaev and Remmel [KR12].The set of permutations that avoid marked mesh patterns of this type form the permutation class Av(45312,45321,54312,54321).Martinez and Savage [MS18] proved that this leading diagonal sequence is also the counting sequence for inversion sequences avoiding the patterns 201 and 210.Chen and Lin [CL24] and Pantone [Pan23] have enumerated these, finding

Permutation Class
PermPAL ID GF known?
their generating function to be 2 Chen and Lin [CL24] then found bijections that linked four permutation classes (G 4 , the class defined by A212198, and two more classes avoiding four patterns of size five) with inversion sequences avoiding the patterns 201 and 210.They also conjecture that nine further classes defined by avoiding four patterns of size five have the same counting sequence.
We have determined by an exhaustive search that in addition to the thirteen classes that Chen and Lin either prove or conjecture are enumerated by A212198, there are at most ten more with the same counting sequence whose basis contains only size 5 patterns.We have enumerated the nine classes in Chen and Lin's conjecture, as well as six of the ten new classes.For an additional one of the ten, we find a combinatorial specification that allows us to compute the first 100 terms of the counting sequence (which match A212198), but not compute the generating function.We summarize below the state of the classes now known or conjectured to be counted by A212198.
For each class whose enumeration we claim, a specification can be found on PermPAL by entering the basis into the search bar.Note that we have listed the symmetry with the lexicographically minimal basis for each class.Av(45123,45132,45213,54123,54132,54213) and (a shift of) the OEIS sequence A228907 defined as the series expansion of the generating function F(x) satisfying the equation
Tilescope finds a specification for G 57 that leads to a system of 20 equations with one catalytic variable that can be solved to find the shifted generating function 1 + xF(x) where F(x) is the generating function from A228907.This is the only permutation class in the PermPAL database with this counting sequence.
eight permutation classes in the symmetry class are POP classes.In particular, C −1 = Av(1423, 1432) corresponds to the poset 1 3 4

Figure 2 :Figure 3 :
Figure 2: The Wilf-equivalence classes of size 5 zig-zag classes.Only one class from each symmetry class is shown.Below each poset is the PermPal ID of the class.

Table 5 :
The ten POP classes known to be counted by OEIS A212198.