Turán‐type problems for long cycles in random and pseudo‐random graphs

We study the Turán number of long cycles in random and pseudo‐random graphs. Denote by ex(G(n,p),H)$\operatorname{ex}(G(n,p),H)$ the random variable counting the number of edges in a largest subgraph of G(n,p)$G(n,p)$ without a copy of H$H$ . We determine the asymptotic value of ex(G(n,p),Ct)$\operatorname{ex}(G(n,p), C_t)$ , where Ct$C_t$ is a cycle of length t$t$ , for p⩾Cn$p\geqslant \frac{C}{n}$ and Alogn⩽t⩽(1−ε)n$A \log n \leqslant t \leqslant (1 - \varepsilon )n$ . The typical behaviour of ex(G(n,p),Ct)$\operatorname{ex}(G(n,p), C_t)$ depends substantially on the parity of t$t$ . In particular, our results match the classical result of Woodall on the Turán number of long cycles, and can be seen as its random version, showing that the transference principle holds here as well. In fact, our techniques apply in a more general sparse pseudo‐random setting. We also prove a robustness‐type result, showing the likely existence of cycles of prescribed lengths in a random subgraph of a graph with a nearly optimal density. Finally, we also present further applications of our main tool (the Key Lemma) for proving results on Ramsey‐type problems about cycles in sparse random graphs.


