Enumerative combinatorics of intervals in the Dyck pattern poset

We initiate the study of the enumerative combinatorics of the intervals in the Dyck pattern poset. More specifically, we find some closed formulas to express the size of some specific intervals, as well as the number of their covering relations. In most of the cases, we are also able to refine our formulas by rank. We also provide the first results on the M\"obius function of the Dyck pattern poset, giving for instance a closed expression for the M\"obius function of initial intervals whose maximum is a Dyck path having exactly two peaks.


Introduction
The Dyck pattern poset was first introduced in [BFPW] and further studied in [BBFGPW]. A Dyck path is a lattice path starting from the origin of a fixed Cartesian coordinate system, ending on the x-axis, never falling below the x-axis and using only two types of steps, namely up steps U = (1, 1) and down steps D = (1, −1). The sequence of up and down steps of a Dyck path is a word on the alphabet {U, D} such that each prefix has at least as many U 's as D's and the total number of U 's and D's is the same. Such words are commonly called Dyck words. The total number of letters/steps of a Dyck word/path is called the length of the word/path. In the following we will frequently switch between paths and words, and in particular we will use the same notations when no confusion is likely to arise. Given two Dyck paths P, Q, we say that P ≤ Q when P is a subword of Q (i.e. there exists a subsequence of the letters of Q which, read from left to right, are equal to P ). In this case, we also say that P is a pattern of Q, and any subword of Q which is equal to P is called an occurrence of P in Q. So, for instance, U U DD ≤ U DU DU D, whereas U U DDU D and U U DU U U DDDD are incomparable. The Dyck pattern poset has a minimum, which is the path U D, and has no maximum; moreover, it is graded, the rank of an element being its semilength.
In the above mentioned papers some enumerative properties of the Dyck pattern poset have been investigated, mainly focusing on pattern avoidance questions. Here we start the analysis of the enumerative combinatorics of the intervals of this poset.
Given any poset, one of the most natural aspects to investigate is the structure of its intervals. This has been done in several combinatorially interesting posets, such as for Tamari lattices [CCP, F], the Bruhat order [T], the consecutive pattern poset [EM], to cite just a few. From this point of view, a fairly general problem is that of counting (saturated) chains (here "saturated" means that the chain cannot be extended except at the beginning and at the end). Special instances of this problem are the enumeration of the elements and of the covering relations of the interval (which are saturated chains of length 0 and 1, respectively). Another important quantity associated to a (combinatorially interesting) poset is the Möbius function of its intervals. For our purposes, we can define the Möbius function µ : P 2 → Z of the poset P in the following recursive way (for x ≤ y): µ(x, x) = 1, µ(x, y) = − x≤z<y µ(x, z), when x < y. .
In the present paper we analyze a few types of initial intervals [U D, P ] in the Dyck pattern poset. More specifically, we first consider the case in which P = (U D) n , for some n ∈ N, for which we are able to determine the cardinality of the interval, also refined by rank. Then we examine in detail the case in which P has exactly two peaks (a peak of a Dyck path P is an occurrence of the Dyck path U D as a consecutive pattern in P ): here we find formulas both for the cardinality of the interval (and also in this case we have a refined version for ranks) and for the number of covering relations. We find also a nice bijection between Dyck paths inside the interval [U D, P ] having two peaks and squares fitting inside a rectangle of appropriate dimensions. Finally, we give also a complete description of the Möbius function of such intervals. We remark that the computation of the Möbius function of the Dyck pattern poset is still open for general intervals, and the results contained in the present paper are the first ones for this poset. In the last section, together with some proposals for further work, we also provide some additional results and conjectures on the Möbius function which suggest that the Dyck pattern intervals have a nice structure that certainly deserves to be better investigated.
We close this Introduction by fixing the main notations we are using throughout the paper. Given a poset P and a nonnegative integer ℓ, a saturated chain of length ℓ in P is a sequence (x 0 , x 1 , ..., x ℓ ) of ℓ + 1 elements of P such that x 0 ≺ x 1 ≺ ... ≺ x ℓ , where ≺ denotes the covering relation of P. For a finite poset P, denote with s ℓ (P) the number of saturated chains of length ℓ in P. In particular, s 0 (P) is the number of elements of P, and s 1 (P) is the number of edges of the Hasse diagram of P (which is also the number of coverings relations in P). When P is graded and ℓ, k ∈ N, the number of saturated chains of length ℓ whose top element has rank k will be denoted s (k) ℓ (P). Therefore s ℓ (P) = k≥ℓ s (k) ℓ (P). In particular, s (k) 0 (P) is the number of elements of P having rank k.
Given x ∈ P, we write ∆(x) for the number of elements in P covered by x. Moreover, ∆ t (P) will denote the number of x ∈ P such that ∆(x) = t. As a consequence, we have that s 1 (P) = t≥0 t · ∆ t (P).

