Enumeration of Some Classes of Pattern Avoiding Matchings, with a Glimpse into the Matching Pattern Poset

A matching of the set [2n]={1,2,…,2n}\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$[2n]=\{1,2,\ldots ,2n\}$$\end{document} is a partition of [2n] into blocks with two elements, i.e. a graph on [2n], such that every vertex has degree one. Given two matchings σ\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\sigma $$\end{document} and τ\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\tau $$\end{document}, we say that σ\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\sigma $$\end{document} is a pattern\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$pattern $$\end{document} of τ\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\tau $$\end{document} when σ\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\sigma $$\end{document} can be obtained from τ\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\tau $$\end{document} by deleting some of its edges and consistently relabelling the remaining vertices. This is a partial order relation turning the set of all matchings into a poset, which will be called the matching pattern poset. In this paper, we continue the study of classes of pattern avoiding matchings (see below for previous work on this subject). In particular, we work out explicit formulas to enumerate the class of matchings avoiding two new patterns, obtained by juxtaposition of smaller patterns, and we describe a recursive formula for the generating function of the class of matchings avoiding the lifting of a pattern and two additional patterns. Moreover, we introduce the notion of unlabeled pattern, as a combinatorial way to collect patterns, and we provide enumerative formulas for two classes of matchings avoiding an unlabeled pattern of order three. In one case, the enumeration follows from an interesting bijection between the matchings of the class and ternary trees. The last part of the paper initiates the study of the matching pattern poset, by providing some preliminary results about its Möbius functions and the structure of some simple intervals.


