Equidistributed statistics on matchings and permutations

We show that the bistatistic of right nestings and right crossings in matchings without left nestings is equidistributed with the number of occurrences of two certain patterns in permutations, and furthermore that this equidistribution holds when refined to positions of these statistics in matchings and permutations. For this distribution we obtain a non-commutative generating function which specializes to Zagier's generating function for the Fishburn numbers after abelianization. As a special case we obtain proofs of two conjectures of Claesson and Linusson. Finally, we conjecture that our results can be generalized to involving left crossings of matchings too.


Introduction
Permutations of n elements are counted by n!. To a combinatorialist, objects counted by some number are often regarded as a representation or concretisation of that number. For each representation we obtain of a number sequence, we understand it better. The more objects we have that are counted by n!, the better we will understand that sequence of numbers.
In 2010, Bousquet-Mélou et al. [1] showed bijectively that the Fishburn numbers, starting with 1, 1, 2, 5, 15, 53, 217 . . . , count not only the unlabelled (2+2)-free posets on n elements which define them, but also ascent sequences of length n, permutations of [n] avoiding the pattern , and matchings on [2n] with no neighbour nestings. This variety of representations of these numbers indicate that they are well worth studying.
Neighbour nestings in matchings come in two flavours, right and left nesting. As it turns out, the number of matchings avoiding only one of these flavours, say left nestings, are counted by n!. The same holds, obviously, for permutations on [n], and also for (2 + 2)-free posets with some natural labelling, according to a 2011 paper by Claesson and Linusson [4].
In more detail, we may view a matching on [2n] as a set of arcs between the elements of [2n] laid out on the real line. A nesting is a pair of arcs, one enclosing the other, and a right (left) nesting is a nesting where the two right (left) elements are adjacent. In the matching below, there is a right nesting between edges {2, 7} and {4, 6}, but no other left or right nestings: Turning to permutations, an instance of the pattern in a permutation π is a triple of entries with the same positions and values, relative to each other, where vertical lines indicate adjacency in position and horizontal lines indicate adjacency in value. Thus, the permutation 3412 contains the pattern once, namely 3412. (Note that while 3412 is a 312 pattern and the last two entries in the pattern are adjacent in position, the first and last entries in the pattern are not adjacent in value and thus it is not an instance of the pattern .) To prove that permutations and matchings without left nestings are equinumerous, Claesson and Linusson took the following approach. Consider an inversion table, that is an n-tuple α = (α 1 , . . . , α n ) such that 1 ≤ α j ≤ j. To each inversion table α, we obtain a permutation if we traverse α from left to right, inserting the number j in position α j from the left. Similarly, we obtain a matching if we traverse α from left to right, inserting the right end of a new arc to the far right and the left end immediately to the left of the right end of the α j th right end from the left. These two bijections induce a bijection between permutations of [n] and matchings of [2n] with no left nestings, since we would need to insert the left end of a new arc to the left of a previous left end to obtain a left nesting. Note also that this bijection ties the given examples of a matching and a permutation together, via the inversion table α = (1, 2, 1, 2).
During their work, Claesson and Linusson made the observation that the number of left-nesting free matchings of [2n] with k right nestings seemed to coincide with the number of permutations with k occurrences of the pattern , which would make an interesting refinement. Indeed, their simple recursive bijection gives a right nesting in step j if and only if α j < α j−1 and the permutation in step j contains the pattern with top entry j if and only if α j < α j−1 . Case closed, right? Not really! As the bijection progresses, an arc added to the matching may break previous right nestings. Similarly, the pattern may also be broken when more entries are included in the permutation. For example, putting the left end of a new arc between the arc with the right nesting in the matching drawn above will break the nesting: 1 2 3 4 5 6 7 8 9 10 In the corresponding permutation, via inversion table α = (1, 2, 1, 2, 3), we should add a 5 in position 3, obtaining 34512. This permutation retains its occurrence of the pattern . On the other hand, inserting the 5 in position 4 would have destroyed the pattern and the corresponding arc added to the matching would not have ruined the nesting. It is not hard to see that the total number of right nestings in all matchings of [2n] equals the total number of occurrences of in permutations of length n, but their equidistribution is not clear from the bijection. This paper presents a proof of the bijection. We actually show that the bistatistic of right nestings and right crossings (pairs of arcs with neighbouring right ends that cross each other) in matchings is equidistributed with the number of occurrences of the patterns and in permutations, and furthermore that this equidistribution holds when refined to positions/values of these statistics in matchings and permutations. Our proof is built on the bijection from Claesson and Linusson, but the inversion table in their proof is replaced by a richer structure in ours, namely certain fillings of partition shapes. (We were inspired by Krattenthaler [6].) Given a set X ⊆ {2, 3, . . . , n} associated with a partition shape, we obtain a bijection between some matchings of [2n] and some permutations of [n] such that the occurrences of right adjacencies and patterns in positions in X match perfectly, whereas other occurrences of right adjacencies and patterns may not match at all. We then apply the sieve principle to obtain a perfect match in the case X = ∅.
The bijections will be presented in more detail in the following four sections, where Section 5 ties our first results together into a proof of Conjecture 20 in [4]. We then introduce noncommutative formal power series in Section 6. Section 7 gives generating functions of matchings and permutations as noncommutative formal power series and we prove that these two generating functions are identical, giving the equidistribution when refined to positions. We then abelianize the generating functions and demonstrate that they coincide with previously known generating functions in special cases. At the end of Section 8 we obtain a proof of Conjecture 21 in [4]. Finally, in Section 9 we conclude with some results and conjectures concerning the number of left crossings.

