A positive fraction Erdos-Szekeres theorem and its applications

A famous theorem of Erdos and Szekeres states that any sequence of $n$ distinct real numbers contains a monotone subsequence of length at least $\sqrt{n}$. Here, we prove a positive fraction version of this theorem. For $n>(k-1)^2$, any sequence $A$ of $n$ distinct real numbers contains a collection of subsets $A_1,\ldots, A_k \subset A$, appearing sequentially, all of size $s=\Omega(n/k^2)$, such that every subsequence $(a_1,\ldots, a_k)$, with $a_i \in A_i$, is increasing, or every such subsequence is decreasing. The subsequence $S = (A_1,\ldots, A_k)$ described above is called block-monotone of depth $k$ and block-size $s$. Our theorem is asymptotically best possible and follows from a more general Ramsey-type result for monotone paths, which we find of independent interest. We also show that for any positive integer $k$, any finite sequence of distinct real numbers can be partitioned into $O(k^2\log k)$ block-monotone subsequences of depth at least $k$, upon deleting at most $(k-1)^2$ entries. We apply our results to mutually avoiding planar point sets and biarc diagrams in graph drawing.


Introduction
In 1935, Erdős and Szekeres [6] proved that any sequence of n distinct real numbers contains a monotone subsequence of length at least √ n. This is a classical result in combinatorics and its generalizations and extensions have many important consequences in geometry, probability, and computer science. See Steele [13] for 7 different proofs along with several applications.
In this paper, we prove a positive fraction version of the Erdős-Szekeres theorem. We state this theorem using the following notion: A sequence (a 1 , a 2 , . . . , a ks ) of ks distinct real numbers is said to be block-increasing (block-decreasing) with depth k and block-size s if every subsequence (a i1 , a i2 , . . . , a i k ), for (j − 1)s < i j ≤ js, is increasing (decreasing). We call a sequence block-monotone if it's either block-increasing or block-decreasing.

62:2 A Positive Fraction Erdős-Szekeres Theorem and Its Applications
We prove Theorem 1 by establishing a more general Ramsey-type result for monotone paths, which we describe in detail in the next section. The theorem is also asymptotically best possible, see Remark 9.
By a repeated application of Theorem 1, we can decompose any sequence of n distinct real numbers into O(k log n) block-monotone subsequences of depth k upon deleting at most (k − 1) 2 entries. Our next result shows that we can obtain such a partition, where the number of parts doesn't depend on n.
▶ Theorem 2. For any positive integer k, every finite sequence of distinct real numbers can be partitioned into at most O(k 2 log k) block-monotone subsequences of depth at least k upon deleting at most (k − 1) 2 entries.
Our Theorem 2 is inspired by a similar problem of partitioning planar point sets into convex-positioned clusters, which is studied in [12]. A positive fraction Erdős-Szekeres-type result for convex polygons is given previously by Bárány and Valtr [3].
In the full version of this paper, we present a polynomial time algorithm that computes the block-monotone subsequence claimed by Theorem 1. Our proof of Theorem 2 is constructive hence implying a polynomial time algorithm for the claimed partition as well.
We give two applications of Theorems 1 and 2.
Mutually avoiding sets. Let A and B be finite point sets of R 2 in general position, that is, no three points are collinear. We say that A and B are mutually avoiding if no line generated by a pair of points in A intersects the convex hull of B, and vice versa. Aronov et al. [1] used the Erdős-Szekeres Theorem to show that every n-element planar point set P in general position contains subsets A, B ⊂ P , each of size Ω( √ n), s.t. A and B are mutually avoiding. Valtr [14] showed that this bound is asymptotically best possible by slightly perturbing the points in an √ n × √ n grid. Following the same ideas of Aronov et al., we can use Theorem 1 to obtain the following. This improves an earlier result of Mirzaei and the first author [9], who proved the theorem above with ϵ k = Ω( 1 k 4 ). The result above is asymptotically best possible for both k and |P |: Consider a k × k grid G and replace each point with a cluster of |P |/k 2 points placed very close to each other so that the resulting point set P is in general position. If we can find subsets A i 's and B i 's as in Theorem 3, but each of size ϵ ′ k |P | with ϵ ′ k = ω( 1 k 2 ), then we can find mutually avoiding subsets in G of size ω(k), contradicting Valtr's [14].
Finally, let us remark that a recent result due to Pach, Rubin, and Tardos [11] shows that every n-element planar point set in general position determines at least n/e O( √ log n) pairwise crossing segments. By using Theorem 3 instead of Lemma 3.3 from their paper, one can improve the constant hidden in the O-notation.