Introduction
Let n ∈ N * and set as usual  is the same as a graph on [2n] such that every vertex has degree one; hence, we will borrow some standard terminology from graph theory, as well as the usual representation of graphs using diagrams consisting of dots and lines. In particular, every matching of [2n] will be represented either by a circular or by a linear chord diagram, as shown in Fig. 1. Let τ be a matching of [2n]. The integer n, i.e., the number of edges of τ , will be called the order of τ and will be denoted by |τ |. The set of all matchings will be denoted by M and the set of all matchings of order n will be denoted by M n . Given e ∈ τ , the integers min(e) and max(e) will be called the left vertex and the right vertex of e, respectively. Given a subset S of τ and e ∈ S, we will say that e is the leftmost (respectively, rightmost) edge of S when min(e) ≤ min(f ) (respectively, max(e) ≥ max(f )) for every f ∈ S. Following [23], we will represent τ by means of the unique integer sequenceτ ∈ [n] 2n such thatτ min(e) =τ max(e) andτ min(e) <τ min(f ) for every e, f ∈ τ such that min(e) < min(f ). Using this encoding, the vertices of τ are represented by the elements ofτ and two vertices of τ are connected by an edge when the corresponding components ofτ are equal (see Fig. 2).
In the following, we will always identify matchings with their corresponding integer sequences. Let σ and τ be matchings. The matching σ(τ +|σ|) will be called the juxtaposition of σ and τ (where τ + |σ| denotes the sequence obtained from τ by adding |σ| to each of its elements). Its linear chord diagram can be indeed represented by juxtaposing the linear chord diagrams of σ and τ , respectively. The matching 1(τ + 1)1 will be called the lifting of τ . Its linear chord diagram can be represented by nesting the linear chord diagram of τ into an additional edge. The matching obtained from the sequence τ n . . . τ 2 τ 1 by suitably renaming its elements so as to obtain a valid matching will be called Given k ∈ N * , let σ be a matching of [2k] and i = (i 1 , . . . , i 2k ) ∈ [2n] 2k . We say that i is an occurrence of σ in τ when i 1 < i 2 < · · · < i 2k and {i p , i q } ∈ τ if and only if {p, q} ∈ σ, for every p, q ∈ [2k] (see Fig. 3).
We say that σ is a pattern of τ , and write σ ≤ τ , when there is an occurrence of σ in τ , and that τ avoids σ otherwise. The relation ≤ is a partial order turning the set of all matchings into a poset, which we will call the matching pattern poset. If S is a set of matchings, the class of all matchings avoiding every pattern in S will be denoted by M(S), the class of all matchings in M(S) of order n will be denoted by M n (S), and the generating function of the sequence {|M n (S)|} n∈N will be denoted by M(S, z). We say that σ and τ are Wilf-equivalent when M(σ, z) = M(τ, z).
The study of pattern posets is nowadays a major trend in enumerative combinatorics. The notion of pattern for permutations [24], for instance, has proved incredibly prolific, giving rise to a great deal of research papers with applications to several disciplines. There are however many other combinatorial structures for which the notion of pattern has revealed very fruitful, such as set partitions [28], words [8], lattice paths [4,11], trees (both labeled [14] and unlabeled [12,27]), and polyominoes [3]. See also the article [30], which lays the groundwork for a general theory of pattern posets.
The goal of our paper is to continue the study of classes of pattern avoiding matchings, initiated in [6,10,23]. Our focus is mainly enumerative, aiming at extending some results and suggesting further lines of research concerning the enumeration of classes of pattern avoiding matchings. Moreover, we begin the investigation of the structure of the matching pattern poset, which appears to be highly nontrivial (for instance, it contains the permutation pattern poset as an induced subposet). More in detail, the paper is organized as follows.
In Sect. 4, we introduce the notion of unlabeled matching, which is an equivalence class of matchings having the same unlabeled circular chord diagram. This seems a reasonable and combinatorially meaningful way to collect patterns. As a first result concerning unlabeled pattern avoidance, we provide enumerative formulas for two classes of matchings avoiding an unlabeled pattern of order three, as well as a bijection between matchings avoiding a certain unlabeled pattern and ternary trees.
Section 5 is a first step towards the study of the structure of the matching pattern poset. Specifically, we find some properties of the Möbius function (which allow us to easily compute it in several cases, especially in the induced subposet of noncrossing matchings) and we illustrate some formulas for counting elements of specific intervals.
Finally, Sect. 6 provides some hints for further work. , respectively. It is easy to see that the map sending every permutation to the corresponding permutational matching is a poset embedding; hence, we can regard the permutation pattern poset as a subposet of the matching pattern poset. Throughout this paper, we will denote by C n = 1 n+1 2n n the n th Catalan number and by C(z) the generating function of Catalan numbers. As for other enumerative results on pattern avoidance, it is well known that noncrossing matchings have a Catalan structure; therefore, |M n (1212)| = C n , and it is also well known that nonnesting matchings are counted by the same sequence, that is, |M n (1221)| = C n . More surprisingly, it was proved in [10] that the matchings 123 . . . k123 . . . k and 123 . . . kk . . . 321 are Wilf-equivalent for every k ∈ N * . No closed formula for the number of matchings avoiding these patterns is available in general, although it was proved in [21] that |M n (123123)| = C n C n+2 − C 2 n+1 . Furthermore, Wilf-equivalences between several classes of patterns are established in [23] through bijective methods; for instance, as an immediate consequence of Lemmas 3.7 and 3.10 in that paper, one can deduce the following useful fact. Moreover, the same paper also contains an enumerative result which reduces the enumeration of M(11(σ + 1)) to the enumeration of M(σ) in a recursive fashion. Finally, aside for the classes of patterns mentioned above, the only (up to Wilf-equivalence) further class of matchings avoiding a small pattern has been enumerated in [6], proving that M(123132, z) = 54z

Previous Work
In the same paper, some enumerative results are given for most of the classes of matchings avoiding a pair of permutational patterns of order three. Nevertheless, enumerating all the remaining classes of matchings avoiding a single patterns of order three remains an open problem and it is likely to be a hard one. Indeed, it is suggested in [6] that enumeration of the class of matchings avoiding the pattern 123231 could be related to the enumeration of the class of permutations avoiding 1324, which is considered to be a very hard problem.

