A New Bound for the Brown–Erd˝os–S´os Problem

Let f ( n, v, e ) denote the maximum number of edges in a 3-uniform hypergraph not containing e edges spanned by at most v vertices. One of the most inﬂuential open problems in extremal combinatorics then asks, for a given number of edges e ≥ 3, what is the smallest integer d = d ( e ) such that f ( n, e + d, e ) = o ( n 2 )? This question has its origins in work of Brown, Erd˝os and S´os from the early 70’s and the standard conjecture is that d ( e ) = 3 for every e ≥ 3. The state of the art result regarding this problem was obtained in 2004 by S´ark¨ozy and Selkow, who showed that f ( n, e +2+ (cid:98) log 2 e (cid:99) , e ) = o ( n 2 ). The only improvement over this result was a recent breakthrough of Solymosi and Solymosi, who improved the bound for d (10) from 5 to 4. We obtain the ﬁrst asymptotic improvement over the S´ark¨ozy–Selkow bound, showing that f ( n, e + O (log e/ log log e ) , e ) = o ( n 2 ) .


Introduction
Extremal combinatorics, and extremal graph theory in particular, asks which global properties of a graph force the appearance of certain local substructures. Perhaps the most well-studied problems of this type are Turán-type questions, which ask for the minimum number of edges that force the appearance of a fixed subgraph F . Recall that an r-uniform hypergraph (r-graph for short) is composed of a ground set V of size n (the vertices) and a collection E of subsets of V (the edges), where each edge is of size exactly r. Note that an ordinary graph is just a 2-graph. A (v, e)configuration is a hypergraph with e edges and at most v vertices. Denote by f r (n, v, e) the largest number of edges in an r-graph on n vertices that contains no (v, e)-configuration. Estimating the asymptotic growth of this function for fixed integers r, e, v and large n is one of the most well-studied and influential problems in extremal graph theory. For example, when e = v r we get the well-known Turán problem of determining the maximum possible number of edges in an r-graph that contains no complete r-graph on v vertices. As another example, the case r = 2, v = 2t and e = t 2 is essentially equivalent to the Zarankiewicz-Kővári-Sós-Turán problem, which asks for the maximum number of edges in a graph without a complete bipartite graph K t,t .
Our focus in this paper is on a notorious question of this type, which emerged from work of Brown, Erdős and Sós [3,4] in the early 70's and came to be named after them. A special case of this so-called Brown-Erdős-Sós conjecture (see [7,8]) states the following: Setting d = 1 in the above proposition readily implies that Conjecture 1.1 is indeed equivalent to the general form of the Brown-Erdős-Sós conjecture stated above. The reason for stating the proposition for arbitrary d is that it allows us to infer approximate versions of the general Brown-Erdős-Sós conjecture from approximate versions of Conjecture 1.1. In particular, by combining Theorem 1 with Proposition 1.2, we immediately obtain the following corollary.
As part of our general discussion of the Brown-Erdős-Sós conjecture, it is also worth mentioning lower bounds for Conjecture 1.1. In their seminal paper [20], where they proved that f 3 (n, 6, 3) = o(n 2 ), Ruzsa and Szemerédi also showed that f 3 (n, 6, 3) ≥ n 2−o (1) . Their construction relies on Behrend's example [2] of a dense set of integers with no 3-term arithmetic progressions. A natural question is then whether f 3 (n, e + 3, e) ≥ n 2−o (1) for every e ≥ 3. A simple averaging argument shows that every (7, 4)-configuration or (8,5)-configuration contains a (6,3)-configuration and, hence, f 3 (n, 7, 4), f 3 (n, 8, 5) ≥ n 2−o (1) . Similar considerations can be used to prove the same lower bound in the cases e = 7, 8 (see [10]). All other cases are open; in particular, it is not known whether f 3 (n, 9, 6) ≥ n 2−o(1) (though see [11] for results on a related problem). The study of lower bounds naturally leads to the following more general question: for which e and d is it the case that f 3 (n, e + d, e) ≤ n 2−ε , where ε > 0 is a constant depending only on e, d? For this question, Gowers and Long [13] made the surprising conjecture that f 3 (n, e + 4, e) ≤ n 2−ε for every e.
Finally, let us mention that in the special group setting, where the hypergraphs under consideration arise from the multiplication table of a group, Conjecture 1.1 has recently been settled in a strong form [14,16] (see also [25,26,31]).
The rest of the paper is organized as follows. Section 2 is the main hub of the paper. It contains a (verbal) flowchart of the process which finds the required configurations of edges needed to prove Theorem 1. This section also contains the (formal) proof of Theorem 1, assuming two key lemmas that we prove in Sections 3 and 4. Hence, Sections 2, 3 and 4 are essentially independent of each other. Finally, in Section 5, we discuss an application of our results to a generalized Ramsey problem of Erdős and Gyárfás which is known to have connections to the Brown-Erdős-Sós problem. Throughout the paper, we make no effort to optimize any of the constants involved. All logarithms are natural unless explicitly stated otherwise.

Proof Overview and Proof of Theorem 1
Our goal in this section is fourfold. We first give an overview of the proof of Theorem 1. In doing so, we will state the two key lemmas, Lemmas 2.4 and 2.6, used in its proof. We will then proceed to show how these two lemmas can be used in order to prove Theorem 1. Finally, in Section 2.4, we prove Proposition 1.2.

