A Permutation Avoidance Game with Reverse Replies and Monotone Traps

We study the impartial game PAP (``permutations avoiding patterns''), in which players take turns choosing patterns to avoid. We define a set of length $k$ patterns, $B_k$, and show that it is the unique minimal monotone-forcing subset of $S_k$: ever…

Authors: Henning Ulfarsson

A Permutation Avoidance Game with Reverse Replies and Monotone Traps
A PERMUT A TION A V OID ANCE GAME WITH REVERSE REPLIES AND MONOTONE TRAPS HENNING ULF ARSSON Abstract. W e study the impartial game P AP (“permutations av oiding patterns”), in whic h play ers take turns choosing patterns to av oid. W e define a set of length k patterns, B k , and show that it is the unique min- imal monotone-forcing subset of S k : ev ery sufficien tly long permutation that a voids B k is monotone, and every monotone-forcing subset of S k m ust con tain B k . W e prov e a quadratic upp er b ound for the monotone- forcing threshold, and determine the exact thresholds for k = 3 , 4 , 5 , 6. W e use prop erties of the sets B k to prov e that a rev erse-reply strategy wins P AP on S n when k = 4 for all n ≥ 10; for k = 3, the same strategy can b e analysed directly . W e conjecture that it is a winning strategy for all k and n sufficien tly large. 1. Introduction Fix n ≥ 1 and let S n b e the set of p erm utations of length n in one- line notation. F or π = π (1) · · · π ( n ) ∈ S n , w e write π r = π ( n ) · · · π (1) for the r everse and π c = ( n +1 − π (1)) · · · ( n +1 − π ( n )) for the c omplement . W e sa y that π c ontains a pattern p ∈ S k if there exist indices 1 ≤ i 1 < · · · < i k ≤ n suc h that the subsequence π ( i 1 ) · · · π ( i k ) is order-isomorphic to p ; otherwise π avoids p . F or background on permutation patterns and p erm utation classes, see V atter [12]. Throughout the paper w e study the follo wing normal-pla y impartial game. Definition 1.1. Fix k ≥ 1. In the game Permutations A voiding Patterns , or P AP , with p attern length k , a p osition is a subset X ⊆ S n . A mov e consists of c ho osing a pattern p ∈ S k that is contained in at least one permutation of X , and replacing X b y the subset of p erm utations in X that av oid p . Because a c hosen length- k pattern remains forbidden for the rest of the game and there are only k ! such patterns, every play terminates after at most k ! mo ves. The game can equally w ell b e play ed with more general notions of pat- tern, such as the mesh patterns of Br¨ and ´ en and Claesson [2], but we restrict atten tion to classical patterns throughout. Related sequence and p erm u- tation games app ear already in the monotonic sequence games of Harary , Sagan, and W est [5] and the later work of Alb ert et al. [1]. More recently , Pudw ell [9] studied a differen t tw o-pla y er p ermutation game based on the Date : March 18, 2026. 1 2 HENNING ULF ARSSON Erd˝ os–Szek eres theorem, where the pla y ers build a permutation one entry at a time and try to av oid long monotone subsequences. Combinatorial games on p ermutations were also studied b y Parton [7], who in tro duced Perm u- Nim, an impartial p erm utation-av oidance game play ed on an m × n b oard b y placing p oin ts in un used rows and columns while a voiding a fixed pattern. Th us P arton’s p ositions are partial p ermutation matrices on a b oard, and the geometry of the b oard itself plays a central role, rather than subsets of a fixed symmetric group S n . W e are mainly interested in the starting position X = S n . If a set F ⊆ S k of patterns has already b een chosen, then the current p osition is Av n ( F ) = { π ∈ S n : π av oids every pattern in F } . So for fixed k the game may b e viewed as a game on subsets of S k . W e will sho w that for k = 3, a simple r everse str ate gy already wins for Pla y er I I (the second pla y er). F or k = 4, and more generally for large- n rev erse-reply questions, the k ey structure is a unique minimal monotone- forcing set B k ⊆ S k of patterns, whic h w e define b elow. F rom the game-theoretic p oin t of view, the main results are these. F or k = 3, the reverse reply wins for ev ery n ≥ 3. F or k = 4, the complete picture is that the mov e-b y-mo v e reverse strategy w orks at n = 4, fails at n = 5 , 6 , 7 , 8 , 9, and then works again for all n ≥ 10. The failure at small n splits in to tw o different phenomena: at n = 6 the starting p osition itself is an N-position, whereas at n = 5 , 7 , 8 , 9 the starting p osition is still a P- p osition but the rev erse mov e need not be the correct winning reply . The k = 4 theorem for n ≥ 10 is pro v ed b y com bining the structural B k analysis with a finite verification. The pap er therefore has tw o intert wined themes. Sections 3–5 and 7 dev elop the structural theory of the sets B k : a recursive c haracterization, minimalit y , upp er and lo w er b ounds for the monotone-forcing threshold, and threshold data for small k . Sections 2 and 6 are the game-theoretic side: Section 2 analyzes the small starting p ositions, while Section 6 uses the structure of B k to prov e the large- n rev erse-reply theorem for k = 4. The role of B k in the game is precisely that it supplies b oth the monotone endgame and the near-monotone witness families that make most rev erse replies uniform. F or general k , the pap er goes only as far as a conjectural extension of this picture. The discussion beyond k = 4 is in tended to isolate the next structural obstruction, not to claim a fully scalable theorem. Sev eral results in the pap er are computer-assisted. Those computations are all exhaustiv e and, with the exception of the separate N 6 threshold com- putation, are repro duced b y the scripts collected in the public repository [11], sp ecifically in the directory code-permuta/ ; see Section 9. PERMUT A TION A VOIDANCE GAME 3 2. Basic P AP anal ysis Definition 2.1. Fix k ≥ 1. F or a P AP p osition X ⊆ S n , the set of fol lowers F ( X ) is the set of all p ositions reac hable from X in one mov e. The Spr ague– Grundy value [10, 4] of X is defined recursively by sg( X ) = mex { sg ( Y ) : Y ∈ F ( X ) } , where mex( S ) denotes the minimal excludant, that is, the least non-negative in teger not in S . A terminal p osition (one with F ( X ) = ∅ ) has sg( X ) = 0. Under normal pla y , Pla y er I (the next mo ver) wins from X if and only if sg( X )  = 0 and the p osition is called an N-p osition . Otherwise, when sg( X ) = 0, it is called a P-p osition (previous pla yer wins). F or the starting p osition with the single allow ed pattern length k , we write sg( S n , k ) for the Sprague–Grundy v alue of S n . Prop osition 2.2. F or every n ≥ 1 , sg ( S n , 1) = 1 . Pr o of. The only legal mo ve is to choose the pattern 1, which remo v es every p erm utation. □ Prop osition 2.3. F or every n ≥ 1 , sg ( S n , 2) = 0 . Pr o of. If n = 1, there are no legal mov es, so sg ( S 1 , 2) = 0. Now assume n ≥ 2. The only length-2 patterns are 12 and 21. Cho osing 12 lea v es Av n ( { 12 } ) = { id r n } , from which the only legal mo v e is 21, after which the p osition is empty . The case of first c ho osing 21 is symmetric. Hence ev ery follo w er of S n has Sprague–Grundy v alue 1, and sg( S n , 2) = mex { 1 } = 0. □ By the proposition ab ov e, for k = 2 and n ≥ 2, Play er II wins b y c ho osing the rev erse of Play er I’s mo ve. The same reverse-reply idea already settles the case k = 3. Lemma 2.4. F or n ≥ 4 we have Av n (123 , 321 , 132 , 231) = ∅ , Av n (123 , 321 , 213 , 312) = ∅ , Av n (132 , 231 , 213 , 312) = { id n , id r n } . Pr o of. Every p erm utation of length at least 4 contains a 4-p oin t subpat- tern order-isomorphic to some elemen t of S 4 , so it is enough to chec k the 24 p ermutations in S 4 . A direct insp ection sho ws that every element of S 4 con tains at least one of 123 , 321 , 132 , 231, and similarly at least one of 123 , 321 , 213 , 312. Lik ewise, every element of S 4 except 1234 and 4321 con- tains at least one of 132 , 231 , 213 , 312. □ Theorem 2.5. F or every n ≥ 3 , sg ( S n , 3) = 0 . Pr o of. The statemen t is immediate for n = 3, so assume n ≥ 4. Pla y er II replies to ev ery mo ve b y choosing the reverse pattern. 4 HENNING ULF ARSSON If Pla y er I c ho oses 123, Play er I I chooses 321. If n ≥ 5 then Pla y er I I has already w on, since b y the Erd˝ os–Szek eres theorem [3] every p ermutation of length at least 5 contains either 123 or 321. If n = 4, a mov e is p ossible, and b y Lemma 2.4, an y third mov e m ust b e one of 132 , 213 , 231 , 312, and after that Pla y er I I can again choose the reverse and finish the game. If Pla y er I c ho oses 132, Play er I I chooses 231. If Pla y er I next c ho oses 123 or 321, then Play er II c ho oses the reverse and empties the set by Lemma 2.4. If Pla yer I chooses 213 or 312, then Play er I I again c ho oses the reverse, and the position b ecomes { id n , id r n } . In that position the only legal mo ves are 123 and 321, so it is again a P-p osition. The cases 231, 213, 312, and 321 follo w b y symmetry . □ R emark 2.6 . The computer-assisted results in Sections 2, 6, and 7 are repro- duced b y the fo cused scripts in the public rep ository [11], namely code-permuta/ , except for the separate N 6 threshold computation; se e Section 9. In the next few pages, the Sprague–Grundy language is used mainly for t w o purp oses: to record small- n data, and to s eparate the statement “ S n is a P-p osition” from the stronger statement that the literal mov e-b y-mo v e rev erse rule is a winning strategy . The later k = 4 theorem for n ≥ 10 is pro v ed b y the rev erse-reply criterion from Corollary 2.13, which establishes the stronger strategy statement. A natural question is whether the same reverse strategy contin ues to win for general k . T able 1 records Sprague–Grundy v alues for sev eral small cases. The en tries for k = 1 , 2 , 3 follo w from the results ab ov e; the entries for k = 4 w ere computed b y exhaustive searc h; see Section 9. n sg( S n , 1) sg ( S n , 2) sg ( S n , 3) sg ( S n , 4) 1 1 0 0 0 2 1 0 0 0 3 1 0 0 0 4 1 0 0 0 5 1 0 0 0 6 1 0 0 2 7 1 0 0 0 8 1 0 0 0 9 1 0 0 0 10 1 0 0 0 T able 1. Sprague–Grundy v alues for P AP on S n up to n = 10 and k = 4. The picture b ecomes more n uanced already at k = 4. The exceptional v alue sg( S 6 , 4) = 2 PERMUT A TION A VOIDANCE GAME 5 sho ws that the naiv e guess that S n should alwa ys b e a P-p osition for fixed k is false. A further computation explains this v alue: among the 24 follow ers Av 6 ( p ), t w elve hav e Sprague–Grundy v alue 0, t w o hav e v alue 1, and the remaining ten ha v e v alue 3; hence sg( S 6 , 4) = mex { 0 , 1 , 3 } = 2 . Moreo v er, ev en when the starting p osition is a P-p osition, the mov e-b y-mo v e rev erse strategy need not b e a winning strategy . Prop osition 2.7. F or k = 4 , tests fr om the starting p osition S n show that the move-by-move r everse str ate gy works for n = 4 and fails for n = 5 , 6 , 7 , 8 , 9 . Pr o of. This follo ws from an exhaustive computer search of the reverse- strategy game tree for 4 ≤ n ≤ 9; see Section 9. □ Example 2.8 illustrates how the reverse strategy can fail. Example 2.8. At n = 9 the reverse reply can already fail on the very next mo v e, even though it remains legal. Starting from S 9 , supp ose Pla y er I c ho oses 1234 and Play er I I replies with the reverse 4321. Then Pla yer I can c ho ose 1324. The rev erse resp onse 4231 is still legal, since a coun t giv es 334 a v oiders b efore 4231 is forbidden and 2 afterwards, yet it lands in an N-p osition: sg( { 1234 , 4321 , 1324 , 4231 } ) = 2 . In fact, the winning replies after 1324 are 3412, 3421, and 4312. Section 6 shows that what happ ened in Example 2.8 disapp ears once certain witness-families stabilize (from n ≥ 9 for non-monotone replies) and once the monotone endgame is av ailable (from n ≥ 10). Exact computation also reveals a rigid pattern in the lengths of optimal pla y when k = 4. Figure 1 shows the distributions of complete play lengths under optimal pla y from S n for 5 ≤ n ≤ 10, with bar heigh ts on a logarithmic scale. The supp orts of these distributions are particularly simple: at n = 5 they are the even lengths 10 , 12 , . . . , 24; at n = 6 they are the o dd lengths 7 , 9 , . . . , 23; at n = 7 , 8 , 9 they are the ev en lengths 4 , 6 , . . . , 24; and at n = 10 they are the even lengths 2 , 4 , . . . , 24. Th us n = 6 is exceptional not only in its Sprague–Grundy v alue but also in the parity pattern of optimal game lengths. These computations suggest that the rev erse strategy do es not hold uni- formly in n , but may still gov ern the large- n game. W e will prov e b elo w that for k = 4 the reverse strategy do es indeed succeed for every n ≥ 10. W e believe that the same phenomenon holds for general k : there are small- n obstructions to the rev erse strategy , but for large enough n it is a winning strategy for Play er I I. W e therefore make the following conjecture. Conjecture 2.9. F or every k ≥ 3 , ther e exists n 0 ( k ) such that the r everse str ate gy is a winning str ate gy for Player II on S n for al l n ≥ n 0 ( k ) . In p articular, sg ( S n , k ) = 0 for al l such n . 6 HENNING ULF ARSSON 6 12 18 4 8 12 16 20 24 n = 5 4 8 12 16 20 24 n = 6 6 12 18 4 8 12 16 20 24 n = 7 4 8 12 16 20 24 n = 8 6 12 18 4 8 12 16 20 24 n = 9 4 8 12 16 20 24 2 n = 10 Figure 1. Distributions of complete play lengths under op- timal pla y for P AP on S n with pattern length 4, for 5 ≤ n ≤ 10. Bar heights are log 10 of the num ber of optimal pla y lines of the giv en length. T o build the theoretical foundation for that later k = 4 theorem, we first isolate the monotone endgame and then form ulate the rev erse-reply criterion that w e will actually use. Definition 2.10. W e sa y that a set F ⊆ S k is r everse-close d if p ∈ F if and only if p r ∈ F . F or a fixed length n , a pattern p is le gal from F at length n if some p ermutation in Av n ( F ) contains p . When the length n is clear from the con text, w e simply say that p is le gal from F . Lemma 2.11. If F ⊆ S k is r everse-close d, then Av n ( F ) is r everse-close d: π ∈ Av n ( F ) if and only if π r ∈ Av n ( F ) . In p articular, a p attern p is le gal fr om F if and only if p r is le gal fr om F . Pr o of. A p ermutation π av oids F if and only if π r a v oids F r = F . □ Prop osition 2.12. L et k ≥ 2 , let F ⊆ S k b e r everse-close d, and supp ose that F c ontains neither monotone p attern. Then b oth monotone p atterns ar e le gal fr om F . If n ≥ ( k − 1) 2 + 1 , then after one monotone p attern is chosen, the other is le gal, and after b oth monotone p atterns ar e chosen no le gal moves r emain. PERMUT A TION A VOIDANCE GAME 7 Pr o of. Since F contains neither monotone pattern, the increasing permu- tation id n and the decreasing p ermutation id r n b oth lie in Av n ( F ). Hence 12 · · · k and k · · · 21 are b oth legal from F . After 12 · · · k is c hosen, the permutation id r n still lies in Av n ( F ∪ { 12 · · · k } ) and contains k · · · 21, so the decreasing monotone pattern remains legal. The other case is symmetric. If b oth monotone patterns hav e b een chosen and n ≥ ( k − 1) 2 + 1, then b y the Erd˝ os–Szek eres theorem ev ery permutation of length n con tains at least one of them, so no p erm utation surviv es. □ Corollary 2.13. Fix k ≥ 2 and n ≥ ( k − 1) 2 + 1 . Supp ose that whenever F ⊆ S k is r everse-close d, c ontains neither monotone p attern, and p ∈ S k \ F is a non-monotone p attern le gal fr om F , the r everse p attern p r is le gal fr om F ∪ { p } . Then the move-by-move r everse str ate gy is a winning str ate gy for Player II on S n . In p articular, S n is a P-p osition. Pr o of. Starting from the empty forbidden set, Play er I I alwa ys replies to Pla y er I b y c ho osing the reverse pattern. At each stage, let F denote the curren t forbidden set after Play er I I’s previous mo ve; then F is rev erse- closed. If Play er I chooses a non-monotone pattern while F con tains neither monotone pattern, then the hypothesis gives a legal reply p r . If Play er I chooses a monotone pattern, then Prop osition 2.12 sho ws that the other monotone pattern is legal, and that after Pla yer I I replies there are no legal mov es left. Th us Play er I I can answer every mo ve of Pla yer I by the rev erse pattern, and the game ends on Pla y er II’s mov e. Hence the mo ve-b y-mov e rev erse strategy is winning, and in particular S n is a P-p osition. □ 3. Definitions and the sets B k The next three sections supply the structural input for the game result, Theorem 6.13, pro v ed in Section 6. This section introduces the sets B k and their recursive description, Section 4 prov es their minimalit y via wit- ness families, and Section 5 dev elops the monotone-forcing bounds on the threshold N k . Definition 3.1. F or k ≥ 3, define p k = 12 · · · ( k − 2) k ( k − 1) , q k = 1 k ( k − 1) · · · 2 , r k = 21 3 4 · · · k , s k = 23 · · · k 1 . W e set B k = { p k , q k , r k , s k , p c k , q c k , r c k , s c k } . 8 HENNING ULF ARSSON Th us B 3 = { 132 , 213 , 231 , 312 } , B 4 = { 1243 , 1432 , 2134 , 2341 , 3214 , 3421 , 4123 , 4312 } , B 5 = { 12354 , 15432 , 21345 , 23451 , 43215 , 45321 , 51234 , 54312 } , B 6 = { 123465 , 165432 , 213456 , 234561 , 543216 , 564321 , 612345 , 654312 } . W e note that for k = 3 we ha ve p 3 = 132 = q 3 , r 3 = 213 = s c 3 , s 3 = 231 = r c 3 , and p c 3 = 312 = q c 3 , so B 3 has only four distinct elements. F or k ≥ 4 it is easy to verify that the eight patterns in B k are all distinct, as illustrated for k = 6 in Figure 2. Notice also that r k = ( p r k ) c = ( p c k ) r and s k = q r k . Th us p k , p c k , r k , r c k form one rev erse/complemen t orbit, and q k , q c k , s k , s c k form the other. p 6 q 6 r 6 s 6 p c 6 q c 6 r c 6 s c 6 Figure 2. The eight patterns in B 6 . T op row: p 6 , q 6 , r 6 , s 6 . Bottom ro w: their complements. With the following definition, w e can giv e a recursive c haracterisation of the sets B k . Definition 3.2. F or π ∈ S n and 1 ≤ ℓ ≤ n , the shadow Sh ℓ ( π ) is the set of ℓ -patterns contain ed in π . When ℓ = n − 1, this is exactly the set obtained b y deleting one en try from π and standardising the result. Prop osition 3.3. F or k ≥ 4 , a p ermutation π ∈ S k b elongs to B k if and only if Sh k − 1 ( π ) c onsists of exactly one monotone p attern and one element of B k − 1 . Pr o of. F orward. The shadow op eration commutes with reverse and com- plemen t, so it suffices to c heck the t wo generators p k , q k . F or p k = 12 · · · ( k − 2) k ( k − 1): deleting any of the first k − 2 entries lea v es a p ermutation of the same shap e, namely p k − 1 ; deleting en try k or en try k − 1 remo v es the only descent, lea ving id k − 1 . Hence Sh k − 1 ( p k ) = { p k − 1 , id k − 1 } . PERMUT A TION A VOIDANCE GAME 9 F or q k = 1 k ( k − 1) · · · 2: deleting the first entry 1 leav es id r k − 1 ; delet- ing any entry from the decreasing tail k ( k − 1) · · · 2 leav es q k − 1 . Hence Sh k − 1 ( q k ) = { q k − 1 , id r k − 1 } . Bac kw ard. Suppose Sh k − 1 ( π ) = { m, u } where m is monotone and u ∈ B k − 1 . By applying the complement if necessary , we ma y assume m = id k − 1 . Let x b e an en try whose deletion leav es id k − 1 , and let M b e the increasing ( k − 1)-pattern formed b y the remaining en tries. Relative to M , the p oint x lies in some cell ( i, j ), meaning that exactly i p oints of M lie to the left of x and exactly j lie b elow x . Since deleting x from u leav es id k − 2 , the forw ard direction applied at lev el k − 1 shows that u must b e one of r k − 1 , q c k − 1 , s k − 1 , p k − 1 . Equiv alently , inserting one p oint into an increasing ( k − 2)-pattern yields r k − 1 in cells (0 , 1) , (1 , 0) , q c k − 1 in cell (0 , k − 2) , s k − 1 in cell ( k − 2 , 0) , p k − 1 in cells ( k − 3 , k − 2) , ( k − 2 , k − 3) . No w delete one p oint of M instead of deleting x . Relative to the remaining increasing ( k − 2)-pattern, the p oint x mov es to one of ( i, j ) , ( i − 1 , j ) , ( i, j − 1) , ( i − 1 , j − 1) , according to whether the deleted p oint lies right or left of x , and ab ov e or b elo w it. Since ev ery such deletion gives the same pattern u , ev ery realized cell m ust b e one of the cells listed ab o ve for u . This forces u = r k − 1 and ( i, j ) ∈ { (0 , 1) , (1 , 0) } , u = q c k − 1 and ( i, j ) = (0 , k − 1) , u = s k − 1 and ( i, j ) = ( k − 1 , 0) , u = p k − 1 and ( i, j ) ∈ { ( k − 2 , k − 1) , ( k − 1 , k − 2) } . These are exactly the insertions pro ducing r k , q c k , s k , and p k , resp ectiv ely , so π ∈ B k . □ Definition 3.4. Let X ⊆ S k . W e call X monotone for cing if there exists N suc h that for all n ≥ N , Av n ( X ) = { id n , id r n } . A trivial example of a monotone-forcing set is S k \ { id k , id r k } , since for n ≥ k the only length n p ermutations that av oid all non-monotone patterns of length k are the t wo monotone p erm utations. 10 HENNING ULF ARSSON 4. Witness f amilies and minimality F or each elemen t of B k there is an infinite family that contains only that pattern and one monotone pattern. Definition 4.1. F or n ≥ 2, define π n = 12 · · · ( n − 2) n ( n − 1) , ρ n = 1 n ( n − 1) · · · 2 , σ n = 21 3 4 · · · n, τ n = 23 · · · n 1 . Clearly π k = p k , ρ k = q k , σ k = r k , and τ k = s k , but for clarity w e use different notation for the infinite families of the witness permutations compared with the patterns. The follo wing prop osition is an analogue of Prop osition 3.3 for these families. Prop osition 4.2. Fix k ≥ 3 and n ≥ k . Then Sh k ( π n ) = { 12 · · · k , p k } , Sh k ( ρ n ) = { k · · · 21 , q k } , Sh k ( σ n ) = { 12 · · · k , r k } , Sh k ( τ n ) = { 12 · · · k , s k } , and similarly Sh k ( π c n ) = { k · · · 21 , p c k } , Sh k ( ρ c n ) = { 12 · · · k , q c k } , Sh k ( σ c n ) = { k · · · 21 , r c k } , Sh k ( τ c n ) = { k · · · 21 , s c k } . Pr o of. F or π n , an o cc urrence of a k -pattern either omits at least one of the final t wo entries, in which case it lies in an increasing subsequence and hence has pattern 12 · · · k , or it uses b oth final entries, in which case the relativ e order is p k . The argument for ρ n is the same: either one omits the exceptional en try or en tries and obtains a monotone subsequence, or one includes them and obtains q k . The claims for the other families follow b y applying the appropriate symmetry . □ Theorem 4.3. Every monotone-for cing subset of S k c ontains B k . Pr o of. Let X ⊆ S k b e monotone forcing. First, X cannot contain either monotone pattern: if 12 · · · k ∈ X , then the increasing p ermutations id n ( n ≥ k ) never b elong to Av n ( X ); similarly if k · · · 21 ∈ X , then the decreasing p erm utations id r n ( n ≥ k ) nev er b elong to Av n ( X ). No w supp ose that some q ∈ B k is not in X . By Proposition 4.2, there is an infinite family W n with Sh k ( W n ) = { q , m } for a single monotone pattern m . Since neither monotone pattern b elongs to X and q / ∈ X , every W n a v oids X . Moreov er, each W n is non-monotone. This con tradicts the assumption that X is monotone forcing. □ PERMUT A TION A VOIDANCE GAME 11 5. Why B k eventuall y for ces monotonicity W e start with a lemma: Lemma 5.1. L et k ≥ 4 , and let M b e an incr e asing ( k − 1) -p attern. If a p oint is inserte d r elative to M in one of the c el ls (0 , 1) , (1 , 0) , (0 , k − 1) , ( k − 1 , 0) , ( k − 2 , k − 1) , ( k − 1 , k − 2) , then the r esulting k -p attern lies in B k . Figure 3 sho ws these cells in the case k = 5. 0 0 1 1 2 2 3 3 4 4 i j (0 , 1) (1 , 0) (0 , 4) (4 , 0) (3 , 4) (4 , 3) Figure 3. The cell decomposition determined b y an increas- ing pattern M = id 4 when k = 5. The cell ( i, j ) records that i p oints of M lie to the left and j lie b elow. The shaded cells are the six cells from Lemma 5.1. Pr o of. Inserting a p oint in to either of the cells (0 , 1) and (1 , 0) b oth pro duce the pattern r k . Inserting in to cell (0 , k − 1) produces q c k . Inserting in to cell ( k − 1 , 0) pro duces s k , and inserting in to either ( k − 2 , k − 1) or ( k − 1 , k − 2) pro duces p k . All four distinct patterns b elong to B k . □ The next theorem gives a general, explicit b ound for when B k forces mono- tonicit y . W rite LIS( π ) and LDS( π ) for the lengths of a longest increasing and a longest decreasing subsequence of π , resp ectively . Theorem 5.2. L et k ≥ 4 . If a p ermutation π avoids B k and has an in- cr e asing subse quenc e of length 3 k − 7 , then π is incr e asing. By symmetry, if π avoids B k and has a de cr e asing subse quenc e of length 3 k − 7 , then π is de cr e asing. Conse quently, Av n ( B k ) = { id n , id r n } for al l n ≥ (3 k − 8) 2 + 1 . 12 HENNING ULF ARSSON Pr o of. Let M = ( m 1 < · · · < m r ) b e a longest increasing subsequence of π , where r ≥ 3 k − 7. F or a p oint x not in M , define its cell ( i, j ) b y requiring that exactly i p oints of M lie to the left of x and exactly j points of M lie b elo w x . No w supp ose that x lies ab ov e the diagonal, so i < j . If j − i ≥ k − 1, then choosing ( k − 1) p oin ts of M from the gap b et w een i and j produces a shorter increasing sequence M ′ . Relative to M ′ the p oin t x lies in the cell (0 , k − 1) and hence a pattern from B k b y Lemma 5.1. If r − j ≥ k − 2, then choosing one p oint of M from the gap and ( k − 2) p oin ts abov e j produces the cell (0 , 1) and again a pattern from B k b y Lemma 5.1. If i ≥ k − 2, then c hoosing ( k − 2) points of M b elo w i and one from the gap produces the cell ( k − 2 , k − 1) and again a pattern from B k b y Lemma 5.1. Figure 4 illustrates these three choices in the case k = 5 and r = 8. x j − i ≥ 4 x lies in cell (0 , 4) relativ e to M ′ x r − j ≥ 3 x lies in cell (0 , 1) relativ e to M ′ x i ≥ 3 x lies in cell (3 , 4) relativ e to M ′ Figure 4. The three cases in the pro of of Theorem 5.2. The c hosen 4-p oint subsequence places x in one of the dangerous cells from Lemma 5.1. Therefore, if x do es not create a pattern from B k , then all three inequal- ities fail, and we must hav e j − i ≤ k − 2 , r − j ≤ k − 3 , i ≤ k − 3 . Hence j ≥ r − ( k − 3) ≥ 2 k − 4 , but also j ≤ i + ( k − 2) ≤ 2 k − 5 , a con tradiction. So no p oint can lie abov e the diagonal. By reversing the argumen t, no p oin t can lie b elow the diagonal either. Th us ev ery p oint of π lies on the diagonal cells determined by M . But a p oin t on a diagonal cell together with M implies the existence of a monotone PERMUT A TION A VOIDANCE GAME 13 subsequence of length r + 1, contradicting the maximality of M . Therefore π = M is increasing. The decreasing case is symmetric. No w let π b e a non-monotone permutation a v oiding B k . The first part sho ws that LIS( π ) ≤ 3 k − 8 , LDS( π ) ≤ 3 k − 8 . By the Erd˝ os–Szekeres theorem, ev ery p ermutation of length (3 k − 8) 2 + 1, or longer, has either an increasing or a decreasing subsequence of length 3 k − 7. Hence no non-monotone p erm utation of that length can a void B k . □ Let N k b e the least in teger suc h that Av n ( B k ) = { id n , id r n } for all n ≥ N k . Theorem 5.2 sho ws that N k ≤ (3 k − 8) 2 + 1. W e defer sharper upper and lo w er b ounds on N k to Section 7. W e now use the structure of the sets B k to pro v e that the reverse-reply strategy works for k = 4 and sufficiently large n . 6. Pro ving the Reverse-Repl y Stra tegy for k = 4 W e now use the structural analysis of the sets B k to prov e that the mov e- b y-mo ve rev erse strategy works for k = 4. By Corollary 2.13, it is enough to v erify that whenever a non-monotone pattern is legal from a reverse-closed monotone-free state, its reverse remains legal after that mov e. The proof splits into three steps. W e first handle the four reverse pairs in- side B 4 using the witness families from De finition 4.1 in Lemma 6.1. W e then treat the six remaining non-monotone rev erse pairs, other than { 2413 , 3142 } , using extended witness families from Definition 6.2 in Lemma 6.10. Finally , w e resolve the hard pair { 2413 , 3142 } using the supp ort sets from Defini- tion 6.11 in Prop osition 6.12. Figure 5 summarizes this division of cases and the to ols used in each branc h. W e b egin with the patterns in B 4 . Lemma 6.1. F or e ach q ∈ B k , the witness family fr om Pr op osition 4.2 for q avoids q r . In p articular, after q is forbidden, q r r emains le gal (witnesse d by the singleton-p attern family for q r , which avoids q ). Pr o of. Let W n b e the witness p erm utation for q from Prop osition 4.2. Then Sh k ( W n ) = { q , m } where m is a monotone pattern, and the witness W ′ n for q r satisfies Sh k ( W ′ n ) = { q r , m ′ } where m ′ is the other monotone pattern. Since q r is non-monotone, q r  = m ; since no p ermutation of length ≥ 2 equals its reverse, q r  = q , so q r / ∈ { q , m } and W n a v oids q r . Symmetrically , q is non-monotone and hence q  = m ′ , while q  = q r , so q / ∈ { q r , m ′ } and W ′ n a v oids q . □ W e now handle the non- B 4 patterns. Definition 6.2. F or a non-monotone p ∈ S 4 \ B 4 and a sp ecified companion q ∈ B 4 , an extende d witness family for ( p, q ) is any choice of p ermutations 14 HENNING ULF ARSSON rev erse-closed monotone-free state F legal non-monotone mo v e p p ∈ B 4 Lemma 6.1 singleton witnesses p / ∈ B 4 and p / ∈ { 2413 , 3142 } Definition 6.2, Prop osition 6.3, Lemma 6.10 p ∈ { 2413 , 3142 } Definition 6.11, Prop osition 6.12 the rev erse reply p r is legal after p Corollary 2.13 rev erse strategy wins Theorem 6.13 S n is a P-p osition for n ≥ 10 Figure 5. Logical flow of the k = 4 reverse-reply pro of. E n ( p, q ), one for eac h n ≥ 7, such that Sh 4 ( E n ( p, q )) ⊆ { p, q , 1234 , 4321 } . The cutoff n ≥ 7 is explained b y the constructions b elo w, b ecause it ensures the long monotone blo ck then has length at least 4, so every 4- pattern is forced either to lie en tirely in that blo ck or to use the exceptional en tries together with the monotone blo c k. Prop osition 6.3. F or e ach of the 6 non- B 4 , non-monotone r everse p airs { p, p r } other than { 2413 , 3142 } , ther e exist two c omp anion p atterns q 1 , q 2 ∈ B 4 fr om distinct r everse p airs, to gether with p ermutation families E n ( p, q i ) valid for al l n ≥ 7 , such that Sh 4  E n ( p, q i )  \ { 1234 , 4321 } = { p, q i } . Mor e over, e ach such family avoids p r . Example 6.4. F or E n (1324 , 1243) = 1 , 2 , . . . , n − 3 , n − 1 , n − 2 , n, the only non-monotone 4-patterns are 1243 and 1324. Rev ersing giv es E n (1324 , 1243) r = n, n − 2 , n − 1 , n − 3 , . . . , 1 , PERMUT A TION A VOIDANCE GAME 15 whose only non-monotone 4-patterns are 3421 and 4231. This sample family illustrates b oth one of the witness families from Proposition 6.3 and the rev ersal step used later in Lemma 6.10. Figure 6 sho ws the case n = 9 together with its reverse. E 9 (1324 , 1243) = 123456879 1324 witness in blue E 9 (1324 , 1243) r = 978654321 4231 witness in blue Figure 6. An instance of the family E n (1324 , 1243) and its rev erse, sho wn here for n = 9. Pr o of. Each displa y ed family in T able 2 consists of one long monotone blo ck together with at most three exceptional en tries. Consequen tly ev ery non- monotone 4-pattern must use at least one exceptional entry , and once the c hosen exceptional en tries are fixed, the tail contributes only monotone or- der. Thus the v erification reduces to a short insp ection according to which exceptional en tries are used and ho w many en tries come from the tail. The preceding example c hec ks the first row. As a second representativ e case, in the row E n (2143 , 1432) = 2 , 1 , n, n − 1 , . . . , 3 , c ho osing four en tries from the decreasing tail giv es the monotone pattern 4321, choosing one of the first t wo entries together with three en tries from the tail alw ays gives 1432, and choosing b oth initial entries together with t w o entries from the tail gives 2143. Thus the only non-monotone patterns are again the target and its stated companion. The t w o remaining display ed symmetry classes are chec k ed in the same w a y: once the exceptional en tries are fixed, the long tail contributes only monotone order. The other 20 ordered pairs ( p, q ) are obtained from these four represen tativ es by rev erse, complement, and in verse symmetries. □ Example 6.5. Let F = { 1432 , 2341 } . Then F is reverse-closed, contains no monotone pattern, and omits the rev erse pair 1243 / 3421 from B 4 . The family E n (1324 , 1243) ab ov e shows 16 HENNING ULF ARSSON p p r q F amily E n ( p, q ) E 7 ( p, q ) 1324 4231 1243 1 , 2 , . . . , n − 3 , n − 1 , n − 2 , n 1234657 1342 2431 1243 1 , 2 , . . . , n − 3 , n − 1 , n, n − 2 1234675 1342 2431 2341 1 , 3 , 4 , . . . , n, 2 1345672 2143 3412 1432 2 , 1 , n, n − 1 , . . . , 3 2176543 T able 2. Extended witness families for non- B 4 patterns (ex- cluding 2413 / 3142), listed up to the symmetries of the square. The four display ed rows represent all 24 ordered pairs ( p, q ): ev ery other pair is obtained from one of these b y applying rev erse, complemen t, or inv erse to the pair ( p, q ) and to the witness family . The underlined segment is the long mono- tone blo c k in each family . In each plot of E 7 ( p, q ), the blue p oin ts are the exceptional entries and the black p oints form the long monotone blo c k. that 1324 is legal from Av n ( F ), so if Pla y er I c ho oses 1324 we can use the family E n (4231 , 3421) = E n (1324 , 1243) r (whic h lies in Av n ( F ∪ { 1324 } )) to see that the rev erse reply 4231 is legal. This is the first branch of the non- B 4 argumen t used later in Lemma 6.10. T o treat the remaining states in which b oth companion reverse pairs are already forbidden, we now introduce one-entry inflation families. Definition 6.6. Fix β ∈ S 6 , an entry index i ∈ { 1 , . . . , 6 } , and a sign ε ∈ { + , −} . F or t ≥ 1, let I t ( β , i, ε ) b e the permutation obtained b y inflating the i th entry of β in to an increasing blo ck of length t if ε = +, and into a decreasing blo c k of length t if ε = − . Define the stable non-monotone shadow Σ( β , i, ε ) = 4 [ t =1  Sh 4 ( I t ( β , i, ε )) \ { 1234 , 4321 }  . PERMUT A TION A VOIDANCE GAME 17 Example 6.7. T ake β = 123465, i = 5, and ε = − . Then I 1 ( β , 5 , − ) = 123465 has non-monotone shado w Sh 4 ( I 1 ( β , 5 , − )) \ { 1234 , 4321 } = { 1243 } , whereas the stable non-monotone shadow is Σ( β , 5 , − ) = { 1243 , 1432 } . The extra pattern 1432 already app ears at blo ck size 2, since I 2 ( β , 5 , − ) = 1234765 and Sh 4 ( I 2 ( β , 5 , − )) \ { 1234 , 4321 } = { 1243 , 1432 } . So in this family the ordinary non-monotone shadow dep ends on the blo ck size, while Σ( β , 5 , − ) records the even tual v alue. F or later use with the hard pair, Figure 7 sho ws the tw o blo c k-size-4 families I 4 (241356 , 5 , +) and I 4 (314256 , 5 , +). Their stable non-monotone shado ws are Σ(241356 , 5 , +) = { 1324 , 2134 , 2314 , 2413 , 3124 } , Σ(314256 , 5 , +) = { 1324 , 2134 , 2314 , 3124 , 3142 } . Th us the tw o stable shadows differ only in whether they con tain 2413 or 3142. Removing that hard pair and then recording the remaining non- monotone patterns only up to reverse-pairs giv es the same set in b oth cases: { 1324 / 4231 , 2134 / 4312 , 2314 / 4132 , 3124 / 4213 } . This viewp oin t becomes imp ortant later in Definition 6.11 and Prop osi- tion 6.12, because for a reverse-closed forbidden set the relev an t question is whic h non-hard reverse pairs remain outside the distinguished hard pair { 2413 , 3142 } . The next lemma explains why once the inflated blo ck has length at least 4, the non-monotone shadow has stabilized to Σ( β , i, ε ). Lemma 6.8. F or every triple ( β , i, ε ) and every t ≥ 4 , Sh 4 ( I t ( β , i, ε )) \ { 1234 , 4321 } = Σ( β , i, ε ) . Pr o of. Any 4-subsequence of I t ( β , i, ε ) uses exactly j en tries from the inflated blo c k for some 0 ≤ j ≤ 4. Once t ≥ j , the standardized pattern of suc h a subsequence dep ends only on j , on the sign ε , and on the c hoice of the other 4 − j base en tries. Hence ev ery non-monotone 4-pattern that o ccurs for some t ≥ 4 already o ccurs for blo ck size max(1 , j ) ≤ 4, so it lies in Σ( β , i, ε ). The con v erse inclusion is immediate from the definition of Σ( β , i, ε ). □ 18 HENNING ULF ARSSON 241356789 I 4 (241356 , 5 , +) 2413 314256789 I 4 (314256 , 5 , +) 3142 Figure 7. Two blo c k-size-4 one-entry inflation examples. The shaded square marks the inflated blo ck, and the blue p oin ts show the distinguished hard pattern: 2413 on the left and 3142 on the right. Prop osition 6.9. L et F ⊆ S 4 b e r everse-close d and c ontain neither mono- tone p attern, and let p / ∈ B 4 ∪ { 2413 , 3142 } b e a non-monotone p attern. Supp ose that p is le gal fr om Av 7 ( F ) and that b oth c omp anion r everse p airs for p fr om Pr op osition 6.3 lie entir ely in F . Then ther e exists a triple ( β , i, ε ) such that p r ∈ Σ( β , i, ε ) , p / ∈ Σ( β , i, ε ) , and every other non-monotone p attern in Σ( β , i, ε ) b elongs to a r everse p air disjoint fr om F . Pr o of. Since F is reverse-closed, w e ma y iden tify it with the set of non- monotone reverse pairs that it contains. The statement is then a finite computation. The script code- permuta/k4_reverse_reply_permuta.py in the public repository [11] enumerates all pairs ( F , p ) satisfying the hy- p otheses; there are 1156 (297 if we reduce them by symmetries) such pairs. F or eac h of them, it finds a triple ( β , i, ε ), with β ∈ S 6 , whose stable non- monotone shado w has the required prop erties. See Section 9 for details on repro ducibilit y . □ Lemma 6.10. F or k = 4 and n ≥ 9 , whenever F ⊆ S 4 is r everse-close d, c ontains neither monotone p attern, and p / ∈ F is a non-monotone le gal p attern with p / ∈ { 2413 , 3142 } , the r everse p attern p r is le gal fr om Av n ( F ∪ { p } ) . Pr o of. W e split in to tw o cases. Case 1: p ∈ B 4 . By Lemma 6.1, the witness family for p r has Sh 4 = { p r , m } where m is monotone. Since p  = p r and p  = m , this family a v oids p . F urthermore, since p r / ∈ F (b y reverse-closure of F ) and m / ∈ F , the family lies in Av n ( F ∪ { p } ) and witnesses the legality of p r . PERMUT A TION A VOIDANCE GAME 19 Case 2: p / ∈ B 4 , p  = 2413 , 3142 . By Prop osition 6.3, eac h suc h p has tw o companions q 1 , q 2 ∈ B 4 from distinct reverse pairs (listed up to symmetry in T able 2). If at least one companion q i satisfies q i / ∈ F , then the reversed family E n ( p, q i ) r has Sh 4 \{ 1234 , 4321 } = { p r , q r i } and av oids p . Since p r / ∈ F (reverse-closure), q r i / ∈ F (b ecause q i / ∈ F and rev erse-closure), and F con tains no monotone pattern, this family lies in Av n ( F ∪ { p } ) and witnesses the legalit y of p r . Otherwise b oth companion rev erse pairs lie entirely in F . Cho ose π ∈ Av n ( F ) containing p . Restricting to the en tries of one o ccurrence of p to- gether with any three additional entries of π shows that p is legal from Av 7 ( F ). Hence Prop osition 6.9 giv es a triple ( β , i, ε ) such that p r ∈ Σ( β , i, ε ) and p / ∈ Σ( β , i, ε ). Moreov er, every other non-monotone pattern in Σ( β , i, ε ) b elongs to a rev erse pair disjoint from F . T aking blo c k size t = n − 5 ≥ 4, Lemma 6.8 gives a length- n p erm utation I t ( β , i, ε ) whose non-monotone 4- shado w is exactly Σ( β , i, ε ). This p ermutation therefore a voids F ∪ { p } and con tains p r , so p r is legal from Av n ( F ∪ { p } ). □ Finally , we handle the hard pair { 2413 , 3142 } . Definition 6.11. F or p ∈ { 2413 , 3142 } , let E p =    Σ( β , i, ε ) \ { 2413 , 3142 } : β ∈ S 6 , i ∈ { 1 , . . . , 6 } , ε ∈ { + , −} , p ∈ Σ( β , i, ε ) , p r / ∈ Σ( β , i, ε )    , where eac h set is recorded only up to rev erse-pairs. In other w ords, E p is the set of reverse-pair sets obtained b y taking all one-en try inflation families I t ( β , i, ε ) with β ∈ S 6 , k eeping those whose stable shado w con tains p but not p r , and then deleting the hard pair { 2413 , 3142 } . W e call E p the c ol le ction of external r everse-p air supp orts for p . Prop osition 6.12. The two c ol le ctions E 2413 and E 3142 ar e e qual, and e ach has size 138 . Mor e over, if F ⊆ S 4 is r everse-close d, c ontains neither mono- tone p attern, and 2413 is le gal fr om Av 7 ( F ) , then the r everse-p air set c or- r esp onding to F is disjoint fr om some supp ort in E 2413 . By r eversal, the analo gous statement also holds with 2413 and 3142 inter change d. Pr o of. Reversal sends 2413 to 3142, and for ev ery one-en try inflation family I t ( β , i, ε ) its reverse is again a one-entry inflation family: I t ( β , i, +) r = I t ( β r , 7 − i, − ) , I t ( β , i, − ) r = I t ( β r , 7 − i, +) , so the definition of E p is closed under rev ersal. Moreo v er, taking shadows comm utes with reversal, and the external supp orts are recorded only up to rev erse-pairs. Therefore reversal gives a bijection from the families in E 2413 to those in E 3142 , so E 2413 = E 3142 . Since F is reverse-closed, we identify it with the set of non-monotone rev erse pairs that it con tains. The remaining assertions are finite exact 20 HENNING ULF ARSSON computations. The script code- permuta/k4_reverse_reply_permuta.py in the public rep ository [11] enumerates all 6! · 6 · 2 one-entry inflation families, computes their stable shadows Σ( β , i, ε ), and records the distinct external rev erse-pair supports for those con taining 2413 but not 3142. It finds 138 suc h supp orts, and hence also 138 supp orts in E 3142 b y the equalit y ab ov e. The same script then enumerates all reverse-closed monotone-free sets F ⊆ S 4 with 2413 , 3142 / ∈ F for whic h 2413 is legal at n = 7; there are 543 suc h states. F or each of them, at least one member of E 2413 is disjoin t from F . The final symmetry statement follo ws by rev ersing every surviving p erm utation. See Section 9. □ Theorem 6.13. F or every n ≥ 10 , the move-by-move r everse str ate gy is a winning str ate gy for Player II in P AP on S n with k = 4 . This implies, sg( S n , 4) = 0 for n ≥ 10 . Example 6.14. Supp ose F ⊆ S 4 is rev erse-closed, con tains neither mono- tone pattern, and omits the reverse pairs { 1324 / 4231 , 2134 / 4312 , 2314 / 4132 , 3124 / 4213 } and let n = 10. Then I 5 (314256 , 5 , +) = (3 , 1 , 4 , 2 , 5 , 6 , 7 , 8 , 9 , 10) lies in Av 10 ( F ∪ { 2413 } ) and contains 3142. The pro of of Theorem 6.13 sho ws that ev ery legal hard-pair state at n ≥ 10 admits some witness of this form, after first passing to a 7-p oint subp ermutation and then choosing an appropriate stable supp ort from Prop osition 6.12. Pr o of. By Lemma 6.10, only the pair { 2413 , 3142 } remains. Let F ⊆ S 4 b e rev erse-closed, contain neither monotone pattern, and supp ose that 2413 is legal from Av n ( F ), where n ≥ 10. Cho ose π ∈ Av n ( F ) contai ning 2413, and select a 4-point o ccurrence of 2413 in π . T ogether with an y three additional en tries of π , these p oints form a 7-point subp ermutation still a v oiding F and still containing 2413. Thus 2413 is legal from Av 7 ( F ). By Proposition 6.12, the reverse-pair set of F is disjoin t from some supp ort E ∈ E 2413 . Since E 2413 = E 3142 , there is a triple ( β , i, ε ) whose stable shadow con tains 3142, av oids 2413, and has external supp ort E . T aking blo ck size t = n − 5 ≥ 5, Lemma 6.8 giv es a length- n permutation I t ( β , i, ε ) whose non-monotone 4-shado w consists of 3142 together with patterns b elonging to the reverse pairs in E , and hence a voids F ∪ { 2413 } . So 3142 is legal after 2413 is c hosen. The case with 2413 and 3142 interc hanged is symmetric. Corollary 2.13 no w applies. □ 6.1. T o w ard general k . The k = 4 pro of suggests a plausible approach to k = 5. First one reduces, via Corollary 2.13, to reverse-closed monotone- free states. Next the four rev erse pairs inside B k are handled uniformly by PERMUT A TION A VOIDANCE GAME 21 the singleton-shado w witness families. One would then try to treat the re- maining patterns b y bounded witness families whose non-monotone shado ws in v olve only a small amoun t of extra supp ort, and finally one isolates and analyzes the residual hard reverse pairs that survive those first passes. The com binatorics of the last step, how ev er, should b ecome substan tially more complicated as k gro ws. There are k ! − 2 2 non-monotone reverse pairs in total, and after removing the four rev erse pairs coming from B k there remain k ! − 10 2 non- B k rev erse pairs that could p otentially b e hard. F or k = 4 this n umber is 7, and the explicit companion families reduce it all the wa y down to the single pair { 2413 , 3142 } . F or k = 5 the corresp onding n umber is already 55. The presen t computations show that the simplest one-companion construction w orks for 14 of these, but this still lea v es man y unresolv ed cases, so one should not exp ect a single hard pair to remain. This suggests that an extension of the k = 4 pro of to k = 5 should still b e p ossible, but it is lik ely to b e more nuanced and case-based, with many more exceptional configurations to treat. F or general k , how ev er, one should probably not exp ect a direct iteration of the k = 4 argument to b e enough: a complete pro of of Conjecture 2.9 will likely require a new idea b ey ond the presen t witness-family analysis. One potential general approach is trying to use the fact that the hard pair for k = 4 consists of exactly the simple p ermutations of length 4, so p erhaps one can use the theory of simple p ermutations to push to general k . 7. Fur ther bounds on N k W e now return to the threshold N k . Theorem 5.2 ga ve the b ound N k ≤ (3 k − 8) 2 + 1. W e can improv e this upp er b ound using more of the patterns in B k . Prop osition 7.1. L et k ≥ 4 , and let π ∈ Av ( B k ) . If LIS( π ) ≥ 2 k − 4 , then LDS( π ) ≤ k − 2 . By symmetry, if LDS( π ) ≥ 2 k − 4 , then LIS( π ) ≤ k − 2 . Pr o of. Let M = ( m 1 < · · · < m r ) b e a longest increasing subsequence of π , where r ≥ 2 k − 4. F or a p oin t x not in M , define its cell ( i, j ) as in the pro of of Theorem 5.2. W e claim that every such p oin t satisfies i ≥ 1 and j ≥ 1. If i = 0 and j = 0, then x together with M forms an increasing subse- quence of length r + 1, contradicting the maximalit y of M . 22 HENNING ULF ARSSON If i = 0 and 1 ≤ j ≤ k − 2, then r − j ≥ k − 2, so choosing one p oin t of M b elow x and k − 2 p oin ts ab o v e x produce s the cell (0 , 1) and hence a pattern from B k b y Lemma 5.1. If i = 0 and j ≥ k − 1, then choosing k − 1 p oints of M b elo w x pro duces the cell (0 , k − 1) and again a pattern from B k b y Lemma 5.1. Therefore i  = 0. By symmetry , the cases (1 , 0) and ( k − 1 , 0) from Lemma 5.1 sho w that j  = 0 as w ell. So m 1 lies to the left of and b elow every other p oin t of π . Now supp ose that π has a decreasing subsequence of length k − 1. Since m 1 is the least p oin t of π , it cannot b elong to a decreasing subsequence of length greater than 1. Prep ending m 1 to such a subsequence therefore pro duces the pattern q k = 1 k ( k − 1) · · · 2 , whic h b elongs to B k , a con tradiction. □ Corollary 7.2. L et k ≥ 4 . Then Av n ( B k ) = { id n , id r n } for al l n ≥ (2 k − 5) 2 + 1 . Equivalently, N k ≤ (2 k − 5) 2 + 1 . Pr o of. Let π b e a non-monotone p ermutation av oiding B k . By Theorem 5.2, LIS( π ) ≤ 3 k − 8 , LDS( π ) ≤ 3 k − 8 . If | π | > (2 k − 5) 2 , then the Erd˝ os–Szekeres theorem giv es either LIS( π ) ≥ 2 k − 4 or LDS( π ) ≥ 2 k − 4 . In the first case, Prop osition 7.1 giv es LDS( π ) ≤ k − 2 , so | π | ≤ (3 k − 8)( k − 2) . In the second case, the symmetric statement in Prop osition 7.1 gives LIS( π ) ≤ k − 2 , and again | π | ≤ (3 k − 8)( k − 2) . But for k ≥ 4 we hav e (3 k − 8)( k − 2) < (2 k − 5) 2 , since the difference is ( k − 3) 2 . This con tradiction sho ws that no non- monotone p erm utation of length (2 k − 5) 2 + 1 can av oid B k . □ The b ound ab ov e is still far from the largest a v oiders found computation- ally . The next tw o constructions give quadratic low er b ounds. PERMUT A TION A VOIDANCE GAME 23 Definition 7.3. F or k ≥ 4, let E k b e the stair c ase p ermutation obtained by concatenating an increasing blo ck A of length k − 3, then k − 2 increasing blo c ks C 1 , . . . , C k − 2 of length k − 2 arranged so that every entry of C i is larger than ev ery en try of C j whenev er i < j , and finally another increasing blo c k B of length k − 3. Thus | E k | = ( k − 3) + ( k − 2) 2 + ( k − 3) = k 2 − 2 k − 2 . Prop osition 7.4. F or every k ≥ 4 , the stair c ase p ermutation E k avoids B k . Conse quently, N k ≥ k 2 − 2 k − 1 . Pr o of. F or this pro of, write G ( a ; c 1 , . . . , c m ; b ) = id a ⊕ (id c 1 ⊖ · · · ⊖ id c m ) ⊕ id b . Then E k = G ( k − 3; k − 2 , . . . , k − 2 | {z } k − 2 ; k − 3) . Ev ery pattern contained in E k is again of the form G ( a ; c 1 , . . . , c m ; b ), with parameters weakly smaller than those of E k . In particular, any pattern in E k satisfies a ≤ k − 3 , b ≤ k − 3 , m ≤ k − 2 , c i ≤ k − 2 for all i. The eigh t patterns in B k app ear in this family as p k = G ( k − 2; 1 , 1; 0) , q k = G (1; 1 , . . . , 1 | {z } k − 1 ; 0) , r k = G (0; 1 , 1; k − 2) , s k = G (0; k − 1 , 1; 0) , p c k = G (0; 1 , . . . , 1 | {z } k − 2 , 2; 0) , q c k = G (0; 1 , k − 1; 0) , r c k = G (0; 2 , 1 , . . . , 1 | {z } k − 2 ; 0) , s c k = G (0; 1 , . . . , 1 | {z } k − 1 ; 1) . No w p k and r k are imp ossible b ecause they require a = k − 2 or b = k − 2, whereas every pattern in E k has a, b ≤ k − 3. The patterns q k , p c k , r c k , and s c k are imp ossible b ecause they require at least k − 1 sk ew blo c ks, whereas ev ery pattern in E k has at most k − 2 suc h blocks. Finally , s k and q c k are imp ossible b ecause they require a sk ew block of size k − 1, whereas ev ery blo c k o ccurring in a pattern of E k has size at most k − 2. Therefore E k a v oids all eigh t patterns in B k . Since | E k | = k 2 − 2 k − 2, the threshold satisfies N k ≥ k 2 − 2 k − 1. □ Prop osition 7.5. F or k ≥ 4 , let L k = id k − 3 ⊖ · · · ⊖ id k − 3 | {z } k − 2 summands and set H k = L k ⊕ L k . 24 HENNING ULF ARSSON Then H k avoids B k . Conse quently, N k ≥ 2( k − 2)( k − 3) + 1 . Pr o of. F or this pro of, write D ( a 1 , . . . , a m ; b 1 , . . . , b n ) = (id a 1 ⊖ · · · ⊖ id a m ) ⊕ (id b 1 ⊖ · · · ⊖ id b n ) , where either list may b e empty . Then H k = D ( k − 3 , . . . , k − 3 | {z } k − 2 ; k − 3 , . . . , k − 3 | {z } k − 2 ) . Ev ery pattern contained in H k is again of the form D ( a 1 , . . . , a m ; b 1 , . . . , b n ), with w eakly smaller parameters. In particular, any pattern in H k satisfies m ≤ k − 2 , n ≤ k − 2 , a i ≤ k − 3 , b j ≤ k − 3 . The eigh t patterns in B k app ear in this family as p k = D ( k − 2 ; 1 , 1) , q k = D (1 ; 1 , . . . , 1 | {z } k − 1 ) , r k = D (1 , 1 ; k − 2) , s k = D (1 , . . . , 1 | {z } k − 1 ; 1) , p c k = D (1 , . . . , 1 | {z } k − 2 , 2 ; ) , q c k = D (1 , k − 1 ; ) , r c k = D ( ; 2 , 1 , . . . , 1 | {z } k − 2 ) , s c k = D ( ; 1 , . . . , 1 | {z } k − 2 , 2) . No w p k and r k are imp ossible b ecause they require a blo ck of size k − 2, whereas every blo ck in a pattern of H k has size at most k − 3. The patterns q k , s k , p c k , and s c k are imp ossible b ecause they require k − 1 skew blo cks on one side, whereas eac h side of a pattern in H k has at most k − 2 suc h blo cks. Finally , q c k and r c k are imp ossible b ecause they require a blo ck of size k − 1, again larger than any blo ck o ccurring in a pattern of H k . Th us H k a v oids all eight patterns in B k . Since | H k | = 2( k − 2)( k − 3) , the threshold satisfies N k ≥ 2( k − 2)( k − 3) + 1. □ Example 7.6. The first case where the family H k impro v es the staircase lo w er b ound is k = 6. Here L 6 = 10 11 12 7 8 9 4 5 6 1 2 3 , so H 6 = L 6 ⊕ L 6 = 10 11 12 7 8 9 4 5 6 1 2 3 22 23 24 19 20 21 16 17 18 13 14 15 . Th us H 6 is the direct sum of t w o copies of a 4-blo ck lay ered p erm utation, eac h blo c k b eing an increasing sequence of length 3. Figure 8 shows this explicitly . PERMUT A TION A VOIDANCE GAME 25 L − L + Figure 8. The p ermutation H 6 = L 6 ⊕ L 6 . Eac h 3 × 3 b o x is an increasing blo c k; the tw o larger highlighted squares are the copies L − and L + . W e now hav e max { k 2 − 2 k − 1 , 2( k − 2)( k − 3) + 1 } ≤ N k ≤ (2 k − 5) 2 + 1 for all k ≥ 4 , while N 3 = 1. In particular, 7 ≤ N 4 ≤ 10 , 14 ≤ N 5 ≤ 26 , 25 ≤ N 6 ≤ 50 . Prop osition 7.7. We have N 3 = 1 , N 4 = 7 , N 5 = 14 , N 6 = 25 . Pr o of. F or k = 3, w e ha ve B 3 = { 132 , 213 , 231 , 312 } , so ev ery p erm utation of length at least 1 av oiding B 3 is monotone, and N 3 = 1. F or k = 4 , 5 , 6, the low er bounds from Proposition 7.4 and Prop osition 7.5 already giv e N 4 ≥ 7 , N 5 ≥ 14 , N 6 ≥ 25 . The classes Av n ( B k ) were then enumerated until the threshold v alue w as reac hed. F or k = 4 , 5 , 6, this happ ens at n = 7 , 14 , 25, resp ectively . Once this happ ens at some length m ≥ k , it p ersists for all larger lengths. These computations are repro duced in Section 9; except for k = 6 which used the incremen tal fast a voider-generation metho ds of Kuszmaul [6]. □ 8. Concluding remarks The sets B k seem to b e the right finite obstruction sets for single-length P AP. They are minimal b y Theorem 4.3, even tually monotone forcing by Theorem 5.2 and Corollary 7.2, and the thresholds for k = 3 , 4 , 5 , 6, are N 3 = 1, N 4 = 7, N 5 = 14, and N 6 = 25. F or k = 3, the rev erse strategy 26 HENNING ULF ARSSON is completely understoo d (Theorem 2.5); for k = 4, the rev erse strategy is no w settled as well, with exceptions at n = 5 , 6 , 7 , 8 , 9 and a large- n theorem pro v ed via stable one-en try inflation families. The staircase permutations E k from Prop osition 7.4 sho w that N k ≥ k 2 − 2 k − 1 , while Prop osition 7.5 giv es the stronger b ound N k ≥ 2( k − 2)( k − 3) + 1 for k ≥ 6, and already yields N 6 ≥ 25. The next step is to push the same program to k = 5 and b eyond (Con- jecture 2.9). There are also sev eral natural game-theoretic v ariants that are not pur- sued here. Since P AP p ositions are finite impartial games with well-defined Sprague–Grundy v alues, one can consider disjunctive sums of P AP positions, for example sums of starting p ositions S n with different pattern lengths. The normal-pla y conv en tion is also not essential: because every play has length at most k !, a mis ` ere version is just as natural, although the reverse-reply argumen ts used here do not immediately transfer to that setting. Finally , one could study partizan v ersions in which the t w o pla y ers are allo w ed to c ho ose from differen t sets of patterns, or even from differen t allow ed pat- tern lengths. These v arian ts seem lik ely to require ideas b eyond the present pap er, but they fit naturally with the viewp oint developed here. A cknowledgements W e thank Ja y P an tone for running Kuszmaul’s co de to obtain the v alue N 6 = 25. W e also thank Magn ´ us M´ ar Halld´ orsson, Hjalti Magn ´ usson, Josh ua Sac k, and Einar Steingr ´ ımsson for discussions during the early stages of this w ork. W e further thank Magn ´ us M´ ar Halld´ orsson for helpful discus- sions relating to the computational testing of our conjectures. Large language mo dels w ere used in this work, more precisely ChatGPT- 5.4 and Claude Opus 4.6. They were used for finding examples, writing co de, and shortening and tightening pro ofs, which in some cases led to b et- ter argumen ts. On the whole, w e can recommend the use of an AI partner in mathematics research, provided that one maintains tigh t con trol: these sys- tems can disapp ear in to rabbit holes, start expensive computations and then forget ab out them, and pro duce arguments that require careful untangling to eliminate circular reasoning. All errors are still the sole resp onsibility of the h uman author. 9. Comput a tional repr oducibility The computer-assisted statemen ts in the main b o dy are all exact and exhaustiv e. The scripts in code-permuta/ are av ailable in the public rep os- itory https://github.com/ulfarsson/Game_patterns . They are limited to the computations needed for the main paper, with the sole exception that PERMUT A TION A VOIDANCE GAME 27 the v alue N 6 = 25 w as obtained separately and is not part of the routine Python bundle. The runs cited here w ere c hec ked with Python 3.11 and permuta [8]. After installing permuta , the commands b elow can b e run directly from the rep ository ro ot. T o reproduce the starting-position data from Section 2, including T able 1, Prop osition 2.7, and the n um bers in Example 2.8, together with the optimal- pla y length distributions sho wn in Figure 1, run: python code-permuta/pap_starting_data_permuta.py table python code-permuta/pap_starting_data_permuta.py reverse-k4 python code-permuta/pap_starting_data_permuta.py \ optimal-dist n 4 python code-permuta/pap_starting_data_permuta.py \ query 9 4 1234,4321,1324 python code-permuta/pap_starting_data_permuta.py \ query 9 4 1234,4321,1324,4231 The tw o query commands pro duce the coun ts 334 and 2 from Example 2.8 together with the winning replies in that state, printed in permuta ’s native zero-based notation. F or each n ∈ { 5 , 6 , 7 , 8 , 9 , 10 } , the optimal-dist com- mand prin ts the num ber of optimal pla y lines of each p ossible length from the starting p osition S n . T o repro duce the k = 4 computations from Section 6 that are used di- rectly in the pro of, namely the residual n = 7 supp ort classification in Prop osition 6.9 and the hard-pair computation in Prop osition 6.12, run: python code-permuta/k4_reverse_reply_permuta.py all This script prin ts the summary lines gap_cases ok checks=1156 hard_pair ok supports=138 legal_states=543 T o repro duce the threshold data from Prop osition 7.7 up to k = 5, run: python code-permuta/bk_thresholds_permuta.py 3 6 python code-permuta/bk_thresholds_permuta.py 4 10 python code-permuta/bk_thresholds_permuta.py 5 20 These commands prin t the counts | Av n ( B k ) | and the first length at which only the tw o monotone permutations remain, equiv alen tly the threshold v alue N k ; for k = 3 this threshold is 1 b ecause id 1 = id r 1 . The v alue N 6 = 25 w as obtained separately and is not part of the routine permuta bundle. T o repro duce the k = 5 full-space computations cited in the discussion after Theorem 6.13 and in the conclusion, run: python code-permuta/k5_fullspace_data_permuta.py all This prin ts the coun ts one_companion_targets=28 total_nonB5_nonmonotone=110 full_space_separable_pairs=59 total_nonmonotone_pairs=59 and also lists the corresp onding targets and confirms that no reverse pair is inseparable in S 8 . 28 HENNING ULF ARSSON References 1. M. H. Albert, R. E. L. Aldred, M. D. Atkinson, C. C. Handley , D. A. Holton, D. J. McCaughan, and B. E. Sagan, Monotonic se quenc e games , Games of No Chance 3, Cam bridge Universit y Press, 2009, pp. 309–328. 2. Petter Br¨ and ´ en and Anders Claesson, Mesh patterns and the exp ansion of permutation statistics as sums of p ermutation p atterns , Electronic Journal of Combinatorics 18 (2011), no. 2, P5. 3. P . Erd˝ os and G. Szek eres, A c ombinatorial pr oblem in ge ometry , Comp ositio Mathe- matica 2 (1935), 463–470. 4. P . M. Grundy , Mathematics and games , Eurek a 2 (1939), 6–8. 5. F rank Harary , Bruce Sagan, and David W est, Computer-aide d analysis of monotonic se quenc e games , Atti Accad. Peloritana Pericolan ti Cl. Sci. Fis. Mat. Natur. 61 (1983), 67–78. 6. William Kuszmaul, F ast algorithms for finding p attern avoiders and c ounting p attern o c curr enc es in permutations , Mathematics of Computation 87 (2018), no. 310, 987– 1011. 7. K. P arton, PermuNim: an imp artial game of p ermutation avoidanc e , M.Sc. thesis, Univ ersity of Victoria, 2010. 8. Perm utaT riangle dev elop ers, Permuta , https://github.com/PermutaTriangle/ Permuta , 2026, GitHub rep ository , accessed 2026-03-15. 9. Lara Pudwell, On an Er d˝ os–Szeker es game , 2025, Preprin t. 10. R. P . Sprague, ¨ Ub er mathematische kampfspiele , T ohoku Mathematical Journal, First Series 41 (1935), 438–444. 11. Henning Ulfarsson, Game p atterns , https://github.com/ulfarsson/Game_patterns , 2026, GitHub rep ository , accessed 2026-03-15. 12. Vincent V atter, Permutation classes , Handbo ok of Enumerativ e Com binatorics (Mikl´ os B´ ona, ed.), CRC Press, 2015, pp. 753–833.

Original Paper

Loading high-quality paper...

Comments & Academic Discussion

Loading comments...

Leave a Comment