Tightish Bounds on Davenport-Schinzel Sequences

Report 0 Downloads 56 Views
Tightish Bounds on Davenport-Schinzel Sequences∗ Seth Pettie University of Michigan

arXiv:1204.1086v1 [cs.DM] 4 Apr 2012

December 15, 2013

Abstract Let Ψs (n) be the extremal function of order-s Davenport-Schinzel sequences over an n-letter alphabet. Together with existing bounds due to Hart and Sharir (s = 3), Agarwal, Sharir, and Shor (s = 4, lower bounds on s ≥ 6), and Nivasch (upper bounds on even s), we give the following essentially tight bounds on Ψs (n) for all s:  n s=1       2n − 1 s=2       s=3  Θ(nα(n)) Ψs (n) = Θ(n2α(n) ) s=4      α(n) 2 α(n)  Ω(nα(n)2 ) and O(nα (n)2 ) s=5      t  (1±o(1))α (n)/t!  n·2 s ≥ 6, t = b s−2 c 2 These bounds refute conjectures due to Alon et al. [4], Nivasch [12], and Pettie [14].

1

Introduction

A Davenport-Schinzel sequence of order-s [6] is a sequence over a finite alphabet whose subsequences are not isomorphic to alternating sequences of the form abab · · · with length s + 2. They have numerous applications in combinatorial and computationally geometry, for example, bounding the complexity of the lower envelope of an arrangement of degree-s polynomials or degree-(s − 2) polynomial segments. See [6, 2, 10]. To ground the discussion of prior work we must define isomorphic, subsequence, and related concepts more precisely. Let |σ| be the length of a sequence σ = (σi )1≤i≤|σ| and let kσk be the cardinality of its def

alphabet Σ(σ) = {σi }. Two equal length sequences σ, σ 0 are isomorphic, written σ ∼ σ 0 , if there is a ¯ σ 0 , if there bijection f : Σ(σ) → Σ(σ 0 ) for which f (σi ) = σi0 . We say σ is a subsequence of σ 0 , written σ ≺ is a strictly increasing function f : {1, . . . , |σ|} → {1, . . . , |σ 0 |} for which σi = σf0 (i) . The notation σ ≺ σ 0 is ¯ σ 0 , that is, σ is isomorphic to a subsequence of σ 0 . The assertion that σ appears short for ∃σ 00 : σ ∼ σ 00 ≺ ¯ σ 0 , which one being perfectly clear from in or occurs in or is contained in σ 0 means either σ ≺ σ 0 or σ ≺ context. A sequence σ is k-sparse if whenever σi = σj and i 6= j, then |i − j| ≥ k. A block is a sequence of distinct symbols. If σ is understood to be partitioned into a sequence of blocks, JσK is the number of blocks. The predicate JσK = m asserts that there is some way to partition σ into at most m blocks. The extremal functions for generalized Davenport-Schinzel sequences are defined as Ex(σ, n, m) = max{|S| : σ ⊀ S, kSk = n, and JSK ≤ m}

Ex(σ, n) = max{|S| : σ ⊀ S, kSk = n, and S is kσk-sparse}

∗ This work is supported by NSF CAREER grant no. CCF-0746673 and a grant from the US-Israel Binational Science Foundation.

1

where the conditions “JSK ≤ m” and “S is kσk-sparse” guarantee that the extremal functions are finite. The extremal functions for (standard) Davenport-Schinzel sequences defined as length s + 2

