Composability of Permutation Classes

We define the operation of composing two hereditary classes of permutations using the standard composition of permutations as functions and we explore properties and structure of permutation classes considering this operation. We mostly concern ourselves with the problem of whether permutation classes can be composed from their proper subclasses. We provide examples of classes which can be composed from two proper subclasses, classes which can be composed from three but not from two proper subclasses and classes which cannot be composed from any finite number of proper subclasses.


Introduction
Permutations of numbers or other finite sets are a very deeply and frequently studied combinatorial and algebraic object. There are two main structures on permutations investigated in modern mathematics: groups, closed under the composition operator, and hereditary pattern-avoiding classes, closed under the relation of containment. This paper is one of several texts exploring the relation between the two notions by applying the composition operator to permutation classes. That is, given two classes A and B, we denote by A • B the class of all permutations which can be written as a composition of a permutation from A and a permutation from B.
The oldest results combining permutation classes and groups that we know of are due to Atkinson and Beals [3], who consider the permutation classes whose permutations of length n form a subgroup of S n for every n and completely characterise the types of groups which may occur this way. These results were recently refined and extended by Lehtonen and Pöschel [8,9]. In an earlier version of their paper, Atkinson and Beals [5] also deal with composing permutation classes, showing that compositions of many pairs of finitely based classes are again finitely based.
Some permutation classes characterise permutations which can be sorted by some sorting machine such as a stack. In this view, a composition of two permutation classes can characterise permutations sortable by two corresponding sorting machines connected serially. For example, Atkinson and Stitt [4,Section 6.4] introduce the popstack, a sorting machine which sorts precisely the layered permutations (see Section 5 for a definition), and consider the class of permutations which can be sorted by two popstacks in series, i.e. which can be written as a composition of two layered permutations. Using their more general results they calculate its generating function and enumerate its basis.
Albert et al. [1] give more enumerative results on compositions of classes in terms of sorting machines.
In the present paper, we study a different question connected to compositions of classes; namely whether a permutation of a given class C can always be written as a composition of two or more permutations from its subclasses, i.e. whether C ⊆ C 1 • C 2 • · · · • C k for some C 1 , . . . , C k C. If this is true, we say that the class C is composable and we refer to this property of C as composability.
The paper is organised as follows. In Section 2 we supply all the necessary definitions and facts about permutation classes. In Section 3 we introduce composability and give some basic results. In Section 4 we explore composability of the class Av(k · · · 21). In Section 5 we explore composability of various classes of layered patterns. Finally in Section 6 we give several additional miscellaneous results.

Preliminaries
For a positive integer n we let [n] denote the set {1, 2, . . . , n}. A permutation of order n is a bijective function π : [n] −→ [n]. We denote the order of a permutation π by |π|. We may also interpret a permutation π as a sequence π(1), π(2), . . . , π(n) of distinct elements of [n], or as a diagram in an n × n square in the plane, consisting of points {(i, π(i)); 1 ≤ i ≤ n}. For n ≥ 0 let S n denote the set of all permutations of order n.

Permutation classes
Two sequences of numbers s 1 , s 2 , . . . , s n and r 1 , r 2 , . . . , r n are order-isomorphic if for any two indices i, j ∈ [n] it holds that s i < s j if and only if r i < r j . We define the following partial ordering on the set of all permutations. We say that π is contained in σ and write π ≤ σ if σ has a subsequence of length |π| orderisomorphic to π. See the example of containment in Figure 2. On the other hand, if π σ, we say that σ avoids π. A set C of permutations is called a permutation class if for every π ∈ C and every σ ≤ π we have σ ∈ C. We say that C avoids a permutation σ if σ / ∈ C, i.e. every π ∈ C avoids σ. Permutation classes are often described by the patterns they avoid. If B is any set of permutations, we denote by Av(B) the set of all permutations avoiding every element of B. Observe that C is a permutation class if and only if C = Av(B) for some set B. Indeed, if C is a permutation class, then C = Av(S \ C), and if σ ≤ π ∈ C, then π avoids all permutations of B and clearly σ avoids them too. If C = Av(B) and B is an anti-chain with respect to containment, we call B the basis of C. Also if B = {π 1 , π 2 , . . . , π k } is finite, we write just Av(π 1 , . . . , π k ) instead of Av({π 1 , . . . , π k }). Finally, if C = Av(π) for a single permutation π, we say that C is a principal class.
Let s 1 , s 2 , . . . , s k be k finite sequences of numbers. We denote their concatenation by s 1 s 2 · · · s k . If a sequence s can be constructed by interleaving s 1 , s 2 , . . . , s k in some (not necessarily unique) way, we say that s is a merge of or it is merged from s 1 , s 2 , . . . , s k .
We define I k resp. D k to be the class of all permutations merged from at most k increasing resp. decreasing subsequences. Also let I = I 1 and D = D 1 , i.e. I = Av(21) is the set of all increasing permutations and D = Av(12) is the set of all decreasing permutations, and for convenience let I 0 = D 0 = S 0 .
The classes I k and D k are well-known examples of principal classes.
Next we recall a known and important property of infinite permutation classes which will become useful in the upcoming sections.
Fact 2.2 (Atkinson, Beals [3]). Let C be an infinite permutation class. Then either I ⊆ C or D ⊆ C.