Monotone biarc diagrams.
A proper arc diagram is a drawing of a graph in the plane, whose vertices are points placed on the x-axis, called the spine, and each edge is drawn as a half-circle. A classic result of Bernhard and Kainen [4] shows that a planar graph admits a planar proper arc diagram if and only if it's a subgraph of a planar Hamiltonian graph. A monotone biarc diagram is a drawing of a graph in the plane, whose vertices are placed on a A. Suk and J. Zeng 62:3 spine, and each edge is drawn either as a half-circle or two half-circles centered on the spine, forming a continuous x-monotone biarc. See Figure 6 for an illustration. In [5], Di Giacomo et al. showed that every planar graph can be drawn as a planar monotone biarc diagram.
Using the Erdős-Szekeres Theorem, Bar-Yehuda and Fogel [2] showed that every graph G = (V, E), with a given order on V , has a double-paged book embedding with at most O( √ E) pages. That is, E can be partitioned into O( |E|) parts, s.t. for each part E i , (V, E i ) can be drawn as a planar monotone biarc diagram, and V appears on the spine with the given order. Our next result shows that we can significantly reduce the number of pages (parts), if we allow a small fraction of the pairs of edges to cross on each page.

▶ Theorem 4. For any ϵ > 0 and a graph
can be drawn as a monotone biarc diagram having no more than ϵ|E i | 2 crossing edge-pairs, and V appears on the spine with the given order.
This paper is organized as follows: In Section 2, we prove Theorem 1 in the setting of monotone paths in multicolored ordered graphs. Section 3 is devoted to the proof of Theorem 2. In Section 4, we present proofs for the applications claimed above. Section 5 lists some remarks.

A positive fraction result for monotone paths
Several authors [7,10,8] observed that the Erdős-Szekeres theorem generalizes to the following graph-theoretic setting. Let G be a graph with vertex set . Then we say that (p 1 , V 1 , p 2 , V 2 , p 3 , . . . , p k , V k , p k+1 ) is a block-monotone path of depth k and block-size s if . and every (2k + 1)-tuple of the form Our main result in this section is the following Ramsey-type theorem. ▶ Theorem 7. There is an absolute constant c > 0 s.t. the following holds. Given integers q ≥ 2, k ≥ 1, and n ≥ (ck) q , let χ be a q-coloring of the pairs of [n]. Then χ produces a monochromatic block-monotone path of depth k and block-size s ≥ n (ck) q .
A careful calculation shows that we can take c = 40 in the theorem above. We will need the following lemma.  3 of these monochromatic monotone paths of length 3 start at vertex p 1 and ends at vertex p 2 . By setting V 1 to be the "middle" vertices of these paths, (p 1 , V 1 , p 2 ) is a monochromatic block-monotone path of depth 1 and block-size

