Stability from graph symmetrisation arguments with applications to inducibility

We present a sufficient condition for the stability property of extremal graph problems that can be solved via Zykov's symmetrisation. Our criterion is stated in terms of an analytic limit version of the problem. We show that, for example, it applies to the inducibility problem for an arbitrary complete bipartite graph B$B$ , which asks for the maximum number of induced copies of B$B$ in an n$n$ ‐vertex graph, and to the inducibility problem for K2,1,1,1$K_{2,1,1,1}$ and K3,1,1$K_{3,1,1}$ , the only complete partite graphs on at most five vertices for which the problem was previously open.


Introduction and notation
The notion of symmetrisation in graphs was introduced by Zykov in [38].In its most basic form, symmetrisation is the process of considering two non-adjacent vertices x and y in a graph G, and replacing x by a clone of y, i.e. a vertex y ′ whose neighbourhood is the same as that of y.Zykov used symmetrisation to reprove Turán's theorem [36], as follows.Let G be an n-vertex K r -free graph with the maximum number of edges.Whenever there are non-adjacent vertices x, y with d G (x) ≤ d G (y), we symmetrise by replacing x by a clone of y.The graph obtained in this way is still K r -free and has at least as many edges as G, and one can do this so that the final graph is complete partite.Standard convexity arguments imply that there are r − 1 parts of almost equal size, recovering Turán's theorem.A variation of this approach was employed by Motzkin and Straus [27] also to reprove Turán's theorem.
Suppose one seeks to maximise (or minimise) a graph parameter λ such that there is always a way to symmetrise any given non-adjacent pair in a graph without decreasing λ.Then it suffices to only consider 'totally symmetrised' (that is, complete partite) graphs to determine the maximum value of λ.Bollobás [3] used symmetrisation to show that the parameter which counts any linear combination of cliques is symmetrisable, a special case of which provides a lower bound for the minimal number of cliques in a graph of given order and size.
In this paper, we are interested in more general graph parameters λ which do not decrease upon symmetrisation, in a specific sense we describe below.Like the example above, a symmetrisable λ is maximised (not necessarily uniquely) by a complete partite graph.Our main result gives a sufficient condition for stability for symmetrisable functions, namely that any graph which almost maximises λ looks very much like a complete partite graph.In fact we prove the quantitatively sharper property of perfect stability, a strong form of stability which additionally implies an exact result.

The statement of the main result
In order to define precisely what we mean by symmetrisable functions and perfect stability, we need to introduce some notation.We write G = (V, E) for a graph with vertex set Fix a positive integer k ≥ 3. Let G be the family of all finite graphs up to isomorphism and let G n consist of graphs with n vertices.Let P n ⊆ G n be the family of complete partite graphs on n vertices.Suppose we have a function γ : where V k is the collection of k-element subsets of V .Thus λ(G) is the expected value of γ(G[X]) where X is a random k-subset of V .We may also work with which may be more convenient in some calculations.For a vertex x ∈ V (G), define Thus λ(G, x) is the conditional expectation of γ(G[X]) where X is a random k-subset of V conditioned on containing x.
Let λ(n) be the maximum of λ(G) over all n-vertex graphs G and define One can easily show that the limit exists.Note that the minimisation problem reduces to a maximisation one just by negating γ, so we will always consider maximising λ here.We can now define what it means for λ to be symmetrisable.
Definition 1.1 (Symmetrisability) A function λ given by ( 1) is symmetrisable if for every ε > 0 there is n 0 > 0 such that the following two properties hold for every graph G = (V, E) of order n ≥ n 0 : (Sym1) There is a sequence of graphs G 0 , G 1 , ... , G m on V such that G 0 = G; G m is complete partite and for every i (Sym2) If G − z is complete partite with partite sets V 1 , ... , V t , then there is a sequence of graphs G 0 , G 1 , ... , G m on V (G) such that for all i ∈ [m]; and for each j ∈ [t], either N Gm (z) ⊇ V j or N Gm (z) ∩ V j = ∅.
Here is an example of a symmetrisable parameter.For graphs F, G with v(F ) ≤ v(G), let P (F, G) be the number of v(F )-subsets of V (G) that induce a subgraph isomorphic to F .Let p(F, G) = P (F, G)/ v(G) v(F ) be the induced density of F in G. Let λ(G) := 1≤i≤k a i p(K i , G) for a 1 , ... , a k ∈ R. If we let γ(F ) = 1≤i≤k a i p(K i , F ) for F ∈ G k , then (1) holds.(Indeed, for v(G) ≥ k ≥ i, we have p(K i , G) = F ∈G k p(K i , F )p(F, G) which implies the statement.)As mentioned above, Bollobas [3] showed that λ(n) is attained on a complete partite graph and his proof shows that every such λ is in fact symmetrisable (for more details and examples, see Section 6).In Section 1.2 we will see a generalisation of this parameter.
Secondly, we define perfect stability.The edit and normalised edit distances between graphs G and H of the same order n are given by ∆1 (G, H) := min σ∈S(G,H) where S(G, H) is the set of bijections from V (G) to V (H).(We also write S(X) := S(X, X).) We further define ∆1 (G, H) := min H∈H ∆1 (G, H) for a family H of graphs of order n, and define δ1 (G, H) analogously.
Definition 1.2 (Perfect stability) A graph parameter λ is perfectly stable if there exists C > 0 such that for every graph G of order n ≥ C there is a complete partite graph H of order n such that δ1 (G, H) ≤ C(λ(n) − λ(G)).
We say that a sequence x = (x 1 , x 2 , ... ) with x 1 ≥ x 2 ≥ ... ≥ 0 and i≥1 x i ≤ 1 is a maximiser if there exists a sequence (H n ) n of complete partite graphs such that, as n → ∞, we have v(H n ) → ∞, λ(H n ) → λ max and for every i ≥ 1 the number of vertices in the i-th largest part of H n is (x i + o(1))v(H n ).Let OPT = OPT(λ) be the set of maximisers.
In Section 4 we will show that if OPT is a finite set, then there is β > 0 such that, for every x ∈ OPT and every i ≥ 0 the entry x i is either 0 or at least β.
Observe that, if λ is perfectly stable, then the only graphs on which λ is maximised are complete partite.Perfect stability has already been proved in several contexts, most notably in Turántype problems; for example by Füredi [13], Norin and Yepremyan [28,29], Pikhurko, Sliačan and Tyros [30], and Roberts and Scott [33].
If x 0 = 0, take a partition Otherwise, for all i ≥ 1 with x i n ≥ 2, let |V i | = ⌊x i n⌋ and let V 0 consist of the remaining vertices in [n].
We say that G n,x is the (n-vertex) realisation of x and has P-structure V 0 , ... , V m .
If H is a graph obtained by adding a new vertex z to G = G n,x , we say that z is a clone of u ∈ V (G) if u ∈ V 0 and N H (z) = V (G), or if u / ∈ V 0 and N H (z) = N G (u).The following is one version of our main result, which is also stated as Theorem 3.5, in terms of limits.Roughly speaking, it states that a symmetrisable function λ is perfectly stable if it is 'strict', meaning that it is sensitive to small alterations in a graph.Theorem 1.4 Let λ be a symmetrisable function defined as above.Suppose |OPT| < ∞.Suppose also that there exists c > 0 such that the following hold for all large n and maximisers x = (x 1 , x 2 , ... ) ∈ OPT, where G = G n,x : (i) For all distinct x, y ∈ V (G) we have λ(G) − λ(G ⊕ xy) ≥ cn −2 , where G ⊕ xy has vertex set V (G) and edge set E(G) △ {{x, y}}.
(ii) If G v is obtained from G by adding a new vertex v which is complete or empty to each part of G (where each V i , i ∈ [m] is a part and we have |V 0 | singleton parts) then the minimum number of edits at v needed to make v a clone of some existing vertex of G is at most n(λ(G) − λ(G v , v))/c.
Then λ is perfectly stable.
As mentioned, see Theorem 3.5 for the 'limit version' of this statement, which concerns One can easily show that this limit exists and that it does not depend on the choice of the part sizes |V i | in Definition 1.3 (only on the ratios x i ).The conditions in Theorem 1.4 become a series of inequalities that must be verified for maximisers x, which are a finite collection of polynomial inequalities if the number of maximisers is finite and x 0 = 0, since, for example, given i, j, the quantity λ(G) − λ(G ⊕ xy) is identical for all x ∈ V i and y ∈ V j .The value of the theorem is that, given the set of maximisers, the conditions are usually very easy to check, so in some sense the 'combinatorial part' of the problem is solved.It remains to determine the set of maximisers, amounting to a polynomial optimisation, which is unfortunately difficult in general.