Introduction
One of the most central topics in extremal graph theory is the so-called Turán-type problems.Recall that ex(n, H) denotes the maximum possible number of edges in a graph on n vertices without having H as a subgraph.Determining the value of ex(n, H) for a fixed graph H has become one of the most central problems in extremal combinatorics and there is a rich literature investigating it.Mantel [33] proved in 1907 that ex(n, K 3 ) = ⌊ n 2 4 ⌋; Turán [42] found the value of ex(n, K t ) for t ≥ 3 in 1941.In 1968, Simonovits [38] showed that the result of Mantel can be extended for an odd cycle of a fixed length, that is, ex(n, C 2t+1 ) = ⌊ n 2 4 ⌋, where the extremal example is the complete bipartite graph 1 .For the general case, it was proved in 1946 by Erdős and Stone [14] that ex(n, H) = 1 , where χ(H) is the chromatic number of the fixed graph H.Note that when H is a graph with chromatic number 2, an even cycle for instance, then from the above result we can only obtain that ex(n, H) = o(n 2 ).Bondy and Simonovits [8] proved in 1974 that for even cycles we have ex(n, C 2t ) = O(n 1+1/t ).Unfortunately, a matching lower bound is known only for the cases where t = 2, 3, 5.For a survey see [39,43].
In this paper we consider the case where H = C t and t := t(n) tends to infinity with n.In this direction, it was proved by Erdős and Gallai [13], among other things, that if t := t(n), then ex(n, P t ) = ⌊ 1 2 (t − 1)n⌋.For long cycles, it was shown by Woodall [44] that if t ≥ 1 2 (n + 3) then ex(n, C t ) = t−1 2 + n−t+2 2 , where the extremal example is given by two cliques intersecting in exactly one vertex.In the same paper, Woodall also showed that for odd cycles C t shorter than 1 2 (n + 3), the trivial bound ex(n, C t ) ≥ ⌊ n 2 4 ⌋ is still tight.In the past few decades several generalizations of the classical Turán number ex(n, H) were suggested and many results have been established in this area.Denote by ex(G, H) the number of edges in a largest subgraph of a graph G containing no copy of H.Note that the value of ex(G, H) is bounded from below by the number of edges in G that are not contained in any copy of H.As a consequence, if the number of copies of H in G is much smaller than the number of edges in G, then we obtain that ex(G, H) ≥ (1 − o( 1))e(G).Thus, it makes sense to restrict our attention to graphs G for which the number of copies of H is at least proportional to the number of edges.
We focus on the case where the host graph G is either a random graph or pseudo-random graph.Given a positive integer n and a real number p ∈ [0, 1], we let G(n, p) be the binomial random graph, that is, a graph sampled from the family of all labeled graphs on the vertex set [n] := {1, . . ., n}, where each pair of elements of [n] forms an edge with probability p := p(n), independently.We denote by ex(G(n, p), H) the number of edges in a largest subgraph of G(n, p) without a copy of H (note that ex(G(n, p), H) is a random variable).Clearly, in this case we want to consider only the values of p for which G(n, p) contains a copy of H with high probability (w.h.p., i.e., with probability tending to 1 as n → ∞), and in fact, the number of copies of H in G is typically "large enough".
For fixed-size graphs H, this parameter has already been considered by various researchers.It is known that the threshold probability for a random graph to have the property that a typical edge is contained in a copy of H, for a fixed graph H, is n −1/m 2 (H) , where m 2 (H) is the maximum 2-density and defined to be m 2 (H) = max e(H ′ )−1 v(H ′ )−2 | H ′ ⊆ H, v(H ′ ) ≥ 3 (see [19] for more details).Therefore, it makes sense to consider graphs G(n, p) for the regime p = Ω(n −1/m 2 (H) ).The cases H = K 3 , H = C 4 , and H = K 4 were solved by Frankl and Rödl [15], Füredi [20], and by Kohayakawa, Luczak, and Rödl [27], respectively.For fixed odd cycles, it was shown by Haxell, Kohayakawa, and Luczak [22] that for p ≥ Cn −(2t−1)/2t we have that 1  2 e(G(n, p)) ≤ ex(G(n, p), C 2t+1 ) ≤ 1  2 + ε e(G(n, p)).For fixed even cycles, the same group of authors showed [23] that for p = ω(n −(2t−2)/(2t−1) ) we have ex(G(n, p), C 2t ) = o(e(G(n, p))) (for more precise bounds on the fixed even cycle case, see Kohayakawa, Kreuter, and Steger [26], and Morris and Saxton [35]).The authors of [22,23,27] conjectured that a similar behaviour should also hold for any fixed-size graph H, that is, that the value of ex(G(n, p), H) should be asymptomatically equal to ex(n,H) ( n 2 ) • e(G(n, p)), for suitable values of p.This conjecture was proved independently by Conlon and Gowers [10] (with certain constraints on H) and by Schacht [37], who showed that the Turán number of a fixed graph in G(n, p) is of the same proportion of edges as it is in the complete graph, where the latter has been determined by Erdős and Stone.More precisely, they proved that for p ≥ Cn −1/m 2 (H) , and for a fixed graph H, w.h.p. ex(G(n, p), H) ≤ (1 − 1 χ(H)−1 + ε)e(G(n, p)).A matching lower bound can be obtained by a random placement of the extremal example of ex(n, H).The phenomenon that we observe here is frequently called the transference principle, which in this context can be interpreted as a random graph "inheriting" its (relative) extremal properties from the classical deterministic case, i.e., the complete graph.In their papers, Conlon and Gowers [10] and Schacht [37] discussed this principle and showed transference of several extremal results from the classical deterministic setting to the probabilistic setting.
In this paper we aim to study the transference principle in the context of long cycles.The first step is to understand what should be the relevant regime of p.It is easy to observe that if p = o( 1 n ) then a typical G(n, p) is a forest, that is, does not contain any cycle.Thus, when looking at the appearance of a cycle in G(n, p), it is natural to restrict ourselves to the regime p = Ω( 1 n ).Furthermore, it is well known that cycles start to appear in G(n, p) at probability p = Θ 1 n .We shall further recall what are the typical lengths of cycles one can expect to have in this regime.Note that for p = Θ 1 n w.h.p. there are linearly many isolated vertices.Therefore, in this regime of p, we can hope to find in G(n, p) cycles of length at most (1 − ε)n for some constant ε > 0. Indeed, the typical appearance of nearly spanning cycles was shown in a series of papers by Ajtai, Komlós, and Szemerédi [1], de la Vega [11], Bollobás [6], Bollobás, Fenner and Frieze [7].In 1986 Frieze [18] proved that if p ≥ C n then w.h.p. in G(n, p) there exists a cycle of length at least n − (1 + ε)v 1 (n, p), where v 1 (n, p) is the number of vertices of degree at most 1 and ε := ε(C) (and it was very recently improved even more by Anastos and Frieze [3]).In 1991, Luczak showed [32] that for p = ω 1 n , w.h.p.G(n, p) contains cycles of all lengths between 3 and n − (1 + ε)v 1 (n, p).On the other hand, when looking at cycles of length o(log n) in the context of Turán-type problems, the regime p = Θ( 1 n ) is not quite relevant.It is easy to verify that for p = Θ( 1 n ) w.h.p. one expects o(e(G(n, p))) cycles of such lengths, and hence they can be destroyed by deleting a negligible proportion of edges.Therefore, when requiring that the number of copies of C t will be w.h.p. at least proportional to the number of edges, combining it with the fact that p = Ω 1 n , we get that t = Ω(log n).Moving back to the extremal problem, it was shown by Dellamonica, Kohayakawa, Marciniszyn, and Steger [12] 1)) e(G(n, p)), then w.h.p.G ′ contains a cycle of length at least (1 − α)n, where w(α) = 1 − (1 − α)⌊(1 − α) −1 ⌋.This result is asymptotically tight by the classical result of Woodall [44] that guarantees a cycle of length at least (1 − α)n in any graph G with e(G) Very recently, Balogh, Dudek and Li [4] studied the asymptotic behavior of ex(G(n, p), P ℓ ) for various ranges of ℓ = ℓ(n).
In this paper we study the appearance of long cycles of a given length in subgraphs of pseudorandom graphs.As a direct consequence we get a result for G(n, p).More precisely, we determine the asymptotic value ex((G(n, p)), C t ), where p = Ω( 1 n ) and t is between Θ(log n) and (1 − ε)n.The more general statement deals with a class of graphs which is larger than the random graphs class.For this we use the following definition.Definition 1.1.Let G be a graph on n vertices.Suppose 0 < η ≤ 1 and 0 , and we use it to count the number of edges in such cuts of H in two ways.We have The following notation is based on results by Erdős-Gallai [13] and Woodall [44] (see Theorem 2.1 and Theorem 2.2 for more information).
Definition 1.3.The functions g o , g e are given as follows.
If t is odd, then Later we will set a specific value of the parameter γ (see Remark 2.7).
We are now ready to state our main theorem.Here and later, log n refers to the natural logarithm.
Since we have ex(n, P t ) = ex(n, P t−1 ) + O(n), then ex(n, P t ) − O(n) ≤ ex(n, P t−1 ) ≤ ex(n, C t ), and we can deduce from our main result the following corollary.
Remark 1.6.In both Theorem 1.4 and Corollary 1.5 we obtain, in fact, given t, all cycles of length q, where C 1 log(1/β) • log n ≤ q ≤ t, with the same parity as t.Theorem 1.4 and Corollary 1.5 are asymptotically optimal in a stronger form; a matching lower bound is true for any graph G on n vertices, not only for upper-uniform graphs.That is, for any graph G on the vertex set [n] there exists a subgraph G 0 with ex(n,Ct) This contradicts the upper uniformity of G since e(G[V \I]) ≤ (1+η)p n/2 2 .Probably the most natural application of Theorem 1.4 is for the random graph case.It is not hard to see that for p = Ω η (1/n), G(n, p) w.h.p. satisfies the conditions of Theorem 1.4.Indeed, as the total number of edges in G(n, p) is distributed binomially with parameters n 2 and p, we have that e(G(n, p)) ≥ (1 − β/2)p n 2 with probability 1 − e −Ω(n) .In addition, for, say, p ≥ log 4 η 4 n we have that for every two disjoint subsets n) .We obtain that, for p ≥ C n and C := C(η) being large enough, the random graph G(n, p) is w.h.p. (p, η)-upper-uniform.By the discussion regarding the expected cycle lengths in G(n, p), we easily get that the lower bound on t in Theorem 1.4 is, in fact, necessary.
As a result, we obtain the following corollary.
Corollary 1.9.For every 0 < β < 1 4 , there exist C, γ > 0 such that if G ∼ G(n, p) where p ≥ C n , then for any Similarly to Corollary 1.5, we can write the upper bound on ex(G(n, p), C t ) only in terms of ex(n, C t ), as follows.
Thus, also here, we observe a manifestation of the transference principle, that is, the random graph G(n, p) preserves the relative behavior of the Turán number of long cycles observed in the classical case, i.e., in the complete graph K n .
As mentioned in Remark 1.6, given t, the statement holds for every C 1 log(1/β) • log n ≤ q ≤ t with the same parity as t.
Another natural application of the main theorem is for (n, d, λ)-graphs, which can be shown to be (p, η)-upper-uniform for suitable values of d, λ.Definition 1.11.A graph G is an (n, d, λ)-graph if G has n vertices, is d-regular, and the second largest (in absolute value) eigenvalue of its adjacency matrix is bounded from above by λ.
(n, d, λ)-graphs have been studied extensively, mainly due to their good pseudo-random properties.For a detailed background see [30].Recently, it was shown in [16] that for a given )n (for some absolute constants C 1 , C 2 > 0), improving the result in [24].
Using the Expander Mixing Lemma due to Alon and Chung [2], we can show that for suitable values of d and λ, an (n, d, λ)-graph is also upper-uniform.Hence we obtain the following corollary.
Note that the lower bound on t is tight due to the existence of (n, d, λ)-graphs with large girth.More explicitly, it was shown in [31,34] that there exist infinitely many (n, d, λ)-graphs with girth Ω(log n), such that d λ is larger than a given constant.Details of the proof and further discussion on this application can be found in Section 6.1.
Using very similar techniques, we can also obtain a robustness-type result (for a detailed survey on robustness problems see [40]).In this type of results, we consider a graph G satisfying some extremal conditions that guarantee a graph property P (in our case, containment of long cycles).The aim is to measure quantitatively the strength of these specific conditions.For this, we let G be a graph satisfying these conditions, and let G(p) be the random graph obtained by keeping each edge of G independently with probability p ∈ In the next theorem we show that if G has (slightly more than) the minimum number of edges that guarantees a long cycle of a given length, then with high probability G(p) also contains such a cycle for p = Ω 1 n .This value of p is best possible due to threshold of the existence of cycles in G(n, p).Theorem 1.13.For every β > 0 there exists C > 0 such that for

