1 Introduction

In 1930, Ramsey [8] showed that every k-colouring of the edges of a very large clique contains a large monochromatic sub-clique. This classical theorem was the starting seed for Ramsey theory, and there have been numerous extensions and generalisations of it since then. One of the most important is the canonical Ramsey theorem of Erdős and Rado [4], which considers colourings that allow an arbitrary number of colours. It states that every colouring of the edges of a very large clique with an arbitrary number of colours contains a large sub-clique with one of four types of colourings.

Theorem 1.1

(Erdős, Rado) There is a function f(k) such that every colouring of the edges of the complete graph on \(\{1,2,\ldots , f(k)\}\) contains a complete k-vertex subgraph whose colouring is of one of the following four canonical types:

  • rainbow—no two edges have the same colour;

  • monochromatic—all edges have the same colour;

  • upper lexical—two edges have the same colour if and only if the larger vertices coincide;

  • lower lexical—two edges have the same colour if and only if the smaller vertices coincide.

Lefmann and Rödl [6] gave the best current bounds for this result, showing that we can take \(f(k) = k^{Ck^2}\) for some constant C. The canonical Ramsey theorem has an immediate corollary for monotone paths. It implies that there is an integer f(lk) such that if \(n > f(l, k)\) then every colouring \(c :\genfrac(){0.0pt}1{[n]}{2} \rightarrow \mathbb {N} \) yields either:

  • \(x_0< \cdots < x_l\) with \(c(x_0 x_1), c(x_1 x_2), \dotsc , c(x_{l - 1} x_l)\) all the same (an l-flash), or

  • \(y_0< \cdots < y_k\) with \(c(y_0 y_1), c(y_1 y_2), \dotsc , c(y_{k - 1} y_k)\) all distinct (a k-rainbow).

Lefmann and Rödl’s bound implies that \(f(k,k) \leqslant k^{Ck^2}\).

In 1992, Lefmann, Rödl, and Thomas [7] gave better bounds on f(lk). From below, they provided a nice construction showing that \(f(l, k) \geqslant l^{k - 1}\): label the vertices with strings from \({\{1, 2, \dotsc , l\}}^{k - 1}\) in lexicographic order and, for a pair of vertices \(u < v\), let c(uv) be any index at which u has a smaller value than v. This construction contains no l-flash or k-rainbowFootnote 1, and in fact it is best possible among all colourings that use at most \(k - 1\) colours. They made the attractive conjecture that this lower bound is tight in general.

Conjecture 1.2

(Lefmann, Rödl, Thomas) For all positive integers l and k, \(f(l, k) = l^{k - 1}\).

Lefmann, Rödl, and Thomas gave support for their conjecture by proving that it is true for the small cases \(l \leqslant 2\) or \(k \leqslant 4\) as well as when l is at least factorial in k (specifically, when \(l \geqslant (3k)^{2k}\)). Our first result proves Conjecture 1.2 provided l is at least polynomial in k (specifically, when \(l \geqslant k^3 (\log k)^{1 + o(1)}\)).

Theorem 1.3

For all \(\varepsilon > 0\), there is \(C_{\varepsilon }\) such that if \(l \ge C_{\varepsilon } k^3 (\log k)^{1 + \varepsilon }\), then \(f(l, k) = l^{k - 1}\).

The best general upper bound on f(lk) was given by Jiang and Mubayi [5].

Theorem 1.4

(Jiang, Mubayi) For all integers \(l \geqslant 1\) and \(k \geqslant 4\),

$$\begin{aligned} f(l, k) \leqslant \biggl (1 + \frac{1}{\sqrt{l}}\biggr )^{k - 4} \cdot l^{k - 1}. \end{aligned}$$

This confirms Conjecture 1.2 asymptotically when \(l = \omega (k^2)\). However, for l fixed and k large this differs from the lower bound by a factor exponential in k. We provide an upper bound in which this factor is only polynomial in k.

Theorem 1.5

For all \(\varepsilon > 0\), there is \(D_{\varepsilon }\) such that for all positive integers l and k,

$$\begin{aligned} f(l, k) \leqslant D_{\varepsilon } k (\log k)^{1 + \varepsilon } \cdot l^{k - 1}. \end{aligned}$$

Theorems 1.3 to 1.5 are each best in different ranges of values of l and k. For \(l \geqslant k^3 (\log k)^{1 + o(1)}\), Theorem 1.3 is best possible, for \(l = \mathcal {O} ((k/\log k)^2)\), Theorem 1.5 provides the best bound known, and Theorem 1.4 is best in the intermediate regime.

We further generalise flashes and rainbows to tournaments, where a tournament is an orientation of a complete graph. A directed walk in a tournament is a sequence of vertices \(x_0, \dots , x_l\) such that \(x_{i-1} x_i\) is a directed edge for all \(1 \leqslant i \leqslant l\) (note that walks are allowed to repeat vertices and edges).

Definition 1.6

Let l and k be non-negative integers. An l-flash in a tournament is a directed walk \(x_0, \dotsc , x_l\) with \(c(x_0 x_1), \dotsc , c(x_{l - 1} x_l)\) all the same. A k-rainbow is a directed walk \(y_0, \dotsc , y_k\) with \(c(y_0 y_1), \dotsc , c(y_{k - 1} y_k)\) all distinct.

Note that a directed monochromatic cycle yields an l-flash for every l. Let t(lk) denote the smallest integer such that every colouring of the edges of any tournament with more than t(lk) vertices contains an l-flash or a k-rainbow. Conjucture 1.2 can now be viewed as the restriction of this problem to transitive tournaments and thus we have

$$\begin{aligned} t(l, k) \geqslant f(l, k) \geqslant l^{k - 1}. \end{aligned}$$

We conjecture that the tournament strengthening of Conjecture 1.2 holds.

Conjecture 1.7

For all positive integers l and k, \(t(l, k) = l^{k - 1}\).

We prove two upper bounds on t(lk). The first, Theorem 1.8, is better when l is large compared to k and confirms Conjecture 1.7 asymptotically for \(l = \omega (k^2)\). Although the bound looks very similar to Theorem 1.4, the proof is quite different and uses a probabilistic argument.