Applications to inducibility
A large class of problems where symmetrisation was sucessfully applied is the inducibility problem for complete partite graphs.The inducibility problem for a graph F is to determine ; the limit is known to exist and is in fact equivalent to the maximum density of induced copies of F in a graphon W . Brown and Sidorenko [7, Proposition 1] used symmetrisation to prove that if F is complete partite, then for every n ∈ N at least one i(F, n)-extremal graph is complete partite.Schelp and Thomason [34], also via symmetrisation, extended both the result of Brown and Sidorenko and a result of Bollobás [3] by showing that the same conclusion holds (at least one graph attaining λ where each F is complete partite, including K t and K t , and c F is non-negative if F is not a clique.Their proof (which is essentially the same as that of Bollobás [3]) implies that this parameter is symmetrisable (see Section 6 for a proof).
In particular, Theorem 1.4 applies to the inducibility problem for complete partite graphs.To the best of our knowledge, for every instance of this problem where the set of maximisers is known, we can prove perfect stability.
Pippenger and Golumbic [32] determined i(K s,t , n) for all s, t with |s − t| ≤ 1, observing that the complete balanced bipartite graph is an extremal graph.Some of these results were independently reproved in [5].Brown and Sidorenko [7] showed that i(K s,t , n) with st ≥ 2 is attained by a complete bipartite graph, and that if t−s 2 ≤ s ≤ t then the unique maximiser is ( 1 2 , 1 2 , 0, ... ).Perhaps surprisingly this does not mean that K ⌊n/2⌋,⌈n/2⌉ is optimal for i(K s,t , n), and they show that if 3n = 4a 2 + 4 for a large integer a, then K n/2−a,n/2+a is optimal for K 3,1 .We prove a corresponding stability result for complete bipartite graphs.
Theorem 1.6 Let s, t ∈ N with st ≥ 2. Then p(K s,t , •) is perfectly stable, i(K s,t ) = s+t s M s,t and there is a unique maximiser (α, 1 − α, 0, 0, 0, ... ), where α ∈ Bollobás, Egawa, Harris and Jin [4] studied the inducibility problem for complete equipartite graphs.They showed that if the size t of each part is not too small compared to the number r of parts, then the complete balanced r-partite graph T r (n) is the unique extremal graph for each large n.This strengthened an earlier work of Brown and Sidorenko [7] which showed that T r (n) is an asymptotically extremal construction (without proving any uniqueness) -that is, ( 1 r , ... , 1 r , 0, ... ) with 1 r repeated r times is an element of OPT.We prove a corresponding stability result.
Theorem 1.7 Let r, t ≥ 2 be integers and let K r (t) denote the complete r-partite graph with parts of size t.Suppose that t > 1 + log r (denoting the natural logarithm by log).Then p(K r (t), •) is perfectly stable, i(K r (t)) = (tr)!r!t! r r tr , and the unique maximiser is ( 1 r , ... , 1 r r , 0, ... ).
Theorem 1.9 p(K 3,1,1 , •) is perfectly stable, i(K 3,1,1 ) = 216 625 , and the unique maximiser is The latter is particularly interesting since the extremal graph contains a clique part: it is a clique with a clique of proportion 3/5 removed.This demonstrates that allowing maximisers x with x 0 = 1 − i≥1 x i > 0 in our theory -which complicates matters somewhat -is essential in giving a full picture.
We remark that the case λ(•) = −p(K 3 , •)− p(K 3 , •) (which is not a function as in Lemma 1.5) is given by a classical theorem of Goodman, who determined this value exactly.Here, asymptotically extremal graphs are those for which all but o(n) vertices have degree n 2 + o(n) (including many graphs which are not complete partite).(Note that p(K 3 , •) + p(K 3 , •) is trivially maximised by the complete and empty graphs.)It remains a major open problem to determine Pikhurko, Sliačan and Tyros [30] were able to prove perfect stability for i(F, n) for several small graphs F via flag algebra calculations.The graphs they considered were , as well as the non-complete partite graphs P 3 ∪ K 2 , the "Y " graph and the paw graph which we do not define.Their results extend inducibility results obtained in [7], [32], and by Hirst in [18].Our Theorem 1.6 in particular reproves the cases K 2,2 and K 3,2 from [30].
Before stating the limit version of our main theorem in Section 3, we give here an illustration of it in the case F = C 4 .(Perfect stability was already proved here in [30].)It is easy to see that OPT consists only of the unique vector ( 12 , 1 2 , 0, ... ) with λ max = 3 8 .Thus in order to apply our criterion we have to check that, starting with K ⌊n/2⌋,⌈n/2⌉ the following two properties hold: (i) if we add an edge into a part or remove an edge across then we decrease the number of induced copies of C 4 by Ω(n 2 ); (ii) if we add a new vertex v which is either isolated or connected to every other vertex, the number of induced copies of C 4 containing v is at most (1 − Ω(1)) 3 8 n

.
Both properties trivially hold so the inducibility problem for C 4 is indeed perfectly stable by Theorem 1.4.
The following conjecture seems plausible.
Conjecture 1.10 The inducibility problem for F is perfectly stable for every complete partite F .However it is not the case that every problem with λ = F c F • p(F, •) is perfectly stable, where each F is complete partite, and c F ≥ 0 if F is not a clique.Indeed, if k ≥ 3 and the sum is over all complete partite F on k vertices, and each c F = 1, then every k-vertex subset of every complete partite graph contributes (the maximum value of) 1 to Λ, so OPT is the set of all x with x 1 ≥ x 2 ≥ ... ≥ 0 and i≥1 x i ≤ 1.Let us show that λ is not perfectly stable.Indeed, if it is, there is C such that for every graph G of order n ≥ C, there is a complete partite H such that δ1 (G, H) ≤ C(λ(n) − λ(G)).Choose 1/n ≪ c ≪ 1/C.Starting with K n , remove every edge with both endpoints inside a set A of size 5cn and add into A a blow-up of C 5 with each part A 1 , ... , A 5 of size cn, to obtain an n-vertex graph G. Then δ1 (G, H) = Ω(c 2 ) for every complete partite H, but λ(n) − λ(G) = 1 − λ(G) = O(c 3 ).Indeed, a subset of G is not complete partite only if it contains at least three vertices in A. So the fraction of subsets inducing a non-complete partite graph is O(c 3 ).This is a contradiction.
Finally, it would be remiss not to remark on the inducibility problem for non-complete partite graphs, for which the present paper does not apply, and which is in general wide open (see [10] for a list of known results of order up to 5).The outstanding open problem in the area is determining i(P 4 ), the smallest unsolved case, for which there is not even a conjectured value.Hatami, Hirst and Norin proved that extremal graphs of large blow-ups are essentially blow-ups themselves [16].Graphs with more interesting structure appear as extremal graphs for other F .An important longstanding conjecture of Pippenger and Golumbic [32] attained by the iterated blow-up of C k .Balogh, Hu, Lidický and Pfender [1] proved this conjecture for k = 5: they obtained an exact result for λ(•) = p(C 5 , •) and showed that if n is a power of 5 then the unique graph attaining i(C 5 , n) is an iterated blow-up of a 5-cycle.There has recently been progress on the general conjecture, see [17,22].Yuster [37] and independently Fox, Huang and Lee [11] proved that for almost all graphs F , the extremal graph is the iterated blow-up of F .Fox, Sauermann and Wei [12] considered graphs H obtained by removing a small number of vertices from a random Cayley graph H of an abelian group, showing that here the extremal graph is the iterated blow-up of H (not of H).Liu, Mubayi and Reiher [23] began a systematic study of the feasible region of induced graphs; that is, the set of points (x, y) in the unit square for which there is a graph of edge density approaching x with F -density approaching y.The inducibility problem seeks the maximum y-value of such a point.

Structure of the paper
The rest of the paper is organised as follows.In Section 2 we introduce the partite limit space corresponding to the collection of limits of complete partite graphs which we will need to prove our main result.In Section 3 we define the notion of strictness in terms of elements of this space and give a limit version of our main result, Theorem 3.5.The main result of Section 4 is that when OPT is finite, all part ratios of extremal graphs are bounded away from 0. We prove Theorem 3.5 in Section 5. We present some applications of Theorem 3.5 to the inducibility problem (Theorems 1.6-1.9) in Section 6. Section 7 contains some concluding remarks.

The partite limit space
We will work in a space P, the partite limit space, which is in some sense the completion of the set of complete partite graphs.The aim of this section is to define P and a metric δ edit on this set, which will essentially generalise edit distance in graphs.We prove that this yields a compact metric space upon which λ can be extended continuously (Lemma 2.6).Thus the set OPT of maximisers of λ in P is non-empty.We define As usual, supp(x) := {i ≥ 1 : x i > 0}, and we also define supp * (x) := supp(x) ∪ {0} if i≥1 x i < 1, and supp * (x) := supp(x) otherwise.For β > 0 we write Write 0 := (0, 0, ... ).Given x, x n ∈ P, we will always write x = (x 1 , x 2 , ... ) and x n = (x n,1 , x n,2 , ... ) and correspondingly x 0 := 1 − i≥1 x i and x n,0 We write P for the set of those elements x of P with finitely many non-zero entries all of which are rational, thus corresponding to the set of complete partite graphs.Somewhat conversely, we have the construction G n,x from Definition 1.3.For example, we have ∼ = K ℓ,ℓ , but we cannot take, say, any K a,b,1 for G n,(x,1−x,0, ... ) .

The measure-theoretic and graphon perspectives
For each x ∈ P, one can define a probability measure µ x on N 0 by setting µ x ({i}) = x i and then let M := µ x : x ∈ P .
It is very natural to define the corresponding collection of "complete partite" graphons (which will be used in Section 4).A graphon is a quadruple Q = (Ω, B, µ, W ), where (Ω, B, µ) is a standard probability space and W : Ω × Ω → [0, 1] is a symmetric measurable function.For every graph G, we define the corresponding graphon Q G = (V, 2 V , µ, A G ) where µ is the uniform measure on the finite set V and A G : V × V → {0, 1} is the adjacency function of G.For a graph F on [k] we write where aut(F ) is the group of automorphisms of F .In the literature one usually encounters t ind (F, Q) which is the above without the normalisation factor.Two graphons Q, Q ′ are equivalent or weakly isomorphic if p(F, Q) = p(F, Q ′ ) for every graph F .A sequence of graphons (Q n : n ∈ N) is said to converge to a graphon Q if lim n→∞ p(F, Q n ) = p(F, Q) for every graph F .A Q-random graph of order k is obtained by sampling k random points v 1 , ... , v k ∈ (Ω, µ) uniformly and independently, and adding each edge x i x j with probability W (x i , x j ).Now let Q x := (N 0 , 2 N 0 , µ x , K) where K(i, j) := 0 if i = j ≥ 1 and K(i, j) := 1 otherwise, i.e. if i = j or i = j = 0. Then define There are various characterisations of weak isomorphism (see [26,Theorem 13.10]).All we will need is the easy fact that for distinct x, y ∈ P, their graphons Q x , Q y are not weakly isomorphic.Indeed, if i ≥ 1 is the minimum integer with x i = y i , say x i > y i , then it is not hard to see directly that the edgeless graph of sufficiently large order n has strictly larger density in x than in y.
The spaces P, M and Q are equivalent and one can take any of these perspectives, but in this paper we mainly work with P (and briefly use Q in Section 4).The space Q was used in [2] by Bennett, Dudek, Lidićky and Pikhurko who determined the minimum C 5 -density in graphs of edge density k−1 k for integers k.They used Q to prove a corresponding stability result.Therefore we hope that the theory concerning P (and, by extension, M and Q) developed in this section may be useful for other extremal problems where the extremal graphs are complete partite.

The edit metric
We would like to define a metric on P which will correspond to the edit distance between graphs.First we define edit distance between two graphs of possibly different orders, often called the fractional edit distance.Given a graph G, let G (n) be an n-vertex almost uniform blow-up of G, that is, we replace each vertex x ∈ V (G) by an independent set I x , where each ||I x | − |I y || ≤ 1, and x∈V (G) |I x | = n, and add every edge between I x and I y whenever xy ∈ E(G).Then let It is easy to see that the limit exists; in fact, its value can be computed via a linear program with v(G) × v(H) variables that considers all fractional overlays between the vertex sets of G and H, c.f. e.g.[31,Equation (3)].We also define for a family H of graphs δ edit (G, H) := lim n→∞ δ1 (G (n) , {H (n) : H ∈ H}).We define the distance between x, y ∈ P to be For a graph G, define also ) and, for a family H of graphs, δ edit (x, H)) in the obvious way.Again, the existence of the limit in these definitions is easy to establish.Note that the normalisation factor 2 n 2 in the 'usual' edit distance δ1 is motivated by vertices of G corresponding to independent sets of relative size 1 n .The distances δ1 and δ edit are not the same even for graphs of the same order, due to rounding; see examples of Matsliah (see Appendix B in [15]) and Pikhurko [31].The following lemma implies that we are free to interchange δ edit and δ1 in matters of convergence, and that with respect to δ edit we are free to interchange H and x H when H is complete partite.Lemma 2.1 We have the following.
x ∈ P and complete partite graphs G, H.
(iii) δ edit satisfies the triangle inequality on P.
Proof.The non-trivial inequality of part (i) was proved in [31, Lemma 14].For (ii), let H have h vertices.Then x The remaining parts of (ii) now follow from (iii) which is immediate since δ1 satisfies the triangle inequality on the set of graphs of the same given order.
This notion of edit distance is very natural, yet rather unwieldly to work with.The following easy facts concerning it will be useful.Recall first that x 0 is not an entry in x = (x 1 , x 2 , ... ), so e.g.
Proof.For (i), consider large n ∈ N and G n,x , G n,y with P-structures V 0 , V 1 , ... , V m and U 0 , U 1 , ... , U ℓ respectively, where without loss of generality ℓ ≤ m.For convenience let )) if and only if either it lies in V i for some i 1 but not in X ij for any j ∈ [m], or lies in U j for some j 1 but not in So δ edit (x, y) ≤ 2 x − y 1 , as required.
Parts (ii) and (iii) are clear.
Note however that convergence in ℓ 1 does not give the same topology as pointwise convergence, by considering for each n ∈ N the sequence x n given by x n,i = 1/n for all i ∈ [n] and x n,i = 0 otherwise.We have that x n 1 = 1 for all n, while x n clearly converges pointwise to 0 and by Proposition 2.2(ii), we see that On the other hand, convergence in δ edit is equivalent to pointwise convergence, as we show in the next lemma.
Proposition 2.3 In the space P, convergence in edit distance is equivalent to pointwise convergence.That is, whenever (x n ) n is a sequence in P and x ∈ P, we have that lim n→∞ δ edit (x n , x) = 0 if and only if for all i ∈ N we have that Proof.Let (x n ) n be a sequence in P and let x ∈ P. Fix an arbitrary ε > 0.
Suppose first that x n → x pointwise.We need to show that δ edit (x n , x) < ε for sufficiently large n.Since i≥1 x i ≤ 1 and x 1 ≥ x 2 ... ≥ 0, there exists an integer M > 0 such that i≥M x i < ε/8, in particular, x M < ε/8.As x n → x pointwise, there exists n 0 such that, for all i ≤ M and for all integers n ≥ n 0 , we have that |x n,i − x i | < ε/(8M ).In particular, since x n,j is non-increasing with j, we have for all integers n ≥ n 0 and j ≥ M that x n,j < ε/4.Let y := (x 1 , ... , x M , 0, ... ) and, for each n ∈ N, define y n := (x n,1 , ... , x n,M , 0, ... ).Let n ≥ n 0 be an integer.Then by Proposition 2.2(i), Similarly by Proposition 2.2(ii) and (iii), . By Lemma 2.1(iii), δ edit defined on P satisfies the triangle inequality.Thus we have δ edit (x n , x) ≤ ε whenever n ≥ n 0 .Thus x n → x in edit distance, as required.
Conversely, suppose now that (x n ) n converges to x in edit distance δ edit .Let i ≥ 1.We need to show that there exists n 0 > 0 such that for all n > n 0 we have |x n,i − x i | ≤ ε.Now, there exists n 0 > 0 such that for all n > n 0 , there is a permutation σ : Let n > n 0 .For A ⊆ [n], denote by σ(A) and σ −1 (A) the image and pre-image of A respectively.By definition G n,xn has a vertex partition Choose an ordering of the vertices of G n,xn so that a vertex u ∈ V n,i comes before a vertex v ∈ V n,j if 1 ≤ i < j; or if i = 0 and j = 0. Choose an analogous ordering for V (G n,x ).Note the following trivial equality: We first show that for each vertex part V n,i which is not too small, there is a unique part V j i such that σ maps most of V n,i to V j i .Given i ∈ {0, 1, ... , m} and j ∈ {0, 1, ... , ℓ}, we say that i Then there exists B ⊆ [ℓ] with |A| = |B| and a bijection µ : A → B such that, for every i ∈ A, we have that i is j-good if and only if j = µ(i).
Proof of Claim.Let i ∈ A. Note first that i is not 0-good.Indeed, this follows from ] are empty graphs, and both G n,x and G n,xn are complete partite graphs, a contradiction.Thus there is some j i ∈ N for which i is j i -good.We claim that we can set µ(i) := j i and B := {µ(i) : i ∈ A}.We first show that this is well-defined, i.e. j i is unique.Fix an arbitrary i.e. i is not j ′ -good.It remains to show that µ is injective, i.e. that if i ′ ∈ A\{i}, we have that i ′ is not j i -good.By (4), it suffices to show that where the last inequality follows from i being j i -good and (4).This completes the proof of the claim.
We are now ready to prove the desired conclusion that for all i ∈ N, |x n,i − x i | ≤ ε.Suppose this is not true, and let k be the smallest integer i such that |x n,i −x i | > ε.Assume that x n,k > x k +ε (the other case can be handled similarly).In particular, recalling (3), |V n,k | ≥ εn/2, and so , which contradicts µ being a bijection.This completes the proof of the lemma.
Remark 2.5 Lemma 3.8 in [2] proves that if x n , x ∈ P are such that x n → x pointwise, then the corresponding graphons Lemma 2.6 The space P and distance δ edit have the following properties.
(i) The space (P, δ edit ) is a compact metric space.
(ii) The set of complete partite graphs P is dense in (P, δ edit ).
(iii) The function λ can be extended to a continuous function on the whole of P, namely by defining Proof.We begin with (i).From the definitions it is clear that δ edit (x, y) = δ edit (y, x) for all x, y ∈ P. By Lemma 2.1(iii), δ edit defined on P satisfies the triangle inequality.Finally, by definition, δ edit (x, y) = 0 if and only if x = y.So (P, δ edit ) is a metric space.To show that it is compact, Proposition 2.3 implies that it suffices to show that P is compact under the topology of pointwise convergence.For this, let (x n ) n be an infinite sequence of elements of P. Then we can define its accumulation point y iteratively as follows.Initially let i = 0.By passing to a subsequence of (x n ) n , we may assume that (x n,i+1 ) n converges to some y i+1 ∈ R. If y i+1 = 0, then stop and output y := (y 1 , ... , y i , 0, 0, ... ).Otherwise, increase i by one and continue.If the iteration does not terminate, output y := (y 1 , y 2 , ... ).One can easily see that y is indeed an accumulation point of (x n ) n , completing the proof of (i).Alternatively, the compactness of P follows from observing that P is a closed subset of the compact space [0, 1] N .
Part (ii) immediately follows since for every x ∈ P, the sequence (G n,x ) n of complete partite graphs converges in edit distance to x.Indeed, for each n ∈ N we have that x Gn,x ∈ P, and the definitions imply that x Gn,x converges pointwise to x.By Proposition 2.3, it also converges in edit distance.
It remains to prove (iii).Recall that we fixed a function γ : G k → R and for all n ∈ N and G ∈ G n , we defined λ(G) as in (1).Let γ max := max{|γ(F )| : F ∈ G k } (which exists since the domain of γ is finite for fixed k).Let n ∈ N, let G ∈ G n and let xy be a pair in V (G).Then .
Therefore, using the triangle inequality, we have for any where the final inequality follows from Lemma 2.1(i).Thus and by (i) we have that the function λ : P → R given by λ(x) := lim n→∞ λ(G n,x ) is well-defined for all x ∈ P and is continuous with respect to δ edit .
Note that the extension in Part (iii) of Lemma 2.6 is unique since P is dense in P.
The lemma implies that λ max := lim n→∞ λ(n) defined in the introduction can equivalently be defined as λ max := max{λ(x) : x ∈ P}.Moreover, for every x = (x 1 , x 2 , ... ) ∈ P, we have that λ(x) has the following analytic formula.Let ω 1 , ... , ω k be independent samples from Ω x which is the probability space on N 0 := {0, 1, 2, ... } where the probability of i is x i .Let the random sample G(x, k) be equal to which is the complete graph on [k] except we do not connect two distinct indices j, h ∈ [k] if ω j = ω h = 0.One can show using the Chernoff bound and the Borel-Cantelli lemma that (G(x, n)) n converges to x in P with probability 1 (see e.g. the more general Proposition 11.32 in [26]).Clearly we have that We let OPT consist of all maximisers x ∈ P, that is, The non-emptiness assertion follows from Lemma 2.6(i) and (iii).Let us see why the forward inclusion of the third equality is true.Take any x ∈ P with λ(x) ≥ λ(y) for all y ∈ P. For each n ∈ N, since λ is symmetrisable, there is a complete partite graph By passing to a subsequence we may assume that y n i converges to some y ∈ P. Then λ(x) ≤ λ(y) = lim i→∞ λ(n i ) = λ max .Thus we must have λ(x) = λ max , as desired.
This definition of OPT is equivalent to the one in the introduction.Indeed, let a = (a 1 , a 2 , ... ) ∈ P be such that there exists a sequence (H n ) n of complete partite graphs such that, as n → ∞, we have v(H n ) → ∞, λ(H n ) → λ max and for every i ≥ 1 the number of vertices in the i-th largest part of H n is (a i + o(1))v(H n ).Then x Hn → a and λ(a) = lim n→∞ λ(H n ) = λ max , as required.On the other hand, let x ∈ P be such that λ(x) = λ max .Then (G n,x ) n is the required sequence of graphs.