62:4 A Positive Fraction Erdős-Szekeres Theorem and Its Applications
Proof of Theorem 7. Let χ be a q-coloring of the pairs of [n] and let c be a sufficiently large constant that will be determined later. Set s = ⌈ n (ck) q ⌉. For the sake of contradiction, suppose χ does not produce a monochromatic block-monotone path of depth k and block-size s. For each element v ∈ [n], we label v with f (v) = (b 1 , . . . , b q ), where b i denotes the depth of the longest block-monotone path with block-size s in color i, ending at v. By our assumption, we have 0 ≤ b i ≤ k − 1, which implies that there are at most k q distinct labels. By the pigeonhole principle, there is a subset V ⊂ [n] of size at least n/k q , s.t. the elements of V all have the same label.
By Lemma 8, there are vertices p 1 , p 2 ∈ V , a subset V ′ ⊂ V , and a color α s.t. (p 1 , V ′ , p 2 ) is a monochromatic block-monotone path in color α, with block-size t ≥ |V | q3 3q . By setting c to be sufficiently large, we have However, this contradicts the fact that f (p 1 ) = f (p 2 ), since the longest supported monotone path with block-size s in color α ending at vertex p 1 can be extended to a longer one ending at p 2 . This completes the proof. ◀ Proof of Theorem 1. Let A = (a 1 , . . . , a n ) be a sequence of distinct real numbers. Let χ be a red/blue coloring of the pairs of A s.t. for i < j, we have χ(a i , a j ) = red if a i < a j and In other words, we color increasing pairs by red and decreasing pairs by blue. If n < (ck) 2 , notice that n/(ck) 2 < 1. By our assumption n > (k − 1) 2 , the classical Erdős-Szekeres theorem gives us a monotone subsequence in A of length at least k, which can be regarded as a block-monotone subsequence of depth at least k and block-size If n ≥ (ck) 2 , by Theorem 7, there is a monochromatic block-monotone path of depth k and block-size s ≥ n/(ck) 2 in the complete graph on A, which can be regarded as a block-monotone subsequence of A with the claimed depth and block-size. ◀ ▶ Remark 9. For each k, q, s > 0, the simple construction below shows Theorem 7 is tight up to the constant factor c q . We first construct K(k, q), for each k and q, a q-colored complete graph on [k q ], whose longest monochromatic monotone path has length k: K(k, 1) is just a monochromatic copy of the complete graph on [k]. To construct K(k, q) from K(k, q − 1),

62:5
take k copies of K(k, q − 1) with the same set of q − 1 colors, place them in order and color the remaining edges by a new color. Now replace each point in K(k, q) by a cluster of s points, where within each cluster one can arbitrarily color the edges. The resulting q-colored complete graph has no k subsets V 1 , V 2 , . . . , V k ⊂ [n] each of size s + 1 and edges between them monochromatic, otherwise K(k, q) would have a monochromatic monotone path with length larger than k. It's well-known that the sharpness of the classical Erdős-Szekeres theorem comes from sequences such as We note that if we color the increasing pairs of S(k) by red and the decreasing pairs of S(k) by blue, we obtain the graph K(k, 2). If we replace each entry s i ∈ S(k) by a cluster of s distinct real numbers very close to s i , we obtain an example showing that Theorem 1 is asymptotically best possible.

Block-monotone sequence partition
This section is devoted to the proof of Theorem 2. We shall consider this problem geometrically by identifying each entry a i of a given sequence A = (a i ) n i=1 as a planar point (i, a i ) ∈ R 2 . As we consider sequences of distinct real numbers, throughout this section, we assume that all point sets have the property that no two members share the same x-coordinate or the same y-coordinate.
Thus, we analogously define block-monotone point sets as follows: A set of ks planar points is said to be block-increasing (block-decreasing) with depth k and block-size s if it can be written as for all i and every sequence (y i1 , y i2 , . . . , y i k ), for (j − 1)s < i j ≤ js, is increasing (decreasing). We say that a point set is block-monotone if it's either block-increasing or block-decreasing. For each j ∈ [k] we call the subset {(x i , y i )} js i=(j−1)s+1 the j-th block of this block-monotone point set. Hence, Theorem 2 immediately follows from the following. Given a point set P ⊂ R 2 , let Our proof of Theorem 10 relies on the following definitions. The constant c below (and throughout this section) is from Theorem 7. See Figure 1 for an illustration.
If a planar point set P is a (k, 4k, t)-pattern or a (k, l, k)-pattern, the next two lemmas state that we can efficiently partition P into few block-monotone point sets of depth at least k and a small remaining set. Starting with an arbitrary point set P , which can be regarded as a (k, 0, 0)-pattern, we will repeatedly apply the following lemma until P is partitioned into few block-monotone point sets, a set P ′ that is either a (k, 4k, t)-pattern or a (k, l, k)-pattern, and a small remaining set.
▶ Lemma 15. For l < 4k and t < k, a (k, l, t)-pattern P can be partitioned into r blockmonotone point sets with depth at least k, a point set P ′ , and a remaining set E s.t.
Moreover, when t = 0, we can always have this partition of P as in either case 1 or case 2.
Before we prove the lemmas above, let us use them to prove Theorem 10.

