Generalized Ramsey numbers: forbidding paths with few colors

Let $f(K_n, H, q)$ be the minimum number of colors needed to edge-color $K_n$ so that every copy of $H$ is colored with at least $q$ colors. Originally posed by Erd\H{o}s and Shelah when $H$ is complete, the asymptotics of this extremal function have been extensively studied when $H$ is a complete graph or a complete balanced bipartite graph. Here we investigate this function for some other $H$, and in particular we determine the asymptotic behavior of $f(K_n, P_v, q)$ for almost all values of $v$ and $q$, where $P_v$ is a path on $v$ vertices.


Introduction
The classical graph Ramsey problem asks, "for a given k and p, what is the smallest n such that every edge-coloring of K n with k colors contains a monochromatic K p ?" We may invert the roles of k and n in this question: for a given n and p, what is the largest k such that every edge-coloring of K n with k colors contains a monochromatic K p ? This is equivalent to determining the smallest k + 1 such that there exists an edge-coloring of K n with k + 1 colors such that every copy of K p contains at least 2 colors. Let f (G, H, q) be the minimum number of colors needed to edge-color G so that every copy of H in G contains at least q colors. 1 The classical Ramsey problem is then equivalent to determining f (K n , K p , 2); as an example from [8], the Ramsey number R(3, 3, 3) = 17 is equivalent to f (K 16 , K 3 , 2) = 3 and f (K 17 , K 3 , 2) = 4. Additionally, f (G, H, e(H)) can be viewed as a variant of the rainbow Ramsey problem, where every copy of H must receive all distinct colors (as defined in [2]). In this way studying f (G, H, q) for general q bridges the gap between these problems.
The function f (K n , K p , q) was first introduced by Erdős and Shelah (see Section 5 of [5]), and while Elekes, Erdős, and Füredi had some preliminary results (described in Section 9 of [6]), the problem was first systematically studied by Erdős and Gyárfás [8]. They focused on the asymptotics of f (K n , K p , q) for large n, with p and q fixed. They also determined the linear and quadratic thresholds of this function, that is, they determined the smallest q(p) such that f (K n , K p , q(p)) = Ω(n) (or = Ω(n 2 ), resp.). Axenovich, Füredi, and Mubayi [1] adapted these results to f (K n,n , K p,p , q) in addition to relating these problems to other results in extremal combinatorics. Many others (only a few of which are mentioned here) have studied f (K n , K p , q) and f (K n,n , K p,p , q) for q between the linear and quadratic thresholds [14,15], above the quadratic Figure 1: threshold [1,13], and at the 'polynomial' threshold [3]. Besides two general results in [1], little has been said for f (K n , H, q) when H is not complete or complete bipartite. The aim of this paper is to open up the study of f (K n , H, q) for general H. We consider H and q as fixed, determining the asymptotics of f (K n , H, q) in terms of n. In Section 2 we make some general observations for all H, supplementing those in [1]. One of the first Ramsey results for non-complete graphs is due to Gerencsér and Gyárfás [10], who determined that every 2-coloring of K n has a monochromatic path of order ⌈(2n + 1)/3⌉. Inspired by this, in Section 3 we find the asymptotics of f (K n , P v , q) for most v and q, where P v denotes the path on v vertices: See Figure 1 for a complete summary of the results of Section 3. The only undetermined cases are when v ≥ 7 is odd and q = v+1 2 . Here we can show that f (K n , P v , q) is neither linear nor quadratic in n, but somewhere in between. It is not clear what the correct asymptotics are for these cases, so we pose the following problem.
2 ) for odd v ≥ 7. Note that f (K n , P v , q) is almost always either Θ(n) or Θ(n 2 ) (with the only notable exception mentioned above). This is in great contrast to the behavior of f (K n , K p , q). Pohoata and Sheffer [11] showed that for p ≥ 2(m + 1) ≥ 6, and they noted that Theorem 2.1 (below) implies an upper bound of where ε(p) goes to zero as p grows. Thus, for each value of m, the upper bound gets asymptotically close to the lower bound for sufficiently large p. This means that f (K n , K p , q), as a function of q, attains arbitrarily many asymptotic values (even while ignoring subpolynomial factors), for sufficiently large p. Similarly tight results can be obtained for the bipartite variant f (K n,n , K p,p , q), using essentially the same method as [11]. Define T (H), the number of 'tiers' for H, to be the number of q ≥ 2 such that f (K n , H, q) and f (K n , H, q + 1) differ by some polynomial factor. Above we concluded that T (K p ) is some unbounded function of p, whereas Theorem 1.1 and the results of Section 2 show that T (P v ), T (S t ), T (tK 2 ) are all at most 3 for all v and t, where S t and tK 2 is a star and a matching on t edges, respectively. It would be interesting to know for what other classes H of graphs is T (H) bounded for all H ∈ H. This may be the case when the graphs of H are sufficiently sparse, perhaps if they were all trees.