Polynomials
We will be interested in various functions on P, in particular the extension of λ from the family of complete partite graphs to P. For these we introduce a notion of polynomial on P which will help us prove that functions related to λ are continuous. Since We say that a function p : P → R is a P-polynomial if it can be written as a finite polynomial of S I d (x) := S d (x I ) for I ⊆ N, where x I ∈ P is obtained from x by removing every x i with i ∈ I and moving back remaining entries to fill in the 'gaps'.(Thus S I d (x) is defined by the version of ( 6) where the sum is restricted to indices not in I.) So, for example, x 0 = S ∅ (x) − S 1 (x), 1 (x) are P-polynomials, while x 1 + 2x 2 + 3x 3 + ... is not.Given any P-polynomial p, there is a finite partition N = I 1 ∪ ... ∪ I s such that p(x 1 , x 2 , . . . ) = p(y 1 , y 2 , ... ) where y is any element of P obtained from x by permuting indices within each part I i .Indeed, one can obtain I 1 , ... , I s by grouping together indices that belong to exactly the same sets I in the definition of p.
where, for all i ≥ 1 we have x ′ i = x i , except x ′ m = x m + h, and let h → 0. Apply the binomial expansion to each (x m + h) d j .As all series converge absolutely, we can change the order of summation and collect the same powers of h.We obtain where δ is an error term satisfying |δ| ≤ h • 2 d .So we can define partial derivatives ∂p ∂x i for i = 1, 2, ... via term-by-term differentiation.Also, if p = s(S d : d ∈ N ≤k ) where s is a finite polynomial, then define ∂p ∂x 0 := − ∂s ∂S 1 .Thus we can define partial derivatives of any Ppolynomial, and each such derivative is itself a P-polynomial.For a complete partite graph G on n vertices with parts V 1 , ... , V m of size at least 2 and clique part V 0 , define for I ⊆ N (ii) Each P-polynomial is uniformly continuous on (P, δ edit ).
(iii) For all x ∈ P we have S d (x) = lim n→∞ S d (G n,x ).
For (iii), fix x ∈ P. In G n,x , writing V n i for the ith part, we have each (

Strictness and a restatement of the main result
In this section, we will finally define what it means for λ to be 'strict'.Very roughly speaking, it means that when an elementary change is made to a complete partite graph on which λ is maximised, the decrease in λ is as much as it possibly could be.An 'elementary change' is either 'flipping a pair' (changing a non-edge to an edge or vice versa); or adding a vertex which is either adjacent to every vertex in a part, or to no vertex in a part.It seems that it is more convenient to state this property in terms of limits rather than graphs (which is why the definition is deferred until now).We will first make the relevant definition and then discuss it further.E) and a pair x, y of vertices of G, define