and for any graph G on n vertices satisfying
Note that starting with a graph with exactly ex(n, C t ) + 1 edges is not enough.Indeed, let G be an extremal example for ex(n, C t ) with an arbitrary edge e added to it.Then when taking G(p) with p = o( 1 n ) w.h.p. e is deleted.However, the above theorem shows that adding β n 2 edges to the extremal number will be enough, and, in fact, for many values of t this number of edges is even tight.Therefore, adding β n 2 edges to the extremal number is necessary in most cases as will be examined in Remark 6.6.Full details can be found in Section 6.2.

Notation and preliminaries
Our graph-theoretic notation is standard, in particular we use the following.For a graph G = (V, E) and a set

Known extremal results
To prove our result, we use two classical theorems, one by Woodall [44] about cycles, and the other one by Erdős and Gallai [13] regarding paths.
Theorem 2.1 ([13], Theorem 2.6).Let G be an n-vertex graph with more than 1  2 n(t − 1) edges.Then G contains a path of length at least t (the number of edges).
By looking at a graph consisting of n t vertex-disjoint cliques of size t and another clique on the remaining vertices, one can observe that the above result is tight.

Theorem 2.2 ([44], Corollary 11).
Let G be a graph on n ≥ 3 vertices and let The result in Theorem 2.2 is tight in the sense that there are graphs with w(t, n) n 2 − 1 edges containing no cycle of some length between 3 and t, and corresponding extremal examples are constructed explicitly (as was mentioned briefly in the beginning of the introduction).For t ≥ 1 2 (n + 3), the graph consisting of two cliques, one of size t−1 2 and the other of size n−t+2 2 , sharing exactly one vertex, does not contain a cycle of length t or longer.For t < 1 2 (n + 3), the complete bipartite graph with 1  4 n 2 edges does not contain a cycle of any odd length, and in particular of any odd length between 3 and t.
Note that the function w(t, n) of Woodall is strongly related to the function g γ (t, n) given in Definition 1.3.In particular, for odd values of t we have w(t, n) = g o (t, n), and furthermore, w(t, n) ≥ 1 2 for any t and n.In addition, w(t, n) is monotone increasing in t for this case.So for any odd t, w(t, n As for even values of t, we get w(t, n) = g e (t, n) only when t ≥ 1 2 (n+3).For an even t < 1 2 (n+3), note that we do not necessarily have w(t, n) n 2 = ex(n, C t )+1 (although, as mentioned, Theorem 2.2 is still tight because of the requirement of having all cycles, also the odd ones, of length at most t.)For this reason, we also make use of ex(n, P t ) in Definition 1.3 for even values of t < 1 2 (n + 3).Remark 2.3.Note that if 0 < ϕ < 1  2 is constant and Another result to be used in this paper in a significant way is by Friedman and Pippenger [17], regarding the existence of large trees in expanding graphs.
Theorem 2.4 ([17], Theorem 1).Let T be a tree on k vertices of maximum degree at most d.Let H be a non-empty graph such that, for every Let further v ∈ V (H) be an arbitrary vertex of H. Then H contains a copy of T , rooted at v.

Sparse Regularity Lemma
In order to prove Theorem 1.4, we make use of a variant of Szemerédis Regularity Lemma [41] for sparse graphs, the so-called Sparse Regularity Lemma due to Kohayakawa [25] and Rödl (see [9,21,28]).The sparse version of the Regularity Lemma is based on the following definition.Definition 2.5.Let a graph G = (V, E) and a real number p ∈ (0, 1] be given.We define the p-density of a pair of non-empty, disjoint sets For any 0 < ε ≤ 1, the pair (U, W ) is said to be (ε, G, p)-regular, or just (ε, p)-regular for short, if, for all We say that a partition In the case p = 1 we say that the pair (or the partition) is ε-regular.
Theorem 2.6 (Sparse Regularity Lemma [25]).For any given ε > 0 and k 0 ≥ 1, there are constants Remark 2.7.In the main proof we make an extensive use of the Sparse Regularity Lemma (and, in fact, also of the Regularity Lemma in Section 6.2).As a result, we need to keep many parameters in mind.For simplicity, we present here some of the parameters and the relations between them.Unless mentioned otherwise, these are the values of the parameters during the proofs in the next sections, given here for future reference: "extra" number of edges we have in the reduced graph δ = 48ε proportion of number of vertices we are not able to use in each cluster γ ≤ 2(1−48ε) k parameter of g γ e (t, n) and g γ (t, n) that appears in Definition 1.3 and in Theorem 1.4 m = n k size of each cluster up to ±1 where K 0 and η * are as given in Theorem 2.6 (taking η * to be η).

Organization
As was mentioned before, in the proof of Theorem 1.4 we rely heavily on the Sparse Regularity Lemma (see Section 2.2).Roughly speaking, we use the lemma to obtain a regular partition of our graph into clusters.Then, we define an auxiliary graph (the reduced graph) in which each vertex represents a cluster of the original graph, and show that if this auxiliary graph has enough edges, then the original graph contains the desired cycle.For this, in Section 3 we define the Reduced Graph and prove that it contains many edges.Then, in Section 4 we present the Key Lemma used in the paper to convert a cycle in the reduced graph to a cycle of an appropriate length in the original graph.In the same section we give the proof of Theorem 1.4 using the Key Lemma.Section 5 is devoted for the proof of the Key Lemma.In Section 6 we give some further related results.
3 The Reduced Graph Definition 3.1 (Reduced Graph).Let ε > 0, k ≥ 1 an integer, 0 ≤ p ≤ 1, and 0 < ρ ≤ 1.Let G 0 be a graph on n vertices, and Π = (V 1 , . . ., V k ) a partition of its vertices.We define the reduced graph R(G 0 , Π, ρ, ε, p) to be the graph on the vertex set {1, . . ., k}, where vertices i and j are connected by an edge if and only if (V i , V j ) is (ε, p)-regular and d G 0 ,p (V i , V j ) ≥ ρ.If we consider the reduced graph where p = 1, we omit this parameter from the notation.
32 , and η < 1 3k be positive.Assume that G is an (p, η)-upper uniform graph, and e(G) ≥ (1 − β/2)p n 2 , for some 0 < p := p(n) ≤ 1.Let G ′ be the graph obtained from G by keeping at least (x + β) e(G) edges, and assume that • The number of edges with endpoints in the same • The number of edges in irregular pairs is at most • The number of edges in pairs that are of p-density less than ρ is at most • The number of edges in (ε, p)-regular pairs (V i , V j ) with p-density at least ρ is at most In total we get On the other hand, recall that so we get and hence where the last inequality follows by the choice of the parameters ε, η, ρ, k, τ combined with the fact that x ≤ 1.
4 Key Lemma and proof of Theorem 1.4 In this section we state the Key Lemma and then use it to prove Theorem 1.4.We say that the pair Definition 4.2.Let ε > 0 and let k be a positive integer.Let G 0 be a graph and let Π = (V 1 , . . ., V k ) be a partition of its vertices into k parts satisfying We define the ε-graph S := S(G 0 , Π, ε) to be the graph with vertex set [k] where {i, j} ∈ E(S) if the pair (V i , V j ) satisfies the ε-property in G 0 .
• If S contains a path of an odd length b, 1 ≤ b < k, then G 0 contains cycles of all even lengths in an , with a := b+1 k .
• If S contains a cycle of an odd length b, The assumption in the first item that b is odd is of technical nature and is in fact an artifact of our proof strategy.The proof of the Key Lemma can be found in Section 5.3.
Using this Key Lemma, we can deduce the existence of long cycles in a graph in cases where there are enough edges in a corresponding ε-graph.
, and δ = 48ε.Let G 0 be a graph on n vertices, for large enough n, and let 10000 is an absolute constant and C 1 is the absolute constant from Lemma 4.3.Assume that there exists a partition Π = (V 1 , . . ., V k ) of the vertices of G 0 such that the corresponding ε-graph S := S(G 0 , Π, ε) satisfies e(S) ≥ (g γ (t, n) + β/32) k 2 , where g γ (t, n) is defined in Definition 1.3.Then G 0 contains a cycle of length t.
Proof.We split the proof into four cases by the parity and the value of t.Throughout all following cases we use the facts that 1 − C 2 β ≤ 1 − δ and that ε < β.
Case 1: t is even and t < γn.In this case we have g γ e (t, n) = 0, and in particular e(S) ≥ β 32 k 2 .By Theorem 2.1 we get that S contains a path of length at least β 32 • k > 1 and hence, by Lemma 4.3, G 0 contains a cycle of length t.
Case 2: t is even and γn ≤ t < 1 2 (n + 3).In this case we have , and in particular e(S) ≥ we get that G 0 contains a cycle of length t, where if t is odd then we look at the cycle in S and if t is even then we look at the path.
Remark 4.5.Given γ, note that the function g γ (t, n) is monotone in the following sense.For any 0 < t < 1 4 (n+3) we have We next show that p-regular pairs of subsets in our graph with non-negligible p-density satisfy the ε-property.Then by the Key Lemma we can deduce the main theorem.Claim 4.6.Let n be an integer, ε > 0, ε < ρ < 1  2 .Let G 0 be a graph on n vertices and let Using Corollary 4.4 we can immediately prove our main theorem.
Let C 1 > 0 be the constant from Lemma 4. Applying Remark 4.5 to Theorem 1.4, note that if t is odd then G contains all cycles of lengths between C 1 log n log(1/β) and t, and if t is even then G contains all even cycles of lengths between C 1 log n log(1/β) and t.In addition, if t > 1 2 (n + 3) then G contains all cycles of lengths between C 1 log n log(1/β) and t (regardless of the parity of t).

Proof of the Key Lemma
In this section we prove the Key Lemma (Lemma 4.3) using several claims and results regarding tree embeddings in expander graphs.The main idea is to show that every two vertices connected by an edge in the reduced graph represent a pair of clusters in the original graph that has "good expansion" properties (Section 5.1).Then, we show that the graph induced by any pair of such clusters contains a very specific tree (Section 5.2), which will later be used to embed the desired cycle (Section 5.3).

Expander graphs
For the proofs in this section we also need a somewhat more specific definition of expander graphs for the special case of bipartite graphs.

Definition 5.2. A bipartite graph
)εm for some integer m, and assume that every two subsets Otherwise, there are subsets violating the expansion condition.We iteratively remove such subsets of size at most εm, one by one, to create an (εm, b)-bipartiteexpander.We then show that the expander we have created is, in fact, an (ax, b)-bipartite-expander.More formally, we define If at some point r 0 there are no more subsets violating the (εm, b)-expansion condition in V r 0 1 , V r 0 2 , and we have |W ] is an (εm, b)-bipartite-expander.Otherwise, for some r 0 we have, for the first time in this process, |W r 0 i | ≥ εm for some i ∈ {1, 2}.Since in each step r of the process we add to one of W r−1 1 , W r−1 2 at most εm vertices, it follows that εm ≤ |W r 0 i | ≤ 2εm.By the definition of W r 0 i we get |Γ(W r 0 i ) ∩ V r 0 j | < b|W r 0 i |, where i = j ∈ {1, 2}.By the choice of r 0 we know that |W r 0 j | < εm (j = i), and thus It follows from our assumption that e G (W r 0 i , V j \ Γ(W r 0 i )) > 0, which is a contradiction.Hence in the end of this vertex-removal process we are left with We conclude by proving that G[U 1 , U 2 ] is in fact an (ax, b)-bipartite-expander.Assume, for contradiction, that for 1 ≤ i = j ≤ 2 there exists W ⊆ U i with εm < |W | ≤ ax and such that and by the assumption we get e(W, U j \ Γ(W )) > 0, which is a contradiction.