Splittability
In this section we shortly introduce another concept which has been recently used to derive enumerative results on permutation classes and which we will also utilize in our work.
A permutation π is merged from permutations α and β if we can color the elements of π with red and blue such that the red subsequence is order-isomorphic to α and the blue sequence is order-isomorphic to β. Given two permutation classes A and B we define their merge denoted by A B as the class of all permutations which can be merged from a (possibly empty) permutation from A and a (possibly empty) permutation from B. For example, it is easy to see that We say that a class C is splittable if it has two proper subclasses A and B such that C ⊆ A B. We refer the reader to the work of Jelínek and Valtr [6] for an exhaustive study of splittability.

The notion of composability
In the following sections we provide definitions of the key notions of this work as well as basic facts and observations.
Having verified associativity of the composition operator we can now define the composition of more than two classes in a natural inductive way: We will also sometimes use the power notation C • C • · · · • C k× = (C) k .
We continue by proving several simple lemmas about composing permutations merged from few increasing sequences. Proof. Choose π ∈ I k and ϕ ∈ I l , partition ϕ into l increasing sequences and choose one of them at indices i 1 < · · · < i r . Then ϕ(i 1 ) < · · · < ϕ(i r ) and so π(ϕ(i 1 )), . . . , π(ϕ(i r )) is a subsequence of π and therefore it can be partitioned into at most k increasing sequences since that is the property of π. This is true for the image of each of the l increasing subsequences in ϕ and therefore π • ϕ can be partitioned into at most k · l increasing subsequences.
Since D • D = I, the argument of the previous proof can be repeated to show that D k • D l ⊆ I kl . We can generalise this even more. Proof. Use the approach identical to that of Lemma 3.2.

Composability
The main problem we are addressing in this work is whether permutations in a given permutation class can be constructed by composing permutations from two or more smaller classes. We formalise this as follows. A permutation class C is said to be composable from classes C 1 , . . . , C k if C ⊆ C 1 • · · · • C k . A class C is k-composable, if it is composable from its k proper subclasses C 1 , . . . , C k . A class C is composable, if it is k-composable for some k ≥ 2. Using this terminology, our goal is thus answering the question whether a given permutation class is composable.
Clearly, for every class C we have C ⊆ C • I. For an infinite class we have either I ⊆ C, which implies C ⊆ C • C, or D ⊆ C, which implies I ⊆ C • C and C ⊆ C • C • C. Restricting ourselves to proper subclasses in the definition of a composable class is motivated by these trivial inclusions.
We begin the exploration of composability by proving the following result which implies that unlike splittability, k-composability for k > 2 does not imply 2-composability.
Theorem 3.4. Let C be an infinite permutation class such that I C. Then C is not 2k-composable for any positive integer k.
Proof. Since C does not contain I, there is an integer n such that C avoids 12 · · · n(n+1) and therefore C ⊆ D n by Fact 2.1.
Since all these classes are subsets of D n , Lemma 3.3 implies A i • B i ⊆ I n 2 for every i ∈ [k]. Using Lemma 3.3 again we get that therefore, according to our assumption, C ⊆ I n 2k , which means that C does not contain a decreasing permutation of length n 2k + 1 by Fact 2.1. But since C is infinite and does not contain I, it has to contain D according to Fact 2.2, which is a contradiction.