Definitions and notation
Given x ∈ P and i 1 , i 2 ∈ supp * (x), define where v 1 , v 2 are distinct vertices of the vertex classes For all i ∈ N 0 , we define e i to be the function e i : N → {0, 1} with e i (j) = 0 if and only if j = i (so e 0 ≡ 1).Let b : N → {0, 1} and α ∈ [0, 1].We write G + b,α u for the graph obtained from G with P-structure V 0 , V 1 , ... , V m by adding a new vertex u and, for i ≥ 1, adding every edge between u and V i if b(i) = 1, and no edges otherwise; and adding ⌊α|V 0 |⌋ edges between u and V 0 .Define where u / ∈ V (G), and let By convention take α = 1 if x 0 = 0 (when V 0 = ∅).
Given k 0 ∈ N 0 and a tuple k = (k 1 , ... , k t ) of positive integers, define the graph G k 0 k as follows.Let G k 0 k be the complete partite graph with t parts U 1 , ... , U t of size k 1 , ... , k t respectively, together with an additional k 0 singletons x 1 , ... , x k 0 , whose union is denoted by U 0 .
Proposition 3.2 Define k and λ as in (1).The following hold for all x ∈ P.
Proof.The equality in (i) can be checked directly.
For (ii), the theory of Lagrange multipliers implies that, for all i, j ∈ supp * (x), we have ∂λ(x) ∂x i = ∂λ(x) ∂x j .Indeed, if we fix the rest of x apart from x i , x j , fix s = x i + x j and vary x i , x j , then we can view λ as a polynomial in x i , x j (of degree at most k).Introducing a new variable µ, the Lagrangian is The stationary points of L occur when ( ∂L ∂x i , ∂L ∂x j , ∂L ∂µ ) = (0, 0, 0), i.e. when ∂λ(x) ∂x i − µ = ∂λ(x) ∂x j − µ, as required.Since λ is a P-polynomial with each monomial having total degree k, we have for all i ∈ supp * (x) that giving the required.
Let us turn to Part (iii).The inequality |λ max −λ(n)| = O(1/n) follows from a standard blow-up trick, see e.g.[30,Lemma 2.2].The claim for the second pair follows from the fact that each named function on P is a P-polynomial, a finite polynomial of S d (G I n,x ) terms, so the error bound comes from (7) when applied to G n,x .For the last claim of Part (iii), a version of (7) implies that |λ(G n,x , u) Then Part (ii) gives the required.
Proof.We have seen that each function λ, ) is a P-polynomial with degree at most k and with coefficients whose absolute values are bounded.Thus Lemma 2.7 implies that the family of λ, ∇ •• i 1 i 2 λ, ∇ • b,α λ, λ(•, (b, α)) over all i 1 , i 2 , b, α is uniformly equicontinuous, as required.
The following crucial definition of the strictness property of a function λ requires that both ∇ •• i 1 i 2 λ and ∇ • b,α λ are bounded from below whenever (b, α) is not close to some (e i , 1).Roughly speaking, this means that λ is sensitive to small alterations in a graph.