62:7
Proof of Theorem 10. Let P be the given point set. For i ≥ 0, we inductively construct a partition , F i is a disjoint family of block-monotone point sets of depth at least k, and |F i | = O(ik log k).
We start with P 0 = P , which is a (k, 0, 0)-pattern, and we end this inductive construction process, otherwise, we construct the next partition According to Lemma 15, P i can be partitioned into r block-monotone point sets with depth at least k, denoted as {P i,1 , . . . , P i,r }, a point set P ′ , and a remaining set E, s.t. either one of the following cases happens.
When t i = 0, by Lemma 15, we can always partition P i as in Case 1 or Case 2. So we always construct F i+1 ∪ {P i+1 , E i+1 } according to Case 1 or Case 2 when t i = 0.
Let F w ∪ {P w , E w } be the last partition of P constructed in this process. Here, P w is a (k, l w , t w )-pattern. We must have either |P w | ≤ k(3k − 1) 2 , or l w ≥ 4k, or t w ≥ k. Since t i+1 ≤ t i + 1 and l i+1 ≤ l i + t i for all i, we have t w ≤ k and l w ≤ 5k. Since we always construct the (i + 1)-th partition according to Case 1 or Case 2 when t i = 0, the sum l i + t i always increases by at least 1 after 2 inductive process. So we have w/2 ≤ t w + l w ≤ 6k and hence w ≤ 12k. Now we handle F w ∪ {P w , E w } based on how the construction process ends. If the construction process ended with If the construction process ended with l w ≥ 4k, by Definition 12, we can partition P w into l w − 4k many block-monotone point sets of depth k, denoted as {P w,1 , . . . , P w,lw−4k }, and a (k, 4k, t w )-pattern P ′ w . Then, by Lemma 13, P ′ w can be partitioned into r = O(k log k) block-monotone point sets of depth at least k, denoted as {P ′ w,1 , . . . , P ′ w,r }, and a remaining set E of size O(k 2 ). We define E w+1 = E w ∪ E and F w+1 = F w ∪ {P w,1 , . . . , P w,lw−4k , P ′ w,1 , . . . , P ′ w,r }.

62:8 A Positive Fraction Erdős-Szekeres Theorem and Its Applications
If the construction process ended with t w ≥ k, we actually have t w = k and l w < 4k. By Lemma 14, we can partition P w into r = O(k 2 log(k) + l w ) block-monotone point sets of depth at least k, denoted as {P w,1 , . . . , P w,r }, and a remaining set E of size O(k 3 ). We define E w+1 = E w ∪ E and F w+1 = F w ∪ {P w,1 , . . . , P w,r }. Again, we can check |F w+1 | = O(k 2 log(k)) and |E w+1 | = O(k 3 ).
Overall, we can always obtain a partition F w+1 ∪ {E w+1 } of P with |F w+1 | = O(k 2 log(k)) and |E w+1 | = O(k 3 ). Using the classical Erdős-Szekeres theorem, we can always find a monotone sequence of length at least k in E w+1 when |E w+1 | > (k − 1) 2 . By a repeated application of this fact, we can partition E w+1 into O(k 2 ) block-monotone point sets of depth k and block-size 1, and a remaining set E of size at most (k − 1) 2 . We define F to be the union of F w+1 and these block-monotone sequences. The partition F ∪ {E} of P has the desired properties and concludes the proof. ◀ We now give proofs for Lemmas 13, 14, and 15. We need the following facts.

▶ Fact 16. For any positive integer k, every point set P can be partitioned into O(k log(k)) block-monotone point sets of depth k and a remaining set
This fact can be established by repeatedly using Theorem 1 to pull out block-monotone point sets and applying the elementary inequality (1 − x −1 ) x log(x) ≤ x −1 for any x > 1.

▶ Fact 17. For any positive integers k and m, every block-monotone point set P with depth k and |P | ≥ m can be partitioned into a block-monotone point set of depth k, a subset of size exactly m, and a remaining set of size less than k.
This fact can be established by taking out ⌈m/k⌉ points from each block of P . Then we have taken out k · ⌈m/k⌉ = m + r points, where 0 ≤ r < k.
Finally, let E : and a remaining set E of size O(k 3 ), as wanted. ◀ Proof of Lemma 15. Write the given (k, l, t)-pattern P = S 1 ∪ · · · ∪ S l ∪ Y as in Definition 12 and the (k, t)-configuration Y = Y 1 ∪· · ·∪Y 2t+1 as in Definition 11. Without loss of generality, . We also assume that Y 1 has the largest size among {Y 2j+1 ; j ∈ {0} ∪ [t]} because other scenarios can be proved similarly.