The Juxtaposition of Two Patterns
Let σ and τ be two matchings. In this section, we investigate the class of matchings avoiding the juxtaposition of σ and τ . To this purpose, we define a set of matchings depending on σ. Let n ∈ N and λ be a matching of order n. We will say that λ minimally contains σ when it contains σ and the matching obtained from λ by deleting its rightmost edge does not contain σ. Denote by μ(σ) the set of matchings minimally containing σ, by μ n (σ) the set of elements in μ(σ) with order n and by μ(σ, z) the corresponding generating function. Generalizing an approach already used in [23], the following formula allows us to relate the enumeration of M(σ(τ + |σ|)) to the enumeration of M(σ), μ(σ) and M(τ ).
Proposition 3.1. Let σ and τ be matchings and n ∈ N, with n ≥ |σ|. Then Proof. Given λ ∈ M n (σ(τ + |σ|)), then either λ ∈ M n (σ) or σ is a pattern of λ. From now on, we assume that the latter case occurs, since the former one is taken into account by the first summand in the right-hand side of (1). For h ∈ [2n], we denote by λ ≤h the pattern of λ consisting of all the edges of λ with both vertices smaller than or equal to h, by λ ≥h the pattern of λ consisting of all the edges of λ with both vertices bigger than or equal to h and finally by λ h the pattern of λ consisting of all the edges of λ that are neither in λ ≤h nor in λ ≥h . Note that an edge of λ belongs to λ h if and only if its left vertex is smaller than or equal to h and its right vertex is bigger than or equal to h. Now, let h denote the smallest integer such that λ ≤h contains an occurrence of σ (of course, such an h exists, because λ ≤2n = λ) and let be the order of λ ≤h . Then, by definition, λ ≤h ∈ μ (σ) and ∈ {|σ|, . . . , n}; hence, there are |μ (σ)| possible choices for λ ≤h . Furthermore, λ h ∈ M k (1122) for some k ∈ {0, . . . , n − }; hence, there are |M k (1122)| = k! possible choices for λ h . Moreover, λ ≥h ∈ M n− −k (τ ), because λ ∈ M n (σ(τ + |σ|)); hence, there are |M n− −k (τ )| possible choices for λ ≥h . Finally, notice that h = 2 + k and that the vertex h necessarily belongs to λ ≤h ; hence, the left vertices of the edges of λ h can be chosen among the vertices of λ smaller than h in 2 +k−1 k ways. Similarly, the right vertices of the edges of λ h can be chosen among the vertices of λ bigger than h in 2n−2 −k k ways. Notice that all possible choices of the vertices of λ ≤h and λ h satisfying the above constraints lead to valid matchings. This explains the factors in the remaining summands of the right-hand side of (1) and concludes the proof.
Unfortunately, Formula (1) is not very informative, as enumerating μ(σ) is often as difficult as enumerating M(σ) itself. Nevertheless, one might still hope that this task can be achieved for some special prefixes σ. For instance, note that, for σ = 11 and n ∈ N * , we easily recover the formula which can be found in [23]. The next proposition shows that the prefix σ = 1212 can be successfully addressed as well. We just need a couple of definitions. We say that a matching is connected when it is nonempty and it is not the juxtaposition of two nonempty matchings. A connected component of a matching λ is a maximal connected submatching of λ (where maximal refers to the number of edges). It is clear that every matching can be decomposed as the juxtaposition of its connected components.
Proof. Let n ≥ 1. Note that any matching λ ∈ μ n+1 (1212) can be obtained by inserting the left vertex of the rightmost edge of λ in one of the available positions between the vertices of a noncrossing matchingλ of order n. More specifically, can be inserted in any position between the vertices ofλ other than the positions between the connected components ofλ. Therefore, ifλ has k connected components for some k ∈ [n], there are 2n − k possible positions for the vertex between the vertices ofλ. It follows that: where C n,k denotes the number of matchings of order n with k connected components. The triangle {C n,k } 1≤k≤n is sometimes called the transposed Catalan triangle (sequence A033184 in [29]). A closed formula for its entries is given by for every n, k ∈ N such that 1 ≤ k ≤ n. Plugging this expression into formula (2) and observing that 2n−k Now, when n, k ∈ N and 1 ≤ k ≤ n, it is not difficult to show by induction on n that Indeed identity (4) is trivial for n = 1 and, when n ≥ 2, it follows by induction that: From Eqs. (3) and (4), we thus get as desired.
Unfortunately, we have not been able to provide a neat combinatorial argument to explain the appearance of the binomial coefficient in Proposition 3.2. However, observe that, as a byproduct, we also find the following identity: which holds for every n ∈ N such that n ≥ 2. Indeed, the left-hand side of the above equation counts all matchings in μ n (1212) by deleting the rightmost edge, and then counting the resulting 1212−avoiding matchings according to the number of connected components. As an immediate consequence of Propositions 2.1, 3.1 and 3.2, we deduce the following.
Specializing τ in Theorem 3.1, we are able to enumerate a couple of new classes of matchings avoiding a single pattern (see also Table 1). Recall that, as we reported in Sect. 2, the patterns τ appearing in the next corollary are among the very few ones whose avoiders have been enumerated.