Proof overview and the key lemmas
Our first simple (yet crucial) observation towards the proof of Theorem 1 is that, in order to prove the theorem, it is enough to prove the following approximate version.
In Section 2.3 we will show how to quickly derive Theorem 1 from the above lemma. So let us proceed with the overview of the proof of Lemma 2.1. We will heavily rely on the hypergraph removal lemma, which states the following.
Let us start by describing the approach of Sárközy and Selkow [22], which roughly proceeds as follows: suppose one has already proved that every sufficiently large n-vertex 3-graph with Ω(n 2 ) edges contains an (e + k, e)-configuration. Using this fact, one then shows that every such 3-graph also contains a (2e + k + 2, 2e + 1)-configuration. In other words, at the price of increasing v − e by 1, we multiply the number of edges by roughly 2 (and hence the term log 2 e in (1)). The proof of [22] used the graph removal lemma (at least implicitly 2 ). As we mentioned before, Solymosi and Solymosi [24] improved the bound of [22] for the special case e = 10. The way they achieved this was by cleverly replacing the application of the graph removal lemma with an application of the 3-graph removal lemma. Roughly speaking, this allowed them to multiply a (6, 3)-configuration by 3, instead of by 2 as in [22].
The above discussion naturally leads one to try and extend the approach of [24] by showing that after multiplying the initial configuration by 3, one can use the 4-graph removal lemma to multiply the resulting configuration by 4, etc. Performing k such steps should (roughly) give a (k! + k, k!)configuration or, equivalently, a (v, e)-configuration with v − e = O(log e/ log log e). There is one big challenge and two problems with this approach. The challenge is of course how to achieve this repeated multiplication process. 3 As to the problems, the first is that we do not know how to guarantee that one can indeed keep multiplying the size of the configurations. In other words, it is entirely possible that this process might get "stuck" along the way (this scenario is described in Item 1 of Lemma 2.4). More importantly, even if the process succeeds in producing a (k! + k, k!)configuration for every k, it is not clear how to "interpolate" so as to prove Theorem 1 for values of e with (k − 1)! < e < k!. That is, our process only guarantees the existence of suitable configurations for a very sparse set of values of e. It it tempting to guess that the resulting (k!+k, k!)-configurations are "degenerate", in the sense that one can repeatedly remove from them vertices of degree 1, thus maintaining the difference v − e while reducing the number of edges until the desired number is achieved. This is however false. Having said that, we will return to this issue of degeneracy after the statement of Lemma 2. 6.
In what follows, it will be convenient to use the following notation.
Our first key lemma, Lemma 2.4 below, comes close to achieving the "iterated multiplication process" described above. Given an n-vertex 3-graph H with Ω(n 2 ) edges, the lemma almost resolves the aforementioned challenge by either showing that H contains configurations with difference k and size roughly k! (this is the statement of Item 2) or getting "stuck" in the scenario described in Item 1. The silver lining in Item 1 is that we get an arithmetic progression of values v for which we can construct (v, e)-configurations of small difference. The problem is that the common difference of this arithmetic progression might be much larger than √ e, so this lemma alone cannot be used in order to prove Lemma 2.1. Before stating Lemma 2.4, we need to introduce the following key definition that appears in its statement. Definition 2.3. Let F be a 3-graph and put k := ∆(F ) = v(F ) − e(F ). We call F nice if there is an independent set A ⊆ V (F ) of size k + 1 such that the following holds for every U ⊆ V (F ).
One can think of the set A in Definition 2.3 as being sparsifying. That is, if a set U contains many elements of A, then this forces U to be (somewhat) sparse (i.e., it forces ∆(U ) to be large). In particular, Item 1 guarantees that if A ⊆ U , then ∆(U ) ≥ k = ∆(F ). This implies that if we glue multiple copies of F on a set U ⊆ V (F ) with A ⊆ U , then the resulting hypergraph F * will satisfy ∆(F * ) ≤ k. This property is crucial for our argument, as it will allow us to "glue" an arbitrary number of copies of F without increasing the difference, thus achieving the conclusion of Item 1 of Lemma 2.4 below. The condition in Definition 2.3 is more complicated than simply requiring that ∆(U ) ≥ k for sets U containing A. The reason for this is (partly) that we want the condition to "carry over" from F to the hypergraph F obtained by "multiplying" F , so that the process can be continued. The exact condition in Definition 2.3 was devised for this purpose.

2.
H contains at least ηn k copies of F k .
Remark 2.5. Item 2 in Lemma 2.4 asserts that H contains Ω(n k ) copies of F k . The exponent k is best possible, as can be seen by considering the random 3-graph with edge density 1 n , which has O(n ∆(F k ) ) = O(n k ) copies of F k w.h.p. A similar situation occurs in Item 3(b) of Lemma 2.6.
The proof of Lemma 2.4 proceeds by induction on k. Namely, assuming H contains Ω(n k ) copies of F k , we show that either H contains Ω(n k+1 ) copies of F k+1 or Item 1 holds. This is done as follows. Recalling that F k is nice, we fix a set A ⊆ V (F k ) of size |A| = k + 1 which witnesses this fact (see Definition 2.3). By assumption, there are Ω(n k ) embeddings of F k into H. For two embeddings ϕ, ϕ : , the set of elements on which ϕ and ϕ agree). By a straightforward argument (combining an application of the multicolor Ramsey theorem with a simple cleaning procedure), we can show that either there are embeddings ϕ 1 , . . . , ϕ r : V (F k ) → V (H) and a set U ⊆ V (F k ) such that |U | ≥ k, |U ∩ A| ≥ k − 1 and U (ϕ i , ϕ j ) = U for all 1 ≤ i = j ≤ r or there is a family F of Ω(n k ) embeddings ϕ : V (F k ) → V (H) such that, for any two ϕ, ϕ ∈ F, we have |U (ϕ, ϕ ) ∩ A| ≤ k − 1 with equality only if U (ϕ, ϕ ) ⊆ A. In the former case, Items 1-2 of Definition 2.3 imply that ∆(U ) ≥ k, which in turn implies that the union of the copies of F k corresponding to ϕ 1 , . . . , ϕ r has difference at most k. From this it then easily follows that Item 1 in Lemma 2.4 holds. In the latter case, we define an auxiliary k-uniform hypergraph by putting a k-uniform (k + 1)-clique on the set ϕ(A) for each A ∈ F. The aforementioned property of F implies that these cliques are pairwise edge-disjoint, which allows us to apply the hypergraph removal lemma (Theorem 3) and thus infer that the number of (k + 1)-cliques in our auxiliary hypergraph is Ω(n k+1 ). Using again our guarantees regarding F, we can show that most such (k + 1)-cliques correspond to copies of a particular 3-graph consisting of k + 1 copies of F k which do not intersect outside of the set A. This 3-graph is then chosen as F k+1 . One of the challenges in the proof is to then show that F k+1 is itself nice, thus allowing the induction to continue. The full details appear in Section 3.
We now move to our next key lemma, Lemma 2.6 below. Let us say that a 3-graph is d-degenerate if it is possible to repeatedly remove from it a set of at least d vertices which touches at most d edges. As we mentioned above, the 3-graphs F k are not 1-degenerate, so it is not possible to take one of these 3-graphs and repeatedly remove vertices of degree at most 1 so as to obtain configurations with any desired number of edges, while not increasing the difference. One can argue, however, that since Lemma 2.1 only asks for e to satisfy e − √ e ≤ e ≤ e, it is enough to show that the 3-graphs F k are, say, e(F k ) 1/3 -degenerate. Unfortunately, we cannot do even this. Instead, we will overcome the problem by using Lemma 2.6. This lemma states that if H contains many copies of some nice 3-graph G, then it also contains copies of 3-graphs G 0 = G, G 1 , G 2 , . . . which are all e(G)-degenerate and whose sizes increase. In fact, as in Lemma 2.4, we cannot always guarantee success in finding copies of G 1 , G 2 , . . . , G in H, since the process might get stuck in a situation analogous to the one in Lemma 2.4. Finally, the price we have to pay for the degeneracy guaranteed by Item 2 of Lemma 2.6 is that the size of the 3-graphs G 1 , G 2 , . . . , G only grows by a factor of roughly k at each step, where k = ∆(G). Namely, G grows (only) exponentially (in ), unlike the factorial growth in Lemma 2.4. Hence, just like Lemma 2.4, Lemma 2.6 alone also falls short of proving Lemma 2.1.
Lemma 2.6. Let G be a nice 3-graph, put k := ∆(G) = v(G) − e(G) and assume that k ≥ 2. Then there is a sequence of 3-graphs (G ) ≥0 having the following properties.
(b) H contains at least δ · n k+ copies of G .
Strictly speaking, we cannot apply Lemma 2.6 with G being an edge, since an edge is not a nice 3-graph (indeed, it has difference k = 2 but evidently contains no independent set of size k + 1 = 3). However, one can check that the proof also works when G is an edge (and, more generally, in any case where k := ∆(G) = 2 and one can choose a (not necessarily independent) A ⊆ V (G) of size 3 which satisfies Items 1-2 in Definition 2.3). By applying Lemma 2.6 with G being an edge, one recovers the construction used by Sárközy and Selkow [22] to prove (1). Generalizing this construction to other graphs G (e.g., for k ≥ 3) presents a challenge, which we overcome by using some of the ideas from the proof of Lemma 2.4.
We now sketch the derivation of Lemma 2.1 from Lemmas 2.4 and 2.6 (the formal proof appears in the next subsection). Given e, choose k such that k! ≈ √ e; then k = Θ(log e/ log log e). We first apply Lemma 2.4 with k. If we are at Item 1, then we get an arithmetic progression with common difference at most e(F k−1 ) ≤ k! ≤ √ e of values e for which we can find (v , e )-configurations of difference v − e ≤ k, thus completing the proof in this case. Suppose then that we are at Item 2, implying that H contains Ω(n k ) copies of F k . Since F k is nice, we can apply Lemma 2.6 with G = F k . Since k = Θ(log e/ log log e), for = O(k) we have k > e, so that e(G ) ≈ e(F k ) · k > e (by Item 1 of Lemma 2.6). Suppose first that the application of Lemma 2.6 results in Item 3(b). Then we can use Item 2 of Lemma 2.6 to find inside G a (v , e )-configuration of difference O(k + ) = O(k) with e − √ e ≤ e − e(G) ≤ e ≤ e, thus completing the proof. Now suppose that we are at Item 3(a) and let 0 ≤ j ≤ − 1 be as in that item. Then we can find a (v , e )-configuration G with difference O(k + ) = O(k) and e − e(G j ) ≤ e ≤ e. With the help of a simple trick we can also find in H a copy G * of G j which is edge-disjoint from G . As in case 3(b) above, we use Item 2 of Lemma 2.6 to find a subconfiguration G of G * with difference O(k + ) = O(k) and e − e(G ) − e(G) ≤ e(G ) ≤ e − e(G ). If we now take G to be the union of G and G , we get that G has difference O(k) and e − √ e ≤ e − e(G) ≤ e(G ) ≤ e. So again we are done.

