1 Introduction

An ordered k-uniform hypergraph H is a hypergraph whose vertices have a fixed ordering. The ordered Ramsey number \(R_{<}(G,H)\) of ordered k-uniform hypergraphs G and H is the minimum N such that every red/blue edge-coloring of the complete k-uniform hypergraph on \(\{1, \dots , N\}\) has a red copy of G or a blue copy of H whose vertices appear in the correct ordering. One of the most well-studied hypergraphs in this context is the monotone tight path \(P_n^{(k)}\), which is the ordered k-uniform hypergraph with vertices \(1,\dots ,n\) and edges \((i,i+1,\dots ,i+k-1)\) for \(i = 1,\dots ,n-k+1\). We also write \(P_n:= P_n^{(2)}\) for the monotone graph path with n vertices.

The study of ordered Ramsey numbers dates back to the very beginning of Ramsey theory, as some of the most foundational theorems in the field fall into this framework. A key example is the celebrated Erdős–Szekeres lemma [7], whose proof gives \(R_{<}(P_s,P_n) = R_{<}(K_s,P_n) = (s-1)(n-1)+1\).

A central feature of ordered Ramsey problems is that they often originate from and have implications for problems in geometry. For example, the famous Erdős–Szekeres cups-caps theorem [7] was used by Erdős and Szekeres (in the same paper [7]) to prove the so-called Happy Ending Theorem, stating that every set of \(\left( {\begin{array}{c}2n-4\\ n-2\end{array}}\right) + 1\) points in the plane in general position contains n points in convex position. Moshkovitz and Shapira [12] observed that the cups-caps theorem is a corollary of their result that \(R_{<}(P_s^{(3)},P_n^{(3)}) = \left( {\begin{array}{c}s+n-4\\ s-2\end{array}}\right) + 1\).

The happy ending theorem was later extended by several authors by replacing “points" with “convex bodies". For example, Pach and Tóth [17] showed that there is \(N = N(n)\) such that every family of N convex bodies in the plane in general position, with any two bodies having at most two common boundary points, contains n bodies in convex position. Fox, Pach, Sudakov and Suk [8] observed that this problem is related to the 3-color Ramsey number of \(P_n^{(3)}\), and used this connection to improve the best known bound for such an N(n). This led to the further study of the multicolor Ramsey number of \(P_n^{(k)}\), and this Ramsey number was determined exactly by Moshkovitz and Shapira [12] and Milans, Stolee and West [11].

Another motivation for studying Ramsey numbers of monotone tight paths comes from the work of Mubayi and Suk [14], who observed that the k-uniform Ramsey number \(R_{<}(P_s^{(k)},K_n^{(k)})\) is closely related to the multicolor \((k-1)\)-uniform Ramsey number of cliques. Proving tight bounds for the latter is one of the major open problems in Ramsey theory (see [18] and its references for the latest results for the graph case, i.e., \(k=3\)).

A systematic study of ordered Ramsey numbers of graphs was initiated by Conlon et al. [4] and Balko et al. [1]. One of the main problems considered in these works is the Ramsey problem for powers of paths. Let \(P_n^t\) denote the t’th power of \(P_n\), namely, the ordered graph with vertices \(1,\dots ,n\) and edge-set \(\{(i,j): i < j \le i+t\}\). Note that for \(P^1_n = P_n\), the Erdős–Szekeres lemma gives \(R_{<}(K_s,P_n^1) = (s-1)(n-1)+1\), which is linear in n for fixed s. Mubayi and Suk [16] recently conjectured that \(R_{<}(K_s,P_n^t)\) remains linear in n for all fixed st, and proved the bound \(R_{<}(K_{s},P_n^t) = O_{s,t}(n \log ^{s-2}n)\). Here, we confirm their conjecture, which can be seen as an extension of the Erdős–Szekeres lemma.

Theorem 1.1

For \(s,t \ge 1\) and \(n > t\), it holds that \(R_{<}(K_{s+1},P_n^t) \le (24\,s^3)^{st} n\).

Mubayi and Suk [16] also considered the “diagonal case" of \(P_n^t\) versus \(K_n\), and proved the quasipolynomial bound \(R_{<}(P_n^t,K_n) \le 2^{O_t(\log ^2 n)}\). Here we improve this to a polynomial bound.

Theorem 1.2

For \(t \ge 2\) and \(n > t\), it holds that \(R_{<}(P_n^t,K_n) \le 2^{2t-1}n^{t(2t-1)}\).

It is easy to see that this Ramsey number is at least \(R(K_{t+1},K_n) \ge {\tilde{\Omega }}(n^{(t+2)/2})\) (see [2, 19]), and therefore the exponent of n should grow in terms of t. It is worth mentioning that powers of paths have also been studied in the context of tournaments. For example, Draganić et al. [5] showed that any tournament on n vertices contains the t’th power of a directed path on \(\Omega _t(n)\) vertices.

The dependence on t of the exponent of n in the previous result can be further improved from quadratic to linear if instead of \(K_n\) one takes the second graph to also be the path-power \(P_n^t\). This problem was first considered by Conlon et al. [4], who conjectured that the Ramsey number \(R_{<}(P_n^t,P_n^t)\) is polynomial in n. Their actual question concerned graphs with bounded bandwidth. But since every n-vertex ordered graph with bandwidth t is a subgraph of \(P_n^t\), this question reduces to the above conjecture. Balko et al. [1] proved the conjecture by showing that \(R_{<}(P_n^t,P_n^t) = O_t(n^{129t})\). In the case \(t=2\), Mubayi [13] improved the bound to \(R_{<}(P_n^2,P_n^2) = O(n^{19.5})\). Here we obtain the improved bound \(R_{<}(P_n^t,P_n^t) = O_t(n^{4t-2})\). For \(t=2\) this gives \(R_{<}(P_n^2,P_n^2) = O(n^6)\). In fact, Theorem 1.2 gives \(R_{<}(P_n^2,K_n) \le 8n^6\).

Theorem 1.3

For \(t \ge 1\) and \(n > t\), it holds that \(R_{<}(P_n^t,P_n^t) \le (400t^3)^{t^2}n^{4t-2}. \)

We now move on to 3-uniform hypergraphs. Mubayi [13] showed that \(R_{<}(K_4^{(3)}{,}P_n^{(3)})\le O(n^{21})\) and conjectured that \(R_{<}(K_s^{(3)},P_n^{(3)})\) is polynomial in n for every fixed s. This conjecture was also reiterated by Mubayi and Suk [15]. Very recently, they [16] proved the quasipolynomial bound \(R_{<}(K_s^{(3)},P_n^{(3)}) \le 2^{O_s(\log ^2 n)}\). Here we prove a polynomial bound, establishing Mubayi’s conjecture.

Theorem 1.4

For every \(s \ge 3\), there is a constant \(C = C(s)\) such that \(R_{<}(K_s^{(3)},P_n^{(3)}) \le C \cdot n^{C}\).