Shapes.
A partition is a weakly increasing sequence of positive integers λ = (λ 1 ≤ λ 2 ≤ · · · ≤ λ ℓ ), and we will identify λ with its shape which is the bottomjustified arrangement of squares, called cells, with λ i cells in the ith column from the left. The left part of Figure 1 shows an example. (This orientation of the shape is more suitable for us than the usual French or English Young diagram.) Define the lazy set of λ, denoted by X(λ), to be the set of indices i such that λ i−1 = λ i . Also, let ℓ(λ) = ℓ denote the length (i.e. the number of columns) of λ. A shape is said to be flat if its rows have distinct lengths and steep if its columns have distinct lengths. If it is both flat and steep it is a staircase shape. (Note that a flat shape is completely determined by its length and its lazy set.) We will number the columns of a shape from left to right and the rows from bottom to top, and the cells will be identified with their coordinate pairs (i, j) where i is the column index and j is the row index.

Fillings.
A 0-1-filling, or simply a filling, of a shape is an assignment of the number 0 or 1 to each cell of the shape. If each column sum is positive or equal to one, the filling is said to be column-positive or column-strict, respectively. The attributes row-positive and row-strict are defined analogously, and a filling that is both row-and column-positive is simply called positive and if it is row-and columnstrict it is called strict. The total sum (i.e. the number of ones) of a filling T is denoted by n(T ). We let λ(T ) denote the underlying shape of T and for convenience we write ℓ(T ) and X(T ) as shorthand for ℓ(λ(T )) and X(λ(T )). A filling also inherits the properties "flat" and "steep" from its underlying shape.
Let T(λ) denote the set of fillings of the shape λ, and let T = λ T(λ) be the set of all fillings (of nonempty shapes). Also, if p is a filling property we let T p (λ) denote the set of fillings of λ with property p, and if q is a shape property we let T q p denote the set of fillings with property p of shapes with property q. For instance, we write T flat col-str for the set of flat column-strict fillings. When drawing fillings we will omit the zeroes and replace the ones by dots, and to each filling T we associate the set of dots Dots(T ) = {(i, j) : there is a dot at (i, j)} and a set sequence α(T ) = (α 1 , . . . , α ℓ(T ) ) where α i = {j : (i, j) ∈ Dots(T )} contains the row indices of the dots in column i. If T is column-strict all sets α i are singletons and, for convenience, in this case we will abuse notation and make no distinction between α i = {j} and j itself. (Note that if λ is the staircase shape of length n then T col-str (λ) can be interpreted as the set of inversion tables of size n.) Given two fillings T and T ′ , we define their direct sum T ⊕ T ′ to be the filling obtained by putting T ′ to the north-east of T and filling out the rectangle below T ′ with empty cells. Figure 2 shows an example. A filling that cannot be written as a direct sum of two fillings are called irreducible. Every filling can be written uniquely as a direct sum of irreducible fillings, called its irreducible components, and we let comp(T ) denote the number of irreducible components of T .
A row-strict filling T may be steepened by, for each k, merging all columns of length k into one single column (with dots in the same rows), see For a filling T , let Min(T ) = {i : (i, 1) ∈ Dots(T )} denote the set of columns with a dot on the bottom row, and let Max(T ) = {i : (i, λ(T ) i ) ∈ Dots(T )} denote the set of columns with a dot in their topmost cell. The cardinalities of these sets are denoted by min(T ) and max(T ). Also, let denote the number of dots that are strictly closer to the top of its column than is any dot strictly to the right; and let lmin(T ) = #{(i, j) ∈ Dots(T ) : i < i ′ for any (i ′ , j ′ ) ∈ Dots(T ) with j ′ < j} denote the number of dots that are strictly to the left of any dot strictly below.
For column-strict fillings T we extend our notation and let Rmax(T ) := {i : λ i − α i < λ j − α j , ∀j > i} denote the set of columns whose dots are closer to the top than is any dot to the right. Note that this is compatible with our previous notation in the sense that # Rmax(T ) = rmax(T ).
Also, define the sets of descents, ascents, and repetitions of a column-strict filling T . The cardinalities of these sets are denoted by des(T ), asc(T ), and rep(T ). A pair of dots is said to be descending if one dot is strictly to the south-east of the other one, and ascending if one dot is strictly to the north-east of the other one. A sequence of dots in which each dot is strictly to the south-east (north-east) of the previous dot is called a descending (ascending) chain.