Definition 3.4 (Strictness)
We say that λ is strict (with parameter c) if there is c = c(λ) > 0 such that for each x ∈ OPT, we have where In the next two subsections, we will motivate these definitions, which appear somewhat complicated at first sight.
: flipping a pair of vertices Take a complete partite graph G of large order n such that λ(G) ≈ λ max and let G ′ = G ⊕ xy be obtained by flipping the adjacency of an arbitrary pair xy ∈ V 2 .Then the number of vertex subsets of size k which contain both x and y is n−2 k−2 , so in the worst case, γ decreases by a constant for all such subsets, and thus λ decreases by Ω( n−2 k−2 / n k ) = Ω(1/n 2 ).Property (Str1) says that this worst-case behaviour is realised for every 'wrong' pair xy.

Observe that
that is, we look at the conditional expectation of the change in λ if we flip the pair {1, 2} in a random sample G(x, k) conditioned on ω 1 = i 1 and ω 2 = i 2 .

∇ • b,α λ: adding a new vertex
Again consider a complete partite graph G of large order n such that λ(G) ≈ λ max and obtain a graph G ′ from G by adding a new vertex u which, for each part of G, either connects to all or none of its vertices (here we are thinking of V 0 , if it exists, as consisting of |V 0 | singleton parts).
If the attachment of u mirrors an existing vertex, then its contribution to λ is approximately λ max (and G ′ is the same as G in the limit).But, if not, as u lies in n k−1 subsets, in the worst case, λ decreases by Ω( n k−1 / n+1 k ) = Ω(1/n).Property (Str2) says that this worst-case behaviour is realised for every u with 'wrong' attachment.
Suppose that G n,x has P-structure V 0 , V 1 , ... , V m(n) .Then, for 0 ≤ i ≤ m(n), let W i be the minimum number of edits needed to move the vertex u in G n,x + b,α u into the i-th part.So each W i being large corresponds to u being attached in an atypical manner, and some W i small means that u behaves like an existing vertex.It is not hard to show that lim n→∞ W i /n = w i +(1−α)x 0 , and of course if b = e i and α = 1, then w i + (1 − α)x 0 = 0 (since no edits are needed to move u to the i-th part).So (Str2) requires that, whenever n is large, the contribution to λ lost by a vertex u in G n,x + b,α u is a significant fraction of the number of edits needed to fit u into G n,x .
Observe that (using Proposition 3.2 and the remark immediately before it) where G ω 1 , ... ,ω k−1 x + b,α u is the random graph obtained by adding u to G(x, k − 1) with ui an edge when ω i = 0 if and only if b(ω i ) = 1, and ui an edge when ω i = 0 with probability α.

Main result
We are now ready to precisely state the 'limit version' of our main result.Theorem 3.5 Let k be a positive integer and let γ : ) for all G ∈ G n and n ∈ N, and let λ(n) := max G∈Gn λ(G).Suppose that λ is symmetrisable and |OPT(λ)| < ∞.Then λ has perfect stability if it is strict.
The following corollary states that strict symmetrisable functions exhibit classical stability, in the sense that any sufficiently large graph which is sufficiently close to being optimal can be edited by changing an arbitrarily small fraction of its adjacencies to obtain a complete partite graph with the correct part sizes.Corollary 3.6 Define k and λ as in (1) and suppose that they satisfy the assumptions in Theorem 3.5, and suppose further that λ is strict.Then for all ε > 0 there exist δ, n 0 > 0 such that for every graph G of order n ≥ n 0 for which λ(G) ≥ λ max − δ, there is x ∈ OPT(λ) for which δ edit (G, x) ≤ ε.
Proof.Let c = c(λ) > 0 be such that λ is strict with parameter c.Apply Theorem 3.5 to obtain C such that λ is perfectly stable with constant C. Suppose that the statement does not hold.Then there is a sequence of counterexamples By taking a subsequence if necessary, we may assume that each v n ≥ n.Let n be sufficiently large.By Theorem 3.5, there is some where we used Proposition 3.2(iii).But then by (5), So, writing x n := x Hn , and taking a subsequence if necessary, we see that x n → x ∈ OPT.But then, when n is sufficiently large, using Lemma 2.1,

