Fix an odd cycle length. If the graph has edge density at least and sufficiently few copies of that cycle, odd-cycle copies from positive triangle density forces few triangles in a graph. The triangle removal lemma deletes at most edges, after which the clique-free edit bound applies with two parts. Absorbing its linear rounding error into the density margin gives the displayed bound for large order.
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 Turan 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.