Permutations and bivincular patterns
Let S n be the set of permutations π of [n] = {1, 2, . . . , n}, let S = n≥1 S n denote the set of all permutations, and let n(π) denote the size of a permutation π.
Given a permutation π of [n] and a permutation π ′ of [n ′ ], we define their direct sum π ⊕ π ′ as the permutation obtained by juxtaposition of (the single-row notation of) π and π ′ whereafter the entries of π ′ are increased by n(π). Example: 213 ⊕ 2413 = 2135746. Every permutation π can be written uniquely as a direct sum of irreducible components, the number of which we denote by comp(π). Example: comp(2135746) = comp(21 ⊕ 1 ⊕ 2413) = 3.
Bivincular patterns were formally defined in [1]. These are classical patterns in permutations drawn in permutation diagrams with optional horizontal and vertical bars, the horizontal bars indicating adjacency in value and the vertical bars indicating adjacency in position. Since we are interested not only in the number of pattern occurrences but also in their positions we will draw one of the dots in a pattern slightly bigger to signify that an occurrence of the pattern is identified with the value of that dot.
In particular, an occurrence of the pattern in a permutation π is an entry π(j) in the single-row notation of π such that π(j − 1) < π(j). Such an occurrence is called an ascent top, or simply an ascent, and the set of ascents is denoted by Asc(π). We will also need the set of ascent bottoms Asc bottom (π) = {π(j) : π(j) < π(j + 1)} towards the end of this article.
Let us refine the ascent statistic. An occurence of the pattern is an ascent π(j) such that π(j − 1) = π(j) − 1. These are known as adjacencies, especially in the context of genome rearrangements [2,5]. To avoid overloading with adjacencies in matchings, we call the pattern a short ascent. The long ascents, that is where π(j −1) < π(j)−1, are occurrences of the pattern , where the dashed line indicate a lack of adjacency in value.
We refine the long ascents further. Namely, an occurrence of the pattern is an ascent π(j) such that the entry π(j) − 1 is to the right of π(j) in the single-row notation of π, and an occurrence of the pattern is an ascent π(j) such that π(j) − 1 is to the left of π(j − 1). Let P (π), Q(π), Asc long (π) and Asc short (π) denote the set of occurrences of , , and in π, respectively. Clearly, the three sets , and are disjoint and their union is Asc(π).
Definition 3.1. A barred permutationπ is a permutation where zero or more ascents are marked by a bar. The set of barred elements is denoted by X(π) ⊆ Asc(π).