Notation and Terminology
The number of edges of H is denoted by e(H), while the number of vertices of H is denoted by v(H). A copy of H in G is a subgraph of G isomorphic to H. All colorings are edge-colorings. For a color c, the c-degree of a vertex u, denoted d c (u), is the number of edges of color c incident to u. The Turán number of H, denoted ex(n, H) is the largest number of edges an n-vertex graph may have without containing a copy of H. For a positive integer t, tH is the disjoint union of t copies of H.
It will often be helpful to think of f (G, H, q) in terms of repeated colors. If color c appears on exactly r + 1 edges in a coloring of H, then we say color c is repeated r times. We say H has r 'repetitions' or 'repeats' if r = r i , where color c i is repeated r i times, the sum being over all colors. Note that if H has r repetitions and contains exactly q colors, then r + q = e(H). With this in mind, let f (G, H, r) = f (G, H, e(H) − r). For example, the number of colors required so that there are no 'isosceles' triangles is f (K n , K 3 , 0) = f (K n , K 3 , 3).

General Observations
A wide-reaching upper bound on f (G, H, q) is achieved with a simple application of the Lovász Local Lemma. This idea first appeared in [8] but was stated in full generality in [1]. The following bound is close to asymptotically tight in many cases when q is large. In the tradition of Erdős and Gyárfás [8], we ask what are the linear and quadratic thresholds for any graph H. The question of the linear threshold was solved for connected H in [1], whose result and proof we give here in slightly more generality for completeness. Proof. The upper bound comes from Theorem 2.1.
For the lower bound, we show that if one color class is too large, we can find a copy of H with at least v − 1 − c repeats. Let F be an edge-maximal spanning forest of H (since H may not be connected), and let T be a tree on v vertices which contains F . Note that T consists of F along with c − 1 more edges. It is well known that ex(n, T ) ≤ vn, that is, any graph on n vertices with at least vn edges contains every tree on v vertices. 2 If some color in a coloring of K n contains more than vn edges, then we can find a monochromatic T and thus a monochromatic F , which has v − c − 1 repeats. This in turn gives a copy of H with at least v − c − 1 repeats. If we require each copy of H to have at most v − c − 2 repeats, then we must use at least n 2 /(vn) colors. More succinctly, Note that when H is connected, Theorem 2.2 gives the linear threshold as q = e − v + 3. What is the best one can do when H is disconnected? The threshold of q = e − v + 2 + c given by Theorem 2.2 is still correct for forests, since in that case e − v + 2 + c = 2. On the other hand, it is not immediately clear if the linear threshold for H = 2K 3 is q = 4 or q = 3.
We now turn to the quadratic threshold, the smallest q for which f (K n , H, q) is quadratic in n. We can answer this question exactly for some graphs, specifically those with a perfect matching and maximum degree at least v/2, where v is the number of vertices: The lower bound f (K n , H, ⌊v/2⌋−2) = Ω n 2 is obtained as follows. Suppose we have a coloring of K n where every copy of H has at most ⌊v/2⌋ − 2 repeats. If there is either a monochromatic matching or a monochromatic star with ⌊v/2⌋ edges, then there is a copy of H with at least ⌊v/2⌋−1 repeats. For a given color, the endpoints of a maximal matching form a vertex cover of size less than v, each vertex of which is incident to fewer than ⌊v/2⌋ edges. Thus each color class has size less than v 2 /2, and so there are at least 2 v 2 n 2 colors.
Note that the proof of Proposition 2.3 relies on only two forbidden substructures, both of which are monochromatic. The more advanced proof of Pohoata and Sheffer [11] uses two forbidden substructures, but only one is monochromatic. The other contains many colors and is crucial to obtaining lower bounds of the form Ω (n α ) for fractional α (for example, in Proposition 3.5 below). Proposition 2.3 clearly generalizes to the following statement. One may hope that the quadratic threshold for H is always the one given in Proposition 2.3, q = e − ⌊v/2⌋ + 2, even when the hypotheses are not satisfied. In fact, this is the case for paths (see Theorem 1.1). However, there are three extreme cases where the quadratic threshold does not even exist: a star with t edges, denoted S t , a matching with t edges, denoted tK 2 , and the triangle. In the following it is understood that t ≥ 2. Recall that f (K n , H, 0) = f (K n , H, e(H)) is the minimum number of colors needed so that every copy of H is 'rainbow.' In fact, if we color the edge between vertex n − 1 and vertex n with color n − 2, this gives a coloring showing that f (K n , tK 2 , 0) ≤ n − 2. To see that f (K n , tK 2 , 0) ≥ n − 2, note that every color class must either be a star or a triangle. The number of edges covered by k stars is at most (n − 1) + · · · + (n − k), so the number of edges covered by n − 3 of these color classes is at most (n − 1) + · · · + 3 < n 2 .
Coloring 2.6. The edge set of K n can be partitioned into matchings of size ⌊n/2⌋ (when n is even this partition is known as a 1-factorization). Color the edges of K n according to which matching contains them. This coloring contains either n or n − 1 colors, and shows that f (K n , S t , 0) = O(n).
Proof. If H has a matching of size two and a vertex of degree at least two, then f (K n , H, 0) = Θ n 2 by Proposition 2.4. The only graphs without those properties are matchings, stars, and the triangle.

