Erdős-Szekeres theorem for multidimensional arrays

The classical Erdős-Szekeres theorem dating back almost a hundred years states that any sequence of (n − 1) + 1 distinct real numbers contains a monotone subsequence of length n. This theorem has been generalised to higher dimensions in a variety of ways but perhaps the most natural one was proposed by Fishburn and Graham more than 25 years ago. They defined the concept of a monotone and a lex-monotone array and asked how large an array one needs in order to be able to find a monotone or a lex-monotone subarray of size n× . . .×n. Fishburn and Graham obtained Ackerman-type bounds in both cases. We significantly improve these results. Regardless of the dimension we obtain at most a triple exponential bound in n in the monotone case and a quadruple exponential one in the lex-monotone case.


Introduction
A classical paper of Erdős and Szekeres [14] from 1935 is one of the starting points of a very rich discipline within combinatorics: Ramsey theory.A main result of the paper, which has become known as the Erdős-Szekeres theorem, says that any sequence of (n − 1) 2 + 1 distinct real numbers contains either an increasing or decreasing subsequence of length n, and this is tight.Among simple results in combinatorics, only few can compete with this one in terms of beauty and utility.See, for example, Steele [29] for a collection of six proofs and some applications.
A very natural question which arises is how does one generalise the Erdős-Szekeres theorem to higher dimensions?The main concept which does not have an obvious generalisation is that of the monotonicity of a subsequence.Several candidates have been proposed [8,9,20,21,22,23,28,30] but perhaps the most natural one was introduced more than 25 years ago by Fishburn and Graham [16].A multidimensional array is said to be monotone if for each dimension all the 1-dimensional subarrays along the direction of this dimension are increasing or are all decreasing.To be more formal, a d-dimensional array f is an injective function from A 1 × . . .× A d to R where A 1 , . . ., A d are non-empty subsets of Z; we say f has size
For example, of the following 2-dimensional arrays first and second are monotone, while the third is not (since some rows contain increasing and some rows decreasing sequences).The higher dimensional version of the Erdős-Szekeres problem introduced by Fishburn and Graham [16] now becomes: given positive integers d and n, determine the smallest N such that any d-dimensional array of size N × . . .× N contains a monotone d-dimensional subarray of size n × . . .× n, we denote this N by M d (n).The Erdős-Szekeres theorem can now be rephrased as M 1 (n) = (n − 1)2 + 1. Fishburn and Graham [16, Section 3] showed that M 2 (n) ≤ towr 5 (O(n)) 1 , that M 3 (n) is bounded by a tower of height at least a tower in n and that M d (n) is bounded from above by an Ackermann-type 2 function of order at least d for d ≥ 4. We significantly improve upon these results.
where the terms o(1) tend to 0 as n → ∞.
Fishburn and Graham introduced another very natural generalisation of the notion of monotonicity of a sequence to higher dimensional arrays.A multidimensional array is said to be lexicographic if for any two entries the one which has the larger position in the first coordinate in which they differ is larger.For example, the following array is lexicographic: An array is said to be lex-monotone if it is possible to permute the coordinates and reflect the array along some dimensions to obtain a lexicographic array.To be more formal, for two vectors u = (u 1 , . . ., u d ) and v = (v 1 , . . ., v d ) in R d , we write u < lex v if u i < v i , where i is the smallest index such that u i = v i .
Note that a 1-dimensional array is lex-monotone if and only if it is a monotone sequence.The following 2-dimensional arrays are lex-monotone since for the first one the above matrix is obtained by swapping the coordinates, for the second one by reflecting along the first dimension and for the third by performing both of these operations.showed that L d (n) exists.This result has been used to prove interesting results in poset dimension theory [15] and computational complexity theory [1].
Note that any lex-monotone array is monotone, so a very natural strategy to bound L d (n) is to first find a monotone subarray and then within this subarray find a lex-monotone subarray.This motivates the following problem which is of independent interest.For positive integers d and n, we define F d (n) to be the minimum N such that any d-dimensional monotone array of size N × . . .× N , contains a lex-monotone subarray of size n × . . .× n.It is easy to see by the above reasoning that We determine F 2 (n) completely and significantly improve the bound for all d ≥ 3.
where the terms o(1) tend to 0 as n → ∞.
For comparison, the best lower bound on L d (n), due to Fishburn and Graham [16,Theorem 2] is achieved by taking a random array, is Notation and organisation.The rest of the paper is organised as follows.We prove Theorem 1.1 in Section 2 and Theorem 1.2 in Section 3. The final section contains some concluding remarks and open problems.
For sequences a(n) and b(n) we write a A set of the form to an ordering of the vertices of the d-dimensional grid A 1 × . . .× A d ; we switch between these points of view interchangeably.
We generally use lowercase bolded letters for vectors and uppercase bolded letters for grids.For a vector u we denote by u i the value of the i-th coordinate.