Tree embeddings
We start by defining the following trees, playing a key role in our proofs.
Definition 5.6.Let T (r,h) be the r-ary tree of depth h (that is, the tree where each vertex, but a leaf, has r children, and the distance, in edges, between the root and every leaf is exactly h).Let T (r,h) ℓ be the tree consisting of two disjoint copies of T (r,h) and a path of length ℓ connecting their roots.Remark 5.7.Note that a longest path in T (r,h) ℓ is of length ℓ + 2h.Furthermore, the tree T (r,h) ℓ has exactly ℓ − 1 + 2 • r h+1 −1 r−1 vertices.The main ingredients in the proof of Lemma 4.3 are the following claims regarding tree embeddings in bipartite-expander graphs.

Proposition 5.8. Let G be a bipartite graph with parts
85 and assume that the pair (V 1 , V 2 ) satisfies the ε-property in G. Then G contains every tree on at most 6εm vertices with maximum degree at most 1 16ε − 1.
Proof.Assume first that ℓ is odd.Let U 11 , U 12 ⊆ V 1 be disjoint, and U 21 , U 22 ⊆ V 2 be also disjoint, such that |U ij | = ⌈21εm⌉ for any i, j ∈ {1, 2}.By Corollary 5.5 (item 2) applied separately on G[U 11 , U 21 ] and on G[U 12 , U 22 ] we get four subsets W ij ⊆ U ij , i, j ∈ {1, 2}, all of size at least 20εm, such that each of the graphs be odd, and let q = 4⌈εm⌉.We now find a path of length exactly ℓ − 4 + q.We do this using the following claim, implied by a standard DFS-based argument, stated implicitly in [5] and more explicitly in, e.g., [36].For a more extensive discussion about the DFS (Depth First Search) algorithm in finding paths in expander graphs we refer the reader to [29].
Claim 5.10.For every graph G there exists a partition of its vertices V = S ∪ T ∪ U such that |S| = |T |, G has no edges between S and T , and U spans a path in G.
and in particular G[X 1 , X 2 ] contains a path of length at least 2(1 − 45ε)m − 3. Thus, let P 0 be a path of length ℓ − 4 + q ≤ 2(1 − 45ε)m − 3 and denote its endpoints by u * ∈ X 1 and v * ∈ X 2 .Let u 1 , . . ., u q be the first q vertices of P 0 when moving from u * , that is u * = u 1 , and let v 1 , . . .v q be the first q vertices of P 0 when moving from v * , that is v * = v 1 .Note that the vertices {u 1 , . . ., u q } are distributed equally between X 1 and X 2 , having exactly 2⌈εm⌉ vertices in each set, and similarly the vertices {v 1 , . . ., v q }.Consider now only the 2⌈εm⌉ vertices with odd indices, i.e., {u 1 , u 3 , . . ., u q−1 } and {v 1 , v 3 , . . ., v q−1 }, and note that we have {u 1 , u 3 , . . ., u q−1 } ∈ X 1 and {v 1 , v 3 , . . ., v q−1 } ∈ X 2 .Hence, by the ε-property of the pair (V 1 , V 2 ) in G, at least ⌈εm⌉ + 1 of the vertices in {u 1 , u 3 , . . ., u q−1 } have some neighbor in W 21 , and similarly, at least εm + 1 of the vertices {v 1 , v 3 , . . ., v q−1 } have some neighbor in W 12 .By the pigeonhole principle, there exists (an odd) s ∈ {1, . . ., q − 1} such that u s is connected to some vertex in W 21 and v q−s is connected to some vertex in W 12 .Denote by P the subpath of P 0 with endpoints u s and v q−s , denoted by u, v, respectively, and note that it is of length exactly ℓ − 2. Now, let w 1 be a neighbor of u in W 21 and w 2 be a neighbor of v in W 12 .Recall that by Theorem 2.4 there exists a copy of T (2,h) in G[W 11 , W 21 ], for h = ⌈ log(εm) log 2 ⌉, rooted in any predetermined vertex of W 21 .Similarly, there exists a copy of T 2,h in G[W 12 , W 22 ], for the same value of h, rooted in any predetermined vertex of W 12 .Let T w 1 , T w 2 be these copies of T (2,h) in G[W 11 , W 21 ] and in G[W 12 , W 22 ], respectively, rooted in w 1 ∈ W 21 and in w 2 ∈ W 12 , respectively.Joining T w 1 and T w 2 to P , we get a copy of T (2,h) ℓ , as required.If ℓ is even then we repeat the same argument, with a minor change.Note first that if ℓ is even then any embedded copy of T has all leaves in either V 1 or V 2 .Assume that we wish to embed a copy of T (2,h) ℓ with all leaves in V i for some i ∈ {1, 2}.Note further that if ℓ is even then P 0 is of an even length ℓ − 4 + q, and hence both of its endpoints u * and v * are in X j for some j ∈ {1, 2}.Now, we look at {u 1 , . . ., u q } and {v 1 , . . ., v q } and split into two possible cases by the parity of h and by the part in which the endpoints of P 0 are contained.If h is even and i = j, or if h is odd and i = j, then we consider only vertices of odd indices, i.e., {u 1 , u 3 , . . ., u q−1 } and {v 1 , v 3 , . . ., v q−1 }.If h is even and i = j, or if h is odd and i = j, then we consider only vertices of even indices, i.e., {u 2 , u 4 , . . ., u q } and {v 2 , v 2 , . . ., v q }.For simplicity we assume now that h is even and j = 1, i = 2 (in particular i = j), where all other cases are handled similarly.This means that by the pigeon hole principle there exists (an odd) s ∈ {1, . . ., q − 1} such that u s is connected to some vertex in W 21 and v q−s is connected to some vertex in W 22 , and equivalently to the odd ℓ case, we embed trees T w 1 and T w 2 , having w 1 ∈ W 21 and w 2 ∈ W 22 .