The set of barred permutations is denoted byS.
The direct sumπ ⊕π ′ of two barred permutations is defined exactly as for nonbarred permutations, with the additional rule that the barred entries ofπ andπ ′ keep their bars inπ ⊕π ′ . Every barred permutationπ can be written uniquely as a direct sum of irreducible barred components, the number of which we denote by comp(π). Note that comp(π) may be smaller than comp(π), the number of irreducible components ofπ disregarding the bars. Example: comp(2135746) = comp(213 ⊕ 2413) = 2 while comp(2135746) = 3.
We now define a map φ : T flat col-str →S from flat column-strict fillings to barred permutations. For a flat column-strict filling T , this map iterates through the sequence α = α(T ) to create a barred permutationπ.
Start with the single block 1 . Now, for i = 2, 3, . . . , n(T ), if i ∈ X(T ), insertī at the right end of the α i th block from the left. If i / ∈ X(T ), insert the new block i immediately before the α i th block from the left or to the right of the rightmost block if α i = λ(T ) i . Having reached n(T ), we dissolve the block structure to obtain (the single-row notation of)π. Dissolving the block structure givesπ = φ(T ) = 7 356 4 18 9 2. We note that P (π) = {5}, Q(π) = {8}, and Asc short (π) = {6, 9}, and hence the barred elements . We also note that 4 ∈ Asc short (3 4 1 2), but when 5 is added, the short ascent pattern is destroyed. Patterns on barred elements can, on the other hand, never be destroyed.
There is an inverse φ −1 : Given a barred permutationπ we construct a flat columnstrict filling T by letting ℓ(T ) = n(π) and X(T ) = X(π) and letting α(T ) i be the number of entries weakly to the left of i in the single-row notation of π that are not greater than i and do not belong to X(π).
for any T, T ′ ∈ T flat col-str , and if φ(T ) =π the following equations hold. n(T ) = n(π), (2a) Proof. First we must check that φ is well-defined. Each barred entry of φ(T ) is preceded by a smaller entry since it is not the leftmost entry in its block and any greater entries in the block are inserted to its right. Thus, the barred entries are ascents and it follows that φ(T ) ∈S.
That φ −1 as defined above really is an inverse of φ follows from the observation that each block contains exactly one entry that is not in X(T ) = X(φ(T )).
Turning to the set of equalities, (2a) and (2e) follow directly from the definition of φ, and (2b) is a consequence of the relation (1) which is straightforward to verify.
To check (2c) we note that a maximal dot in column i in T will put the entry i to the right of every entry less than i inπ. Hence i ∈ Rmin(π). Conversely, if i ∈ Rmin(π), φ −1 will put the dot in the topmost cell of column i in φ −1 (π), since i has no smaller entries to its right inπ. Equation (2d) is checked similarly: If i ∈ Rmax(T ), it will not have any larger entries to its right inπ, hence i ∈ Rmax(π), and vice versa.
For the final equalities, (2f), (2g), and (2h), take any i ∈ X(T ) = X(π). If i ∈ Des(T ), α i−1 > α i and the entry i is put to the left of the block containing i − 1; hence i ∈ P (π). If i ∈ Asc(T ), α i−1 < α i and i is put in a block to the right of the block containing i − 1; hence i ∈ Q(π). Finally, if i ∈ Rep(T ), α i−1 = α i and i is put immediately after i − 1 and in the same block; hence i ∈ Asc short (π).

Hatted permutations.
A silly ascent of a permutation π ∈ S n is an entry π(j) in the single-row notation of π such that π(j −1) < π(j) or j = 1, and π(j) < n. So the set Asc silly (π) of silly ascents is obtained from the set of ordinary ascents by replacing n by π(1) if n is an ascent, that is, Asc silly (π) = (Asc(π)∪ {π(1)})\{n}. In particular, the number of silly ascents always equals the number of ordinary ascents.
In analogy with the refinement Asc(π) = P (π) ∪ Q(π) ∪ Asc short (π) of ascents, we partition the set of silly ascents into two types Asc silly (π) = P silly (π) ∪ Q silly (π). Here, P silly (π) is the set of occurrences of the pattern , that is, silly ascents π(j) such that π(j) + 1 is to the left of π(j) in the single-row notation of π. Q silly (π) is the set of silly ascents π(j) such that π(j) + 1 is to the right of π(j), or equivalently, the set of occurrences of the pattern in the permutation 0 ⊕ π of [0, n] obtained by inserting a zero at the very beginning of the single-row notation of π. Definition 3.3. A hatted permutationπ is a permutation where zero or more silly ascents are marked by a hat. The set of hatted ascents is denoted by X(π) ⊆ Asc silly (π).
The set of hatted permutations is denoted byŜ.
Start with the single block 0 . Now, for i = 1, 2, . . . , n(T ), if i + 1 ∈ X(T ) (i.e. λ(T ) i = λ(T ) i+1 ) insertî at the right end of the α i th block from the left. If i + 1 / ∈ X(T ), insert the new block i immediately after the α i th block from the left. Having reached n(T ), we dissolve the block structure and remove the leading zero to obtain (the single-row notation of)π. Removing the block sequence and the leading zero givesπ = φ(T ) =57 6 34 1 8 9 2.
There is an inverse φ −1 silly : Given a hatted permutationπ we construct a flat column-strict filling T by letting ℓ(T ) = n(π) and X(T ) = X + (π) and letting α(T ) i be one plus the number of entries to the left of i in the single-row notation of π that are less than i and do not belong to X(π).
Theorem 3.4. The map φ silly : T flat col-str →Ŝ is a bijection. Furthermore, we have for any T, T ′ ∈ T flat col-str , and if φ silly (T ) =π the following equations hold. n(T ) = n(π), (4a) Proof. First we must check that φ silly is well-defined. Let 0 ⊕π denote the hatted permutationπ preceded by a zero. Each hatted entry of 0 ⊕π is preceded by a smaller entry since it is not the leftmost entry in its block and any greater entries in the block are inserted to its right. Thus, the hatted entries are silly ascents and it follows thatπ ∈Ŝ.
That φ −1 silly as defined above really is an inverse of φ silly follows from the observation that each block contains exactly one entry that is not in X(π).
Turning to the set of equalities, (4a) and (4e) follow directly from the definition of φ silly and (4b) is a consequence of (3) which is straightforward to verify. To check (4c) we note that a maximal dot in column i in T will put i to the right of  every entry less than i. Hence i ∈ Rmin(π). Conversely, if i ∈ Rmin(π), φ −1 silly will put the dot in the topmost cell of column i in φ −1 silly (π), since i has no smaller entries to its right inπ. Equation (4d) is checked similarly: If i ∈ Rmax(T ), it will not have any larger entries to its right inπ, hence i ∈ Rmax(π), and vice versa.
For the final equalities, (4f) and (4g), since we know that X(T ) = X + (π) it suffices to show that for i ∈ X(T ), i ∈ Des(T ) if and only if i − 1 ∈ P silly (π). If i ∈ Des(T ), α i−1 > α i and i is put to the left of the block containing i − 1; hence i − 1 ∈ P silly (π). If i / ∈ Des(T ), α i−1 ≤ α i and i is put in the same block as the block containing i − 1 or to its right; hence i − 1 / ∈ Q silly (π).