Monotone arrays
In this section we will prove Theorem 1.1.We begin with a few preliminaries.

Preliminaries
We collect here several well-known Ramsey-type results, whose simple proofs are included for completeness.
Lemma 2.1.Given k, n, t ∈ N in any vertex k-colouring of an tk nk n × kn grid there is a monochromatic subgrid of size t × n.
Proof.Since each row of the grid has kn points, by pigeonhole principle each row has n points with same colour.Fix a choice of such n points for each row.These n points may appear in kn n different positions and are monochromatic in one of k colours.Since we have tk kn n rows in total, there are t rows whose chosen points appear at the same positions and use the same colour.The t × n subgrid formed by the chosen points of these t rows is monochromatic.
there exist a (d − 1)dimensional n × . . .× n grid T , and a size-n subset A 1 ⊆ [N ] such that all {i} × T with i ∈ A 1 have the same monochromatic colour.In particular, A 1 × T is a monochromatic n × . . .× n subgrid, as desired.

Proofs of the main results on monotonicity
We begin with the 2-dimensional case.We will actually prove a stronger version of Theorem 1.1 (i) as we will need it for the 3-dimensional case.
Proof.Let f be an array indexed by [N ] × [M ], where N = 4n 2 and M = (2t) 2 2n .By Erdős-Szekeres Theorem we know that in each column of f there is a monotone subsequence of length 2n.The entries of this subsequence can appear in 4n 2 2n different positions so there must be a set R ⊆ [N ] of 2n positions for which at least M/ 4n 2 2n columns are monotone when restricted to (rows) R. We take C ⊆ [N ] to be the subset of these columns for which the restriction is increasing, we may w.l.o.g.assume that C consists of at least half of these columns.We obtain a subarray f ′ = f | R×C which is increasing in each column and has size 2n × M ′ where By applying Erdős-Szekeres Theorem to the sequence given by the first row of f ′ , we can find a subset such that the first i rows of f ′ | R×C i are monotone.Continuing this process until i = 2n we obtain an 2n × t array with each row being either increasing or decreasing.By taking the ones of the type which appears more often we obtain a monotone n × t subarray as claimed.
One can easily generalise the above proof to give a bound of the form M (d, n) ≤ towr d+1 ((2+o(1))n d−1 ) for any d ≥ 2, which would already be a substantial improvement over the Ackermann bound due to Fishburn and Graham [16].However, to prove the desired and better bound M (d, n) ≤ towr 4 ((2 + o(1))n d−1 ) for d ≥ 4, we need to consider an intermediate problem which we find interesting in its own right.

Definition (Inconsistently monotone array). An array
Main difference compared with the definition of a monotone array is that we do not require all the lines along a fixed dimension to be all increasing or all decreasing but allow some to be increasing and some to be decreasing.
Proof.We will prove the following recursive bound Let there are at most m n d−1 possibilities for the location of S h .Hence, by the pigeonhole principle, we can such that f is inconsistently monotone on S × {h} for every h ∈ H. Let us denote the elements of S by s 1 , . . ., s n d−1 .By Erdős-Szekeres Theorem, we can construct a nested sequence and that {s j } × H i is monotone for j = 1, . . ., i.In particular, we have that and that the restriction of f to S × H n d−1 is inconsistently monotone.This completes the proof of (1).
What remains to be shown is that (1) implies the desired bound . We proceed by induction on d, noting that the case d = 2 follows from (1) and the fact that M ′ 1 (n) = (n−1) 2 +1.For the induction step, assuming d ≥ 3. Using (1) and the induction hypothesis we find The following definition is going to help us find a monotone array inside an inconsistently monotone array.

