then there is exactly one ratio $a_i/a_j$ such that $d_1/d_2 = a_i/a_j$. Thus, the term $|R_{d_1}||R_{d_2}|$ appears in at most one of the sums on the right hand side of the first line.

Finally, for $i = 0, 1 {\text{ and }}2$, define the quantity $X_i$ by $$X_i = \sum_{\substack{d = M^{e_1}(M+1)^{e_2} \\ e_1 - e_2 = i \mod 3}} |R_d|.$$ By our construction of $d$, each $|R_d|$ appears as a term in exactly one of the $X_i$. Furthermore, $d_1 \sim d_2$ only if $R_{d_1}$ and $R_{d_2}$ are in different sums $X_i$, and any term $|R_{d_1}||R_{d_2}|$ appears at most once in (\[eqn:sum\_of\_RR\]). Consequently, we have the upper bound $$\begin{aligned}
\frac{1}{4}\sum_{d_1 \sim d_2} |R_{d_1}||R_{d_2}| &{\leqslant}\frac{1}{4}(X_0X_1 + X_0X_2 + X_1X_2) \\
&{\leqslant}\left(\frac{1}{12} + \frac{{\varepsilon}}{4}\right)|S|^2,\end{aligned}$$ the latter inequality following from an easy application of Cauchy-Schwarz, since $X_0 + X_1 + X_2 {\leqslant}|S|$. This completes the proof of Lemma \[lem:bounding\_good\_solutions\].

We have now essentially proven Theorem \[thm:main\_theorem\]. Indeed, any solution to $a_1x_1 + a_2x_2 + a_3x_3 = 0$ must either have some $x_i$ in $S_0$, or must come from a bad triple, or must come from a good triple. Combining Lemmas \[lem:ignore\_S0\], \[lem:ignore\_bad\_triples\] and \[lem:bounding\_good\_solutions\] gives the result if $|S|$ is large enough.

Equations 