Finitely many maximisers
We will need the following result which states that if the limit problem has finitely many optimisers, then all non-zero entries in them are separated from 0 by some constant β > 0.
The rest of the section is dedicated to proving Lemma 4.1.Our proof is an adaptation of the proof of Glebov, Grzesik, Klimošová and Král' [14] who, in particular, worked on the finite forcibility of graphons which are a countable union of cliques.Recall notions related to graphons in Section 2.1.A graphon Q is finitely forcible if there are finitely many graphs F 1 , ... , F ℓ such that for every graphon First, we need the following result which is Lemma 11 in [14] (except it is obtained by complementing all graphs and using our language of partite limits).
Lemma 4.2 If OPT = {x} consists of a single element x then there is ℓ 0 (in fact, we can take ℓ 0 = k where k is as in the definition of λ) such that, for any y ∈ P with y 0 = x 0 , if p(K i , x) = p(K i , y) for every 2 ≤ i ≤ ℓ 0 then y = x.
Proof.Our x corresponds to a graphon Q x .The fact that x is the unique element of OPT is equivalent to saying that the equations p(P 3 , Q) = 0 (the induced density of triples spanning exactly one edge) and λ(Q) = λ max force Q to be Q x up to weak isomorphism in the space of graphons.In particular, Q x is finitely forcible.The constraint p(P 3 , Q) = 0 forces Q ∈ Q (that is, to be a complete partite graphon) and thus automatically forces p(F, Q) = 0 for every graph F which is not complete partite so we can ignore all such induced densities.
Thus the equation λ(Q) = λ max can be viewed as involving only induced densities of complete partite graphs on at most k vertices.We claim that it can be equivalently rewritten as some polynomial in x 0 and induced densities of independent sets of size at most k.Then, supposing that the claim is true, if Q y ∈ Q has y 0 = x 0 and the same induced densities of K 2 , ... , K k as Q x , then Q y and Q x are weakly isomorphic and thus y = x.
We need the following easy generalisation of Lemma 4.2.
Lemma 4.3 If OPT is finite then there is ℓ 0 such that, for every x ∈ OPT and every y ∈ P with y 0 = x 0 , if x and y have the same induced density of K i for every 1 ≤ i ≤ ℓ 0 then y = x.
Proof.For every pair z, z ′ ∈ OPT there is some graph F such that p(F, z) = p(F, z ′ ).Indeed, since z = z ′ , their graphons Q z , Q z ′ are not weakly isomorphic and thus have a different induced density of some graph F .Of course, this F has to be complete partite (otherwise its induced density in both z and z ′ is zero).Let F 1 , ... , F m be all such graphs F where m ≤ |OPT|

2
. Let ℓ 0 := k + 2 max i∈[m] v(F i ).Now let x and y be as in the lemma.
Consider the new optimisation problem where we maximise Again, as in the proof of Lemma 4.2, λ ′ can be written as a polynomial of x 0 and induced densities of anticliques on at most ℓ 0 vertices.Also, clearly, x is the unique element of OPT(λ ′ ).Apply Lemma 4.2 to OPT(λ ′ ) = {x}.
Proof of Lemma 4.1 Let ℓ 0 be as in Lemma 4.3.It is enough to show that, for every x ∈ OPT, there are at most m := ℓ 0 distinct non-zero values among x 1 , x 2 , ... (then since |OPT| < ∞ the lemma trivially follows).
Suppose on the contrary that x i 1 , ... , x i m+1 are all positive and distinct for some 1 ≤ i 1 < ... < i m+1 .Without loss of generality, assume that these are the smallest such indices we could have chosen.Consider unknown variables y i 1 , ... , y i m+1 and set y i := x i for every other i ≥ 1.We get a contradiction to our choice of ℓ 0 if we show that there is a choice of y i 1 , ... , y i m+1 > 0 such that m+1 j=1 but the reordering y ′ of y (so that y ′ 1 ≥ y ′ 2 ≥ ... and y ′ 0 = y 0 ) is not equal to x. (Indeed, then y ′ ∈ P by the case d = 1 of (10) and it satisfies p(K d , y ′ ) = p(K d , x) for every d = 2, ... , ℓ 0 by the corresponding case of (10).)Consider the map g : R m × R → R m which sends (z 1 , ... , z m+1 ) to ( m+1 j=1 z d j ) m d=1 .The Jacobian of g(•, x i m+1 ) : R m → R m , which sends z ∈ R m to g(z, x i m+1 ), has non-zero determinant at z 0 := (x i 1 , ... , x im ).Indeed, the (s, t)-entry of the Jacobian at (z 1 , ... , z m ) is sz s−1 t so if we divide its s-th row by s we obtain the Vandermonde matrix of z 1 , ... , z m , so its determinant is m! 1≤s<t≤m (z s − z t ) which is non-zero at z = z 0 .
Thus the Jacobian of g(•, x i m+1 ) is invertible.By the Implicit Function Theorem, for every choice of y i m+1 sufficiently close to x i m+1 there is a continuous choice of (y i 1 , ... , y im ) close to (x i 1 , ... , x im ) satisfying (10).Choose such a y i m+1 not equal to any x j and such that y i 1 , ... , y im are all positive.Then the reordering y ′ of the obtained sequence y is not equal to x, giving the desired contradiction.
5 The proof of Theorem 3.5 In the first part of the proof, we find a suitable 'hypothetical counterexample' H on h vertices (Claim 5.2).This means that H is very close to being optimal (λ(H) is almost as large as λ(h)), but it is comparatively far from being complete partite (though it is important that H is not too far from being complete partite, and also that H is very large).Using (Sym1), given a candidate for H which has too many imperfections, we can incrementally symmetrise it until this is no longer the case, and without decreasing λ.
In the second part of the proof (Claim 5.3), we use the strictness of λ to obtain a contradiction.We compare H with the graph H ′ obtained by removing all imperfections (roughly speaking H ′ is the closest complete partite graph to H).The ratios of part sizes of H ′ are necessarily close to some x ∈ OPT.The contradiction will come from the fact that λ(H ′ ) − λ(H) is too large (which implies that H is actually far from optimal).We would like to argue that λ(H) − λ(H ′ ) can be approximated looking at each wrong pair e ∈ W := E(H) △ E(H ′ ) separately and summing its contribution to the function.This need not be true if e is incident to many other wrong pairs, so instead we consider two families of wrong pairs: those incident to vertices in B, which are those with high degree in W , and the collection E ′ of remaining wrong pairs.The fact that each e ∈ E ′ has a large contribution to λ(H) − λ(H ′ ) will follow from (Str1): namely that ∇ •• i 1 i 2 λ(x) is large, where i 1 , i 2 are the indices of the parts where e lies.The fact that the edges incident to each v ∈ B have a large contribution to λ(H) − λ(H ′ ) is slightly more involved.For this we use (Sym2) to symmetrise the neighbourhood of v, and, depending on the attachment of v in the resulting graph, the required conclusion will follow from (Str1) (if it is 'canonical') and (Str2) (otherwise).
The following lemma will be useful when comparing λ evaluated on a complete partite graph with λ evaluated on the same graph with a few imperfections.
Lemma 5.1 Let c > 0 and let γ : G k → R be fixed.Let H, H ′ be graphs on the same vertex set of size h, where h is large and H ′ ∈ P has P-structure V 0 , V 1 , ... , V m .Write R := E(H)△E(H ′ ) and given x ∈ V (H ′ ), write p(x) for the index of the part of H ′ containing x. Define and .
All three parts follow immediately, noting for (ii) that when R is a star it has no disjoint pairs.
We now have all the tools in place to prove our main theorem.
Suppose that λ is strict with parameter c > 0. Without loss of generality we may assume that c ≪ β, 1/γ max , 1/k.We want to show that there exists a constant C > 0 such that for every graph G on at least 1/C vertices, there exists a complete partite graph H on the same vertex set such that δ1 (G, H) ≤ C(λ(v(G)) − λ(G)).Suppose that this is false.That is, there exists a sequence of counterexamples and thus λ( Using the graphs G n , we now find a large graph H which is almost optimal and has a small but comparatively large number of imperfections.
Claim 5.2 For all ε > 0, there exists ε ′ > 0 such that the following holds.For all N > 0, there exist x ∈ OPT and a graph H on vertex set Proof of Claim.We consider two cases depending on whether (d n ) n contains a subsequence converging to 0. If it does not, then our counterexamples are eventually always far from being complete partite.In this case we perform an additional step of symmetrising each G n to obtain a graph which has a controlled number of imperfections; this number will be a small fraction of v 2 n .In the other case, the counterexamples are becoming gradually more like complete partite graphs so the number of imperfections could be subquadratic (in v n ).
Case 1: (d n ) n does not contain a subsequence converging to 0.
In this case, there exists ξ > 0 such that d n ≥ ξ for all sufficiently large n.Since we are free to make ε and ξ smaller we may assume without loss of generality that ξ = ε.Further, we may assume that d n ≥ ε for all n ∈ N.
Property (Sym1) (applied with parameter ε) implies that there exists n 0 = n 0 (ε) such that for each n ≥ n 0 , we can find a sequence G n,0 , G n,1 , ... , G n,m(n) of graphs on Let y n := x G ′ n .By choosing a convergent subsequence since (P, δ edit ) is compact, we may assume that y n converges to some y ∈ P.But λ(y n ) → λ max , so y ∈ OPT by the continuity of λ.By definition, . By increasing n 0 , we can assume that t < m(n).Then We claim that there exists ε ′ > 0 for which p n := δ edit (J n , P vn ) ≥ ε ′ for all sufficiently large n.Indeed, if the claim is not true, then by passing to a subsequence we may assume that p n → 0. For each n, pick a complete partite graph P n on v n vertices with δ edit (J n , P n ) = p n .Let z n := x Pn ∈ P be the sequence that encodes the part ratios of P n .We can pass to a subsequence of n such that z n converges to some z ∈ P; then λ(z) = lim n→∞ λ(P n ) = λ max .Thus z ∈ OPT.However, by Lemma 2.1, This ε ′ satisfies the lemma.Indeed, for any given N > 0, choose n > N sufficiently large so that v n > N and δ edit (J n , x n ) ∈ [ε, 2ε] and δ edit (J n , P vn ) ≥ ε ′ .Then we can set x := x n and H := J n and h Assume without loss of generality that (d n ) n → 0. Therefore, there exists a sequence (x n ) n with x n ∈ P such that δ edit (G n , x n ) → 0. By choosing a convergent subsequence of (x n ) n , we may assume that the sequence itself converges to some x ∈ P. Then for sufficiently large n, δ edit (G n , x) ≤ δ edit (G n , x n ) + δ edit (x n , x) → 0. Then the continuity of λ with respect to δ edit and (12) imply that x ∈ OPT.We can choose n sufficiently large so that, by (11), H := G n satisfies all the required properties in Claim 5.2 (where, for concreteness, we let ε ′ := 1).This completes the proof of the claim.
Choose an additional constant 0 < η ≪ c.Obtain ε > 0 by applying Corollary 3.3 with η 2 , 6ε playing the roles of ε, δ respectively.We may assume that ε ≪ η.Claim 5.2 furnishes us with an ε ′ > 0 which we may assume satisfies ε ′ ≪ ε.Now choose N ∈ N such that 1/N ≪ ε ′ .We have the following hierarchy: Apply Claim 5.2 to yield an x ∈ OPT and a graph H on h ≥ N vertices.Let us list some properties of x (which will be all we need from now on): where for all b : N → {0, 1} and α ∈ [0, 1].
(P5) Whenever y ∈ P satisfies δ edit (x, y) ≤ 6ε and supp * (y) = supp * (x) =: S, we have that |f Properties (P1) and (P2) follow immediately from |OPT| < ∞ and Lemma 4.1.Properties (P3) and (P4) follow since λ is strict with parameter c.Property (P5) follows from our choice of ε and the fact from Corollary 3.3 that any f in this family of functions is uniformly equicontinuous.Property (P6) is a direct consequence of Claim 5.2.
Let H be the family of h-vertex graphs with P-structure Among all graphs in H, let H ′ be one whose edit distance δ edit to H is minimised, with Pstructure (V i : i ∈ supp * (x)) as above, where , and call the edges of W wrong.By the definition of H ′ , (P6) and Lemma 2.1, we have that Then Note that, by (P2), this implies For a vertex v of H ′ let H ′ ⊕ v denote the graph obtained from H ′ by removing every edge containing v and then for all y ∈ [h] \ {v} adding the edge vy if and only if y ∈ N H (v). The heart of the proof is the following claim.

Claim 5.3
The following statements hold.
Proof of Claim 5.3.For (i), we see that For (ii), fix an arbitrary v ∈ B, and let and with arbitrary attachment to V 0 ).That is, either v is adjacent to every vertex or no vertices in each part V 1 , ... , V m .For brevity, let for all i ∈ [r], where here for any two graphs J, J ′ which differ only at a vertex v, we define ∆v 1 (J, J ′ ) to be the minimum number of edits of pairs containing v to make J equal to J ′ .By the definition of H, there are b : we let α := 1).We consider two cases depending on (b, α): in Case 1 the attachment of v in H r is very different to any vertex H ′ − v, and in Case 2 it is similar.
We will first show that For this, let y be the vector of part ratios of where the final equality follows from Proposition 3.2(i).This proves (17).Now, so to complete the proof of the claim, it suffices to show that ∇ • b,α λ(x) ≥ cη 3/2 /2.We will use the lower bound on ∇ • b,α λ(x) given by (P4), and that x i ≥ β > c for all i ∈ supp * (x) from (P2).Suppose first that (a) holds.Since each term in the expression for w i is non-negative, we have for all i ∈ supp * (x) = {0, ... , m} that ∇  Notice that Cases 1 and 2 are the only possible outcomes (recalling that if x 0 = 0, then α = 1).For all 0 ≤ i ≤ r, let as required for (ii).
For (iii), our task is to obtain a suitable lower bound on T := λ(H ′ ) − λ(H).Notice that the only k-sets X contributing to T are those containing some e ∈ W .Let In a similar fashion to part (ii), we will first give lower bounds for T 0 , T ′ respectively, and then show that T is well-approximated by T 0 + T ′ .First consider T 0 .By Claim 5.3(ii), we have T 0 ≥ |B|kη 3/2 c/(3h).Now consider T ′ .Again ∇ •• p(x)p(y) λ(x H ′ ) ≥ c/2 for all xy ∈ E ′ , so Lemma 5.1 and (15) imply that For the final step, note that h k |T − T 0 − T ′ | ≤ X∈I 0 2γ max , where Thus as desired.This completes the proof of Claim 5.3.
Thus we complete the proof of Theorem 3.5.