Paths
We now turn our attention to the asymptotics of f (K n , P v , q), where P v is a path on v ≥ 4 vertices. (Recall that the asymptotics of P 3 = S 2 were found in Section 2.) We show the range of q for which f (K n , P v , q) is linear in n in Proposition 3.1, and the range for which it is quadratic in n in Theorem 3.3. The only gap in these ranges is bounded in Proposition 3.5. See Figure 1 for a summary of these results. Proposition 3.1. For every 2 ≤ q ≤ ⌊v/2⌋, we have f (K n , P v , q) = Θ(n).
The lower bound follows by Theorem 2.2 and the upper bound by Coloring 2.5.
Now we find the quadratic threshold for paths. We first give a lemma which facilitates the proofs of Theorem 3.3 and Proposition 3.5.
In any coloring of K n , one of three things must occur: • there exists a copy of P v with at least ⌊(v − 1)/2⌋ repeats, • Ω(n 2 ) colors are used, or • there exist at least n 2 /16k log n color classes each with a matching of at least k/16v edges, for some k ≥ 16v 2 .
Proof. Let K n be colored with colors from C such that every copy of P v repeats at most ⌈(v − 1)/2⌉− 1 colors. First note that every color class has size less than vn, or else we would find a monochromatic P v (see e.g. [7]). For a color c, let E c denote the set of edges of color c. Suppose that for every k ≥ 16v 2 , there are at most n 2 /8k log n color classes each of size at least k. Let C i = {c : i ≤ |E c |}, and let C ′ = {c : |E c | ≤ 32v 2 }. Then which implies |C ′ | = Ω(n 2 ), so |C| = Ω(n 2 ), as desired. Now suppose that there is some k ≥ 16v 2 such that |C k | ≥ n 2 /8k log n; fix one such k. Let C * be the set of colors c ∈ C k such that there is a monochromatic matching in color c with at least k 16v edges. If |C * | ≥ 1 2 |C k | ≥ n 2 /16k log n, then we are done. Otherwise, we have |C * | < 1 2 |C k |, and we will find a copy of P v with at least ⌊(v − 1)/2⌋ repeats with the use of an auxiliary bipartite graph.
Let c ∈ C k \ C * , and let S be a minimum vertex cover for the edges of color c. Since the endpoints of the edges of a maximal matching form a vertex cover and c has a maximal matching of size at most k 16v , we have |S| ≤ k 8v . Since the vertices of S of c-degree less than 4v cover at most 4v|S| ≤ k 2 edges of E c , then at least half of E c is incident to vertices of c-degree at least 4v. Let G be the bipartite graph with parts X = V (K n ) and Y = {(u, c) : c ∈ C k \ C * , u ∈ V (K n ), d c (u) ≥ 4v} and an edge between x ∈ X and (u, c) ∈ Y if the edge ux is colored with c. Note that for a given color c, the number of edges incident to vertices of the form (u, c) is at least On the other hand, it is clear from the definition of Y that |E(G)| ≥ 4v|Y |. We delete vertices of degree at most v repeatedly from X and Y until we cannot delete any more, leaving us with a bipartite graph G ′ with minimum degree greater than v. To show that G ′ is not empty, suppose we delete D edges from G; observe that which can be seen by splitting into the cases |Y | > |X| and n = |X| ≥ |Y |. Thus G ′ is not empty, and the minimum degree of G ′ is at least v + 1. We greedily construct a path x 1 (u 1 , c 1 ) · · · x ⌊v/2⌋ (u ⌊v/2⌋ , c ⌊v/2⌋ )x ⌊v/2⌋+1 in G ′ as follows: select x i not equal to any of x 1 , . . . , x i−1 or u 1 , . . . , u i−1 , and select u i not equal to any of x 1 , . . . , x i or u 1 , . . . , u i−1 . When selecting x i , only 2i − 2 < v + 1 vertices of X have been forbidden, so we may choose greedily. When selecting u i , it is possible that we have forbidden many vertices of Y , since many vertices of Y correspond to the same u j . However, the vertex x j is adjacent to (u j , c j ) only if the edge x j u j has color c j , and so x j has at most one neighbor in Y for every choice of u j . Thus at most 2i − 1 < v + 1 of x i 's neighbors in Y are forbidden, so we may choose u i greedily.
We can think of the argument with the auxiliary bipartite graph as a kind of Turán problem: the auxiliary graph G is reflective of a hypergraph on V (K n ) (the edges are exactly those cneighborhoods of u), and we wish to find a kind of 'self-avoiding' Berge-path in this hypergraph given that the number of hyperedges present is large.
With Lemma 3.2, we find the quadratic threshold for paths with an even number of vertices in the following theorem.
Proof. It suffices to show f (K n , P v , ⌈(v − 1)/2⌉ − 2) = Ω n 2 . Let K n be colored with colors from C such that every copy of P v repeats at most ⌈(v − 1)/2⌉ − 2 colors. The first case of Lemma 3.2 does not occur, and in the second case we are done. If the third case of Lemma 3.2 occurs, then we have a monochromatic matching of size k/16v ≥ ⌊v/2⌋, with which we have a copy of P v with ⌈(v − 1)/2⌉ − 1 repeats (see Figure 3). So this case is impossible as well.
There is a small gap in what we have shown when v is odd, namely f (K n , P v , (v + 1)/2) has only been shown to be Ω(n) (and O(n 2 ) trivially). Note that v = 3 is equivalent to the star S 2 , so by Corollary 2.7, f (K n , P 3 , 2) = Θ(n). The v = 5 case was shown to be linear by a construction of Rosta [12]: label the vertices of K n with distinct binary strings of length ⌈log n⌉, and color the edge between vertices labeled x and y with color x ⊕ y (where ⊕ is bitwise exclusive-or). This coloring is proper, since x ⊕ y = x ⊕ z implies y = z. In this coloring, if any P 5 with vertices a, b, c, d, e (in that order) contains only two colors, it must be that a ⊕ b = c ⊕ d and b ⊕ c = d ⊕ e. Upon 'adding' these equations, we get a ⊕ c = c ⊕ e, meaning a = e, contradicting this being a path. Thus Rosta's construction shows f (K n , P 5 , 3) ≤ 2 ⌈log n⌉ ≤ 2n.
We only have loose bounds when v ≥ 7. First we need a combinatorial lemma of Erdős [4], which we state here for a particular case.
Proof. The upper bound comes from Theorem 2.1. Let K n be colored with colors from C so that every P 7 contains at least 4 colors (and at most 2 repeated colors). By Lemma 3.2, we either have a copy of P 7 with at least 3 repeats (which does not occur), we use Ω(n 2 ) colors (so we are done), or there exists a k ≥ 16v 2 such that there are at least n 2 /16k log n color classes each with a matching of at least k/16v edges. Let C * be the set of these colors. If k ≤ n 2/3 / log 1/3 n, then there are already at least Ω(n 4/3 / log 2/3 n) many colors. Otherwise, k ≥ n 2/3 / log 1/3 n. For c ∈ C * , there is a matching M of size k/16v ≥ n 2/3 /(16v log 1/3 n) in color c; let S be the matched vertices of M . If an edge of color c appears between vertices of S but is not in the matching M , then we have a P 7 with 3 repeats, which is not allowed. If there are five edges of color c ′ among the vertices of S, these edges must be incident to at least three edges of M , and so we may find a P 7 with 3 repeats as well ( Figure 4 enumerates these possibilities and shows the desired P 7 in each case). Therefore there are at least Ω(n 4/3 / log 2/3 n) colors (even just among the vertices of S).
To show the lower bound when v ≥ 9, again apply Lemma 3.2: the first case does not occur, and in the second case we are done, so suppose we are in the third case as before. If k ≤ 32v 3/2 n 1/2 we have Ω(n 3/2 / log n) many colors in C * and we are done. So suppose k ≥ 32v 3/2 n 1/2 . Let C * = {c 1 , . . . , c N }, let M i be a maximum matching in color c i , and let d = 4 √ v. Note that |V (M i )| ≥ 2 k 16v ≥ d √ n and N = |C * | ≥ n 2 16k log n ≥ 8 d √ n, the latter of which follows because k ≤ vn, since no color class has size more than vn. We have by Lemma 3.4 that there are two indices i and j such that |V (M i ) ∩ V (M j )| ≥ d 2 2 = 8v. The graph whose edges are the edges of M i and M j incident to at least one vertex of V (M i ) ∩ V (M j ) contains a disjoint union of even cycles and paths of length at least two on at least 8v > 5 3 v vertices. Thus we can find v 3 disjoint copies of an edge of color c i incident with an edge of color c j , as in Figure 5. Stringing these together into a path with v vertices gives at least 2 3 v − 2 ≥ v−1 2 many repeated colors (with equality when v = 9, 11, and 13), which is not allowed.