Definition 2.5 (Monotonicity pattern). Let
Notice that if f is a monotone array then f has the same monotonicity pattern at all points, in which case we just call it the monotonicity pattern of f .We now use Theorem 2.4 to prove Part (iii) of Theorem 1.1.
Let us colour every point in A with the monotonicity pattern of f at this point.This gives us a vertexcolouring of A with 2 d colours given by {−1, 1} d .By Lemma 2.2 and the choice of C, there exists a monochromatic n×. ..×n subgrid B of A with colour (s 1 , . . ., s d ).From the definition of the monotonicity pattern (s 1 , . . ., s d ), we can see that f | B is monotone.
In order to prove , we devise a different argument, not going through the intermediate problem of bounding M ′ d (n).
Theorem 2.7.We have ].To prove Theorem 1.1 (ii) it suffices to show that any 3-dimensional array f indexed by n2 2n different possibilities for a 2n × n2 2n × 1 monotone subarray, and the monotonicity pattern of each such subarray is a vector , by pigeonhole principle, we can find a vector s ∈ {−1, 1} 2 and three subsets such that for any h ∈ S 3 the array f | S 1 ×S 2 ×{h} is monotone with pattern s.Our remaining goal is to find an n × n subgrid of S 1 × S 2 such that for any pair (a 1 , a 2 ) of this subgrid, f (a 1 , a 2 , •) is always increasing or always decreasing on some fixed subset of size n of S 3 .
For each h ∈ S 3 , let L h = S 1 × S 2 × {h}.We can think of L h 's as "layers" stacked one on top of each other.

Given two layers L h and L h
and blue otherwise.This way we obtain a colouring of S 1 × S 2 with two colours, so by Lemma 2.1 we can find a monochromatic subgrid B hh ′ of size n × n.We now consider the following edge-colouring of the complete graph on the vertex set S 3 using k colours.We colour the edge between h and h ′ by a pair made of B hh ′ and its monochromatic colour.Since there are at most 2n From this and a result of Erdős and Rado [13, Theorem 1] on the multicolor Ramsey numbers which states that in any k-edge colouring of the complete graph on k kn many vertices contains a monochromatic K n , we deduce that our colouring contains a monochromatic K n .Let H ⊆ S 3 correspond to the vertices of this K n and let its colour correspond to an n × n subgrid B and say w.l.o.g.blue.This means that f (a 1 , a 2 , •) : H → R is increasing for all (a 1 , a 2 ) ∈ B. So by our construction of S 1 , S 2 we have that f when restricted to B × H is a monotone array of size n × n × n.
Remark.In the above proof we used the usual Ramsey theorem on our colouring of the complete graph on S 3 .However, our colouring is not arbitrary and in fact one can instead use the ordered Ramsey number of a path (see [11]).The third alternative is to only colour an edge according to B hh ′ , and record whether the values increase or decrease between B hh ′ × {h} and B hh ′ × {h ′ } by a directed edge.This gives us a colouring of a tournament in which we want to find a monochromatic directed path (see [10,19]).Both approaches give slightly better bounds than the one in Theorem 1.1 (ii), but unfortunately still give bounds of the form M 3 (n) ≤ towr 3 (O(n 2 )).

Lexicographic arrays
In this section we show our bounds on F d (n), in particular we prove Theorem 1.2.

Preliminaries
A monotone array f is said to be increasing if restriction of f to any axis parallel line is an increasing sequence (i.e.case (i) of the definition of monotonicity always occurs).More formally: The following definition generalises the notion of a lexicographic array to allow for a custom priority order of coordinates.Definition 3.2.Given a d-dimensional array f and a permutation σ ∈ S d , we say f is (lexicographic) of type σ if f (x) < f (y) ⇔ (x σ(1) , . . ., x σ(d) ) < lex (y σ(1) , . . ., y σ(d) ) for all possible x and y.
Recall that an array is said to be lex-monotone if it is possible to permute the coordinates and reflect the array along some dimensions to obtain a lexicographic array.The above definition allows us to separate these two actions.In particular, an alternative definition is that an array is lex-monotone if one can reflect the array along some dimensions to obtain a lexicographic array of some type.
Notice that any subarray of a monotone array is itself monotone and moreover has the same monotonicity pattern.This means that when looking for a lex-monotone subarray within a monotone array we can only ever find one with the same monotonicity pattern.In other words we may w.l.o.g.assume that the starting array is increasing.The following immediate lemma makes this statement formal.

