Confusion on the proof of Erdös's prime gap inequality I am currently reading Erdös's paper "The difference of consecutive primes" published in 1940, in which he shows that there exists $\delta>0$ such that
$$
A=\liminf_{n\to\infty}{p_{n+1}-p_n\over\log p_n}\le1-\delta
$$
His method is essentially a proof by contradiction:
Let $I=[(1-\delta)\log n,(1+\delta)\log n]$ and $p_1,p_2,\dots,p_t$ denotes all primes in $[n/2,n]$ and $b_k=p_{k+1}-p_k$. If $A=1$ then all $b_k\ge(1-\delta)\log n$. This indicates that
$$
\frac n2\ge\sum_{1\le k<t}b_k=(1-\delta)\log n\underbrace{\sum_{b_k\in I}1}_{S_1}+(1+\delta)\log n\underbrace{\sum_{b_k\notin I}1}_{S_2},
$$
Applying Brun's sieve, I am able to recover Erdös' upper bound that $S_1<{n\over6\log n}$ when $\delta$ sufficiently small and $n$ sufficiently large. Mysteriously, Erdös applies this upper bound to obtain the lower estimate as follows:
$$
\frac n2>(1-\delta)\log n\cdot{n\over6\log n}+(1+\delta)\log n S_2,
$$
and somehow he also wrote $S_2>(\frac12-\varepsilon)n/\log n$ so that
$$
\frac n2>\frac16(1-\delta)n+\frac n2(1-\varepsilon)(1+\delta)>\frac n2
$$
leads to a contradiction.
I am totally confused by these steps, and I wonder whether anyone on this community can help me explain Erdös's reasoning.

Note that $S_1+S_2=\frac{(1+o(1)) }{2}\cdot \frac{n}{\log n}$ by the prime number theorem. Therefore writing $S_2 =\frac{(1+o(1)) }{2}\cdot \frac{n}{\log n} - S_1$ in your first inequality and simplifying gives
$$ \frac{n}{2} \geq -2\delta S_1 \log n+ (1+\delta)\frac{1+o(1)}{2}n.$$
Using $S_1 \log n < n/6$ we deduce
$$ \frac{n}{2} \geq n\left(\frac{1}{2}+\delta/6+o(1)\right).$$
Since $\delta>0$ this is a contradiction for large enough $n$.