Theorem 1.8

For all positive integers l and k, \(t(l, k) \leqslant \bigl (1 + \frac{2}{\sqrt{l}}\bigr )^k \cdot l^{k-1}\).

Our second upper bound, Theorem 1.9, is better when k is large compared to l and, in particular, improves upon Theorem 1.8 for \(l = \mathcal {O} ((k/\log k)^2)\). Note that it implies Theorem 1.5.

Theorem 1.9

For every \(\varepsilon > 0\), there is \(D_{\varepsilon }\) such that for all positive integers l and k,

$$\begin{aligned} t(l, k) \leqslant D_{\varepsilon } k (\log k)^{1 + \varepsilon } \cdot l^{k - 1}. \end{aligned}$$

Conjucture 1.7 posits that if one wants to colour the edges of a large tournament while avoiding l-flashes and k-rainbows, then transitive tournaments are best in the sense of having the most vertices. The following result shows that there are tournaments that are strictly worse than transitive tournaments.

Theorem 1.10

For all \(l \geqslant 2\) and \(k \geqslant 3\), there is a tournament with \(f(l,k) - 1\) vertices such that every colouring of its edges contains an l-flash or a k-rainbow.

Finally, it is interesting to ask how bad a tournament can be: how few vertices can a tournament have if every colouring of its edges contains an l-flash or a k-rainbow? The following provides a general lower bound showing that the number of vertices in such a tournament must be within a factor \(l \sqrt{k}\) of \(l^{k - 1}\).

Theorem 1.11

There is a constant \(C > 0\) such that every tournament with at most \(C l^{k - 2}/\sqrt{k}\) vertices has an edge colouring with neither l-flashes nor k-rainbows.

The rest of the paper is structured as follows. In Sect. 2 we consider arbitrary tournaments and prove Theorems 1.8 and 1.9. We then specialise to transitive tournaments in Sect. 3 and provide a proof of Theorem 1.3. In Sect. 4 we explore the differences between these two settings, proving Theorems 1.10 and 1.11, and we close by stating some open problems in Sect. 5. Throughout this paper, l and k are positive integers.

2 Upper Bounds for Arbitrary Tournaments

In this section, we prove Theorems 1.8 and 1.9. For both, we rely on the following observation: if a tournament contains no k-rainbow and a \((k-1)\)-rainbow ends at some vertex v, then v has at most \(k-1\) outgoing colours. Indeed, otherwise any \((k-1)\)-rainbow ending at v could be extended to a k-rainbow. This will allow us to restrict ourselves to tournaments where each vertex only has few outgoing (and incoming) colours. In this setting, we show that the following lemma holds.

Lemma 2.1

Let \(T = (V, E)\) be an edge-coloured tournament containing no l-flash, and assume that every vertex has at most c incoming colours and at most c outgoing colours. Then,

$$\begin{aligned} |V| \leqslant \left(1 + \frac{2}{\sqrt{l}}\right)^c \cdot l^c. \end{aligned}$$

We prove this result with a probabilistic argument. We will use the following definitions throughout the paper. For a vertex v, we write \( C^- (v) = \{ c(u v) :u v \in E \}\) for the set of incoming colours of v, \( C^+ (v) = \{ c(v u) :v u \in E \}\) for the set of outgoing colours of v, and \( C (v) = C^- (v) \cup C^+ (v)\) for the set of colours incident to v. Moreover, for every vertex v and colour a, let