Matchings and adjacencies
A matching of size n is a set partition of [2n] into parts of size 2. Each part is called an arc. For each arc A, we refer to the smaller of its elements as the opener op(A) and the greater as the closer cl(A). We denote the arcs of a matching M by M 1 , M 2 , . . . , M n ordered by closer so that M 1 is the arc with the smallest closer.
In the following, we will identify a set of drawn arcs between 2n points on a horizontal line with a matching M by assigning the numbers 1, 2, . . . , 2n to the points from left to right, see Figure 4.    The set of marked matchings is denoted byN.
There is a well-known bijection between strict fillings of shapes of length n and matchings on [2n]: Follow the border of the shape from the south-west corner to the north-east corner and label the edges 1, 2, . . . , 2n as in Figure 6. Consider this  Figure 4.
to be a labelling of the rows and columns of the shape. Now, construct a matching on [2n] by drawing an arc between i and j if there is a dot in the row labelled i and the column labelled j. Under this bijection it is easy to see that left adjacencies in the matching correspond to adjacent rows of the same length in the shape, and similarly right adjacencies correspond to adjacent columns of the same length. Furthermore, a pair of dots in adjacent rows or columns of the same length correspond to a (left or right) crossing if they are ascending, and to a (left or right) nesting if they are descending. (Recall that a pair of dots are said to be descending (ascending) if one of them is strictly to the south-west (north-west) of the other one.) In particular, matchings without left nestings correspond to strict fillings such that, for each k, the dots on rows of length k form an ascending chain. Thus, via the flattening function T → Fl(T ) (i.e. merging rows of equal length) we obtain a bijection ψ from matchings without left nestings to flat column-strict row-positive fillings, see Figure 6.
Next we will define a function f : T flat col-str →N from flat column-strict fillings to marked matchings. Given a T ∈ T flat col-str , remove its empty rows to obtain a flat column-strict row-positive filling  Proof. We know from above that ψ is a bijection and it is easy to see that for any subset X of X(T ′ ) there is a unique way of inserting empty rows into T ′ to obtain a flat column-strict filling T with X(T ) = X. This shows that f is a bijection.
Turning to the set of equalities, (6a) and (6d) follow directly from the definition of f , and (6b) is a consequence of (5) which is straightforward to verify. The remaining equations, (6c), (6e), (6f), and (6g) are also just matters of inspection. Equations (2f), (2g), (2h), (4f), (4g), (6e), (6f), and (6g) all include an intersection with X(T ). Looking back at the examples, we note that without taking this intersection the equations would not hold. In the following sections we will use inclusion-exclusion to prove that while the bijections above seem to indicate the opposite, there are other bijections that allow the restriction to X(T ) to be dropped.