The Lifting of a Pattern
In this section, we investigate classes of matchings avoiding the lifting of a given matching σ. The enumeration of such classes seems to be a hard problem in general, since a special instance of it is the enumeration of matchings avoiding the pattern 123231, which is the lifting of 1212, and it was remarked in Sect. 1 that this is likely to be a hard problem. However, if we impose additional constraints, namely the avoidance of a special pattern χ and its reversal χ, the description of the structure of matchings avoiding the lifting of σ becomes more accessible. We start by fixing some preliminary definitions. Let e and f be any two edges of σ. We say that e is nested in f when min(f ) < min(e) and max(e) < max(f ). We say that e is a nested edge when it is nested in some edge of σ and that e is a top edge otherwise. The pattern of σ consisting of all the nested edges of σ will be called the core of σ and the pattern of σ consisting of all the top edges of σ will be called the roof of σ. Note that, by definition, the roof of σ is a nonnesting matching. Recall that a matching is said to be connected when it is nonempty and it is not the juxtaposition of two nonempty matchings. Let S be a set of matchings and n ∈ N, we denote by M * (S) the class of all connected matchings avoiding S, by M * n (S) the set of matchings in M * (S) of order n and by M * (S, z) the generating function of M * (S). In the following, we will make some use of the so-called symbolic method, borrowing some standard constructions and notations from [18], such as disjoint union, cartesian product and composition of combinatorial classes (in particular, the operator Seq), which will allow us to easily translate combinatorial descriptions into generating functions.
which means that, for every n ∈ N * , there are C n−1 connected nonnesting matchings of order n.
We are now in a position to state and prove the main result of this section.

Theorem 3.2.
Let σ be a connected matching and set χ = 123132, so that χ = 123213. Then Proof. Let n ∈ N * , λ ∈ M * n (1(σ + 1)1, χ, χ) and m be the order of its roof. The matching λ is required to avoid both χ and χ, that are the matchings represented by the following linear chord diagrams: This means that every nested edge of λ is forced to never cross a top edge of λ. Therefore, the core of λ can be decomposed as the juxtaposition of 2m − 1 (possibly empty) matchings λ 1 , . . . , λ 2m−1 ∈ M(σ, χ, χ); moreover, the occurrences of these factors in λ are separated by the vertices of the top edges of λ. Conversely, every matching constructed as above belongs to the class M * (1(σ + 1)1, χ, χ), because σ is connected, and so, no occurrence of σ can show up by juxtaposing two patterns in the class M(σ, χ, χ). Thus, M * n (1(σ + 1)1, χ, χ) is the set of matchings obtained by choosing some m ∈ N * and a matching in M * m (1221), then replacing its edges other than the rightmost one with ({ }×M * (σ, χ, χ) 2 )− structures and the rightmost edge with a ({ } × M * (σ, χ, χ))− structure. An instance of this decomposition is illustrated in the following figure, when the roof is 121323, and where each of the isolated points inside a box is one vertex of the edge of the roof incident to that box.
It follows that the combinatorial class M * (1(σ + 1)1, χ, χ) is isomorphic to the combinatorial class: and this isomorphism immediately translates into the following expression for the generating function: Now, the claim follows from the above Remark.
Note that, at least in principle, iterating Theorem 3.2 allows us to find expressions for the generating function of M(12 . . . k(σ + k)k . . . 21, χ, χ) in terms of the generating function of M(σ, χ, χ), for every k ∈ N * . As an immediate application, we are able to compute the generating function of two classes of matchings avoiding three patterns of order three.
Applying the change of variable y = zC(z), so that z = y(1 − y) and C(z) = 1 1−y , some routine computations show that f (z) = 1 1−zC(z)C(C(z)−1) ; hence, the second claim also follows. Sequence A125188 of [29] counts Dumont permutations of the first kind avoiding the patterns 2413 and 4132, but we have not been able to find any bijection with our classes of pattern avoiding matchings. Note that, for σ ∈ {1212, 1221}, iterating Theorem 3.2 allows us to prove that M(12 . . . k(σ +  k)k . . . 21, χ, χ, z) is an algebraic function of C(z); hence, it is itself algebraic, for every k ∈ N * .

