\left(\frac{1000 K_1^4K_2^2}{{\varepsilon}^2}\right)^{K_1} |S_1|,$$ whenever $|S_1|$ is sufficiently large.

This contradiction completes the proof of Lemma \[lem:no\_bad\_cycles\].

To complete the proof of Theorem \[thm:main\_theorem\], we just need to bound the number of solutions to $a_1x_1 + a_2x_2 + a_3x_3 = 0$, with $x_1, x_2, x_3$ taken from a good triple. The following lemma will achieve this.

\[lem:bounding\_good\_solutions\] Suppose we choose $a_1 = 1, a_2 = M {\text{ and }}a_3 = M+1$, as in the statement of Lemma \[lem:no\_bad\_cycles\].

Then the number of solutions to $a_1x_1 + a_2x_2 + a_3x_3 = 0$ taken from good triples is bounded above by $\left(\frac{1}{12} + \frac{{\varepsilon}}{4}\right)|S|^2$, whenever $|S|$ is large enough.

We will start by defining a function $$\label{eqn:defn_of_depth}
d : [n] \rightarrow {\mathbb{Q}},$$ with the property that if $S_i \rightarrow S_j$ has label $t$, then $d(j) = td(i)$.

One way we can do this is as follows. For each connected component $G'$ of $G$, choose the smallest value of $i$ such that $S_i$ is in $G'$, and set $d(i) = 1$. Then, for any other $j$ with $S_j$ in $G'$, $d(j)$ is determined by the product of the labels on any path from $S_i$ to $S_j$. Lemma \[lem:no\_bad\_cycles\] guarantees that this value does not 