Restriction to right nestings
Later on, in Section 7, we will take full advantage of the bijections φ, φ silly , and f from the previous sections. As a warm-up, in this section we will confine ourselves to hatted permutations and matchings and we will forget about crossings and consider only right nestings. In the end we will obtain a proof of Conjecture 20 in [4].
Define the following three sets. In other words, T ′ flat col-str is the set of flat column-strict fillings such that, for any k, the dots in columns of length k form a descending chain;Ŝ ′ is the set of hatted permutations where only occurrences of are hatted; andN ′ is the set of marked matchings where only right nestings are marked. Proof. The first assertion follows immediately from Theorems 3.4 and 4.2, and the second assertion is clear after noting that comp(π) = comp(π) for anyπ ∈Ŝ ′ . Our goal in this section is to show that these generating functions are equal and to obtain an expression for them. Let us first make a variable substitution, and define S ′ silly (u, t, s, r) :=S ′ silly (u + 1, t, s, r),
Proposition 5.2. The following identities hold.
Proof. Since an elementπ ∈Ŝ ′ is essentially a permutation together with a subset X(π) of P silly (π), the sieve principle yields the desired result, see e.g. [7]. The same holds for matchings.
The steepening function T → St(T ) is clearly a bijection from T ′ flat col-str to T staircase col-pos , the set of column-positive staircase fillings. Moreover, it preserves the statistics n, min, max, rmax, and comp, and #X(T ) = n(St(T )) − ℓ(St(T )) for any T ∈ T ′ flat col-str . These facts together with Lemma 5.1 yield the following theorem. for µ ∈ {min, rmax}.
It remains to show that I ′ rmax (u, t, s, r) = I ′ min (u, t, s, r) and to compute this generating function. To show equality we will present an involution ι on T staircase col-pos taking rmax to min while preserving the statistics n, ℓ, and comp.
An enriched permutation filling is a positive filling of a square shape with the property that each dot is the leftmost dot in its row if and only if it is the topmost dot in its column. Let R denote the set of enriched permutations. (Note that the dot diagram of a permutation π (where there is a dot at (i, j) if π(i) = j) is indeed an enriched permutation filling.) Given two enriched permutation fillings ρ, ρ ′ ∈ R, we define their boxed sum ρ ⊞ ρ ′ as the enriched permutation filling obtained by putting ρ ′ to the north-east of of ρ ⊕ = Figure 7. Boxed sum of enriched permutations.
and then filling out with empty rectangles at the north-west and south-east corners in order to get a square shape. Enriched permutation fillings that cannot be written as a boxed sum is called box-irreducible. Every enriched permutation ρ can be written uniquely as a boxed sum of box-irreducible components, and the number of such components is denoted by boxcomp(ρ). We will define a map g from column-positive staircase fillings to enriched permutation fillings recursively as follows.
• The filling is mapped to itself. • If T ∈ T staircase col-pos has more than one column, remove the rightmost column from T to obtain T ′ ∈ T staircase col-pos , and let ρ ′ = g(T ′ ). Now we obtain ρ = g(T ) by inserting an empty row of length ℓ(ρ ′ ) into ρ ′ at position max α(T ) ℓ(T ) and then inserting the rightmost column of T to the far right. It is easy to see that g is a bijection and the inverse map g −1 from enriched permutation fillings to column-positive staircase fillings is straightforward: Given an enriched permutation filling ρ, delete every cell in ρ that is to the left of the leftmost dot in its row. Then, flush the remaining cells downwards to obtain the column-positive staircase filling g −1 (ρ).
The bijection g transfers many useful properties as stated by the following theorem whose proof is just a matter of straightforward verification and therefore omitted. For any enriched permutation filling ρ, define the transpose of ρ, denoted by ρ T , to be the enriched permutation filling obtained by reflecting ρ in the north-west to south-east diagonal. Clearly, transposition is an involution on R with the properties that lmin(ρ) = rmax(ρ T ) and boxcomp(ρ) = boxcomp(ρ T ).
To compute J(s) = I ′ min (u, t, s, 1) we construct a typical column-positive staircase filling by first choosing the number ℓ of columns and then, for k = 1, 2, . . . , ℓ, choosing which cells in the kth column should have a dot. Translated to a generating function, this procedure becomes and plugging this into (14) finally yields From (10) and Theorem 5.3 we see that substituting x − 1 for u in the last equation, according to (7) and (8), yields the following theorem.
The first equation of the theorem proves Claesson and Linusson's Conjecture 20 in [4] after two simple observations: • The pattern p used by Claesson and Linusson is our pattern p silly = rotated 180 degrees. Hence our rmax(π) corresponds to their lmin(π). • The part of their conjecture stating that (rne, comp, min) is equidistributed on matchings and posets follows from their Proposition 17 together with the fact that their bijection h preserves rne.