Properties of symmetries
In this section we explore how composability is preserved under some of the usual symmetrical maps.
For a permutation π of length n we define π r to be the reverse of π, i.e. π r (k) = π(n − k + 1), and π c to be the complement of π, i.e. π c (k) = n − π(k) + 1. For a permutation class A we define the inverse class A −1 = {π −1 ; π ∈ A}, the reverse class A r = {π r ; π ∈ A}, and the complementary class A c = {π c ; π ∈ A}.
, then by the property of inverse elements in a group we have ( (c): Apparent from (b).
Using this lemma we derive several composability criteria for symmetries of a given class, the first of which requires no further proof as it is an immediate consequence of Lemma 3.5.
Corollary 3.6. Let A be a permutation class. Then the following statements are equivalent: The case of the reverse and complementary operators is more complicated and requires additional assumptions.
Lemma 3.7. If A is a k-composable class and I A, then both A r and A c are (2k − 1)-composable.
Proof. Let A be composable from its proper subclasses A 1 , A 2 , . . . , A k . Then It holds that D • D = I, so we have Clearly A r i A r and since I A, we have D A r , so the proper subclass criterion is met and A r is therefore (2k − 1)-composable. Analogously we show that

Vertical and horizontal merge
Let C 1 , . . . , C k be any permutation classes. We define the vertical merge of these classes as the class of permutations that can be written as a concatenation s 1 s 2 · · · s k of k (possibly empty) sequences such that s i is order-isomorphic to a permutation of C i . We write this class as V(C 1 , . . . , C k ). In addition, if C 1 = C 2 = · · · = C k = I, we let V k denote the class V(C 1 , . . . , C k ). Similarly we define the horizontal merge of these classes as the class of permutations that can be written as a merge of k (possibly empty) sequences s 1 , s 2 , . . . , s k such that each s i is order-isomorphic to π i ∈ C i and every element of s i is smaller than every element of s i+1 for 1 ≤ i ≤ k − 1. Note that this implies that each s i uses a set of consecutive integers. We let H(C 1 , . . . , C k ) denote the horizontal merge of classes C 1 , . . . , C k and if Alternatively, we can observe that π ∈ V(C 1 , . . . , C k ) resp. π ∈ H(C 1 , . . . , C k ) if and only if its plot in R 2 can be separated by vertical resp. horizontal lines into at most k parts , i-th of them containing a sequence order-isomorphic to a permutation in C i (see Figure 4), hence the names of the classes.
The opposite inclusion is equally straightforward.
When composed with any other class A, the classes H k , V k and I k can be viewed as a unary operator transforming A in a specific way. We formalise this approach in the following lemma. (c) A • I k is precisely the class of permutations which can be obtained from a permutation of A by dividing it into at most k subsequences and interleaving them in any way.
Proof. Let α ∈ A, η ∈ H k , ν ∈ V k and ι ∈ I k . (a): Consider the permutation α • η ∈ A • H k . Then η is merged from k (possibly empty) sequences of consecutive integers s 1 , . . . , s k . Now we define k sequences r 1 , . . . , r k such that Every r i is a contiguous subsequence of α and at the same time α • η is merged from r 1 , . . . , r k .
On the other hand, if a permutation π is obtained from α ∈ A by dividing it into k contiguous subsequences r 1 , . . . , r k and merging them in some way, we define k sequences s 1 , . . . , s k such that s i is the sequence of indices of the elements of r i in α. Then by definition α((s i ) j ) = (r i ) j for any suitable i and j, and since we divided α into contiguous subsequences, each s i is a sequence of consecutive integers. Now consider the permutation η created by replacing the subsequence r i by the sequence s i in π for every i. Then η is merged from s 1 , . . . , s k , which are sequences of consecutive integers, therefore η ∈ H. At the same time, for any m ∈ {1, 2, . . . , |π|} there are indices i and j such that π(m) = (r i ) j = α((s i ) j ) = α(η(m)), where the last equality holds because we replaced (r i ) j by (s i ) j when constructing η from π. Therefore π = α • η.
The permutation ν is formed by concatenating k increasing sequences s 1 , . . . , s k . Define k sequences r 1 , . . . , r k such that On the other hand, if a permutation π is obtained from α ∈ A by dividing it into k subsequences r 1 , . . . , r k and then concatenating them, we define k sequences s 1 , . . . , s k such that s i is the sequence of indices of elements of r i in α. Thus every s i is an increasing sequence and α((s i ) j ) = (r i ) j . Consider a permutation ν created by replacing the subsequence r i by the sequence s i in π for every i. Since π is a concatenation of r 1 , . . . , r k , we get that ν is a concatenation of s 1 , . . . , s k and thus ν ∈ V k . Also, for any m ∈ {1, 2, . . . , |π|} there are indices i and j such that π(m) = (r i ) j = α((s i ) j ) = α(ν(m)), where the last equality holds because we replaced (r i ) j by (s i ) j when constructing ν from π. Therefore π = α • ν.
(c): The proof is similar to the proofs of (a) and (b).

Composability results
Using the machinery introduced in the previous section we now prove a key lemma which we will use to show several composability results.
. . , C k be arbitrary permutation classes. Then Proof. Consider a permutation π ∈ C 1 · · · C k and divide it into k sequences s 1 , . . . , s k such that s i is isomorphic to a permutation from C i . The permutation ν = s 1 s 2 · · · s k then lies in V(C 1 , . . . , C k ), which together with Lemma 4.2(a) implies π ∈ V(C 1 , . . . , C k )• H k .
By reformulating the previous statement we immediately get the following. Using what has already been shown in this section it is now elementary to show that I k is 2-composable.
Theorem 4.5. The class I k is 2-composable for every k ≥ 2. In particular, Proof. Trivially V k I k and H k I k . Next we recall that I k = I · · · I k× and use Lemma 4.3 for C 1 = C 2 = · · · = C k = I.
We proceed by proving a result in some sense opposite to that of Lemma 3.2, namely we show that I k may be constructed from smaller I a , I b using composition. Proof. Consider a permutation π ∈ I k+l−1 , merged from two sequences a and b such that a is merged from k increasing sequences s 1 , . . . , s k and b is merged from l − 1 increasing sequences s k+1 , . . . , s k+l−1 . Let c be the increasing sequence created by sorting the elements of b. Consider a permutation σ created by merging the sequences a and c so that c and s k form a single increasing sequence. Clearly σ ∈ I k and sequences s k+1 , . . . , s k+l−1 are subsequences of σ, since they are increasing and therefore were not affected by sorting b.
According to Lemma 4.2(c) the class I k • I l contains all permutations we can create from σ by dividing it into l subsequences and merging them in any way. It is therefore enough to find a way to divide σ into l subsequences which can be merged into π. A simple choice of l such subsequences is a, s k+1 , . . . , s k+l−1 .
This theorem raises the question whether we could construct a bigger class from given I k and I l .
Question. Given positive integers k and l, what is the largest integer m = m(k, l) such that I m ⊆ I k • I l ?
So far we have shown that m(k, l) ≤ kl (Lemma 3.2) and that m(k, l) ≥ k + l − 1 (Theorem 4.6). It is also not difficult to show the sharp inequality m(k, l) < kl by constructing a permutation π ∈ I kl \ (I k • I l ).

Classes of layered patterns
In this section we cover classes of permutations which can be written as a sum or as a skew sum of increasing or decreasing permutations. Among these classes we provide infinitely many examples of composable classes as well as several examples of classes which are not composable.
Let ι k denote the increasing permutation of order k and δ k denote the decreasing permutation of order k. A permutation is layered if it is a sum of decreasing permutations which are then called layers. We let L denote the class of all layered permutations. We let L k denote the class of permutations which are sums of at most k layers. The complement of a layered permutation is clearly a skew sum of increasing permutations and we call such a permutation co-layered. The class L c consists of precisely the co-layered permutations.  We start by proving that L 2 is not composable using a counting argument. As it turns out, proper subclasses of L 2 are asymptotically too small to build the entire L 2 class using composition.
Theorem 5.1. The class L 2 is not composable.
. Each of these subclasses avoids at least one permutation of L 2 . In other words for every C i there is a π i ∈ L 2 such that C i ⊆ L 2 ∩ Av(π i ). Considering a sufficiently large n so that π i ≤ δ n ⊕ δ n for every i ∈ [k] we get that C i ⊆ L 2 ∩ Av(δ n ⊕ δ n ) for every i, in other words every permutation in these subclasses has one of its two layers shorter than n. It follows that for a fixed integer N there are at most 2(n − 1) permutations of order N in any C i , therefore there are at most (2n − 2) k permutations in C 1 • · · · • C k . But L 2 contains N permutations of order N for any N , therefore we obtain a contradiction by choosing N > (2n − 2) k .
The number of permutations of order n in L 2 is linear in n while any proper subclass contains only constantly many permutations of fixed order. We can use the same approach using the asymptotic jump from polynomial to exponential functions to show that a different class of permutations cannot be composable. Namely, let F 2 be the class of layered permutations with layers of size 1 or 2.
Theorem 5.2. The class F 2 is not composable.
Proof. Suppose F 2 is composable from k of its proper subclasses C 1 , C 2 , . . . , C k . We choose a permutation from F 2 \ C i for every i and we select n large enough so that every chosen permutation is contained in π = n i=1 δ 2 . Then if C = F 2 ∩ Av(π), we get that F 2 ⊆ (C) k . Every permutation in C contains fewer than n layers of size 2, otherwise it would contain π. Clearly there are at most N a permutations of F 2 that have order N and exactly a layers of size 2. Therefore C contains at most N 1 + N 2 + · · · + N n−1 ≤ nN n permutations of order N and the composition (C) k then contains at most n k N nk permutations of order N , which is a number polynomial in N . As mentioned in [10,Chapter 4], the number of permutations of order N of F 2 is counted by the Fibonacci numbers which grow exponentially, therefore there is N large enough so that F 2 has more permutations of order N than (C) k .
Note that this result also follows immediately from the theorem of Kaiser and Klazar ([7,3.4]), which states that if the number of permutations of order n in a permutation class is less than the n-th Fibonacci number for at least one value of n, then it is eventually polynomial in n. This implies that every class counted by the Fibonacci numbers is uncomposable.
The argument used in the proofs above cannot be used for L 3 , so we need a different approach to show that this class too is not composable. We will make use of the following property of L 2 ∪ L r 2 .
Lemma 5.3. (L 2 ∪ L r 2 ) ∩ S n is a subgroup of S n for every n, i.e. it is closed under composition.
Proof. In this proof, we consider an additive group structure on the set [n] with the neutral element n and an operator + n defined as First we prove that L r 2 ∩ S n by itself is a subgroup of S n . Observe that L r 2 ∩ S n contains exactly permutations π such that there is a shifting number k with π(i) = i + n k for every i ∈ [n]. Indeed, if π = ι a ι b then for any i ∈ [n] we have π(i) = i + n b and conversely if π(i) = i+ n k for every i ∈ [n] then π = ι n−k ι k . Now for two permutations π, σ ∈ L r 2 with shifting numbers k, l respectively we have π(σ(i)) = i + n l + n k for any i ∈ [n], therefore π • σ ∈ L r 2 since it has a shifting number k + n l. It trivially holds that Considering π, σ ∈ (L 2 ∪ L r 2 ) ∩ S n it remains to distinguish the following four cases: (i) π ∈ L r 2 and σ ∈ L r 2 , then π • σ ∈ L r 2 by the discussion above, (ii) π ∈ L r 2 and σ ∈ L 2 , then π • σ = (π • σ r ) • δ n ∈ L 2 , (iii) π ∈ L 2 and σ ∈ L r 2 , then π • σ = (δ n • π c ) • σ = δ n • (π r • σ) ∈ L 2 , (iv) π ∈ L 2 and σ ∈ L 2 , then π • σ = π r • (δ n • δ n ) • σ c = π r • σ r ∈ L r 2 .
Theorem 5.4. The class L 3 is not composable.
Proof. Suppose that L 3 ⊆ C 1 • C 2 • · · · • C k such that C i L 3 for any i. Using the same initial argumentation as in the proof of Theorem 5.1 we get that there is an n such that L 3 ⊆ (L 3 ∩ Av(δ n ⊕ δ n ⊕ δ n )) k , meaning that every permutation of L 3 can be composed from k permutations having at least one of the three layers shorter than n. Let π i ∈ C i for 1 ≤ i ≤ k and π = π 1 • π 2 • · · · • π k . We now claim that it is possible to remove at most (n − 1)k elements from π to obtain a two-layered or a two-co-layered permutation. We will prove this by induction on k. The case k = 1 is easy since π = π 1 avoids δ n ⊕ δ n ⊕ δ n , so it has a layer of length shorter than n whose removal creates a two-layered pattern.
For k > 1 let σ = π 1 • · · · • π k−1 and π = σ • π k . Let all these permutations have the order N . By the induction hypothesis, there are a indices i 1 , . . . i a such that a ≥ N − (n − 1)(k − 1) and σ restricted to these indices has the two-layer or the twoco-layer pattern. Also there are b indices j 1 , . . . , j b such that b ≥ N − (n − 1) and π k restricted to these indices forms the two-layer or the two-co-layer pattern.
Let us now restrict the function σ • π k to the set S = {π −1 k (i 1 ), . . . , π −1 k (i a )} ∩ {j 1 , . . . , j b } whose size is at least N − (n − 1)k. Then both π k (S) and σ(π k (S)) are still two-layer or two-co-layer patterns, which implies the same for their composition according to Lemma 5.3. Therefore π restricted to S forms a two-layer or two-co-layer pattern and N − |S| ≤ (n − 1)k which completes the induction step.
If we allow more than three but still constantly many layers, we always get a composable class.
Theorem 5.5. The class L k is 3-composable for every k ≥ 4.
Proof. We will show that L k ⊆ L k−1 • L k−2 • L k−1 .
If π ∈ L k of order n has fewer than k layers, then π = π •δ n •δ n ∈ L k−1 •L k−2 •L k−1 . Otherwise π has at least 4 layers and has the form π = δ a ⊕ δ b ⊕ δ c ⊕ δ d ⊕ π for some positive a, b, c, d. Since for every layered σ we have σ • σ • σ = σ it is not hard to check that The situation is represented in Figure 6.
This theorem raises the question whether L k could be 2-composable for k ≥ 4. Our work from Section 3 quickly determines that this is not the case.
Proposition 5.6. L k for k ≥ 4 is not 2-composable. In particular, it is not ncomposable for any even number n.
Proof. Since L k is an infinite class which does not contain I the statement directly follows from Theorem 3.4.
We have now covered the classes L k for all k ≥ 2. It remains to consider the class L, which we show to be uncomposable. Before we proceed with the proof, we introduce an additional useful concept. We call a subsequence s of a permutation π a block if s is either an increasing or a decreasing contiguous subsequence of consecutive integers. We then call π a k-block if it is a concatenation of at most k blocks (see Figure 7). Lemma 5.7. Let π ∈ S n be a k-block and let σ ∈ S n be an l-block. Then π • σ is a (k · l)-block.
Proof. Choose a block of σ at indices a, a + 1, . . . , a + b. Then the sequence π(σ(a)), π(σ(a + 1)), . . . , π(σ(a + b)) is a contiguous subsequence of either π(1), π(2), . . . , π(n) or π(n), . . . , π(2), π(1) and therefore is a concatenation of at most k blocks since π itself is a k-block. This is true for each of the l blocks of σ, therefore π • σ is a (k · l)-block.  Proof. Every subclass of L is determined by one or more forbidden layered permutations. If L is composable from k subclasses, we may choose one forbidden layered permutation from each of them and then choose n large enough so that π = n+1 i=1 δ n+1 contains all of the chosen patterns. That way, L ⊆ C k where C = Av(π) ∩ L.
Clearly every permutation in C has at most n layers longer than n, otherwise it would contain π. Our goal is to show that permutations in C k are somehow very close to patterns composed from permutations that have a constant number of non-trivial layers and all other layers are just of size 1. Given a layered permutation we call a layer of length at most n a short layer and a layer of length more than n a long layer.
We say that two permutations α and β are (c, l)-close, if |α(i) − β(i)| ≤ c for every index i with at most l exceptions.
For σ ∈ C we denote by N (σ) the permutation created from σ by replacing every short layer by the corresponding number of layers of size 1, i.e. flipping the short layers into increasing blocks.
If k = 1, we have to show that σ 1 and N (σ 1 ) are (2n, 8n 2 )-close. Since N (σ) is created by manipulating layers of σ of length at most n in place, every element of σ is shifted by at most n, so they are even (n, 0)-close, thus the first step of induction is done.
Given a layered permutation and one of its layers of size l+1 at indices i, i+1, . . . , i+ l, we say that a number u is in the area of influence of this layer if i ≤ u ≤ i + l.
Given a long layer of σ k+1 or N (σ k+1 ) (their long layers are the same), there are at most 4nk indices u such that |σ(u) − ν(u)| ≤ kn and ν(u) is in the area of influence of this layer and σ(u) is not: at most 2nk to the left and to the right of the layer. Similarly there are at most 4nk indices u such that |σ(u) − ν(u)| ≤ kn and σ(u) is in the area of influence of the considered layer and ν(u) is not. Since there are at most n long layers, we get that in total there are at most 8n 2 k indices u such that |σ(u) − ν(u)| ≤ kn and one of {σ(u), ν(u)} is in the area of influence of a long layer while the other is not in that area.
By the induction hypothesis, there are at most 8n 2 k 2 indices u such that |σ(u) − ν(u)| > nk. Together with the at most 8n 2 k indices from the previous paragraph we get 8n 2 k 2 + 8n 2 k = 8n 2 k(k + 1) ≤ 8n 2 (k + 1) 2 indices at which we will allow σ k+1 • σ and N (σ k+1 ) • ν to differ arbitrarily in our proof that these two permutations are (2n(k+1), 8n 2 (k+1) 2 )-close. It remains to show |σ k+1 (σ(u))−N (σ k+1 (ν(u))| ≤ n(k+1) for all the remaining indices u to complete the induction step. For other indices u ∈ {1, 2, . . . , |σ|} not considered so far it holds that |ν(u) − σ(u)| ≤ 2nk and that either ν(u) and σ(u) are both in the area of influence of the same long layer of σ k+1 or they are in areas of influence of short or trivial layers. In the latter case the value of σ(u) changes by at most n after applying σ k+1 to it and similarly the value of ν(u) changes by at most n after applying N (σ k+1 ) to it, thus |N (σ k+1 )(ν(u)) − σ k+1 (σ(u))| ≤ 2nk + 2n ≤ n(k + 1). In the former case it is enough to realise that for a given decreasing permutation δ a it holds that δ a (x ± y) = δ a (x) ∓ y, thus if σ(u) differs by y from ν(u) and they are in the area of influence of the same long layer, after applying σ k+1 (or N (σ k+1 ), which is the same for the big layers) the values still differ by y ≤ 2nk ≤ 2n(k + 1), which finishes the induction step.
Notice that for σ ∈ C the permutation N (σ) is a (2n)-block according to the definition above. Thus by Lemma 5.7 we get that by composing k such permutations we get a permutation which is a (2n) k -block. As a result we get that each permutation from (C) k is (c, l)-close to a C-block for suitable fixed constants c, l, C. Notice now that every C-block avoids the (C + 1)-block γ = 214365 · · · (2C + 2)(2C + 1), so every permutation from (C) k is (c, l)-close to a permutation avoiding γ. We can construct a layered permutation which is not (c, l)-close to any γ-avoider as follows. Choose a layered permutation with C + 1 layers of length l + 2c + 1 and consider a permutation (c, l)-close to it. Then in every layer there are at least 2c + 1 elements whose value changed by at most c; therefore there exist at least two elements which remained in decreasing order. Choosing these two elements from every layer forms an occurrence of γ. Since L contains a permutation which is not (c, l)-close to γ and (C) k does not contain such permutations, we get that L (C) k , achieving contradiction.
Preceding results and Lemma 3.7 imply the following corollary.

Other results
In the final section of this work we collect several miscellaneous results concerning composability. First we provide more examples of composable classes, and then we fininish by presenting several additional examples of uncomposable classes.

Composable principal classes
In this section, we use results of Section 4 and of [6] to prove that many classes avoiding a single decomposable pattern (a permutation which can be written as a non-trivial sum of smaller permutations) are composable.
We will base our proof on the following splittability result of Jelínek and Valtr [6].
Let π ∈ C be merged from sequences a and c as in Lemma 6.1 and let σ = ac. We have to show that σ ∈ C. Suppose for a contradiction that σ contains a copy of α ⊕ β ⊕ γ. Let b be the decreasing subsequence of σ representing the occurrence of β. Then b cannot be contained entirely in a or in c since that would create a copy of α ⊕ β in a or of β ⊕ γ in c. Thus if β = 1 the contradiction is reached immediately.
If |β| > 1, we would like to show that b is also a subsequence of π. Assume it is not, therefore there are elements b i and b j with i < j such that they appear in reverse order in π. That can only be achieved if b i is in a and b j is in c, which together with b i > b j contradicts the properties of a and c from Lemma 6.1.
It follows that the entire occurrence of α ⊕ β ⊕ γ is also contained in π, which is a contradiction, thus C ⊆ (V(A, B) ∩ C) • H.
To prove that C is really 2-composable for α ⊕ β ⊕ γ / ∈ H it remains to verify that V(A, B)∩C and H are proper subclasses of C. Clearly V(A, B)∩C ⊆ C and the condition α ⊕ β ⊕ γ / ∈ H implies H ⊆ C, so it remains to show that the inclusions are proper. Consider the permutation (α⊕β) (β ⊕γ) which is clearly in C and not in V (A, B). For the class H we use the results of Atkinson, who showed in [2, Proposition 3.4] that the class H has a basis of size 3 and therefore it cannot be equal to a principal class.
Note that for the case β = 1 we get V(Av(α ⊕ 1), Av(1 ⊕ γ)) Av(α ⊕ 1 ⊕ γ), and thus we may omit the intersection with Av(α ⊕ 1 ⊕ γ) in the formula of Theorem 6.2. Indeed, if a permutation is concatenated of two parts, first avoiding α ⊕ 1 and the second avoiding 1 ⊕ γ, such a permutation cannot contain an occurrence of α ⊕ 1 ⊕ γ since one of the two parts would contain the middle 1 and thus the forbidden pattern.

More uncomposable classes
So far we have used classes such as V or H to prove that other classes are composable. In this section, we will show that these classes, and classes similar to them, are themselves uncomposable.
We call a permutation η ∈ H alternating if η(2i − 1) < η(2i) > η(2i + 1) for all possible values of i. We will use the following simple observation about alternating permutations in H.  Proof. We will show the proof for the class H, the same approach can be applied to every mentioned horizontal merge and the result is transferred by inversion to the vertical merges by to Corollary 3.6. Suppose that H is composable from its proper subclasses C 1 , . . . , C k . Each of C 1 , . . . , C k avoids a permutation of H, thus according to Observation 6.3 there is an alternating permutation η ∈ H such that C i ⊆ Av(η) and therefore if C = Av(η) ∩ H H we have H ⊆ (C) k .
Any permutation π ∈ C is merged from two sequences a and b of consecutive integers. We label elements of π by a or b depending on which sequence they belong to. A sequence of elements with alternating labels forms a copy of an alternating permutation in π. The length of the longest sequence of alternating labels in π is thus limited by a constant N determined by the order of η, thus π can be broken into at most N contiguous parts each having one label. Since elements labeled with a single label form a sequence of consecutive integers, this implies that π is in fact an N -block. Since the choice of π was arbitrary, every permutation of C is an N -block and by Lemma 5.7 every permutation of (C) k is an (N k )-block. But a long enough alternating permutation from H is not an (N k )-block, therefore H (C) k and the proof is finished.

Conclusion
This paper studies the previously unexplored concept of composability of permutation classes. Given a permutation class, our main goal is to show, how it can be constructed using smaller permutation classes and the composition operator, or to prove that this cannot be done. Throughout the paper, we present both types of results.
On the positive side, Theorems 4.5 and 4.6 show two distinct ways of constructing the class Av(k · · · 21), Theorem 5.5 provides infinitely many examples of classes of layered patterns which can be constructed from simpler subclasses and Theorem 6.2 shows that many principal classes avoiding a decomposable pattern are composable.
On the negative side, in Theorems 5.1, 5.2, 5.4 and 5.8 we present four different classes of layered patterns which cannot be constructed from any number of proper subclasses using composition, and Proposition 6.4 provides us with 8 more examples of uncomposable classes.
Composability is similar to splittability in that both these properties describe how a bigger class is built from smaller ones. We do not know whether these two properties are somehow connected; however, our research suggests that this may be the case, since every composable class we have found so far is also splittable. We have found examples of splittable yet uncomposable classes, namely the classes L 2 and L 3 introduced in Section 5. The class of all layered permutations is an example of a both uncomposable and unsplittable class. The last case remains open and we pose it as a question for future work.
Question. Is there a permutation class which is composable and unsplittable?
In Section 3 we showed that if a class is composable and avoids an increasing pattern, then its reverse and complement are composable. It remains open whether the avoidance condition is necessary.
Question. Is there a composable class A such that A r or A c is not composable?
Splittability has the property that if a class is splittable, it can be split into two parts. This is not the case for composability as we showed in Section 4 where we proved that the class L k for k ≥ 4 is 3-composable but not 2-composable.
Question. Is there a 4-composable class which is not 3-composable? More generally, is there a universal constant K such that every composable class is K-composable?
Our work may find applications in enumerating permutation classes. Denote by gr(A) the growth rate of the class A as defined e.g. in [10]. It is not difficult to see that if C ⊆ A • B, then gr(C) ≤ gr(A) · gr(B). Using this observation one could try to find upper bounds for growth rates of composable permutation classes.

Acknowledgement
I am very grateful to Vít Jelínek for many consultations, valuable advice and proofreading of this work.