Proof of the Key Lemma
We are now ready to prove Lemma 4.3 using Proposition 5.8 and Proposition 5.9.
Proof of Lemma 4.3.Throughout the proof we denote m := n k .Note that k is constant, so m = Θ(n).Recall that S is the ε-graph obtained from G 0 with respect to the partition Π = (V 1 , . . ., V k ), that is, every edge {i, j} ∈ E(S) represents a pair (V i , V j ) which satisfies the ε-property in G 0 .
The general idea is to convert a cycle (or a path) from the graph S to a cycle in G 0 of the desired length, by using tree embeddings between clusters of G 0 .Assume that (1, . . ., b) is a cycle in S and that b is odd.Roughly speaking, we divide the cycle in S into pairs of vertices that are connected with an edge (2i, 2i + 1).We then embed in each pair of corresponding clusters (V 2i , V 2i+1 ) a tree T (r,h) ℓ with appropriate parameters such that the leaf sets are in different clusters.Since each of these leaf sets contains at least εm vertices, we can use the ε-property to connect some leaf from the leaves in V 2i+i and some leaf from the leaves in V 2i+2 by an edge.This way, we are able to connect different copies of T (r,h) ℓ to a very large tree, containing a copy of T (r,h) ℓ * for an appropriate ℓ * , where its leaf sets are in V 2 and V b .We then use one vertex v from V 1 and connect it to both leaf sets.This creates a cycle in G 0 of length exactly t = ℓ * + 2h + 2. For converting a path in S to an even cycle in G 0 we use a similar argument, only this time we split each cluster into two clusters and use both endpoints of the path in S to "close" the cycle in G 0 .We give the full details below.
We start with the first item.Suppose that S contains a path of an odd length b, where 1 ≤ b < k, and let t ∈ [ C 1 log(1/ε) log n, (1 − δ)an] be even, a := b+1 k .Assume w.l.o.g. that this path is (1, . . ., b + 1), and consider the sequence of corresponding clusters V 1 , . . ., V b+1 .We separate the case where t is even into three parts.The first part deals with the case where t ∈ [ C 1 log(1/ε) log n, 2εm], the second part deals with the case where t ∈ [2εm, (1 − δ)an] and b = 1, and the third part deals with all other cases, i.e., t ∈ [2εm, (1 − δ)an] and b ≥ 3 (and is further separated into two subcases by the value of b).In each part we divide the vertices of the path into pairs, and embed a certain tree in the bipartite subgraph of the original graph induced by each pair.This is where we use the assumption of b being odd, i.e., the path has an even number of vertices.A similar cluster pairing strategy was presented and used by Dellamonica et al. [12,Theorem 7].
If t ∈ [ C 1 log(1/ε) log n, 2εm] is even, then we look at a single edge in the path, say, {1, 2}.The graph G 0 [V 1 , V 2 ] is bipartite and the pair (V 1 , V 2 ) satisfies the ε-property in G 0 .By Proposition 5.8 we know that G 0 [V 1 , V 2 ] contains a copy of every tree with at most 6εm vertices and maximum degree at most 1 16ε − 1.In particular, has at most 4εm vertices for these -copies are contained in V 1 and V 4 , but they can rather be contained in V 2 and V 3 , respectively, as well).
values of r and h, and thus T (r,h) ℓ has at most 6εm).Note that a maximal path in T (r,h) ℓ is of length 2h + ℓ.Set ℓ = t − 2h − 1 (note that it satisfies the constraints, as 1 ≤ t − 2h − 1 ≤ 2εm) and we get that a maximal path in a T (r,h) ℓ -copy is of length exactly t − 1.Now, note that this copy of T (r,h) ℓ has at least εm leaves in V 1 and εm leaves in V 2 , due to parity considerations.By the ε-property of the pair (V 1 , V 2 ) in G 0 there is an edge between these two sets of leaves, closing a cycle of length ℓ + 2h + 1 = t, as required.
If b = 1 and t ∈ [2εm, (1 − δ)an] is even, for a := b+1 k , then once again the graph ] is bipartite and the pair (V 1 , V 2 ) satisfies the ε-property in G 0 .We repeat the previous argument but with the only change of embedding a different tree in log 2 ⌉ and ℓ = t − 1 − 2h.Also here, note that this copy of T (2,h) ℓ has at least εm leaves in V 1 and εm leaves in V 2 , due to parity considerations.Again, by the ε-property of the pair (V 1 , V 2 ) in G 0 there is an edge between these two sets of leaves, closing a cycle of length t, as required.
If b ≥ 3 and t ∈ [2εm, (1 − δ)an] is even, for a := b+1 k , then we look at the full path (1, . . ., b + 1) and the set of corresponding clusters V 1 , . . ., V b+1 .Informally, we embed two copies of T Then, if we have used all the clusters already for tree embedding (i.e., b = 3), then we connect these two trees by two edges to create a cycle of the desired length.Otherwise, we keep embedding trees in all clusters we have not touched yet.Formally, we further separate this case into two subcases and argue as follows.
Assume first that b = 3.For following the arguments of this subcase Figure 1 can be helpful.Note that each of the pairs (V 1 , V 2 ) and (V 3 , V 4 ) satisfies the ε-property in G 0 , and that we have |V j | ∈ {⌊m⌋, ⌈m⌉} for any j ∈ [4].Now let j ∈ {1, 3}.By Proposition 5.9 we know that G 0 [V j , V j+1 ] contains a copy of T 2,h ℓ j where h = ⌈ log(εm) log 2 ⌉ and ℓ j is such that ℓ , and both are even.Note here that ℓ j ≤ 1 2 t − 2h ≤ 2(1 − 48ε)m.We embed two such T (2,h) ℓ j -copies, j ∈ {1, 3}, such that the leaf sets L 2 , L ′ 2 and L 3 , L ′ 3 are in V 2 and V 3 , respectively (which is possible as , by the ε-property of the pair (V 2 , V 3 ) in G 0 , there exist two edges, one between L 2 and L 3 , and the other between L ′ 2 and L ′ 3 .These two edges close a cycle of length exactly t.
Assume now that b ≥ 5.When following the arguments of this subcase Figure 2 can be helpful.In this subcase too we embed two T . However, we do not connect them directly by two edges, but through other T -copies are contained in V 1 and V b , but they can rather be contained in V 2 and V b−1 , respectively, as well).its leaf sets in V 2i−1 and in V 2i , respectively.Note that for every i ∈ {1, . . ., 1  2 (b − 1)}, a maximal path in T 2i−1,2i is of length 2h + ℓ i .Recall that for every i ∈ {1, . . ., 1  2 (b − 3)}, also the pair (V 2i , V 2i+1 ) satisfies the ε-property in G 0 , and note that we have |L 2i |, |L 2i+1 | ≥ εm.Thus we have e G 0 (L 2i , L 2i+1 ) > 0 for every i ∈ {1, . . ., 1  2 (b − 3)}, so we add an edge between every such pair of leaf sets, summing up to 1 2 (b − 3) new edges.Thus we get in G 0 a copy of the tree T (r,h) ℓ * , where with at least εm leaves in V 1 and at least εm leaves in V b−1 .Some maximal path inside this tree (connecting the mentioned two leaf sets) will be used to get a cycle of length t along with extra two edges.Now, we note that there exists a vertex v b ∈ V b which is adjacent both to a vertex in L 1 and a vertex in L b−1 .Indeed, otherwise one of L 1 , L b−1 would have fewer than (1 − ε)⌊m⌋ neighbors in V b , which contradicts the ε-property of the pairs (V 1 , V b ) and (V b−1 , V b ) in G 0 .Thus we can connect the vertex v b to a vertex in L 1 and to a vertex in L b−1 , adding two more edges and closing a cycle of length exactly t.
6 Further results