62:10 A Positive Fraction Erdős-Szekeres Theorem and Its Applications
If |Y 1 | ≤ (3k − 1) 2 , we can partition P into r = l + t = O(k) many block-monotone point sets of depth k, which are {S 1 , . . . , S l , Y 2 , Y 4 , . . . , Y 2t }, and a remaining set P ′ := ∪ t j=0 Y 2j+1 of size at most k(3k − 1) 2 , since t < k. So we conclude the lemma in case (1). Now we assume |Y 1 | > (3k − 1) 2 . Apply Theorem 1 to extract a block-monotone point set S ⊂ Y 1 of depth 3k and block-size at least |Y 1 |/(3ck) 2 and name the i-th block of S as B i for i ∈ [3k]. Our proof splits into two cases: S being block-increasing or S being block-decreasing. Case 1. Suppose S is block-increasing, write S l+i := Y 2(t+1−i) for each i ∈ [t] and set P ′ = S 1 ∪ · · · ∪ S l+t ∪ (Y 1 \ S). We can check that P ′ is a (k, k + l, 0)-pattern by Definition 12. Let Z := ∪ t j=1 Y 2j+1 . By an argument similar to (1), we can apply Fact 16 three times to We have partitioned P into O(k log(k)) block-monotone point sets of depth at least k, which are {A 1 , . . . , A w , S}, a (k, k + l, 0)-pattern P ′ , and a remaining set E of size O(k 2 ). So we conclude the lemma in case (3). If We observe that C := B ′ 1 ∪ · · · ∪ B ′ 3k ∪ Z ′ is block-increasing of depth 3k + 1 and S ′ := B ′′ 1 ∪ · · · ∪ B ′′ 3k is block-increasing of depth 3k by their construction. We have partitioned P into O(k log(k)) block-monotone point sets of depth at least k, which are {A 1 , . . . , A w , C, S ′ }, and a (k, k+l, 0)pattern P ′ . So we conclude the lemma in case (3).

Case 2.
Suppose S is block-decreasing, we choose two points in the following regions: Also we require x 1 or x 2 isn't the x-coordinate of any element in P , and y 1 or y 2 isn't the y-coordinate of any element in P . We use the lines x = x i and y = y i for i = 1, 2 to divide the plane into a 3 × 3 grid and label the regions R i , i = 1, . . . , 9 as in Figure 3.

We have partitioned
) block-monotone sequence of depth at least k, which are {A j,x ; j = 1, 2, x ∈ [w j ]}, and a (k, l, t + 1)-pattern P ′ . Combined with the claim in previous paragraph, we conclude the lemma in case (2).
Finally, when we are in the special case t = 0 and S is block-increasing, we can still use the arguments for the case when S is block-decreasing and conclude the lemma in case (2). The condition t = 0 can be used to verify Y ′ is a (k, t + 1)-configuration, which is generally not true when t > 0 and S is block-increasing. ◀

