On the maximum running time in graph bootstrap percolation

Graph bootstrap percolation is a simple cellular automaton introduced by Bollob\'as in 1968. Given a graph $H$ and a set $G \subseteq E(K_n)$ we initially"infect"all edges in $G$ and then, in consecutive steps, we infect every $e \in K_n$ that completes a new infected copy of $H$ in $K_n$. We say that $G$ percolates if eventually every edge in $K_n$ is infected. The extremal question about the size of the smallest percolating sets when $H = K_r$ was answered independently by Alon, Kalai and Frankl. Here we consider a different question raised more recently by Bollob\'as: what is the maximum time the process can run before it stabilizes? It is an easy observation that for $r=3$ this maximum is $\lceil \log_2 (n-1) \rceil $. However, a new phenomenon occurs for $r=4$ when, as we show, the maximum time of the process is $n-3$. For $r \geq 5$ the behaviour of the dynamics is even more complex, which we demonstrate by showing that the $K_r$-bootstrap process can run for at least $n^{2-\varepsilon_r}$ time steps for some $\varepsilon_r$ that tends to $0$ as $r \to \infty$.


Introduction
Graph bootstrap percolation was introduced by Bollobás in 1968 [10] under the name weak saturation. For a fixed graph H, a graph G on n vertices is called weakly H-saturated if there is no copy of H in G, but there is an ordering of the missing edges of G so that if they are added one-at-a-time, every added edge creates a new copy of H. Bollobás conjectured that the minimum size of a weakly K r -saturated graph is n 2 − n−r+2 2 . This conjecture was confirmed independently by Alon [1], Frankl [15] and Kalai [18].
Recently, Balogh, Bollobás and Morris [3] observed that weak saturation is strongly related to bootstrap percolation, a dynamical process introduced by Chalupa, Leath and Reich [12] in 1979 to model the behaviour of ferromagnets. In bootstrap percolation on a graph G = (V, E) with infection threshold r 2 we choose a set A ⊆ V of initially "infected" vertices and we declare the remaining vertices "healthy". Then, in consecutive rounds, we infect all healthy vertices with at least r infected neighbours. We say that A percolates if, starting from A as the set of the initially infected vertices, we eventually infect every vertex in V . More precisely, we set A 0 = A and for t = 1, 2, 3, . . . we define where N G (v) is the neighbourhood of the vertex v in G. Hence A percolates if we have ∞ t=0 A t = V (G).
Let us then redefine weak saturation in the language of bootstrap percolation. We fix a graph H and we choose a set G ⊆ E(K n ) of edges that we initially infect. (We shall switch back and forth between thinking of G as a graph and as a set of edges.) Then, in consecutive steps, we infect every e ∈ K n that completes a new infected copy of H in K n . Formally, we take G 0 = G and for t = 1, 2, 3, . . . let G t = G t−1 ∪ {e ∈ E(K n ) : G t−1 + e contains more copies of H than G t−1 }. ( We call this process H-bootstrap percolation and we say that G percolates (or H-percolates) if eventually every edge in K n is infected. Hence, G is weakly H-saturated if and only if it percolates in H-bootstrap percolation and contains no copy of H.
In bootstrap percolation we are usually interested in the following setup: for 0 < p < 1, we initially infect every vertex in V independently at random with probability p. We then look for the critical probability p = p c (G, r) for which percolation is more likely to occur than not. A large number of results, often very sharp, have been obtained in the search for critical probabilities for various graphs G and values of r. To name a few, the values of the critical probabilities p c (Z d , r) for infinite grids were found by van Enter [13] (r = d = 2) and Schonmann [23] (for general r and d). Holroyd [16] and Balogh, Bollobás, Duminil-Copin and Morris [2] obtained sharp bounds on the critical probabilities for finite grids. Various families of random graphs were studied in this context by Balogh and Pittel [6], Janson, Luczak, Turova and Vallier [17] and Bollobás, Gunderson, Holmgren, Janson and Przykucki [11].
An analogous question in graph bootstrap percolation was considered in [3]. There, the authors look at the random graph G(n, p) obtained by choosing every edge of K n independently at random with probability p = p(n). For fixed r, they obtain bounds on the values of p for which G(n, p) is likely to percolate in the K r -bootstrap process.
Another family of problems considered in bootstrap percolation concerns the extremal properties of the process. For example, the size of the smallest percolating sets in various graphs was studied by Pete [5], Balogh, Bollobás, Morris and Riordan [4] and by Morrison and Noel [20]. Morris [19] and Riedl [22] analysed the size of the largest minimal percolating sets for the n × n square grid and the hypercube respectively, both for r = 2. Przykucki [21] and Benevides and Przykucki [7,8] studied the maximum time the infection process on a square grid or a hypercube can take before it stabilizes for r = 2.
In this paper we study a question due to Bollobás [9], who initiated the study of the maximum running time of the graph bootstrap process. Let us define the maximum running time of the K r -bootstrap process to be where G t is defined as in (2). We say that the process stabilizes at time t if t is the smallest integer such that G t = G t+1 . Hence M r (n) is the maximum time the K r -bootstrap process takes before it stabilizes starting from any initially infected graph with n vertices. It is an easy observation that M 3 (n) = ⌈log 2 (n − 1)⌉. Indeed, at every step of the K 3 -bootstrap process, any two vertices at distance two are joined by an edge. Hence, if G t is connected then we have diam(G t+1 ) = ⌈diam(G t )/2⌉. If G t is not connected then the components of G t remain disjoint in G t+1 . Therefore to maximize the time until the process stabilizes we should take G 0 to be a connected graph with as large diameter as possible, i.e., a path on n vertices. It then takes ⌈log 2 (n − 1)⌉ steps until we obtain a clique.
We shall prove two main results.
The rest of this paper is organised as follows. In Sections 2 and 3 we prove Theorems 1 and 2 respectively. We prove Theorem 2 by giving a probabilistic argument showing the existence of initially infected sets of edges satisfying our bound. In Section 4 we give a deterministic construction of an initially infected set that in the K 5 -bootstrap process runs for at least 1 200 n 3/2 time steps before it stabilizes. The construction can be easily adapted for all r 5, always guaranteeing the running time to be at least c r n 3/2 (this is weaker than Theorem 2, but the proof is much simpler). Finally, in Section 5 we discuss some open problems.

Maximum running time in the K 4 -bootstrap process
In this section we prove Theorem 1, that is, we show that M 4 (n) = n − 3 for all n 3. We prove this in two steps: we first give a simple construction to show M 4 (n) n − 3; then we prove the corresponding upper bound. Given a graph G, in this section we define G t as in (2) with H = K 4 . Thus G t is the graph obtained after running the K 4 -process for t steps, starting with the graph G.
Proof. The case n = 3 is trivial. We shall show by induction that for each n 4 there is an n-vertex graph G that stabilizes in time exactly n − 3, for which G n−3 = K n . The base case is trivial taking G = K − 4 , a complete graph on 4 vertices with one edge deleted. Suppose then that n 4 and G is such a graph; it remains to construct a corresponding graph G + on n + 1 vertices. Let xy be any edge of G n−3 \ G n−4 , and let G + = G + xz + yz be formed from G by adding one new vertex, z, and two new edges, xz and yz. Let t n − 3 be the first time that there is a copy of K − 4 present in G + t but not in G t . Until this time, exactly the same edges are added in the percolation processes starting from G and from G + , so G + t = G t + xz + yz. Any K − 4 present in this graph but not in G t must contain z, and hence x, y and one other vertex w. Since the edge zw is missing, xy must be present, so t n − 3. Conversely, since G n−3 is complete, G + n−3 consists of a complete graph on n vertices with an extra vertex z joined to x and to y, and it follows that all edges zw are added in the next step, so G + n−2 is complete, as required.
We now turn to prove the upper bound for Theorem 1 To prove that M 4 (n) n − 3, we prove the following stronger statement by induction. Once we have established it, the upper bound will easily follow.
Lemma 5. Let t 1 and suppose that e = ij ∈ G t \ G t−1 in the K 4 -bootstrap process. Then for some d = d(e) ∈ {0, 1} the edge e is contained in a clique of size t + 3 + d in G t+d .
Proof. We prove the lemma by induction on t. The case t = 1 is immediate. So assume that t 2 and that the statement is true for t − 1. Now suppose that e = ij ∈ G t \ G t−1 . We want to find d(e) ∈ {0, 1} such that e is contained in a clique of size t + 3 + d(e) in G t+d(e) .
The edge ij appears in G t by virtue of some 4-element set K such that i, j ∈ K and (K (2) −ij) ⊆ G t−1 , where K (2) is the complete graph on K. Note that we cannot have (K (2) We consider the following cases.
1. Suppose first that i, j ∈ C. Then we cannot have d(f ) = 0 as this would imply that C induces a clique in G t−1 and hence the edge e is in G t−1 , which contradicts the choice of e. Hence we have d(f ) = 1 and, taking d(e) = d(f ) − 1 = 0, we observe that C induces a clique in G t+d(e) = G t of size (t − 1) + d(f ) + 3 = t + d(e) + 3 = t + 3 that contains i, j. Hence, we are done in this case.
2. Suppose instead that at least one of the vertices i, j is not in C. We further divide this case into two subcases.
(a) If d(f ) = 1 then K and C both induce cliques in G t−1+d(f ) = G t . Since f ∈ K (2) ∩ C (2) , we have |K ∩ C| 2 and, by Observation 4, at time t + 1, K and C will merge to form a single clique of size at least |C| + 1 t + 3 + 1. Hence, we are done choosing d(e) = 1.
(b) If d(f ) = 0 then both K and C induce cliques in G t . If |K ∩C| = 2 then by Observation 4 at time t + 1 they merge to form a complete graph of size |C| + 2 t + 1 + 3 in G t+1 . So again we are done taking d(e) = 1.
If |K ∩ C| = 3 then C contains exactly one endpoint of e. Assume that i ∈ C, j / ∈ C. Since K (2) − e ⊆ G t−1 , j has two neighbours j 1 , j 2 ∈ K ∩ C in G t−1 . This implies that both C and {j, j 1 , j 2 } induce cliques in G t−1 and that they intersect in two points, i.e., in j 1 and j 2 . Hence by Observation 4 we have that C ∪ {j} induces a clique of size |C| + 1 t + 3 in G t . Hence, taking d(e) = 0 we are done. This completes the proof of Lemma 5.
Theorem 1 follows easily from Lemma 5. Let T be the time at which the K 4 -bootstrap process stabilizes starting from an arbitrary graph G = G 0 . For any edge e, let t(e) be the time at which the edge e is added to the infected set. Now for all e ∈ G T , we have that n t(e) + d(e) + 3 since by Lemma 5 we know that G t(e)+d(e) , a graph on n vertices, contains a clique of size t(e) + d(e) + 3. Now since d(e) ∈ {0, 1}, we have This completes the proof Theorem 1.
3 Lower bounds on M r (n) for r 5 In this section we use a probabilistic argument to prove Theorem 2. In other words, taking α r = r−2 ( r 2 )−2 , we show that for every ε > 0 and for n large enough (depending on r and ε) there exists a graph G = G(r, n) such that the K r -bootstrap process started from G stabilizes after at least n 2−αr−ε time steps. Throughout we fix r 5 and ε > 0; all constants in what follows may depend on r and ε. The simplest possible way to construct a graph that takes a fairly long time to stabilize in the K r -bootstrap process is as follows. Start with a chain of K r s that are vertex disjoint except that each shares an edge with the next. More precisely, consider a sequence e 0 , H 1 , e 1 , H 2 , . . . , e t−1 , H t , e t where each H i is a copy of K r , each e i is an edge, and the entire collection of e i s and H j s is vertex disjoint except that both e i−1 and e i are (vertex disjoint) edges of H i . Take G 0 to be the union of all the K r s in the chain, with all edges e i except e 0 deleted. Then, clearly, e i is the unique edge added at step i, and the process stabilizes at time t. Of course, this construction only gives the rather weak lower bound To obtain a stronger bound, the idea is to relax the disjointness conditions, but in a way that will not affect the percolation process. More precisely, by a K r -chain (within K n ) we mean a sequence H 1 , H 2 , . . . , H t where each H s is a complete graph on r vertices (contained within K n ), and H i and H j are edge-disjoint unless |i − j| = 1, in which case they share exactly one edge. Given such a chain we let e i be the edge shared by H i and H i+1 , let e 0 be some edge of H 1 other than e 1 , and let e t be some edge of H t other than e t−1 . Sometimes we describe the chain by the list e 0 , H 1 , e 1 , H 2 , . . . , e t−1 , H t , e t . In this list, the edges e i are distinct, and e i is an edge of H j if and only if i ∈ {j − 1, j}.
Let K − r denote the graph formed by deleting an edge from K r . Given a K r -chain as above, an Proof. Although this is immediate, let us spell out the details. Define G t as in (2), with H = K r . We claim that for i t we have G i = G 0 ∪ {e 1 , . . . , e i }. Clearly this holds for i = 0. Suppose it holds for some 0 i t − 1; then G i is a subgraph of j t H j , so any copy of K − r in this graph has vertex set V (H j ) for some j. Within V (H j ), exactly two edges are missing in G 0 − e 0 , namely e j−1 and e j . Since (by induction) G i contains e k if and only if k i, we have an induced copy of K − r if and only if j = i + 1, so e i+1 is the unique edge added at step i + 1. It follows that G 0 stabilizes at time t.
Our aim is to show that we can fit a very long good K r -chain into a set of n vertices, i.e., to prove the following result. Here and in what follows we ignore rounding to integers when it makes no essential difference.
Theorem 7. Let r 5 and ε > 0 be given, and set If n is large enough, then there is a good K r -chain e 0 , H 1 , e 1 , . . . , e T −1 , H T , e T with T = n 2−αr−ε using at most n vertices in total.
By Observation 6 above, Theorem 7 implies Theorem 2. The rest of this section is devoted to the proof of Theorem 7, for which we use a random construction. We outline this informally before giving the formal proof. Throughout, r 5 and ε > 0 are fixed, n is sufficiently large for various conditions that arise below to hold, and α r and T are defined as in Theorem 7.
We will construct the K r -chain randomly. There is a snag, however: if we follow the obvious method (just pick r − 2 new random vertices each time) then because there are many steps, we are likely to get stuck (create an external K − r ) relatively early, at a point where each individual step is unlikely to cause a problem. Intuitively, we should be able to keep going as long as there is a decent chance that the next step succeeds. To make this precise, we consider a number m = ⌈log n⌉ of attempts at choosing the next r − 2 vertices, and continue if one of these succeeds. Of course this leads to a lot of dependence (which choice succeeds depends on what happened at previous steps). But we can get around this in the analysis by considering all possible ways that our choices could lead to an external K − r . Outline construction. Let e 0 be a uniformly random edge in K n . For 1 t T and 1 a m, let X t,a be a uniformly random set of r − 2 vertices of K n , and e t,a a uniformly random edge within X t,a , with these choices independent over all t and a. For t running from 0 to T − 1 do the following: pick an index a = a t+1 so that certain conditions specified later hold (if this is possible), set X t+1 = X t+1,a and e t+1 = e t+1,a , and let H t+1 be the complete graph on e t ∪ X t+1 .
We think of X t+1,a as the ath candidate set of new vertices in step t + 1, and X t+1 as the selected set; similarly, e t+1,a is a candidate next edge in the chain, and e t+1 the actual next edge. A candidate set X t+1,a is successful if it satisfies certain conditions (C0)-(C4) below. Later we shall write F t+1 for the event that our construction fails at step t + 1, in the sense that none of the candidates X t+1,a for X t+1 is successful. We write for the 'good' event that the construction succeeds up to (at least) step t.
The first of the conditions referred to above is This condition ensures that e t ∪ X t+1 is indeed a set of r vertices. We shall always write G t = 1 s t H s for the graph constructed so far. By a new i-set of vertices we mean a set of i 2 vertices of H t+1 not all contained in e t . Note that any 'new' edge in the chain (i.e., edge present in G t+1 but not in G t ) is a new 2-set. Our second condition is the following: No new 2-set is contained in any H s , s t.
If conditions (C0) and (C1) hold at each step t ′ t, then e 0 , H 1 , e 1 , . . . , H t , e t is a K r -chain: each H s is a complete graph on r vertices, and for i < j (using (C1) at step j) we see that H i and H j are edge-disjoint unless j = i + 1, in which case they share only one edge, e i . Given a set A of vertices, we write K A for the complete graph with vertex set A, i.e., the graph (A, A (2) ). For 2 i r − 1, we say that a set A of i vertices is dangerous at time t (or sometimes just dangerous) if there is a set B of r vertices with A ⊂ B and B = V (H s ) for all s t such that the graph G t ∪ K A includes all but at most one of the edges within B. In other words, A is dangerous if adding all edges within A would create an external K − r . The next condition involves avoiding such sets A: (C2) Proof. As noted above, (C0) and (C1) ensure that we get a K r -chain. Suppose it is not good. Then at some step t an external K − r must have been generated. Let its vertex set be B. Clearly, But then A was dangerous at step t − 1, so condition (C2) did not hold.
If steps 1, 2, . . . , t succeed, i.e., G t holds, then by definition conditions (C0)-(C2) were satisfied at steps 1, . . . , t. Hence Our aim is to show that with positive probability, we can satisfy conditions (C0)-(C2) above. Since our construction is inductive, when considering the candidates for X t+1 we may assume that G t holds.
A key step in our proof is to show that there are not too many dangerous i-sets. More generally, we shall show that for any graph F with r vertices, if we exclude copies arising inside a single H s , it is unlikely that G t contains many more copies of F than a random graph with the same overall edge density as G t . To show this, we fix a set A of r vertices, and think about all possible ways that the chain H 1 , H 2 , . . . , H t can meet A, considering only cliques H s that contribute an edge within A, i.e., satisfy |V (H s ) ∩ A| 2. Since successive K r s in the chain are related in a different way from those further apart, we shall split the set of K r s in the chain that meet A into subchains. This (hopefully) motivates the following definition.
Let A be a set of r vertices. By a chain within A we mean a sequence (S 1 , . . . , S k ) of subsets of A such that By a (partial) chain cover C of A we mean a sequence (S 1 1 , . . . , S 1 k 1 ), (S 2 1 , . . . , S 2 k 2 ), . . . , (S ℓ 1 , . . . , S ℓ k ℓ ) of chains within A. Such a chain cover is minimal if every S j i spans some edge not spanned by any other set S j ′ i ′ in the chain cover. Clearly, a minimal chain cover contains at most r 2 sets S j i in total, so there are a finite number (depending on r) of minimal chain covers of any r-set A. Also, if C is minimal, then each of its constituent chains is minimal in the natural sense (i.e., as a chain cover with one chain).
The cost of a chain C = (S 1 , . . . , S k ) is informally corresponding to the number of 'new' vertices in the chain. The edge set For a chain cover C = (C 1 , . . . , C j ) we define its cost and benefit by c(C) = c(C i ) and b(C) = b(C i ). (For b(C) it might be more natural to take the total number of edges without repetition; this makes no difference in the argument below.) Given a set A of r vertices and a chain cover C = ((S 1 1 , . . . , S 1 k 1 ), (S 2 1 , . . . , S 2 k 2 ), . . . , (S ℓ 1 , . . . , S ℓ k ℓ )) of A, we say that our random K r -chain H 1 , . . . , H t meets A in C if there exist 0 t 1 < · · · < t ℓ such that t j + k j t j+1 − 1 for each 1 j ℓ − 1 and t ℓ + k ℓ t, and V (H t j +i ) ∩ A = S j i for each j ℓ and 1 i k j . In other words, our K r -chain contains ℓ intervals of consecutive K r s, the jth running from time t j + 1 to time t j + k j , with gaps between the intervals, so that in each interval the intersections of the K r s with A form the jth chain of C. Proof. Simply consider a minimal subset of the cliques H s that between them contain all e edges of G t inside A, and split this set of cliques into intervals with gaps of at least one between them. Each of these H s shares at least two and at most r − 1 vertices with A, and consecutive H s meet in at most two vertices, since G t holds so (H 1 , . . . , H t ) is a K r -chain.
Lemma 10 and its consequence Corollary 11 below are key to our analysis; the latter says, roughly speaking, that the 'easiest' way for a random K r -chain of length T to cover a set A to form an external K − r (or some other graph F ) is by meeting it r 2 − 1 times (e(F ) times) in non-consecutive cliques H i , each time in just one edge. This condition is loosely analogous to the '2-balanced' condition that appears in many small subgraph problems. We start by showing that for a single chain, a certain 'cost-benefit ratio' is maximized in the single-edge case.
Lemma 10. Let A be a set of r vertices, and C = (S 1 , . . . , S k ) a minimal chain within A. Then Proof. Recalling the definition of α r , and writing b = b(C) and c = c(C), the inequality claimed can be rewritten as Now | S i | c, and b = | S is an equality for c = 2, and is easily seen (by multiplying out) to hold (strictly) for c = r − 1. Hence (since the left-hand side is convex and the right-hand side linear) it holds for 2 c r − 1; since b c 2 this proves (4) in these cases. For c r + 1 we use the trivial bound b r 2 ; it is easy to check that this implies (4) in this case. This leaves only the case c = r. In this case (4) reduces to b r 2 − 1, i.e., we must show that if c(C) = r then there is at least one edge in A (2) missing from E(C). To see this, recall first that |S i | r − 1 by definition, so k 2. Also, if | S i | < c = r, then clearly b(C) r−1 2 < r 2 − 1. Hence, we may assume that S i = A and that only consecutive sets S i meet. By minimality there is some u ∈ S 1 \ S 2 , and some v ∈ S k \ S k−1 . But then uv / ∈ E(C) and we are done.
Remark. We don't need it here, but in fact we have strict inequality in the result above unless k = 1, c = 2 and so b = 1. To see this we must show in the final case above that at least two edges are missing, which is not hard.
Corollary 11. Let C be a minimal chain cover of some r-set A consisting of ℓ chains and having total cost c and benefit b. Then T ℓ n −c n −αrb−ε . Proof.
Applying Lemma 10 to each chain C i and summing, we see that α r (b − ℓ) c − 2ℓ. Rearranging gives The result follows recalling that T = n 2−αr−ε and noting that ℓ 1. denote the event that there are indices a t , . . . , a t+k such that if we set V s = e s−1,a s−1 ∪ X s,as for s = t + 1, . . . , t + k, then we have V t+j ∩ A = S j for j = 1, . . . , k. In other words, [A, t, C] is the event that it is conceivable (considering all a priori possible choices for which candidate set/edge is chosen at each step) that the consecutive K r s H t+1 , . . . , H t+k meet A in the chain C. Recalling the definition of c(C), we see that for this event to hold, we need c of the relevant candidate vertices to fall in A. Taking a union bound over the choices of a t , . . . , a t+k , and noting that (by minimality), k is bounded (by r 2 , say), we see that for some constant M k,r depending on k and r. Here, as usual, the O * notation hides powers of log n that (with r fixed) are bounded. For C = (C 1 , . . . , C ℓ ) a minimal chain cover of A with each chain C j having length k j , let B A,C be the event that there exist 0 t 1 < t 2 < · · · < t ℓ such that t j +k j t j+1 −1 for each 1 j ℓ−1 and t ℓ + k ℓ T , and [A, t j , C j ] holds for j = 1, 2, . . . , ℓ.
Note that if the K r -chain (H s ) t s=1 meets A in C, then B A,C holds. Indeed, informally speaking, B A,C is the event that is it conceivable that our chain might meet A in C. The advantage of working with B A,C is that it avoids the complicated dependence introduced by the rule for selecting which attempt at the next K r becomes the actual next K r .
Since [A, t j , C j ] depends only on the random variables X t,a , t j t t j + k j , 1 a m, with C and the t j fixed the ℓ events appearing in (6) are independent. Hence, using (5) and summing over the at most T ℓ choices for t 1 , . . . , t ℓ , we have where the final step follows from Corollary 11.
For 1 e r 2 , let B A,e be the event that there exists some minimal chain cover of A with b(C) e such that B A,C holds. Since there are O(1) minimal chain covers of A, we see that By Observation 9, for any t T , if G t holds and A spans at least e edges in G t = s t H s , with A = V (H s ) for each s t, then B A,e holds. This allows us to prove our key lemma on the number of dangerous i-sets.
Recall that a set A of i vertices is dangerous at time t if adding all edges inside A to G t would create an external copy of K − r (or of K r ) with vertex set B ⊃ A. We will consider the 'bad' event Proof. For 2 i r − 1 let Y t,i denote the number of dangerous i-sets at time t. Let Z i denote the number of r-sets A such that B A,e i holds, where e i = r 2 − 1 − i 2 . If G t holds and an i-set A ′ is dangerous at time t, then it is contained in an r-set A, not the vertex set of any H s , s t, such that A spans at least e i edges in G t . But then as noted above B A,e i holds. Since a particular r-set can be responsible for at most r i 2 r i-sets being dangerous, it follows that, for any t T , if G t holds then Y t,i 2 r Z i . Thus it suffices to show that for each i. We claim that, for 2 i r − 1, we have This holds for i = 2 by definition of α r . For i = r − 1 it simplifies to 1 α r (r − 2) and hence to (r − 2) 2 r 2 − 2, which is easily seen to hold for r 5. Hence, by convexity, (9) holds for all 2 i r − 1. By (7) we have But then, by (9), E[Z i ] = o(n i−ε/2 ), and (8) follows by Markov's inequality.
Lemma 12 shows that one 'global bad event' is unlikely. The next lemma considers another, much simpler one.
Lemma 13. Suppose that r 5 and ε > 0, and define T = n 2−αr−ε as usual. Let B 2 t be the event that the maximum degree of G t is at least n 1−ε . Then P( t T B 2 t ) = o(1).
Proof. Suppose that a vertex v has degree at least n 1−ε in some G t . Then v must be in (crudely) at least n 1−ε /r of the cliques H s , s t, and hence in at least n 1−ε /(2r) of the selected sets X s . Thus, v is in at least n 1−ε /(2r) of the candidate sets X s,a , 0 s T , 1 a m. For each v, let N v be the number of these candidate sets that contain v. Then N v has a binomial distribution with mean m(T + 1)(r − 2)/n = O * (n 1−αr−ε ) = o(n 1−ε /(2r)). Thus the probability that N v n 1−ε /(2r) is exp(−Ω(n 1−ε )) = o(n −100 ), say, and the probability that there exists such a v is o(1).
After this preparation we are now ready to prove Theorem 7.
Proof of Theorem 7. As above, we fix r 5 and ε > 0, and define m = ⌈log n⌉ and T = n 2−αr−ε , where α r = (r − 2)/( r 2 − 2). We consider the outline construction described above, saying that a candidate choice X t+1,a for X t+1 is successful if it satisfies conditions (C0)-(C2) above, and (C3) and (C4) below. At each step t + 1 T we choose a successful candidate for X t+1 if there is one, otherwise, our construction fails at step t + 1.
Let F t be the (finite, of course) σ-algebra generated by (X s,a ) s t, a m , i.e., by all information 'revealed' by time t. Our key claim is that for 0 t T − 1 we have P( candidate X t+1,1 succeeds | F t ) 99/100 (10) whenever all previous steps have succeeded, and neither B 1 t nor B 2 t holds. Suppose for the moment that this holds; we shall see that Theorem 7 easily follows. Indeed, because the X t+1,a are independent of each other and of F t , and identically distributed, if (10) holds, then recalling that F t+1 denotes the event that our construction fails at step t + 1, we have Since this latter event is F t -measurable, it follows that But then, considering the least t for which using Lemmas 12 and 13. Hence, with probability 1−o(1) > 0 (for n large enough), the construction succeeds for T steps. Then, as noted above, the fact that conditions (C0)-(C2) are satisfied implies that we construct a good K r -chain of the required length. It remains only to establish (10). From now on, we condition on F t (i.e., on all X s,a , s t), and assume that our construction succeeded at steps 1, . . . , t and that neither B 1 t nor B 2 t holds. The only relevant randomness remaining is the uniform choice of X t+1,1 from all sets of r − 2 vertices. Let E i be the event that X t+1,1 fails to satisfy condition (Ci). To establish (10) it suffices to show that P(E i ) = o(1), i = 0, . . . , 4. Clearly, P(E 0 ) = 1 − n−2 r−2 / n r−2 = o(1).
The case i = 1 is also easy. If E 1 holds then either (i) X t+1,1 includes two vertices forming an edge uv of G t or (ii) for some vertex u of e t , X t+1,1 includes a vertex v such that uv ∈ E(G t ). The first event has probability at most r−2 2 e(G t )/ n 2 = O(e(G t )n −2 ) = O(T n −2 ) = o(1). Since B 2 t does not hold and there are only two choices for u, the second has probability O(∆(G t )/n) = o(1). Before turning to the details, let us outline the argument for E 2 . If E 2 holds, then for some 0 j 2 and 1 i r − 2 with i + j < r, some subset of V (e t ) of size j and some subset of X t+1,1 of size i combine to form a dangerous set of size i + j. The case j = 0 will cause no problems, since we assume B 1 t does not hold, so there are o(n i ) dangerous sets of size i. (This is analogous to (i) above.) For j > 0, we will have a problem only if some subset J of V (e t ) of size j is in Θ(n i ) dangerous (i + j)-sets. To avoid this, we consider a further condition For each j = 1, 2 and i 1 with i + j < r, no set of j vertices of X t+1,a is contained in more than n i−ε/4 dangerous (i + j)-sets at time t.
(C3) This is not quite what we need, however; we would like to use this condition one step earlier to say that e t ⊂ X t has the properties we want. The problem is that condition (C3) having been satisfied by X t only tells us that subsets of e t are not in many sets that were dangerous at time t − 1, rather than at time t. On the other hand, the bound n i−ε/4 in condition (C3) is much stronger than the bound o(n i ) that we need. So we will be able to deal with this 'off-by-one' problem by showing that not too many sets become dangerous in one step. To make this argument work we will need one final condition. We say that a set A of vertices with 2 |A| r − 1 is deadly at time t if there is a set B of r vertices with A ⊂ B such that G t ∪ K A contains all edges within B, with B not equal to V (H s ) for any s t. Note that a deadly set is dangerous.
For j ∈ {2, 3}, no set of j vertices of e t ∪ X t+1,a containing at most one vertex of e t and at least one vertex of X t+1,a is contained in more than n 1−ε/8 deadly (j + 1)-sets at time t. (C4) As noted above, it remains only to show that P(E i ) = o(1) for i = 2, 3, 4. Before doing this, we establish some deterministic consequences of our conditions (C0)-(C4), i.e., of succeeding with our choice at step t + 1. In the following we assume that n is large enough, depending on the constant c. Claim 1. Let c > 0 be any positive constant. If the candidate X t+1,1 satisfies conditions (C0)-(C4), then for j = 1, 2 and each i 1 with i + j < r, every set J of j vertices from X t+1,1 is in at most cn i (i + j)-sets that are dangerous at time t + 1.
Proof. Suppose the claim fails for some i, j and J. Because condition (C3) is satisfied, we see that there are Θ(n i ) i-sets I such that I ∪ J is dangerous at time t + 1 but not at time t. Since H t+1 = K et∪X t+1,1 contains r = O(1) vertices and ∆(G t+1 ) ∆(G t ) + r − 1 = o(n) by our assumption that B 2 t does not hold, there are Θ(n i ) of these sets I with the additional property that no vertex in I is in H t+1 , or is adjacent in G t+1 to any vertex in H t+1 . For each such set I, by the definition of dangerous there is an r-set A ⊃ I ∪ J such that G t+1 ∪ K I∪J contains all but at most one of the edges within A. Furthermore, since I ∪ J is not dangerous at time t, there is such a set A such that G t+1 \ G t includes at least one edge within A but not within I ∪ J. In particular, A \ (I ∪ J) contains at least one vertex of H t+1 . Let L = V (H t+1 ) ∩ (A \ (I ∪ J)), so L = ∅.
By choice of I, there are no edges from I to H t+1 in G t+1 . Hence there are no edges from I to L in G t+1 . Since I, J and L are disjoint, in G t+1 ∪ K I∪J there are still no edges from I to L. Hence, in this final graph, there are at least |I||L| missing edges inside A; as at most one edge is missing, we conclude that |I| = |L| = 1. Furthermore, the only missing edge in A in G t+1 ∪ K I∪J is the I-L edge. Hence in G t+1 ∪ K I∪J∪L the set A is complete. Since V (H t+1 ) ∩ A = J ∪ L, we see that A is also complete in G t ∪ K I∪J∪L , so I ∪ J ∪ L is deadly at time t. Note that |I ∪ J ∪ L| = j + 2 < r.
Since we find one such deadly set I ∪ J ∪ L for each of Θ(n) choices for I (recall that now i = 1), and there are at most r choices for L, we see that some set J ∪ L of j + 1 = 2 or 3 vertices of H t+1 (with at most one in e t , namely that in L) is contained in Θ(n) deadly (j + 2)-sets I ∪ J ∪ L. But this violates our assumption that condition (C4) holds, completing the proof of the claim. Claim 2. If the candidate X t+1,1 satisfies conditions (C0)-(C4), then for i ∈ {2, 3} each vertex of X t+1,1 is contained in at most 2n i−ε/4 deadly (i + 1)-sets at time t + 1.
Proof. The proof is very similar to that of Claim 1. Adopting similar notation, if the claim fails there is some i ∈ {2, 3} and some singleton set J = {u} ⊂ X t+1,1 such that there are 2n i−ε/4 i-sets I disjoint from J with I ∪ J deadly at time t + 1. Since condition (C3) holds and a deadly set is dangerous, at least n i−ε/4 of these sets I are such that I ∪ J is deadly at time t + 1 but not at time t. As before, since ∆(G t+1 ) = O(n 1−ε ) = o(n 1−ε/4 ), we may find Θ(n i−ε/4 ) > 0 such sets I which are disjoint from H t+1 and send no edges to H t+1 in the graph G t+1 . Fix any such I. Then there is an r-set A ⊃ I ∪ J such that G t+1 ∪ K I∪J contains all edges in A with (as before) L = V (H t+1 ) ∩ (A \ (I ∪ J)) non-empty. (Otherwise I ∪ J was deadly at time t also.) Since L ⊂ V (H t+1 ), by choice of I there are no I-L edges in G t+1 , so the I-L edges (of which there is at least one) are missing in G t+1 ∪ K I∪J also, a contradiction.
We now show that for k = 2, 3, 4 the probability of the event E k that our first candidate X t+1,1 fails to satisfy condition (Ck) is o (1). Recall that we are assuming that our algorithm succeeded at earlier steps and that neither B 1 t nor B 2 t holds. If condition (C2) fails then for some 0 j 2 and 1 i r − 2 with i + j < r there is an i-element subset I of X t+1,1 and a j-element subset J of e t such that I ∪ J is dangerous (at time t). For j = 0, since B 1 t does not hold, there are o(n i ) dangerous i-sets in G t . The probability that X t+1,1 includes any given one is O(n −i ), so the probability that such I, J exist with j = 0 is o(1). For j ∈ {1, 2}, applying Claim 1 with t replaced by t − 1 (for t > 0; for t = 0 there is no problem), we see that for each j-element subset J of e t ⊂ X t there are o(n i ) i-sets I such that I ∪ J is dangerous. It follows that P(E 2 ) = o(1).
Turning to E 3 , fix j ∈ {1, 2} and i 1 with i + j < r. Call a j-set bad if it is in at least n i−ε/4 (i + j)-sets that are dangerous at time t. Since at most n i+j−ε/2 (i + j)-sets are dangerous at time t, there are at most i+j j n j−ε/4 = O(n j−ε/4 ) bad j-sets. For condition (C3) to fail, X t+1,1 must contain such a bad j-set, an event of probability O(n j−ε/4 n −j ) = o(1).
Finally, we turn to E 4 ; the argument is somewhat similar to that for E 2 . Firstly, as B 1 t does not hold and a deadly set is dangerous, there are at most (j + 1)n j−ε/4 j-sets J with the property that J is contained in more than n 1−ε/4 deadly (j + 1)-sets at time t. Hence the probability that X t+1,1 contains such a j-set is O(n j−ε/4 /n j ) = o(1). For j = 2, 3 it remains to bound the probability that for some vertex v of e t , the set X t+1,1 contains a (j − 1)-set J such that J ∪ {v} is in more than n 1−ε/8 deadly (j + 1)-sets. This probability is o(1) as required unless v is in Θ(n j−1 ) j-sets each contained in more than n 1−ε/8 deadly (j + 1)-sets. But if this holds, v is in Θ(n j−ε/8 ) deadly (j + 1)-sets. Since v ∈ e t ⊂ X t , this contradicts Claim 2 applied at time t − 1.

Deterministic constructions
In this section we present a deterministic algorithm that constructs an initially infected set which stabilizes after at least 1 200 n 3/2 time steps in the K 5 -bootstrap process. This construction generalizes immediately to any r 6 to obtain graphs that stabilize after at least c r n 3/2 time steps in the K r -bootstrap process. The result is not as strong as Theorem 2, but the proof, in addition to being deterministic, is much simpler, and may perhaps be of independent interest.  (5) and distinct e 0 = {1, 2}, e 1 , . . . , e t ∈ [n] (2) with the following properties: √ n.
Proof. Let us define the neighbourhood N (u) of u ∈ [n] to be Also define the second neighbourhood of u to be Notice that u ∈ N (u) ⊆ N 2 (u). Also, if for all u ∈ [n] we have deg(u) ∆, then |N 2 (u)| < 25∆ 2 . Let us proceed by induction on t. Assume that we have sets A 1 , . . . , A t−1 , and pairs e 0 = {1, 2}, e 1 , . . . , e t−1 , satisfying the lemma. We want to find some A t and e t while t < cn 3/2 . Let e t−1 = {u, v}. We shall take A t = e t−1 ∪ {w 1 , w 2 , w 3 } for some distinct w 1 , w 2 , w 3 / ∈ e t−1 , and then set e t = {w 1 , w 2 }. Now we choose the w i , one at a time, so that, for i = 1, 2, 3, the vertex w i is not contained in where in defining N 2 (·) we include the set A t = {u, v, w 1 , . . . , w i−1 }. By the condition on the degrees of all vertices, Choosing w i that does not belong to any of the above second neighbourhoods ensures that there are no external triangles formed by the addition of A t and that |A t ∩ A j | 1 for all j t − 2.
By (11), if the maximum degree of a vertex is at most 1 20 √ n, then there are at least 1 2 n possible choices for each of w 1 , w 2 , w 3 . Now, for each i = 1, 2, 3, choose w i to be the vertex with the smallest degree among these choices. If this choice makes the degree of w i larger than 1 20 √ n, then all of these 1 2 n vertices have degree at least 1 20 √ n. Hence there are at least T = 1 200 n 3/2 sets in A. This completes the argument.
Let us show how to turn the set system A into a graph that has a long running time in the K 5bootstrap process. For T = 1 200 n 3/2 , given A and e 1 , . . . , e t as defined above, we define G ⊆ E(K n ) to be Let us run the K 5 -bootstrap process starting from G. We claim that it takes T steps before this process stabilizes. Let A be a set system on [n] and let G ⊆ E(K n ). We say that G is covered by A if every edge e ∈ G is contained in some set A i ∈ A. We say that G is simply covered by A if there exists some A i ∈ A such that e ⊆ A for every e ∈ G. The following observation follows immediately from the third condition in Lemma 14.
Observation 15. For any distinct u, v, w ∈ [n], if A covers {u, v, w} (2) then it simply covers it.
Lemma 16. Let G 0 = G be defined as in (12). Then for all 1 t T we have G t \ G t−1 = {e t }.
Proof. Suppose that the lemma is false and let t ′ 1 be the first time when G t ′ \ G t ′ −1 = {e t ′ }. Hence, for all 1 t < t ′ we have G t \ G t−1 = {e t }. Clearly A t ′ induces a K − 5 in G t ′ −1 because e t ′ −1 ∈ G t ′ −1 and, by the definition of A, all edges {e 1 , . . . , e T } are distinct which implies that e t ′ / ∈ G t ′ −1 . Hence we have e t ′ ∈ G t ′ \ G t ′ −1 and, by the definition of t ′ , we must have some e = e t ′ such that e ∈ G t ′ \ G t ′ −1 .
If e is included at time t ′ then it appears by virtue of some K − 5 that is contained in G t ′ −1 . If there was no A i that induced all the edges of this K − 5 in G t ′ −1 then, since G t ′ −1 is a subset of i , the set system A would would cover a triangle that it would not simply cover. That would contradict Observation 15.
Hence e = e k for some k > t ′ . However, only two sets in A contain e k namely, A k and A k+1 . By the definition of t ′ we have e k−1 , e k , e k+1 / ∈ G t ′ −1 therefore both A k and A k+1 induce 5 2 − 2 edges in G t ′ −1 . Hence it is impossible that e k ∈ G t ′ \ G t ′ −1 .
Lemma 16 immediately implies that the K 5 -bootstrap process starting from G stabilizes after at least 1 200 n 3/2 time steps.

Open problems
In this paper we considered the problem of finding the maximum running time of the K r -bootstrap process. For r 5 the exact answer remains to be found and it is the obvious open problem in this direction. In the proof of Theorem 2 we were a little careless with the o(1) term in the exponent; a more careful version of the argument will give a slightly stronger bound (presumably n 2−αr divided by some power of log n), but still o(n 2−αr ). It seems unlikely that any random construction of this type can go (significantly, if at all) beyond n 2−αr , since at this point, in a random graph with the relevant number of edges, many missing edges e have the property that adding e would create a K − r . It is tempting to think that therefore M r (n) = n 2−αr+o(1) for r 5, but we have no real reason to believe this. Instead, since proving any non-trivial upper bound on M r (n) is open for r 5, we make the following much weaker conjecture. The following evidence supports Conjecture 1 for r = 5. We should expect that if the process runs for a long time then the infection spreads in a "controlled" way, i.e., most of the time the infection of one edge completes just one infected copy of K − 5 , which on the next step again infects only one new edge. For this to happen, the resulting copies of K 5 in the infected graph should not be packed "too tightly", to prevent the infection spreading out of control. The third condition in Lemma 14, about the lack of external triangles, itself implies that we must have T = o(n 2 ) (see Theorem 1.7 in Erdős, Frankl, Rődl [14]). This condition is more strict than that which a graph on which the infection spreads in a controlled way needs to satisfy. However, if G t contains two infected copies A 1 , A 2 of K 5 that share an edge {u, v}, and an additional infected edge {w, z} for some w ∈ A 1 , z ∈ A 2 (hence both {u, v, w} and {u, v, z} induce external triangles), then it is easy to check that the 8 vertices containing A 1 ∪ A 2 induce a K 8 in G t+2 . This situation seems difficult to avoid if the process is meant to run for at least αn 2 steps for some α > 0.