Unlabeled Pattern Avoidance
In this section, we introduce the notion of unlabeled matching, which provides a way to collect patterns that are combinatorially equivalent, in a sense that is specified below. Given n ∈ N * , let γ n denote the 2n−cycle (1 2 .
As a consequence, its coefficients have the following closed form: for n ≥ 2.

the previous characterization of matchings in A amounts to a bijection between A and (B × {}) × C × (C × {}), which immediately translates into the functional equation
for the generating functions A(z), B(z) and C(z) of A, B and C, respectively. Now, it is well known that B(z) = 1−z 1−2z and C(z) = 1 1−z , and therefore which is the generating function of sequence A000295 in [29], whose n th term is called the n th Eulerian number and can be written as 2 n − n − 1, as desired.
Our last result concerns the unlabeled pattern [123132], which is represented by the following unlabeled chord diagram: It turns out that matchings avoiding [123132] have a ternary tree structure and the following discussion is in fact devoted to describe a bijection between this class of matchings and ternary trees. To this purpose, recall that, for k ∈ N * , a k-ary tree is an ordered rooted tree, such that every node has at most k children, each of which is labeled as the i-th child, for some i between 1 and k (and no two children having the same label). Notice that, according to such a definition, a node can have its i-th child without having its j-th child, for some j < i. In the pictorial description of a k-ary tree, the children of a node are depicted in increasing order of their labels from left to right. Let T k denote the combinatorial class of k−ary trees. Note that every k−ary tree is either empty or it can be decomposed as in the following figure: where • is the root and T 1 , . . . , T k ∈ T k . Therefore, the combinatorial classes T k and {∅} + {•} × (T k ) k are isomorphic and the isomorphism translates into the functional equation T k (z) = 1 + zT k (z) k for the generating function T k (z) of the class T k . This equation can be classically solved by Lagrange's inversion as follows: In particular, when k = 3, we thus get [z n ]T 3 (z) = 1 2n + 1 3n n for every n ∈ N * . This is sequence A001764 in [29]. Now, we recursively define a map ϕ : ) as follows. Set ϕ(∅) = ∅; furthermore, for every (T 1 , T 2 , T 3 ) ∈ (T 3 ) 3 , let ϕ(•, T 1 , T 2 , T 3 ) be the matching whose linear chord diagram Γ is constructed as follows: 1. Denote by Γ (i) the linear chord diagram of ϕ(T i ), for every i ∈ {1, 2, 3}. 2. If Γ (1) is empty, then: 1. draw a vertex to the left of a vertex r and connect them with an edge; 2. draw Γ (2) between and r and Γ (3) to the right of r . 3. If Γ (1) is nonempty, then: 1. let and r denote the left and right vertex of the leftmost edge of Γ (1) , respectively; draw two vertices and r to the left of and r, respectively, and connect them with an edge. 2. draw Γ 2 between and and Γ 3 between r and r. In other words, the map ϕ can be represented by the following diagram: We then define ψ(λ) = (•, ∅, ψ(λ 2 ), ψ(λ 3 )). 2. Suppose that the leftmost edge of λ crosses some other edge of λ and let denote the leftmost edge of λ among those crossed by . Let λ 2 denote the pattern of λ consisting of all e ∈ λ such that min( ) < min(e) < max(e) < min( ) and let λ 3 denote the pattern of λ consisting of all e ∈ λ such that max( ) < min(e) < max(e) < max( ). Finally, let λ 1 denote the pattern of λ consisting of all the remaining edges of λ other than . We then define ψ(λ) = (•, ψ(λ 1 ), ψ(λ 2 ), ψ(λ 3 )).  M([123132]). Using the same notation as in the definition of ϕ, we first observe that (by induction hypothesis) there is no occurrence of Λ in Γ (1) . Furthermore, the edge { , r } cannot be involved in any occurrence of Λ. Suppose in fact that Λ 0 is an occurrence of Λ involving { , r }. If Γ (1) is nonempty, then it is not difficult to realize that the leftmost edge { , r} of Γ (1) cannot occur in Λ 0 (this is due to the choice of the specific pattern To conclude, it suffices to prove that ϕ and ψ are mutually inverse, which is immediate by their construction. An instance of the bijections ϕ and ψ is shown in Fig. 4.

A Glimpse into the Structure of the Matching Pattern Poset
As we have already observed in the Introduction, the poset structure of the set of all matchings of finite order associated with the notion of pattern appears to be rather complicated. This is witnessed, for example, by the fact that the subposet of permutational matchings is isomorphic to the permutation pattern poset, whose structure is still far from being completely understood. Here, we aim at laying the groundwork for the investigation of the matching pattern poset, with a particular emphasis on aspects such as the combinatorics of intervals and the Möbius function.

Combinatorics of Intervals: Preliminary Results
From a combinatorial point of view, typical questions on intervals of a poset concern the counting of elements or, more generally, the enumeration of (saturated) chains of a given interval. These are problems that have been classically studied for many combinatorial posets, such as Bruhat orders [31], Tamari lattices [9,15], and Stanley (or Dyck) lattices [16,17]. In this section, we just scratch the surface of this vast subject, by proposing a couple of relatively simple results concerning the enumeration of intervals of the form [ , τ], when τ has a specific form. In particular, in all the cases, we will consider τ to be noncrossing. Before starting, we point out that, when restricted to noncrossing matchings, the notion of pattern on matchings essentially reduces to that of noncontiguous pattern on plane trees, introduced in the case of binary (and m-ary) trees in [12,19]. In fact, both noncrossing matchings and plane trees belong to the so-called "Catalan family" (of combinatorial objects counted by Catalan numbers), and it turns out that the classical bijection between noncrossing matchings and plane trees is more precisely an order isomorphism between the associated pattern posets. The relevance of the notion of pattern (or related ones) for trees can also be inferred by several articles exploiting it to address a wide range of problems (see for instance [25] for application to generalization of the secretary problem, [20] where the asymptotic of pattern occurrence is studied, and [2] for an application to database theory).
Given a matching τ , we say that an edge of τ is small whenever its vertices are consecutive integers. If τ (n, k) is a noncrossing matching of size n having k small edges, what is the cardinality of the interval [ , τ(n, k)]? This may be a difficult problem in general. Here, we address only a few very simple cases.
When k = 2, the generic noncrossing matching having two small edges has the following form: where an edge labeled x stands for a totally nesting matching having x edges. In words, the above matching is the juxtaposition of two totally nesting matchings having r and s edges, respectively, enclosed in a totally nesting matching having k edges. To have easy inline notations, such a matching will be denoted k(r; s). Assuming w.l.o.g. that r ≥ s, it is easy to see that [ , k(r; s)] contains r + k matchings having 1 small edge and rs(k + 1) matchings having two small edges. Therefore, |[ , k(r; s)]| = r + k + rs(k + 1).
When k = 3, again w.l.o.g., the generic matching τ (n, 3) has the form Similarly as before, we denote the above matching with k(h(a; b); c). We can count the elements of [ , k(h(a; b); c)] with respect to the number of small edges.
• In order to count the number χ 1 of matchings having one small edge, we have to understand how many edges the largest totally nesting matching smaller than k(h(a; b); c) has. To construct such a matching, we take the k external edges, and add the largest number between c and h+max(a, b). Therefore χ 1 = max(k + h + a, k + h + b, k + c). • Matchings having two small edges can be obtained in two different ways from k(h(a; b); c). First, we can remove the totally nesting matching having c edges, thus obtaining the matching (h + k)(a; b), which has ab(h + k+1) matchings with 2 small edges below. The second option is to remove one of the two totally nesting matchings with a and b edges, and precisely the smaller one, thus obtaining the matching k ((max(a, b) + h); c), which has (max(a, b) + h)c(k + 1) matchings with 2 small edges below. However, there are matchings in common in the two above cases, which causes an overcount. Indeed, the matchings which can be obtained in both the above cases are precisely those lying below k(a; min(b, c)) and having 2 small edges, which are a · min(b, c) · (k + 1). From the above consideration, we can write the total number χ 2 of elements of the interval [ , k(h(a; b); c)] having 2 small edges, which is • Finally, the total number χ 3 of matchings in [ , k(h(a; b); c)] having 3 small edges is immediate to compute, and we get χ 3 = abc(h + 1)(k + 1).
Summing up the above contributions, we then find the desired closed expression for | [ , k(h(a; b); c)]|.
Our last example concerns a class of noncrossing matchings defined in a recursive fashion. Before introducing them, we state an easy, but useful, lemma whose proof is left to the reader. Lemma 5.1. Let σ and τ be any matchings. Then the following are equivalent: , and • τ 2n = τ 2n−1 .
Denote by f n the cardinality of the interval [ , τ n ] and by f n,k the number of elements having k edges of the same interval, for k > 0. In particular, it is clear that f n,k = 0 for n < k and whenever n ≤ 0 or k ≤ 0 (actually, when n = k = 0, we set f n,k = 0 by convention). In the next proposition, we give closed formulas for such quantities. Proposition 5.1. Let n > 0 and 0 < k ≤ n, and denote by ϕ n the n-th Fibonacci number (with ϕ 0 = 0 and ϕ 1 = 1). Then Proof. We use the following notations: A n,k is the set of all matchings in [ , τ 2n ] having k edges, B n,k is the set of all matchings in [ , τ 2n−1 ] having k edges, and C n,k is the set of all matchings of the form σ , with σ ∈ B n,k−1 .
We then have that f 2n,k = |A n,k | = |B n,k |+|C n,k |−|B n,k ∩C n,k |. By definition, we have |B n,k | = f 2n−1,k , and clearly, |C n,k | = f 2n−1,k−1 . Furthermore, as a consequence of Lemma 5.1 and of the specific shape of the matchings under consideration, the set B n,k ∩ C n,k is precisely the set of matchings of the form σ , with σ ∈ B n−1,k−1 ; hence, |B n,k ∩ C n,k | = f 2n−3,k−1 . We thus get the recurrence relation f 2n,k = f 2n−1,k + f 2n−1,k−1 − f 2n−3,k−1 . Using a completely similar argument, we can also prove the analogous recurrence f 2n−1,k = f 2n−2,k + f 2n−2,k−1 − f 2n−4,k−1 . Summing up, we thus have the following recurrence relation, which holds for all n, k ≥ 2: Together with the starting condition f 1,1 = 1, formula (5) allows us to compute the generating function F (x, y) = n,k≥0 f n,k x n y k . Indeed, using standard arguments, our recurrence translates into the functional equation It turns out that F (x, y) = xyG(x, y), where G(x, y) is the generating function given in [29] for the number triangle A004070: from there, we deduce the desired closed form given in (i) for f n,k . Moreover, denoting with Φ(x) = n≥0 ϕ n x n the generating function of Fibonacci numbers, it is easy to see that which proves (ii).

The Möbius Function: Preliminary Results
In the present section, we deal with the Möbius function of the matching pattern poset M. For this reason, the symbol μ here is reserved for the Möbius function (and so matchings will be denoted with different symbols). For our purposes, we can define the Möbius function μ : P 2 → Z of a locally finite poset P in the following recursive way (for x ≤ y): μ(x, x) = 1, μ(x, y) = − x≤z<y μ(x, z), when x < y.
We now wish to exploit a powerful result that relates the Möbius functions of two posets, when one is the image of the other under a closure operator. To this aim, we first need some preliminary notations and results, and then, we need to define some "interesting" closure operators on M.
A closure operator on a poset P [26] is a map c : P → P such that, for all x, y ∈ P: An element x ∈ P is said to be closed when c(x) = x. Denote by P c the set of closed elements of P (with respect to the closure operator c).
The proof of the following lemma is easy, and so, it is left to the reader.
Let σ be a connected matching. Given α ∈ M, we express it as α = Mρ, where ρ is the longest suffix of connected components of α such that ρ ≤ σ. Notice that both ρ and M can be empty. This will be called the σ-decomposition of α. In the rest of this section, every matching will be tacitly assumed to be expressed by means of its σ-decomposition, for some given connected matching σ.
Define the map k σ : M → M by setting k σ (α) = k σ (Mρ) = Mσ. The following lemma is immediate. Proof. It is easy to see that, for any matching α, we have α ≤ k σ (α) and k σ (k σ (α)) = k σ (α). Now, suppose that α ≤ β, and let α = Mρ, β = Nτ be the σ-decompositions of α and β, respectively. We start by observing that necessarily M ≤ N . To prove this, consider the rightmost occurrence of α into β. If the rightmost connected component of M of such an occurrence were contained in τ , then ρ would not be the longest suffix of α contained in σ (since τ ≤ σ), which is a contradiction. Then, necessarily, the rightmost connected component of M is contained in N , which means that there exists an occurrence of M into N , that is M ≤ N . Thanks to this fact, we then get k σ (α) = k σ (Mρ) = Mσ ≤ Nσ = k σ (Nτ ) = k σ (β), as desired.
Proof. This is an immediate consequence of Lemma 5.2 and Proposition 5.2. Some special cases of the above corollary are particularly relevant. 1. The closure operator c maps a matching α to the matching α , unless the rightmost connected component of α is a single edge, in which case α is left unchanged. 2. Generalizing the previous example, for any k > 0, denote by k the totally nesting matching having k edges (observe that, with this notation, 1 = ). The closure operator c k maps a matching α = to the matching αk, unless the rightmost connected component of α is h, with 0 < h ≤ k; in such a case, α is mapped into the matching obtained by completing the rightmost connected component to k.
The following corollary states some useful consequences of Corollary 5.1 in connection with Theorem 5.1.
Proof. 1. Suppose that the rightmost connected component of the matching α is not a single edge and consider the closure operator c 1 = c . The set of matchings whose closure is equal to c 1 (α) is {α, α }. Using Theorem 5.1 (and recalling that is closed), we thus get Now, observe that closed elements (with respect to c 1 ) are precisely those matchings whose rightmost connected component is a single edge. Therefore, in the subposet P c1 , the interval [ , α ] has a single atom (which is ), and so its Möbius function is 0. Using a similar argument, since the only matching whose closure is equal to α is α itself, again Theorem 5.1 says that μ( , α ) = μ c1 ( , α ), and the right-hand side is equal to 0 for the same reason as above. 2. We proceed by induction on k. First, suppose that k = 2, and consider the closure operator c 2 . Using Theorem 5.1 and the hypothesis on α (that is, α's rightmost component is different from 1 and 2), we get that μ( , α) + μ( , α1) + μ( , α2) = μ c2 ( , α2).
Similarly as before, we observe that the closed elements (with respect to c 2 ) are those matchings whose rightmost connected component is 2; hence, the interval [ , α2] has exactly one atom (which is 2); hence, μ c2 ( , α2) = 0. Together with the result in the previous item, we thus have that μ( , α2) = 0. Now, fix h ≤ k and suppose that μ( , αt) = 0, for all t < h, t ≥ 2. This time, we exploit the closure operator c h , which allows us to apply Theorem 5.1 to get h t=0 μ( , αt) = μ c h ( , αh).
Again, the summands in the left-hand side depend on the fact that α's rightmost connected component is not h, and the usual argument shows that the right-hand side is 0. Moreover, for every 2 ≤ t < h, we have μ( , αt) = 0 (by inductive hypothesis, using the assumptions on the rightmost connected component of α). Summing up, and using again the result of item 1, we thus get that μ( , αh) = −μ( , α) − μ( , α1) = 0.
3. This is not a direct consequence of Corollary 5.1; however, we use a closure operator whose definition is somewhat analogous to that of c 1 . Consider the map c 1 defined by setting c 1 (α) = α if α is a matching of order n having at least two edges, such that (1, 2n) is not an edge; otherwise, c 1 (α) = α. It is possible to prove that c 1 is a closure operator (and we leave this to the reader). Applying Theorem 5.1 in a way similar to what we did for c 1 then gives the desired result.
The above results allow us to efficiently compute the Möbius functions in several cases, especially in the induced subposet of noncrossing matchings. Consider, for instance, the interval I = , .
Using Theorem 5.1 with the closure operator c = c σ , where σ = , we get μ , + μ , The interval I in the subposet of closed elements has a unique atom (which is σ); hence, the right-hand side is equal to 0. Moreover, thanks to Corollary 5.2, and the second and the third summand of the left-hand side are equal to 0, whereas the fourth and the fifth are opposite. As a consequence, we have that μ , = 0.
Another interesting example concerns the matchings τ n introduced in the previous section. An immediate application of our results (whose details we omit) gives that μ(τ n ) = (−1) n−1 , for all n ≥ 1.

Conclusion and Further Work
The enumerative combinatorics of the matching pattern poset remains still largely unknown. Although some major efforts to enumerate pattern avoiding matchings have already been spent, as mentioned in Sect. 2, the enumeration of most classes of matchings avoiding a single pattern of order three is still lacking. To this regard, in the present paper, we have introduced the notion of unlabeled pattern, and we have enumerated matchings avoiding the unlabeled patterns [123123], [112323], and [123132], respectively. However, we did not succeed in finding a formula for the number of matchings avoiding the remaining two unlabeled patterns of order three, namely [123321] and [112233], although matchings in the former class seem to have a rather neat combinatorial structure.
In Sect. 5, we have started the investigation of the combinatorial structure of intervals in the matching pattern poset, with special emphasis on enumerative issues. However, all important general questions concerning this topic are completely unanswered yet. How many elements does a generic interval contain? How many (saturated) chains of fixed length? What is the Möbius function of a generic interval? In which cases does an interval have a (possibly distributive) lattice structure? Notice that the subposet of noncrossing matchings is isomorphic to the pattern order on 231-avoiding permutations (this is rather easy to show, see also [1,13]). This can be useful, for instance, in the computation of the Möbius function, since the results developed in [7] can be applied. However, it is possible (and maybe likely) that the specific combinatorial structure of matchings may help in finding neater formulas.