2-dimensional case
Notice first that in 2 dimensions there are only two possible types of a (lexicographic) array, namely (1,2) and (2,1).See Figure 1 for an illustration of both together with an example of the arrow notation which we found useful when thinking about the problem.We begin with a proof of the upper bound F 2 (n) ≤ 2n 2 − 5n + 4 as it sheds some light to where our lower bound construction is coming from.Theorem 3.4 (Fishburn and Graham [16]).For n ∈ N we have F 2 (n) ≤ 2n 2 − 5n + 4.

Proof. Let f be an increasing array indexed by
Define a red-blue colouring of the grid {a 1 , . . ., a 2n−3 } × {a 1 , . . ., a 2n−3 } as follows.For every i, j ∈ [2n − 3], we colour (a i , a j ) red if f (a i+1 , a j ) < f (a i , a j+1 ), and blue otherwise.As (n − 2)(2n − 3) + (n − 2)(2n − 3) < (2n − 3) 2 , there exists a row with at least n − 1 red points or a column with at least n − 1 blue points.By symmetry, we can assume (a i , a j 1 ), . . ., (a i , a j n−1 ) are n − 1 red points in a row a i with j 1 < j 2 < . . .< j n−1 .One can check that the n × n subarray of f indexed by The remainder of this subsection is devoted to the proof of the lower bound F 2 (d) ≥ 2n 2 − 5n + 4. We will make ample use of the immediate observation that any subarray of a lexicographic array of type σ which has size at least 2 in each dimension must also be of type σ.We first construct a "building block" for our actual construction showing F 2 (d) ≥ 2n 2 − 5n + 4. Lemma 3.5.For n ≥ 3, there exists an increasing array g of size (n − 1)(n − 2) × (n − 1) 2 such that (G1) g does not contain an (n − 1) × 2 subarray of type (1, 2), (G2) g does not contain an n × 2 subarray of type (2, 1).
We choose an array g (see Figure 2 for an illustration), indexed by For (G1), if such a subarray exists, then at least one of C i 's would need to intersect this subarray in some 2 × 2 subarray.By the second property of g, the 2 × 2 subarray is of type (2, 1), a contradiction.
For (G2), if such a subarray exists it would intersect at least two distinct C i 's, and so it would contain a 2 × 2 subarray of type (1, 2), a contradiction.
Another building block of our construction is the following.
Let us define h to be an array indexed by [(n − 1) 2 ] × [(n − 1)(n − 2)] so that h| R i < h| R j whenever i < j and so that h| R i is of type (1, 2) (see Figure 3 for an illustration).This array satisfies the properties (H1) and (H2) by the same argument as in Lemma 3.5.We are now in a position to prove Theorem 1.2 (i).
Theorem 3.7.For n ∈ N we have Proof.It is immediate that the statement holds for n = 1, 2. We henceforth assume that n ≥ 3.
To prove the statement, it suffices to construct an increasing array f : [N ] 2 → R which does not contain an n × n subgrid of type (1,2) or (2,1).
Let g and h be arrays given by Lemma 3.5 and Lemma 3.6, respectively.The array f is chosen so that is increasing as well.It remains to show that f does not contain an n × n subarray of type (1,2) or (2,1).We will show that f has the desired property using properties (P1)-(P4) together with conditions (G1), (G2), (H1), (H2) from Lemmas 3.5 and 3.6.(1,2) or type (2,1) (as in Figure 1).Numbers denote the relative order of subarrays.

