Regularity inheritance in pseudorandom graphs

Advancing the sparse regularity method, we prove one-sided and two-sided regularity inheritance lemmas for subgraphs of bijumbled graphs, improving on results of Conlon, Fox and Zhao [Adv. Math. 256 (2014), 206--290]. These inheritance lemmas also imply improved $H$-counting lemmas for subgraphs of bijumbled graphs, for some $H$.


Introduction
Over the past 40 years, the Regularity Method has developed into a powerful tool in discrete mathematics, with applications in combinatorial geometry, additive number theory and theoretical computer science (see [14,17,20,23] for surveys).
The Regularity Method relies on Szemerédi's celebrated Regularity Lemma [27] and a corresponding Counting Lemma.Roughly speaking, the Regularity Lemma states that each graph can (almost) be partitioned into a bounded number of regular pairs.More precisely, a pair (U, W ) of disjoint sets of vertices in a graph G is εregular if, for all U ′ ⊆ U and  U, W ) and e(U, W ) is the number of edges between U and W in G.The Regularity Lemma then says that every graph G has a vertex partition V 1 ∪ . . .∪V m into almost equal-sized sets such that all but at most εm 2 pairs (V i , V j ) are ε-regular and m is bounded by a function depending on ε but not on G.
The Counting Lemma complements the Regularity Lemma and states that in systems of regular pairs the number of copies of any fixed graph H is roughly as predicted by the densities of the regular pairs.In particular, if H is a graph with V (H) = [m] := {1, . . ., m} and G is an m-partite graph with partition V 1 ∪ . . .∪V m of V (G) such that (V i , V j ) is ε-regular whenever ij ∈ E(H), then the number of (labelled) copies of H in G with vertex i in V i for each i ∈ V (H) is as long as ε is sufficiently small.Such a Counting Lemma can easily be proved with the help of the fact that neighbourhoods in dense regular pairs are large and therefore 'inherit' regularity.More precisely, if (X, Y ), (Y, Z) and (X, Z) are ε-regular and have density d ≫ ε then for most vertices x ∈ X it is true that |N (x)∩Y | = (d±ε)|Y | and |N (x)∩Z| = (d±ε)|Z|.Hence one can easily deduct from ε-regularity that the pair N (x)∩Y, Z is ε ′ -regular (this is called one-sided inheritance) and the pair N (x) ∩ Y, N (x) ∩ Z is ε ′ -regular (this is called two-sided inheritance) for some ε ′ .Using this regularity inheritance, the Counting Lemma follows by induction on the number of vertices m of H.
For sparse graphs G, that is, G with n vertices and o(n 2 ) edges, the error term in the definition of ε-regularity is too coarse, and hence the Regularity Method is, as such, not useful for such graphs.There are, however, sparse analogues of the Regularity Lemma, which 'rescale' the error term and hence are meaningful for sparse graphs.
The Sparse Regularity Lemma (see [15,25]) states that any graph can be partitioned into (ε)-regular pairs and very few irregular pairs.However, a corresponding Counting Lemma for (ε)-regular pairs is not true in general: One can construct, say, balanced 4-partite graphs such that every pair of parts induces an (ε, d, p)-regular pair with ε ≪ d, but which do not contain a single copy of K 4 (see, e.g., [9, p.11]).
Nevertheless, Counting Lemmas are known for sparse graphs G with additional structural properties.In the case that G is a subgraph of a random graph establishing such a Counting Lemma was a famous open problem, the so-called K LR-Conjecture [16], which was settled only recently [6,8,24].Proving an analogous result for subgraphs G of pseudorandom graphs has been another central problem in the area.The study of pseudorandom graphs was initiated by Thomason [28,29] (see also [21] for more background information on pseudorandom graphs), who considered a notion of pseudorandomness very closely related to that of bijumbledness.Definition 2 (bijumbled).A pair (U, V ) of disjoint sets of vertices in a graph Γ is called (p, γ)-bijumbled in Γ if, for all pairs (U ′ , V ′ ) with U ′ ⊆ U and V ′ ⊆ V , we have A graph Γ is said to be (p, γ)-bijumbled if all pairs of disjoint sets of vertices in Γ are (p, γ)-bijumbled in Γ.A bipartite graph Γ with partition classes U and V is (p, γ)-bijumbled if the pair (U, V ) is (p, γ)-bijumbled in Γ.
After partial results were obtained in [18], Conlon, Fox and Zhao [9] recently proved a general Counting Lemma for subgraphs of bijumbled graphs.This Counting Lemma has various interesting applications for subgraphs of bijumbled graphs, including a Removal Lemma, Turán-type results and Ramsey-type results.
For obtaining Counting Lemmas for sparse graphs the most straightforward approach is to try to mimic the strategy for the proof of the dense Counting Lemma outlined above.The main obstacle here is that in sparse graphs it is no longer true that neighbourhoods of vertices in regular pairs are typically large and therefore trivially induce regular pairs -they are of size pn ≪ εn.One can overcome this difficulty by establishing that, under certain conditions, typically these sparse neighbourhoods nevertheless inherit sparse regularity.Inheritance Lemmas of this type were first considered by Gerke, Kohayakawa, Rödl, and Steger [13].Conlon, Fox and Zhao [9] proved Inheritance Lemmas for subgraphs of bijumbled graphs.The main results of the present paper are Inheritance Lemmas which require weaker bijumbledness conditions.The first result establishes one-sided regularity inheritance.
Lemma 3 (One-sided Inheritance Lemma).For each ε ′ , d > 0 there are ε, c > 0 such that for all 0 < p < 1 the following holds.Let G ⊆ Γ be graphs and X, Y, Z be disjoint vertex sets in V (Γ).Assume that Then, for all but at most at most ε ′ |X| vertices x of X, the pair Comparing this result with the analogue by Conlon, Fox, Zhao in [9, Proposition 5.1], we need Γ to be a factor (p log The second result establishes two-sided regularity inheritance under somewhat stronger bijumbledness conditions.Lemma 4 (Two-sided Inheritance Lemma).For each ε ′ , d > 0 there are ε, c > 0 such that for all 0 < p < 1 the following holds.Let G ⊆ Γ be graphs and X, Y, Z be disjoint vertex sets in V (Γ).Assume that Here Γ needs to be a factor p less jumbled when |X| = |Y | = |Z| than in [9,Proposition 1.13].We remark that the bijumbledness conditions in our results imply that these implicitly are statements about sufficiently large graphs (see Lemma 7).

Applications.
Counting Lemmas.The most obvious application of our results here is to prove stronger Counting Lemmas than those in [9].Recall that for a dense graph G and fixed H the Counting Lemma provides matching upper and lower bounds on the number of copies of H in G.By contrast, when G is a subgraph of a sparse bijumbled graph Γ, we formulate two separate Counting Lemmas.The one-sided Counting Lemma gives only a lower bound on the number of copies of H in G, while the twosided Counting Lemma gives in addition a matching upper bound. 1 The motivation for formulating two separate lemmas is that for many graphs H, the bijumbledness requirement on Γ to prove a one-sided Counting Lemma is significantly less than to prove a two-sided Counting Lemma, and for many applications the one-sided Counting Lemma suffices.
The statements and proofs of our Counting Lemmas are quite technical, and we prefer to leave them as an Appendix to this paper.Comparison with the results of [9] is unfortunately also not straightforward, in part because the two-sided Counting Lemma in [9] actually provides better performance than the one-sided Counting Lemma there in some important cases, such as for cliques.Briefly, our one-sided Counting Lemma always performs at least as well as either of [9, Theorems 1.12 and 1.14], and in some cases our results are better.For example, if H consists of 10 copies of K 3 sharing a single vertex, then our one-sided Counting Lemma requires (p, cp 3 )-jumbledness to lower bound the number of copies of H, whereas the results 1 Somewhat confusingly, the terms one-sided/two-sided refer to completely different aspects in the one-sided/two-sided Counting Lemmas and the one-sided/two-sided Inheritance Lemmas.Both are standard terminology.
in [9] require (p, cp 4 )-bijumbledness.Our two-sided Counting Lemma sometimes performs better than [9,Theorem 1.12].Again, for 10 copies of K 3 sharing a vertex, we require p, cp 10.5 -bijumbledness while [9] requires p, cp 12 -bijumbledness.In general, our results perform better when there are vertices of exceptionally high degree.For many interesting graphs (such as d-regular graphs for any d ≥ 3) the performance is identical.
Of course, these counting lemmas can also be immediately applied in the (relatively straightforward) applications presented in [9].For most of these applications what one requires is a one-sided Counting Lemma.In particular, by using the onesided Counting Lemma resulting from our Inheritance Lemmas the bijumbledness requirements for the removal lemma [9, Theorem 1.1], the Turán result [9, Theorem 1.4], and the Ramsey result [9, Theorem 1.6] can always be matched, and in some cases be improved.
Blow-up Lemmas and their applications.In addition, our Regularity Inheritance Lemmas also have other applications, in which they perform better than the results from [9] would.Blow-up Lemmas are another important tool in the Regularity Method, which make it possible to derive results about large or even spanning subgraphs in certain graph classes (see, e.g., [22]).In [3] a Blow-up Lemma which works relative to sparse jumbled graphs is proved.The proof of this lemma relies on the Regularity Inheritance Lemmas, Lemmas 3 and 4.
As an application of this Blow-up Lemma for jumbled graphs in [1] resilience problems for jumbled graphs with respect to certain spanning subgraphs are considered.Such resilience problems (see, e.g., [26]; resilience was investigated also earlier, for example as fault-tolerance in [5]) received much interest recently.In [1] Lemmas 3 and 4 together with the Blow-up Lemma for jumbled graphs are used to derive the following sparse version of the Bandwidth Theorem (proved for dense graphs in [7]).Theorem 5. [1] For each ε > 0, ∆ ≥ 2, and k ≥ 1, there exists a constant c > 0 such that the following holds for any p > 0. Given γ ≤ cp max(4,(3∆+1)/2) n, suppose Γ is a p, γ -bijumbled graph, G is a spanning subgraph of Γ with δ(G) ≥ k−1 k + ε pn, and H is a k-colourable graph on n vertices with ∆(H) ≤ ∆ and bandwidth at most cn.Suppose further that there are at least c −1 p −6 γ 2 n −1 vertices in V (H) that are not contained in any triangles of H. Then G contains a copy of H.
Note that the bijumbledness requirement implicitly places a lower bound on p.It is necessary to insist on some vertices of H not being in any triangles of H, but the number c −1 p −6 γ 2 n −1 comes from the requirements of Lemma 4, and improvement there would immediately improve this statement.This is a very general resilience result, covering for example Hamilton cycles, clique factors, and much more.Note that although a Hamilton cycle might not be 2-colourable, in [1] a more complicated variant of the above statement is proved which allows occasional vertices to receive a (k + 1) st colour.
Resilience theorems in jumbled graphs.The Andrásfai-Erdős-Sós Theorem states that any n-vertex triangle-free graph with minimum degree greater than 2 5 n is bipartite.Thomassen [30] further proved that the chromatic threshold of the triangle is 1  3 , or in other words that for every ε > 0, any n-vertex triangle-free graph with minimum degree 1  3 +ε n has chromatic number bounded independently of n.The analogous statements relative to random graphs are false, and there can be a few 'bad' edges destroying bipartiteness, or bounded chromatic number, respectively.In [4] accurate estimates are proved for the number of these bad edges that can exist.On the other hand, one can ask what minimum degree does force triangle-free subgraphs of random graphs, or more generally H-free subgraphs of random graphs, to have bounded chromatic number; this question is studied in [2].In both papers, a key tool is the Regularity Inheritance Lemma for random graphs (though in both cases more ideas are needed).It would be interesting to use the results of this paper to give jumbled graph versions of the results of [2,4].1.2.Optimality.
Our one-sided Inheritance Lemma is probably not optimal.The optimality of our two-sided Inheritance Lemma would follow from a conjecture of Conlon, Fox and Zhao [9], since an improvement on the bijumbledness requirement in this lemma would imply an improved version of the triangle removal lemma in bijumbled graphs.However, we think it unlikely that this lemma is optimal and believe there is room for improvement in our proof strategy.
In the case when H is a clique, Conlon, Fox and Zhao [9] are able to obtain a onesided counting lemma with a bijumbledness requirement matching ours by using a completely different strategy.In particular, when H is a triangle, these counting lemmas imply a triangle removal lemma for subgraphs of bijumbled graphs with β = o(p 3 n).Such a result was obtained earlier already in [19], where it was also conjectured that this can be improved to β = o(p 2 n).Conlon, Fox and Zhao [9] conjecture the contrary.We sympathise with the former conjecture, and believe that it would be extremely interesting to resolve this question.
Organisation.The remaining sections of this paper are devoted to the proofs of the Inheritance Lemmas.We start in Section 2 with an overview of these proofs.Section 3 collects necessary auxiliary results on bijumbled graphs and sparse regular pairs.In Sections 4 and 5 we prove various lemmas used in the proofs of the Inheritance Lemmas: Section 4 establishes lemmas on counting copies of C 4 in various bipartite graphs, and Section 5 concerns a classification of pairs of vertices in such graphs according to their codegrees.In Section 6 we prove Lemma 3 and in Section 7 Lemma 4.
Notation.For a graph G = (V, E) we also write V (G) for the vertex set and E(G) for the edge set of G.We write e(G) for the number of edges of G.For vertices v, v ′ ∈ V and a set U ⊆ V we write N G (v; U ) and If U = V we may omit U and, if G is clear from the context, we may also omit G.
For disjoint vertex sets U, W ⊆ V the graph G[U, W ] is the bipartite subgraph of G containing exactly all edges of G with one end in U and the other in W .We write e(U, W ) for the number of edges in G[U, W ].

Proof Overview
We sketch the proof of Lemma 3 first.We label the pairs in Y as 'typical', 'heavy', or 'bad', according to whether their G-common neighbourhood in Z is not significantly larger than one would expect, or so large as to be unexpected even in Γ, or intermediate.By using the bijumbledness of (Y, Z) in Γ we can show that the heavy pairs are so few that one can ignore them (Lemma 16).Now suppose that x ∈ X is such that N Γ (x; Y ), Z is either too dense or is not sufficiently regular.In either case, by several applications of the defect Cauchy-Schwarz inequality, we conclude that N Γ (x; Y ), Z contains noticeably more copies of C 4 in G than one would expect if (Y, Z) were a random bipartite graph of the same density (Lemma 13).In particular, the average pair of vertices in N Γ (x; Y ) has noticeably more G-common neighbours in Z than one would expect.It follows that a substantial fraction of the pairs y, y ′ in N Γ (x; Y ) are bad or heavy.Since there are few heavy pairs, we see that there are many bad pairs (Lemma 17).
On the other hand, because (Y, Z) is regular, we can count copies of C 4 in G crossing the pair (Lemma 13).A further application of the defect Cauchy-Schwarz inequality tells us that a very small fraction of the pairs in Y are bad, and using the bijumbledness of (X, Y ) we conclude that there are few triples (x, y, y ′ ) such that xy and xy ′ are edges of Γ and (y, y ′ ) is bad (Lemma 18).
Putting these two statements together, we conclude that there are few x ∈ X such that N Γ (x; Y ), Z is either too dense or is not sufficiently regular.By averaging, if there are few dense pairs there are also few pairs which are too sparse.This completes the proof of Lemma 3.
The proof of Lemma 4 is very similar.We have to additionally classify the pairs in Y as typical, heavy or bad with respect to x ∈ X, which we do according to their G-common neighbourhood in N Γ (x; Z).Now Lemma 17 as before tells us that if x ∈ X is such that N Γ (x; Y ), Z is either too dense or is not sufficiently regular, then a substantial fraction of the pairs (y, y ′ ) in N Γ (x; Y ) are bad with respect to x. Lemma 18 continues to tell us that there are few triples (x, y, y ′ ) such that xy and xy ′ are edges of Γ and (y, y ′ ) is bad, and Lemma 16 continues to tell us that we can ignore the heavy pairs.To complete the argument as before, it remains to show that if (y, y ′ ) is a typical pair, then there are few x such that xy, xy ′ ∈ Γ and (y, y ′ ) is bad with respect to x.To prove this we do not use the requirement xy, xy ′ ∈ Γ, but simply bound, using bijumbledness of (X, Z), the number of x with abnormally many neighbours in N G (y, y ′ ; Z).This step is where we require most bijumbledness.We believe it is wasteful, but were not able to find a more efficient way.
It follows that we can take a set U ′ ⊆ U of min 1  4 p −1 , 1 2 |U | vertices, each with degree at most 2p|V |.The union of their neighbourhoods covers by definition at most we can let V ′ be a subset of 1  2 |V | vertices in V with no edges between U ′ and V ′ .Applying bijumbledness to the pair (U ′ , V ′ ), we have is false for all U = ∅ by our choice of c ′ , p and k, so we conclude that Remark 8. Erdős and Spencer [10] (see also Theorem 5 in [11]) observed that there exists c > 0 such that every m-vertex graph with density p contains two disjoint sets X and Y for which e(X, Y One can also recover Lemma 7 using this result.(See also Remark 6 in [18].) 3.2.Sparse regularity.The Slicing Lemma, Lemma 9, states that large subpairs of regular pairs remain regular.
Lemma 9 (Slicing Lemma).For any 0 < ε < γ and any p > 0, any (ε, p)-regular pair (U, W ) in G, and any In the other direction, the following lemma shows that, under certain conditions, adding a few vertices to either side of a regular pair cannot destroy regularity completely.
Lemma 10.Let 0 < ε < 1  10 and c ≤ 1 10 ε 3 .Let G be a spanning subgraph of a graph Γ, let (U ′ , V ′ ) be a pair of disjoint sets in V (Γ), and let 3.3.Cauchy-Schwarz.We use the following 'defect' form of the Cauchy-Schwarz inequality.This inequality and a proof can be found in [12,Fact B].
Lemma 11 (Defect form of Cauchy-Schwarz).Let a 1 , . . ., a k be real numbers with average at least a.If for some δ ≥ 0 at least µk of them average at least and the same bound is obtained if at least µk of the a i average at most (1 − δ)a.

Counting copies of C 4 in regular, irregular and dense pairs
The following counting lemma for counting C 4 in (ε, d, p)-regular subgraphs of bijumbled graphs is as given by Conlon, Fox, and Zhao [9, Proposition 4.13].We write C 4 (G) for the number of unlabelled copies of C 4 in G.
The next lemma gives a lower bound on the number of copies of C 4 in a bipartite graph of a given density.Moreover, if this bipartite graph is not (ε)-regular we obtain an even stronger lower bound.Observe that for this lemma we do not require that the pair is a subgraph of a pseudorandom graph.
Lemma 13 (counting C 4 in dense pairs and irregular pairs).Let 0 < ε l13 ≤ 10 −3 , let G be a bipartite graph with vertex classes U and V of sizes m ≥ n ≥ 2ε −9 l13 respectively.Suppose that G has density q ≥ ε −10 Hence, for bounding this quantity we will analyse common neighbourhoods of vertices in U .Let us first bound the average a l13 )q 2 n then, using Jensen's inequality and facts that q ≥ 2ε −4 l13 n −1/2 and m ≥ n ≥ 2ε −9 l13 , we get 4 n 2 m 2 , and thus are done.Hence we may assume in the following that (2) a ≤ (1 + ε 8 l13 )q 2 n .For obtaining a corresponding lower bound on a note that the average degree of the vertices in V is qm.Hence by Jensen's inequality we have where the second inequality uses q ≥ q 2 ≥ ε −20 l13 m −1 .Therefore This gives Moreover, we obtain from ( 1) and ( 2) that ( 4) For estimating the sum of squares in this inequality we will use the defect form of Cauchy-Schwarz (Lemma 11).
Let us first establish the first part of Lemma 13.Lemma 11 with k = m 2 , µ = δ = 0 (so actually without defect) implies that Hence, by (4) we have as desired, where we used q ≥ ε −10 l13 n −1/2 in the second inequality.For the second part of the lemma, we will use a similar calculation, but we will apply Lemma 11 with µ, δ > 0. So we need to find a subset Ũ ⊆ U of vertices whose average pair degrees differ significantly from a.
The following definition will be useful.For a set Ũ ⊆ U , let where the second inequality follows from (2).
Before we prove this claim, let us show how it implies the second part of our lemma.For this, assume that G is not (ε l13 )-regular, and let Ũ be the set guaranteed by Claim  to infer that Together with (4) this gives the desired where again we used q ≥ ε −10 l13 n −1/2 in the second inequality.It remains to prove the claim.
Proof of Claim 14.Since G is not (ε l13 )-regular there are sets Now we distinguish three cases.First suppose that d(U ′ , V ) ≥ 1 + ε 3 l13 10 q =: q.Then using again Jensen's inequality we have where the second inequality uses q ≥ q ≥ ε −8 l13 /m and the last inequality uses ε l13 ≤ 10 −3 .Hence we can choose U ′ as Ũ .
Secondly, suppose that Using an analogous calculation as in the previous case we obtain a(U ′′ ) ≥ (1 + 2ε 5 l13 )q 2 n and thus can choose U ′′ as Ũ .
Finally, suppose 1 − In this case we will use Ũ := U ′ and apply Lemma 11 to bound (7) a For this observe that On the other hand b(V ′ ) := 1 mn and thus, by (6), we obtain Therefore Lemma 11 applied with k := n, δ := ε l13 /2, µ := ε l13 , and with b instead of a implies that Together with ( 7) and ( 8) this gives as desired, where we used q ≥ 400ε −4 l13 /m.

Typical pairs, bad pairs, heavy pairs
The proofs of our inheritance lemmas rely on estimating the number of copies of C 4 which use certain types of vertex pairs in one part of a regular pair which is a subgraph of a bijumbled graph.We will consider vertex pairs that are atypical for the regular pair, which we call bad, and vertex pairs which are even atypical for the underlying bijumbled graph, which we call heavy.
Definition 15 (bad, heavy pairs).Let G be a graph and U and V be disjoint vertex sets in G. Let q ∈ [0, 1] and δ > 0. We say that a pair uu Pairs which are neither heavy nor bad (with certain parameters) will usually be called typical.
In a bijumbled graph we can establish good bounds on the number of copies of C 4 which use heavy pairs.Lemma 16 (C 4 -copies using heavy pairs).Let Γ be a bipartite graph with partition classes U and V that is p, c ′ p 3/2 (log Then the number of copies of C 4 in Γ which use a pair in U which is Proof.We first fix u ∈ U and count the number of copies of C 4 in Γ which use a pair that contains u and is (V, p)-heavy.Let W u ⊆ U \ {u} be the set of vertices u ′ ∈ U \ {u} such that uu ′ is a (V, p)-heavy pair.We now split W u according to the number of common neighbours the vertices of W u have with u.Since 4p For a fixed u ′ , the number of copies of C 4 using u and Hence, the total number of copies of C 4 using u and any vertex of S t is at most Summing over the at most log 2 1 p values of t, we conclude that the total number of copies of C 4 in Γ using u and some Finally, summing over all u ∈ U , the total number of copies of C 4 in Γ using (V, p)-heavy pairs in U is at most 64(c Using this lemma we obtain a good lower bound on the number of bad pairs in subgraphs of bijumbled graphs which are irregular or exceed a certain density.Proof.Let P h be the set of (V, p)-heavy pairs in Γ and P b be the set of (V, dp, δ)-bad pairs in G which are not in P h .Let P t := U 2 \ (P b ∪P h ).Denote by C h 4 the number of those copies of C 4 in G that use a pair in P h , and define C b 4 and C t 4 similarly.We claim that, if (i ) or (ii ) are satisfied, then
The next lemma provides an upper bound for the number of bad pairs in neighbourhoods.
Lemma 18 (few bad pairs).Let d, δ > 0, let c ′ ≤ ε ≤ 10 −10 δ 6 d 8 , and p ∈ (0, 1).Let G ⊆ Γ and let U, V, W ⊆ V (Γ) be disjoint sets such that Then for the sets P b (u) of pairs vv ′ ∈ NΓ(u;V ) 2 which are (W, dp, δ)-bad in G we have Proof.Let P b be the set of all pairs vv ′ ∈ V 2 which are (W, dp, δ)-bad in G. Our first step is to obtain an upper bound on which we will use to estimate binomial coefficients.
Let µ be such that Our goal is to get an upper bound on µ.For this purpose we shall use the defect form of Cauchy-Schwarz, Lemma 11, to get a lower bound on the number of C 4 -copies in (V, W ) in terms of µ, and combine this with the upper bound on the number of C 4 -copies in regular pairs provided by Lemma 12.
For the application of Lemma 11 set a vv ′ := deg G (v, v ′ ; W ) for each vv ′ ∈ V 2 , and define to be the average of the a vv ′ .Let us now first establish some bounds on a ′ .Since (V, W ) is (ε, d, p)-regular in G, all but at most ε|W | vertices of W have at least On the other hand, by Lemma 6 the number of vertices w ∈ W with deg  (11).Lemma 11 thus guarantees that

Now we apply
Hence the number of and (p, c Putting these two inequalities together we obtain and because c ′ ≤ ε ≤ 10 −10 δ 6 d 8 by assumption, we get µ ≤ 1 2 δ as desired. where we use assumption (iii ) for the second inequality.We therefore obtain as desired, where in the third inequality we use Claim 19.

One-sided inheritance
To prove Lemma 3 we combine Lemma 17 and Lemma 18.The former asserts that any vertex x such that N Γ (x; Y ), Z is not (ε ′ , d, p)-regular in G creates many pairs in N Γ (x, Y ) which are bad in (Y, Z) ⊆ G, whereas the latter upper bounds the sum over x ∈ X of the number of such bad pairs.Proof of Lemma 3. We may assume without loss of generality that 0 < ε ′ < 10 Observe that by Lemma 6 and by (ε, d, p)-regularity of (X, Y ) in G we have We then let X ′ ⊆ X be the set of vertices x of X with (16) deg Similarly as before, we apply Lemma 6 once to (X, Y ′ ) with γ = ε and once to the pair (X, Y \ Y ′ ) in (X, Y ) with γ = 1 3 and use ( 13) and ( 16) to obtain ( 17) By Lemma 9 and because of ( 14) and ( 17) it follows that 16), (19) (Y, Z) is p, 2cp 3/2 (log Finally, let X * be the set of vertices in We claim that N Γ (x; Y ), Z is (ε ′ , d, p)-regular in G for all x ∈ X ′ \ X * .In order to show this we apply Lemma 10 with ε l10 = 1 2 ε ′ and c l10 = 2c, and with U = N Γ (x; Y ′ ), U ′ = N Γ (x, Y ) and V = V ′ = Z.This is possible by (19), the definition of X * , and because where for the second to last inequality we use ( 15) and ( 16).We conclude that indeed N Γ (x; Y ), Z is (ε ′ , d, p)-regular in G. Therefore, by ( 17) it suffices to show that |X * | ≤ 1 2 ε ′ |X| to complete the proof.For this purpose, we define for each x ∈ X ′ For the lower bound, fix x ∈ X * .By ( 14) the density of N Γ (x; Y ′ ), Z in G is at least (d − ε)p.Hence, by ( 13), ( 14), (19) and the definition of X * we may apply Lemma 17 with parameters d, ε * = ε ′ 2 , δ, ε l17 = 2ε, c ′ = 2c and p to the pair and therefore ( 21) For the upper bound we use Lemma 18 with input δ, ε l18 = 3ε, and c ′ = 2c, and setting U = X ′ , V = Y ′ and W = Z, which we may do by ( 13), ( 15), (17) and (18).The conclusion is that Together with (21) this gives ε ′ By Lemma 6 and (22) we have Again, by Lemma 6 and (22) we have (26) |X \ By Lemma 9, by (23) and by (26), we obtain 25), (28) (Y, Z) is p, ).This again follows from Lemma 10, which we apply with ε l10 = 1 2 ε ′ and c l10 = 2c, and with -regular in G by the definition of X * and X * * , and because to complete the proof.We start with the former.For each x ∈ X ′ , let To bound |X * |, we will again estimate x∈X ′ |P * b (x)| in two different ways.The first part is given by the following claim.

Claim 20.
x∈X Proof.This bound will follow from Lemma 17.We first need to 'clean up' the pairs (Y x , Z x ) for the application of this lemma.Let (25).So Lemma 6 and (22) imply To bound P * b (x) we want to apply Lemma 17 to (Y ′ x , Z x ), using condition (i ) of Lemma 17.For this purpose we will first show that (Y ′ x , Z x ) is also not ε ′ 4 , d, p -regular in G. Indeed, by ( 22) and ( 29) we can apply the contrapositive of Lemma 10 with ε l10 = ε ′ 4 and c l10 = 4c, and with 4 , d, p -regular in G as claimed.Hence, by ( 22), (29), the definition of X * 1 and the definition of Y ′ x we may apply Lemma 17 to (Y ′ x , Z x ) with input d, ε * l17 = ε ′ 4 , δ, ε l17 = ε * , c ′ = 4c and p.We conclude that It remains to consider x ∈ X * 2 .In this case we want to use Lemma 17(ii ).To obtain the required density condition, observe that (22).Hence, by (22) and ( 29) we can apply Lemma 17 to (Y ′ x , Z x ) with input d, ε * l17 = 1 3 (ε * ) 2 , δ ε l17 = ε and c ′ = 4c and conclude that Summing over all x ∈ X * = X * 1 ∪ X * 2 , and using ( 22) the claim follows.The next claim establishes a complementing upper bound for | we will distinguish between the contribution made to this sum by the pairs and that made by the pairs which holds since P * b (x) ∩ P b ⊆ P b (x) for all x ∈ X ′ .By Lemma 18 applied to X ′ , Y ′ , Z with parameters d, δ l18 = 1 2 δ, c ′ = 2c ε l18 = 3ε, which we can do by ( 22), (27) and since (Y ′ , Z) is (2ε, d, p)-regular in G, we thus have (30) For the contribution of P t on the other hand, define By assumption, (X, Z) is (p, cp 3 |X||Z|)-bijumbled, and so (X, ≥ ≥ (1 + ε)p|Z yy ′ | and by the choice of Z yy ′ , the left-hand side of (31) is at least |V b (yy ′ )|.Summing over all yy ′ ∈ P t we conclude Together with (30) this proves the claim.
for each x ∈ X ′′ .Since X * ∩ X ′′ = ∅ we get by the definition of X * and X * * For obtaining a lower bound on T , let (22).Now, each y ∈ Y ′′ contributes at least T (y) := e Γ N Γ (y, X ′′ ), N G (y, Z) triples to T .As (X, Z) is (p, cp 3 |X||Z|)-bijumbled the definition of Y ′′ thus implies that Again, this quantity depends on the choice of V 1 , . . ., V m , and again this will always be clear from the context.Still for any given graph H with vertex set [m], which we think of as having order 1, . . ., m, and given u, v ∈ [m], we define Finally, we let k reg (H) be the smallest number with the following properties for each 1 ≤ i ≤ m.For each j ≥ i such that ij ∈ E(H) Informally, the idea is that (p, cp kreg(H) )-bijumbledness is enough to use Lemmas 3 and 4 to find copies of H in G one vertex at a time, in the natural order 1, . . ., m.
The following lemma formalises this.
Lemma 23 (One-sided Counting Lemma).For every graph H with V (H) = [m] and every γ > 0, there exist ε, c > 0 such that the following holds.Let G and Γ be graphs with G ⊆ Γ, and let V 1 , . . ., V m be subsets of V (G).Suppose that for each edge ij ∈ H, the sets V i and V j are disjoint, and the pair The proof of this lemma is similar to the proof of [9,Lemma X].It is also contained in the proof of Lemma 24 below, so we omit the details.
The jumbledness requirement in our two-sided Counting Lemma depends on another graph parameter, which is also different from the parameter in the twosided Counting Lemma in [9] and may appear somewhat exotic at first sight.We shall later compare this parameter to other more common graph parameters.
Let H be given with vertex set [m], which again we think of as having the order 1, . . ., m.For each v ∈ V (H), let τ v be any ordering of N + (v) such that |N <v (w)| is decreasing.We define The idea is that this parameter controls the bijumbledness we require in order to prove an upper bound on the number copies of H in Γ.In order to count in G, we need both to be able to do this and to use our inheritance lemmas, and we need to consider the same order on V (H) for both.
Lemma 24 (Two-sided Counting Lemma).For every graph H with V (H) = [m] and every γ > 0, there exist ε, c > 0 such that the following holds.We set Let G and Γ be graphs with G ⊆ Γ, and let V 1 , . . ., V m be subsets of V (G).Suppose that for each edge ij ∈ H, the sets V i and V j are disjoint, and the pair As with Lemma 23, in applications one should choose the order on V (H) so that the resulting β is as large as possible.
For comparison to more standard graph parameters, observe in an optimal order we have , where degen(H) = min{d : ∀H ′ ⊆ H, δ(H ′ ) ≤ d} is the degeneracy of H.To see that the former inequality is true, observe that for any v ∈ V (H) we have and thus, d(H) ≥ ∆(H).For the latter, consider a degeneracy order on H, that is, an order in which each vertex has at most degen(H) neighbours preceding it.For such an order, for any v and any w ∈ N + (v), we have |N <v (w)| ≤ degen(H) − 1, since N <v (w) contains neighbours of w preceding w, but not including v. We thus have, for each v ∈ V (H), In the similar two-sided counting result of [9], the exponent of p in bijumbledness is min ∆(L(H))+4

2
, where L(H) is the line graph of H, namely the graph with vertex set E(H) in which two vertices are adjacent if they are incident as edges of H.It is easy to check that this parameter is bounded between ∆(H)+3 2 and ∆(H)+degen(H)+4 2 (and both bounds can be sharp).
We now briefly outline the proof of Lemma 24.We prove this statement by induction.We count the number of copies of H in G, which is a subgraph of the bijumbled Γ, by embedding H one vertex at a time, and bounding the number of choices at each step.Most of the time, we will choose to embed to vertices which maintain regularity, and thus we can accurately estimate the number of choices.This part of the proof is very similar to the usual proof of the Counting Lemma for dense graphs, except that we use Lemmas 3 and 4 to argue that regularity is usually maintained rather than this being a triviality.To deal with the exceptional event that we embed to a vertex and regularity is lost, we require an upper bound on H-copies in Γ.This is the content of the following Lemma 25.
Given H with V (H) = [m] in an order realising d(H), and x ∈ V (H), let Lemma 25.Given H with vertex set [m] and 0 < p < 1 10 , suppose Let V 1 , . . ., V m be subsets of V (Γ), and suppose We now show how this implies Lemma 24 Proof of Lemma 24.Suppose that Γ, G and H are as in the lemma statement.We will prove by induction the following statement ( †).
For every γ ′ > 0 there exist ε ′ , c ′ > 0 with the following property.Given Before we prove this, we show that it implies the statement of Lemma 24.To that end, we assume ( †) holds with input γ ′ = γ 4 and x = 1, returning constants c ′ and ε ′ .We set c = c ′ and ε = 1 2 ε ′ , and use 4 , then by ( †) the lemma statement follows.We may therefore assume that there is some ij ∈ E(H) such that d p V i , V j < γ 4 , and thus d(H; G) < γ 2 .To establish the lemma statement it thus suffices to show n(H; G) ≤ γp e(H) We generate a graph G ′ with G ⊆ G ′ ⊆ Γ by adding edges of Γ to each (ε, p)-regular pair (V i , V j ) with d p (V i , V j ; G) < γ 4 .We do this by choosing edges of Γ in such pairs uniformly at random with probability 3γ 8 − d p (V i , V j ).We claim that the result is that any such pair (V i , V j ) is (2ε, p)-regular in G ′ with density between γ 4 p and γ 2 p.The proof of this claim is a standard application of the Chernoff bound, and we omit it.Since there is a pair in G ′ with density less than γ 2 p, we have d(H; G ′ ) ≤ 3γ 4 .By construction we have n(H; G) ≤ n(H; G ′ ), and by ( †) the lemma statement follows.
If v ∈ W x fails to satisfy any of the following conditions, we say v is bad.(a ) For each i we have deg G (v, W yi ) = (d p (V x , V yi ) ± ε ′ )p|W yi |. (b ) For each i we have deg Γ (v, W yi ) = (1 ± ε ′ )p|W yi |. (c ) For each i and z > x such that y i z ∈ E(H ≥x ), the pair N G (v, W yi ), W z ) is ε ′′ , d p (V yi , V z ), p -regular in G. (d ) For each i = j such that y i y j ∈ E(H ≥x ) the pair N G (v, W yi ), N G (v, W yj ) is ε ′′ , d p (V yi , V yj ), p -regular in G. Let B ⊆ W x be the set of bad vertices.We now show that B is much smaller than W x .Since for each 1 ≤ i ≤ q the pair W x , W yi is ε ′ , d p (V 1 , V yi ), p -regular, there are at most 2qε ′ |W x | vertices in W x for which (a ) fails.
For the remaining estimates, it is convenient to estimate the bijumbledness of pairs (W i , W j ) for i, j ≥ x.Specifically, since (V i , V We move on to the regularity statements.By (35) and definition of k reg , the bijumbledness requirements of Lemma 3 are satisfied, so since d p (V yi , V z ) ≥ γ ′ and V yi , V z is (ε ′ , p)-regular, the number of vertices v ∈ W x such that N Γ (v, V yi ), V z is not 1  2 γ ′ ε ′′ , d p (V yi , V z ), p -regular is at most qmε ′′ |W x |.Similarly, the bijumbledness requirements of Lemma 4 are satisfied.Again, the number of vertices v ∈ W x such that N Γ (v, V yi ), N Γ (v, V yj ) is not 1  2 γ ′ ε ′′ , d p (V yi , V yj ), p -regular is at most qmε ′′ |W x |.Now suppose that v satisfies (a ) and (b ).By choice of ε ′ and by Lemma 9, if Now given any v ∈ W x \ B, we wish to estimate the number of copies of H ≥x in G such that x is mapped to v and i is in W i for each x + 1 ≤ i ≤ m.In other words, we need to know the number of copies of H ≥x+1 such that i is in W ′ i for each x + 1 ≤ i ≤ m, where W ′ i = W i if xi ∈ E(H) and W ′ i = N G (v) ∩ W i if xi ∈ E(H).Because v satisfies (c ) and (d ), for each ij ∈ E(H ≥x+1 ) the pair (W ′ i , W ′ j ) is (ε ′′ , p)-regular in G.We now use the induction hypothesis.By choice of c ′ , we can apply ( †) with input x + 1 and γ ′ 2 to obtain n(H ≥x+1 ; G) = d(H ≥x+1 ; G) ± γ ′ 2 p e(H ≥x+1 ) x+1≤i≤m where the second line uses the fact that (W ′ i , W ′ j ) is ε ′′ , d p (V i , V j ), p -regular for each ij ∈ E(H ≥x+1 ) by (c ) and (d ), and the fact |W ′ i | = d p (V x , V i ) ± ε ′ p|W i | for each i such that xi ∈ E(H ≥x ).We conclude that the number of copies of H ≥x in G with x mapped to W x \ B and i mapped to W i for each x + 1 ≤ i ≤ m is By Lemma 26, with b i = |N <x (y i )| for each 1 ≤ i ≤ q, letting C = max q i=1 (b i + i), the sum of these terms over all B α with α = 0 is at most W ′ ⊆ W with |U ′ | ≥ ε|U | and |W ′ | ≥ ε|W |, we have |d(U ′ , W ′ ) − d(U, W )| ≤ ε,where d(U, W ) := e(U, W )/(|U ||W |) is the density of the pair ( yields the same bound on |U − |, and the result follows. Lemma 12 (counting C 4 in regular pairs).For any ε > 0, c > 0 and d ∈ [0, 1] the following holds.If (U, V ) is a (p, cp 2 |U ||V |)-bijumbled pair in a graph Γ, and G is a bipartite subgraph of Γ with parts U and V which forms an (ε, d, p)-regular pair, then C 4 14. Since | Ũ | ≥ ε l13 m, there are at least ε l13 m 2 ≥ ε 2 l13 m 2 /2 pairs of vertices in Ũ .Thus we can use Lemma 11 with k := m 2 , µ = ε 2 l13 /2 and δ = ε 5 l13
and determine a lower bound on P b (x) in terms of |X * | with the help of Lemma 17 and an upper bound in terms of |X ′ | with the help of Lemma 18.
regular in G and (p, cp kreg(H) |V i ||V j |)-bijumbled in Γ.Then we have and for each y∈ V H ≥x , let W y ⊆ V y satisfy |W y | ≥ εp |N <x (y)| |V y |.Then the number of copies of H ≥x in Γ with y in the set W y for each y is at most H ≥x ; G) ± 3γ ′ 4 p e(H ≥x ) x≤i≤m |W i | ,where the second line follows by choice of ε ′ .This gives the desired lower bound; it only remains to complete the upper bound by showing that the number of copies ofH Since V x , V yi is p, β |V x ||V yi | -bijumbled, this implies 1 2 • 2 αi p|B α ||W yi | ≤ β |V x ||V yi | |B α ||W yi | .Rearranging this we obtain|B α | ≤ 4β 2 |V x ||V yi | 2 2αi p 2 |W yi | .Since this holds for each i with α i > 0, using (38) with deg Γ (v; W yi ) ≤ 2 αi+1 p|W yi | for each i, the number of φ-partite copies of H ≥x in Γ with x in B α and y ∈ W y for each y > x is at most min i:αi>04β 2 |V x ||V yi | 2 2αi p 2 |W yi | (4p) e(H ≥x )−q |V x ||V yi | 2 2αi p 2 |W yi |Since |W yi | ≥ εp |N <x (yi)||Vy i | this is at most ≥x in G with x in B and i in W i for each x + 1 ≤ i ≤ m is at most γ ′ 4 p e(H ≥x ) x≤i≤m |W i | .q 2 αi+1 4 −q (4p) e(H ≥x ) y>x |W y | .