Enumeration of Stack-Sorting Preimages via a Decomposition Lemma

We give three applications of a recently-proven"Decomposition Lemma,"which allows one to count preimages of certain sets of permutations under West's stack-sorting map $s$. We first enumerate the permutation class $s^{-1}(\text{Av}(231,321))=\text{Av}(2341,3241,45231)$, finding a new example of an unbalanced Wilf equivalence. This result is equivalent to the enumeration of permutations sortable by ${\bf B}\circ s$, where ${\bf B}$ is the bubble sort map. We then prove that the sets $s^{-1}(\text{Av}(231,312))$, $s^{-1}(\text{Av}(132,231))=\text{Av}(2341,1342,\underline{32}41,\underline{31}42)$, and $s^{-1}(\text{Av}(132,312))=\text{Av}(1342,3142,3412,34\underline{21})$ are counted by the so-called"Boolean-Catalan numbers,"settling a conjecture of the current author and another conjecture of Hossain. This completes the enumerations of all sets of the form $s^{-1}(\text{Av}(\tau^{(1)},\ldots,\tau^{(r)}))$ for $\{\tau^{(1)},\ldots,\tau^{(r)}\}\subseteq S_3$ with the exception of the set $\{321\}$. We also find an explicit formula for $|s^{-1}(\text{Av}_{n,k}(231,312,321))|$, where $\text{Av}_{n,k}(231,312,321)$ is the set of permutations in $\text{Av}_n(231,312,321)$ with $k$ descents. This allows us to prove a conjectured identity involving Catalan numbers and order ideals in Young's lattice.