Suppose towards a contradiction that
We will obtain various inequalities involving a, b, c, x, y, z, and eventually reach a contradiction.Since L has size n × n and |J| = n − 1 we obtain We divide our analysis into two cases.
We have the following series of observations Observe that To see ( 9) if b + c = 0 then by (2) we have a = n which according to (3) implies x + y ≤ 1 so ( 7) implies (9).Similarly, to see (10) if a + b = 0 then by (2) we have c = n which according to (4) implies y + z ≤ 1 so ( 8) implies (10).
To complete our analysis of Case 1, we show a = c = 0, giving a contradiction to (2).Suppose to the contrary that a ≥ 1.Then x + y ≤ 1 by ( 9), and so z ≥ n − 1 by ( 2), which according to (5) shows giving a contradiction to (10).It remains to show that c = 0.If we instead have c ≥ 1, then (10) implies y + z ≤ 1, and so x ≥ n − 1 by ( 2), which by ( 6) implies b + c ≤ 1.Thus contradicting (10) and completing the proof in this case.
The analysis of this case is very similar to that of Case 1.We first have the following observations We next show To see ( 17) if x + y = 0 then by ( 2) we have z = n which according to ( 13) implies a + b ≤ 1 so ( 15) implies (17).Similarly, to see (18) if y + z = 0 then by ( 2) we have x = n which according to ( 14) implies b + c ≤ 1 so ( 16) implies (18).
. This completes our proof of Theorem 1.2 (i).
The example used above is partially motivated by certain examples considered in [5].This paper also considers higher dimensional examples which may be of some use in higher dimensional instances of our problem as well, but only in terms of optimizing the dependency on d.