We will derive Theorem 1.4 from another result which might be of independent interest. It can be viewed as an ordered version of the celebrated Canonical Ramsey Theorem of Erdős and Rado [6] (here “ordered" refers to an order on the colors, as we shall see). To state our theorem, we need the following definition:

Definition 1.5

Let \(\chi : \left( {\begin{array}{c}N\\ 2\end{array}}\right) \rightarrow {\mathbb {N}}\). A set \(x_1< \dots < x_s\) is lexicographic if there are colors \(c_1,\dots ,c_{s-1} \in {\mathbb {N}}\) such that one of the following holds:

  1. 1.

    \(\chi (x_i,x_j) = c_i\) for all \(1 \le i < j \le s\).

  2. 2.

    \(\chi (x_i,x_j) = c_{j-1}\) for all \(1 \le i < j \le s\).

The canonical Ramsey theorem [6] states that for every s, there is \(N = N(s)\) such that in every edge-coloring of \(K_N\) (with any number of colors), there is a clique of size s which is either monochromatic, rainbowFootnote 1 or lexicographic. It is natural to restrict the number of colors to say n, and ask how large N should be to guarantee a lexicographic s-clique. It is not hard to see that \(N = 1+\sum _{i=0}^{s-2}n^i = O(n^{s-2})\) vertices are enough for n colors. Indeed, the first vertex has degree at least \(1+\sum _{i=0}^{s-3}n^i\) in one of the n colors, and one can then apply induction in its neighbourhood. Observe also that by combining this argument with the Erdős–Szekeres lemma, one can make sure that the sequence of colors \(c_1,\dots ,c_{s-1}\) (from Definition 1.5) is monotone, namely that \(c_1 \ge \dots \ge c_{s-1}\) or \(c_1 \le \dots \le c_{s-1}\). Indeed, taking \(N = O\big (n^{(s-1)^2}\big )\), one first finds a lexicographic set of size \(t = (s-1)^2+2\), and then applies the Erdős–Szekeres lemma to \(c_1,\dots ,c_{t-1}\). The question becomes much more interesting, however, if one requires that \(c_1 \ge \dots \ge c_{s-1}\). In this case we say that the lexicographic set is non-increasing. The following theorem shows that polynomially many vertices are still enough to find such a set. This can be viewed as an ordered version of the canonical Ramsey theorem.

Theorem 1.6

For every \(s \ge 2\), there is a constant \(C = C(s)\) such that every \(\chi : \left( {\begin{array}{c}N\\ 2\end{array}}\right) \rightarrow [n]\), \(N = C n^C\), admits a lexicographic non-increasing set of size s.

The idea of using non-increasing sets to bound \(R_{<}(K_s^{(3)},P_n^{(3)})\) is due to Mubayi and Suk [16], see Sect. 2 for the details.

The rest of this paper is organized as follows. Theorems 1.4 and 1.6 are proved in Sect. 2. Theorems 1.2 and 1.3 are proved in Sect. 3. The proof of Theorem 1.1 is given in Sect. 4, and the last section contains some concluding remarks and open problems.

Notation: For two subsets of vertices AB in an ordered graph, we write \(A < B\) if \(a < b\) for all \(a \in A, b \in B\).

2 Proof of Theorem 1.4 and 1.6

Throughout this section, we consider functions \(\chi : \left( {\begin{array}{c}N\\ 2\end{array}}\right) \rightarrow [n]\). We now define the notion of a non-increasing set, which plays a key role throughout this section.

Definition 2.1

Let \(\chi : \left( {\begin{array}{c}N\\ 2\end{array}}\right) \rightarrow [n]\). A triple \(x<y<z\) is called non-increasing if \(\chi (x,y) \ge \chi (y,z)\), and moreover \(\chi (x,z) = \chi (x,y)\) or \(\chi (x,z) = \chi (y,z)\). A set \(x_1< \dots < x_s\) is called non-increasing if every triple \(x_i,x_j,x_k\), \(1 \le i< j < k \le s\), is non-increasing.

Let g(ns) be the minimum N such that in every coloring \(\chi : \left( {\begin{array}{c}N\\ 2\end{array}}\right) \rightarrow [n]\), there is a non-increasing set of size s. The following was observed by Mubayi and Suk [16] and was their motivation for studying non-increasing sets. For completeness, we include the proof.

Proposition 2.2

[16] For all \(s,n \ge 3\), it holds that \(R_{<}(K_s^{(3)},P^{(3)}_n) \le g(n-2,s)\).

Proof

Fix a red/blue coloring of \(K_N^{(3)}\), \(N = g(n-2,s)\), and suppose that there is no blue monotone tight path with n vertices. For each pair of vertices \(x<y\), let \(\chi (x,y)\) be the largest number of vertices in a blue monotone tight path ending at xy. So \(2 \le \chi (x,y) \le n-1\). Observe that if \(x< y < z\) with xyz blue, then \(\chi (x,y) < \chi (y,z)\), because we can extend any longest path ending at xy with the edge xyz. Hence, a non-increasing set must be a red clique. Observe that there are \(n-2\) possible values of \(\chi (x,y)\)’s. By the definition of \(g(n-2,s)\), there is a red clique of size s. \(\square \)

Remark 2.3

We note that the proof of Proposition 2.2 only uses that a non-increasing triple xyz satisfies \(\chi (x,y) \ge \chi (y,z)\), but does not use the full definition of a non-increasing triple. Thus, one can replace \(g(n-2,s)\) with the analogous function corresponding to this weaker notion of being non-increasing (only requiring \(\chi (x,y) \ge \chi (y,z)\)), and potentially get stronger bounds on \(R_{<}(K_s^{(3)},P^{(3)}_n)\) via Proposition 2.2. Still, we decided to stick to the stronger notion given in Definition 2.1, because we do not know of better bounds for the weaker notion of g-function (for general s), and also because the stronger notion is needed to prove Theorem 1.6.

We will now prove the following theorem, which together with Proposition 2.2 implies Theorem 1.4.

Theorem 2.4

For every \(s \ge 2\), there is a constant \(C = C(s)\) such that \(g(n,s) \le C \cdot n^C\).

To prove Theorem 2.4, we need to find a non-increasing set of size s. The proof is via induction on s, and to this end, it turns out to be convenient to find the following bigger structure. For \(s \ge 2, t \ge 1\), let \(H_{s,t}\) be the ordered graph with vertices \(x_1< \dots< x_s = y_1< \dots < y_t\) such that \(\{x_1,\dots ,x_s\}\) is non-increasing, \((y_1,\dots ,y_t)\) is a monotone path, and \(\chi (x_{s-1},x_s) \ge \chi (y_1,y_2) \ge \dots \ge \chi (y_{t-1},y_t)\). Let f(nst) be the minimum N such that every n-coloring \(\chi \) of the edges of \(K_N\) admits a copy of \(H_{s,t}\). As \(H_{s,1}\) is just a non-increasing s-set, it holds that \(f(n;s,1) = g(n,s)\). The following gives a recursive bound on f(nst).

Lemma 2.5

For \(s \ge 3, t \ge 1\), it holds that \(f(n;s,t) \le f(n;s-1,t+1)^{s+t} \cdot n^{s-1}\).

Proof

Put \(M = f(n;s-1,t+1)\) and \(N = M^{s+t}n^{s-1}\), and fix a coloring \(\chi : \left( {\begin{array}{c}N\\ 2\end{array}}\right) \rightarrow [n]\). Put \(h = s+t-1 = |V(H_{s-1,t+1})|\). We use a standard double-counting (supersaturation) argument to argue that there are many copies of \(H_{s-1,t+1}\). Indeed, by definition, every M vertices contain a copy of \(H_{s-1,t+1}\). There are \(\left( {\begin{array}{c}N\\ M\end{array}}\right) \) subsets of size M, each of which contains a copy of \(H_{s-1,t+1}\), and every copy of \(H_{s-1,t+1}\) is contained in \(\left( {\begin{array}{c}N-h\\ M-h\end{array}}\right) \) such subsets. Thus, by double-counting, there are at least \(\frac{\left( {\begin{array}{c}N\\ M\end{array}}\right) }{\left( {\begin{array}{c}N-h\\ M-h\end{array}}\right) } = \frac{\left( {\begin{array}{c}N\\ h\end{array}}\right) }{\left( {\begin{array}{c}M\\ h\end{array}}\right) } \ge (N/M)^h\) copies of \(H_{s-1,t+1}\). By the pigeonhole principle, there is a choice of colors \(\alpha _1,\dots ,\alpha _{s-2},\beta \in [n]\), and a set \({\mathcal {H}}\) of at least \(\frac{N^h}{M^h n^{s-1}}\) copies \((x_1,\dots ,x_{s-1}=y_1,\dots ,y_{t+1})\) of \(H_{s-1,t+1}\), with the property that \(\chi (x_i,x_{s-1}) = \alpha _i\) for every \(1\le i\le s-2\), and \(\chi (y_1,y_2) = \beta \). By the definition of \(H_{s-1,t+1}\), \(\chi (x_{s-2},x_{s-1})\ge \chi (y_1,y_2)\) and the triple \(x_i,x_{i+1},x_{s-1}\) is non-increasing for all \(1 \le i \le s-3\). Thus, \(\alpha _1 \ge \alpha _2 \ge \dots \ge \alpha _{s-2}\ge \beta \). By averaging, there is a choice of \(x_1,\dots ,x_{s-2},y_2,\dots ,y_{t+1}\) and a set X of size \(|X| \ge \frac{N}{M^h n^{s-1}} = M\), such that vspace*-3pt \((x_1,\dots ,x_{s-2},x,y_2,\dots ,y_{t+1}) \in {\mathcal {H}}\) for all \(x \in X\). By the definition of M, X contains a copy of \(H_{s-1,t+1}\), say on the vertices \(u_1,\dots ,u_{s-1}=v_1,\dots ,v_{t+1}\). We now consider two cases:

Case 1: \(\chi (v_1,v_2) \le \beta \). Then, we have \(\alpha _{s-2} \ge \beta \ge \chi (v_1,v_2) \ge \dots \ge \chi (v_t,v_{t+1})\). We claim that \(x_1,\dots ,x_{s-2},v_1,v_2,v_3,\dots ,v_{t+1}\) form a copy of \(H_{s,t}\) with s-clique \(\{x_1,\dots ,x_{s-2},v_1,v_2\}\) and path \(v_2,\dots ,v_{t+1}\). It suffices to show that \(\{x_1,\dots ,x_{s-2},v_1,v_2\}\) is non-increasing. For convenience, write \(x_{s-1}:= v_1\) and \(x_s:= v_2\). Let \(1 \le i< j < k \le s\). If \((j,k) \ne (s-1,s)\), then \(x_i,x_j,x_k\) is non-increasing because \(\{x_1,\dots ,x_{s-2},v_1\}\) and \(\{x_1,\dots ,x_{s-2},v_2\}\) are non-increasing, as \(v_1,v_2 \in X\). And for \((j,k) = (s-1,s)\), we have \(\chi (x_i,x_{s-1}) = \chi (x_i,x_s) = \alpha _i\) and \(\chi (x_{s-1},x_s) = \chi (v_1,v_2) \le \beta \le \alpha _{s-2} \le \alpha _{i}\), meaning that \(x_i,x_{s-1},x_s\) is non-increasing.

Case 2: \(\chi (v_1,v_2) \ge \beta \). Then \(\chi (u_{s-2},u_{s-1}) \ge \chi (v_1,v_2) \ge \beta \), where the first inequality is by the definition of \(H_{s-1,t+1}\). Also, \(\chi (u_i,y_2) = \beta \) for all \(1 \le i \le s-1\) because \(u_1,\dots ,u_{s-1} \in X\). We claim that \(u_1,\dots ,u_{s-1},y_2,y_3,\dots ,y_{t+1}\) make a copy of \(H_{s,t}\) with s-clique \(\{u_1,\dots ,u_{s-1},y_2\}\) and path \(y_2,\dots ,y_{t+1}\). First, note that \(\chi (u_{s-1},y_2) = \beta \ge \chi (y_2,y_3) \ge \dots \ge \chi (y_t,y_{t+1})\). So it remains to check that \(\{u_1,\dots ,u_{s-1},y_2\}\) is non-increasing. For convenience, write \(u_s:= y_2\). Let \(1 \le i< j < k \le s\). If \(k \le s-1\), then the triple \(u_i,u_j,u_k\) is non-increasing because \(\{u_1,\dots ,u_{s-1}\}\) is non-increasing (by the definition of \(H_{s-1,t+1}\)). And for \(k=s\), we have \(\chi (u_i,u_s) = \chi (u_j,u_s) = \beta \) and \(\chi (u_i,u_j) \ge \chi (u_i,u_{s-1}) \ge \chi (u_{s-2},u_{s-1}) \ge \beta \), where the first two inequalities use that the triples \(\{u_i,u_j,u_{s-1}\}\) and \(\{u_i,u_{s-2},u_{s-1}\}\) are non-increasing. This completes the proof of the lemma. \(\square \)

The following theorem implies Theorem 2.4, as \(f(n;s,1) = g(n,s)\).

Theorem 2.6

For every \(s \ge 2, t \ge 1\), there is a constant \(C = C(s,t)\) such that \(f(n;s,t) \le O_{s,t}(n^C)\). Moreover, one can take \( C(s,t) = (s+t)^{s-1} - 3(s+t)^{s-2} + \sum _{i=0}^{s-3}(s-1-i)(s+t)^i. \)

Proof

The proof is by induction on s, starting with the base case \(s=2\). Observe that \(H_{2,t}\) is just a monotone path of length t with non-increasing \(\chi \)-labels. By a result of Chvatal and Komlós [3], in every edge-coloring \(\chi \) of an ordered \(K_N\), \(N > \left( {\begin{array}{c}p+q-2\\ p-1\end{array}}\right) \), there are vertices \(y_1< \dots < y_{p+1}\) with \(\chi (y_1,y_2) \ge \chi (y_2,y_3) \ge \dots \ge \chi (y_p,y_{p+1})\) or vertices \(y_1< \dots < y_{q+1}\) with \(\chi (y_1,y_2)< \chi (y_2,y_3)< \dots < \chi (y_q,y_{q+1})\). Apply this with \(p=t, q=n+1\), assuming \(N > \left( {\begin{array}{c}n+t-1\\ t-1\end{array}}\right) \). The second outcome is impossible because there are only n colors. And the first outcome gives a copy of \(H_{2,t}\). Hence, we can take \(C(2,t) = t-1\) for all \(t \ge 1\). It is easy to see that this coincides with the choice of C(st) in the statement of the theorem.

Now let \(s \ge 3\). By Lemma 2.5 and the induction hypothesis, we have

$$\begin{aligned} f(n;s,t) \le f(n;s-1,t+1)^{s+t} \cdot n^{s-1} \le O_{s,t}\!\left( n^{(s+t) \cdot C(s-1,t+1) + s-1} \right) , \end{aligned}$$

so one can take \(C(s,t) = (s+t) \cdot C(s-1,t+1) + s - 1\). It is easy to check that the choice of C(st) in the statement of the theorem also satisfies this recursion. \(\square \)

Next we prove Theorem 1.6. This theorem follows by combining Theorem 2.4 with the following proposition:

Proposition 2.7

For \(s \ge 3\), every non-increasing set of size \(2^{2s-3}\) contains a lexicographic set of size s.

It remains to prove Proposition 2.7. To this end, we need the following recursive definition.

Definition 2.8

(weakly lexicographic) A set of size two is weakly lexicographic. For \(s \ge 3\), a set \(x_1< \dots < x_s\) is weakly lexicographic if one of the following holds:

  1. 1.

    There is a color \(c \in [n]\) such that \(\chi (x_1,x_i) = c\) for all \(2 \le i \le s\), and \(x_2,\dots ,x_s\) is weakly lexicographic.

  2. 2.

    There is a color \(c \in [n]\) such that \(\chi (x_i,x_s) = c\) for all \(1 \le i \le s-1\), and \(x_1,\dots ,x_{s-1}\) is weakly lexicographic.

Let us say that a set \(x_1< \dots < x_s\) is forward lexicographic if \(x_1,\dots ,x_s\) satisfies Item 1 in Definition 1.5, i.e., if there are colors \(c_1,\dots ,c_{s-1}\) such that \(\chi (x_i,x_j)=c_i\) for all \(1 \le i < j \le s\). Similarly, \(x_1,\dots ,x_s\) is backward lexicographic if \(x_1,\dots ,x_s\) satisfies Item 2 in Definition 1.5, i.e., if there are colors \(c_1,\dots ,c_{s-1}\) such that \(\chi (x_i,x_j)=c_{j-1}\) for all \(1 \le i < j \le s\). By definition, \(x_1,\dots ,x_s\) is lexicographic if and only if it is forward lexicographic or backward lexicographic. Thus, the following lemma shows that every weakly lexicographic set contains a large lexicographic subset.

Lemma 2.9

Let \(s,t \ge 2\). Every weakly lexicographic set of size \(s+t-2\) contains a forward lexicographic set of size s or a backward lexicographic set of size t.

Proof

By induction on \(s+t\). The base case is \(s=2\) or \(t=2\). This case is evident because every set of size 2 is both forward and backward lexicographic. Suppose now that \(s,t \ge 3\). Let \(x_1< \dots < x_{s+t-2}\) be a weakly lexicographic set. Suppose without loss of generality that Item 1 in Definition 2.8 holds. By induction, \(x_2,\dots ,x_{s+t-2}\) contains a forward lexicographic set of size \(s-1\) or a backward lexicographic set of size t. In the latter case, we are done; in the former case, by adding \(x_1\) we get a forward lexicographic set of size s (so again we are done). \(\square \)

Lemma 2.10

Every non-increasing set of size \(2^{s-1}\) contains a weakly lexicographic set of size s.

Proof

By induction on s. For \(s=2\) this is clear. Let \(s \ge 3\) and let \(x_1< \dots < x_k\), be a non-increasing set with \(k = 2^{s-1}\). For each \(2 \le i \le k-1\), it holds that \(\chi (x_1,x_i) = \chi (x_1,x_k)\) or \(\chi (x_i,x_k) = \chi (x_1,x_k)\) because the triple \(x_1,x_i,x_k\) is non-increasing. Suppose, without loss of generality, that at least \((k-2)/2= 2^{s-2}-1\) of the \(2 \le i \le k-1\) satisfy \(\chi (x_1,x_i) = \chi (x_1,x_k) =: c\). Let I be the set consisting of these \(2 \le i \le k-1\) and the element k. Then \(\chi (x_1,x_i) = c\) for all \(i \in I\), and \(|I| \ge 2^{s-2}\). By induction, \(\{x_i: i \in I\}\) contains a weakly lexicographic set of size \(s-1\), which together with \(x_1\) forms a weakly lexicographic set of size s. \(\square \)

Proposition 2.7 follows by combining Lemmas 2.9 and 2.10 (where we apply Lemma 2.9 with \(s=t\)).

3 Proof of Theorem 1.2 and 1.3

Definition 3.1

(t-clique chain) In an ordered graph, a t-clique chain consists of t-cliques (cliques of size t) \(X_1,\dots ,X_m\) such that for every \(1 \le i \le m-1\), \(|X_i \cap X_{i+1}| = 1\) and the last element of \(X_i\) is the first element of \(X_{i+1}\).

See Fig. 1 for an example of a 4-clique chain.

Fig. 1
figure 1

An example of a 4-clique chain \(X_1,\dots ,X_5\)

Lemma 3.2

For \(n,m,t \ge 1\), the following holds:

  1. 1.

    Every red/blue edge-coloring of \(K_N\), \(N = (R(K_t,K_t) - 1) \cdot m^2 + 1\), contains a monochromatic t-clique chain with m cliques.

  2. 2.

    Every red/blue edge-coloring of \(K_N\), \(N = (R(K_t,K_n) - 1) \cdot m + 1\), contains a blue \(K_n\) or a red t-clique chain with m cliques.

Proof

We first prove Item 1. Suppose that the assertion does not hold. For each vertex v, let \(\chi _r(v)\) (resp. \(\chi _b(v)\)) be the largest number of t-cliques in a red (resp. blue) t-clique chain ending at v. Then \(0 \le \chi _r(v),\chi _b(v) \le m-1\) for all v. By the pigeonhole principle, there are values \(0 \le c_r,c_b \le m-1\) and a set U with \(|U| \ge N/m^2 > R(K_t,K_t)-1\), such that \(\chi _r(v) = c_r\) and \(\chi _b(v) = c_b\) for all \(v \in U\). As \(|U| \ge R(K_t,K_t)\), there is a monochromatic t-clique \(x_1<\dots <x_t\) in U. Suppose without loss of generality that this clique is red. Then \(\chi _r(x_t) > \chi _r(x_1)\), because any longest red t-clique chain ending at \(x_1\) can be extended using the t-clique \(\{x_1,\dots ,x_t\}\). This is a contradiction to \(\chi _r(x_1) = \chi _r(x_t) = c_r\).

The proof of Item 2 is similar to that of Item 1. Suppose that the statement does not hold, and let \(0 \le \chi _r(v) \le m-1\) be defined as above. By the pigeonhole principle, there is \(0 \le c_r \le m-1\) and a vertex-set U, \(|U| \ge N/m\), such that \(\chi _r(v) = c_r\) for all \(v \in U\). We have \(|U| \ge R(K_t,K_n)\) by the choice of N. If U contains a blue \(K_n\) then we are done, and else U contains a red t-clique \(x_1< \dots < x_t\). As in the previous item, we have \(\chi _r(x_t) > \chi _r(x_1)\), in contradiction to \(\chi _r(x_1) = \chi _r(x_t) = c_r\). \(\square \)

Proof of Theorem 1.3

Put \(R = R(K_t,K_t)\) and \(N = 2R^{2t-1}n^{4t-3} \cdot R_<(K_t,P_n^t)\), and note that \(N < (400t^3)^{t^2}n^{4t-2}\), using Theorem 1.1 and \(R(K_t,K_t) \le 4^t\). Fix a red/blue coloring of \(K_N\), and suppose by contradiction that there is no monochromatic copy of \(P_n^t\). For each monochromatic t-clique \(x_1,\dots ,x_t\), let \(\chi (x_1,\dots ,x_t)\) be the largest \(\ell \) such that there is a monochromatic \(P_\ell ^t\) which ends at \(x_1,\dots ,x_t\). Then \(t \le \chi (x_1,\dots ,x_t) \le n-1\). A good pair is a pair of monochromatic t-cliques XY in the same color, such that the last element of X is the first element of Y, and \(\chi (X) \ge \chi (Y)\).

Claim 3.3

There are at least \(\frac{N^{2t-1}}{R^{2t-1}n^{4t-4}}\) good pairs.

Proof

First, we observe that every set of \((R-1) n^2+1\) vertices contains a good pair. Indeed, by Item 1 of Lemma 3.2, every \((R-1) n^2 +1\) vertices contain a monochromatic t-clique chain with n cliques \(X_1,\dots ,X_{n}\). There must exist an \(1 \le i \le n-1\) such that \(\chi (X_i) \ge \chi (X_{i+1})\), because \(\chi (X_i) \in \{1,2,\dots ,n-1\}\) for every i. Then \((X_i,X_{i+1})\) is a good pair.

Now, every set of \(Rn^2\) vertices contains at least \(n^2\) good pairs (by repeatedly finding a good pair and deleting one of its vertices). By double counting, there are at least

$$\begin{aligned} n^2 \cdot \frac{\left( {\begin{array}{c}N\\ Rn^2\end{array}}\right) }{\left( {\begin{array}{c}N-2t+1\\ Rn^2-2t+1\end{array}}\right) } = n^2 \cdot \frac{\left( {\begin{array}{c}N\\ 2t-1\end{array}}\right) }{\left( {\begin{array}{c}Rn^2\\ 2t-1\end{array}}\right) } \ge \frac{N^{2t-1}}{R^{2t-1}n^{4t-4}} \end{aligned}$$

good pairs. \(\square \)

By Lemma 3.3 and averaging, there are vertices \(x_1< \dots< x_{t-1}< z_1< \dots < z_{t-1}\) and a set \(Y'\) of vertices \(x_{t-1}< y < z_1\) such that \(|Y'| \ge \frac{N}{R^{2t-1}n^{4t-4}} \ge 2n \cdot R_<(K_t,P_n^t)\), and such that for every \(y \in Y'\), \(\{x_1,\dots ,x_{t-1},y\}\) and \(\{y,z_1,\dots ,z_{t-1}\}\) form a good pair. Without loss of generality, for at least half of the vertices \(y \in Y'\), the t-cliques \(\{x_1,\dots ,x_{t-1},y\},\{y,z_1,\dots ,z_{t-1}\}\) are red. Also, by the pigeonhole principle over the value of \(\chi \), there exists a set \(Y \subseteq Y'\), \(|Y| \ge |Y'|/(2n) = R_<(K_t,P_n^t)\), and there exists a value \(t \le c \le n-1\), such that \(\chi (x_1,\dots ,x_{t-1},y) = c\) and \(\{x_1,\dots ,x_{t-1},y\},\{y,z_1,\dots ,z_{t-1}\}\) are red for all \(y \in Y\). Note that \(\chi (y,z_1,\dots ,z_{t-1}) \le c\) for all \(y \in Y\), by the definition of a good pair. As \(|Y| = R_<(K_t,P_n^t)\) and Y contains no blue \(P_n^t\), it must contain a red clique \(y_1<\dots <y_t\). Now take a red \(P^t_c\) ending at \(x_1,\dots ,x_{t-1},y_1\), and extend it by adding the vertices \(y_2,\dots ,y_t,z_1,\dots ,z_{t-1}\), using that \(x_1,\dots ,x_{t-1},z_1,\dots ,z_{t-1}\) are connected to \(y_1,\dots ,y_t\) in red, and that \(y_1,\dots ,y_t\) is a red clique. It follows that \(\chi (y_t,z_1,\dots ,z_{t-1}) > \chi (x_1,\dots ,x_{t-1},y_1) = c\), in contradiction to \(\chi (y_t,z_1,\dots ,z_{t-1}) \le c\). \(\square \)

Proof of Theorem 1.2

The proof is similar to that of Theorem 1.3. Put \(M = R(K_t,K_n)\) and \(N = (2Mn)^{2t-1}\). As \(R(K_t,K_n) \le \left( {\begin{array}{c}n+t-2\\ t-1\end{array}}\right) \le n^{t-1}\) (by the Erdős–Szekeres bound [7]), we have \( N \le 2^{2t-1}n^{t(2t-1)}. \) Fix a red/blue coloring of \(K_N\), and suppose by contradiction that there is no red \(P_n^t\) and no blue \(K_n\). For each red t-clique \(x_1,\dots ,x_t\), let \(\chi (x_1,\dots ,x_t)\) be the largest \(\ell \) such that there is a red \(P_\ell ^t\) that ends at \(x_1,\dots ,x_t\); so \(t \le \chi (x_1,\dots ,x_t) \le n-1\). A good pair is a pair of red t-cliques XY such that the last element of X is the first element of Y, and \(\chi (X) \ge \chi (Y)\).

Claim 3.4

There are at least \(\frac{N^{2t-1}}{2^{2t-1}M^{2t-2}n^{2t-2}}\) good pairs.

Proof

First, we observe that every set of \((M-1) n+1\) vertices contains a good pair. Indeed, by Item 2 of Lemma 3.2, every set of \((M-1)n+1\) vertices contains a blue \(K_n\) or a red t-clique chain with n cliques \(X_1,\dots ,X_{n}\). In the latter case, there must be \(1 \le i \le n-1\) such that \(\chi (X_i) \ge \chi (X_{i+1})\), which gives a good pair.

Now, every set of 2Mn vertices contains at least Mn good pairs (by repeatedly finding a good pair and deleting one of its vertices). By double counting, there are at least

$$\begin{aligned} Mn \cdot \frac{\left( {\begin{array}{c}N\\ 2Mn\end{array}}\right) }{\left( {\begin{array}{c}N-2t+1\\ 2Mn-2t+1\end{array}}\right) } = Mn \cdot \frac{\left( {\begin{array}{c}N\\ 2t-1\end{array}}\right) }{\left( {\begin{array}{c}2Mn\\ 2t-1\end{array}}\right) } \ge \frac{N^{2t-1}}{2^{2t-1}M^{2t-2}n^{2t-2}} \end{aligned}$$

good pairs. \(\square \)

By Lemma 3.4 and averaging, there are vertices \(x_1< \dots< x_{t-1}< z_1< \dots < z_{t-1}\) and a set \(Y'\) of vertices \(x_{t-1}< y < z_1\) such that \(|Y'| \ge \frac{N}{2^{2t-1}M^{2t-2}n^{2t-2}} \ge Mn\), and such that for all \(y \in Y'\), \(\{x_1,\dots ,x_{t-1},y\}\) and \(\{y,z_1,\dots ,z_{t-1}\}\) form a good pair. By the pigeonhole principle over the value of \(\chi \), there exists a set \(Y \subseteq Y'\), \(|Y| \ge |Y'|/n = M\), and a value \(t \le c \le n-1\), such that \(\chi (x_1,\dots ,x_{t-1},y) = c\) for all \(y \in Y\). Then \(\chi (y,z_1,\dots ,z_{t-1}) \le c\) for all \(y \in Y\), by the definition of a good pair. As \(|Y| = M = R(K_t,K_n)\) and Y contains no blue \(K_n\), it must contain a red clique \(y_1<\dots <y_t\). As in the proof of Theorem 1.3, we get \(c \ge \chi (y_t,z_1,\dots ,z_{t-1}) > \chi (x_1,\dots ,x_{t-1},y_1) = c\), a contradiction. \(\square \)

4 Proof of Theorem 1.1

We begin with a brief sketch. Our strategy for upper bounding \(R(K_{s+1},P_n^t)\) is to find a certain structure which we call an s-red-net (see Definition 4.3). We will show (see Lemma 4.12) that this structure implies the existence of a red \(K_{s+1}\) or a blue \(P_n^t\). To find an s-red-net, we will first find blue cliques \(V_1< \dots < V_M\), each of large constant size, and partition each \(V_i\) into s consecutive equal-sized parts. For each i and \(0 \le j \le s-2\), we will define \(\chi _j(i)\) as the largest \(\ell \) such that there exists a blue \(P_\ell ^t\) whose last t vertices belong to the first \((s-1-j)\) parts in the partition of \(V_i\). The key point is that if \(i_1 < i_2\) and \(\chi _j(i_1) \ge \chi _j(i_2)\), then the bipartite graph between certain parts of \(V_{i_1}\) and certain parts of \(V_{i_2}\) must be almost red. Using this, we can reduce the task of finding an s-red-net to the task of finding a certain structure in the functions \(\chi _0,\dots ,\chi _{s-2}\). We call this structure a \((\chi _0,\dots ,\chi _{s-2})\)-forest, see Definition 4.4 and Lemma 4.5.

We now introduce some definitions. We will consider rooted trees and forests, and use the following terminology.

Definition 4.1

A rooted forest is a collection of rooted trees. The depth of a vertex is the distance from the root (of the corresponding tree). A rooted forest is balanced if all leaves have the same depth.

We always consider forests F with \(V(F) \subseteq [M]\) for some integer M, so that there is a natural ordering on V(F).

Definition 4.2

Let F be a rooted forest with a linear order on its vertices. We say that F is pre-ordered if each vertex comes before all of its descendants, and for every two vertices \(y<y'\) that are at the same depth, the descendants of y come before \(y'\), and thus before all the descendants of \(y'\).

Note that if F is pre-ordered then for every two components (trees) \(T_1,T_2\) in F, we have \(T_1 < T_2\) or \(T_2 < T_1\). Also, if x is the root of a component T, \(y_1< \dots < y_k\) are the children of x, and \(S_i\) is the subtree rooted at \(y_i\) (\(1 \le i \le k\)), then \(x< S_1< \dots < S_k\), and each \(S_i\) is pre-ordered. Observe that if F is balanced pre-ordered forest of depth d, and \(x_1,\dots ,x_m\) are the roots of the components (trees) of F, then after deleting \(x_1,\dots ,x_m\) we get a balanced pre-ordered forest of depth \(d-1\) (the trees in this forest are the subtrees rooted at the children of \(x_1,\dots ,x_m\)). We write |F| for the number of vertices in a forest F.

We are now ready to define the notion of an s-red-net, which will play a key role in the proof.

Definition 4.3

Consider a red/blue edge-coloring of \(K_N\). Let \(s \ge 1\). An s-red-net of order r is a pair \((F,(X_v)_{v \in V(F)})\), where F is a balanced pre-ordered forest of depth \(s-1\), and for each \(v \in V(F)\), \(X_v\subseteq [N]\) is a blue clique (in \(K_N\)) of size r, such that the following holds:

  1. 1.

    For \(v,u \in V(F)\), if \(v < u\) then \(X_v < X_u\).

  2. 2.

    For every \(v \in V(F)\) and every descendant u of v, there is no blue \(K_{t,t}\) with one part in \(X_v\) and the other in \(X_u\).

See figure 2 for an example of an s-red-net for \(s=2,3\). We note that since there is a total order of the vertices of F, there is also a corresponding total order of \((X_v)_{v\in V(F)}\).

Fig. 2
figure 2

An example of a 2-red-net (top) and a 3-red-net (bottom). In the top example \(V(F)=\{1,\dots ,7\}\) and in the bottom example \(V(F) = \{1,\dots ,11\}\). An edge between \(X_i\) and \(X_j\) indicates that there is an edge between i and j in F

4.1 Finding s-Red-nets

As mentioned above, we will find an s-red-net by finding a certain structure in a family of functions \(\chi _0,\dots ,\chi _{q-1}: [M] \rightarrow [n]\). We now define this structure.

Definition 4.4

Let \(\chi _0,\dots ,\chi _{q-1}: [M] \rightarrow [n]\) be q functions. A \((\chi _0,\dots ,\chi _{q-1})\)-forest is a pre-ordered balanced forest F of depth q with \(V(F) \subseteq [M]\), such that the following holds: For every \(0 \le d \le q-1\) and \(a \in V(F)\) at depth d, it holds that \(\chi _{d}(a) \ge \chi _{d}(a')\) for every child \(a'\) of a. We denote by L(F) the set of leaves of F.

Note that in the case \(q=1\), a \((\chi _0)\)-forest simply consists of elements \(x_1,\dots ,x_m\) (the roots of the trees in the forest) and sets \(Y_1,\dots ,Y_m\) (the sets of leaves of the trees) such that \(x_1< Y_1< \dots< x_m < Y_m\) and \(\chi _0(x_i) \ge \chi _0(y)\) for all \(y \in Y_i\) and \(1 \le i \le m\). See figure 3 for an example when \(q=2\).

Fig. 3
figure 3

An example of a \((\chi _0,\chi _1)\)-forest on vertex set \(\{1,2,\dots ,11\}\): the number above each node is its index, and the pair below node i is \((\chi _0(i),\chi _1(i))\)

Lemma 4.5

For every \(q \ge 1\) and functions \(\chi _0,\dots ,\chi _{q-1}: [M] \rightarrow [n]\), there is a \((\chi _0,\dots ,\chi _{q-1})\)-forest F with \(|L(F)| \ge M/2^{q-1} - n\).

Proof

The proof is by induction on q. First, define a sequence \(x_1,x_2,\dots \) as follows. Set \(x_1 = 1\), and for each \(i \ge 2\), let \(x_i\) be the smallest \(x > x_{i-1}\) with \(\chi _0(x) > \chi _0(x_{i-1})\). Let \(x_1< \dots < x_k\) be the resulting sequence. As \(\chi _0(x_1)< \dots < \chi _0(x_k)\), we have \(k \le n\).

First, we handle the base case \(q=1\). In this case, put \(Y_i=\{x_i+1,\dots ,x_{i+1}-1\}\) for \(1 \le i \le k-1\), and \(Y_k=\{x_k+1,\dots ,M\}\). By the definition of the sequence \((x_i)_i\), we have that \(\chi _0(x_i) \ge \chi _0(y)\) for every \(y \in Y_i\) and \(1 \le i \le m\). Now, write I for the set of \(i\in [k]\) with \(Y_i\ne \emptyset \). For \(i \in I\), let \(T_i\) be the tree of depth 1 with root \(x_i\) and leaf-set \(Y_i\). Let F be the forest with components \(T_i\), \(i \in I\). Then F is pre-ordered and balanced of depth 1. Also, \(|L(F)| = |Y_1| + \dots + |Y_k| = M-k \ge M-n\). So F is the required \((\chi _0)\)-forest.

Fig. 4
figure 4

An example for the proof of Lemma 4.5 where \(q=2\), \(k=4\) and \(\ell =5\). Every red (dashed) circle stands for a component of \(F'\) rooted at some \(y_i\). Also, \(J_0=\{1,2,3\}\), so \(Z_j\) is defined for \(j=1,2,3\)

Suppose now that \(q \ge 2\). Apply the induction hypothesis for \(q-1\) to the functions \(\chi _1,\dots ,\chi _{q-1}\) and to \([M] {\setminus } \{x_1,\dots ,x_k\}\) in place of [M]. This gives a \((\chi _1,\dots ,\chi _{q-1})\)-forest \(F'\) with \(V(F') \subseteq [M] {\setminus } \{x_1,\dots ,x_k\}\) and

$$\begin{aligned} |L(F')| \ge \frac{M-n}{2^{q-2}} - n \ge \frac{M}{2^{q-2}} - 2n. \end{aligned}$$

Let \(S_1< \dots < S_{\ell }\) be the components of \(F'\). For each \(1 \le i \le \ell \), let \(y_i\) be the root of \(S_i\), and let \(j_i\) be the maximum \(1 \le j \le k\) with \(x_j < y_i\) (this is well-defined because \(x_1 = 1\)). Then \(x_{j_i}< y_i < x_{j_i+1}\) if \(j_i < k\), and \(y_i \ge x_k\) if \(j_i = k\). It follows that \(\chi _0(x_{j_i}) \ge \chi _0(y_i)\) by the definition of the sequence \((x_j)_j\). (This means that \(y_i\) is a potential child of \(x_{j_i}\) in the \((\chi _0,\dots ,\chi _{q-1})\)-forest we are going to construct.) For \(1 \le j \le k\), let \(I_j = \{1 \le i \le \ell : j_i = j\}\), the set of potential children of \(x_j\). Let \(J_0\) be the set of all \(1 \le j \le k\) such that \(I_j \ne \emptyset \). For each \(j \in J_0\), let \(Z_j\) be the minimum interval (in [M]) which contains the set \(\{x_j\} \cup \bigcup _{i \in I_j}V(S_i)\); namely, the left endpoint of \(Z_j\) is \(x_j\), and the right endpoint of \(Z_j\) is the rightmost element of \(\bigcup _{i \in I_j}V(S_i)\). See figure 4 for an example. Recall that \(L(S_i)\) denotes the set of leaves of \(S_i\).

Claim 4.6

There is \(J \subseteq J_0\) such that \(Z_j < Z_{j'}\) for every pair \(j,j' \in J\) with \(j < j'\), and

$$\begin{aligned} \sum _{j \in J}\sum _{i \in I_j}|L(S_i)| \ge \frac{1}{2}\left( |L(S_1)| + \dots + |L(S_{\ell })|\right) \ge \frac{M}{2^{q-1}} - n. \end{aligned}$$
(1)

Proof

Let H be the interval graph of the intervals \(Z_j\), \(j \in J_0\); namely, \(V(H) = J_0\) and \(j,j'\) are adjacent if \(Z_j,Z_{j'}\) intersect. We claim that H is triangle-free. Indeed, suppose that \(j< j' < j''\) make a triangle in H. Since \(Z_j,Z_{j''}\) intersect, there is \(v \in \bigcup _{i \in I_j}V(S_i)\) with \(v > x_{j''}\). Let \(i \in I_j\) such that \(v \in V(S_i)\). We know \(y_i < x_{j'}\) because \(j_i = j < j'\). Now, take an arbitrary \(i' \in I_{j'}\) (the set \(I_{j'}\) is non-empty because \(j' \in J_0\)). If \(i' \le i\), then \(y_{i'} \le y_i\), which means \(j_{i'} \le j_i=j<j'\). And if \(i' > i\), then \(S_i < S_{i'}\). As \(v \in V(S_i)\), this implies that \(y_{i'}> v > x_{j''}\), so \(j_{i'} \ge j'' > j'\). In either case, \(j_{i'} \ne j'\), contradicting the fact that \(i' \in I_{j'}\). This proves our claim that H is triangle-free.

Interval graphs are perfect (see [9, Chap. 8]), so H is 2-colorable. Take \(J \subseteq J_0\) to be the color class that maximizes \(\sum _{j \in J}\sum _{i \in I_j}|L(S_i)|\). Then (1) holds. Also, for every pair \(j,j' \in J\) with \(j < j'\), we have \(Z_{j} \cap Z_{j'} = \emptyset \) (because J is independent in H) and hence \(Z_j < Z_{j'}\) (because \(Z_j,Z_{j'}\) are intervals and \(x_j \in Z_j\) is to the left of \(x_{j'} \in Z_{j'}\)). \(\square \)

We now complete the proof of the lemma. For each \(j \in J\), form a balanced tree \(T_j\) by taking \(x_j\) as the root and attaching \(S_i\) as a subtree of the root for every \(i \in I_j\). Then \(T_j\) is pre-ordered and balanced of depth q, because the \(S_i\)’s are pre-ordered and have depth \(q-1\). The children of \(x_j\) are all the \(y_i\) with \(i \in I_j\), and we already saw that \(\chi _0(x_j) \ge \chi _0(y_i)\) for each such \(y_i\). Also, by the claim, we have \(Z_j < Z_{j'}\) for all \(j,j' \in J\) with \(j < j'\). Hence, writing \(J = \{j_1,\dots ,j_{m}\}\), we have \(V(T_{j_1})< \dots < V(T_{j_m})\). Let F be the forest with components \(T_{j_1},\dots ,T_{j_m}\). Then F is a \((\chi _0,\dots ,\chi _{q-1})\)-forest; indeed, the requirement in Definition 4.4 holds for \(d=0\) (as we just saw), and also holds for \(1 \le d \le q-1\) because \((S_1,\dots ,S_{\ell })\) is a \((\chi _1,\dots ,\chi _{q-1})\)-forest. Also, \(|L(F)| \ge M/2^{q-1} - n\) by (1). This completes the proof. \(\square \)

4.2 Using s-Red-nets

In this section, we show in Lemma 4.12 that a large enough s-red-net implies the existence of a red \(K_{s+1}\) or a blue \(P_n^t\). This is done via a stronger statement (see Lemma 4.9), which has the advantage of allowing an inductive proof. The following definition will play an important role.

Definition 4.7

Let \(\mathcal {C}= (F, (X_v)_v)\) be an s-red-net. Let x be the root of the leftmost component (tree) of F and \(x'\) be the root of the rightmost component (tree) of F. The head of \(\mathcal {C}\), denoted \({{\,\textrm{Head}\,}}(\mathcal {C})\), consists of the s vertices of F on the leftmost path from x to a leaf (i.e., a path that always goes to the leftmost child). Similarly, the tail of \(\mathcal {C}\), denoted \({{\,\textrm{Tail}\,}}(\mathcal {C})\), consists of the s vertices of F on the rightmost path from \(x'\) to a leaf.

As an example, if \(\mathcal {C}\) is as depicted in the top part of figure 2, then \({{\,\textrm{Head}\,}}(\mathcal {C})=\{1,2\}\) and \({{\,\textrm{Tail}\,}}(\mathcal {C})=\{5,7\}\), and if \(\mathcal {C}\) is as depicted in the bottom part of figure 2, then \({{\,\textrm{Head}\,}}(\mathcal {C})=\{1,2,3\}\) and \({{\,\textrm{Tail}\,}}(\mathcal {C})=\{9,10,11\}\).

Definition 4.8

For each subset \(S=\{s_1,\dots ,s_r\}\) of [N], write \({S}^{\text {U}}:=\{s_1,\dots ,s_{r/3}\}\), \({S}^{\text {M}}:=\{s_{r/3+1},\dots ,s_{2r/3}\}\), \({S}^{\text {D}}:=\{s_{2r/3+1},\dots ,s_r\}\).Footnote 2

Our key lemma is the following.

Lemma 4.9

Let \(s \ge 1\), \(n \ge t \ge 1\) and \(r \ge 3t\). Suppose \(\mathcal {C}=(F,(X_v)_v)\) is an s-red-net of order r. Then, at least one of the following holds.

  1. (a)

    There exist \(s+1\) distinct vertices \(v_1,\dots ,v_{s+1}\in V(F)\), along with sets \(A_i \subseteq X_{v_i} (\subseteq [N])\), \(|A_i| \ge r/3\), such that for every \(1 \le i < j \le s+1\), there is no blue \(K_{t,t}\) with one part in \(A_i\) and the other in \(A_j\).

  2. (b)

    There exist s integers \(\ell _1,\dots ,\ell _s \ge t\) with \(\sum _{i=1}^s \ell _i \ge |F|r/3\), and there exist vertex-disjoint blue copies \(P_1,\dots ,P_s\) of \(P_{\ell _1}^t,\dots ,P_{\ell _s}^t\), respectively, such that the following holds: there exist two bijections \(\sigma :[s]\rightarrow {{\,\textrm{Head}\,}}(\mathcal {C})\) and \(\pi :[s]\rightarrow {{\,\textrm{Tail}\,}}(\mathcal {C})\) such that for each \(i\in [s]\), the first t vertices of \(P_i\) lie in \({X}^{\text {M}}_{\sigma (i)}\) and the last t vertices of \(P_i\) lie in \({X}^{\text {M}}_{\pi (i)}\).

Before proving Lemma 4.9, let us sketch the proof when \(s=1,2\), as these cases are easy to describe and already contain the main ideas. We will also explain how Lemma 4.9 is used to show that there exists a red \(K_{s+1}\) or a blue \(P_n^t\).

In the case \(s=1\), the forest F consists of isolated vertices, say \(x_1< \dots < x_{|F|}\). The key observation is that if for every \(1 \le i \le |F|-1\), there is a blue \(K_{t,t}\) with parts \(L_i \subseteq {X}^{\text {D}}_{x_i}\) and \(R_i \subseteq {X}^{\text {U}}_{x_{i+1}}\), then we can construct a copy of \(P^t_{\ell }\) (for some \(\ell \)) from these \(K_{t,t}\)’s by connecting \(R_i\) and \(L_{i+1}\) inside \(X_{x_{i+1}}\), using that the sets \(X_{x_i}\) are all blue cliques; see figure 5. Note that this \(P^t_{\ell }\) contains the middle part \({X}^{\text {M}}_{x_i}\) for every i, so \(\ell \ge \frac{1}{3}\sum _i |X_{x_i}| = |F|r/3\). This case corresponds to Item (b) in the lemma. On the other hand, if, for some \(1 \le i \le |F|-1\), there is no blue \(K_{t,t}\) with one part in \({X}^{\text {D}}_{x_i}\) and one part in \({X}^{\text {U}}_{x_{i+1}}\), then Item (a) in the lemma holds with \(v_1 = x_i, v_2 = x_{i+1}\). Note that \(K_{t,t}\)-free graphs are sparse, so here we get a bipartite graph which is very dense in red.

Fig. 5
figure 5

Proof of Lemma 4.9 for \(s=1\): Every part with a blue shadow induces a blue clique, and every two parts connected by two blue dashed lines induce a blue complete bipartite graph

Now let us consider the case \(s=2\). In this case, the trees in F have depth 1; namely, each tree consists of a root and leaves connected to the root. Let \(x_1< \dots < x_m\) be the roots, and let \(Y_k\) be the set of children of \(x_k\). For each \(1 \le k \le m\), we would like to apply the case \(s=1\) to the set of vertices \(Y_k\). If Item (a) in the lemma holds, then we have vertices \(v_1,v_2 \in Y_k\) and sets \(A_i \subseteq X_{v_i}\) with no blue \(K_{t,t}\) between \(A_1,A_2\). Together with \(X_{x_k}\), this gives three sets with no blue \(K_{t,t}\) between any two, meaning that Item (a) in the lemma holds (for \(s=2\)). (Here we use the definition of an s-red-net, which implies that there is no blue \(K_{t,t}\) between \(X_{x_k}\) and \(X_y\) for any \(y \in Y_k\).)

So we may assume that when applying Lemma 4.9 to \(Y_k\) (with \(s=1\)), Item (b) holds. This gives a copy \(P_k\) of \(P_{\ell }^t\) inside \(\bigcup _{y \in Y_k} X_y\), where \(\ell \ge |Y_k|r/3\). We now take another “trivial” t’th-power of a path which just consists of all the vertices in \({X}^{\text {M}}_{x_k}\); let us denote it by \(P'_k\), so \(|P'_k| = |{X}^{\text {M}}_{x_k}|\). Our goal now is to connect the ends of \(P_k\) and \(P'_k\) to the beginnings of \(P_{k+1}\) and \(P'_{k+1}\). This connection forms a matching, i.e., we want to connect \(P_k\) to \(P_{k+1}\) and \(P'_k\) to \(P'_{k+1}\), or \(P_k\) to \(P'_{k+1}\) and \(P_k\) to \(P'_{k+1}\); see Fig. 6. Doing this for every \(1 \le k \le m-1\) gives disjoint blue copies of \(P^t_{\ell _1},P^t_{\ell _2}\) (for some \(\ell _1,\ell _2\)) which together cover \({X}^{\text {M}}_x\) for every \(x \in V(F)\). This corresponds to Item (b) in the lemma. As \(P^t_{\ell _1},P^t_{\ell _2}\) together cover many vertices, one of them must be long, and this will give the desired blue \(P_n^t\).

To achieve the aforementioned connection for a specific \(1 \le k \le m-1\), we do as follows. Let \(u_k\) be the rightmost vertex in \(Y_k\subseteq V(F)\) and let \(v_{k+1}\) be the leftmost vertex in \(Y_{k+1}\subseteq V(F)\); then the last t vertices of \(P_k\) are in \({X}^{\text {M}}_{u_k}\), and the first t vertices of \(P_{k+1}\) are in \({X}^{\text {M}}_{v_{k+1}}\). We now define an auxiliary bipartite graph with parts \(\{x_k,u_k\}\) and \(\{x_{k+1},v_{k+1}\}\), where \(u \in \{x_k,u_k\}\) is connected to \(v \in \{x_{k+1},v_{k+1}\}\) if there is a blue \(K_{t,t}\) with one part in \({X}^{\text {D}}_u\) and one part in \({X}^{\text {U}}_v\). A perfect matching in this bipartite graph gives the desired connection (see figure 6). On the other hand, if there is no perfect matching, then there is an isolated vertex. So suppose, for example, that \(x_{k+1}\) is adjacent to neither \(x_k\) nor \(u_k\). Then \({X}^{\text {D}}_{x_k},{X}^{\text {D}}_{u_k},{X}^{\text {U}}_{x_{k+1}}\) are three sets such that between any two there is no blue \(K_{t,t}\) (recall that there is no blue \(K_{t,t}\) between \(X_{x_k}\) and \(X_{u_k}\) by the definition of an s-red-net). So Item (a) in the lemma holds. Finally, note that a bipartite graph with no blue \(K_{t,t}\) is sparse in blue, and hence very dense in red. Thus, a (large enough) tripartite graph with no blue \(K_{t,t}\) between any two parts must contain a red triangle (we will argue this in Lemma 4.12). We now proceed with the full proof of Lemma 4.9.

Fig. 6
figure 6

Proof of Lemma 4.9 for \(s=2\): The top picture shows two trees (of depth one) which we want to connect. The middle and bottom show the two ways of connecting \(P_1,P_1'\) to \(P_2,P_2'\) (the connections are the blue dotted curves). Every part with a blue shadow induces a blue clique and every two parts connected by a single blue dash-dotted line induce a blue complete bipartite graph

Proof of Lemma 4.9

The proof is by induction on s. First, for the base case \(s=1\), F consists of |F| isolated vertices \(x_1<\dots <x_{|F|}\). Note that \({{\,\textrm{Head}\,}}(\mathcal {C}) = \{x_1\}\) and \({{\,\textrm{Tail}\,}}(\mathcal {C}) = \{x_{|F|}\}\). If, for some \(1 \le i \le |F|-1\), there is no blue \(K_{t,t}\) with one part in \({X}^{\text {D}}_{x_i}\) and the other in \({X}^{\text {U}}_{x_{i+1}}\), then (a) is satisfied with \(v_1:= x_i\) and \(v_2:= x_{i+1}\) with \(A_1:= {X}^{\text {D}}_{x_i}\) and \(A_2:= {X}^{\text {U}}_{x_{i+1}}\). Otherwise, for every \(1 \le i \le |F|-1\), there exists a blue \(K_{t,t}\) with one part \(L_i \subset {X}^{\text {D}}_{x_i}\) and the other part \(R_i \subset {X}^{\text {U}}_{x_{i+1}}\). As each \(X_{x_i}\) forms a blue clique in \(K_N\), we can connect these \(|F|-1\) blue \(K_{t,t}\)’s by

$$\begin{aligned}{} & {} {X}^{\text {M}}_{x_1}\rightarrow L_1\rightarrow R_1\rightarrow {X}^{\text {M}}_{x_2}\rightarrow L_2\rightarrow R_2\rightarrow {X}^{\text {M}}_{x_3}\rightarrow \dots \rightarrow {X}^{\text {M}}_{x_{|F|-1}}\rightarrow L_{|F|-1}\\{} & {} \qquad \rightarrow R_{|F|-1}\rightarrow {X}^{\text {M}}_{x_{|F|}}, \end{aligned}$$

which forms a blue \(P_{\ell }^t\), for \(\ell \ge |F|r/3\), with first t vertices in \(X_{x_1}^M\) and last t vertices in \(X_{x_{|F|}}^M\). Thus, (b) is satisfied. This completes the proof of the base case \(s=1\).

For the inductive step, let \(s \ge 2\), and suppose that the lemma holds for \(s-1\). We assume that (a) does not hold and show that (b) must hold. Let \(x_1<\dots <x_m\) be the roots of the components (trees) in F. For each \(k \in [m]\), let \(F_k\) denote the forest obtained from the tree rooted at \(x_k\) by deleting \(x_k\) (so the components of \(F_k\) are the trees rooted at the children of \(x_k\)). Then \(F_k\) is a pre-ordered balanced forest of depth \(s-2\). Let \(\mathcal {C}_k\) denote the \((s-1)\)-red-net \((F_k,(X_v)_{v \in F_k})\). Note that \({{\,\textrm{Head}\,}}(\mathcal {C}) = \{x_1\} \cup {{\,\textrm{Head}\,}}(\mathcal {C}_1)\) and \({{\,\textrm{Tail}\,}}(\mathcal {C}) = \{x_m\} \cup {{\,\textrm{Tail}\,}}(\mathcal {C}_m)\). We will apply the induction hypothesis to \(\mathcal {C}_k\) with \(s-1\) in place of s. We now show that Item (b) of the lemma must hold:

Claim 4.10

For each \(k \in [m]\), (b) holds for \(\mathcal {C}_k\) in terms of \(s-1\).

Proof

Suppose not. Then by the induction hypothesis for \(\mathcal {C}_k\) (with \(s-1\) in place of s), (a) must hold for \(\mathcal {C}_k\), i.e., there exist \(v_1,\dots ,v_s \in V(F_k)\) and \(A_1,\dots ,A_s\) with \(A_i\subset X_{v_i}\) and \(|A_i|\ge |X_{v_i}|/3\), such that for every \(1 \le i < j \le s\), there is no blue \(K_{t,t}\) with one part in \(A_i\) and the other in \(A_j\). Note that for every \(1 \le i \le s\), there is no blue \(K_{t,t}\) with one part in \(X_{x_k}\) and the other in \(A_i\), by the definition of an s-red-net (as \(v_i\) is a descendant of \(x_k\)). So the \(s+1\) vertices \(x_k,v_1,\dots ,v_s\), along with the sets \(X_{x_k},A_1,\dots ,A_{s}\), satisfy (a), contradicting our assumption that (a) does not hold for \(\mathcal {C}\). \(\square \)

By the above claim, for each \(k \in [m]\), there exist integers \(\ell _{k,1},\dots ,\ell _{k,s-1} \ge t\) with \(\sum _{i=1}^{s-1} \ell _{k,i} \ge |F_k|r/3\), there exist vertex-disjoint blue copies \(P_{k,1},\dots ,P_{k,s-1}\) of \(P_{\ell _{k,1}}^t,\dots ,P_{\ell _{k,s-1}}^t\), respectively, and there exist two bijections \(\sigma _k:[s-1]\rightarrow {{\,\textrm{Head}\,}}(\mathcal {C}_k)\) and \(\pi _k:[s-1]\rightarrow {{\,\textrm{Tail}\,}}(\mathcal {C}_k)\) such that for each \(i\in [s-1]\), the first t vertices of \(P_{k,i}\) lie in \({X}^{\text {M}}_{\sigma _k(i)}\) and the last t vertices of \(P_{k,i}\) lie in \({X}^{\text {M}}_{\pi _k(i)}\).

We now add an additional blue copy of \(P^t_{\ell _{k,s}}\) with \(\ell _{k,s}:=|{X}^{\text {M}}_{x_k}|=r/3\ge t\), as follows: let \(P_{k,s}\) be the copy of \(P_{\ell _{k,s}}^t\) on all the vertices of \({X}^{\text {M}}_{x_k}\) (recall that \(X_{x_k}\) induces a blue clique by Definition 4.3). It will be convenient to set \({{\,\textrm{Head}\,}}'(\mathcal {C}_k):=\{x_k\}\cup {{\,\textrm{Head}\,}}(\mathcal {C}_k)\) and \({{\,\textrm{Tail}\,}}'(\mathcal {C}_k):=\{x_k\}\cup {{\,\textrm{Tail}\,}}(\mathcal {C}_k)\). Note that \({{\,\textrm{Head}\,}}(\mathcal {C})={{\,\textrm{Head}\,}}'(\mathcal {C}_1)\) and \({{\,\textrm{Tail}\,}}(\mathcal {C}) = {{\,\textrm{Tail}\,}}'(\mathcal {C}_m)\). Also, with a slight abuse of notation, we extend \(\sigma _k\) and \(\pi _k\) by setting \(\sigma _k(s) = x_k\) and \(\pi _k(s) = x_k\), to get bijections \(\sigma _k: [s] \rightarrow {{\,\textrm{Head}\,}}'(\mathcal {C}_k)\) and \(\pi _k: [s] \rightarrow {{\,\textrm{Tail}\,}}'(\mathcal {C}_k)\). Note that \(\sum _{i=1}^{s} \ell _{k,i} \ge (|F_k|+1)r/3\) and that \(P_{k,1},\dots ,P_{k,s}\) are vertex-disjoint blue copies of \(P_{\ell _{k,1}}^t,\dots ,P_{\ell _{k,s}}^t\), respectively, such that for each \(i\in [s]\), the first t vertices of \(P_{k,i}\) are in \({X}^{\text {M}}_{\sigma _k(i)}\) and the last t vertices of \(P_{k,i}\) are in \({X}^{\text {M}}_{\pi _k(i)}\)

To prove that Item (b) holds, we need to “connect" \(P_{k,1},\dots ,P_{k,s}\) to \(P_{k+1,1},\dots ,P_{k+1,s}\) for every \(1 \le k \le m-1\). More precisely, we will prove the following by induction on k:

  1. (b’)

    For every \(1 \le k \le m\), there exist integers \(\ell _1,\dots ,\ell _s \ge t\) with \(\sum _{i=1}^s \ell _i \ge \sum _{j=1}^k (|F_j|+1)r/3\), and there exist vertex-disjoint copies \(P_1,\dots ,P_s\) of \(P_{\ell _1}^t,\dots ,P_{\ell _s}^t\), respectively, such that the following holds: there exist two bijections \(\sigma :[s]\rightarrow {{\,\textrm{Head}\,}}'(\mathcal {C}_1)\) and \(\pi :[s]\rightarrow {{\,\textrm{Tail}\,}}'(\mathcal {C}_k)\) such that for each \(i\in [s]\), the first t vertices of \(P_i\) lie in \({X}^{\text {M}}_{\sigma (i)}\) and the last t vertices of \(P_i\) lie in \({X}^{\text {M}}_{\pi (i)}\).

Note that \(\sum _{j=1}^m (|F_j|+1) = |F|\). Hence, by setting \(k=m\) in (b’), we get (b).

So it remains to prove (b’). In the base case \(k=1\), we take \(P_1,\dots ,P_s\) to be \(P_{1,1},\dots ,P_{1,s}\) and \(\sigma := \sigma _1, \pi := \pi _1\). For the inductive step, suppose \(k \ge 2\) and we have found \(P_1,\dots ,P_s\) and \(\sigma ,\pi \) satisfying (b’) for \(k-1\). Our goal is to extend \(P_1,\dots ,P_s\) by \(P_{k,1},\dots ,P_{k,s}\) to obtain \(P_1',\dots ,P_s'\) satisfying (b’) for k. We will also define appropriate \(\sigma ',\pi '\). To this end, we define an auxiliary bipartite graph H with sides \({{\,\textrm{Tail}\,}}'(\mathcal {C}_{k-1})\) and \({{\,\textrm{Head}\,}}'(\mathcal {C}_k)\) such that \(u\in {{\,\textrm{Tail}\,}}'(\mathcal {C}_{k-1})\) is adjacent to \(v\in {{\,\textrm{Head}\,}}'(\mathcal {C}_k)\) in H if there exists a blue \(K_{t,t}\) with one part in \({X}^{\text {D}}_{u}\) and the other in \({X}^{\text {U}}_v\).

Claim 4.11

H has a perfect matching.

Proof

Suppose not. By Hall’s marriage theorem, there exists a subset \(S \subseteq {{\,\textrm{Tail}\,}}'(\mathcal {C}_{k-1})\) with \(|N_H(S)|<|S|\), where \(N_H(S)\) is the neighborhood of S in H. Take \(T={{\,\textrm{Head}\,}}'(\mathcal {C}_k) \backslash N_H(S)\). Then there is no edge in H between S and T. Hence, for each \(u \in S\) and each \(v \in T\), there is no blue \(K_{t,t}\) with one part in \({X}^{\text {D}}_{u}\) and the other in \({X}^{\text {U}}_v\). Observe also that for distinct \(u,v\in {{\,\textrm{Tail}\,}}'(\mathcal {C}_{k-1})\) or \(u,v\in {{\,\textrm{Head}\,}}'(\mathcal {C}_{k})\), there is no blue \(K_{t,t}\) with one part in \(X_{u}\) and the other in \(X_v\). This follows from Definition 4.3, since \({{\,\textrm{Tail}\,}}'(\mathcal {C}_{k-1})\) and \({{\,\textrm{Head}\,}}'(\mathcal {C}_{k})\) are paths from a root to a leaf in F, and so, for every two \(u,v \in {{\,\textrm{Tail}\,}}'(\mathcal {C}_{k-1})\) or \(u,v\in {{\,\textrm{Head}\,}}'(\mathcal {C}_{k})\), it holds that u is a descendant of v or vice versa. Also, note that \(|S|+|T|=|S|+s-|N_H(S)|\ge s+1\). So we see that the (at least \(s+1\)) vertices in \(S \cup T\), along with the sets \(({X}^{\text {D}}_u)_{u\in S}\) and \(({X}^{\text {U}}_{v})_{v\in T}\), satisfy Item (a) in the lemma. This contradicts our assumption that (a) does not hold for \(\mathcal {C}\). \(\square \)

By the above claim, there exists a bijection \(\tau :{{\,\textrm{Tail}\,}}'(\mathcal {C}_{k-1})\rightarrow {{\,\textrm{Head}\,}}'(\mathcal {C}_k)\) that specifies the perfect matching of H. Fix \(i \in [s]\). Due to (b’) for \(P_1,\dots ,P_s\) (with \(k-1\) in place of k), the last t vertices of \(P_i\) lie in \({X}^{\text {M}}_{u}\) for \(u=\pi (i) \in {{\,\textrm{Tail}\,}}'(\mathcal {C}_{k-1})\) (and this is the only u with this property). Set \(v:= \tau (u)\in {{\,\textrm{Head}\,}}'(\mathcal {C}_k)\). We know that the first t vertices of \(P_{k,j}\) lie in \({X}^{\text {M}}_{v}\) for \(j=\sigma _k^{-1}(v)\) (and this is the only j with this property). We have \(x_{k-1}<x_k\), and hence \(V(F_{k-1}) < V(F_k)\), as F is pre-ordered. Therefore, \(u < v\), since \(u \in V(F_{k-1})\cup \{x_{k-1}\}\) and \(v \in V(F_k)\cup \{x_{k}\}\). Now, by Definition 4.3, we have \(X_u < X_{v}\). As \((u, v) \in E(H)\), there is some blue \(K_{t,t}\) with parts L and R such that \(L\subseteq {X}^{\text {D}}_u\) and \(R \subseteq {X}^{\text {U}}_{v}\). Also, both \(X_u\) and \(X_{v}\) are blue cliques. Thus, we can extend \(P_i\) by \(P_i\rightarrow L\rightarrow R\rightarrow P_{k,j}\), giving a blue copy of \(P_{\ell _i'}^t\) with \(\ell _i' > \ell _i + \ell _{k,j}\). We denote this copy by \(P'_i\). Doing the above for all \(i \in [s]\), we obtain blue copies \(P_1',\dots ,P_s'\) of \(P_{\ell _1'}^t,\dots ,P_{\ell _s'}^t\), respectively, where

$$\begin{aligned} \sum _{i=1}^s \ell _i' \ge \sum _{i=1}^s \ell _i + \sum _{i=1}^s \ell _{k,i} \ge \sum _{j=1}^{k-1} (|F_j|+1)r/3 + (|F_k|+1)r/3 = \sum _{j=1}^{k} (|F_j|+1)r/3. \end{aligned}$$

As \(\tau \) specifies a perfect matching in H, \(P'_1,\dots ,P'_s\) are vertex-disjoint. Clearly, for every \(1 \le i \le s\), the first t vertices of \(P_i'\) are the same as those of \(P_i\), and thus lie in \({X}^{\text {M}}_{\sigma (i)}\). The last t vertices of \(P_i'\) are the same as those of \(P_{k,j}\) for \(j=\sigma _k^{-1}(\tau (\pi (i)))\), and thus lie in \({X}^{\text {M}}_{\pi _k(j)}\). Then \(P'_1,\dots ,P'_s\), \(\sigma ':=\sigma \) and \(\pi ':=\pi _k\circ \sigma _k^{-1}\circ \tau \circ \pi \) satisfy (b’) for k. This completes the inductive step, thus proving the lemma. \(\square \)

Lemma 4.12

Let \(s \ge 1\), \(n \ge t \ge 1\). Suppose \(\mathcal {C}=(F,(X_v)_v)\) is an s-red-net of order \(r\ge 3(4\,s^2)^t\) with \(|F| \ge 3sn/r\). Then, \(K_N\) contains a red \(K_{s+1}\) or a blue \(P_n^t\).

Proof

We apply Lemma 4.9 to \(\mathcal {C}\), and consider the following two cases.

  1. Case 1:

    (a) holds for \(\mathcal {C}\), i.e., there exist distinct subsets \(A_1,A_2,\dots ,A_{s+1}\subseteq [N]\), each of size \(a=r/3\), such that for all \(1 \le i < j \le s+1\), there is no blue \(K_{t,t}\) with one part in \(A_i\) and the other in \(A_j\). Fix any \(1 \le i < j \le s+1\). Let \(z(a \times a, K_{t,t})\) denote the maximum number of edges in a \(K_{t,t}\)-free \(a \times a\) bipartite graph. By the Kővari–Sós–Turán theorem [10], we have the following bound for the number of blue edges between \(A_i\) and \(A_j\):

    $$\begin{aligned} e_{\text {blue}}(A_i,A_j) \le z(a \times a, K_{t,t}) < t^{1/t}a^{2-1/t}+ta \le a^2/\left( {\begin{array}{c}s+1\\ 2\end{array}}\right) . \end{aligned}$$

    In the last inequality, we used the fact that \(a = r/3 \ge (4\,s^2)^t \ge (2\,s^2)^tt\). Now, sample vertices \(v_1\in A_1, \dots ,v_{s+1}\in A_{s+1}\) independently and uniformly at random. For every \(1 \le i < j \le s+1\), the probability that \((v_i,v_j)\) is blue is \(\frac{1}{a^2} \cdot e_{\text {blue}}(A_i,A_j) < 1/\left( {\begin{array}{c}s+1\\ 2\end{array}}\right) \). Taking a union bound over all pairs \(1 \le i < j \le s+1\), we get that with positive probability, none of the edges \((v_i,v_j)\) is blue, meaning that \(v_1,\dots ,v_{s+1}\) form a red \(K_{s+1}\).

  2. Case 2:

    (b) holds for \(\mathcal {C}\), i.e., there exist \(P_1,\dots ,P_s\) such that for each \(i \in [s]\), \(P_i\) is a blue copy of \(P_{\ell _i}^t\) for some \(\ell _i \ge t\), and \(\sum _{i=1}^s \ell _i \ge |F|r/3\). By averaging, there is \(i\in [s]\) such that \(\ell _{i} \ge |F|r/(3\,s) \ge n\). Thus, \(P_{i}\) contains a blue copy of \(P_n^t\).

\(\square \)

4.3 Putting It All Together

Proof of Theorem 1.1

Set \(r = 3(4\,s^2)^t\), \(M = 2^{s-1}n\), and \(N = M\cdot R(K_{s+1},K_{sr})\). Note that \(R(K_{s+1},K_m) \le \left( {\begin{array}{c}m+s-1\\ s\end{array}}\right) \le m^s\) (by the Erdős–Szekeres bound [7]). Hence, \( N \le 2^{s-1} n\cdot (rs)^s \le (24\,s^3)^{st} n. \) Fix a red/blue edge-coloring of \(K_N\) and suppose by contradiction that there is no red \(K_{s+1}\) and no blue \(P_n^t\). Then every \(R(K_{s+1},K_{sr})\) vertices contain a blue clique of size sr. As \(N = M \cdot R(K_{s+1},K_{sr})\), this means that we can find blue cliques \(V_1< \dots < V_M\) of size sr each. Partition \(V_i = X_i^{(0)} \cup \dots \cup X_i^{(s-1)}\) with \(|X_i^{(j)}| = r\) for all \(0 \le j \le s-1\), and \(X_i^{(s-1)}< X_i^{(s-2)}< \dots < X_i^{(0)}\).

For each \(1 \le i \le M\) and \(0 \le j \le s-2\), let \(\chi _j(i)\) be the maximum \(\ell \) such that there exists a blue copy of \(P_\ell ^t\) whose last t vertices belong to \(X_i^{(j+1)} \cup \dots \cup X_i^{(s-1)}\). By definition, for every \(1 \le i \le M\),

$$\begin{aligned} \chi _0(i) \ge \chi _1(i) \ge \dots \ge \chi _{s-2}(i) \ge t. \end{aligned}$$
(2)

Also, \(\chi _j(i) < n\) for all j because there is no blue \(P_n^t\). By Lemma 4.5 (with \(q = s-1\)), there is a \((\chi _0,\dots ,\chi _{s-2})\)-forest F with \(|L(F)| \ge M/2^{s-2} - n = n\). The following is the key property we need:

Claim 4.13

Let \(0 \le d < d' \le s-1\), let \(a \in F\) at depth d and let \(a'\) be a descendant of a at depth \(d'\). Then there is no blue \(K_{t,t}\) with one part in \(X_a^{(d)}\) and the other part in \(X_{a'}^{(d')}\).

Proof

Let \(a=b_0,b_1,\dots ,b_{d'-d}=a'\) be the unique path from a to \(a'\) in F. Then \(b_i\) is at depth \(d+i\). We have \(\chi _{d+i}(b_i) \ge \chi _{d+i}(b_{i+1})\) for every \(0 \le i < d'-d\), by the definition of a \((\chi _0,\dots ,\chi _{s-2})\)-forest (Definition 4.4). Also, \(\chi _{d+i}(b_{i+1}) \ge \chi _{d+i+1}(b_{i+1})\) for every \(0 \le i \le d'-d-2\), by (2). So \(\chi _{d+i}(b_i) \ge \chi _{d+i+1}(b_{i+1})\) for \(0 \le i \le d'-d-2\), meaning that the sequence \((\chi _{d+i}(b_i))_{i=0}^{d'-d-1}\) is non-increasing. Setting \(i=0\) and \(i=d'-d-1\), we get \(\chi _d(a) = \chi _d(b_0) \ge \chi _{d'-1}(b_{d'-d-1}) \ge \chi _{d'-1}(b_{d'-d}) = \chi _{d'-1}(a')\), where the last inequality again uses the definition of a \((\chi _0,\dots ,\chi _{s-2})\)-forest.

Now suppose by contradiction that there is a blue \(K_{t,t}\) with sides \(A \subseteq X_a^{(d)}\) and \(A' \subseteq X_{a'}^{(d')}\). By the definition of \(\chi _d(\cdot )\), there exists a blue copy P of \(P_{\chi _d(a)}^t\) whose last t vertices belong to \(X_a^{(d+1)} \cup \dots \cup X_a^{(s-1)}\). We can extend P by adding the sets A and \(A'\), using that both A and \(A'\) induce blue cliques, and all edges between A and the last t vertices of P are blue (because \(V_a,V_{a'}\) are blue cliques). Extending P in this way gives a blue copy Q of \(P_{\chi _d(a)+2t}^t\), whose last t vertices are \(A' \subseteq X_{a'}^{(d')}\). Hence, \(\chi _{d'-1}(a') \ge \chi _d(a)+2t >\chi _d(a)\), a contradiction to \(\chi _d(a) \ge \chi _{d'-1}(a')\). \(\square \)

We now use Lemma 4.13 to find an s-red-net. For every \(0 \le d \le s-1\) and every \(v \in V(F)\) at depth d in F, define \(X_v:= X_v^{(d)} \subseteq V_v\). Then \(X_v\) is a blue clique of size r. For every \(v,u \in V(F)\) with \(v < u\), we have \(V_v < V_u\) and hence \(X_v < X_u\). Also, by Lemma 4.13, for every \(v \in V(F)\) and every descendant u of v, there is no blue \(K_{t,t}\) with one part in \(X_v\) and one part in \(X_u\). Hence, \((F,(X_v)_v)\) is an s-red-net of order r. Also, \(|F| \ge n \ge 3sn/r\). By Lemma 4.12, there is a red \(K_{s+1}\) or a blue \(P_n^t\). This completes the proof. \(\square \)

5 Concluding Remarks and Open Problems

In Theorem 1.1, we showed that \(R_{<}(K_{s+1},P_n^t) \le s^{O(st)} n\). As for lower bounds, it holds that \(R_{<}(K_{s+1},P_n^t) > (R(K_{s+1},K_{t+1}) - 1) \cdot (n-1)/t\). Indeed, partition the vertices into \((n-1)/t\) intervals of size \(R(K_{s+1},K_{t+1}) - 1\), and on each of the intervals, put a red/blue coloring with no red \(K_{s+1}\) and no blue \(K_{t+1}\). All edges between the intervals are blue. Then there is no red \(K_{s+1}\) and no blue \(P_n^t\), because a blue \(P_n^t\) would have to contain \(t+1\) vertices from one of the intervals which appear consecutively in the \(P_n^t\), and hence must form a blue \(K_{t+1}\). Combining our upper and lower bounds, we obtain \(s^{\Omega (t)} \cdot n \le R_{<}(K_{s+1},P_n^t) \le s^{O(st)} \cdot n\) (when say \(t \ll s\)). It would be interesting to determine the correct dependence of the exponent on s and t.

In Theorem 1.2 we proved that \(R_<(P_n^t,K_n) = O_t(n^{t(2t-1)})\). It would be interesting to improve the exponent further.

Conjecture 5.1

\(R_<(P_n^t,K_n) \le n^{O(t)}\).

This conjecture, if true, would be tight (up to the implied constant in the exponent) because \(R_<(P_n^t,K_n) \ge R(K_{t+1},K_n) \ge {\tilde{\Omega }}(n^{(t+2)/2})\), see [2, 19]. We note that our proof method for Theorem 1.2 can be used to prove \(R_<(P_n[t],K_n) \le n^{O(t)}\), where \(P_n[t]\) is the t-blowup of the monotone path \(P_n\) (i.e., \(P_n[t]\) is obtained by replacing each vertex of \(P_n\) with t vertices and replacing edges with complete bipartite graphs). This bound is tight because \(R_<(P_n[t],K_n) \ge R(K_{t,t},K_n) \ge n^{\Omega (t)}\).

Proposition 5.2

\(R_<(P_n[t],K_n) \le (2tn^3)^{2t-1}\).

Proof sketch

The proof is similar to that of Theorem 1.2. A semi-red t-clique is a clique \(x_1< \dots < x_t\) such that all edges \(x_1x_i\) (\(2 \le i \le t\)) and \(x_ix_t\) (\(1 \le i \le t-1\)) are red. It can be shown that every set of \(N:= (t-2)n^2\) vertices contains a blue \(K_n\) or semi-red t-clique. Indeed, if there is no vertex with forward red degree at least \((t-2)n\), then one can greedily find a blue clique of size \(\frac{N}{(t-2)n} \ge n\). Thus, there is a vertex \(x_1\) with forward red degree at least \((t-2)n\). By the same argument inside the forward red neighbourhood of \(x_1\), we can find a vertex \(x_t\) with at least \(t-2\) backward red neighbours \(x_2,\dots ,x_{t-1}\). Now \(x_1< x_2< \dots < x_t\) is a semi-red t-clique.

One can then show, using the argument from Lemma 3.2, that every set of \(((t-2)n^2 - 1)n + 1\) vertices contains a blue \(K_n\) or a chain of n semi-red t-cliques. Then, we essentially repeat the proof of Theorem 1.2: consider a red/blue coloring of \(K_N\) with \(N=(2tn^3)^{2t-1}\). We assume that there is no red \(P_n[t]\) or blue \(K_n\). For a semi-red clique \(x_1<\dots <x_t\), define \(\chi (x_1,\dots ,x_t)\) to be the largest number \(\ell \) such that \(x_1,\dots ,x_t\) are the last t vertices of a red \(P_{\ell }[t]\). Then \(1 \le \chi (x_1,\dots ,x_t) \le n-1\). Using the choice of N, one can obtain vertices \(x_1< \dots< x_{t-1}< z_1< \dots < z_{t-1}\), a set Y with \(|Y| \ge tn^2\), and a value \(1 \le c \le n-1\), such that for every \(y \in Y\), \(\{x_1,\dots ,x_{t-1},y\},\{y,z_1,\dots ,z_{t-1}\}\) are semi-red, \(\chi (x_1,\dots ,x_{t-1},y) = c\), and \(\chi (y,z_1,\dots ,z_{t-1}) \le c\). Then, by finding a semi-red \((t+2)\)-clique \(y_1< \dots < y_{t+2}\) inside Y, we can extend a longest \(P_c[t]\) ending at \(x_1,\dots ,x_{t-1},y_1\) by adding the vertices \(y_2,\dots ,y_{t+1},y_{t+2},z_1,\dots ,z_{t-1}\). This gives \(\chi (y_{t+2},z_1,\dots ,z_{t-1}) > \chi (x_1,\dots ,\chi _{t-1},y_1)\), a contradiction. \(\square \)

In Theorem 1.3 we obtain a new bound on \(R_<(P_n^t,P_n^t)\), whose exponent grows linearly with t. Since we do not have a corresponding lower bound, we wonder whether the following might be true.

Problem 5.3

Is there a constant C independent of t, such that \(R_<(P_n^t,P_n^t) = O_t(n^C)\)?

Even improving the exponent to o(t) would be interesting.

In Theorem 2.4 we proved that \(g(n,s) = O_s(n^C)\) for a constant \(C = C(s)\). It may be interesting to determine the order of growth of (the optimal such) C(s). Our proof of Theorem 2.4 gives an upper bound on C(s) of the order \(s^s\), and this is likely far from optimal. Does C(s) grow polynomially in s? Also, for \(s=3\), is it true that \(g(n,3) = O(n)\)?

One could also consider the analogous extremal functions for weaker notions of a non-increasing triple (see Definition 2.1). There are two such notions: one is to require that \(\chi (x,y) \ge \chi (x,z) \ge \chi (y,z)\), and one is only to require that \(\chi (x,y) \ge \chi (y,z)\). For each of these notions, how large should N be to guarantee a non-increasing set of size s in an n-coloring of \(K_N\)?