Size of the interval
Our first goal is to find an explicit formula for the number of elements of the interval [U D, (U D) n ], for n ∈ N. Recall that, given n, k ∈ N, the Narayana number N n,k is defined as the number of Dyck paths of semilength n having k peaks. It is well known that N 0,0 = 1, N n,k = 1 n n k n k−1 for n, k ≥ 1 and N n,k = 0 in the remaining cases. Suppose now P is a Dyck path and denote with asc(P ) the number of ascents of P , where an ascent of a Dyck path is a maximal consecutive substrings of P of the form U m , for some m > 0. It is clear that asc(P ) also counts the number of peaks of P , in particular N n,k also counts the number of Dyck paths of semilength n with k ascents. The next lemma characterizes Dyck paths in the interval [U D, (U D) n ] in terms of the number of ascents. Lemma 1. Let n > 0, k ∈ {1, ..., n} and P be a Dyck path of semilength k. Then P ≤ (U D) n if and only if asc(P ) ≥ 2k − n.
In order to prove this lemma, it is convenient to regard it as a special case of the following slight generalization.
Suppose first that P is a substring of (U D) n . Then, for each step of P not belonging to a peak, we need one factor U D from (U D) n in order to embed P into (U D) n . Moreover, each peak of P needs just one factor from (U D) n . Thus the total number of factors U D of (U D) n must be at least the sum of the two above quantities, that is which implies the desired inequality.
Suppose now that n ≥ α + β − m. We look for an occurrence of P in (U D) n . It is not hard to see that each step of P not belonging to a peak, as well as each peak of P , requires precisely one factor U D from (U D) n . Thus, for any i, in order to embed Now as an immediate consequence of this lemma we can deduce an explicit formula for s (1) In Figure 1 the Hasse diagram of the interval [U D, (U D) 5 ] is depicted.
The sequence (s )) n≥k≥0 appears as A137940 in [S]. The first few lines of the associated triangle are recorded below (Table 1). As a consequence of the last proposition, and since the Narayana array is symmetric, the k-th diagonal of Table 1 contains the sum of the first k columns of the Narayana array. Therefore, s  2,4,8,16,33,70,152,337 and is not recorded in [S]; however, it is the sequence of the partial sums of A004148 of [S], called "generalized Catalan numbers" and counting, among other things, peakless Motzkin paths with respect to the length. In fact, it is not difficult to find a bijective explanation.  Proposition 2. There is a bijection between [U D, (U D) n ] and the set of peak-less Motzkin paths of length at most n.
Proof. Given a peak-less Motzkin path of length k ≤ n, just replace each of its level steps with a peak: the resulting Dyck path is easily seen to be in [U D, (U D) n ]. Also, it is not difficult to realize that such a map is indeed a bijection.
the generic Dyck paths with two peaks. Our first goal is to find an explicit formula for the cardinality of U D, Q (h) a,b , depending on a, b and h. Without loss of generality, we can suppose b ≥ a ≥ 1. It is clear that each path in the above interval has either one peak or two peaks. The generic path with only one peak in U D, Q (h) a,b has height j, with 1 ≤ j ≤ b + h. Therefore there are b + h such paths. From now on, we will focus on the remaining elements of our interval, i.e. paths having exactly two peaks.
We start with the case h = 0, that is Q : this is the generic nonelevated Dyck path with two peaks.
Proposition 3. Denote with ϕ 0 (a, b) the number of Dyck paths having exactly two peaks in the (2) Proof. The generic Dyck path P with two peaks in [U D, Q a,b ] can be constructed as follows. Start by choosing k up steps from the first run of Q (0) a,b , for k running from 1 to a. Then choose t down steps from the second run: here it must be 1 ≤ t ≤ k, since otherwise P would have some points of negative height. Similarly, the up steps chosen from the third run of Q (0) a,b cannot be too many, otherwise there would remain too few down steps in the last run to complete the Dyck path. Specifically, it is possible to select s up steps from the third run of Q (0) a,b , with k − t + s ≤ b (the quantity k − t + s being the height of the path P at the end of the last ascending run), and so 1 ≤ s as desired.
The sequence (ϕ 0 (a, b)) 1≤a≤b is A082652 in [S], where an interpretations in terms of squares inside an a × b rectangular grid is provided. We will discuss the connections with our combinatorial setting at the end of the present section.
We are now ready to express the number of Dyck paths having exactly two peaks lying below Q where the above partial order on tuples has to be understood componentwise.
For i = h, the above definitions immediately imply that 4,6 and the associated square inside the grid 4 × 6 Iterating this argument, we get: Now observe that, if Γ ∈ C i , then Γ = U i P D i , for some Dyck path P with two peaks. This is due to the fact that, if the first ascending run of Γ has length i + a, the first descending run of . Of course an analogous argument holds if the last descending run of Γ has length i + b. As a consequence, for each i = 1, . . . , h, we can define a function from It is easy to see that such a function is well defined (i.e. P ∈ C 0 ) and is bijective. Thus formula (4) can be rewritten as Finally, in order to enumerate C 0 , we observe that a path P ∈ C 0 is uniquely determined by the length s of its first descending run and the length t of its last ascending run, where 1 ≤ s ≤ a and 1 ≤ t ≤ b. In fact, the unique path of C 0 corresponding to a legal choice of s and t is U Hence we have that |C 0 | = ab. This leads immediately to formula (3), as desired.
As we have already noted, the triangular array determined by (ϕ 0 (a, b)) 1≤a≤b is sequence A082652 in [S], which counts the numbers of squares that can be found in an a × b rectangular grid. We now describe a bijection between the set of such squares and the set [U D, Q a,b ] 2 if and only if i, j ≥ 1, i + k ≤ a and j + k ≤ b. Moreover, a triple (i, j; k) satisfying the above conditions also uniquely determines a square inside an a × b rectangular grid of unit cells as follows. Label the rows of the grid with integers 1, 2, . . . , a from top to bottom and the columns with integers 1, 2, . . . , b from left to right. A unit cell lying at the intersection between row i and column i will be said in position (i, j). A square inside the grid can be characterized by providing the position (i, j) of its topmost and leftmost cell and the length k + 1 of its side. Notice that the triple (i, j; k) determines (in a unique way) a square if and only if i, j ≥ 1, i + k ≤ a and j + k ≤ b. We have thus found the same encoding both for Dyck paths in [U D, Q (0) a,b ] 2 and for squares inside an a × b rectangular grid, which gives the desired bijection. In Figure 2 the path encoded by the triple (2, 3; 2) is mapped into the corresponding square.
The above bijection can be exploited to transport the order structure on Dyck paths to a description in terms of squares in a grid. In the next lemma, we use the above encoding into triples to give an alternative presentation of the pattern order inside [U D, Q Define a partial order on Θ by setting (α, β; γ) ⊑ (i, j; k) when (α, β, γ) ≤ (i, j, min{i + k − α, j + k − β}, where ≤ is the usual coordinatewise order on N 3 . Then (α, β; γ) ⊑ (i, j; k) if and only if (α, β; γ) ≤ (i, j; k) in the Dyck pattern poset, i.e.
since the two paths have the same number of peaks, and so the steps of each run of the smaller path must be selected from the steps of the corresponding run of the larger one. The above inequalities can be equivalently written as (α, β, γ) ≤ (i, j, min{i + k − α, j + k − β}, which is exactly (α, β; γ) ⊑ (i, j; k).
Using the above lemma and bijection, the pattern order on [U D, Q a,b ] 2 can now be expressed as a partial order on the set of squares inside an a × b rectangular grid. Denote with xy| the rectangle having a pair of opposite corners in positions (1, 1) and (x, y). Take two squares Q, Q ′ in the grid whose topmost and leftmost cells are in positions (α, β) and (i, j), respectively, and whose sides have length γ + 1 and k + 1; hence they are encoded by the triples Q = (α, β; γ) and Q ′ = (i, j; k). The partial order on Θ defined in the above lemma can be read off on squares in the following way: Q ≤ Q ′ when the topmost and leftmost cell of Q is in the rectangle ij| and the opposite cell is in the rectangle (i + k)(j + k)|.
Suppose now r ∈ N and 2 ≤ r ≤ a + b. We will refine our previous enumerative result by counting the number of elements in [U D, Q

where [Ω] denotes the characteristic function of the property Ω, that is [Ω] = 1 if Ω is true and
[Ω] = 0 if Ω is false. Proof. We can clearly limit ourselves to considering paths having two peaks, since paths with just one peak inside [U D, Q (h) a,b ] are easily counted (we have exactly one such path for any rank r ≤ b + h).
Using an approach similar to that of Proposition 3, we observe that a generic Dyck path exceed b + h, which is the maximum possible length of the fourth run of P ). Finally, we have i + j + k = r, so that the following relations hold: From the last relation, we have i + k = r − j and j + k = r − i, so that i ≤ r − j and j ≤ r − i. Therefore, after some manipulations, the above inequalities can be equivalently written as follows, in order to make as explicit as possible the ranges of i and j (note that once i and j are fixed, the term k is uniquely determined): These inequalities can be condensed in The above computations immediately lead to a formula for the rank distribution of the Formula 6 is not very easy to read as it is written. However, if we assign specific values to a, b or h, some much nicer expressions can be obtained. For instance, in the particular case h = 0, depending on the value of the semilength r, we get what follows.

Enumeration of covering relations
In this section we work out a formula for the number s 1 ([U D, Q ; as usual, we can assume w.l.o.g. that 1 ≤ a ≤ b. For this purpose, we will use the following lemma.
Proof. A Dyck path having two peaks can cover at most 4 paths, obtained by removing one up step from one of the two ascending runs and one down step from one of the two descending runs. However, in some cases different choices can lead to the same path. Using Proposition 2.1 of [BBFGPW], we get exactly the formula given in the statement.
The above lemma, together with the following formula Therefore it follows from Lemma 4 that ∆ 2 ([U D, Q (0) a,b ]) = (a−1)+(b−1)+(a−1) = 2a+b−3. When n = 3, we have that Again using Lemma 4 and some standard computations, we get Finally, when n = 4, we have that Q Using formula (8), we thus have the following.
Proposition 6. The number of covering relation in the interval [U D, Q a,b ] is given by

The Möbius function
To conclude our analysis of the intervals [U D, Q a,b ] we now completely determine their Möbius function. Note that the Möbius function of intervals of the form [U D, U n D n ] is trivial since these intervals consist of a single chain: • if n = 1, the Möbius function is 1; • if n = 2, the Möbius function is −1; • otherwise, the Möbius function is 0.
The next proposition shows that µ(U D, Q (h) a,b ) is almost always 0. As usual, we assume that a ≤ b.
Proposition 7. If at least one among h and b−a is strictly bigger than 1, then µ(U D, Q (h) a,b ) = 0.
Proof. We use induction on the semilength r It is easy to see that, if the hypothesis of the proposition is satisfied, then r ≥ 4. Moreover, if r = 4, then either a = b = 1 and h = 2 or a = 1, b = 3 and h = 0. In such cases, the maximum of µ(U D, Q (h) a,b ) is either U 3 DU D 3 or U DU 3 D 3 , respectively. and it is immediate to verify that µ(U D, U 3 DU D 3 ) = µ(U D, U DU 3 D 3 ) = 0. Now suppose that r > 4. Consider the longest Dyck path Q a,b such that k, j − i ≤ 1. Such a path can be explicitly described as follows: • if h ≤ 1, then necessarily a + 1 < b, so we set k = h, i = a and j = a + 1; • if h > 1 and a = b, then we set k = 1 and i = j = a; • if h > 1 and a < b, then we set k = 1, i = a and j = a + 1.
From the above construction, it is clear that Q In the r.h.s, the first sum is 0 by definition of Möbius function, and the second sum is 0 as well, since each of its summand is 0. This concludes the proof. Now, to conclude the computation of the Möbius function when the maximum of the interval has exactly two peaks, we have to analyze a few remaining cases.
Proposition 8. If h, b − a ≤ 1, then we are in one of the following cases: 1,1 ) = 1.
Proof. All the small cases (namely, when a ≤ 2) can be easily checked with a simple computation. When a > 2, we can proceed by induction on the semilength of the top of the interval. So, suppose for instance that the top of the interval is Q (1) a,a+1 (the first of the above listed cases). Then, among the paths covered by Q The first sum of the r.h.s is of course 0. To evaluate the second sum, we need to find all a,a such that the absolute value of the difference between the lengths of any two consecutive runs is at most one (otherwise, thanks to the previous proposition, the contribution to the above sum is 0). It is not difficult to realize that, in the case under consideration, the only path with the required properties is Q (0) a−1,a . By induction, we know that µ(U D, Q a−1,a ) = 1, and so we can conclude that µ(U D, Q (1) a,a+1 ) = −1, as desired. The three remaining cases can be dealt with using analogous arguments.

Again on the Möbius function and further work
The combinatorics of the intervals of the Dyck pattern poset is still largely unknown. We have just provided the first results in this directions, concerning the enumerative combinatorics of specific intervals (cardinality and covering relations), as well as the computation of the Möbius function in a special case. Concerning this last topic, we can prove some further results, which give some insight on this important invariant.
First of all, the absolute value of the Möbius function of the Dyck pattern poset is unbounded. This is a consequence of the following.
Proof. Since the interval I n = [(U D) n−1 , (U D) n+1 ] has rank 2, its Möbius function is simply given by the number of its elements covering the minimum (or covered by the maximum) minus 1. Any path greater than (U D) n−1 has at least n − 1 peaks. Any path smaller than (U D) n+1 has at most n peaks; moreover, if it has exactly n peaks, it is necessarily the path (U D) n . In order to count the paths inside I n having exactly n − 1 peaks, we observe that they can be obtained from (U D) n−1 by just adding a new up step to one of the peaks and a new down step to one of the peaks as well (possibly the same one), in such a way that the resulting path is still Dyck. It is not difficult to realize that this is equivalent to choosing a multiset having 2 elements out of a set having n − 1 elements, which can be done in n 2 ways.
We can also determine the maximum value of the Möbius function on intervals of rank 2.
Proposition 10. For all n ≥ 1, µ(U (U D) n−1 D, U (U D) n+1 D) = n 2 , and this is the maximum value attained by µ on intervals of rank 2.
Proof. We start by observing that, for a given path Q of semilength n, the maximum number of paths covering it is n 2 + 1. In fact, if Q has k factors having semilengths f 1 , f 2 , . . . f k , respectively, then, using Proposition 2.2 of [BFPW], we get that the number of paths covering Q is The maximum of the above quantity is indeed n 2 + 1 and is attained when i<j f i f j (which corresponds to having only one factor). To finish the proof, it will be enough to show that, for the interval in the statement of the proposition, all the paths covering the lower path are also covered by the upper path. This can be done quite easily, by means of a case-by-case analysis (just insert in the lower path a U and a D in all possible places and show that the resulting path is still covered by the upper path).
Notice that the above proof does not show that the interval in the statement of the proposition is the unique interval of rank 2 attaining the maximum of the Möbius function.
Some computations also suggest the following conjecture: Conjecture 1. The maximum absolute value of the Möbius function on intervals of rank 3 is (2n + 1) · n 2 , attained by the interval [U (U D) n−1 D, U (U D) n+2 D].
Another intriguing conjecture, again supported by computational evidence, is the following: Conjecture 2. The Möbius function is alternating, meaning that it is ≥ 0 on intervals of even rank and ≤ 0 on intervals of odd rank.
The above conjecture suggests that the intervals of the Dyck pattern poset might all be shellable.
Concerning the enumerative combinatorics of the intervals in the Dyck pattern poset, we still have to understand what happens in most of the cases. Counting elements and covering relations in the case of initial intervals in which the maxiumum has exactly three peaks could be a good starting point. Moreover, there are some asymptotic issues that seem to be rather interesting. Indeed, some computations suggest that the maximum size of an interval of fixed rank whose minimum has semilength n is polynomial in n (when n tends to infinity). Finally, we remark that this kind of investigations, which has already been pursued for many combinatorially interesting posets (as we recalled in the Introduction), seems to still be lacking for the permutation pattern poset.