High-dimensional case
In this subsection we prove Theorem 1.2 (ii).Our first ingredient in the proof will be the following lemma.
Lemma 3.8 (Dominant coordinate).Let d, m, t ≥ 2 be integers, and let f be an increasing array indexed by One should think of this lemma as saying that there is a dimension i such that one can find a "stack" of subgrids appearing at the same location along the remaining d − 1 dimensions and different positions along dimension i, which can be thought of as heights of the subgrids.Furthermore, the subgrids are not much smaller than the initial one in the remaining dimensions and our array is always bigger on a higher subgrid.Our proof of this lemma borrows some ideas of [16].
Proof.The proof of the lemma is in some sense a high-dimensional generalisation of the argument used to prove Theorem 3.4.We split the grid [d 2 mt] d along each coordinate into td intervals of equal size, obtaining a partition of where T = {0, dm, 2dm, . . ., (dt − 1)dm} d .The reason behind considering this is that we are now going to compare values taken by the array on certain points in u + [dm] d for each u ∈ T , and once we find the one with the largest entry, the fact that points of T are suitably spaced apart will allow us to get information about the ordering of a relatively large (d − 1)-dimensional subarray.For each i ∈ [d], the aforementioned points are given by x i and the subarrays by C i below.
Notice that x i+1 has every coordinate larger than x i , except i-th, here x d+1 := x 1 .Notice further that x i+1 ∈ C i is larger in every coordinate than any other point of C i .Similarly x i with its i-th coordinate reduced by d(m − 1) is the point of C i which is smaller than any other in every coordinate.In other words with respect to the componentwise order of [dm] d : where e i stands for the i-th unit vector (0, . . ., By pigeonhole principle, there is a colour i ∈ [d] which appears at least (td) d /d times.This implies that the grid T contains a column in the direction of the i-th coordinate for which at least t vertices of this column have colour i.We list those vertices of T from smallest to largest with respect to their i-th coordinates: u 1 , . . ., u t .
We show that the grids A 1 = u 1 + C i , . . ., A t = u t + C i have the desired properties.Indeed, (19) implies that A 1 , . . ., A t are subgrids of [d 2 mt] t .Since we have chosen u j 's as in the same column in the direction of the i-th coordinate, all of them have the same coordinates in all other dimensions.This implies that there are d − 1 sets B 1 , . . ., B i−1 , B i+1 , . . ., B d and t "heights" h 1 , . . ., h t such that A j can be written as B 1 × . . .× B i−1 × {h j } × B i+1 × . . .× B d for every 1 ≤ j ≤ t.Since C i has size (m + 1) × . . .× (m + 1) each B j has size m + 1.Finally, since f is increasing, for 1 ≤ j < k ≤ t we have The first equality follows since (20) implies u j + x i+1 is the largest point of A j so since f is increasing we conclude that f is maximised over A j at u j + x i+1 .Similarly, we get the last equality as well.The first inequality follows since χ(u j ) = i.The second inequality follows since j < k implies the i-th coordinate of u j is smaller than that of u k (since u j and u k belong to the same column along i-th dimension and since we named them according to their i-th coordinate) by at least dm (since u j , u k ∈ T ).This finishes our proof of Lemma 3.8.This lemma provides us with a stack of subgrids A 1 , . . ., A t on which f is increasing in dimension i.It is natural to try to iterate and now apply the lemma within each A j , but notice that we do not only want to find a lexicographic subgrid in some n different A j 's, but they also have to appear at the same positions in each of them.One can now apply a Ramsey result for O(2 F d−1 (n) ) colours to ensure the found subgrids appear at the same locations.Consequently, this approach gives at best Fishburn and Graham [16, Section 4] follow a similar approach and their arguments hit the same barrier in terms of the bounds they can obtain.
We take a different approach in order to prove Theorem 1.2 (ii).Proof.We prove the statement by induction on d.
The base case: n) , and N = d 2 mt = 2 n+o(n) .Consider an increasing array f : [N ] 3 → R. By Lemma 3.8, we can assume w.l.o.g. that [N ] 3 contains a stack of t subgrids We drop the third dimension from now on, and think of A i 's as 2-dimensional grids.
We split each A i into m n 2 smaller subgrids of size n × n.Colour each such smaller subgrid red if its topmost leftmost corner is smaller than bottommost rightmost, and blue otherwise.As in the proof of Theorem 3.4, any n red subgrids in the same row of A i give rise to an n × n subgrid of type (1,2).If we further manage to find n layers of the stack, each having such a sequence of the same n red n × n subgrids we obtain an n × n × n subgrid of type (3, 1, 2) (using the property that h 1 < h 2 < . . .< h t and Similarly, if we find n layers each having the same sequence of n blue n × n subgrids in the same column we find an n × n × n subgrid of type (3, 2, 1).
By pigeonhole principle, each layer A i of the stack has a row with m 2n red subgrids or a column with at least m 2n subgrids.This row or column can be chosen in 2 • m n ways, so there are nt 2m layers having in the same row/column m 2n red/blue subgrids.Let's say w.l.o.g. that it is the first row.Then, the first row of such a layer contains at least m/(2n) n tuples of n red subgrids.By pigeonhole principle, there are at least It is easy to see that the desired estimate F d (n) ≤ 2 (c d +o(1))n d−2 follows from the induction hypothesis and the following recursive bound We now prove this inequality.Let Consider an increasing array f : By Lemma 3.8, we can assume w.l.o.g. that [N ] d contains a stack of t subgrids

Concluding Remarks
We obtain a major improvement on best known upper bounds for M d (n).However, our bounds are still off from the best known lower bound of M d (n) ≥ n (1+o(1))n It is natural to ask whether our argument used to get a double exponential bound in the monotone case in 3 dimensions (Theorem 2.7) generalises to higher dimensions.Unfortunately, the natural generalisation of our approach to more dimensions gives a bound of the form M d (n) ≤ towr ⌊d/2⌋+2 (O d (n)) which has a tower of height growing with d.However, this does still imply a better bound than Theorem 2.6 in 4 and 5 dimensions.The main issue preventing us from extending our argument to more dimensions is the fact that it seems hard to obtain asymmetric results which would allow us to find a monotone subarray with exponential size in at least 2 dimensions.For example, if we could find an n × 2 n × 2 n 2 monotone subarray within any array of size we would obtain a double exponential bound M 4 (n) ≤ 2 2 O(n 3 ) .However, if we knew how to do this then by considering an array which is always increasing in the first dimension and has the same but arbitrary ordering for each 2-dimensional subarray with fixed value in the first dimension, we would also be able to get a better than double exponential bound in the 2-dimensional case, which leads us back to Question 4.1.Our better bounds in 3, 4 and 5 dimensions make it seem unlikely that a triple exponential is ever needed.For the problem of determining F d (n), we completely settle the 2-dimensional case and give exponential upper bounds for d ≥ 3. The best known lower bound F d (n) ≥ (n − 1) d , also due to Fishburn and Graham [16] is still only polynomial.We find the 3-dimensional case particularly interesting since via Lemma 3.8 it reduces to the following nice problem.In particular, is this N bounded by a polynomial in n or is it exponential in n.
The study of M d (n), F d (n) and L d (n) while interesting in its own right is also closely related to various other interesting problems.We present just a few here.

Long common monotone subsequence
The problem of estimating M 2 (n) is closely related to the longest common monotone subsequence problem.A common monotone subsequence of two permutations π, σ ∈ S N is a set I ⊆ [N ] such that the restrictions of π and σ to I are either both increasing or both decreasing.A common monotone subsequence of more than two permutations is defined analogously.Given positive integers t, k and N , let LMS(t, k, N ) denote the maximum ℓ such that any size-k multisubset P ⊆ S N contains a size-t multisubset P ′ such that the length of the longest common monotone subsequence of P ′ is at least ℓ.
We now describe the connection between M 2 (n) and LMS(t, k, N ).Let f : [N ] 2 → R be a 2-dimensional array.Similarly to the first part of the proof of Theorem 2.3, we can show that [N ] 2 contains a subgrid R × C of size (log N ) 1−o(1) × N 1−o (1) such that either f | R×C is increasing in each column, or f | R×C is decreasing in each column.For each r ∈ R, the restriction of f to the row {r} × C induces a permutation π r of C, since f is assumed to be injective.(Note that π r 's are not necessarily distinct.)It is not hard to see that if among (log N ) 1−o(1) permutations {π r : r ∈ R} of C there are n permutations whose longest common mononotone subsequence has length at least n, then f | R×C contains an n × n monotone subarray.Therefore every N × N array contains a monotone subarray of size n × n, where n is the maximum t ∈ N such that LMS(t, (log N ) 1−o (1) , N 1−o (1) ) is greater than or equal to t.By an iterative application of the Erdős-Szekeres theorem, one can take n = (1/2 − o(1)) log 2 log 2 N , or equivalently N = 2 2 (2+o(1))n .
The problem of determining the parameter LMS(t, k, N ) for other ranges of t and k is also very appealing.For example, it would be interesting to have a good estimate for LMS(t, k, N ) when t is fixed and k grows to infinity with N .We refer the reader to [3,4,7] for some related results in this direction.

Ramsey type problems for vertex-ordered graphs
One can place the problems we have studied in this paper under the framework of (vertex-)ordered Ramsey numbers.For simplicity of presentation we choose to illustrate this through the 2-dimensional monotone subarray problem.Let K Given positive integers d and n, let L d (n) denote the minimum N such that for any d-dimensional array of size N × . . .× N , one can find a lex-monotone subarray of size n × . . .× n.Fishburn and Graham[16, Theorem 1] ))n d−2 for d ≥ 3, where c d = 1 2 (d − 1)! and the term o(1) tends to 0 as n → ∞.Part (i) of Theorem 1.2 answers a question of Fishburn and Graham asking whether F 2 (n) = (1 + o(1))n 2 , in negative.Combining Theorems 1.1 and 1.2 with the inequality L d (n) ≤ M d (F d (n)) gives the following upper bounds on L d (n).Theorem 1.3.
and we write a(n) = o(b(n)) to mean that a(n)/b(n) → 0 as n → ∞.All asymptotics are as n → ∞.Given d ∈ N, we denote the set of all permutations of [d] by S d .For real numbers α and β, we employ the interval notation [α, β] := {x ∈ Z : α ≤ x ≤ β}.

