Define \(p=2^{4+\frac{16}{\delta}}\) and, for all \(i\geq0\text{,}\) let \(n_i=(16/p)^in\) and \(e_i=C(1/p)^i n^{1+\delta}\text{.}\) We construct graphs \(G_0,G_1,\dots, G_t\) iteratively in such a way that, for all \(i\geq0\text{,}\)
\(G_{i+1}\) is a subgraph of \(G_{i}\text{,}\)
\(G_i\) has at most \(n_i\) vertices and
\(G_i\) has at least \(e_i\) edges.
We start by initiating \(G_0=G\) and note that the statements in the second and third bullet points above hold in the case \(i=0\) by the hypotheses of the lemma.
For \(i\geq 0\text{,}\) suppose that the graph \(G_i\) has already been constructed. Our goal in this step of the algorithm is to either produce a subgraph \(G'\) of \(G_i\) with the properties described in the lemma statement, or a subgraph \(G_{i+1}\) of \(G_i\) with at most \(m_{i+1}\) vertices and at least \(e_{i+1}\) edges. Before describing the procedure for doing this, we take a detour to prove a lower bound on \(n_i\text{.}\) Of course, we must have
\begin{equation*}
e_i\leq |E(G_i)|\leq |V(G_i)|^2\leq n_i^2.
\end{equation*}
Plugging in the values for \(e_i\) and \(n_i\) yields
\begin{equation*}
C(1/p)^i n^{1+\delta}\leq (16/p)^{2i}n^{2}.
\end{equation*}
After a bit of rearranging, we get
\begin{equation*}
(p/256)^i \leq n^{1-\delta}/C\leq n^{1-\delta/2}
\end{equation*}
where the last inequality uses that \(n\geq C^{-2/\delta}\text{.}\) Note that
\begin{equation*}
\frac{p}{256} = 2^{-4+\frac{16}{\delta}} = 2^{\left(\frac{4-\delta}{4}\right)\left(\frac{16}{\delta}\right)} = (p/16)^{\frac{4-\delta}{4}}.
\end{equation*}
Combining this with the previous inequality yields
\begin{equation*}
(p/16)^i \leq n^{\frac{2-\delta}{2}\cdot \frac{4}{4-\delta}} =n^{1-\frac{\delta}{4-\delta}}
\end{equation*}
and so
\begin{equation*}
n_i = (16/p)^i n \geq n^{\frac{\delta}{4-\delta}} = n^{\frac{\delta}{4-\delta} - \varepsilon} n^\varepsilon \geq 2 n^{\varepsilon}
\end{equation*}
where the last inequality uses the lower bound on \(n\) in the hypotheses of the lemma.
Let \(q=\lceil p/4\rceil\) and let \(V_0,\dots,V_{q-1}\) be a partition of \(V(G_i)\) into sets of cardinality \(\lfloor n_i/q\rfloor\) or \(\lceil n_i/q\rceil\) such that \(V_0\) contains the \(\lfloor n_i/q\rfloor\) vertices of highest degree. We divide into cases.
Case 1: At least half of the edges of \(G_i\) are incident to a vertex in \(V_0\text{.}\)
In this case, choose \(1\leq i\leq q-1\) so that the number of edges from \(V_0\) to \(V_i\) is maximized. We let \(G_{i+1}\) be the subgraph of \(G_i\) obtained by deleting all vertices except for those in \(V_0\cup V_i\text{.}\) By pigeonhole and the fact that at least half of the edges of \(G_i\) are incident to a vertex in \(V_0\text{,}\) the number of edges in \(G_{i+1}\) is at least
\begin{equation*}
e_i/2q\geq e_i/p=e_{i+1}.
\end{equation*}
Also, the number of vertices of \(G_{i+1}\) is at most
\begin{equation*}
2\lceil n_i/q\rceil \leq 2\lceil 4n_i/p\rceil\leq 2(4n_i/p) + 2 \leq (16/p)n_i =n_{i+1}
\end{equation*}
where the last inequality uses the bound \(n_i\geq 2 n^{\varepsilon}\) established earlier and the lower bound on \(n\) from the hypotheses of the lemma. Thus, \(G_{i+1}\) has the desired properties.
Case 2: At most half of the edges of \(G_i\) are incident to a vertex in \(V_0\text{.}\)
In this case, let \(G'\) be the subgraph of \(G_i\) obtained by deleting the vertices of \(V_0\text{.}\) Then
\begin{equation*}
|V(G')| \geq n_i - |V_0| \geq n_i\left(1-\frac{1}{q}\right) \geq 2 n^{\varepsilon}\left(1-\frac{4}{p}\right) > n^{\varepsilon}.
\end{equation*}
Also, by definition of \(p\text{,}\) we have \(1/p\geq (16/p)^{1+\delta}\) and so
\begin{equation*}
|E(G')| \geq |E(G_i)|/2\geq e_i/2 = (C/2)(1/p)^i n^{1+\delta} \geq (C/2)(16/p)^{i(1+\delta)} n^{1+\delta} =(C/2)n_i^{1+\delta} \geq (C/2)|V(G')|^{1+\delta}.
\end{equation*}
Finally, suppose that \(G'\) has a vertex of degree greater than \(2p|E(G')|/|V(G')|\text{.}\) By definition of \(V_0\text{,}\) this means that all of the vertices of \(V_0\) have degree greater than \(2p|E(G')|/|V(G')|\) in \(G_i\text{.}\) Thus, by handshaking,
\begin{equation*}
2|E(G_i)|\geq \left(|V_0|+1\right)2p|E(G')|/|V(G')| \geq \left(n_i/q\right)2p|E(G')|/n_i = (2p/q)|E(G')|> 4|E(G')|.
\end{equation*}
However, this contradicts the assumption that at most half of the edges of \(G_i\) are incident to a vertex in \(V_0\text{.}\) Therefore, \(G'\) has the desired properties and the proof is complete.