z }| { Ψs (n, m) = Ex( ababa · · · , n, m) length s + 2

z }| { Ψs (n) = Ex( ababa · · · , n)

Note that the sparseness condition in the definition of Ψs (n) only forbids immediate repetitions since kabab · · · k = 2. Bounds on generalized Davenport-Schinzel sequences are expressed as a function of “the” inverse-Ackermann function, though there is no universally agreed-upon definition. Essentially all definitions in the literature are equivalent up to an additive O(1), which usually obviates the need for more precision. One such definition is: k−1

z }| { α(n, m) = min{k ≥ 1 : log∗ ∗ ∗ · · · ∗ (n) ≤ 3 + n/m} α(n) = α(n, n)

We state previous results in terms of the single argument version of α. However, they all generalize to the two-argument version by replacing Ψs (n) with Ψs (n, m) and α(n) with α(n, m). A Brief History After introducing the problem, Davenport and Schinzel [6] proved that Ψ1 (n) = n, Ψ2 (n) = √ 2n−1, Ψ3 (n) = O(n log n), and for all s ≥ 4, that Ψs (n) = n·2O( log n) , where the leading constant in the exponent depends on s. Shortly thereafter Davenport [5] improved the bound on Ψ3 (n) to O(n log n/ log log n). Szemer´edi [18] dramatically improved the upper bounds for all s ≥ 3, showing that Ψs (n) = O(n log∗ n), where the leading constant depends on s. Hart and Sharir [8] found asymptotically tight bounds on order-3 sequences, namely Ψ3 (n) = Θ(nα(n)). Improving on results of Sharir [16, 17], Agarwal, Sharir, and Shor [3] gave asymptotically tight bounds on order-4 sequences and reasonably tight bounds on all higher order sequences: Ψ4 (n) = Θ(n · 2α(n) )  t  > n · 2(1−o(1))α (n) / t!   t    < n · 2(1+o(1))α (n) Ψs (n)  t   > n · 2(1−o(1))α (n) / t!   t  < n · α(n)(1+o(1))α (n)

for even s ≥ 6, t = b s−2 2 c

for odd s ≥ 5, t = b s−2 2 c

The bounds on even-order sequences were tight except for the leading constant in the exponent, lying somewhere in the range [1/t!, 1]. However, the upper and lower bounds on odd-order sequences differed more significantly: note that the base of the exponent in the lower and upper bounds are 2 and α(n), respectively. Nivasch [12] presented a simplified construction of even-order sequences and sharpened the leading constant in the exponent for both even and odd s ≥ 5:

Ψs (n)

 t = n · 2(1±o(1))α (n) / t!   

for even s ≥ 6, t = b s−2 2 c

t

> n · 2(1−o(1))α (n) / t!    t < n · α(n)(1+o(1))α (n) / t! 2

for odd s ≥ 5, t = b s−2 2 c

(1)

This essentially closed the problem1 for even s but left the odd case open. Alon et al. [4] and Nivasch [12] conjectured that the upper bounds (1) are tight, citing as circumstantial evidence some recent results on an apparently unrelated problem, namely stabbing interval chains with tuples [4], where functions of this type arose naturally.2 Pettie [14] exhibited a construction of generalized Davenport-Schinzel sequences avoiding subsequences of the form τs = 1213 · · · (s − 1)1s1s2s · · · (s − 2)s(s − 1)s whose lengths matched the upper t t bounds of (1). Specifically Ex(τs , n) > n·2(1−o(1))α (n)/t! for s even and n·α(n)(1−o(1))α (n)/t! for s odd, where s−2 t = b 2 c. This construction offered more circumstantial support for the Alon et al./Nivasch conjecture. New Results. We refute the Alon et al./Nivasch conjecture and prove that the extremal function for odd order Davenport-Schinzel sequences are essentially no different than the even orders. Specifically, order-s t Davenport-Schinzel sequences have extremal functions of the form 2(1±o(1))α (n)/t! for all s ≥ 4 and t = b s−2 2 c. Furthermore, we prove that Ψ5 (n) is asymptotically faster than Ψ4 (n) (refuting a conjecture of Pettie [14]), its extremal function being between Ω(nα(n)2α(n) ) and O(nα2 (n)2α(n) ). Theorem 1.1 summarizes the state of affairs. Theorem 1.1 Let Ψs (n) be the maximum length of a repetition-free sequence over an n-letter alphabet avoiding subsequences isomorphic to abab · · · (length s + 2). Then Ψs satisfies:  n s=1       2n − 1 s=2      s=3  Θ(nα(n)) Ψs (n) = α(n) Θ(n2 ) s=4       Ω(nα(n)2α(n) ) and O(nα2 (n)2α(n) ) s=5     t  (1±o(1))α (n)/t!  n2 s ≥ 6, t = b s−2 c 2

To a certain approximation Theorem 1.1 closes the problem. For s = 5 there is an α(n) gap that can certainly be closed, but for higher orders (both even and odd) the ±o(1) in the exponent hides a rather large ±O(αt−1 (n)/(t − 1)!). To reduce this additive uncertainty to ±O(1) one would need to overcome not just technical obstacles but the social norms governing research on lower order terms and inverse-Ackermanns in general.

2

Upper Bounds

2.1

Notation and Definitions

A sequence S with kSk = n and JSK = m is an (n, m)-sequence. If S is partitioned into intervals of S ˇ q def consecutive blocks S 1 S 2 · · · S b , then Σ = Σ(S q )\ p6=q Σ(S p ) denotes the alphabet local to interval S q and S ˇq P ˆ def ˇ q and Σ ˆ are n Σ = Σ(S)\ The cardinalities of Σ ˇ q and n ˆ , thus n = n ˆ+ q n ˇq P q Σq all other (global) symbols. and m = q JS K. A global symbol in S q is called first, last, or middle if it appears in no earlier interval, ´ q, Σ ` q, Σ ¯ q, Σ ˆ q be the subset no later interval, or appears in both earlier and later intervals, respectively. Let Σ q of Σ(S ) consisting of, respectively, first, last, middle, and all global symbols, and let n ´q , n `q , n ¯ q , and n ˆ q be q ˆq ´q `q ¯q q q ˆq ´q `q q ˇ ˇ ¯ their cardinalities. Let S , S , S , S , S be the projection of S onto Σ , Σ , Σ , Σ , and Σ . 1 (to

this author’s satisfaction at least) t t t+1 t+1 is, functions of the form . . . , 2Θ(α (n)) , α(n)Θ(α (n) , 2Θ(α (n)) , α(n)Θ(α (n) , . . .

2 That

3

We use the following variant of Ackermann’s function: a1,j = 2j

j≥1

ai,1 = 2

i≥2

ai,j = ai,j−1 · ai−1,ai,j−1

i, j ≥ 2

There are a few facts about ai,j worth noting. For any w = ai,j−1 and c ≥ 1 we have wc aci−1,w = aci,j . For c ≥ 1, ac1,j = (2j )c = a1,cj . In the table of a-values the 1st column is constant and the second merely exponential (ai,2 = 2i+1 ) so one has to look at least to the third column to find Ackermann-type growth.

2.2

Basic Upper Bounds

Lemma 2.1 follows from the bounds Ψ1 (n) = n, Ψ2 (n) = 2n − 1 and the fact that repetitions (violating 2-sparseness) can only occur at the m − 1 block boundaries. Lemma 2.1 Ψ1 (n, m) = n + m − 1 and, for m ≥ 2, Ψ2 (n, m) = 2n + m − 2. Variants of Lemma 2.2 and Theorem 2.3 were used by Agarwal et al. [3] and Nivasch [12]. Lemma 2.2 For s ≥ 2 and m ∈ (ac1,j−1 , ac1,j ], Ψs (n, m) ≤ 2s−1 n + (cj)s−2 (m − 1). Proof: Fix c = 1. The claim is trivially true for j = 1 or s = 2. Let S = S 1 S 2 be any order-s (n, m ≤ a1,j ) sequence, where JS 1 K = a1,j−1 and JS 2 K = m − a1,j−1 . Note that for q ∈ {1, 2}, the projection of S q onto ˇ q is an order-s sequence and its projection onto Σ ˆ is an order-(s − 1) sequence, from which it follows that Σ  X  Ψs (n, m) ≤ Ψs (ˇ nq , JSq K) + Ψs−1 (ˆ n, JSq K) q=1,2

≤ 2s−1 (n − n ˆ ) + (j − 1)s−2 (m − 2) + 2(2s−2 n ˆ ) + j s−3 (m − 2)

{Ind. hyp.}

< 2s−1 n + j s−2 (m − 1) which concludes the induction for c = 1. For c > 1 and m ∈ (ac1,j−1 , ac1,j ], the identity ac1,j = a1,cj implies Ψs (n, m) ≤ 2s−1 n + (cj)s−2 (m − 1). 2 Versions of Theorem 2.3 in [3, 12] make no reference to Ackermann’s function but rather allow for an P arbitrary block partition {mq } such that q mq = m. However, the recurrences derived in Sections 2.3 and 2.4 do explicitly refer to Ackermann’s function. We use the same style in Theorem 2.3 for consistency. Theorem (aci,j−1 , aci,j ] and w = ai,j−1 , where i, j > 1, c ≥ s − 2, and s ≥ 3. For any P 2.3 Let m ∈ P n=n ˆ+ qn ˇ q and m = q mq , where mq = wc if q < dm/wc e, dm/wc e

Ψs (n, m) ≤

X

Ψs (ˇ nq , mq ) + 2 · Ψs−1 (ˆ n, m) + Ψs−2 (Ψs (ˆ n, dm/wc e) − 2ˆ n, m)

(2)

q=1 c Proof: Let S = S 1 · · · S dm/w e be the order-s (n, m)-sequence. Each Sˇq is clearly an order-s sequence and the Pdm/wc e c c contribution of local symbols therefore q=1 Ψs (ˇ nq , mq ). Let S´ = S´1 · · · S´dm/w e and S` = S`1 · · · S`dm/w e ´ + |S| ` ≤ 2 · Ψs−1 (ˆ be the restriction of S to first and last occurrences, respectively. It follows that |S| n, m) as both are order-(s − 1) sequences. c ˆ1 · · · Σ ˆ dm/wc e be obtained Let Sˆ = Sˆ1 · · · Sˆdm/w e be the restriction of S to global symbols and Sˆ0 = Σ ˆ q , listed in order of first appearance from Sˆ by replacing each Sˆq with a single block containing its alphabet Σ q 0 c 00 0 ˆ ˆ ˆ ˆ in S . Thus, |S | ≤ Ψs (ˆ n, dm/w e). Let S be obtained from S by removing the first and last occurrence of

4

Figure 1: The derivation tree T|a . Shaded nodes are feathers. Solid nodes are wing nodes. each symbol, then regarding it as a single block containing |Sˆ00 | = |Sˆ0 | − 2ˆ n distinct symbols. Observe that c S¯ = S¯1 · · · S¯dm/w e (the restriction of S to middle occurrences) can be construed as an order-(s−2) (|Sˆ00 |, m)ˆ in different blocks are treated as distinct symbols in Sˆ00 . sequence, where the occurrences of a symbol a ∈ Σ c ¯ Thus |S| ≤ Ψs−2 (Ψs (ˆ n, dm/w e) − 2ˆ n, m). As S is partitioned into local, first, last, and middle occurrences, Eq. (2) follows. 2

2.3

The Derivation Tree

The derivation tree T = T (S, c, i) of a sequence S is an ordered, rooted binary tree whose nodes are identified with the blocks encountered in recursively decomposing S, as in the proofs of Lemma 2.2 and Theorem 2.3. In this section we adopt the notation from Section 2.1 and the proof of Theorem 2.3. Let j be minimum such that JSK ≤ aci,j . Let B(v) denote the block associated with node v ∈ T . The pth block of S is always identified with the pth leaf of T in left-to-right order. When i = 1, T is a fragment of a full binary tree with height log(ac1,j ) = cj. For a symbol a ∈ Σ(S) let v ∈ T be the least common ancestor of all occurrences of a. The children of v are called the twin roots of a, denoted and rootL (a) and rootR (a). We include a in both B(rootL (a)) and B(rootR (a)) but no other internal nodes. The case i > 1, j = 1 is handled exactly the same way, where the derivation tree T has height log(aci,1 ) = c. c When i, j > 1, T is the composition of Tˆ = T (Sˆ0 , c, i − 1) and Tˇ 1 , . . . , Tˇ dm/w e , where Tˇ q = T (Sˇq , c, i). To be more specific, we identify the root of Tˇ q (whose block is empty) with the qth leaf of Tˆ , then assign c the blocks of S to the leaves of T . (Note that the blocks of leaves in Tˇ 1 , . . . , Tˇ dm/w e do not coincide with blocks of S since they contain only local symbols.) Definition 2.4 (Wings, feathers, and wingtips) The derivation tree for a, denoted T|a , is the forest of T -nodes {v ∈ T | a ∈ B(v)} that inherits the ancestor/descendant relation from T . Note that T|a consists of exactly 2 trees rooted at rootL (a) and rootR (a). The descendants of rootL (a) in T|a are called left nodes and their corresponding occurrences in S left occurrences; right nodes and right occurrences are defined analogously. The first and last leaves in T|a are called its left and right wingtips. Its left wing is the path extending from rootL (a) to its left wingtip; its right wing is defined analogously. A non-wingtip leaf v ∈ T|a is a left feather if it is the rightmost descendant of some u in T|a (possibly u = v), which is a child of a left wing node in T|a ; right feathers are defined symmetrically. See Figure 1. The term feather also refers to the occurrence of a ∈ B(v) in S if v is a feather of T|a . If u, v ∈ T|a and v is a descendant of u we may also refer to the occurrence of a ∈ B(v) as a descendant of the occurrence of a ∈ B(u). Definition 2.5 (Nesting) Let β be a block in S containing two symbols a, b, neither of which makes its first or last appearance in β. Call a and b nested in β if S contains either a · · · b · · · β · · · b · · · a or b · · · a · · · β · · · a · · · b and interleaved otherwise.

5

The role of nested symbols will become perfectly clear in Section 2.4. Lemma 2.6 reveals the connection between feathers and nested symbols. Lemma 2.6 Suppose that v ∈ T is a leaf and a, b are symbols in B(v). If the following criteria are satisfied then a and b are nested in B(v). i. v is not a wingtip in either T|a or T|b . ii. v is not a feather in either T|a or T|b . iii. v is either a left node or right node in both T|a and T|b . Proof: Without loss of generality we can assume that iv. The level of rootL (b) and rootR (b) is equal or ancestral to the level of rootL (a) and rootR (a). Let x be the nearest wing node ancestor of v in T|a . Let v 0 and v 00 be the leftmost and rightmost leaf descendants of x in T|a . It follows from (i,ii) that v, v 0 , and v 00 are distinct leaves. Consider a partition of S into four intervals, namely I1 : everything preceding the a ∈ B(v 0 ), I2 : everything from the end of I1 to B(v), I3 : everything from B(v) to the a ∈ B(v 00 ), and I4 : everything following I3 . By (i) there must be occurrences of b before and after B(v). However, if a and b are not nested then they must appear exclusively in intervals I1 and I3 or exclusively in I2 and I4 . Without loss of generality we can assume the latter. v. All occurrences of b appear in blocks between v 0 and v inclusive, or between v 00 and the rightmost leaf of T inclusive. Let u be the left wingtip in T|b (it may be that u = v 0 ) and let z be the least common ancestor of u and v in T|b . It follows from (iv) that z exists, that is, u cannot be a descendant of rootL (b) while v is a descendant of rootR (b). Since u is the left wingtip z must be a left wing node in T|b , which, by (iii), implies that v is a left node in T|a . Note that the least common ancestor of u and v in T is a descendant of x but z may be either an ancestor or descendant of x. We treat each case separately. If z is equal to or a strict descendant of x then it must lie on the path from x to v 00 in T . If this were not true then it follows from (v) that v would be a feather in T|b , contradicting (ii). Let u0 6= v be the rightmost leaf descendant of z in T|b and let v 000 be the right wingtip of T|a . Since z is a descendant of x and rootR (a) is unrelated to x, it follows from (v) that a and b are nested in B(v), affirming the claim. We now consider the remaining case, where z is a strict ancestor of x in T . Let y be the child of z ancestral to v and u0 be the rightmost leaf descendant of y in T|b . As y is unrelated to u it must be a strict descendant of x. By virtue of (v) and the fact that y is a child of a left wing node, it follows that y lies on the path from x to v 00 in T , for otherwise u0 = v, contradicting (ii). As argued above, u0 is to the left of v 000 , which, together with (v), implies that a and b are nested in B(v). 2 Lemma 2.7 Let S be an order-s (n, m)-sequence and T = T (S, c, i) be its derivation tree, where c ≥ s − 2 and m ≤ aci,j . Let Φs,c,i (n, m) be the maximum number of feathers in such a T . It follows that Φs,c,i (n, m) ≤ Ψs (n, m) ≤ 2s−1 n + (cj)s−2 (m − 1)

when i = 1 or j = 1

dm/wc e

Φs,c,i (n, m) ≤

X

Φs,c,i (ˇ nq , mq ) + Φs,c,i−1 (ˆ n, dm/wc e) + 2 · Ψs−1 (ˆ n, m)

when i, j > 1

q=1

where m =

P

q

mq and mq = wc if q < dm/wc e.

Proof: We adopt the notation from Section 2.1 and Theorem 2.3. In the worst case every occurrence in S is a feather, so Φs,c,i (n, m) ≤ Ψs (n, m) holds trivially. We apply this bound P only when i = 1 or j = 1. When i, j > 1 the number of feathers of local symbols is clearly at most q Φs,c,i (ˇ nq , mq ). A global left ˆ feather (right feather) in S is either the rightmost child (leftmost child) of a left feather (right feather) in Sˆ0 ` that is, a child in T|a of a wingtip in Tˆ|a . There are at most Φs,c,i−1 (ˆ or an occurrence a in S´ or S, n, dm/wc e) ´ ` feathers of the first type and, since S and S are order-(s − 1) sequences, at most 2 · Ψs−1 (ˆ n, m) of the second type. 2 6

z/y

Figure 2:

2.4

A Recurrence for Odd Orders

Theorem 2.8 defines an improved recurrence tailored to odd-order Davenport-Schinzel sequences. The function Φs,c,i is defined in Lemma 2.7. c c Theorem P 2.8 Let m ∈ (a Pi,j−1 , ai,j ] and w = aci,j−1 , where i,cj > 1, c ≥ s − 2, and s ≥ 5 is odd. For any n=n ˆ+ qn ˇ q and m = q mq , where mq = w if q < dm/w e. m dw ce

Ψs (n, m) ≤

X

Ψs (ˇ nq , mq ) + 2 · Ψs−1 (ˆ n, m) + Ψs−2 (Φs,c,i−1 (ˆ n, d wmc e), m) + Ψs−3 (Ψs (ˆ n, d wmc e), 2m − 1)

q=1

Proof: We begin by constructing the derivation tree T = T (S, c, i) for S. In Theorem 2.3 we partitioned S into local and global symbols and partitioned the occurrences of global symbols into first, middle, and last. We now partition the middle occurrences one step further. Define S˜0 ≺ Sˆ0 to be the subsequence consisting of feathers (w.r.t. Tˆ = T (Sˆ0 , c, i − 1)) and define S˙ 0 (and S¨0 ) to be the subsequences consisting of left (and right), non-feather, non-wingtip occurrences. That is, |Sˆ0 | = |S˜0 | + |S˙ 0 | + |S¨0 | + 2ˆ n. In an analogous fashion ˜ S, ˙ and S¨ to be the subsequences of Sˆ consisting of children of occurrences in S˜0 , S˙ 0 , and S¨0 in their define S, P ´ + |S| ` + |S| ˜ + |S| ˙ + |S|. ¨ respective derivation trees {T|a }a∈Σˆ . Thus, |S| = q |Sˇq | + |S| According to the standard argument {Sˇq } are order-s sequences, S´ and S` are order-(s − 1) sequences, and S˜ is obtained by substituting for each block β in S˜0 an order-(s − 2) sequence over the alphabet of β, ˜ ≤ Ψs−2 (Φs,c,i−1 (ˆ hence |S| n, dm/wc e), m). ˙ ¨ We claim that S (or S) is obtained by substituting an order-(s − 3) sequence for each block in S˙ 0 (or 0 ¨ ˆ and that the S ). Suppose for the purpose of contradiction that the qth block β in S˙ 0 contains a, b ∈ Σ, s−1 q subsequence of S˙ intersecting S contains an alternating subsequence (ab) 2 . Note that s − 1 is even. By definition β is a left, non-feather, non-wingtip in both T|a and T|b . According to Lemma 2.6, a and b must be nested in β, which implies that S contains a subsequence of the form s−1 z }| { · · · a · · · b · · · · · · a · · · b · · · · · · a · · · b · · · · · · b · · · a · · ·

7

or s−1 z }| { · · · b · · · a · · · · · · a · · · b · · · · · · a · · · b · · · · · · a · · · b · · · where the portion between bars is in S q . In either case S contains (ab)(s+1)/2 a or (ba)(s+1)/2 b, contradicting the fact that S is an order-s sequence. It follows that ˙ + |S| ¨ ≤ Ψs−3 (|S˙ 0 |, m) + Ψs−3 (|S¨0 |, m) |S| ≤ Ψs−3 (|S˙ 0 | + |S¨0 |, 2m − 1) ≤ Ψs−3 (Ψs (ˆ n, dm/wc e), 2m − 1) The second line follows from that fact that concatenating any two order-(s − 3) m-block sequences over disjoint alphabets yields a (2m − 1)-block sequence over the union of their alphabets. The last line follows from the inequality |S˙ 0 | + |S¨0 | ≤ |Sˆ0 | and the fact that Sˆ0 is an order-s (ˆ n, dm/wc e)-sequence. 2

2.5

Analysis of the Recurrences

Call an ensemble {µs,i , κs,i , νs,i , λs,i } agreeable if for s ≥ 2, c ≥ max{s − 2, 1}, and m ≤ aci,j , Ψs (n, m) ≤ µs,i n + κs,i (cj)max{s−2,1} (m − 1)

(3)

and for odd s ≥ 5 Φs,c,i (n, m) ≤ νs,i n + λs,i (cj)s−2 (m − 1) Lemma 2.9 The following ensemble is agreeable, where s ≥ 1 and t = b s−2 2 c. µ1,i , κ1,i , κ2,i , κs,1 = 1

all i, all s

µ2,i = 2

all i

µ3,i = 2(i + 1)

all i

κ3,i = 3(i − 1) + 1  i+t+3  2( t ) − 3(2(i + t + 1))t µs,i , κs,i = i+t+3  3 t+1 ( t ) 2 2 (2(i + t + 1))

all i even s ≥ 4 odd s ≥ 5

i+t+3 νs,i , λs,i = 4 · 2( t )

odd s ≥ 5

Proof: The proof is by induction over triples (s, i, j). Base cases.

The cases when s ∈ {1, 2} or i = 1 or j = 1 follow from Lemmas 2.1, 2.2, and 2.7.3 

3 For



t+4 t

s = 3 we have µ3,1 = 4 = 2(i+ 1). For even s ≥ 4 we have µs,1 = 2  

odd we have µs,1 = 23 (2(t + 2))t+1 2 valid for κs,1 = µs,1 and λs,1 = νs,1 .

t+4 t

≥ 22t+2 = 2s−1 and νs,1 = 4 · 2

8

− 3(2(t + 2))t ≥ 22t+1 = 2s−1 . For odd s ≥ 5 

t+4 t

≥ 22t+2 = 2s−1 . These inequalities are also

For s = 3 and i, j > 1 dm/wc e

Ψ3 (n, m) ≤

X

Ψ3 (ˇ nq , mq ) + 2 · Ψ2 (ˆ n, m) + Ψ1 (Ψ3 (ˆ n, dm/wc e) − 2ˆ n, m)

q=1

≤ µ3,i (n − n ˆ ) + κ3,i c(j − 1)(m − dm/wc e) + 4ˆ n + 2(m − 1) + (µ3,i−1 − 2)ˆ n + κ3,i−1 cw(dm/wc e − 1) + (m − 1) h i h i ≤ µ3,i n + κ3,i cj(m − 1) + − µ3,i + µ3,i−1 + 2 n ˆ + − cκ3,i + κ3,i−1 + 3 (m − 1) ≤ µ3,i n + κ3,i cj(m − 1)

One can verify that the last inequality holds since µ3,i = µ3,i−1 + 2, κ3,i = κ3,i−1 + 3, and c ≥ s − 2 = 1. For even s ≥ 4 we apply Theorem 2.3. dm/wc e

Ψs (n, m) ≤

X

Ψs (ˇ nq , mq ) + 2 · Ψs−1 (ˆ n, m) + Ψs−2 (Ψs (ˆ n, dm/wc e), m)

q=1

≤ (n − n ˆ )µs,i + κs,i (c(j − 1))s−2 (m − dm/wc e) + 2µs−1,i n ˆ + 2κs−1,i (cj)s−3 (m − 1) + µs−2,i µs,i−1 n ˆ + µs−2,i κs,i−1 (cw)s−2 (dm/wc e − 1) + κs−2,i (cj)s−4 (m − 1) ≤ µs,i n + κs,i (cj)s−2 (m − 1) h i + − µs,i + 2µs−1,i + µs−2,i µs,i−1 n ˆ h i + − κs,i cs−2 j s−3 + 2κs−1,i (cj)s−3 + µs−2,i κs,i−1 cs−2 + κs−2,i (cj)s−4 (m − 1)

(4)

≤ µs,i n + κs,i (cj)s−2 (m − 1)

(6)

(5)

By Eq. (4,5), Eq. (6) will be satisfied whenever µs,i ≥ 2µs−1,i + µs−2,i µs,i−1 µs−2,i κs,i−1 κs−2,i 2κs−1,i + + κs,i ≥ s−3 s−2 2 2(s − 2)2

(7) (8)

Eq. (8) was obtained by dividing Eq. (5) through by cs−2 j s−3 and noting that c ≥ s − 2 and j ≥ 2. We first show that the ensemble is agreeable at s = 4 then consider even s ≥ 6 later. Note that when s = 4, t = 1 the expressions for µ4,i , κ4,i are 2i+4 − 6(i + 2). Thus,  2µ3,i + µ2,i µ4,i−1 = 2(2(i + 1)) + 2 · 2i+3 − 6(i + 1) by defn. = 2i+4 + 4(i + 1) − 12(i + 1) ≤ 2i+4 − 6(i + 2) = µ4,i

9

s = 4, t = 1

The agreeableness of κ4,i is shown in the same way. When s ≥ 5 is odd we apply Theorem 2.8. m d wc e

Ψs (n, m) ≤

X

Ψs (ˇ nq , mq ) + 2 · Ψs−1 (ˆ n, m) + Ψs−2 (Φs,c,i−1 (ˆ n, d wmc e), m) + Ψs−3 (Ψs (ˆ n, d wmc e), 2m − 1)

q=1

≤ µs,i (n − n ˆ ) + κs,i (c(j − 1))s−2 (m − dm/wc e) + 2µs−1,i n ˆ + 2κs−1,i (cj)s−3 (m − 1) + µs−2,i νs,i−1 n ˆ + µs−2,i λs,i−1 (cw)s−2 (dm/wc e − 1) + κs−2,i (cj)s−4 (m − 1) + µs−3,i µs,i−1 n ˆ + µs−3,i κs,i−1 (cw)s−2 (dm/wc e − 1) + 2κs−3,i (cj)s−5 (m − 1) ≤ µs,i n + κs,i (cj)s−2 (m − 1) h i + − µs,i + 2µs−1,i + µs−2,i νs,i−1 + µs−3,i µs,i−1 n ˆ h + − κs,i cs−2 j s−3 + 2κs−1,i (cj)s−3 + µs−2,i λs,i−1 cs−2 i + κs−2,i (cj)s−4 + µs−3,i κs,i−1 cs−2 + 2κs−3,i (cj)s−5 (m − 1) s−2

≤ µs,i n + κs,i (cj)

(m − 1)

(9)

(10) (11)

Eq. (9,10) imply that Eq. (11) will be satisfied whenever µs,i ≥ 2µs−1,i + µs−2,i νs,i−1 + µs−3,i µs,i−1 2κs−1,i µs−2,i λs,i−1 κs−2,i µs−3,i κs,i−1 κs−3,i κs,i ≥ + + + + s−3 2 s−3 s−2 2 2(s − 2) 2 2(s − 2)3

(12) (13)

The denominators of Eq. (13) follow by dividing Eq. (10) through by cs−2 j s−3 and noting that c ≥ s − 2 and j ≥ 2. Using similar calculations, one derives from Lemma 2.7 the following lower bounds on νs,i and λs,i .

The agreeableness of νs,i and λs,i

νs,i ≥ νs,i−1 + 2µs−1,i λs,i−1 2κs−1,i λs,i ≥ s−3 + 2 s−2 follow immediately since

(14) (15)

i+t+3 i+t+3 i+t+2 λs,i−1 2κs−1,i + ≤ νs,i−1 + 2µs−1,i ≤ 4 · 2( t ) + 2 · 2( t ) ≤ 4 · 2( t ) = νs,i = λs,i s−3 2 s−2

In the remainder of the proof we consider the case of s = 5, even s ≥ 6, and odd s ≥ 7.4 When s = 5 we have  2µ4,i + µ3,i ν5,i−1 + µ2,i µ5,i−1 = 2 2i+4 − 6(i + 2) + 2(i + 1) · 4 · 2i+3 + 2 · 23 (2(i + 1))2 2i+3   ≤ 2 + 4(i + 1) + 32 (2(i + 1))2 2i+4 ≤ 32 (2(i + 2))2 2i+4 = µ5,i This also implies the agreeableness of κ5,i . In general, if µs,i satisfies its lower bound then κs,i does as well since Eq. (7,12) are stronger than Eq. (8,13). In particular, for s ≥ 5 odd we have µs−2,i λs,i−1 κs−2,i µs−3,i κs,i−1 κs−3,i 2κs−1,i + + + + s−2 2s−3 2(s − 2)2 2s−3 2(s − 2)3 ≤ 2µs−1,i + µs−2,i νs,i−1 + µs−3,i µs,i−1 ≤ µs,i = κs,i 4 The

reason we need to treat s ∈ {4, 5} as base cases is that the lower bounds on µ4,i , κ4,i , µ5,i , κ5,i in Eq. (7,8,12,13) refer 

to µ2,i . However, for s = 2, t = 0, µ2,i = 2 6≤ 2 bound on µ2,i .

i+0+3 0

− 3(2(i + 0 + 1))0 so we cannot use this expression as a valid upper

10

which follows from the fact that κs−1,i = µs−1,i , λs,i−1 = νs,i−1 , κs−2,i , κs−3,i ≤ κs−1,i , and s − 2 ≥ 3. For s ≥ 4 it follows that κs−2,i µs−2,i κs,i−1 2κs−1,i + + s−2 2s−3 2(s − 2)2 ≤ 98 µs−1,i + µs−2,i µs,i−1 ≤ µs,i = κs,i We now turn to bounding µs,i when s ≥ 6 is even or s ≥ 7 is odd. For even s we have: i+t+2 t−1

2µs−1,i + µs−2,i µs,i−1 ≤ 2 · [ 32 (2(i + t))t 2(

i+t+2 ) ] + [2(i+t+2 ) − 3(2(i + t))t ] t−1 ) − 3(2(i + t))t−1 ] · [2( t

i+t+2 t−1

) · 2(i+t+2 ) − 3(2(i + t))t−1 2(i+t+2 )−1 t t

≤ 2(

i+t+3 t

≤ 2(

) − 3(2(i + t + 1))t

i+t+2 t

{3(2(i + t))t < 21 2(

)}

i+t+2 {2( t )−1 > 4(i + t + 1)}

= µs,i and for odd s we have 2µs−1,i + µs−2,i νs,i−1 + µs−3,i µs,i−1 i+t+2 i+t+2 i+t+2 i+t+2 i+t+3 ≤ 2 · 2( t ) + 23 (2(i + t))t 2( t−1 ) · 4 · 2( t ) + 2( t−1 ) · 23 (2(i + t))t+1 2( t ) h i i+t+3 ≤ 2 + 23 4 · (2(i + t))t + 23 (2(i + t))t+1 2( t ) i i+t+3 h ≤ 32 (2(i + t))t · 2(i + t + 2) + 2 2( t ) i+t+3 ≤ 32 (2(i + t + 1))t+1 2( t ) = µs,i

2

This concludes the induction.

2.6

Proof of Theorem 1.1: Upper Bounds

Fix s ≥ 3, n, m and let c = s − 2. For i ≥ 1 let ji be minimum such that m ≤ aci,ji . Lemma 2.9 implies that an order-s (n, m) sequence has length at most µs,i (n + (cji )c m). Choose ι to be minimum such that n (cjι )c ≤ max{ m , (3c)c }. It is a tedious exercise to show that ι = α(n, m)±O(1) for any of the usual definitions of α. By choice of ι it follows that Ψs (n, m) = O((n + m)µs,ι ), which is O((n + m)α2 (n, m)2α(n,m) ) for s = 5 t and O((n + m)2(1+o(1))α (n,m)/t! ) for s ≥ 6. If m  n then we can always remove repetitions at block boundaries and analyze the sequence ignoring blocks, that is, Ψs (n, m) ≤ m − 1 + Ψs (n). We now turn to analyzing Ψs (n). Sharir [16] proved that if Ψs−2 (n) ≤ n · γs−2 (n) then Ψs (n) ≤ γs−2 (n) · Ψs (n, 2n − 1), that is, by paying a γs−2 (n) factor we can force an arbitrary order-s sequence to have less than 2n blocks. Building on this, F¨ uredi and Hajnal [7] (see also [14]) showed that Ψs (n) ≤ γs (γs (n)) · Ψs (n, n) = 2poly(α(α(n))) Ψs (n, n). Applying these reductions when s ∈ {3, 4} has no affect asymptotically since γ1 = 1, γ2 = 2. Applying the reductions when s ≥ 6 has no visible effect since the γs−2 (n) or γs (γs (n)) is hidden by the o(1) in the exponent. However, for s = 5 the F¨ uredi-Hajnal reduction gives us an upper bound Ψ5 (n) = O(nα2 (n)2α(n) 2(1+o(1))α(α(n)) ). We generalize the recurrence of Theorem 2.8 in order to eliminate the unsightly 2(1+o(1))α(α(n)) factor. Let S be a 2-sparse order-5 sequence with kSk = n. Greedily partition S into maximal order-3 sequences S 1 S 2 · · · S m . Sharir’s argument shows that each S q contains either the first or last occurrence of some symbol, hence m < 2n. We adopt the definitions of Sˇq , Sˆq , S´q , S`q , S¯q from Sections 2.1–2.4, that is, we consider the subsequences of S q consisting of symbols that are local, global, first global, last global, and middle global. Let Sˇ = Sˇ1 · · · Sˇm and Sˆ = Sˆ1 · · · Sˆm be the subsequences of local and global symbols. Neither is necessarily ˆ1 · · · Σ ˆ m be the sequence 2-sparse. Let Sˇ0 be the maximum length 2-sparse subsequence of Sˇ and let Sˆ00 = Σ q ˆ obtained from S by replacing each S with a block consisting of its alphabet, listed in order of first appearance ˆ in S q . The number of global symbols is n ˆ = kSk. 11

Judiciously choose ι to be minimum such that a3ι,3 ≥ n2 and find the derivation tree T (Sˆ00 , 3, ι). (Again, it is a tedious exercise to show that ι = α(n) ± O(1).) Let S˜00 , S˙ 00 , and S¨00 be the subsequences of Sˆ00 consisting of feathers, left non-feathers, and right non-feathers, all excluding wingtips. Let S˜0 , S˙ 0 , S¨0 , S´0 , and S`0 be the maximum length 2-sparse subsequences of Sˆ begat by, respectively, feathers, left and right non-feathers, and left and right wingtips. The same argument from Theorem 2.8 shows that |S˜0 | + |S˙ 0 | + |S¨0 | + |S´0 | + |S`0 | ≤ Ψ3 (Φ, 2Φ − 1) + 2 · Ψ5 (ˆ n, 2n − 1) + 4 · Ψ4 (ˆ n, 2ˆ n − 1)

(16)

where Φ = Φ5,3,i (ˆ n, 2n − 1) The 2-sparse subsequence of Sˆ begat by the Φ feathers in Sˆ00 has length Ψ3 (Φ) ≤ Ψ3 (Φ, 2Φ − 1). The 2-sparse subsequences begat by non-feather non-wingtips have length Ψ2 (|S˙ 0 |) + Ψ2 (|S¨0 |) ≤ 2(|S˙ 0 | + |S¨0 |) ≤ 2·Ψ5 (ˆ n, 2n−1) and the 2-sparse subsequences begat by wingtips have total length 2·Ψ4 (ˆ n) = 4·Ψ4 (ˆ n, 2ˆ n −1). We can also conclude that |Sˇ0 | ≤ Ψ3 (n − n ˆ , 2(n − n ˆ ) − 1) as the Sˇq s were by definition order-3 sequences over disjoint alphabets. Observe that S can be constructed by “blowing up” its six constituent sequences S˜0 , S˙ 0 , S¨0 , S´0 , S`0 , Sˇ0 , (by replacing each occurrence a with an arbitrarily long run aa · · · a) then interleaving the resulting sequences to restore 2-sparseness. In other words, there is a surjective map ϕ from occurrences in S to occurrences in 0 e. one of the six constituents. Partition S into subsequences T 1 T 2 · · · T d|S|/c e each with width c0 = d Ψ5 (6)+1 2 It follows that the image of ϕ on two consecutive {T q−1 }, {T q } (q < d|S|/c0 e) cannot be identical for otherwise T q−1 T q would be a 2-sparse, order-5 sequence with length 2c0 > Ψ5 (6) over a 6-letter alphabet, a contradiction. Hence |S| ≤ c0 · (|Sˇ0 | + |S˜0 | + |S˙ 0 | + |S¨0 | + |S´0 | + |S`0 |), which is c0 · O(ι(n − n ˆ ) + ι(2ι (ˆ n + n)) + 2 ι ι 2 α(n) ι 2 (ˆ n + n) + 2 n ˆ ) = O(nα (n)2 ). This follows from the fact that in Eq. (16), the second argument to the Ψ and Φ functions is never more than Φ5,3,i (ˆ n, 2n − 1) < n2 < a3ι,3 (for n sufficiently large), so when applying Eq. (3) with c = s − 2 = 3 and i = ι, it is always the case that j ≤ 3.

3

Lower Bounds

In this section we exhibit a new construction of order-5 sequences, proving that Ψ5 (n, m) = Ω(nα(n, m)2α(n,m) ) and Ψ5 (n) = Ω(nα(n)2α(n) ). This is the first construction that is asymptotically longer than the order-4 sequences with length Θ(n2α(n) ) and comes within an α(n) factor of the upper bounds established in the previous section. The sequences S4 (i, j) and S5 (i, j) are defined inductively below. As we will prove, S4 (i, j) is an abababfree sequence partitioned into blocks of length precisely j in which each symbol appears 2i times, whereas S5 (i, j) is an abababa-free sequence partitioned into blocks of length at most j in which each symbol appears (i − 2)2i + 4 times. Let Bs (i, j) = JSs (i, j)K and Ns (i, j) = kSs (i, j)k be, respectively, the number of blocks in Ss (i, j) and the alphabet size of Ss (i, j). By definition |S4 (i, j)| = 2i · N4 (i, j) = j · B4 (i, j) and |S5 (i, j)| = ((i − 2)2i + 4) · N5 (i, j) ≤ j · B5 (i, j). The construction of S4 is the same as Nivasch’s [12] and similar to that of Agarwal et al. [3]. It is based on two generic operations called composition and shuffling. If S 0 is a sequence with kS 0 k = j and S 00 a sequence partitioned into blocks with length j, S 00 ◦ S 0 is obtained by substituting for each block β in S 00 a copy of S 0 such that Σ(S 0 ) = Σ(β), where the order of symbols in β agrees with the order of first appearance in S 0 . Clearly JS 00 ◦ S 0 K = JS 00 K · JS 0 K. If S 0 and S 00 contain µ0 and µ00 copies of each symbol, respectively, the S 00 ◦ S 0 clearly contains µ0 µ00 copies of each symbol. If T 00 has JT 00 K = j and T 0 is partitioned into blocks of length j, the shuffle T 0  T 00 is obtained by forming the concatenation T ∗ of JT 0 K copies of T 00 , the alphabets of which do not intersect with each other or T 0 , then appending the kth symbol in the jth block of T 0 to the kth block in the jth copy of T 00 in T ∗ . Note that JT 0  T 00 K = |T 0 | = j · JT 0 K. Our construction of S5 uses slightly generalized forms of substitution and shuffling. Suppose S 00 is 0 0 partitioned into blocks with length at most j and Sf0 , Sm , Sl0 are sequences with kSf0 k = kSm k = kSl0 k = j.

12

D E 0 The 3-fold composition S 00 ◦ Sf0 , Sm , Sl0 is formed as follows. For each block β in S 00 , partition its symbols into blocks βf , βm , βl according to whether the symbol makes its first, middle, or last appearance in β, then 0 replace β with the concatenation of Sl0 (βl ), Sm (βm ), and Sf0 (βf ). Here Sx0 (βx ) represents a fragment of a 0 copy of Sx over the alphabet Σ(βx ) where the last j − |βx | symbols of the alphabet are missing. That is, due to missing the blocks in Sx0 (βx ) may be shorter than in the template Sx0 . We count empty blocks, D symbols E 0 0 0 so JS 00 ◦ Sf0 , Sm , Sl0 K = JS 00 K · (JSf0 K + JSm K + JSl0 K). The block lengths of Sf0 , Sm , and Sl0 may not be equal, D E 0 but if they are multiples of j we will construe S 00 ◦ Sf0 , Sm , Sl0 as being partitioned into blocks with length at most j. Irregular block lengths (due to missing symbols) present no problem for the shuffling operation T 0  T 00 so long as JT 00 K = j and blocks in T 0 have length at most j. The base cases for our sequences are given below, where brackets indicate blocks:

S2 (j) = [12 · · · (j − 1)j] [j(j − 1) · · · 21] S4 (1, j) = S5 (1, j) = S2 (j) i

S4 (i, 1) = [1]2

i

S5 (i, 1) = [1](i−2)2

+4

Observe that these base cases satisfy the property that symbols appear precisely 2i times in S4 (i, ·) and (i − 2)2i + 4 times in S5 (i, ·).   S4 (i, j) = S4 (i − 1, y) ◦ S2 (y)  S4 (i, j − 1) where y = B4 (i, j − 1)  D E S5 (i, j) = S5 (i − 1, N4 (i − 1, z)) ◦ S4 (i − 1, z), S2 (N4 (i − 1, z)), S4 (i − 1, z)  S5 (i, j − 1) where z = B5 (i, j − 1) We argue by induction that symbols appear with the correct multiplicity in S4 and S5 . In the case of S4 each symbol appears 2i−1 times in S4 (i − 1, y) (by the inductive hypothesis), twice in S2 (y), and therefore 2i times in S4 (i − 1, y) ◦ S2 (y). Symbols in copies of S4 (i, j − 1) already appear 2i times, by the inductive i−1 hypothesis. In S5 (i − 1, N4 (i − 1, z)) each symbol appears (i − 3)2 + 4 times. The composition operation   i−1 increases the multiplicity of such symbols to 2 (i − 3)2 + 2 + 2 2i−1 = (i − 2)2i + 4, where the first term accounts for the blowup in middle occurrences and the second term for the blowup in first and last occurrences. It follows that B and N are defined inductively as follows: B4 (1, j) = B5 (1, j) = B2 (j) = 2 B4 (i, 1) = 2i B5 (i, 1) = (i − 2)2i + 4 B4 (i, j) = B4 (i − 1, y) · 2 · y B5 (i, j) = B5 (i − 1, N4 (i − 1, z)) · (2 + 2−i+2 )B4 (i − 1, z) · z N4 (1, j) = N5 (1, j) = N2 (j) = j N4 (i, 1) = N5 (i, 1) = 1 N4 (i, j) = N4 (i − 1, y) + B4 (i − 1, y) · 2 · N4 (i, j − 1) N5 (i, j) = N5 (i − 1, N4 (i − 1, z)) + B5 (i − 1, N4 (i − 1, z)) · (2 + 2−i+2 )B4 (i − 1, z) · N5 (i, j − 1)

13

The 2 + 2−i+2 factor in the definition of B5 (i, j) and N5 (i, j) comes from the fact that in the shuffling step, S2 (N4 (i − 1, z)) is interpreted as having |S2 (N4 (i − 1, z))|/z blocks of length z, where |S2 (N4 (i − 1, z))| 2 · N4 (i − 1, z) 2 · z · B4 (i − 1, z) = 2−i+2 B4 (i − 1, z) = = z z z · 2i−1 Lemma 3.1 For s ∈ {4, 5}, Ss (i, j) is an order-s Davenport-Schinzel sequence. Proof: We use square brackets to indicate block boundaries, e.g., [ab]ab is a pattern where the first ab appear in one block and the last ab appear outside that block. One can easily show by induction that ¯ Ss (i, j) for all s ∈ {4, 5}, i > 1, j ≥ 1. (The base cases are trivial. When b ab[ab] ⊀ Ss (i, j) and [ab]ba ⊀ is shuffled into the indicated block in a copy of Ss (i, j − 1), all as appear in that copy and all other bs are shuffled into different copies, hence [ab] cannot be preceded by ab or followed by ba. This also implies that no two symbols both appear in two distinct blocks in Ss (i, j) for all s, i, j.) It follows that the patterns ababab (and abababa) cannot be introduced into S4 (and S5 ) by the shuffling operation but must come from the ¯ β for some block β in S4 (i − 1, y). It follows composition (and 3-fold composition) operation. Suppose ab ≺ that composing β with S2 (y) (an abab-free sequence) does not introduce an ababab pattern. (Substituting ¯ β and projecting onto {a, b} yields sequences of the form b∗ a∗ abaa∗ b∗ .) aba for ab ≺ ¯ β for some block β in S5 (i − 1, N4 (i − 1, z)). If a and b are both middle symbols Now suppose ab ≺ in β then, by the same argument above, composing β with S2 (N4 (i − 1, z)) does not introduce an ababab pattern much less an abababa pattern. If both a, b are first then composing β with an order-4 sequence S4 (i − 1, z) and projecting onto {a, b} yields patterns of the form a∗ b∗ a∗ b∗ a∗ a∗ b∗ , where the underlined portion originated from β. The case when a and b are last is symmetric. The cases when a and b are of different types (first-middle, first-last, last-middle) are handled similarly. 2 We have shown that Ψ4 (N4 (i, j), B4 (i, j)) ≥ 2i N4 (i, j) and Ψ5 (N5 (i, j), B5 (i, j)) ≥ ((i − 2)2i + 4)N5 (i, j). Since any blocked sequence can be turned into a 2-sparse sequence by removing duplicates at block boundaries this also implies that Ψ4 (N4 (i, j)) ≥ 2i N4 (i, j) − B4 (i, j) > (1 − 1/j)2i N4 (i, j), since all blocks in S4 (i, j) have length exactly j. There is no such guarantee for S5 , however, so statements of the form Ψ5 (N5 (i, j)) ≥ ((i − 2)2i + 4)N5 (i, j) − B5 (i, j) become trivial if B5 (i, j) ≥ ((i − 2)2i + 4)N5 (i, j). Lemma 3.2 shows that for j sufficiently large this does not occur and therefore removing duplicates at block boundaries does not affect the length of S5 (i, j) asymptotically. i Lemma 3.2 N5 (i, j) ≥ j · B5 (i, j)/δ(i), where δ(i) = 3i 2(2) .

Proof: When i = 1 we have N5 (1, j) = j ≥ j · B5 (1, j)/δ(1) = 2j/3. When j = 1 we have N5 (i, 1) = 1 ≥  i B5 (i, 1)/δ(i) = (i − 2)2i + 4 /3i 2(2) . Assuming the claim holds for all (i0 , j 0 ) < (i, j) (lexicographically), N5 (i, j) = N5 (i − 1, N4 (i − 1, z)) + B5 (i − 1, N4 (i − 1, z)) · (2 + 2−i+2 )B4 (i − 1, z) · N5 (i, j − 1) {defn. of N } 1 ≥ N5 (i − 1, N4 (i − 1, z)) + B5 (i − 1, N4 (i − 1, z)) · (2 + 2−i+2 )B4 (i − 1, z) · (j − 1)z {ind., defn. of z} δ(i) j−1 = N5 (i − 1, N4 (i − 1, z)) + B(i, j) {defn. of B} δ(i) 1 j−1 ≥ N4 (i − 1, z) · B5 (i − 1, N4 (i − 1, z)) + B(i, j) {ind. hyp.} δ(i − 1) δ(i) 1 j−1 ≥ B(i, j) {N4 (i, j) = 2ji B4 (i, j)} · z · B4 (i − 1, z) · B5 (i − 1, N4 (i − 1, z)) + δ(i − 1)2i−1 δ(i) 1 j−1 B5 (i, j) {2 + 2−i+2 ≤ 3} ≥ · z · (2 + 2−i+2 )B4 (i − 1, z) · B5 (i − 1, N4 (i − 1, z)) + i−1 3δ(i − 1)2 δ(i) j = B5 (i, j) {defn. of B, δ} δ(i) 2 14

Theorem 3.3 For any n and m, Ψ5 (n, m) = Ω(nα(n, m)2α(n,m) ) and Ψ5 (n) = Ω(nα(n)2α(n) ). Proof: Consider the sequence S5 = S5 (i, j), where j ≥ δ(i), and let S50 be obtained by removing duplicates at block boundaries. It follows that S50 is 2-sparse and, from Lemma 3.2, that |S50 | ≥ ((i − 2)i + 3)N5 (i, j). One can prove that i = α(N5 (i, j), B5 (i, j)) ± O(1) and that i = α(N5 (i, j)) ± O(1) when j = δ(i). See [4, 12, 3, 14] for several examples of such proofs. 2

4

Discussion t

t

One is hesitant to declare bounds of the form n·2(1±o(1))α (n)/t! tight since they are off by a 2±o(α (n)/t!) factor, which is not completely negligible. Nonetheless, we feel our results come close to settling the asymptotics of Ψs (n). In the world of generalized Davenport-Schinzel sequences, however, there is an abundance of open problems [10]. For example, there is currently no characterization of linear forbidden subsequences [1, 11, 10, 14, 13, 15], that is, the {σ} for which Ex(σ, n) = O(n), though the problem is solved when kσk = 2 and mostly solved when kσk = 3 [1, 14]. There are very few minimally non-linear sequences known, and it is open whether there are an infinite number of them [10, 14]. It is known that Ex(σ, n) = O(n·2poly(α(n)) ) [9, 12], but when Ex(σ, n) is nonlinear its asymptotic growth is only known to some precision when σ = abab · · · (standard Davenport-Schinzel sequences), σ = (aabb)t+2 (doubled even-length Davenport-Schinzel sequences) or when σ = abcacbc. The recurrence that we used for bounding Ex((ab)t+2 a, n) (t ≥ 1) can probably be extended to bound Ex((aabb)t+2 aa, n). An interesting question is whether it can also be extended to analyze the formation free sequences of Nivasch [12] and Klazar [9] or light forbidden 0-1 matrices, which are closely related to generalized Davenport-Schinzel sequences [7, 14, 13, 15].

References [1] R. Adamec, M. Klazar, and P. Valtr. Generalized Davenport-Schinzel sequences with linear upper bound. Discrete Math., 108(1-3):219–229, 1992. [2] P. Agarwal and M. Sharir. Davenport-Schinzel Sequences and their Geometric Applications. Cambridge University Press, 1995. [3] P. Agarwal, M. Sharir, and P. Shor. Sharp upper and lower bounds on the length of general DavenportSchinzel sequences. J. Combin. Theory Ser. A, 52:228–274, 1989. [4] N. Alon, H. Kaplan, G. Nivasch, M. Sharir, and S. Smorodinsky. Weak -nets and interval chains. In Proceedings 19th ACM-SIAM Symposium on Discrete Algorithms, pages 1194–1203, 2008. [5] H. Davenport. A combinatorial problem connected with differential equations. II. Acta Arith., 17:363– 372, 1970/1971. [6] H. Davenport and A. Schinzel. A combinatorial problem connected with differential equations. American J. Mathematics, 87:684–694, 1965. [7] Z. F¨ uredi and P. Hajnal. Davenport-Schinzel theory of matrices. Discrete Mathematics, 103(3):233–251, 1992. [8] S. Hart and M. Sharir. Nonlinearity of Davenport-Schinzel sequences and of generalized path compression schemes. Combinatorica, 6(2):151–177, 1986. [9] M. Klazar. A general upper bound in extremal theory of sequences. Comment. Math. Univ. Carolin., 33(4):737–746, 1992.

15

[10] M. Klazar. Generalized Davenport-Schinzel sequences: results, problems, and applications. Integers, 2:A11, 2002. [11] M. Klazar and P. Valtr. Generalized Davenport-Schinzel sequences. Combinatorica, 14(4):463–476, 1994. [12] G. Nivasch. Improved bounds and new techniques for Davenport-Schinzel sequences and their generalizations. J. ACM, 57(3), 2010. [13] S. Pettie. Degrees on nonlinearity in forbidden 0-1 matrix problems. Discrete Mathematics, 311:2396– 2410, 2011. [14] S. Pettie. Generalized Davenport-Schinzel sequences and their 0-1 matrix counterparts. J. Comb. Theory Ser. A, 118(6):1863–1895, 2011. [15] S. Pettie. On the structure and composition of forbidden sequences, with geometric applications. In Proceedings 27th Annual Symposium on Computational Geometry, pages 370–379, 2011. [16] M. Sharir. Almost linear upper bounds on the length of general Davenport-Schinzel sequences. Combinatorica, 7(1):131–143, 1987. [17] M. Sharir. Improved lower bounds on the length of Davenport-Schinzel sequences. Combinatorica, 8(1):117–124, 1988. [18] E. Szemer´edi. On a problem of Davenport and Schinzel. Acta Arith., 25:213–224, 1973/74.

16