Deriving Lemma 2.1 from Lemmas 2.4 and 2.6
The required integer n 0 = n 0 (e, ε) will be chosen implicitly. Let (F k ) k≥3 be the nice 3-graphs whose existence is guaranteed by Lemma 2.4. Recall that e(F 3 ) = 3 and e(F k ) = 5k!/12 for each k ≥ 4. Let k ≥ 4 be such that k! ≤ √ e < (k + 1)!, and note that e(F k ) ≤ k! ≤ √ e. We now check 4 that k ≤ 2 log e/ log log e. Set x = 2 log e/ log log e . We need to check that x! > √ e, which implies that k < x. It is well-known that x! ≥ (x/ exp) x for every x ≥ 1, where exp is the base of the natural logarithm. Hence, it suffices that (x/ exp) x > √ e, which is equivalent to x(log x − 1) > 1 2 log e. Since x(log x − 1) is an increasing function for x ≥ 1, it is enough to plug in x = 2 log e/ log log e and check that the above inequality holds. This inequality becomes 2 log e log log e (log log e + log 2 − log log log e − 1) > 1 2 log e. Hence, it suffices that log log e + log 2 − log log log e − 1 > 1 4 log log e, which can be shown to hold for all e ≥ 3. Thus, k ≤ 2 log e/ log log e, as required.
We will now apply our second construction, given by Lemma 2.6. Set G := F k and let (G ) ≥0 be the sequence of 3-graphs whose existence is guaranteed by Lemma 2.6. Let be the minimal integer satisfying e(G ) ≥ e. Then ≥ 1 (because e(G 0 ) = e(G) = e(F k ) < e). We now show that ≤ 2k, that is, e(G 2k ) ≥ e. Using Item 1 of Lemma 2.6, we have e(G 2k ) = k 2k+1 −1 where the last inequality uses our choice of k and the penultimate inequality holds for every k ≥ 3. So indeed ≤ 2k.
Let H be a 3-graph with n ≥ n 0 vertices and at least εn 2 edges. Partition E(H) into equal-sized parts E 1 , . . . , E +1 and, for each Proof. For convenience, let us assume that m = 1. We apply Lemma 2.4 to H 1 with parameters k, r = e and ε/( + 1). Suppose first that the assertion of Item 1 in Lemma 2.4 holds and let 3 ≤ j ≤ k − 1 and 0 ≤ q ≤ e(F j ) − 1 be as in that item. Let i be the maximal integer satisfying q + i · (e(F j ) − q) ≤ e and note that 1 ≤ i ≤ e. We may thus infer from Item 1 in Lemma 2.4 that H 1 contains a (v , e )-configuration with e = q + i · (e(F j ) − q) ≤ e and v − e ≤ j < k ≤ 2 log e/ log log e.
Observe that, by the maximality of i, Hence, H 1 satisfies the assertion of Lemma 2.1, as required. This completes the proof for the case that Item 1 in Lemma 2.4 holds.
Suppose from now on that the assertion of Item 2 in Lemma 2.4 holds, namely, that H 1 contains at least ηn k copies of F k = G. This means that we may apply Lemma 2.6 to H 1 (with G = F k ). By Item 3 of Lemma 2.6, applied with r = e and with η in place of ε, the 3-graph H 1 satisfies (at least) one of the following: contains a (v , e )-configuration which contains a copy of G j and satisfies v − e ≤ k + j and e = q + i · (e(G j ) − q).
Suppose first that H 1 satisfies Item (b). Let t ≥ 0 be the maximal integer satisfying t · e(G) ≤ e and note that t ≤ e/e(G) ≤ e(G )/e(G), where the second inequality uses our choice of . By Item 2 of Lemma 2.6, H 1 contains a (v , e )-configuration with v − e ≤ k + ≤ 3k ≤ 6 log e/ log log e and e = t · e(G) ≤ e. By our choice of t, we have e − e < e(G) = e(F k ) = 5k!/12 ≤ k! ≤ √ e. So in this case the assertion of Lemma 2.1 indeed holds for H 1 .
Finally, assume that H 1 satisfies Item (a) and let 0 ≤ j ≤ − 1 and 0 ≤ q ≤ e(G j ) − 1 be as in that item. Let i be the maximal integer satisfying q +i·(e(G j )−q) ≤ e. Then 1 ≤ i ≤ e. We may thus rely on (a) above to conclude that H 1 contains a (v , e )-configuration which contains a copy of G j and satisfies e = q + i · (e(G j ) − q) ≤ e and v − e ≤ k + j. Observe that the maximality of i guarantees that e − e < e(G j ) − q ≤ e(G j ). We conclude that H 1 indeed contains a (v , e )-configuration with the properties stated in the claim.
We now return to the proof of the lemma. If some H m (1 ≤ m ≤ + 1) satisfies the assertion of Lemma 2.1, then we are done. Otherwise, Claim 2.7 implies that for each 1 ≤ m ≤ + 1 there is 0 ≤ j m ≤ − 1 such that H m contains a (v , e )-configuration which contains a copy of G jm and satisfies v − e ≤ k + j m and e − e(G jm ) ≤ e ≤ e. By the pigeonhole principle, there are two indices 1 ≤ m ≤ + 1 whose j m 's are equal. It follows that, for some 0 Let t be the maximal integer satisfying t · e(G) ≤ e − e(G ) and note that 0 ≤ t ≤ e(G j )/e(G) because e − e(G ) ≤ e(G j ). Then, by Item 2 of Lemma 2.6 (applied to the copy So we see that the assertion of the lemma holds with G as the required (v , e )-configuration.