Noncommutative formal power series
For the rest of this paper we will continue concerning ourselves with permutation patterns and matching adjacencies. However, we will not be interested merely in their numbers but in their positions inside the permutations and matchings as well, so ordinary generating functions will not suffice anymore. Instead, our results will typically be expressed in terms of noncommutative power series, sometimes mixed up with commutative variables. For noncommutative variables we will use bold symbols, like x and y, while the commutative ones will be thin, like x and y. The ring C[[x 1 , . . . , x m ]] x 1 , . . . , x n of formal series over the complex numbers in the variables x 1 , . . . , x m (commutative) and x 1 , . . . , x n (noncommutative) is an object that requires some care, so in this section we will define it precisely and discuss some of its properties. Assuming that the reader is familiar with the integral domain C[[x 1 , . . . , x m ]] of ordinary commutative formal series in variables x 1 , . . . , x m , we will define R x 1 , . . . , x n for any integral domain R. We will follow Stanley's exposition in [7, Sec. 6.5] closely, but Stanley deals only with the case where R is a field.
Let X = {x 1 , . . . , x n } be a set of noncommutative variables and let X * be the free monoid generated by X. Thus X * consists of all finite strings (including the empty string 1) of letters in X. Definition 6.1. A formal (power) series in X over an integral domain R is a function S : X * → R. We write S, w for S(w) and then write The set of all formal series in X is denoted R X .
We identify 1 ∈ X * with 1 ∈ R and abbreviate the term α · 1 of the above series S as α. To make R X a ring, we define addition and multiplication in the obvious way: A sequence S 1 , S 2 , . . . of formal series is said to converge to a formal series S if for all w ∈ X * the sequence S 1 , w , S 2 , w , . . . has only finitely many terms unequal to S, w .
Proof. The "only if" direction follows from the fact that ST, 1 = T S, 1 = S, 1 T, 1 . For the "if" direction, suppose S, 1 = α is invertible in R and define This sum converges formally and it is easy to check that ST = T S = 1.
It is evident from the definition of addition and multiplication on R X that R X is a domain, that is ST = 0 implies S = 0 or T = 0. Thus, for any S, U ∈ R X with U = 0 there can be at most one T ∈ R X such that S = T U and if there is such a T we may write T = SU −1 without ambiguity, even if U is not invertible.

Generating functions
In this section we will exploit the bijections φ, φ silly , and f from Theorems 3.2, 3.4, and 4.2 in their full splendour, and extract enumerative results in the form of noncommutative generating functions. Let x 1 , . . . , x k , t be noncommutative variables. If n ∈ N and A 1 , . . . , A k are disjoint subsets of [n], we write [x A 1 1 · · · x A k k ; t] n for the monomial of length n where the ith factor is Let us define three generating functionsS,S silly andN , whereS counts permutations π with respect to the sets P (π), Q(π), and Asc short (π),S silly counts permutations π with respect to P + silly (π) and Q + silly (π), andN counts matchings M without left nestings with respect to Rne(M ), Rcr 0 (M ), and LRcr(M ). Our goal in this section is to show thatS(x, y, z, t, 1) =N (x, y, z, t, 1) and S(x, y, y, t, s) =S silly (x, y, t, s) =N (x, y, y, t, s) and to obtain expressions for these functions. To this end we will make extensive use of the sieve principle, which takes the following form in terms of noncommutative generating functions.
Theorem 7.1 (The sieve principle). Let n be a positive integer and let A 1 , . . . , A k be disjoint subsets of [n]. Then, Proof. The left-hand side is a product of factors, some of which are t and some of which are (u j + t) for some j. Expanding all factors of type (u j + t) yields the right-hand side.
It turns out that it is convenient to make a variable substitution and work instead with the generating functions Of course, we can reverse the substitution by the formulasS(x, y, z, t, s) = S(x − y, y − t, z − y, t, s),S silly (x, y, t, s) = S silly (x − y, y − t, t, s), andN (x, y, z, t, s) = N (x − y, y − t, z − y, t, s) if we want.
Lemma 7.4. For µ ∈ {min, max}, we have the sum taken over all column-strict fillings T of rectangular shapes of height k.
Proof. A flat shape can be seen as a finite sequence of rectangular blocks, where all columns of height k constitute the kth block. An alternative way of describing a flat column-strict filling is to specify the number m of blocks and then for each k ∈ [m] specify the kth block, that is, a column-strict filling of a rectangular shape of height k. But this is exactly what the right-hand side of (18) does. Furthermore, in both the left-hand side and the right-hand side In particular, we have Proof. By the sieve principle we have This generating function chooses a column-strict filling T of a rectangular shape of height k, and a set Y ⊆ Des(T ) ∪ Rep(T ). Divide the shape λ(T ) into rectangular blocks of height k, so that adjacent columns i − 1 and i belong to the same block if and only if i ∈ Y . Since the dots inside each block form a weakly descending chain (i.e. each dot is below or at the same level as the dot in the column immediately to the left), we get the sum taken over column-strict fillings T of rectangular shapes of height k such that Asc(T ) = ∅. The generating function G µ k (u, w, s) only has to choose the number of dots on each row, so G max k (u, w, s) = AB − 1 and G min k (u, w, s) = BA − 1.
Finally, we are ready to present our main theorem.
Proof. The theorem follows from Theorem 7.3 and Lemma 7.4 and 7.5.

