Adapted from jtraverso/turan-stability (Palomar-registered source).
The Erdős–Simonovits stability theorem #
Erdős–Simonovits stability theorem (Erdős 1967, Simonovits 1968), in the form derived by
Füredi (2015) from the regularity method: let L be a finite graph with chromatic number at most
p + 1 (i.e. L.Colorable (p + 1)). For every ε > 0 there are δ > 0 and n₀ such that every
L-free graph on n ≥ n₀ vertices with at least (1 - 1/p) n² / 2 - δ n² edges differs from
some complete p-partite graph on the same vertices in at most ε n² edges.
The proof combines Szemerédi's regularity lemma (through the reduced graph of
StabilityLib/CliqueRemoval.lean), the embedding lemma Embedding.exists_embedding_of_isUniform
(the reduced graph of an L-free graph is K_{p+1}-free) and Füredi's theorem
Furedi.exists_partition_symmDiff_le applied to the reduced graph.
ErdosSimonovits.stability: the theorem above. The complete p-partite graph with parts the
fibres of f : W → Fin p is (⊤ : SimpleGraph (Fin p)).comap f; L ⊑ G is Mathlib's
SimpleGraph.IsContained.
The reduced graph of an L-free graph is K_r-free, provided L is properly
r-coloured and the parameters allow the embedding lemma.
Edit distance to K grows by at most the number of deleted edges when passing from a
subgraph G' to G.
Erdős–Simonovits stability theorem. Let L be a finite graph that is
(p + 1)-colourable. For every ε > 0 there are δ > 0 and n₀ such that every graph G on
n ≥ n₀ vertices that does not contain L and has at least (1 - 1/p) n² / 2 - δ n² edges
differs from some complete p-partite graph on the same vertices in at most ε n² edges.