Background
We use the word "permutation" to refer to an ordering of a set of positive integers written in one-line notation. Let S n denote the set of permutations of the set [n]. If π is a permutation of length n, then the standardization of π is the permutation in S n obtained by replacing the i th -smallest entry in π with i for all i. We say a permutation is standardized if it is equal to its standardization. Definition 1.1. Given τ ∈ S m , we say a permutation σ = σ 1 · · · σ n contains the pattern τ if there exist indices i 1 < · · · < i m in [n] such that the standardization of σ i1 · · · σ im is τ . We say σ avoids τ if it does not contain τ . Let Av(τ (1) , τ (2) , . . .) denote the set of standardized permutations that avoid the patterns τ (1) , τ (2) , . . . (this list of patterns could be finite or infinite). A set of the form Av(τ (1) , τ (2) , . . .) is called a permutation class. Let Av n (τ (1) , τ (2) , . . .) = Av(τ (1) , τ (2) , . . .) ∩ S n .
The investigation of permutation patterns began with Knuth's analysis of a certain "stack-sorting algorithm" [38]. This analysis also marked the first use of what is now called the "kernel method," a powerful enumerative tool that we employ throughout this article (see [4,12,13,42] for more information about this technique). In his dissertation, West [47] defined a deterministic variant of Knuth's algorithm. This variant is a function, which we call the "stack-sorting map" and denote by s, that sends permutations to permutations. The map s sends the empty permutation to itself. To define s(π) when π is a nonempty permutation, we write π = LnR, where n is the largest entry in π. We then let s(π) = s(L)s(R)n. There is now a large amount of literature concerning the stack-sorting map [7-11, 14-18, 21-35, 40, 43, 46-48].
We say a permutation π is t-stack-sortable if s t (π) is an increasing permutation, where s t denotes the t-fold iterate of s. Let W t (n) be the set of t-stack-sortable permutations in S n , and let W t (n) = |W t (n)|. Knuth initiated the study of pattern avoidance and the study of stack-sorting (and introduced the kernel method) with the following theorem. In his dissertation, West conjectured that W 2 (n) = 2 (n+1)(2n+1) 3n n . Zeilberger [48] later proved this formula, and other proofs have emerged over the past few decades [22,24,[32][33][34][35]. Some authors have investigated the enumeration of 2-stack-sortable permutations according to various statistics [8,14,16,24,32]. There is little known about t-stack-sortable permutations when t ≥ 3. The best known upper bound in general is given by the estimate W t (n) ≤ (t + 1) 2n . The current author [28] proved that lim n→∞ W 3 (n) 1/n < 12.53296 and lim n→∞ W 4 (n) 1/n < 21.97225. Recently, Bóna [9] reproved the first of these two estimates.
Even more recently, the current author [24] proved a certain "Decomposition Lemma" and used it to give a new proof of Zeilberger's formula for W 2 (n) that generalizes in order to count 2-stack-sortable permutations according to their number of descents and number of peaks. The proof also generalizes to the setting of 3-stack-sortable permutations, yielding a recurrence that generates the numbers W 3 (n) (more generally, it gives a recurrence for W 3 (n, k, p), the number of 3-stack-sortable permutations of length n with k descents and p peaks). This allowed the author to shed light on several conjectures of Bóna concerning 3-stack-sortable permutations, disproving one of them.
The fact that these permutations are of such specific forms indicates the difficulty of computing fertilities. Bousquet-Mélou [15] found a method for determining whether or not a given permutation is sorted, meaning that its fertility is positive. She asked for a general method for computing the fertility of any given permutation. The current author achieved this in even greater generality in [27][28][29] using new combinatorial objects called "valid hook configurations." He and others have applied this method in order to prove several results about fertilities of permutations, many of which link the stack-sorting map to other fascinating combinatorial objects and sequences [23-31, 40, 43].
Define the fertility of a set A of permutations to be |s −1 (A)|. In [29], the current author computed the fertilities of many sets of the form Av n (τ (1) , . . . , τ (r) ) for τ (1) , . . . , τ (r) ∈ S 3 . He also refined these enumerative results according to the statistics that count descents and peaks. Investigations of preimages of permutation classes appeared earlier in [16] and [21] and appeared more recently in [26]; this line of work is motivated by the observations that W 1 (n) = s −1 (Av n (21)) and W 2 (n) = s −1 (Av n (231)). Further motivation comes from the fact that preimages of permutation classes under s are often themselves permutation classes. For example, s −1 (Av(321)) = Av(34251, 35241, 45231). Our goal in the present article is to compute fertilities of some sets of permutations that were not completed in [29]. We do this via the Decomposition Lemma, which, when combined with generating function tools such as the kernel method, gives a unified technique for computing fertilities.

Summary of Main Results
Section 2 is brief; its purpose is simply to state the Decomposition Lemma. In Section 3, we use the Decomposition Lemma to prove that n≥0 |s −1 (Av n (231, 321))|x n = 1 is the generating function of the Catalan numbers. This proves Conjecture 12.3 from [29]. This is notable because s −1 (Av(231, 321)) = Av(2341, 3241, 45231).
Callan [20] proved that is the generating function of the permutation class Av(4321, 4213), and Bloom and Vatter [6] later reproved this result with a clearer bijection. The authors of [39] showed that this expression is also the generating function for Av(2413, 2431, 23154), which means that Av(4321, 4213) and Av(2413, 2431, 23154) form a pair of "unbalanced" Wilf equivalent permutation classes. The first naturally-occurring unbalanced Wilf equivalent pairs of finitely-based (i) permutation classes were found only recently [5,19]. Our theorem proves that Av(2341, 3241, 45231) is also Wilf equivalent to Av(4321, 4213) and Av(2413, 2431, 23154), providing yet another example of a pair of unbalanced Wilf equivalent finitely-based classes. Another motivation for the results of Section 3 comes from the study of the bubble sort map B. This map sends the empty permutation to itself. If π = LnR, where n is the largest entry of π, then B(π) = B(L)Rn. The article [1] investigates permutations sortable via s • B, showing that (s • B) −1 (123 · · · n) = Av n (3241, 2341, 4231, 2431).
In Section 4, we consider the chain of equalities n≥1 |s −1 (Av n (132, 312))|x n = n≥1 |s −1 (Av n (231, 312))|x n = n≥1 |s −1 (Av n (132, 231))|x n The first of these equalities was proven in [29], while the second was proven in [26]. We use the Decomposition Lemma to prove the third equality, completing the chain and proving a conjecture from [29]. Let us also remark that s −1 (Av(231, 312)) is the set of permutations that are sortable via one iteration of the map Pop • s, where Pop is the pop-stack-sorting map (see [2] and the references therein). Therefore, this theorem answers a deterministic variant of one of the problems considered in [44].
The expression is the generating function of OEIS sequence A071356 [41]. Hossain [36] has named these numbers "Boolean-Catalan numbers" and has discussed several interesting combinatorial properties that they enjoy. The above chain of inequalities is important because one can show that s where the underlines are used to represent so-called "vincular patterns" (defined in Section 4). Therefore, we are able to use the stack-sorting map as a tool in order to enumerate sets of permutations avoiding certain vincular patterns. This is particularly noteworthy in the case of the set s −1 (Av(132, 231)) = Av(2341, 1342, 3241, 3142). Indeed, Hossain [37] conjectured that this set of permutations is enumerated by the Boolean-Catalan numbers. As far as we are aware, there is no known proof of this fact that does not make use of the stack-sorting map. Applying the Decomposition Lemma yet again in Section 5, we prove that where Av n,k (231, 312, 321) is the set of permutations in Av n (231, 312, 321) with k descents. This yields a new proof of Theorem 6.2 from [29]. It also allows us to prove Conjecture 6.1 from that same article, which is an identity involving Catalan numbers and orderings on integer compositions and partitions. There are 64 subsets {τ (1) , . . . , τ (r) } of S 3 ; for each one, we have the problem of enumerating the permutations in s −1 (Av(τ (1) , . . . , τ (r) )). Many of these enumerations were accomplished in [16,29,38,48]. The main results of Sections 3 and 4 below finish the last remaining cases with the single exception of the set {321}.
Remark 1.1. The permutation classes Av(231, 321), Av(132, 231), and Av(231, 312, 321) have very simple descriptions, so one might think that the enumerations of their preimages under s could be computed directly and easily without additional tools. This is not the case. As mentioned above, even computing the fertilities of extremely simple permutations like 23 · · · k1(k + 1) · · · n takes some work without the Decomposition Lemma or valid hook configurations. Even with the machinery of valid hook configurations, the author could not figure out how to compute these fertilities in the paper [29].

General Proof Strategy
The tail length of a permutation π = π 1 · · · π n ∈ S n , denoted tl(π), is the largest integer ∈ {0, . . . , n} such that π i = i for all i ∈ {n − + 1, . . . , n}. Our strategy for proving the results in Sections 3-5 is to use the Decomposition Lemma in order to count various sets of permutations according to the statistic tls defined by tls(π) = tl(s(π)). One interesting property of this statistic is that it is closely related to the statistic zeil that Zeilberger used when he counted 2-stack-sortable permutations. For σ ∈ S n , zeil(σ) is the largest positive integer m such that n, n − 1, . . . , n − m + 1 appear in decreasing order in σ. It is proven in [26] that where rmax(σ) is the number of right-to-left maxima of σ. Our enumerations according to the statistic tls will yield generating function equations involving catalytic variables that we can remove using the kernel method.

The Decomposition Lemma
A descent of a permutation π = π 1 · · · π n is an index i ∈ [n − 1] such that π i > π i+1 . The plot of π is the diagram showing the points (i, π i ) for all i ∈ [n]. For example, the image on the left in Figure 1 is the plot of 31542678. A hook of a permutation is obtained by starting at a point (i, π i ) in the plot of π, drawing a vertical line segment moving upward, and then drawing a horizontal line segment to the right that connects with a point (j, π j ). This only makes sense if i < j and π i < π j . The point (i, π i ) is called the southwest endpoint of the hook, while (j, π j ) is called the northeast endpoint. Let SW i (π) be the set of hooks of π with southwest endpoint (i, π i ). The right image in Figure 1 shows a hook of 31542678. This hook is in SW 3 (31542678) because its southwest endpoint is (3, 5). As mentioned above, the tail length tl(π) of a permutation π = π 1 · · · π n ∈ S n is the largest integer ∈ {0, . . . , n} such that π i = i for all i ∈ {n − + 1, . . . , n}. The tail of π is the sequence of points (n − tl(π) + 1, n − tl(π) + 1), . . . , (n, n) in the plot of π. For example, the tail length of the permutation 31542678 shown in Figure 1 is 3, and the tail of this permutation is (6, 6), (7,7), (8,8). We say a descent d of π is tail-bound if every hook in SW d (π) has its northeast endpoint in the tail of π. The tail-bound descents of 31542678 are 3 and 4.
Suppose H is a hook of a permutation π = π 1 · · · π n with southwest endpoint (i, π i ) and northeast endpoint (j, π j ). Let π H U = π 1 · · · π i π j+1 · · · π n and π H S = π i+1 · · · π j−1 . The permutations π H U and π H S are called the H-unsheltered subpermutation of π and the H-sheltered subpermutation of π, respectively. For example, if π = 31542678 and H is the hook shown on the right in Figure 1, then π H U = 3158 and π H S = 426. Note that the northeast endpoint of the hook does not contribute to either the unsheltered subpermutation nor the sheltered subpermutation. In all of the cases we consider in this paper, the plot of π H S lies completely below the hook H in the plot of π (it is "sheltered" by the hook H). Lemma 2.1 (Decomposition Lemma, [24]). If d is a tail-bound descent of a permutation π ∈ S n , then 3 Enumerating s −1 (Av(231, 321)) In his dissertation, West [47] proved that a permutation is in if and only if it avoids the pattern 2341 and avoids any 3241 pattern that is not part of a 35241 pattern. As mentioned in the introduction, s −1 (Av(321)) = Av(34251, 35241, 45231). Combining these two facts, it is straightforward to check that In this section, we use the Decomposition Lemma to prove the following theorem.
is the generating function of the sequence of Catalan numbers.
This is notable because it tells us that we can use the stack-sorting map and the Decomposition Lemma as tools in order to enumerate the permutation class Av(2341, 3241, 45231), which, as far as we are aware, has not been enumerated yet. As mentioned in the introduction, is also the generating function of the sequence that enumerates the permutation classes Av(4321, 4213) [6,20] and Av(2413, 2431, 23145) [39]. In particular, Theorem 3.1 tells us that the permutation classes Av(4321, 4213) and Av(2341, 3241, 45231) form a new example of an unbalanced Wilf equivalence, as defined in [5,19]. Let B (n) = |s −1 (D (n))| and B ≥ (n) = |s −1 (D ≥ (n))|. Suppose π ∈ D (n + 1) is such that π n+1−i = n + 1 (see Figure 2). Note that n + 1 − i is a tail-bound descent of π because every point in the plot of π that is higher than (n + 1 − i, n + 1) is in the tail of π. The Decomposition Lemma tells us that |s −1 (π)| is equal to the number of triples (H, µ, λ), where H ∈ SW n+1−i (π), µ ∈ s −1 (π H U ), and λ ∈ s −1 (π H S ). Choosing H amounts to choosing the number j ∈ {1, . . . , } such that the northeast endpoint of H is (n + 1 + j, n + 1 + j). The permutation π and the choice of H determine the permutations π H U and π H S . On the other hand, the choices of H and the permutations π H U and π H S uniquely determine π. It follows that B (n + 1), which is the number of ways to choose an element of s −1 (D (n + 1)), is also the number of ways to choose j, the permutations π H U and π H S , and the permutations µ and λ. Let us fix a choice of j. Because π avoids 231, π H U must be a permutation of the set {1, . . . , n − i} ∪ {n + 1} ∪ {n + 2 + j, . . . , n + + 1}, while π H S must be a permutation of {n − i + 1, . . . , n + j} \ {n + 1}. In fact, π H S is the increasing permutation of the (i + j − 1)-element set {n − i + 1, . . . , n + j} \ {n + 1} because π avoids 321. According to Theorem 1.1, there are C i+j−1 choices for λ. Choosing π H U is equivalent to choosing its standardization, which is an element of D ≥ −j+1 (n − i). Any element of D ≥ −j+1 (n − i) can be chosen as the standardization of π H U . Also, π H U has the same fertility as its standardization. Combining these facts, we find that the number of choices for π H U and µ is |s . We obtain the recurrence relation Let Note that G (0) = B ≥ (0) = |s −1 (123 · · · )| = C by Theorem 1.1. Our goal is to understand the generating function |s −1 (Av n (231, 321))|x n .
The recurrence (2) tells us that On the other hand, Combining (3) and (4) and rearranging terms, we get the equation We now employ the kernel method (see [4,12,13,42] for more on this method). There is a unique power Substituting this into (5), we find that I(x, 0) = C(Y ). For ease of notation, let u = I(x, 0) and v = 1 . We wish to show that u = v.
Combining the equation If we solve for C(x) and use the functional equation xC(x) 2 + 1 − C(x) = 0, we obtain We can simplify this last equation to find that Q(u, x) It is easy to see that 1 − u + xu 2 = 0, so Q(u, x) = 0.
where the last equality follows from the Catalan functional equation. This means that It follows that C( , so we can use the Catalan functional equation to find that After simplifying this equation, we find that Q(v, x) 1 (v−1) 4 = 0, where Q is the polynomial in (6). Hence, Q(v, x) = 0.
We now know that Q(u, x) = Q(v, x) = 0. There are four Laurent series F (x) satisfying Q(F (x), x) = 0, but only one satisfies F (x) = 1 + x + O(x 2 ). This proves that u = v, as desired.

Enumerating s −1 (Av(132, 231))
Many analogues and generalizations of classical permutation patterns have emerged over the past few decades. One of the most notable notions is that of a "vincular pattern," which appeared first in [3] and has garnered a large amount of attention ever since. We refer the reader to the survey [45] and the references therein for further background. A vincular pattern is a permutation pattern in which some consecutive entries can be underlined. We say a permutation contains a vincular pattern if it contains an occurrence of the permutation pattern in which underlined entries are consecutive. For example, saying that a permutation σ = σ 1 · · · σ n contains the vincular pattern 3241 means that there are indices i 1 < i 2 < i 3 < i 4 such that σ i4 < σ i2 < σ i1 < σ i3 and i 2 = i 1 + 1. We say a permutation avoids a vincular pattern τ if it does not contain τ . Let Av(τ (1) , τ (2) , . . .) be the set of standardized permutations avoiding the vincular patterns τ (1) , τ (2) , . . ., and let Av n (τ (1) , τ (2) , . . .) = Av(τ (1) , τ (2) , . . .) ∩ S n .
There are many fascinating combinatorial properties of the OEIS sequence A071356 [41]; several are listed in [36], where the numbers in this sequence are named "Boolean-Catalan numbers." One can define this sequence via its generating function Hossain [37] has conjectured that the Boolean-Catalan numbers enumerate the permutations in Av(2341, 1342, 3241, 3142).
We will see that this set is precisely s −1 (Av(132, 231)). We will then enumerate these permutations via the Decomposition Lemma, proving Hossain's conjecture. It is interesting that the only known proof of this conjecture makes heavy use of the stack-sorting map.
The main theorem of this section is the following.
This theorem settles Conjecture 10.1 from [29]. Before proving it, we show how to deduce from it the following corollary, part of which settles Hossain's conjecture.
We prove the first of these equalities, the proof of the second is similar. If σ contains 2341 or 3241, then it follows from West's characterization of 2-stack-sortable permutations (mentioned at the start of Section 3) that s(σ) contains 231. It is also straightforward to check that s(σ) contains 132 if σ contains 1342 or 3142. This proves the containment s −1 (Av(132, 231)) ⊆ Av (2341, 1342, 3241, 3142).
Now suppose s(σ) contains either 132 or 231. We want to prove that σ contains one of the vincular patterns 2341, 1342, 3241, 3142. We will assume that σ avoids 2341, 1342, 3241 and prove that it contains 3142. Let us first assume s(σ) contains 231. Using West's characterization of 2-stack-sortable permutations and the assumption that σ avoids 2341, we see that σ contains a 3241 pattern that is not part of a 35241 pattern. Therefore, there are indices i 1 < i 2 < i 3 < i 4 such that σ i4 < σ i2 < σ i1 < σ i3 and such that no entry lying between σ i1 and σ i2 is larger than σ i3 . We may assume that among all such choices for i 1 , i 2 , i 3 , i 4 , we have made a choice that minimizes i 2 − i 1 . Because σ avoids 3241, i 2 ≥ i 1 + 2. Our choice of i 1 , i 2 , i 3 , i 4 guarantees that σ i1+1 < σ i3 . One can check that the minimality of i 2 − i 1 forces σ i1+1 < σ i4 . However, this means that the standardization of σ i1+1 σ i2 σ i3 σ i4 is 1342, contradicting our assumption that σ avoids 1342. This shows that s(σ) avoids 231, so it must contain 132.
One can show [21,29] that a permutation is in s −1 (Av(132)) if and only if it avoids the pattern 1342 and avoids any 3142 pattern that is not part of either a 34152 pattern or a 35142 pattern. Since we are assuming that s(σ) contains 132 and that σ avoids 1342, σ must contain a 3142 pattern that is not part of either a 34152 pattern or a 35142 pattern. This means that there are indices i 1 < i 2 < i 3 < i 4 such that σ i2 < σ i4 < σ i1 < σ i3 and such that no entry lying between σ i1 and σ i2 is larger than σ i1 . We may assume that among all such choices for i 1 , i 2 , i 3 , i 4 , we have made a choice that minimizes i 2 − i 1 . In fact, one can show that this minimality assumption forces i 2 − i 1 = 1. Hence, σ i1 σ i2 σ i3 σ i4 is an occurrence of the vincular pattern 3142 in σ.
In the following proof, we recycle our notation from the proof of Theorem 3.1 in Section 3. This is meant to elucidate the parallels between the proofs.
Suppose n ≥ 1 and π ∈ D (n + 1) (see Figure 3). Using the fact that π avoids 132 and 231 and has tail length < n + + 1, we easily find that π 1 = n + 1 and that 1 is a tail-bound descent of π. The Decomposition Lemma tells us that |s −1 (π)| is equal to the number of triples (H, µ, λ), where H ∈ SW 1 (π), µ ∈ s −1 (π H U ), and λ ∈ s −1 (π H S ). Choosing H amounts to choosing the number j ∈ {1, . . . , } such that the northeast endpoint of H is (n + 1 + j, n + 1 + j). The permutation π and the choice of H determine the permutations π H U and π H S . On the other hand, the choices of H and the permutations π H U and π H S uniquely determine π. It follows that B (n + 1), which is the number of ways to choose an element of s −1 (D (n + 1)), is also the number of ways to choose j, the permutations π H U and π H S , and the permutations µ and λ. Let us fix a choice of j. Fig. 3: An example of a permutation π ∈ D 5 (9) and a hook H with j = 2 (in the notation of the proof of Theorem 4.1).
The permutation π H U must be the increasing permutation (n + 1)(n + 2 + j) · · · (n + + 1) of length − j + 1. By Theorem 1.1, there are C −j+1 choices for µ. Now, π H S is a permutation of the (n + j − 1)element set {1, . . . , n + j} \ {n + 1}, so choosing π H S is equivalent to choosing its standardization. This standardization is in D ≥j−1 (n). Any element of D ≥j−1 (n) can be chosen as the standardization of π H S . Also, π H S has the same fertility as its standardization. Combining these facts, we find that the number of choices for π H S and λ is |s −1 (D ≥j−1 (n))| = B ≥j−1 (n). We obtain the recurrence relation Let G (x) = n≥0 B ≥ (n)x n and I(x, y) = ≥0 G (x)y .

Note that
be the generating function of the sequence of Catalan numbers. Since B ≥0 (n) = |s −1 (Av n (132, 231))|, our goal is to understand the generating function (Av n (132, 231))|x n .
Note that B (1) = 0 because there are no permutations of length + 1 with tail length . Therefore, the recurrence (7) tells us that On the other hand, Combining (8) and (9) and rearranging terms, we get the equation As in the previous section, we use the kernel method. Let After verifying that xY (C(Y ) − 1) − Y + x = 0, we use (10) to find that After some elementary algebraic manipulations, this expression simplifies to the generating function as desired. Let ψ(x) be the partition (composition with nonincreasing parts) that has x i − 1 parts of size a − i for all i ∈ {1, . . . , a − 1} (and has no parts of size at least a). The quantity D x can also be interpreted as the number of partitions whose Young diagrams fit inside the Young diagram of ψ(x). Said differently, D x is the size of the order ideal in Young's lattice generated by ψ(x) (see [29] for more details). Let us write C x = a t=1 C xt , where C j is the j th Catalan number. Put together, Theorems 6.1 and 6.2 in [29] state that |s −1 (Av n (231, 312, 321))| = n−1 (11) From this equation, it is natural to conjecture that for all nonnegative integers n and k; this is the content of Conjecture 6.1 in [29]. In that article, the current author showed that this conjecture is equivalent to the following theorem. Let des(π) denote the number of descents of a permutation π.
In this section, we use the Decomposition Lemma to prove this theorem, thereby settling the aforementioned conjecture. Our result implies the first equality in (11), so the proof given in this section yields a completely new proof of Theorem 6.2 from [29] (see that article for more details). Let B (n, k) = |s −1 (D (n, k))| and B ≥ (n, k) = |s −1 (D ≥ (n, k))|.

Proof
Suppose n ≥ 0 and π ∈ D (n + 1, k) (see Figure 4). Using the fact that π avoids 312 and 321, we easily find that π n = n + 1. Because π avoids 231, we must have π n+1 = n. Note that n is a tail-bound descent of π. The Decomposition Lemma tells us that |s −1 (π)| is equal to the number of triples (H, µ, λ), where H ∈ SW n (π), µ ∈ s −1 (π H U ), and λ ∈ s −1 (π H S ). Choosing H amounts to choosing the number j ∈ {1, . . . , } such that the northeast endpoint of H is (n + 1 + j, n + 1 + j). Let us fix such a j. The permutation π H S = n(n + 2)(n + 3) · · · (n + j) is an increasing permutation of length j. Therefore, there are C j choices for λ by Theorem 1.1. Fig. 4: An example of a permutation π ∈ D 5 (9, 3) and a hook H with j = 2 (in the notation of the proof of Theorem 4.1).
The recurrence (13) is equivalent to Combining (14) and (15) yields the equation If we multiply both sides of (16) by z k and sum over k ≥ 0, we obtain We can rewrite this equation as As in the previous two sections, we use the kernel method to find the generating function J(x, 0, z). There is a unique power series Y = Y (x, z) such that C(Y (x, z)) = x + 2x 2 + O(x 3 ) and x 2 z(C(Y ) − 1) + x − Y = 0. Substituting this into (17) shows that J(x, 0, z) = C(Y ). Let J(x, z) = xJ(x, 0, z) = xC(Y ). Using the Catalan functional equation Y C(Y ) 2 + 1 − C(Y ) = 0, we obtain We now use the fact that x 2 z(C(Y ) − 1) + x − Y = 0 to see that Substituting this into (18) shows that By Lagrange inversion, as desired.

Further Directions
The proofs of our three main theorems relied on the Decomposition Lemma, which was proven in [24]. That article actually obtained this useful tool as a corollary of a more general result, called the "Refined Decomposition Lemma," which allows one to count stack-sorting preimages of permutations according to the additional statistics des and peak (for π = π 1 · · · π n , peak(π) is the number of indices i ∈ {2, . . . , n− 1} such that π i−1 < π i > π i+1 ). It could be interesting to generalize Theorems 3.1, 4.1, and 5.1 by counting the relevant preimage sets according to the statistics des and peak. One could also attempt to generalize these results to the context of "troupes," which are special families of colored binary plane trees for which a version of the Decomposition Lemma holds (see [30] for more details). Of course, one could also search for other interesting sets of permutations whose stack-sorting preimages can be enumerated via the Decomposition Lemma. The results in Sections 3 and 4 complete the enumerations of all sets of the form s −1 (Av(τ (1) , . . . , τ (r) )) for {τ (1) , . . . , τ (r) } ⊆ S 3 except the set {321}. There are currently no nontrivial results that enumerate sets of this form when one or more of the patterns τ (i) has length at least 4. Obtaining such results would be a natural next step. It would be especially interesting to solve this enumerative problem using valid hook configurations (as in [29]) or the Decomposition Lemma in the cases in which the sets s −1 (Av(τ (1) , . . . , τ (r) )) have some natural alternative descriptions (i.e., if they are characterized as the permutations avoiding some collection of patterns or vincular patterns). It is shown in [26] that n≥1 |s −1 (Av n (132, 3412))|x n = n≥1 |s −1 (Av n (231, 1423))|x n = n≥1 |s −1 (Av n (312, 1342))|x n .
Thus, it is natural to consider the specific problem of computing the generating function n≥1 |s −1 (Av n (132, 3412))|x n .

Acknowledgments
The author was supported by a Fannie and John Hertz Foundation Fellowship and an NSF Graduate Research Fellowship.