Lemma 2 . 2 . 2 .
Given integers d, k ≥ 2 there exists a positive constant C = C(d, k) such that for any positive integers n and N with N ≥ 2 Cn d−1 , in any k-colouring of the d-dimensional N × . . .× N grid there is a monochromatic subgrid of size n × . . .× n.Proof.Choose constants C(d, k) so that C(2, k) = 2 log 2 (ek), and C(d, k) = 2(d − 1)C(d − 1, k) for every d ≥ We prove the lemma by induction on d.For d = 2, since N ≥ 2 C(2,k)n = (ek) 2n ≥ nk nk n , the statement follows from Lemma 2.1.We proceed to the case d > 2, and suppose that the lemma holds for d − 1. Letting M = 2 C(d−1,k)n d−2 , we will show that any k-colouring of the d-dimensional grid [N ] × [M ] × . . .× [M ] contains a monochromatic n × . . .× n subgrid.For each i ∈ [N ], define S i = {i} × [M ] × . . .× [M ].By the induction hypothesis, each S i contains a monochromatic subgrid {i} × T i of size 1 × n × . . .× n.There are at most M n d−1 ≤ M (d−1)n possibilities for T i , and each T i uses one of the k colours.Hence, noting that For positive integers d and n, let M ′ d (n) denote the minimum N such that for any d-dimensional array of size N × . . .× N , one can find a d-dimensional inconsistently monotone subarray of size n × . . .× n.We have M ′ 1 (n) = (n − 1) 2 + 1 according to Erdős-Szekeres Theorem.When d ≥ 2 we obtain the following improved version of Theorem 1.1 for inconsistently monotone arrays.Theorem 2.4.For every d ≥ 2, we have

