Let \delta = \min\{\delta_{\ref{thm_cleanstage1}}(\gamma)/2, 3/4\}. Without loss of generality, we may assume that \varepsilon \leq 2/\delta. Furthermore, let \varepsilon_3 = \varepsilon_{\ref{prop_typicalstability}}(\varepsilon, 2\delta), \varepsilon_1 = \min\{\varepsilon\delta^2/1180, \varepsilon_3\delta^2/40\}, \varepsilon_2 = \min\{\varepsilon_{\ref{prop_manygoodvertices}}(\varepsilon_1, 2\delta), \varepsilon_{\ref{thm_cleanstage1}}(\gamma), \varepsilon_{\ref{lemma_randommatching}}(\delta), \varepsilon/2\}, and \xi = \xi_{\ref{thm_cleanstage1}}(\varepsilon_2)/2.
Let \eta = 12\varepsilon_1/\delta^2.
Moreover, let
D = (6/\xi) \max\{D_{\ref{thm_cleanstage1}(\varepsilon_2)}, D_{\ref{prop_nontypicalvertices} (ii)}(1/4, \varepsilon_1\xi), D_{\ref{prop_randomgraphproperties2}}(\varepsilon_1\varepsilon_2 \delta^3\xi^2/4, 1/4) \}
and C = \max\{ C_{\ref{thm_cleanstage1}}(\varepsilon_2), C_{\ref{prop_smallexpansion}}(3\varepsilon_1\xi) \}.
By Theorem 5.2, there exists a further subgraph G' of G whose vertex set can be partitioned into sets B_0, S_0, and (W_i)_{i=1}^{3k} such that |B_0| \leq (D/2)p^{-2}, G[S_0] contains a perfect triangle packing, and for all t \in \{1, \ldots, k\}, the triple (W_{3t-2}, W_{3t-1}, W_{3t}) is (2\delta, \varepsilon_2, p)-super-regular in G' and satisfies |W_{3t-2}| = |W_{3t-1}| = |W_{3t}|. Moreover, the endpoints of no edge in (W_{3t-2}, W_{3t-1}) have more than 4|W_{3t}|p^2 common neighbours in W_{3t} (and a similar statement holds for other choices of indices). We will show that each such triple contains a slightly smaller (\delta, \varepsilon, p)-strong-super-regular triple in such a way that all but at most O(p^{-1}) leftover vertices can be covered by vertex-disjoint triangles. Obviously, this will imply the assertion of the theorem.
Without loss of generality, we will only consider the triple (W_1, W_2, W_3). For the sake of brevity, let m = |W_1| = |W_2| = |W_3| and note that m \geq 2\xi n. Without loss of generality, we can condition on the event that G(n,p) satisfies the assertions of
Proposition 4.2 (ii) with \rho = 1/4 and \xi = \varepsilon_1m/n,
Proposition 4.4 with \varepsilon = \varepsilon_1\varepsilon_2\delta^3m^2/(4n^2), and \rho = 1/4, and
Proposition 4.3 with \xi = 6\varepsilon_1m/(2n).
For each i, let X_i \subset W_i be the collection of vertices that are not \varepsilon_1-good. By Proposition 2.13, |X_i| \leq \varepsilon_1 m and we may assume that
|X_i| = \varepsilon_1 m. We perform the following cleaning-up procedure. While constantly updating the sets X_1, X_2, and X_3, repeat the following. If there exists an i and a vertex v \in W_i \setminus X_i such that either
(A)
|N(v) \cap X_j| \geq 4\varepsilon_1pm for some j or
(B)
the neighbourhood of v contains more than \varepsilon_2d_{12}d_{13}d_{23}p^3m^2 edges whose endpoints have more than 5\varepsilon_1p^2m common neighbours in X_i,
then move v to X_i.
CLAIM.
The cleaning-up procedure finishes with \varepsilon_1 m \le |X_i| \leq 3\varepsilon_1m for all i.
Proof.
Suppose that at some point in time, |X_i| > 3\varepsilon_1m for some i, and consider the earliest such moment. Without loss of generality, we may assume that i = 1. Clearly, 3\varepsilon_1m < |X_1| \leq 4\varepsilon_1m and |X_j| \leq 3\varepsilon_1m if j \neq 1. Since at the beginning, every X_1 contained at most \varepsilon_1m vertices, W_1 contains either \varepsilon_1m vertices satisfying (A) or \varepsilon_1m vertices satisfying (B). The former is impossible, since |X_j| \leq 3\varepsilon_1m for j \neq 1 and we assumed that G(n,p) satisfies the assertion of Proposition 4.2 (ii) with \xi = \varepsilon_1m/n. Since the endpoints of each edge in (W_2, W_3) have at most 4p^2m common neighbours in W_1, the latter would imply that (W_2, W_3) contains
(\varepsilon_1 m) \cdot (\varepsilon_2 d_{12}d_{13}d_{23}p^3 m^2) / (4p^2m) \ge (\varepsilon_1\varepsilon_2\delta^3/4)pm^2
edges whose endpoints have more than 5\varepsilon_1p^2m common neighbours in X_1. Since |X_1| \leq 4\varepsilon_1m, this is impossible by our assumption that G(n,p) satisfies the assertion of Proposition 4.4 with \varepsilon = \varepsilon_1\varepsilon_2\delta^3m^2/(4n^2), and \rho = 1/4.
It is not hard to check that (W_1 \setminus X_1, W_2 \setminus X_2, W_3 \setminus X_3) is (\delta/2, \varepsilon', p)-strong-super-regular. Unfortunately, this conclusion does not help us at the moment as we first need to absorb X_1 \cup X_2 \cup X_3 into vertex-disjoint triangles and in the process of absorbing those vertices, we may use some vertices from the triple (W_1 \setminus X_1, W_2 \setminus X_2, W_3 \setminus X_3).
For every i, let Y_i \subset X_i be the set of vertices in X_i that have more than 4\varepsilon_1pm neighbours in X_j for some j with j \neq i. Since |X_j| \leq 3\varepsilon_1m and we assumed that G(n,p) satisfies the assertion of Proposition 4.2 (ii) with \xi = \varepsilon_1m/n, then |Y_i| \leq Dp^{-1}/(6k). By adding arbitrary vertices of X_i to Y_i, we can guarantee that |Y_1| = |Y_2| = |Y_3|. For every i and j, let E_{ij} = (X_i, W_j) \cup (W_i, X_j). Since (W_i, W_j) is (\varepsilon_2, p)-regular and |X_i| \ge \varepsilon_1 |W_i| \ge \varepsilon_2 |W_i|, we have
|E_{ij}| \leq (d_{ij}+\varepsilon)p(|X_i||W_j|+|W_i||X_j|) \leq (1+\varepsilon/\delta)6\varepsilon_1d_{ij}pm^2 \leq \eta d_{ij}pm^2.
Fix a vertex v \in W_i \setminus Y_i. We check that (A2) in Lemma 6.1 is satisfied. Let (N''_j, N''_k) be as in (A2) in Lemma 6.1. Since |N''_j \cap X_j| \leq |N(v) \cap X_j| \leq 4\varepsilon_1pm and similarly, |N''_k \cap X_k| \leq 4\varepsilon_1pm, we have
|E_{jk} \cap (N''_j, N''_k)| \leq 4\varepsilon_1pm (2d_{ij}d_{jk}p^2m + 2d_{ik}d_{jk}p^2m) \leq (16\varepsilon_1/\delta) d_{ij}d_{ik}d_{jk}p^3m^2 \leq \eta d_{ij}d_{ik}d_{jk}p^3m^2.
Lemma 6.1 implies that a.a.s. for each i and j, there exists an M_{ij} \subset (W_i \setminus X_i, W_j \setminus X_j) such that (M1)–(M4) in Lemma 6.1 are satisfied with V_i = W_i and V'_i = W_i \setminus Y_i for each i. Let Q_i be defined as in Lemma 6.1.
CLAIM.
The sets X_1 \setminus Y_1, X_2 \setminus Y_2, and X_3 \setminus Y_3 can be covered by vertex-disjoint triangles that use only vertices in Q_1 \cup X_1, Q_2 \cup X_2, and Q_3 \cup X_3.
Proof.
Since M_{12} \cup M_{13} \cup M_{23} is a matching whose edges are not incident to any vertex in X_1 \cup X_2 \cup X_3, it suffices to show that for each i, j, and k, the vertices of X_i \setminus Y_i can be paired with some |X_i \setminus Y_i| edges of M_{jk} to form vertex-disjoint triangles.
Let H be the bipartite graph on the vertex set (X_i \setminus Y_i) \cup M_{jk}, where a vertex w \in X_i \setminus Y_i is adjacent to an edge \{u, v\} \in M_{jk} if and only if \{u, v, w\} is a triangle in (W_1, W_2, W_3). Clearly, it suffices to prove that H contains a matching that covers X_i \setminus Y_i. We check that Hall’s condition holds in H. Fix an arbitrary non-empty set S \subset X_i \setminus Y_i. If |N_H(S)| \leq |S|, then there would be an x with 1 \leq x = |S| \leq |X_i| \leq 3\varepsilon_1m such that G(n,p) contains some x independent edges and x vertices, each of which is adjacent to both ends of at least (\eta/2)\delta^2p^2m of those edges, see (M3) in Lemma 6.1. This would contradict our assumption that G(n,p) satisfies the assertion of Proposition 4.3 with \xi = \eta\delta^2m/(2n) = 6\varepsilon_1m/(2n). Hence, |N_H(S)| > |S| for all non-empty S \subset X_i \setminus Y_i.
Fix any such triangle packing and for each i, let X'_i = X_i \cup T_i, where T_i \subset Q_i is the set of vertices in W_i \setminus X_i that are covered by the triangle packing. Note that |T_i| = |X_j \setminus Y_j| + |X_k \setminus Y_k|. Let W'_i = W_i \setminus X'_i. Since for each i, |X'_i| = |X_i| + |T_i| = |X_1 \setminus Y_1| + |X_2 \setminus Y_2| + |X_3 \setminus Y_3| + |Y_i| and |Y_1| = |Y_2| = |Y_3|, the sets W'_1, W'_2, and W'_3 have the same number of elements. Denote this number by m' and note that m' \geq m - 9\varepsilon_1m \geq m/2 \geq \xi n.
CLAIM.
The triple (W'_1, W'_2, W'_3) is (\varepsilon, \delta, p)-strong-super-regular.
Proof.
Since (W_1, W_2, W_3) is (\varepsilon/2, p)-regular with density at least 2\delta p and m' \geq m/2, Proposition 2.1 implies that (W'_1, W'_2, W'_3) is (\varepsilon, p)-regular with density at least \delta p. Fix an index i, recall that |X'_i| \leq 9\varepsilon_1m \leq \varepsilon_3m, and let v be an arbitrary vertex in W'_i. Without loss of generality, we may assume that i = 1. Since v \not\in X_1, (A) implies that \deg(v,X_j) \leq 4\varepsilon_1pm for every j. Moreover, (M2) in Lemma 6.1 implies that \deg(v,Q_j) \leq 3\eta d_{ij}pm. Hence,
\deg(v, X'_j) \leq \deg(v, X_j) + \deg(v, T_j) \leq \deg(v, X_j) + \deg(v, Q_j) \leq \varepsilon_3pm,
and by Proposition 2.10, v becomes \varepsilon-typical in (W'_1, W'_2, W'_3). It remains to show that v is also \varepsilon-good. Since v \not\in X_i, it was \varepsilon_1-good in (W_1, W_2, W_3) and it satisfies (B). Hence, the endpoints of all but at most (\varepsilon_1+\varepsilon_2)d_{12}d_{13}d_{23}p^3m^2 edges in the neighbourhood of v have at least (1-\varepsilon_1-5\varepsilon_1/\delta^2)d_{12}d_{13}p^2m common neighbours in W_1 \setminus X_1.
Moreover by (M4), they have at most 4\eta d_{12}d_{13}p^2m common neighbours in Q_1. Since 1 -\varepsilon_1-5\varepsilon_1/\delta^2- 4\eta \geq (1+\varepsilon_2/\delta)^2(1-\varepsilon), each such edge is \varepsilon-good in the new triple. It follows that v is \varepsilon-good.
Finally, let B = B_0 \cup \bigcup_{i=1}^{3k}Y_i and let S = S_0 \bigcup_{i=1}^{3k}(T_i \cup (X_i \setminus Y_i)). Clearly, the sets B, S, and (W'_i)_{i=1}^{3k} partition the vertex set of G,
|B| \leq |B_0| + \sum_{i=1}^{3k} |Y_i| \leq Dp^{-2}/2 + 3k \cdot Dp^{-1}/(6k) \leq Dp^{-2}/2,
and G[S] contains a perfect triangle packing. Finally, by Claim Proof, for each t \in [k], the triple (W'_{3t-2}, W'_{3t-1}, W'_{3t}) is (\varepsilon, \delta, p)-strong-super-regular and satisfies |W'_{3t-2}| = |W'_{3t-1}| = |W'_{3t}| \geq \xi n.