A note on the Erdős-Szekeres Theorem in two dimensions

Burkill and Mirsky, and Kalmanson prove independently that, for every r > 2, n > 1, there is a sequence of r2 n vectors in Rn, which does not contain a subsequence of r + 1 vectors v1, v2, . . . , vr+1 such that, for every i between 1 and n, (v i )16j6r+1 forms a monotone sequence. Moreover, r 2n is the largest integer with this property. In this short note, for two vectors u = (u1, u2, . . . , un) and v = (v1, v2, . . . , vn) in Rn, we say that u 6 v if, for every i between 1 and n, ui 6 vi. Just like Burkill and Mirsky, and Kalmanson, for every k, ` > 1, d > 2 we find the maximal N1, N2 (which turn out to be equal) such that there are numerical twodimensional arrays of size (k + `− 1)×N1 and (k + `)×N2, which neither contain a subarray of size k× d, whose columns form an increasing sequence of d vectors in Rk, nor contain a subarray of size `× d, whose columns form a decreasing sequence of d vectors in R`. In a consequent discussion, we consider a generalisation of this setting and make a connection with a famous problem in coding theory. Mathematics Subject Classifications: 05D10


Introduction
For every n 1, we denote by [n] the set of integers between 1 and n. For a sequence (a i ) n i=1 and any k ∈ [n], a subsequence of (a i ) n i=1 of length k is any sequence a i 1 , a i 2 , . . . , a i k with 1 i 1 < i 2 < · · · < i k n. In this note, an array A of size m × n is a rectangular matrix of size m × n, and a subarray of A is obtained by intersecting a subset of the rows of A with a subset of the columns of A.
The following theorem due to Erdős and Szekeres is one of the cornerstones in the field of Ramsey theory.
Theorem 1 (Erdős-Szekeres theorem, [5]). For all integers k, 1, any sequence of k +1 real numbers contains either an increasing subsequence of length k + 1 or a decreasing subsequence of length + 1. 1 Since the appearance of the theorem in 1935, a vast number of generalisations have been brought forward. A few of them can be found in [3,4,7]. In each of the three papers, a major subject was the topic of finding large subarrays of numerical arrays, in which the entries of every row or every column, or both, form a monotone sequence. To be more precise, we state a version of Theorem 1 from [7], which also appears as Theorem 2.4 in [4]: Theorem 2 ( [4,7]). Let S be a sequence of vectors in R n , (n 1). If S has length at least r 2 n + 1, then it contains a subsequence of r + 1 vectors v 1 , v 2 , . . . , v r+1 such that, for every i between 1 and n, (v j i ) 1 j r+1 forms a monotone sequence. Moreover, r 2 n + 1 cannot be replaced by r 2 n .
In another line of research, the papers [2,6] consider another notion of monotonicity. For two vectors u = (u 1 , u 2 , . . . , u n ) and An array is called monotone if both the set of its rows and the set of its columns form a monotone sequence of vectors. Perhaps the first to introduce this notion were Fishburn and Graham in [6]. The papers [2,6] treat (a generalisation in dimension d 2 of) the problem of finding the minimal N , for which every numerical array of size N × N contains a monotone subarray of size n × n (they denote this minimal N by M 2 (n)).
Our setting interpolates between the weaker notion from [3,4,7] and the stronger one from [2,6]. In particular, we will be interested in the partial order used in [2,6], but only on the set of columns of an array and not on the set of rows.

Our results
We say that a numerical array has property (k, , d) if it contains either a subarray of size k × d, whose columns form an increasing sequence of vectors in R k , or a subarray of size × d, whose columns form a decreasing sequence of vectors in R . Proof. Our main tool will be the Erdős-Szekeres theorem. We prove the theorem by induction on k + . The case k + = 2 is true, since this is the statement of the Erdős-Szekeres theorem itself. Suppose that the statement is true for every pair of positive integers of sum less than some integer t 3. Let k, be positive integers with k + = t. Consider the first row of an array of size (k + −1)×((d−1) ( k+ k ) +1). Then, by the Erdős-Szekeres theorem, either it contains an increasing subsequence of size (d − 1) ( k+ −1 k−1 ) + 1, or it contains a decreasing subsequence of size (d − 1) ( k+ −1 k ) + 1. If k = 1 and the first case takes place, or if = 1 and the second case takes place, we are done. Otherwise, in both cases, it is sufficient to consider the subarray of the remaining t − 1 rows and the columns, whose first entries participate in the monotone subsequence given above, to conclude by the induction hypothesis. Remark 5. In [6] Fishburn and Graham gave an upper bound on M 2 (n) of the form towr 5 (O(n)), where the function towr k is defined recursively as towr 1 (n) = n, towr k (n) = 2 towr k−1 (n) . This bound was improved significantly by Bucić, Sudakov and Tran in [2] to Theorem 3 may be seen as an improvement of Theorem 2.3 from [2] in the special case when k = = n. This slightly improves the bound on M 2 (n) given there: we obtain Indeed, consider a numerical array of size By the Erdős-Szekeres theorem every column of the array contains a monotone subsequence of length 2n − 1. Since any such subsequence may be increasing or decreasing, and the number of possible choices for the indices of the rows of its entries is , one may deduce by the Pigeonhole principle that there is a subarray of size (2n−1)× (n − 1) ( 2n n ) + 1 , whose rows form a monotone sequence of vectors of dimension . By Theorem 3 we find a monotone subarray of size n × n in the latter.
What is most surprising about Theorem 3 is that it is indeed tight for any choice of parameters k, 1, d 2.
Note that Theorem 6 is slightly stronger than a purely complementary statement of Theorem 3 since we consider arrays of size (k + ) , which does not have property (k, , d), we make an elementary observation. A walk in Z 2 is up-right if it uses only transitions of the type (x, y) → (x + 1, y) and (x, y) → (x, y + 1).
Observation 7. For every k, ∈ N, the number of up-right walks in Z 2 from (0, 0) to (k, ) is k+ k .
For technical reasons, let us rotate the grid Z 2 at −45 • and consider walks from (0, 0) (which is the image of (k, ) under the rotation) instead. Each of these walks contains k steps of the type and steps of the type . By Observation 7 there are k+ k such walks, which we list in an arbitrary order. Let A be an array of size (k + ) × k+ k with entries in the set { , }, for which the j−th column (A i,j ) k+ i=1 describes the j−th walk in the list above (one begins the walk with the arrow A 1,j ). See Figure 1. Now, we show how to relate the array A to the construction of a numerical array, satisfying the requirements of Theorem 6. In the beginning, let B be an empty array of size (k + ) × (d − 1) ( k+ k ) . We will fill in the entries of B so that each row forms a permutation of the integers from 1 to (d entries. For each group, we replace its entries in the j−th row of B with the consecutive integers in one of the sets Since for every i ∈ [ k+ k ] we require that the integers from any group of size (d − 1) i in the j−th row of B are consecutive, we may consider an order relation between the groups, defined by g 1 < g 2 if every entry in the group g 1 is smaller than every entry in the group g 2 . Now, we will use the j−th row of the array A to indicate the order of the integers in every group in the j−th row of B, and the order of the groups as well, as follows. For every row j ∈ [k + ] and for every i ∈ [ k+ k ], if A j,i = , then for every group g i containing (d − 1) i consecutive entries in the j−th row of B, we order the d − 1 groups of (d − 1) i−1 consecutive entries, contained in g i , in increasing order. If, on the other hand, A j,i = , then for every group g i of (d − 1) i entries in the j−th row of B, we order the d − 1 groups of (d − 1) i−1 consecutive entries, contained in g i , in decreasing order. For the sake of clarity, we give an example.
For example, consider the case k = 2, = 1, d = 4. One possibility for the array A is     .
Since (d − 1) ( k+ k ) = 3 3 = 27, in the beginning we are given an empty array B of size 3 × 27. Let us see how to fill in the first row. We have A 1,3 = , so this means that the first row in B must begin with the group of (d − 1) ( k+ k )−1 = 3 2 = 9 integers from 19 to 27 in some order, then continue with the group of nine integers from 10 to 18 in some order, and finish with the group of nine integers from 1 to 9 in some order. Then, A 1,2 = , so each of the three groups above will consist of three smaller groups, ordered in increasing order. For example, the integers in the first group will be 19, 20, 21 in some order, then we continue with 22, 23, 24 in some order, and we finish with 25, 26, 27 in some order. Also, the second group of nine integers will begin with 10, 11, 12 in some order, continue with 13, 14, 15 in some order, and then finish with 16, 17, 18 in some order. Finally, A 1,1 = , so the members of each of the nine groups of three consecutive integers will be ordered in an increasing order. Therefore, the first row of B is given by   19, 20, 21, 22, 23, 24, 25, 26, 27, 10, 11, 12, 13, 14, 15, 16, 17, 18, 1, 2, 3 , 4, 5, 6, 7, 8, 9. Let us analyse the second row. Since A 2,3 = , it will begin with the integers from 1 to 9 in some order, then it will continue with the integers from 10 to 18 in some order, and will finish with the integers from 19 to 27 in some order. Then, A 2,2 = , so the first group of nine integers will begin with 7,8,9 in some order, then it will continue with 4,5,6 in some order, and will finish with 1,2,3 in some order. The two other groups of nine integers are organised similarly, that is, 16, 17, 18; 13, 14, 15; 10, 11, 12 for the second one and 25, 26, 27; 22, 23, 24; 19, 20, 21 for the third one. Finally, A 2,1 = , so each group of three consecutive integers is ordered in an increasing order. The second row of B is thus given by 7, 8, 9, 4, 5, 6, 1, 2, 3, 16, 17, 18, 13, 14, 15, 10, 11, 12, 25, 26, 27, 22, 23, 24, 19, 20, 21.
Proof of Theorem 6. We argue by contradiction. Suppose that there exists a subarray D of size k × d, whose columns form an increasing sequence of k−dimensional vectors (the case of a subarray D of size × d, whose columns form a decreasing sequence of −dimensional vectors is analogous). Let c 1 , c 2 , . . . , c d be the indices of the columns of B, which contain the entries of D. Proof. Let i 1 be the largest i between 1 and k+ k , for which the set c 1 , c 2 , . . . , c d has elements in at least two different groups of size (d − 1) i 1 −1 . Note that i 1 is at least two since a group of size d − 1 cannot contain all d indices c 1 , . . . , c d . Moreover, by the pigeonhole principle, there is a group of size (d−1) i 1 −1 , which contains at least two indices among c 1 , . . . , c d . For these two indices, there exists an integer i 2 < i 1 , for which both of them are contained in a group of size (d − 1) i 2 , but at the same time they are contained in different groups of size (d − 1) i 2 −1 (note that the smallest groups are of size one). This proves the claim. Now, let i 1 and i 2 be the integers given by Claim 8. Then, one must have that in each of the k rows of B, which contain entries of D, the order of the groups of size (d − 1) i 1 −1 within any group of size (d − 1) i 1 must be increasing, and the order of the groups of size (d − 1) i 2 −1 within any group of size (d − 1) i 2 must also be increasing. This means that in the array A must contain a subarray of size k × 2, full of . However, this is not possible since the columns of the array A correspond to walks from (0, 0) to ( k+ √ 2 , k− √ 2 ) with k steps of the type and steps of the type , and the positions of the steps of the type determine a unique such walk. This is a contradiction, which proves that the array B has property (k, , d).

Discussion
A natural question to ask in light of our results up to now is: for t 1, which is the largest integer N = N (t), for which there exists a numerical array of size (k + + t) × N , which does not have property (k, , d)? The idea from the proof of Theorem 6 gives a clue for a lower bound. One could try to find a maximal family of paths with steps within { , } k+ +t , for which, at any k positions among the k + + t, at most one path of the family has only steps of the type , and at any positions among the k + + t, at most one path of the family has only steps of the type . The question might be reformulated as follows: Question 9. What is the largest possible N = N (k, , t) ∈ N, for which there exists a family of N binary vectors of length k + + t such that no two vectors in the family share k entries equal to 1 ( ), and no two vectors in the family share entries equal to 0 ( )?
Arguing as in the proof of Theorem 6, we conclude the following fact: Fact 10. For every k, , t 1, d 2, there is an array of size (k + + t) × (d − 1) N (k, ,t) , which does not have property (k, , d).
Sadly, we cannot compute N (k, , t) in general. In the case when the number of 1−s (or −s) is fixed for all the vectors in the family considered in the question above (say, to k + t 1 with t 1 between 0 and t, and let t 2 = t − t 1 ), the problem comes down to looking for a family of paths between (0, 0) and ( k+ +t ) using only steps in the set { , }, just like in the proof of Theorem 6. In the language of coding theory, we are looking for the largest constant-weight code of length k + + t, distance 2 max(1 + t 1 , 1 + t 2 ) and weight k + t 1 . It is a famous and vastly studied problem in coding theory to compute this number, often denoted by A(k + + t, 2 max(1 + t 1 , 1 + t 2 ), k + t 1 ), see [1,8,9] for a number of lower and upper bounds on the function A(·, ·, ·) (not to be confused with the array A constructed above). Now, let M (k, , t) = max 0 t 1 t A(k + + t, 2 max(1 + t 1 , 1 + t 2 ), k + t 1 ).
Since A(k + + t, 2 max(1 + t 1 , 1 + t 2 ), k + t 1 ) N (k, , t) for every choice of t 1 between 0 and t, we conclude that M (k, , t) N (k, , t) as well. As a consequence we obtain following corollary. We believe that it may be used in practice in the construction of large numerical arrays satisfying property (k, , d) for some small values of the parameter: Corollary 11. For every k, , t 1, the construction from the proof of Theorem 6 yields an array of size (k + + t) × (d − 1) M (k, ,t) , which does not have property (k, , d).
Reasonable upper bounds in this more general case may also be of interest since our approach for Theorem 3 breaks down in case more than k + − 1 rows are present.