We use the following precise form of the Szemerédi regularity lemma. For every and positive integer , there are integers such that every graph on vertices has a partition
with at most irregular unordered pairs among the nonexceptional classes. Here for disjoint nonempty sets, and is an -regular pair if
whenever , , , .
For the proof, let be the adjacency indicator, including , and define by averaging on even for diagonal cells. The regularity energy of a partition is
Every exceptional vertex is represented by its own singleton cell in this energy. If a rectangle is refined into smaller rectangles with densities and weights , expanding the square gives the refinement variance identity for regularity energy
Thus refinement never decreases energy.
Suppose an equitable partition with classes of size fails the desired conclusion. For every irregular pair choose witness subsets , , each of size at least , whose density differs from by more than . Split each class by all witness subsets involving it. Each class has at most atoms. On a witness rectangle, the weighted mean of is . The Cauchy-Schwarz inequality therefore bounds the energy increment on this rectangle below by
The different original cell pairs have disjoint rectangles. More than irregular unordered pairs, with both orientations counted in the energy, thus increase it by more than . As long as , this is greater than , and in particular greater than .
Restore equitability by dividing each atom into pieces of common size , moving each leftover vertex into the exceptional set as a singleton energy cell. This remains a refinement, so the energy gain persists. There are at most atoms, so the additional exceptional vertices number at most
If , then , and the new number of equal cells satisfies . For the lower bound, within each old class the leftover count is at most , so at least one full new cell survives. For the upper bound, , using . This proves equalization with a controlled exceptional set without any energy loss.
Put . Choose with . Start with equal classes and fewer than exceptional vertices. Iterate the bounded recurrence times to obtain a bound . Choose so large that the initial remainder is at most and, for every , . The total exceptional set remains at most , since at most rounds each add at most . Each failing round raises an energy in by more than , so fewer than rounds can fail. This proves the lemma with all constants independent of the input graph.
For the application, write and . We may replace the given tolerance by a smaller one, so assume . Set , take , and choose
Apply the lemma and delete all edges incident with , all edges inside a class, all edges across irregular pairs, and all edges across regular pairs of density below . The resulting spanning subgraph loses at most
Let be the reduced graph of a regularity partition, whose edges represent the surviving regular pairs of density at least . We show that a copy of in forces a copy of in .
Choose a proper -coloring of and assign its color classes to the corresponding clusters. Embed its vertices one at a time. For each unembedded vertex maintain the candidate set in its cluster consisting of unused vertices adjacent to all already embedded neighbours. After at most restrictions its size is at least . This last quantity is at least when is large, so every such candidate set is large enough for regularity. In an -regular pair of density , fewer than vertices on one side have fewer than neighbours in any fixed set on the other side of size at least : otherwise these vertices and violate regularity. For the vertex currently being embedded, there are at most relevant future candidate sets. At most vertices are bad for one of them. Its own candidate set has at least vertices, so an unused good vertex can be chosen. All future candidate sets shrink by at most the factor , apart from the removal of a used vertex; the stated size bound follows inductively, since the accumulated removals are at most . This completes the graph embedding lemma for regular pairs in the form needed here.
Since is -free, is -free. Any in would use distinct clusters, because intraclass edges were deleted, and project to a in . Therefore
The required threshold on depends only on and , since makes every nonexceptional cluster sufficiently large.
For disjoint vertex sets , define their edge density of a bipartite graph by . They form a regular pair with parameter if every with , satisfies .
The Szemerédi regularity lemma says that for every and minimum cell count , some have the following property. Every graph on vertices admits
with , equal-sized , and at most unordered irregular pairs. It is enough to consider .
Prove this using equitable regularity energy. Treat exceptional vertices as singleton cells and set
with ordered pairs and the adjacency indicator also defining diagonal densities. Then . The refinement variance identity for regularity energy proves refinement cannot decrease :
An irregular pair supplies witness subsets of relative sizes at least whose density differs by more than . Refining along those witnesses raises by more than per orientation, where is the common cell size. If there are more than irregular pairs, the increase is greater than , provided the exceptional set has size at most .
Refine each cell by all its witness subsets; this produces at most atoms per cell. Restore equal sizes by the equalization with a controlled exceptional set: cut each atom into blocks of size and declare its remainder exceptional, still retaining every such vertex as a singleton in the energy. This is another refinement, so no energy is lost. At most vertices become exceptional, and, when , at most new nonexceptional cells occur.
Put and start with so large that . An initial equitable partition has at most exceptional vertices when is sufficiently large. Subsequent cell counts only increase, so the total added exceptional set has size at most . The recurrence , iterated at most times, supplies a finite bound ; choose large enough that every intermediate meets the size requirement. More than unsuccessful refinements would raise above one. The process must therefore stop with the required regular pairs. This proves the lemma.
Its usefulness comes from replacing an arbitrarily large graph by the bounded reduced graph of a regularity partition. For fixed positive cross-density, the graph embedding lemma for regular pairs lifts fixed configurations from the reduced graph to the original one. In particular, three sufficiently regular positive-density pairs contain many triangles in a graph. Deleting exceptional, intracell, irregular and sparse-pair edges then gives the triangle removal lemma: a graph with sufficiently few triangles can be made triangle-free by deleting edges. A triangle surviving in the reduced graph would force a positive proportion of the original possible triangles, a contradiction. More generally this approach yields the clique removal lemma and the asymptotic Erdős-Stone theorem. Applied to the tripartite graph encoding , triangle removal also gives Roth theorem on three-term arithmetic progressions. The price is that the energy argument gives a very rapidly growing, iterated-exponential bound on ; the lemma is a structural tool, not a promise of small practical constants.
We prove edit-distance stability for clique-free graphs by induction on , using the symmetric difference of edge sets as the distance. For , a -free graph is edgeless, and there is nothing to change. For , choose a vertex of maximum degree , let be its neighbourhood and put . Then is -free. Write
Both deficits are nonnegative by the Turan theorem. Since every vertex of has degree at most ,
The complete -partite graph formed from an -partite Turán graph on and the new class has at most edges. Thus , and direct subtraction gives
By induction, edit into a complete -partite graph using at most changes. Delete the edges inside , and add the missing edges between and . The resulting graph is complete -partite on the same vertex set, and
where the inequality uses . The required edit distance is at most . Empty partition classes are allowed; a sufficiently dense nondegenerate case has the usual full complement of classes.
For the odd-cycle conclusion, use two standard consequences of the Szemerédi regularity lemma, stated explicitly. The triangle removal lemma says that for every , some ensures that a graph with at most triangles in a graph can be made triangle-free by deleting at most edges, for all sufficiently large . Also, for each fixed odd length and each , there is such that a graph with at least triangles in a graph contains at least copies of .
For clarity, the latter odd-cycle copies from positive triangle density consequence follows by applying regularity with error small relative to , removing exceptional, irregular and very sparse pairs, and retaining a triangle in a graph among the remaining regular dense pairs. The graph embedding lemma for regular pairs counts a positive constant times embeddings of any fixed graph properly three-coloured into those three clusters, including . Dividing by the fixed number of descriptions of a cycle gives the same conclusion for unlabelled copies.
Apply triangle in a graph removal with , and take the resulting . A -free graph cannot have triangles in a graph for large , by the preceding consequence. Delete at most edges to obtain a triangle-free . With ,
Apply the proved stability result with . The resulting complete bipartite graph satisfies
Choose also large enough that . Then the distance is at most .
For the unheaded continuation, use the same and its associated , and set . Having at most cycles rules out triangles in a graph just as before. The identical deletion and stability calculation applies. A sufficiently small gives the same bound.
In this enumeration problem, monotone means subgraph-closed graph property: both deleting vertices and deleting edges preserve membership. This is a decreasing convention, rather than the increasing-edge convention often used for random-graph thresholds. Assume first that the property is proper and has graphs of arbitrarily large orders. These are the usual nondegenerate hypotheses for the formula.
Put . Every graph of chromatic number at most belongs to . In particular, all subgraphs of a fixed balanced Turán graph belong. Choosing each of its edges independently as present or absent gives
For the upper bound, fix with . Every member of is -free, by closure under subgraphs.
We use the following standard regularity consequences. For every sufficiently small regularity error , large minimum cluster count , and fixed positive density cutoff , the Szemerédi regularity lemma gives an equitable partition into clusters and an exceptional set of at most vertices, with at most irregular pairs. The graph embedding lemma for regular pairs says that a fixed graph with a prescribed proper colouring embeds into the corresponding clusters if all its required cross pairs are regular with density at least , provided is sufficiently small relative to and the graph. Hence the reduced graph of a regularity partition, joining regular pairs of density at least , is -free: such a clique would embed .
By the Turan theorem, this reduced graph has at most edges. On its dense pairs allow arbitrary choices of original edges, giving at most free binary choices. All edges within clusters, touching the exceptional set, or lying in irregular pairs contribute further choices. On each remaining pair there are at most times its number of possible edges. The elementary binary entropy estimate
bounds the total sparse-pair contribution by . The partition and pair classifications have at most descriptions, whose logarithm is since is fixed. Choose large, then small, then sufficiently small; their total error can be made arbitrarily small. This proves
It is the enumeration of subgraph-closed graph properties.
For the hereditary extension, a hereditary graph property is closed under induced subgraphs. Define the clique-independent partition class , for , to consist of graphs partitionable into possibly empty classes, exactly designated as cliques and the other designated as independent sets; cross edges are unrestricted. Thus is the total number of classes. The colouring number of a hereditary graph property is
Use value zero if this set is empty, and infinity for the class of all graphs.
for . The lower bound follows from the definition. For the upper bound, fix any and a balanced partition of a large -vertex set into classes with clique classes. Independent choices of cross edges give distinct graphs in . On the other hand, all graphs in can be described by at most partitions, each with at most unrestricted cross pairs. The former count is strictly larger for large , so is not contained in for any . A contained class with even more parts would contain one of these -part classes by making unused parts empty, so it is also impossible.
The main changes for the hereditary graph enumeration theorem are as follows. The lower bound now uses a contained class : within-class edges are fixed as complete or empty, and the balanced cross pairs still give free edge choices. For the upper bound, since no is wholly contained in , choose one forbidden induced graph for each .
Use the standard induced regularity template lemma: for a fixed finite forbidden induced family and any error tolerance, a regularity refinement gives bounded-size templates with internal clique/independent types and cross pairs classified as sparse, almost complete, or intermediate. A clique of intermediate pairs on classes realizes every fixed induced pattern consistent with the internal types of those classes. This induced embedding conclusion uses a Ramsey refinement within clusters and regularity for both edges and nonedges; the total exceptional-pair cost can be made arbitrarily small. Applied to the , a clique on intermediate classes would realize the forbidden whose number of clique types is . Thus the graph of intermediate pairs is -free. Only intermediate pairs contribute unrestricted binary choices; sparse pairs and the missing edges in almost-complete pairs each have the same entropy bound as before. The Turan theorem and the earlier counting argument now give
This formula assumes . For the universal property the count is exactly ; a hereditary property of bounded order has and has no graphs on sufficiently large vertex sets, so the displayed expression with is not applicable.
For a proper subgraph-closed graph property, any contained must have : if , it contains arbitrarily large complete graphs, and closure under subgraphs would force every graph into the property. Consequently its colouring number is exactly one less than the least chromatic number of an excluded graph. The excluded family of an intersection is the union of the two excluded families, whose minimum chromatic number is the smaller of their minima. Therefore for subgraph-closed properties, with the universal case treated by .
For hereditary properties take and , both of colouring number two. A graph in their intersection is both bipartite and a union of two cliques. A clique in a bipartite graph has at most two vertices; hence every such graph has at most four vertices. The intersection contains no complete clique-independent class on arbitrarily large orders, so . This also demonstrates why the bounded-order exception to the enumeration formula is necessary.
Because , every bipartite graph is -free. The balanced complete bipartite graph therefore gives
For the reverse bound, fix and suppose that has more than edges. Apply the Szemerédi regularity lemma with parameters much smaller than . Form the reduced graph whose vertices are the regularity classes and whose edges are the regular pairs of density above a small fixed threshold. Edges inside classes, irregular pairs, and regular pairs below the threshold account for edges. The remaining edges force the reduced graph to have more than edges.
By the Turan theorem, the reduced graph contains a triangle. The three corresponding regular pairs all have positive density, and the graph embedding lemma for regular pairs embeds every fixed three-colourable graph, in particular , across suitable repeated subclusters of these three classes. Thus every sufficiently large graph of density above contains . Letting gives
This is the chromatic-number-three case of the Erdős-Stone theorem.