Applications
As mentioned in the introduction, Theorem 1.4 is also applicable to pseudo-random graphs.For proving Corollary 1.12, we use the Expander Mixing Lemma due to Alon and Chung [2] cited below.We now verify that for suitable values of d and λ, an (n, d, λ)-graph is also upper-uniform.Concretely, an (n, d, λ)-graph is (p, η)-upper-uniform with p = d n and η ≥ λ d , proving Corollary 1.12.

Robustness
For proving Theorem 1.13, we use Szemerédi's celebrated Regularity Lemma [41].Theorem 6.2 (Szemerédi's Regularity Lemma [41]).For every positive real ε and for every positive integer k 0 there are positive integers n 0 and K with the following property: for every graph G on n ≥ n 0 vertices there is an ε-regular partition Π = (V 1 , . . ., V k ) of V (G) such that ||V i | − |V j || ≤ 1 and k 0 ≤ k ≤ K.
The following lemma bounds from below the number of edges in the reduced graph R of the graph G from Theorem 1.13, similarly to Lemma 3.2.Proof.Let G ′ by the subgraph of G obtained be keeping only the edges between the clusters V i , V i in which {i, j} ∈ E(R).We count the edges of G − G ′ as follows.
• Edges in regular pairs with density less than ρ.There are at most ρ k 2 n 2 k 2 ≤ 1 20 βn 2 such edges.
• Edges inside clusters.There are at most k In total we kept all but at most 31 200 βn 2 < 1 3 β n 2 edges, so G ′ has at least (x + 2β/3) n 2 ≥ (x + β/2) k 2 • n k 2 edges.Since any edge of R corresponds to at most n 2 k 2 edges of G ′ , we get e(R) ≥ (x + β/2) k 2 as required.
The following claim and corollary connect the reduced graph of G and the ε-graph of G(p), with respect to the same partition Π. Claim 6.4.Let ε > 0 and let G be a graph on n vertices.Then there exists C := C(ε) such that the following holds.Let Π = (V 1 , V 2 , . . ., V k ) be an ε-regular partition of V (G) with ||V i | − |V j || ≤ 1, for some k := k(ε).Then for p ≥ C n , for every i, j where (V i , V j ) is an ε-regular pair with d(V i , V j ) ≥ ρ = 10ε, we have that w.h.p. (V i , V j ) satisfies the ε-property in the random graph G(p).
Proof.Denote ⌊m⌋ ≤ |V i | ≤ ⌈m⌉, where m = n k .Let U i ⊆ V i and U j ⊆ V j be such that |U i |, |U j | ≥ εm.By regularity we have |d(V i , V j ) − d(U i , U j )| ≤ ε.Combining it with the assumption d(V i , V j ) ≥ ρ, we have that e(U i , U j ) ≥ (ρ − ε)|U i ||U j | ≥ 9ε|U i ||U j |.
For two disjoint subsets U i , U j of V (G), denote by e p (U i , U j ) the random variable counting the number of edges between these sets in G(p).Then e p (U i , U j ) is distributed binomially with parameters e G (U i , U j ) and p.Hence, the probability that there exist two such sets that do not satisfy the ε-property in G(p) is at most n We can now prove Theorem 1.13.
Proof of Theorem 1.13.We can assume 0 < β < 1/4.Set ε = β 10000 and k 0 = 2 ε 2 .Take n 0 , K as given in the Regularity Lemma (Theorem 6.2), and also set γ = 2(1−48ε) We next look at the graph G(p) with the same partition and consider the ε-graph S := S(G(p), Π, ε).By Corollary 6.5 we have that w.h.p. e(S) ≥ (g γ (t, n) + β/4) k 2 .Using Corollary 4.4 we get that w.h.p.G(p) contains a cycle of length t.Remark 6.6.As mentioned in the introduction, Theorem 1.13 is tight in the sense that for many values of t taking a graph G with Θ(n 2 ) extra edges above the extremal number ex(n, C t ) is in fact necessary for having w.h.p. a copy of C t in G(p) where p = C n .As an example we show that it is tight for t ≥ n 2 .First, it is known (and an easy exercise) that for any constant C > 0, there exists some α := α(C) > 0 such that w.h.p. for any n 2 ≤ t 0 ≤ n the graph G(t 0 , p) has w.h.p. at least αn isolated vertices, where p = C n .Now, let n 2 ≤ t < n, let 0 < ε < α be some constant, and take G to be the graph on n vertices consisting of two cliques sharing exactly one vertex, one of size (1 + ε)t, denoted by K 1 , and the other of size n − (1 + ε)t + 1, denoted by K 2 .Now take G(p) and look at a subgraph of it that is induced by the vertices of K 1 .This subgraph is exactly G((1 + ε)t, p) and thus w.h.p.G(p)[K 1 ] contains at least αn isolated vertices.Therefore, w.h.p.G(p)[K 1 ] does not contain any cycle of length (1 + ε)t − αn < t or larger, and in particular G(p) does not contain any cycle of length t or larger.On the other hand, e(G) = (1+ε)t