Deriving Theorem 1 from Lemma 2.1
Our goal is to show that for every e ≥ 3 and ε ∈ (0, 1), there is n 0 = n 0 (e, ε) such that every 3-graph with n ≥ n 0 vertices and at least εn 2 edges contains a (v, e)-configuration with v − e ≤ 26 log e/ log log e. As in the proof of Lemma 2.1, the required integer n 0 = n 0 (e, ε) will be chosen implicitly. The proof is by induction on e. Let H be a 3-graph with n ≥ n 0 vertices and at least εn 2 edges. First, we take care of the case where e is small by using (1). Indeed, by (1) Here, the second inequality uses the fact that the function x → log x/ log log x is monotone increasing for x ≥ 16 and the last inequality holds whenever e ≥ exp(2 14 ). Letting F be the union of F and F , we see that e(F ) = e(F ) + e(F ) = e and v( This completes the proof of the theorem.

Proof of Proposition 1.2
Let 2 ≤ k < r, e ≥ 3 and d ≥ 1. Let H be an n-vertex r-graph with Our goal is to show that H contains a (v, e)-configuration with v ≤ (r − k)e + k + d. By averaging, there are vertices v 1 , . . . , v k−2 such that more than r−k+2 We now consider two cases. Suppose first that there is a triple T ∈ V (H) It follows that H contains a (v, e)-configuration with v ≤ (r − k)e + k, thus completing the proof in this case.
Suppose now that for each where the equality holds due to our choice of E 1 and the inequality due to (2). It follows that H contains an (e + 2 + d, e)-configuration F . Now observe that the edge-set

Proof of Lemma 2.4
In this section we prove Lemma 2.4. The construction of the 3-graphs F k appearing in the statement of the lemma, as well as the proof that these 3-graphs have the required properties, is done by induction on k. The inductive step, which constitutes the main part of the proof of Lemma 2.4, is given by the following lemma.

2.
H contains at least δn k+1 copies of F .
Ideally, we would like to start the induction by invoking Lemma 3.1 with F being an edge (so k = ∆(F ) = 2). As is the case with Lemma 2.6 (see the remark following that lemma), Lemma 3.1 does in fact work with F being an edge, even though an edge is not nice as per Definition 2.3. The 3-graph F supplied by Lemma 3.1 (when applied with F being an edge) is the linear 3-cycle (see Figure 1). In fact, applying Lemma 3.1 with F being an edge recovers the proof of the (6,3)-theorem. Unfortunately, the linear 3-cycle is not nice (this time in a meaningful way; it really cannot be used as an input to Lemma 3.1), preventing us from continuing the induction. To make matters even worse, we know of no 3-graph F with difference k = 3 which can be used as a viable input to Lemma 3.1. Indeed, note that in order for the lemma to be useful when applied with input F , we need to know that F is abundant 6 in every sufficiently large n-vertex 3-graph with Ω(n 2 ) edges (or at least in every such 3-graph that does not satisfy the conclusion of Theorem 1 for some other reason). Unfortunately, no such nice F (of difference 3) is known.
In light of this situation, the base step of our induction will have to involve a nice 3-graph F with difference at least 4. Fortunately, as stated in the following lemma, there does exist a nice F of difference 4 which can be shown to be abundant in every 3-graph H with n vertices and Ω(n 2 ) edges, unless H satisfies the assertion of Theorem 1 for a trivial reason.

H contains at least δn 4 copies of F .
We note that the 3-graph F in the above lemma played a key role in the proof of Solymosi and Solymosi [24] that f 3 (n, 14, 10) = o(n 2 ). As such, the abundance statement regarding F was already proved in [24]. Consequently, our main task in the proof of Lemma 3.2 is to show that F is nice.
The rest of this section is organized as follows. In Section 3.1, we derive Lemma 2.4 from Lemmas 3.1 and 3.2. We then prove these two lemmas in Sections 3.2 and 3.3, respectively.

Deriving Lemma 2.4 from Lemmas and 3.2
Let F 3 be the linear 3-cycle (which has 6 vertices and 3 edges). Let F 4 be the nice 3-graph whose existence is guaranteed by Lemma 3.2. For each k ≥ 5, let F k be the nice 3-graph F obtained by applying Lemma 3.1 with F := F k−1 . Then it is easy to check by induction that, for every k ≥ 4, it holds that v(F k ) − e(F k ) = k and e(F k ) = 5k!/12. Moreover, F k is nice for every k ≥ 4.
Let r ≥ 1 and ε ∈ (0, 1). We define a sequence (δ k ) k≥4 as follows. Let δ 4 = δ 3.2 (r, ε) be defined via Lemma 3.2 and, for each k ≥ 4, let δ k+1 = δ 3.1 (F k , r, δ k ) be defined via Lemma 3.1. We now show by induction on k ≥ 4 that the assertion of Lemma 2.4 holds with η = η 2.4 (k, r, ε) := δ k . For k = 4, Lemma 3.2 readily implies that H either satisfies the assertion of Item 2 of Lemma 2.4 or satisfies the assertion of Item 1 with j = 3 and q = 0. Let now k ≥ 4, assume that the assertion of Lemma 2.4 holds for k, and let us show that it also holds for k + 1. By the assertion for k, H satisfies the assertion of (at least) one of the items 1-2 of Lemma 2.4. If Item 1 is satisfied, then it is also satisfied when k is replaced with k + 1, so we are done. Suppose then that H satisfies the assertion of Item 2, namely, that H contains at least δ k · n k copies of F k . Then, by Lemma 3.1 (with parameters F = F k and δ k in place of ε), either H satisfies the assertion of Item 1 in Lemma 2.4 for parameter k + 1 (with j = k) or it contains at least δ k+1 · n k+1 = η 2.4 (k + 1, r, ε) · n k+1 copies of F k+1 , as required by Item 2.

Proof of Lemma 3.1
Let A ⊆ V (F ) be as in Definition 2.3. It will be convenient to set v := v(F ) and to assume (without loss of generality) that V (F ) = [v] and A = [k + 1] ⊆ [v]. The required nice 3-graph F is defined as follows: take vertices x 1 , . . . , x k+1 , x 1 , . . . , x k+1 and, for each 1 ≤ i ≤ k + 1, add a copy F i of F in which x j plays the role of j ∈ V (F ) for each j ∈ [k + 1] \ {i}, x i plays the role of i ∈ V (F ) and all other v(F ) − k − 1 vertices are new.
We now show that F is nice. We will show that F satisfies the requirements of Definition 2.3 with respect to the set A := {x 1 , . . . , x k+1 , x 1 }. (We remark that in the definition of A we could replace x 1 with any other vertex among x 1 , . . . , x k+1 .) For the rest of the proof, we set X = {x 1 , . . . , x k+1 }, Observe that, for each 1 ≤ i ≤ k + 1, the vertices of A i are precisely the vertices which play the roles of the vertices of It is evident that |A | = k + 2 and easy to see that A is independent in F . Our goal then is to show that every U ⊆ V (F ) satisfies the assertion of Items 1-2 in Definition 2.3 (with A in place of A). So let U ⊆ V (F ) and put U i = U ∩ V (F i ) for each 1 ≤ i ≤ k + 1. Since every vertex of X belongs to exactly k of the copies F 1 , . . . , F k+1 and every other vertex of F belongs to exactly one of these copies, we have Since F 1 , . . . , F k+1 are pairwise edge-disjoint, we have Subtracting the above two equalities, we get For each 1 ≤ i ≤ k + 1, it follows from the niceness of F (and the fact that A i plays the role of A in the copy Setting s := #{1 ≤ i ≤ k + 1 : The first equality in (5) holds because A 1 ∪ · · · ∪ A k+1 = X ∪ X and every element of X (resp. X ) belongs to exactly k (resp. 1) of the sets A 1 , . . . , A k+1 . The second equality in (5) is immediate from the definition of A . We first prove that ∆(U ) ≥ |U ∩ A | − 1 A ⊆U , as required by Item 1 in Definition 2.3. If s = 0, then (5) readily gives ∆(U ) ≥ |U ∩ A |. Suppose then that s ≥ 1 and let 1 ≤ i ≤ k + 1 be such that This in particular means that if 1 ≤ s ≤ k − 1, then ∆(U ) ≥ |U ∩ A | + 1, as k ≥ 3 by the assumption of the lemma. It also follows that ∆ Next, we assume that |U ∩ A | ≤ k and U \ A = ∅ and show that in this case ∆(U ) ≥ |U ∩ A | + 1 (as required by Item 2 in Definition 2.3). The assumption that |U ∩ A | ≤ k implies that s ≤ k − 1, because if s ≥ k, then |U ∩ X | ≥ k and x 1 ∈ U , which means that |U ∩ A | ≥ k + 1. We already saw that ∆(U ) ≥ |U ∩ A | + 1 if 1 ≤ s ≤ k − 1, so it remains to handle the case that s = 0, namely, . , x k+1 } = ∅. Now it follows from the niceness of F (or, more precisely, of the copy F j of F ) that ∆(U j ) ≥ |U j ∩ A j | + 1, by Item 2 of Definition 2.3. Moreover, by (4), we have ∆(U i ) ≥ |U i ∩ A i | for each 1 ≤ i ≤ k + 1 (here we use that A i ⊆ U i for each 1 ≤ i ≤ k + 1). By plugging these facts into (3), in a manner similar to the derivation of (5), we obtain Having proved that F is nice, we go on to show that the assertion of the lemma holds. Given r ≥ 1 and ε ∈ (0, 1), we set and n 0 = n 0 (F, r, ε) = 1/δ, where γ is from Theorem 3 and v = v(F ) as before.
Let H be a 3-uniform hypergraph with n ≥ n 0 vertices and at least εn k copies of F . Partition the vertices of H randomly into sets C 1 , . . . , C v by choosing, for each vertex x ∈ V (H), a part C i (1 ≤ i ≤ v) uniformly at random and independently (of the choices made for all the other vertices of H) and placing x in this part. A copy of F in H will be called good if, for each i = 1, . . . , v, the vertex playing the role of i in this copy is in C i . Since H contains at least εn k copies of F , there are in expectation at least v −v · εn k good copies of F . So fix a partition C 1 , . . . , C v with at least this number of good copies of F and denote the set of these copies by F. It will be convenient to identify each good copy of F with the corresponding embedding ϕ : V (F ) → V (H) which maps each i ∈ [v] = V (F ) to a vertex in C i . So we will assume that the elements of F are such mappings.
We now define an auxiliary graph G on F as follows: for each pair ϕ 1 , ϕ 2 ∈ F, we let {ϕ 1 , ϕ 2 } be an edge in G if and only if the set U := U (ϕ 1 , ϕ 2 ) := {i ∈ V (F ) : ϕ 1 (i) = ϕ 2 (i)} satisfies either |U ∩ A| ≥ k or |U ∩ A| = k − 1 and U \ A = ∅. Here, A ⊆ V (F ) is the set from Definition 2.3. We distinguish between two cases. Suppose first that there is ϕ ∈ F whose degree in G is at least Let ϕ 1 , . . . , ϕ d be distinct neighbours of ϕ in G. By the pigeonhole principle, there is I 0 ⊆ [d] of size at least 2 −v d = 2 v2 v r and a set U 0 ⊆ V (F ) such that, for all i ∈ I 0 , it holds that U (ϕ, ϕ i ) = U 0 . Note that, by the definition of G, we have either |U 0 ∩ A| ≥ k or |U 0 ∩ A| = k − 1 and U 0 \ A = ∅. We now consider the complete graph on I 0 and color each edge {i, j} ∈ I 0 2 of this graph with color U (ϕ i , ϕ j ). A well-known bound for multicolor Ramsey numbers (see [6]) implies that in every c-coloring of the edges of the complete graph on c cr vertices, there is a monochromatic complete subgraph on r vertices. Applying this claim with c = 2 v , we conclude that there is I ⊆ I 0 of size |I| = r and a set U ⊆ V (F ) such that U (ϕ i , ϕ j ) = U for all {i, j} ∈ I 2 . Observe that, for each {i, j} ∈ I 2 , we have U = U (ϕ i , ϕ j ) ⊇ U (ϕ, ϕ i ) ∩ U (ϕ, ϕ j ) = U 0 . This implies that either |U ∩ A| ≥ k or |U ∩ A| = k − 1 and U \ A = ∅. Our choice of A via Definition 2.3 implies that in both cases ∆(U ) ≥ k. Note also that U = V (F ) because the copies of F corresponding to (ϕ i : i ∈ I) are distinct.
We now show that the assertion of Item 1 in the lemma holds. Suppose without loss of generality that I = {1, . . . , r} and write V i := ϕ i (V (F ) \ U ) ⊆ V (H) for 1 ≤ i ≤ r. Note that V 1 , . . . , V r are pairwise disjoint. We also put W := ϕ 1 (U ) = · · · = ϕ r (U ). Now, fix any 1 ≤ i ≤ r and set V : From the above, we see that H[V ] contains a (v , e )-configuration with v − e ≤ k and e = q + i · (e(F ) − q). So the assertion of Item 1 of the lemma holds with this choice of q. This completes the proof in the case that G has a vertex of degree at least d.
From now on we assume that the maximum degree of G is strictly smaller than d and prove that the assertion of Item 2 in the lemma holds. Let F * ⊆ F be an independent set 7 in G of size at least v(G)/d = |F|/d. Recall that we identify V (F ) with [v] and A with [k + 1]. We now define an auxiliary k-uniform (k + 1)-partite hypergraph J with parts C 1 , . . . , C k+1 , as follows. For each ϕ ∈ F * , put a k-uniform (k + 1)-clique in J on the vertices ϕ(1) ∈ C 1 , . . . , ϕ(k + 1) ∈ C k+1 . We denote this clique by K ϕ . Note that, by the definition of J, every edge of J is contained in a copy of F in H, which corresponds to some embedding ϕ ∈ F * .
A (k + 1)-clique K in J is called colorful if it is not equal to K ϕ for any ϕ ∈ F * . Note that all but at most n k of the (k + 1)-cliques in J are colorful (because the non-colorful cliques are pairwise edge-disjoint). It follows that J contains at least 2δn k+1 − n k ≥ δn k+1 colorful (k + 1)-cliques (here we use our choice of n 0 ).
We will show that each colorful (k + 1)-clique gives rise to a copy of F in H. So fix any colorful (k + 1)-clique K = {c 1 , . . . , c k+1 }, where c i is the unique vertex in K ∩ C i for each 1 ≤ i ≤ k + 1.
By the definition of J, for each i ∈ [k + 1], there is ϕ i ∈ F * such that ϕ i (j) = c j for every j ∈ [k + 1] \ {i}. We claim that ϕ 1 , . . . , ϕ k+1 are pairwise distinct. Suppose, for the sake of contradiction, that ϕ i = ϕ i =: ϕ for some 1 ≤ i < i ≤ k + 1. Then, for each 1 ≤ j ≤ k + 1, we have ϕ(j) = c j because one of i, i does not equal j. So we see that K = K ϕ , contradicting the assumption that K is colorful. We conclude that ϕ 1 , . . . , ϕ k+1 are indeed pairwise distinct. It now follows that ϕ i (i) = c i for each 1 ≤ i ≤ k + 1. Indeed, if ϕ i (i) = c i then, fixing any j ∈ [k + 1] \ {i}, we have ϕ i ( ) = ϕ j ( ) for each ∈ [k +1]\{j}, contradicting the fact that K ϕ i and K ϕ j are edge-disjoint.
Recall that F consists of vertices x 1 , . . . , x k+1 , x 1 , . . . , x k+1 and copies F 1 , . . . , F k+1 of F such that the vertex playing the role of j ∈ [k + 1] ⊆ V (F ) in F i is x j if j = i and x j if j = i (for every 1 ≤ i, j ≤ k + 1) and F 1 , . . . , F k+1 do not intersect outside of X = {x 1 , . . . , x k+1 }. Now let ϕ = ϕ K : V (F ) → V (H) be the function which, for each 1 ≤ i ≤ k + 1, maps x i to c i and agrees with ϕ i on the vertices of F i (where we identify V (F i ) with V (F )). Then ϕ(x i ) = c i and ϕ(x i ) = ϕ i (i) for each 1 ≤ i ≤ k +1. It is not hard to see that in order to show that ϕ is an embedding of F into H it is enough to verify that Im(ϕ i ) ∩ Im(ϕ j ) = {c 1 , . . . , c k+1 } \ {c i , c j } for each 1 ≤ i < j ≤ k + 1. So fix any 1 ≤ i < j ≤ k + 1 and consider the set , then U \ A = ∅, so that ϕ i and ϕ j are adjacent in G, contradicting the fact that ϕ i , ϕ j ∈ F * and that F * is an independent set of G. Hence, U = [k + 1] \ {i, j}, as required. We have thus shown that each colorful (k + 1)-clique in J gives rise to a copy of F in H. It is also easy to see that these copies are pairwise distinct. It follows that H contains at least δn k+1 copies of F .

Proof of Lemma 3.2
In the proof of Lemma 3.2, we will need the following simple claim that can be verified by exhausting all possible cases. The proof is thus omitted. Let F denote the 3-uniform linear 3-cycle (see Figure 1). Claim 3.3 implies that F satisfies Condition 1 in Definition 2.3 with respect to A = {v 1 , . . . , v 4 }. However, F does not satisfy Condition 2 in that definition, as evidenced, e.g., by the set U = {v 1 , v 2 , v 5 }. So the "moreover"-part of Claim 3.3 can be thought of as a (non-equivalent) variant of Condition 2 in Definition 2.3. We also note that by going over all possible choices of A, one can easily verify that F is not nice.
Proof of Lemma 3.2. Let F be the 3-graph depicted in Figure 2, having vertices w 1 , w 2 , w 3 , w 4 , w 1 , w 2 , w 3 , w 4 , x 5 , x 6 , y 5 , y 6 , z 5 , z 6 and edges Then v(F ) = 14 and e(F ) = 10. Solymosi and Solymosi [24] (implicitly) proved that for every 3-graph H with n ≥ n 0 (r, ε) vertices and at least εn 2 edges, either H satisfies the assertion of Item 1 in the lemma or H contains at least δ(r, ε) · n 4 copies of F (with δ(r, ε) being roughly γ(3, ε/r), where γ is from Theorem 3). So, in order to complete the proof, it is enough to show that F is nice.
We prove that F satisfies the requirements of Definition 2.3 with A := {w 4 , w 1 , w 2 , w 3 , w 4 }. To this end, define V 1 = {w 1 , w 2 , z 5 , w 4 , z 6 , w 3 }, V 2 = {w 1 , w 2 , y 5 , w 4 , x 6 , w 3 }, V 3 = {w 1 , w 2 , x 5 , w 4 , y 6 , w 3 } and V 4 = {w 1 , w 2 , x 5 , w 4 , x 6 , w 3 }. Observe that F [V i ] is a linear 3-cycle for every 1 ≤ i ≤ 4. Furthermore, considering the vertex-labeling of the linear 3-cycle in Figure 1, we see that for each 1 ≤ i, j ≤ 4, the role of v j in F [V i ] is played by w j if j = i and by w j if j = i. Now fix any U ⊆ V (F ) and let us show that U satisfies Items 1-2 in Definition 2.3. For each Let us now express ∆(U ) in terms of ∆(U 1 ), . . . , ∆(U 4 ). It is easy to check that and Setting r : we combine (6) and (7) to obtain To complete the proof, it is enough to show that r + t ≥ −1 A⊆U and that r + t ≥ 1 if |U ∩ A| ≤ 3 and U \ A = ∅. In what follows we will frequently use the fact that ∆(U i ) ≥ |U i ∩ A i | − 1 A i ⊆U i for each 1 ≤ i ≤ 4, as mentioned above. We consider two cases, depending on whether w 1 ∈ U or not.
It remains to handle the case where {w 2 , w 3 } ⊆ U . In this case, we have t = 3, so r + t ≥ 0 unless r = −4. But if r = −4, then A i ⊆ U i for each 1 ≤ i ≤ 4, which implies that A ⊆ U . So we see that r + t ≥ −1 A⊆U , as required. Furthermore, if |U ∩ A| ≤ 3, then #{1 ≤ i ≤ 4 :

Proof of Lemma 2.6
In this section, we prove Lemma 2.6 through a sequence of claims. We start by defining the 3-graphs (G ) ≥0 appearing in the statement of the lemma. Very roughly speaking, G can be thought of as the 3-graph obtained by starting with a complete k-ary tree of height and replacing each of its vertices by a copy of G.
In each of the graphs G ( ≥ 0) we will have a special set A of k + + 1 vertices, whose role will be similar to the role of the set A in Definition 2.3. The elements of A ⊆ V (G ) will be denoted by x 1 , . . . , x k , y 0 , . . . , y . If G * is a copy of some G , then we will use x i (G * ) and y i (G * ) to denote the vertices of G * playing the roles of x i and y i , respectively, in G * . We will also write A (G * ) = {x 1 (G * ), . . . , x k (G * ), y 0 (G * ), . . . , y (G * )}. When G * is clear from the context, we will simply write A , x 1 , . . . , x k , y 0 , . . . , y .
Recall that G is assumed to be nice; so let A ⊆ V (G) be as in Definition 2.3 and note that |A| = k+1 and that A is an independent set. Label the vertices of A (arbitrarily) as x 1 , . . . , x k , y 0 and set G 0 to be G, y 0 (G 0 ) to be y 0 and x i (G 0 ) to be x i for every 1 ≤ i ≤ k. In particular, A 0 (G 0 ) = A. Proceeding by induction, we fix ≥ 1 and assume that G −1 and the vertices x 1 (G −1 ), . . . , x k (G −1 ) and y 0 (G −1 ), . . . , y −1 (G −1 ) (and thus also the set A −1 (G −1 )) have already been defined. Now G is defined as follows. Start with the k + + 1 vertices x 1 , . . . , x k , y 0 , . . . , y . Define x i (G ) to be x i for every 1 ≤ i ≤ k and y i (G ) to be y i for every 0 ≤ i ≤ . In addition to these k + + 1 vertices, we also have k additional vertices x 1 , . . . , x k . For each 1 ≤ i ≤ k, add a copy of G −1 , denoted G i −1 , in which x j plays the role of x j (G −1 ) for each j ∈ [k] \ {i}, x i plays the role of x i (G −1 ), y j plays the role of y j (G −1 ) for each 0 ≤ j ≤ − 1 and all other v(G −1 ) − k − vertices are "new". As a last step, add a copy G of G in which x i plays the role of x i (G) for each 1 ≤ i ≤ k, y plays the role of y 0 (G) and all other v(G) − k − 1 vertices are "new". The resulting 3-graph is G . Proof. We first prove by induction on that A (G ) is an independent set. For = 0, this is guaranteed by our choice of A 0 (G 0 ) = A. So fixing ≥ 1 and assuming the claim holds for − 1, we now prove it for . By the definition of G , each edge of G belongs to one of the 3-graphs . So the fact that A (G ) is independent follows from the induction hypothesis for − 1 and from the case = 0.
Since A (G ) is independent, the subgraphs G 1 −1 , . . . , G k −1 , G , which comprise G , are pairwise edge-disjoint. This implies that e(G ) = k · e(G −1 ) + e(G). We now prove the two assertions of Item 1 of the lemma by induction on . The case = 0 is immediate. As for the induction step, observe that for each ≥ 1, we have where the second equality follows from the induction hypothesis for − 1. Moreover, we have v(G ) = 2k Here we used the fact that ∆(G) = k and the induction hypothesis ∆(G −1 ) = k + − 1. So we see that ∆(G ) = k + . We have thus proved that Item 1 in Lemma 2.6 holds.
We now move on to Item 2 of Lemma 2.6. We will prove this item in the following slightly stronger form, which allows for an inductive proof.  For the rest of the proof it will be safe to write x i for x i (G ), y i for y i (G ) and A for A (G ), as we always consider G and no other hypergraph (so there should be no confusion). This will simplify the notation.
Suppose first that t ≤ e(G −1 )/e(G). In this case, take G to be the subgraph G from the above induction hypothesis with t := t. Then G satisfies all the requirements in Claim 4.2.
Suppose from now on that t > e(G −1 )/e(G). If t = e(G )/e(G), then G = G satisfies all the requirements in Claim 4.2. Suppose then that t ≤ e(G )/e(G) − 1 = (k +1 − 1)/(k − 1) − 1 = k · (k − 1)/(k − 1), where the first equality uses Item 1 of Lemma 2.6. We also assumed that t ≥ e(G −1 )/e(G) + 1 = (k − 1)/(k − 1) + 1. Let d be the unique integer satisfying and note that 1 ≤ d ≤ k − 1 by the above upper and lower bounds on t. Set and note that 0 ≤ t < (k − 1)/(k − 1) = e(G −1 )/e(G) by (9). Let G be the subgraph of G k −1 obtained from the above induction hypothesis, so that e(G ) = t · e(G) and where the second inequality holds because y 0 , . . . , y −1 ∈ A and x 1 , . . . , x k−1 ∈ V (G ) ∩ A (using the above induction hypothesis). Now, take G to be the subgraph of G consisting of G 1 −1 , . . . , G d −1 , G and G . Recall that G is a subgraph of G k −1 and that d ≤ k − 1. This implies that G 1 −1 , . . . , G d −1 , G , G are pairwise edge-disjoint. Hence, where the second equality uses Item 1 of Lemma 2.6 and that e(G ) = t · e(G), while the last equality uses our choice of t in (10). Next, note that {x 1 , . . . , x k , y 0 , . . . , In particular, we have |V (G ) ∩ {y 0 , . . . , y }| = + 1 and x 1 , . . . , x k−1 ∈ V (G ). So to prove that G satisfies the requirements in Claim 4.2, it remains to show that v(G ) − e(G ) ≤ k + . To this end, observe that where in the first equality we used the definition of G ; in the inequality we used the fact that |V (G ) ∩ A | ≥ v(G ) − e(G ) by (11); in the second equality we used Item 1 of Lemma 2.6 and |A | = k + +1; and in the last equality we used (12). We have thus shown that v(G )−e(G ) ≤ k + , as required.
The rest of this section is devoted to establishing Item 3 of Lemma 2.6. To this end, we first prove the following claim, which shows that the niceness of G (with respect to the set A) is carried over in a certain sense to G for every ≥ 0. From now on, we will write A = {x 1 , . . . , x k , y 0 , . . . , y } (omitting G from the notation). We also set X := {x 1 , . . . , x k }.
Proof. We first prove Items 1-2 by induction on and then deduce Item 3 from Item 1. In the base case = 0, Items 1-2 immediately follow from the fact that G 0 = G is nice and from our choice of A 0 = A via Definition 2.3. Let now ≥ 1 and let U ⊆ V (G ) be such that {y 0 , . . . , y −1 } ⊆ U . We start with Item 1.
. Also, put U 0 := U ∩ V (G ) and note that because y 0 , . . . , y −1 ∈ U by assumption. Since the subgraphs G 1 −1 , . . . , G k −1 , G , which comprise G , are pairwise edge-disjoint, we have e(U ) = k i=0 e(U i ). Observe also that as each element of X∪{y 0 , . . . , y −1 } is contained in exactly k of the sets V (G 1 −1 ), . . . , V (G k −1 ), V (G ) and each of the other vertices of G is contained in exactly one of these sets. From the above formulas for e(U ) and |U |, it follows that Here we used the fact that {y 0 , . . . , y −1 } ⊆ U by assumption. Recall that by the definition of G , for each 1 ≤ i ≤ k, we have By the induction hypothesis for − 1, applied to the copy G i −1 of G −1 , we get where the second inequality follows by considering whether x i ∈ U i or not. From (15), we obtain where in the first equality we used the fact that each element of X belongs to exactly k − 1 of the sets A \ {x i , y } (where 1 ≤ i ≤ k) and each element of {y 0 , . . . , y −1 } belongs to all of these sets. Plugging the above into (14) gives Since G is nice and G is a copy of G in which y plays the role of y 0 (G), we have Note that 1 {x 1 ,...,x k ,y }⊆U 0 = 1 A ⊆U because y 0 , . . . , y −1 ∈ U . By combining (13), (17), (18), we get thus establishing Item 1. Next, we prove Item 2. Suppose then that |U ∩ X| ≤ k − 2 and U \ A = ∅. The inequality . , x k , y }| + 1. Here we used the niceness of G (see Item 2 in Definition 2.3). By plugging our bound on ∆(U 0 ) into (17) and using (13), we get ∆(U ) ≥ ∆(U 0 ) + ≥ |U 0 ∩ {x 1 , . . . , x k , y }| + 1 + = |U ∩ A | + 1, as required. Now suppose that 1 ≤ i ≤ k. We claim that In other words, we show that the inequality bounding the leftmost term in (15) by the rightmost one is strict. If x i ∈ U i , then as required. Here, in the first inequality we used (15), in the equality we used the fact that A −1 (G i −1 ) ⊆ U i (as mentioned above) and in the last inequality we used the fact that So suppose now that x i / ∈ U i and note that in this case So, by the induction hypothesis applied to the copy G i −1 of G −1 , we have where the last inequality uses that . This proves (19). By repeating the calculation in (16) and plugging in (19) and (15) By plugging the above into (14), we get We show that in this case, Item 1 in Claim 4.4 holds. Let ϕ 1 , . . . , ϕ d be distinct neighbours of ϕ in G. By the pigeonhole principle, there is I ⊆ [d] of size at least 2 −v d = 2 v2 v r and a set U ⊆ V (G ) such that, for all i ∈ I , it holds that U (ϕ, ϕ i ) = U . As in the proof of Lemma 3.1, we consider the coloring {i, j} → U (ϕ i , ϕ j ) of the pairs {i, j} ∈ I 2 and use a well-known bound for multicolor Ramsey numbers [6] to obtain a set I ⊆ I of size |I| = r and a set U ⊆ V (G ) such that U (ϕ i , ϕ j ) = U for all {i, j} ∈ I 2 . Observe that for each {i, j} ∈ I 2 , we have U ⊇ U (ϕ, ϕ i ) ∩ U (ϕ, ϕ j ) = U . In particular, {y 0 , . . . , y −1 } ⊆ U ⊆ U (by the definition of G). Note also that U = V (G ) because the copies (ϕ i : i ∈ I) of G are distinct.
We now use Claim 4.3 to prove that ∆(U ) ≥ k + . The definition of the graph G implies that the set U must satisfy one of the conditions (i)-(iii) above. Note that for each of these three conditions, if it is satisfied by U , then it is also satisfied by every superset of U and, in particular, by U . Now, if U satisfies Condition (i) (resp. (iii)), then the bound ∆(U ) ≥ k + immediately follows from Item 1 (resp. 3) of Claim 4.3. Suppose then that U satisfies Condition (ii). If |U ∩ X| ≥ k − 1, then |U ∩ A | ≥ k + (since y 0 , . . . , y −1 ∈ U and Condition (ii) supposes that y ∈ U ), so again we can use Item 1 of Claim 4.3. Finally, if |U ∩ X| = k − 2 and U \ A = ∅, then we have ∆(U ) ≥ |U ∩ A | + 1 = k + , where the inequality is Item 2 of Claim 4.3 and the equality holds because {y 0 , . . . , y } ⊆ U and |U ∩ X| = k − 2. We have thus shown that ∆(U ) ≥ k + in all cases.
Suppose without loss of generality that I = [r]. Put W := ϕ 1 (U ) = · · · = ϕ r (U ) and denote Combining all of the above, we see that the assertion of Item 1 in the claim holds with q := e(U ). This completes the proof in the case where G has a vertex of degree at least d.
From now on we assume that the maximum degree of G is strictly smaller than d. Let F * ⊆ F be an independent set in G of size at least v(G)/d = |F|/d. For each -tuple of vertices u = (u 0 , . . . , u −1 ) ∈ C := C y 0 × · · · × C y −1 , we denote by F * (u) the set of all ϕ ∈ F * such that ϕ(y i ) = u i for each 0 ≤ i ≤ − 1. Note that We claim that |F * (u)| ≤ n k for each u ∈C. To see this, fix any such u and let ϕ 1 , ϕ 2 ∈ F * (u) be distinct. If ϕ 1 (x i ) = ϕ 2 (x i ) for each 1 ≤ i ≤ k, then {x 1 , . . . , x k , y 0 , . . . , y −1 } ⊆ U (ϕ 1 , ϕ 2 ). But then U satisfies Condition (i) above, implying that {ϕ 1 , ϕ 2 } ∈ E(G), contradicting the fact that F * is an independent set in G. So we see that for each u ∈C and each ϕ ∈ F * (u), the values of ϕ(x 1 ), . . . , ϕ(x k ) determine ϕ uniquely. It follows that indeed |F * (u)| ≤ n k . Now, by using (20) and averaging, we get that there are at least ζ 2 n tuples u ∈C which satisfy |F * (u)| ≥ ζ 2 n k . Let C ⊆C be the set of all such tuples u. We will show that for every u = (u 0 , . . . , u −1 ) ∈ C, there are at least 1 2 γ(k, ζ 2 ) · n k+1 copies of G +1 in H in which u i plays the role of y i (G +1 ) for every 0 ≤ i ≤ − 1. Combining this with the fact that |C| ≥ ζ 2 n , we will conclude that H contains at least ζ 2 n · 1 2 γ(k, ζ 2 ) · n k+1 = δn k+ +1 copies of G +1 , as required.
Finally, we use Claim 4.4 in order to establish Item 3 of Lemma 2.6 by induction on . The case = 0 is trivial. Let us now fix ≥ 0, assume the validity of Item 3 of Lemma 2.6 for and prove its validity for + 1. It is easy to see that if the assertion of Item 3(a) holds for parameter , then it also holds for parameter + 1. So we may assume that the assertion of Item 3(b) holds, namely, that H contains at least δ · n k+ copies of G , where δ := δ 2.6 ( , r, ε). Now, apply Claim 4.4 to H (with parameter δ in place of ε). If Item 1 of Claim 4.4 holds, then Item 3(a) of Lemma 2.6 holds with + 1 in place of (and with j = ). If instead Item 2 of Claim 4.4 holds, then H contains at least δ · n k+ +1 copies of G +1 , where δ = δ 4.4 ( , r, δ ). So we see that Item 3(b) in Lemma 2.6 is satisfied. This completes the proof of the lemma.

An Improved Bound for a Problem of Erdős and Gyárfás
The Brown-Erdős-Sós problem has a known connection to (a special case of) the following generalized Ramsey problem, introduced by Erdős and Gyárfás in [9]. Let g(n, p, q) denote the minimum number of colors in a coloring of the edges of K n in which every copy of K p receives at least q colors. For a fixed p ≥ 4, Erdős and Gyárfás [9] showed that g(n, p, q) is quadratic in n if and only if q ≥ q quad (p) := p 2 − p 2 + 2 and that, for p even, g(n, p, q quad (p)) ≤ n 2 − εn 2 for some ε = ε(p) > 0. They then asked for which q quad (p) ≤ q ≤ p 2 it holds that g(n, p, q) = n 2 − o(n 2 ), observing that this question is related to the Brown-Erdős-Sós problem and using this relationship to prove some initial results. This connection was further exploited by Sárközy and Selkow, who combined it with (1) (or, more precisely, with a 4-uniform analogue thereof) to show that g(n, p, q) = n 2 − o(n 2 ) whenever q > q quad (p) + log 2 p 2 . By using our improved bound for the Brown-Erdős-Sós problem (i.e., Corollary 2), we can improve upon the result of Sárközy and Selkow [21]. For completeness, we now sketch the proof of the reduction from the above generalized Ramsey problem to the Brown-Erdős-Sós problem. This reduction has been used implicitly in [9,21].
Proof. Assume that f 4 (n, p, e) = o(n 2 ) and suppose, for the sake of contradiction, that (for infinitely