Applications to inducibility
First we prove Lemma 1.5 which is essentially Theorem 1 in [34].
Proof of Lemma 1.5 In fact, we can require that |E(G i−1 ) △ E(G i )| is at most n − 1 (resp.at most 1) in (Sym1) (resp.(Sym2)) for every graph G of every order n ≥ k.
Let us show (Sym1).Initially, let H := G and let V = {V 1 , ... , V n } be the partition of V (H) into singletons.At each stage, every part of V will consist of twin vertices, i.e. vertices with neighbourhoods (in particular, every part is an independent set).We will modify the current graph H and the current partition V = {V 1 , ... , V s } so that at each step λ does not decrease while the affected edges are incident to a single vertex.
If for each 1 ≤ i < j ≤ s, H[V i , V j ] is complete bipartite, then H is a complete partite graph so we stop.Otherwise, pick i < j, x ∈ V i and y ∈ V j such that xy ∈ E(H).Let X = N H (x) and Y = N H (y). Fix a complete partite graph F .Note that every A ⊆ V with H[A] ∼ = F is one of the following four kinds: (1) for some constant C F > 0 and functions f F and g F .Here f F (X) (resp.f F (Y )) counts the number of copies of F of type (1) (resp.type ( 2)) as this depends only on X (resp.Y ).For disjoint U, W , we define g F (U, W ) to be the number of copies of any graph J with V (J) ⊆ U ∪W such that by adding two new vertices z, z ′ to J and adding edges {uz, uz ′ : u ∈ U } to J we obtain a copy of F .Observe that if {x, y} ∪ V (J) induces a copy of F in H as above, then x and y are in the same partite set, U ∩ V (J) ⊆ X ∩ Y and W ∩ V (J) ∩ (X ∪ Y ) = ∅.Thus g F (X ∩ Y, V \ (X ∪ Y )) counts type (3) copies.The type (4) count is a constant depending only on H − x − y.Then, letting f = F c F • f F and defining g, C similarly, we have Notice that g(•, •) is non-decreasing in both arguments, that is, Indeed, if F is a clique, then no copy of F contains both x and y, and c F ≥ 0 otherwise.
Suppose that f (X) ≥ f (Y ), let H xy be the graph obtained from H by making y a clone of x.
Let H ′ = H xy and let V ′ be obtained from V by moving y to the part containing x.It satisfies all the claimed properties as Finally, it remains to argue that one can avoid infinite cycles.The rule for breaking ties f (X) = f (Y ) with e.g.
that are at most n 3 steps where λ stays constant.(In fact, one can bound the total number of steps by 1 + 2 + ... + n − 1 = n 2 : if there are currently i ≥ 2 groups and we merge one group entirely into another, then we can do this by moving at most n − i + 1 vertices.)Let us show (Sym2).Given G and z as in the property, we have a partition consisting of all partite sets in G−z and z will always stay a single part.Given any partite V i of G−z, we can partition vertices V i = V ′ i ∪ V ′′ i depending on their adjacency to z, say V ′ i ⊆ N (z).Start with this initial partition into parts V ′ i and V ′′ i .Fix arbitrary non-adjacent vertices x ∈ V ′ i , y ∈ V ′′ i , note that (19) and (20) The rule for breaking ties is again to clone the vertex from the larger part: if f (X) = f (Y ) and, say, Note that G ′ differs from G only in one pair.As before, λ has not decreased.Then redefine V ′ i , V ′′ i and repeat the process.The final graph has N (z) so as before there are at most n 3 steps where λ stays constant, so there are no infinite cycles.)Repeating this for all i, we make at most n steps in total, and the resulting graph is as desired.
6.1 Proofs of Theorems 1.6-1.9 Since by Lemma 1.5, p(F, •) is symmetrisable whenever F is complete partite, to prove Theorems 1.6-1.9 it suffices to determine OPT (if it is not already known), and then check that p(F, •) is strict.The result then follows from Theorem 3.5.
In all cases, OPT consists of a single point, and checking strictness is generally straightforward (it is slightly more involved for F = K 1,t ).However, determining OPT where it is not already known, for F = K 2,1,1,1 and F = K 3,1,1 , is challenging and we are required to solve a polynomial optimisation problem.We use computer-assisted semidefinite programming to solve the last problem.
Note that f s,t is symmetric about α = 1 2 .For (i) and (ii), we just follow the proof of [7, Theorem 3].We have Assume first that s ≥ t−s 2 .Setting x = 1 + ε for ε ≥ 0, one can show that h(x) > 0, so f s,t is non-decreasing in [0, 1  2 ], and thus the unique maximum of f s,t in [0, 1] is at 1 2 , as required for (i).(In the calculation in [7,Theorem 3], it is shown that ≥ 0, but there is equality in the first inequality only if t − s = 1, but in this case the final inequality is strict.)Note that [7] uses (t, s + t) and (a, b) instead of our (s, t).Assume secondly that s < t−s 2 .Following the remarks after [7, Theorem 5], it suffices to show that h has a single root in (0, 1).This is a consequence of h(0) < 0, h(1) = 0, h ′ (1) < 0 and h ′′ (x) < 0 for all x ∈ (0, 1), as required for (ii).
Note that (Str1) is immediate as a non-edge between two partite sets is not contained in any induced copy of F , and an edge within a partite set is not contained in any induced copy of F .As in the proof of Theorem 1.6, this means that every ∇ •• ij λ(x) = λ(x), which is always at least Indeed, counting copies of F in G n,a + b,1 u containing u: if u plays the role of a vertex in A, then we choose the other vertex from this set among any of the 8 − k parts not adjacent to u, and then choose three distinct parts of the k adjacent to u to contain the other vertices.
If u plays the role of a singleton, we choose two among k parts for the other two singletons, and another for A (dividing by two for both orders).Routine calculations show that this is uniquely maximised (with value λ 0 ) when k = 7, as required.
Suppose that the claim holds.Since G is optimal, Proposition 3.2 implies that v has optimal attachment in G; that is, P (F, G, v) = n−1 4 λ(G, v) = n−1 4 λ max + O(n 3 ) ≥ 9 625 n 4 + O(n 3 ).Thus h(y, z) ≥ 0 for the y, z corresponding to Y, Z, since, as we have shown, z ≤ 2 5 .So y ≥ 3 5 .Consider the graph H obtained by replacing Z by a clique.Then we lose every copy of F containing the 3-independent set in Z (and lose no other copies) while we gain copies of F with the 3-independent set in Y and the two other vertices in Z.So P (F, G) − P (F, H) Suppose we can find non-negative polynomials s 0 , ... , s 3 in y, z and positive t ∈ Q such that −h(y, z) − t − zs 1 − (y − z)s 2 − (α − y)s 3 = s 0 , where a polynomial p ∈ R[y, z] is non-negative if p(y, z) ≥ 0 whenever y, z ≥ 0. Then −h(y, z) > 0 on R ′ .This will complete the proof of the claim.Let x := (1, y, z, y 2 , yz, z 2 ) ⊺ .To ensure that the s are non-negative, it suffices to find positive semidefinite 6 × 6 matrices Q i such that s i (y, z) = x ⊺ Q i x.For this, a sum-of-squares solver (we used the YALMIP Matlab toolbox [24,25] with SeDuMi [35]) numerically maximises t such that the above equality holds; that is, we obtain t ′ ≈ 0.02 and real matrices Q ′ 0 , ... , Q ′ 3 such that −h(y, z) − t ′ − zs ′ 1 − (y − z)s ′ 2 − (α − y)s ′ 3 ≈ s ′ 0 , where s ′ i = x ⊺ Q ′ i x.Now let Q i be a (symmetric) rational approximation to Q ′ i for i ∈ [3] and let R 0 be a rational approximation to Q ′ 0 .We obtain At this stage it does not matter (for the purposes of a verifiable proof) where R 0 , Q 1 , Q 2 , Q 3 came from; it suffices to show that they are positive semidefinite and that the polynomial ε(y, z) := −h(y, z) − zs 1 − (y − z)s 2 − (α − y)s 3 − r 0 is positive on [0, 1] 2 , where r 0 = x ⊺ R 0 x.To check positive semidefiniteness of a matrix A = (a ij ) i,j∈[m] , we first check that A is symmetric, then we use Sylvester's criterion, which says that a Hermitian matrix A is positive semidefinite if and only if A (k) = (a ij ) i,j∈[k] has positive determinant for all k ∈ [m].We bound ε(y, z) from below by its constant term minus the sum of the absolute value of its other coefficients (see 311.nb) to see that ε(y, z) ≥ 1 50 in the required region.This completes the proof of the claim.Since Claim 6.1 implies that OPT = {( 3 5 , 0, ... )}, it remains to check that p(K 3,1,1 , •) is strict.Consider G = G n,a which has a clique part V 0 of size 2n 5 + O(1) and another part V 1 of size This completes the proof of the theorem.