2 .
ε, p) be the reduced graph as in Definition 3.1 for ρ = 10ε.Then e(R) ≥ (x + τ ) k Proof.Denote m = n k , and recall that ⌊m⌋ ≤ |V i | ≤ ⌈m⌉ for any i ∈ [k].Now we count the number of edges of G ′ .

Figure 1 :
Figure 1: Embedding trees to create an even cycle (in red), proof of Lemma 4.3, b = 3. (For the simplicity of the figure the roots of the T (r,h) ℓ

Figure 2 :
Figure 2: Embedding trees to create an even cycle (in red), proof of Lemma 4.3, b ≥ 5. (For the simplicity of the figure the roots of the T (r,h) ℓ

Theorem 6 . 1 (
Expander Mixing Lemma[2]).Let G be a d-regular graph on n vertices where λ ≤ d is the second largest eigenvalue of its adjacency matrix, in absolute value.Then for any two disjoint subsets of vertices A, B ⊆ V (G) we have e(A, B) − d n |A||B| ≤ λ |A||B|.
By Theorem 2.1 we get that S contains a path of length at least t n + β 50 k and hence, by Lemma 4.3, and since t < t n + β 50 (1 − δ)n, G 0 contains a cycle of length t. ≤ t ≤ (1 − C 2 β)n.In this case we have g γ (t, n) = Consequently, under the assumptions of Corollary 4.4, if t is odd then G contains all cycles of lengths between C 1 log(1/β) log n and t, and if t is even then G contains all even cycles of lengths between C 1 log(1/β) log n and t (regardless of the parity of t).