Mutually avoiding sets
We devote this subsection to the proof of Theorem 3. The proof is essentially the same as in [1], but we include it here for completeness. Given a non-vertical line L in the plane, we denote L + to be the closed upper-half plane defined by L, and L − to be the closed lower-half plane defined by L. We need the following result, which is Lemma 1 in [1]. We can apply an affine transformation so that L and H are perpendicular, and N is on the right side of H. Think of L as the x-axis, H as the y-axis, and N as a vertical line with a positive x-coordinate. After ordering the elements in Q according to their x-coordinates, we apply Theorem 1 to Q to obtain disjoint subsets Q 1 , . . . , Q 2k+1 ⊂ Q s.t. (Q 1 , . . . , Q 2k+1 ) is block-monotone of depth 2k + 1 and block-size Ω(n/k 2 ), where each entry represents its y-coordinate. Without loss of generality, we can assume it is block-decreasing, otherwise we can work with Q r rather than Q l in the following arguments. Figure 5 An example when Ai's are increasing. Each ellipse represents a cluster of points as defined in the proof. Now fix a point q ∈ Q k+1 . We express the points in Q l in polar coordinates (ρ, θ) with q being the origin. We can assume no two points in Q l are at the same distance to q, otherwise a slight perturbation may be applied. By ordering the points in Q l with respect to θ, in counter-clockwise order, we apply Theorem 1 to Q l to obtain disjoint subsets A 1 , . . . , A k ⊂ Q l s. t. (A 1 , . . . , A k ) is block-monotone of depth k and block-size Ω(n/k 2 ), where each entry represents its distance to q. If it's block-decreasing, take B i = Q i for i ∈ [k], and if it's block-increasing, take B i = Q k+1+i . It is easy to check that the sets {A 1 , . . . , A k } and {B 1 , . . . , B k } have the claimed properties. See Figure 5 for an illustration. ◀

Monotone biarc diagrams
We devote this subsection to the proof of Theorem 4. Our proof is constructive, hence implying an recursive algorithm for the claimed outcome. We start by making the simple observation that our main results hold for sequences of (not necessarily distinct) real numbers, if the term block-monotone now refers to being block-nondecreasing or block-nonincreasing. More precisely, a sequence (a 1 , a 2 , . . . , a ks ) of real numbers is said to be block-nondecreasing (block-nonincreasing) with depth k and block-size s if every subsequence (a i1 , a i2 , . . . , a i k ), for (j − 1)s < i j ≤ js, is nondecreasing (nonincreasing). To see our main results imply the above variation, it suffices to slightly perturb the possibly equal entries of a given sequence until all entries are distinct. Algorithms for our main results can also be applied after such a perturbation.
We need the following lemma in [2] for Theorem 4. , we order the elements in E ′ lexicographically: for (x, y), (x ′ , y ′ ) ∈ E, we have (x, y) < (x, y) when x < x ′ or when x = x ′ and y < y ′ . Given the order on E ′ described above, consider the sequence of right-endpoints in E ′ . We apply Theorem 19 with parameter k = ⌈ϵ −1 ⌉ to this sequence, to decompose it into C k many block-monotone sequences of depth k, upon deleting at most (k − 1) 2 entries. For each block-monotone subsequence of depth k, we draw the corresponding edges on a single page as follows. If the subsequence is block-nonincreasing of depth k and block-size s, we draw the corresponding edges as semicircles above the spine. Then, two edges cross only if they come from the same block. Since there are a total of ks 2 pairs of edges, and only k s 2 such pairs from the same block, the fraction of pairs of edges that cross in such a drawing is at most 1/k. See Figure 6(i). Similarly, if the subsequence is block-nondecreasing of depth k and block-size s, we draw the corresponding edges as monotone biarcs, consisting of two semicircles with the first (left) one above the spine, and the second (right) one below the spine. Furthermore,

62:14 A Positive Fraction Erdős-Szekeres Theorem and Its Applications
we draw the monotone biarc s.t. it crosses the spine at b + 1 − ℓ/n − r/(2n 2 ), where ℓ and r are the left and right endpoints of the edge respectively. See Figure 6(ii). By the same argument above, the fraction of pairs of edges that cross in such a drawing is at most 1/k.
Hence, E ′ can be decomposed into C k + (k − 1) 2 many monotone biarc diagrams, s.t. each monotone biarc diagram has at most 1/k-fraction of pairs of edges that are crossing.
(i) (ii) For edges within [b], Lemma 20 and the inductive hypothesis tell us that they can be decomposed into (C k + (k − 1) 2 )(log |E| − 1) monotone biarc diagrams, s.t. the fraction of pairs of edges that are crossing in each diagram is at most 1/k. The same argument applies to the edges within [n] \ [b]. However, notice that two such monotone biarc diagrams, one in [b] and another in [n] \ [b], can be drawn on the same page without introducing more crossings. Hence, we can decompose E\E ′ into at most (C k + (k − 1) 2 )(log |E| − 1) such monotone biarc diagrams, giving us a total of (C k + (k − 1) 2 ) log |E| monotone biarc diagrams. ◀