Concluding remarks
In this paper we have shown how to obtain stability from results in extremal graph theory which use symmetrisation.We have applied our general theory to the inducibility problem for complete partite graphs.It would be interesting to solve other instances of the polynomial optimisation problem which amounts to determining i(F ).
It would be particularly interesting to find other extremal graph theory problems to which our theory applies.
Let Σ(d) := {(d 1 , ... , d t ) ∈ N t : t ∈ N 0 and d 1 + ... + d t = d} be the set of ordered tuples of positive integers summing to d.Let S ∅ (x) := 1 and for t ∈ N and d := (d 1 , ... , d t ) ∈ Σ(d), define an elementary symmetric polynomial and let S d (G) := S ∅ d (G).So S I d (G) is equal to S d (G I ), up to a scaling factor, where G I := G − i∈[m]∩I V i .Lemma 2.7 Let d be an integer and let d = (d 1 , ... , d t ) ∈ Σ(d).Then (i) S d is uniformly continuous on (P, δ edit ).
are finite polynomials in variables |V n 0 | and S I d (G n,x ) for d ∈ Σ(d) with d ≤ k and I ⊆ N. Indeed, for λ we need only I = ∅; for ∇ •• v 1 v 2 λ we could take only I = ∅, {v 1 }, {v 2 }, {v 1 , v 2 } and their complements, and for ∇ • b,α λ, I = ∅, supp(b) and their complements.Thus, by Lemma 2.7, ∇ •• i 1 i 2 λ and ∇ • b,α λ are P-polynomials.In fact, one can explicitly write these polynomials.For positive integers b 1 ≥ ... ≥ b r , let sym(b 1 , ... , b r ) be the number of permutations of [r] that keep the sequence (b 1 , ... , b r ) unchanged.In other words, if we take i

First, let us 2 yn 3 + n − sn − yn 3 = n 5 s 2 12 (y 3 +
derive a contradiction from assuming that z ≥ 2 5 .Let s := 1 − y − z, so s ≤1  5 .The number of copies of F with at least three vertices in S is at most n The number of copies of F with exactly two vertices in S is at most sn (1 − s − y) 3 ) + O(n 4 ).

1 −s 2 .
So the expression in (21) is at most r(s)n 5 + O(n 4 ) where r(s)