$$\begin{aligned} l_a(v) = {\left\{ \begin{array}{ll} l-1 &{} \text {if } a \in C^- (v) \setminus C^+ (v), \\ \hbox {length of the longest flash of colour}\, a \,\hbox {ending at}\, v &{} \text {otherwise}. \end{array}\right. } \end{aligned}$$

This is defined for every colour a in our colouring; however \(l_a(v)\) is only non-zero for incoming colours of v. Note also that if an edge uv has colour a, then \(l_a(u) < l_a(v)\). The first condition in this definition is only needed for convenience in the following proof.

Proof of Lemma 2.1

Let p be the positive root of \((l-2)p^2+2p=1\), so \(p = 1 / (1 + \sqrt{l-1})\). For every colour a, choose \(l_a \in \{0, \dots , l-1\}\) independently at random such that \({{\,\mathrm{\mathbb {P}}\,}}(l_a = 0) = {{\,\mathrm{\mathbb {P}}\,}}(l_a = l-1) = p\) and \({{\,\mathrm{\mathbb {P}}\,}}(l_a = i) = p^2\) for every \(i \in [l-2]\). Define

$$\begin{aligned} U = \{ v \in V :l_a(v) = l_a \text { for all } a \in C (v) \}. \end{aligned}$$

If T[U] contains an edge uv, say of colour a, then \(a \in C (u) \cap C (v)\) and \(l_a(u) < l_a(v)\), contradicting the definition of U. Thus, \(|U| \leqslant 1\). Moreover, for every vertex v and every colour \(a \in C (v)\) it holds that \(l_a(v) \in \{0, l-1\}\) if and only if \(a \in C^- (v) \bigtriangleup C^+ (v)\), and so

$$\begin{aligned} {{\,\mathrm{\mathbb {P}}\,}}(v \in U) = \textit{p}^{| C^- (v) \bigtriangleup C^+ (v)|} \textit{p}^{2 | C^- (v) \cap C^+ (v)|} = \textit{p}^{| C^- (v)| + | C^+ (v)|} \geqslant \textit{p}^{2 c}. \end{aligned}$$

It follows that the expected size of U is at least \(p^{2 c} |V|\), and since \(|U| \leqslant 1\) we have

$$\begin{aligned} |V|&\leqslant p^{-2 c} = \left(1 + \sqrt{l-1}\right)^{2 c} = \left(l + 2 \sqrt{l-1}\right)^c \leqslant \left(1 + \frac{2}{\sqrt{l}}\right)^c \cdot l^c. \end{aligned}$$

\(\square \)

To obtain Theorem 1.8, we will use induction to bound the number of vertices where no \((k-1)\)-rainbow starts and no \((k-1)\)-rainbow ends. By the observation from the beginning of this section, the number of remaining vertices can then be bounded via the preceding lemma.

Proof of Theorem 1.8

For \(k \geqslant 2\), we claim that \(t(l,k) \leqslant 2 \cdot t(l,k-1) + (l + 2 \sqrt{l})^{k-1}\). Indeed, let \(T = (V, E)\) be a tournament containing no l-flash and no k-rainbow. Define

$$\begin{aligned}&R = \{ v \in V :\hbox {no}\, (k-1) \hbox {-rainbow ends at} \,v \} \text { and} \\&S = \{ v \in V :\hbox {no}\, (k-1) \hbox {-rainbow starts at}\, v \}. \end{aligned}$$

Clearly \(|R|, |S| \leqslant t(l,k-1)\). Every vertex \(v \in V \setminus R\) has at most \(k-1\) outgoing colours (or else any \((k-1)\)-rainbow ending at v could be extended to a k-rainbow), and similarly every vertex in \(V \setminus S\) has at most \(k-1\) incoming colours. By Lemma 2.1, it follows that \(|V \setminus (R \cup S)| \le (1 + 2 / \sqrt{l})^{k-1} \cdot l^{k-1}\) and therefore

$$\begin{aligned} |V| \leqslant |R| + |S| + |V \setminus (R \cup S)| \leqslant 2 \cdot t(l,k-1) + (l + 2 \sqrt{l})^{k-1}. \end{aligned}$$

This proves the claim. A straightforward induction on k with base case \(t(l,1) = 1\) yields

$$\begin{aligned} t(l,k)&\leqslant \sum _{i=0}^{k-1} \left(\frac{2}{l + 2 \sqrt{l}}\right)^i (l + 2 \sqrt{l})^{k-1} \leqslant \frac{1}{1 - \frac{2}{l + 2 \sqrt{l}}} (l + 2 \sqrt{l})^{k-1} \\&= \frac{l + 2 \sqrt{l}}{l + 2 \sqrt{l} - 2} \left(1 + \frac{2}{\sqrt{l}}\right)^{k-1} \cdot l^{k-1} \leqslant \left(1 + \frac{2}{\sqrt{l}}\right)^k \cdot l^{k-1}. \end{aligned}$$

\(\square \)

Next, we prove Theorem 1.9. To this end, we will consider so-called ‘robust’ vertices, which were introduced by Lefmann, Rödl, and Thomas [7] under a different name. Loosely, we call a vertex v robust if we can find long rainbows ending and/or starting at v that avoid any given colour.

Definition 2.2

Let r be a non-negative integer. A vertex v is r-in-robust if, for every colour a, some r-rainbow without colour a ends at v.

In-robust vertices are very useful for constructing long rainbows. Indeed, assume that u is an in-robust vertex with an edge of colour a to some other vertex v. Then, we can pick a long rainbow without colour a ending at u and try to connect this rainbow to some rainbow starting at v. Since the edge uv cannot interfere with the rainbow ending at u, choosing an appropriate rainbow starting at v might result in a long rainbow.

Of course, in-robust vertices are only useful if they are forced to occur in large enough tournaments. As above, it will suffice to consider tournaments with few incoming and outgoing colours at each vertex. Therefore, let g(lkr) denote the smallest integer such that if T is a tournament with more than g(lkr) vertices, then every edge colouring of T with at most \(k-1\) outgoing colours at each vertex contains an l-flash, a k-rainbow, or an r-in-robust vertex.

It turns out that g(lkr) is not much larger than t(lr). Therefore, in large tournaments we will be able to find r-in-robust vertices for large r, which we can then use to find k-rainbows as outlined above. This strategy yields the following bound on t(lk).

Lemma 2.3

For every \(k \geqslant 2\) and \(1 \leqslant r < k\),

$$\begin{aligned} t(l,k) \leqslant t(l,k-1) + g(l,k,r-1) + 1 + 2 (k-1) l^r \cdot t(l,k-r). \end{aligned}$$

Proof

Let \(T = (V, E)\) be an edge-coloured tournament with no l-flash or k-rainbow. Let

$$\begin{aligned} R = \{ v \in V :\hbox {no} \,(k-1) \hbox {-rainbow ends at} \,v \}. \end{aligned}$$

Then \(|R| \leqslant t(l,k-1)\), and every vertex in \(V \setminus R\) has at most \(k-1\) outgoing colours.

Order the vertices in \(V \setminus R\) in a way that maximises the number of forward edges of \(T[V \setminus R]\). In particular, every vertex in \(V \setminus R\) has outgoing edges to at least half of the vertices following it. Pick a minimal initial segment \(P \subseteq V \setminus R\) of this ordering such that T[P] contains an \((r-1)\)-in-robust vertex v (if no such vertex exists, then we already have \(|V| \leqslant |R| + |V \setminus R| \leqslant t(l,k-1) + g(l,k,r-1)\)). Note that \(|P| \le g(l,k,r-1) + 1\). Since v has outgoing edges to at least half of the vertices following it, its out-neighbourhood \(U = \{ u \in V :v u \in E \}\) satisfies \(|V \setminus (R \cup P)| \leqslant 2 |U|\).

For every colour \(a \in C^+ (v)\), let \(U_a = \{ u \in U :c(v u) = a \}\). Since v is \((r-1)\)-in-robust, we can choose an \((r-1)\)-rainbow \(W_a\) without colour a that ends at v, and extend it to each of the vertices in \(U_a\) by the edges of colour a. Let \(C_a\) be the set containing a and the \(r-1\) colours appearing in \(W_a\).

Next, for every \(m \in \{0, \dots , l-1\}^{C_a}\) define

$$\begin{aligned} U_a^m = \{ u \in U_a :l_b(u) = m_b \text { for all } b \in C_a \}. \end{aligned}$$

If the colour of an edge uw in \(T[U_a^m]\) is b, then \(l_b(u) < l_b(w)\), and so \(b \notin C_a\). Thus, if \(T[U_a^m]\) contained a \((k-r)\)-rainbow starting at some vertex u, then this rainbow would use no colour from \(C_a\) and could therefore be extended by the r-rainbow ending at u to a k-rainbow. It follows that \(T[U_a^m]\) contains no \((k-r)\)-rainbow, so \(|U_a^m| \le t(l,k-r)\) and

$$\begin{aligned} |U_a| = \sum _{m \in \{0, \dots , l-1\}^{C_a}} |U_a^m| \le \sum _{m \in \{0, \dots , l-1\}^{C_a}} t(l,k-r) \leqslant l^r \cdot t(l,k-r). \end{aligned}$$

Since v has at most \(k-1\) outgoing colours, this implies that

$$\begin{aligned} |U| = \sum _{a \in C^+ (v)} |U_a| \leqslant \sum _{a \in C^+ (v)} l^r \cdot t(l,k-r) \leqslant (k-1) l^r \cdot t(l,k-r). \end{aligned}$$

Putting everything together, we get

$$\begin{aligned} |V|&= |R| + |P| + |V \setminus (R \cup P)| \\&\leqslant |R| + |P| + 2 |U| \\&\leqslant t(l,k-1) + g(l,k,r-1) + 1 + 2 (k-1) l^r \cdot t(l,k-r). \end{aligned}$$

\(\square \)

To apply this lemma, we need a good bound on g(lkr). Fortunately, we can use a strategy similar to that used in the preceding proof to obtain the following result.

Lemma 2.4

For every \(r \geqslant 1\), it holds that

$$\begin{aligned} g(l,k,r) \leqslant g(l,k,r-1) + 1 + 2 (k-1) r l \cdot t(l,r). \end{aligned}$$

Proof

Let \(T = (V, E)\) be an edge-coloured tournament with no l-flash, no k-rainbow, no r-in-robust vertex, and at most \(k-1\) outgoing colours at each vertex. Order the vertices of T in a way that maximises the number of forward edges, and pick a minimal initial segment \(P \subseteq V\) of this ordering such that T[P] contains an \((r-1)\)-in-robust vertex v. As before, \(|P| \leqslant g(l,k,r-1) + 1\) and the out-neighbourhood \(U = \{ u \in V :v u \in E \}\) of v satisfies \(|V \setminus P| \leqslant 2 |U|\). For each \(a \in C^+ (v)\), define \(U_a\), \(W_a\), and \(C_a\) as in the previous proof.

Next, for every colour \(b \in C_a\), define

$$\begin{aligned} U_{a,b} = \{ u \in U_a :\text {every { r}-rainbow ending at { u} contains colour { b}} \}. \end{aligned}$$

By assumption, no vertex is r-in-robust, but for each \(u\in U_a\) there is an r-rainbow using only the colours of \(C_a\) ending at u. It follows that \(U_a = \bigcup _{b \in C_a} U_{a,b}\). Finally, for every \(m \in \{0, \dots , l-1\}\), let

$$\begin{aligned} U_{a,b}^m = \{ u \in U_{a,b} :l_b(u) = m \}. \end{aligned}$$

Now, if an edge uw in \(T[U_{a,b}^m]\) has colour b, then \(l_b(u) < l_b(w)\) which gives a contradiction. Thus, if \(T[U_{a,b}^m]\) contained an r-rainbow ending at some vertex u, then this rainbow would not use the colour b, contradicting \(u \in U_{a,b}\). It follows that \(T[U_{a,b}^m]\) contains no r-rainbow, so \(|U_{a,b}^m| \leqslant t(l, r)\) and

$$\begin{aligned} |U_a| \leqslant \sum _{b \in C_a} |U_{a,b}| = \sum _{b \in C_a} \sum _{m \in \{0, \dots , l-1\}} |U_{a,b}^m| \leqslant \sum _{b \in C_a} \sum _{m \in \{0, \dots , l-1\}} t(l,r) = r l \cdot t(l,r). \end{aligned}$$

Since v has at most \(k-1\) outgoing colours, this implies \(|U| \leqslant (k-1) r l \cdot t(l,r)\), and so

$$\begin{aligned} |V| = |P| + |V \setminus P| \leqslant |P| + 2 |U| \le g(l,k,r-1) + 1 + 2 (k-1) r l \cdot t(l,r). \end{aligned}$$

\(\square \)

Finally, to obtain numerical bounds on t(lk) and g(lkr), we apply these recursive bounds repeatedly. This is handled by the following corollary, which proves Theorem 1.9 and gives an upper bound on g(lkr) that will be useful in Sect. 3.

Corollary 2.5

For every \(\varepsilon > 0\), there is \(D_\varepsilon \) such that for \(r<k\)

$$\begin{aligned} t(l,k) \leqslant D_\varepsilon k (\log k)^{1+\varepsilon } \cdot l^{k-1} \quad \text {and} \quad g(l,k,r) \leqslant 4 D_\varepsilon k^3 (\log k)^{1+\varepsilon } \cdot l^r. \end{aligned}$$

Proof

From Lemma 2.3 and Lemma 2.4, we can obtain the inequalities

$$\begin{aligned} t(l,k)&\leqslant t(l,k-1) + g(l,k,r-1) + 2 k l^r \cdot t(l,k-r) \text { and} \\ g(l,k,r)&\leqslant g(l,k,r-1) + 2 k^2 l \cdot t(l,r) \end{aligned}$$

for \(k \geqslant 2\) and \(1 \leqslant r < k\).

Let \(k_0\geqslant 2\) be such that \(8 (3 \log k + 5) (\log (3 \log k + 5))^{1+\varepsilon } \leqslant (\log k)^{1+\varepsilon }\) for all \(k \geqslant k_0\). By Theorem 1.8, there is \(D_\varepsilon \) such that \(t(l,k) \le D_\varepsilon k (\log k)^{1+\varepsilon } \cdot l^{k-1}\) for all \(k < k_0\).

We prove the corollary by induction on k. Assume that we have already proved it for all \(k' < k\). We may also assume that \(l \ge 2\) since \(t(1,k) = g(1,k,r) = 1\). Then, for \(r < k\), a simple induction on r with base case \(g(l,k,0) = 0\) yields

$$\begin{aligned} g(l,k,r)&\leqslant g(l,k,r-1) + 2 k^2 l \cdot t(l,r) \\&\leqslant 4 D_\varepsilon k^3 (\log k)^{1+\varepsilon } \cdot l^{r-1} + 2 D_\varepsilon k^3 (\log k)^{1+\varepsilon } \cdot l^r {\mathop {\leqslant }\limits ^{l \ge 2}} 4 D_\varepsilon k^3 (\log k)^{1+\varepsilon } \cdot l^r. \end{aligned}$$

To bound t(lk), we may assume that \(k \geqslant k_0\) by our choice of \(D_\varepsilon \). Note that

$$\begin{aligned} t(l,k-1) \leqslant D_\varepsilon k (\log k)^{1+\varepsilon } \cdot l^{k-2} {\mathop {\leqslant }\limits ^{l \ge 2}} \frac{D_\varepsilon k (\log k)^{1+\varepsilon } \cdot l^{k-1}}{2}. \end{aligned}$$

Choose

$$\begin{aligned} r = \left\lfloor {k - \frac{2 \log k + \log 16}{\log l}} \right\rfloor , \end{aligned}$$

then

$$\begin{aligned} g(l,k,r-1) \leqslant 4 D_\varepsilon k^3 (\log k)^{1+\varepsilon } \cdot l^{k - 1 - \frac{2 \log k + \log 16}{\log l}} = \frac{D_\varepsilon k (\log k)^{1+\varepsilon } \cdot l^{k-1}}{4}. \end{aligned}$$

Also,

$$\begin{aligned} r&\geqslant k - \frac{2 \log k + \log 16}{\log l} - 1 \geqslant k - \frac{2 \log k + \log 16}{\log 2} - 1 \geqslant k - (3 \log k + 5) \end{aligned}$$

and so, using the fact that \(k \geqslant k_0\), we have

$$\begin{aligned} 8 (k-r) (\log (k-r))^{1+\varepsilon } \leqslant 8 (3 \log k + 5) (\log (3 \log k + 5))^{1+\varepsilon } \leqslant (\log k)^{1+\varepsilon }. \end{aligned}$$

It follows by induction that

$$\begin{aligned} 2 k l^r \cdot t(l,k-r) \leqslant 2 k D_\varepsilon (k-r) (\log (k-r))^{1+\varepsilon } \cdot l^{k-1} \leqslant \frac{D_\varepsilon k (\log k)^{1+\varepsilon } \cdot l^{k-1}}{4}. \end{aligned}$$

Combining, we obtain

$$\begin{aligned} t(l,k)&\leqslant t(l,k-1) + g(l,k,r-1) + 2 k l^r \cdot t(l,k-r) \\&\leqslant \left(\frac{1}{2} + \frac{1}{4} + \frac{1}{4}\right) D_\varepsilon k (\log k)^{1+\varepsilon } \cdot l^{k-1} \\&= D_\varepsilon k (\log k)^{1+\varepsilon } \cdot l^{k-1}. \end{aligned}$$

\(\square \)

3 Upper Bounds for Transitive Tournaments

In this section we prove Theorem 1.3, that is, we show that \(f(l,k) = l^{k-1}\) if l is sufficiently large in terms of k. We will follow a similar strategy to that used by Lefmann, Rödl, and Thomas [7] when they showed this equality for \(l \ge (3 k)^{2 k}\), but our bounds and arguments from the previous section will allow us to improve the dependence on k.

The idea of the proof is to find a strongly \((k-2)\)-robust vertex, that is, a vertex v such that there exists a set C of \(k-1\) colours which contains all colours incident to v and which has the property that for all \(a\in C\), there is a \((k-2)\)-rainbow with colour set \(C \setminus \{a\}\) that ends at v, and also one that starts at v. The existence of such a vertex will allow us to show that every 2-flash in the entire tournament takes its colour from C, which will in turn allow us to reduce the problem to the \(l = 2\) case, for which Lefmann, Rödl, and Thomas [7] have already shown that the result holds.

Theorem 3.1

(Lefmann, Rödl, Thomas) For all positive integers k, \(f(2,k) = 2^{k-1}\).

This final ingredient, Theorem 3.1, is the only part of the proof where we need our tournament to be transitive: our arguments will show that if \(t(2,k)=2^{k-1}\) for all k, then Theorem 1.3 holds with t(lk) in place of f(lk). For this reason, we will state and prove most of the results in this section for arbitrary tournaments.

We begin by explaining how the fact that few colours appear in 2-flashes allows us to reduce the problem to the \(l = 2\) case. Write \( C^{m\text {-flash}} (v)\) for the set of colours a such that there exists an m-flash of colour a containing v.

Lemma 3.2

Let \(1 \leqslant m \leqslant l\), let \(T = (V, E)\) be an edge-coloured tournament containing no l-flash or k-rainbow, and suppose that \(| C^{m\text {-flash}} (v)| \leqslant c\) for every vertex v. Then,

$$\begin{aligned} |V| \leqslant t(m,k) \left(\frac{l}{m}\right)^c. \end{aligned}$$

We will use a probabilistic argument similar to that used to prove Lemma 2.1. Here, it suffices if \(l_a(v)\) simply denotes the length of the longest flash of colour a ending at v.

Proof

For every colour a, choose a subset \(L_a \subseteq \{0, \dots , l-1\}\) of size m uniformly and independently at random. Define

$$\begin{aligned} U = \left\{ v \in V :l_a(v) \in L_a \text { for all } a \in C^{m\text {-flash}} (v) \right\} , \end{aligned}$$

and note that T[U] contains no m-flash \(v_0, \dots , v_m\) in any colour a. Indeed, otherwise \(l_a(v_0)< \dots < l_a(v_m)\) with \(a \in C^{m\text {-flash}} (v_i)\) for every i, so \(L_a\) has size at least \(m+1\), which is a contradiction. Hence, \(|U| \leqslant t(m,k)\). On the other hand, for every vertex v we have \({{\,\mathrm{\mathbb {P}}\,}}(v \in U) = (m/l)^{| C^{m\text {-flash}} (v)|} \geqslant (m/l)^c\), and so

$$\begin{aligned} |V| \left(\frac{m}{l}\right)^c \leqslant \sum _{v \in V} {{\,\mathrm{\mathbb {P}}\,}}(v \in U) = {{\,\mathrm{\mathbb {E}}\,}}(|U|) \leqslant t(m,k), \end{aligned}$$

which implies that \( |V| \leqslant t(m,k) \left({l}/{m}\right)^c\). \(\square \)

Next, we show how the existence of a strongly \((k-2)\)-robust vertex implies that few colours occur in 2-flashes.

Lemma 3.3

Let \(k\geqslant 2\) and let \(T=(V,E)\) be an edge-coloured tournament containing no k-rainbow. Suppose that T contains a strongly \((k-2)\)-robust vertex. Then at most \(k-1\) colours occur in 2-flashes.

Proof

Let u be a strongly \((k-2)\)-robust vertex in T, and let C be the corresponding set of \(k-1\) colours. Suppose for a contradiction that there exists a 2-flash \(v_0, v_1, v_2\) of some colour \(b \notin C\) in T. Consider the case that the edge between u and \(v_1\) is directed towards \(v_1\), and let \(a\in C\) be the colour of that edge. Since u is strongly \((k-2)\)-robust, some \((k-2)\)-rainbow with colour set \(C\setminus \{a\}\) ends at u. Extending this \((k-2)\)-rainbow to \(v_1\) and \(v_2\) yields a k-rainbow in T, which is a contradiction. The case that the edge between u and \(v_1\) is directed towards u is similar. Hence, no 2-flash of a colour not in C can exist in T. Since \(|C| = k-1\), the result follows. \(\square \)

The last step will be to show that every sufficiently large tournament with no l-flash or k-rainbow contains a strongly \((k-2)\)-robust vertex. The proof of this result is similar to the proofs of Lemmas 2.3 and 2.4.

Lemma 3.4

Let \(k \geqslant 2\) and let \(T = (V, E)\) be an edge-coloured tournament containing no l-flash and no k-rainbow with

$$\begin{aligned} |V| \geqslant{} & {} t(l,k-1) + g(l,k,k-2) \\{} & {} + 2 (k-1)\Bigl (t(l,k-1) + 2 (k-1) l \cdot t(l,k-2)\Bigr ) + 2. \end{aligned}$$

Then T contains a strongly \((k-2)\)-robust vertex.

Proof

Define

$$\begin{aligned} R = \{ v \in V :\hbox {no} ~(k-1) \hbox {-rainbow ends at}~ v \}. \end{aligned}$$

Then \(|R| \leqslant t(l,k-1)\), and every vertex in \(V \setminus R\) has at most \(k-1\) outgoing colours.

Order the vertices in \(V \setminus R\) in a way that maximises the number of forward edges of \(T[V \setminus R]\), and pick a minimal initial segment \(P \subseteq V \setminus R\) of this ordering such that T[P] contains a \((k-2)\)-in-robust vertex v. Then \(|P| \leqslant g(l,k,k-2) + 1\) and the out-neighbourhood \(U = \{ u \in V :v u \in E \}\) of v satisfies \(2 |U| \geqslant |V \setminus (R \cup P)|\). So,

$$\begin{aligned} 2 |U| \geqslant |V| - |R| - |P| \geqslant 2 (k-1) \Bigl (t(l,k-1) + 2 (k-1) l \cdot t(l,k-2)\Bigr ) + 1 \end{aligned}$$

which implies that

$$\begin{aligned} |U| \geqslant (k-1) \Bigl (t(l,k-1) + 2 (k-1) l \cdot t(l,k-2)\Bigr ) + 1. \end{aligned}$$

For every colour \(a \in C^+ (v)\), let \(U_a = \{ u \in U :c(v u) = a \}\). Since v has at most \(k-1\) outgoing colours, there must exist a colour a such that \(|U_a| \geqslant {|U|}/{(k-1)}\) and so

$$\begin{aligned} |U_a| \geqslant t(l,k-1) + 2 (k-1) l \cdot t(l,k-2) + 1. \end{aligned}$$

Since v is \((k-2)\)-in-robust, we can choose a \((k-2)\)-rainbow W without colour a that ends at v, and extend it to each of the vertices in \(U_a\) by the edges of colour a. Let C be the set containing a and the \(k-2\) colours appearing in W. Then, every outgoing colour of every vertex \(u \in U_a\) must be a colour from C. In particular, all edges in \(T[U_a]\) have one of the \(k-1\) colours from C.

Define

$$\begin{aligned} S = \{ u \in U_a :\text {no}~ (k-1)\text {-rainbow in}\, T\,[U_a] \text { starts at}~ u \}. \end{aligned}$$

Then \(|S| \leqslant t(l,k-1)\). For every vertex \(u \in U_a \setminus S\), some \((k-1)\)-rainbow in \(T[U_a]\) starts at u. Since every edge in \(T[U_a]\) has a colour from C, this \((k-1)\)-rainbow uses only colours from C, and so every incoming colour of u in T must be a colour from C.

Next, for every colour \(b \in C\), define

$$\begin{aligned}&U_{a,b} = \{ u \in U_a :\hbox {every}\, (k-2) \hbox {-rainbow in}~ T[U_a] \, \text {ending at }u \text { contains colour}~ b \} \, \text { and} \\&V_{a,b} = \{ u \in U_a :\text {every}\, (k-2)\text {-rainbow in}~ T[U_a] \, \text {starting at }u \text { contains colour}\, b \}. \end{aligned}$$

For every \(m \in \{0, \dots , l-1\}\), let

$$\begin{aligned} U_{a,b}^m = \{ u \in U_{a,b} :l_b(u) = m \}. \end{aligned}$$

If an edge uw in \(T[U_{a,b}^m]\) has colour b, then \(l_b(u) < l_b(w)\) which gives a contradiction. Thus, \(T[U_{a,b}^m]\) contains no \((k-2)\)-rainbow, so \(|U_{a,b}^m| \leqslant t(l,k-2)\) and \(|U_{a,b}| \leqslant l \cdot t(l,k-2)\). Similarly, \(|V_{a,b}| \le l \cdot t(l,k-2)\).

Finally, consider \(U_a' = U_a \setminus (S \cup \bigcup _{b \in C} (U_{a,b} \cup V_{a,b}))\), so

$$\begin{aligned} |U_a'| \geqslant |U_a| - |S| - \sum _{b \in C} (|U_{a,b}| + |V_{a,b}|) \geqslant 1. \end{aligned}$$

Let \(u \in U_a'\) be arbitrary. For every colour \(b \in C\), there is a \((k-2)\)-rainbow in \(T[U_a]\) without colour b that ends at u, and also one that starts at u. Since every edge in \(T[U_a]\) has a colour from C, the colour set of these \((k-2)\)-rainbows is \(C \setminus \{b\}\). This shows that u is strongly \((k-2)\)-robust in T. \(\square \)

We can now combine the preceding three lemmas and insert the bounds from the previous section to prove the following.

Corollary 3.5

For every \(\varepsilon > 0\), there is \(C_\varepsilon \) such that for all \(k \geqslant 2\),

$$\begin{aligned} t(l,k) \leqslant \max \left\{ C_\varepsilon k^3 (\log k)^{1+\varepsilon } \cdot l^{k-2}, t(2,k) \left(\frac{l}{2}\right)^{k-1}\right\} . \end{aligned}$$

Proof

Let \(D_\varepsilon \) be given by Corollary 2.5, and let \(C_\varepsilon = 12 D_\varepsilon \). Suppose that \(T = (V, E)\) is an edge-coloured tournament containing no l-flash and no k-rainbow with \(|V| \geqslant C_\varepsilon k^3 (\log k)^{1+\varepsilon } \cdot l^{k-2}\). Then, we have

$$\begin{aligned} |V| \geqslant {}&12 D_\varepsilon k^3 (\log k)^{1+\varepsilon } \cdot l^{k-2} \\ \geqslant {}&4 D_\varepsilon k^3 (\log k)^{1+\varepsilon } \cdot l^{k-2} + 2 k \cdot D_\varepsilon k (\log k)^{1+\varepsilon } \cdot l^{k-2}\\&+ 4 k^2 l \cdot D_\varepsilon k (\log k)^{1+\varepsilon } \cdot l^{k-3} + 2 \\ \geqslant {}&g(l,k,k-2) + (2 (k-1) + 1) t(l,k-1) + 4 (k-1)^2 l \cdot t(l,k-2) + 2 \\ = {}&t(l,k-1) + g(l,k,k-2) \\&+ 2 (k-1) (t(l,k-1) + 2 (k-1) l \cdot t(l,k-2)) + 2. \end{aligned}$$

Hence, by Lemma 3.4, T contains a strongly \((k-2)\)-robust vertex. Applying Lemma 3.3 yields that at most \(k-1\) colours appear in 2-flashes in T, and the result now follows from Lemma 3.2. \(\square \)

Specialising these proofs to transitive tournaments, the preceding corollary tells us that \(f(l,k) \leqslant \max \{C_\varepsilon k^3 (\log k)^{1+\varepsilon } \cdot l^{k-2}, f(2,k) (l/2)^{k-1}\}\). We can now prove Theorem 1.3.

Proof of Theorem 1.3

Let \(C_\varepsilon \) be given by Corollary 3.5. The result is trivial for \(k=1\) so assume that \(k\geqslant 2\). If \(l \geqslant C_\varepsilon k^3 (\log k)^{1+\varepsilon }\), then \(C_\varepsilon k^3 (\log k)^{1+\varepsilon } \cdot l^{k-2} \leqslant l^{k-1}\), and by Theorem 3.1 we know that \(f(2,k) (l/2)^{k-1} = l^{k-1}\). Therefore, Corollary 3.5 implies that \(f(l,k) \leqslant l^{k-1}\). \(\square \)

4 Colourings of Arbitrary Tournaments

In this section, we ask how small a tournament can be while still having the property that every colouring of its edges contains an l-flash or a k-rainbow. For \(k = 2\), any non-transitive tournament is an example of this: if the tournament has a directed cycle, this cycle either contains two consecutive edges with different colours, creating a 2-rainbow, or the cycle is monochromatic, creating flashes of arbitrary lengths. For \(l\geqslant 2\) and \(k \geqslant 3\), we show that there are tournaments on fewer than f(lk) vertices with the desired property.

Proof of Theorem 1.10

Set \(n = f(l,k)\) and let T be the “increasing” transitive tournament on \([n - 1]\) with the edge from 1 to \(n - 1\) reversed, that is \(V(T) = [n-1]\) and

$$\begin{aligned} E(T) = \{ u v :1 \leqslant u < v \leqslant n - 1,\ u v \ne (1, n - 1) \} \cup \{(n - 1, 1) \}. \end{aligned}$$

Suppose that T has an edge colouring c with neither l-flashes nor k-rainbows. Define an edge colouring \(c'\) of the “increasing” transitive tournament \(T'\) on the vertex set \(\{0\}\cup [n]\) as follows. For any edge uv of T with \(u v \ne (n - 1, 1)\), let \(c'(u v) = c(u v)\). Next, for any \(v \in [n - 1]\), let \(c'(0, v)\) be the colour of any incoming edge of v in T, and let \(c'(v, n)\) be the colour of any outgoing edge of v in T (every vertex in T has an incoming and outgoing edge). Finally, let \(c'(1, n - 1)\) and \(c'(0,n)\) be distinct and entirely new colours.

Note first that the edge (0, n) is not contained in an l-flash or k-rainbow since it is in no walk of length greater than 1. Next, the edge \((1, n - 1)\) is not contained in an l-flash in \(T'\) since there are no other edges with the same colour. It is also not contained in a k-rainbow since the only 3-walk containing that edge is \(0, 1, n - 1, n\), but \(c'(0,1) = c(n-1,1) = c'(n-1,n)\). On the other hand, for every walk w in \(T'\) containing neither (0, n) nor \((1, n-1)\), there is a walk in T with the same colours. Indeed, if w uses the edge (0, v) for \(v\in [n-1]\), then by the construction of \(c'\) this can be replaced by an edge of T incident to v of the same colour, and the same holds for edges (vn). Since T contains no l-flash and no k-rainbow, it follows that \(T'\) also contains no l-flash and no k-rainbow. However, \(T'\) is a transitive tournament with \(n + 1 = f(l,k) + 1\) vertices, contradicting the definition of f(lk). \(\square \)

In the positive direction, we prove that all tournaments with \( \mathcal {O} (l^{k-2} / \sqrt{k})\) vertices can be coloured in a way that avoids l-flashes and k-rainbows. Our construction is very similar to the construction from the introduction which showed that \(f(l,k) \geqslant l^{k-1}\). However, it only uses those strings whose entries sum to a fixed value. This ensures that no matter how an edge is directed, we can always pick an index where the first string has a smaller value than the second string.

Proof of Theorem 1.11

Let

$$\begin{aligned} X = \left\{ x \in [l]^{k - 1} :\sum _{i = 1}^{k-1} x_i = \left\lfloor \frac{l (k-1)}{2}\right\rfloor \right\} . \end{aligned}$$

A result of Anderson [1] says that there is a constant \(C > 0\) (independent of l and k) such that \(|X| \geqslant C l^{k - 2}/\sqrt{k}\). Let \(T = (V, E)\) be a tournament with at most \(C l^{k - 2}/\sqrt{k}\) vertices.

As \(|V| \leqslant |X|\), we can assign to every vertex v a unique \(x(v) \in X\). Define an edge colouring of T by picking, for an edge \(u v \in E\), a colour \(c(u v) \in [k-1]\) such that \(x(u)_{c(u v)} < x(v)_{c(u v)}\). By the construction of X, this is always possible.

Since this edge colouring uses at most \(k - 1\) colours, there is no k-rainbow. If there were an l-flash \(v_0, \dots , v_l\) of colour a, then \(x(v_0)_a< x(v_1)_a< \dots < x(v_l)_a\), implying \(x(v_l)_a > l\), which is a contradiction. Thus this gives an edge colouring of T without l-flashes and k-rainbows. \(\square \)

Note that X is the largest antichain in the grid poset [3] and so \(C l^{k - 2}/\sqrt{k}\) is the best bound that can be attained by this simple strategy. With additional work, it is possible to slightly strengthen Theorem 1.11. We sketch the argument, which combines our proof with an argument from Bucić, Letzter, and Sudakov [2] and improves the bound to \(C l^{k-2} (\log l)^{1/(k-1)} / \sqrt{k}\). The idea is to partition a tournament of size n into \( \mathcal {O} (n / \log l)\) transitive tournaments of size \( \mathcal {O} (\log l)\) each. From the introduction, we know that each of the transitive tournaments can be coloured with \(k-1\) colours and no a-flash if \(a^{k-1} = \Omega (\log l)\). Moreover, the previous proof provides a way to colour the edges between the transitive tournaments with \(k-1\) colours and no b-flash provided \(b^{k-2} / \sqrt{k} = \Omega (n / \log l)\). The tournament will then contain no (ab)-flash, so we need \(a b \leqslant l\), and this is satisfied if \(n = \mathcal {O} (l^{k-2} (\log l)^{1/(k-1)} / \sqrt{k})\).

5 Open Problems

We have proved that Lefmann, Rödl, and Thomas’s conjecture, Conjecture 1.2, holds for \(l \geqslant k^3 (\log k)^{1+o(1)}\), but the conjecture remains open when l is small compared to k. The case \(l = 3\) (that is, proving \(f(3, k) = 3^{k - 1}\)) is already of significant interest. In this setting, there are edge-coloured transitive tournaments with more than \(l^{k-1}\) vertices that contain no l-flash and no k-rainbow starting at the first vertex. The existence of k-rainbows starting at the first vertex was a crucial ingredient in Lefmann, Rödl, and Thomas’s proof that \(f(2, k) = 2^{k - 1}\).

Conjucture 1.7 remains wide open for any \(l \geqslant 2\) and \(k \ge 3\). Establishing this conjecture for \(l = 2\) would be very useful as our results would then imply that the conjecture also holds for \(l \geqslant k^3 (\log k)^{1 + o(1)}\).

In terms of general upper bounds on f(lk) and t(lk), an interesting next step would be to reduce the gap between the upper and the lower bounds to a multiplicative factor that is sublinear in k. All of our arguments relied on certain vertices having at most \(k-1\) outgoing colours, which always added a factor of at least k to our upper bounds.

Problem 5.1

For positive integers l and k, is it true that \(f(l,k) = o(k) \cdot l^{k-1}\)?

We have also constructed a tournament with \(f(l,k)-1\) vertices, every edge colouring of which contains an l-flash or a k-rainbow. Are there tournaments with o(f(lk)) vertices that satisfy this? We believe random tournaments are good candidates.

Problem 5.2

What is the minimal n such that, for a uniformly random tournament on n vertices, with high probability every edge colouring contains an l-flash or a k-rainbow?

Finally, we defined flashes and rainbows in tournaments to be walks, but it is possible to consider the same problem with paths instead. This adds some technical difficulties. For example, when we split a set of vertices according to the longest flash of colour a ending in those vertices, it is no longer guaranteed that each resulting set contains no edge of colour a: the vertices in a directed cycle of colour a could all end up in the same set. However, Conjecture 1.7 could still hold in this more restrictive setting.

Conjecture 5.3

Let l and k be positive integers and let T be a tournament with \(l^{k-1}+1\) vertices. Then every edge colouring of T contains a directed monochromatic path of length l or a directed rainbow path of length k.