Lemma 3 . 3 .
For every d, n ∈ N, F d (n) equals the minimum N such that any increasing d-dimensional array of size N × . . .× N contains an n × . . .× n subarray of type σ for some σ ∈ S d .

Figure 2 :
Figure 2: An illustration of the array g.Directed arrows point towards a position with a larger value of g.Numbers denote relative order of subarrays.

Figure 3 :
Figure 3: An illustration of the array h.Directed arrows point towards a position with a larger value of h.Numbers denote relative order of subarrays.
we also find that (P1) Any 2 × 2 subarray with two vertices in A 1 and two vertices to the right of A 1 is of type (1,2), (P2) Any 2 × 2 subarray with two vertices in A 5 and two vertices to the left of A 5 is of type (1,2), (P3) Any 2 × 2 subarray with two vertices in A 2 and two vertices above A 2 is of type (2,1), (P4) Any 2 × 2 subarray with two vertices in A 4 and two vertices below A 4 is of type (2,1).

3 A 2 A 4 Figure 4 :
Figure 4: Directed arrows point towards a larger value of f and indicate whether the given subarray is of type(1,2) or type (2,1) (as in Figure1).Numbers denote the relative order of subarrays.

Figure 5 :
Figure 5: Lightly shaded (d − 1)-dimensional regions in the figure denote C i 's with their maximum point being x i+1 .Depending on which of the x i 's has largest value of f one of these C i 's has value of f on x i smaller than that of f on the minimal point of a translate of C i (strongly shaded region of the same colour) at x i .
same red n-tuples, as desired.The induction step: suppose d ≥ 4 and that the lemma holds for d − 1.

Question 4 . 1 .
d−1 /d due to Fisburn and Graham [16, Theorem 3].Perhaps the most interesting open question regarding M d (n) is to determine the behaviour in 2 dimensions.What is the behaviour of M 2 (n)?Is it closer to exponential or to double exponential in n?

Question 4 . 2 .
For d ≥ 4 is M d (n) bounded from above by a double exponential in n d−1 ?

Question 4 . 3 .
What is the smallest N such that given N increasing arrays of size N × N one can find an n × n lexicographic array of the same type appearing in the same positions in at least n of the arrays?

( 3 )
N,N be the 3-uniform hypergraph with vertex set A ∪ B, where A and B are two copies of [N ], and edge set consisting of all those triples which intersect both A and B. Given an array n d correspond in the obvious way to vertices of the d-dimensional grid [n 1 ] × . . .× [n d ].Subhypergraphs of K ,...,m d then correspond to subgrids of [n 1 ] × . . .× [n d ] of size m 1 × . . .× m d .Using this correspondence, one can derive Lemmas 2.1 and 2.2 from known results on (hyper)graph Zarankiewicz problem.For example, Lemma 2.1 follows from [18, Theorem 2], while Lemma 2.2 is a consequence of [12, Theorem 4].