Abelianization
In this section we will replace the noncommutative variables in the generating functions from the previous section by commutative variables and relate the resulting expressions to known enumerative results. At the end we will obtain a proof of Conjecture 21 in [4]. From (15) it is clear that S(xt, yt, zt, t, s) = S((x − y)t, (y − 1)t, (z − y)t, t, s).
Substituting commutative variables x, y, z, t for x, y, z, t and using Theorem 7.6 yields the following theorem.
Seeing that Conjecture 21 from [4] follows from the theorem only requires two simple observations: • The pattern p used by Claesson and Linusson is our pattern p silly = rotated 180 degrees. Hence our rmin(π) corresponds to their lmax(π). • The part of their conjecture stating that the triple (rne, min, lev −1) of statistics on posets is equidistributed with the triple (rne, min, int −1) on matchings follows from their Proposition 17 together with the fact that their bijection h preserves rne.

Left crossings and open problems
So far, we have only counted right adjacencies. Turning to the left adjacencies, left nestings are forbidden and thus easily counted. We are, however, able to account for the number of left crossings as well. x p(π) y q(π) z asc short (π) υ asc long (π) = t n π∈Sn s rmin(π) x p(π) y q(π)+asc short (π) υ asc(π) = ∞ n=0 t n π∈Sn s rmin(π) x p silly (π) y q silly (π) υ asc(π) Proof. This theorem amounts only to noting that the number of left adjacencies equals the number of right adjacencies in a matching, since the number of switches from openers to closers is always one more than the number of switches from closers to openers when we traverse through a matching from left to right. Thus, with no left nestings, the number of left crossings equals the number of right crossings and nestings. Mapping long right adjacencies to and , the number of long left crossings must equal the number of long ascents. Theorem 8.1 then gives the first generating function. For the second, the patterns and refine silly ascents, which are equinumerous with ordinary ascents.
It would of course be interesting if we could also pinpoint the positions of the left crossings. To this end, we need to adjust our ascent definition somewhat. Let the ascent bottoms be the set Asc bottom (π) = {π(j) : π(j) < π(j + 1)} and the long ascent bottoms be the set Asc long bottom (π) = {π(j) : π(j) < π(j + 1) − 1}. Based on computations up to n = 8 and n = 7, respectively, we make the following conjectures. Letting go of right adjacencies, we are able to compute the noncommutative generating function for left adjacencies, which constitutes further evidence for the conjectures above.
Proof. To establish the connection between permutations and matchings, there is a fairly simple bijection f from matchings without left nestings to permutations which maps left crossings to ascents. We define the bijection recursively. Assume that M is a matching of size n without left nestings and let M ′ be the matching obtained by removing arc M n , i.e. the arc with the rightmost closer. We then define π = f (M ) from π ′ = f (M ′ ) as follows. Assume that op(M n ) = cl(M j ) − 1: • If j = n, insert n to the far left of π ′ ; • If op(M n ) − 1 is a closer, insert n to the immediate left of j in π ′ ; • If op(M n ) − 1 = op(M k ), insert n to the immediate right of k in π ′ .
It is not obvious that this yields a bijection, since the left of j and the right of k might coincide. However, it is not hard to see that in the second case, n is inserted to the left of an ascent top, breaking an ascent. In the third case, n is inserted to the right of a descent top or to the far right, hence not breaking an ascent. Thus, the map is injective. It is also clear that left crossings are mapped to ascent bottoms, since the left crossing k is introduced in the third case, where k becomes the ascent bottom of n. It is also easy to check that double crossings are mapped to short ascents.
Neither left crossings nor ascent bottoms can be destroyed by adding more arcs or higher elements.
Turning to the generating function, we note that ascent bottoms in a permutation turn into ascent tops in the same permutation rotated 180 degrees. Ascent tops are counted by the patterns P (π), Q(π) and Asc short (π). Thus, by Theorem 7.6 we have ∞ n=1 π∈Sn [υ Asc long (π) z Asc short (π) ; t] n =S(υ, υ, z, t, 1) Since rotating the permutation turns ascent top k into ascent bottom n + 1 − k, the generating function of ascent tops should be the vertical reflection of the generating function for ascent bottoms.
To conclude the picture, we would like to allow left nestings. Is there a nice bijection from all matchings of size n to, for instance, ternary trees? What kind of patterns would be the counterparts of and ? What are the generating functions?
Another possibly fruitful path of generalisation could be to study the distribution of left and right nestings and crossings in partitions. Recent work of Chen et al. [3] and of Yan and Xu [8] shows some progress in this direction.