---
abstract: |
    Given a linear equation of the form $a_1x_1 + a_2x_2 + a_3x_3 = 0$ with integer coefficients $a_i$, we are interested in maximising the number of solutions to this equation in a set $S \subseteq \mathbb{Z}$, for sets $S$ of a given size.

    We prove that, for any choice of constants $a_1, a_2$ and $a_3$, the maximum number of solutions is at least $\left(\frac{1}{12} + o(1)\right)|S|^2$. Furthermore, we show that this is optimal, in the following sense. For any $\varepsilon > 0,$ there are choices of $a_1, a_2$ and $a_3,$ for which any large set $S$ of integers has at most $\left(\frac{1}{12} + \varepsilon\right)|S|^2$ solutions.

    For equations in $k {\geqslant}3$ variables, we also show an analogous result. Set $\sigma_k = \int_{-\infty}^{\infty} (\frac{\sin \pi x}{\pi x})^k dx.$ Then, for any choice of constants $a_1, \dots, a_k$, there are sets $S$ with at least $\left(\frac{\sigma_k}{k^{k-1}} + o(1)\right)|S|^{k-1}$ solutions to $a_1x_1 + \dots + a_kx_k = 0$. Moreover, there are choices of coefficients $a_1, \dots, a_k$ for which any large set $S$ must have no more than $\left(\frac{\sigma_k}{k^{k-1}} + \varepsilon\right)|S|^{k-1}$ solutions, for any $\varepsilon > 0$.
author:
- James Aaronson
nocite: '[@HLP]'
title: Maximising the number of solutions to a linear equation in a set of integers
---

Introduction {#sec:intro}
============

Let $a_1, a_2 {\text{ and }}a_3$ be fixed coprime integers, none of which is zero. We will consider the linear equation $$\label{eqn:to_solve}
a_1x_1 + a_2x_2 + a_3x_3 = 0.$$ In this paper, we are interested in the problem of finding sets with as many solutions to (\[eqn:to\_solve\]) as possible. This leads to the following definition.

Given a finite set $S {\subseteq}{\mathbb{Z}}$, define $T(S) = T_{a_1, a_2, a_3}(S)$ to be the number of triples $x_1, x_2, x_3 \in S$ satisfying (\[eqn:to\_solve\]).

The trivial upper bound on $T(S)$ is $T(S) {\leqslant}|S|^2$. This is because, for any choice of $x_1 {\text{ and }}x_2$, there is at most one choice of $x_3$ such that $a_1x_1 + a_2x_2 + a_3x_3 = 0$, namely $x_3 = \frac{-a_1x_1-a_2x_2}{a_3}$. We are interested in making $T(S)$ as large as possible, for a fixed size $|S|$.

For some choices of coefficients $a_1, a_2 {\text{ and }}a_3$, the exact maximal value of $T(S)$ is known. For example, consider the case $a_1 = a_2 = a_3 = 1$. Then, work of Hardy and Littlewood [@HLIneqNotes] and Gabriel [@Gabriel] shows that, when $|S|$ is odd, $T(S)$ is maximised when $S$ is an interval centred about 0. This was extended to even $|S|$ by Lev in [@lev_max]. In fact, their arguments show that if $S \subseteq {\mathbb{Z}}$ is a set, and $S'$ is an interval centred about 0 of the same size, then $T_{a_1, a_2, a_3}(S) {\leqslant}T_{1,1,1}(S')$. The ideas behind their approaches involve rearrangement inequalites, which are discussed in detail in [@HLP Chapter 10], and which inspire some of the arguments in this paper.

Similarly, it is shown by Green and Sisask in [@GreenSisask Theorem 1.2] and by Lev and Pinchasi in [@LevPinchasi Theorem 2] respectively that, if $(a_1, a_2, a_3) = (1, -2, \pm 1)$, then $T(S)$ is again maximised when $S$ is an interval centred at 0.

The set of solutions to $x_1 - 2x_2 + x_3 = 0$ is precisely the set of three-term arithmetic progressions; that is, the set of affine shifts of the set $\{0, 1, 2\}$. By analogy with this, Bhattacharya, Ganguly, Shao and Zhao considered longer arithmetic progressions; in [@uppertails Theorem 2.4], they proved that the number of $k$ term arithmetic progressions in a set $S$ of $n$ integers is maximised when $S$ is an interval.

Ganguly asked [@pc_ganguly] about other affine patterns; in particular, finding sets $S$ with as many affine copies of $\{0, 1, 3\}$, or solutions to $x + 2y = 3z$, as possible. In this case, such a result would necessarily be less clean; for instance, there are more solutions to $x + 2y = 3z$ in $\{0,1,3\}$ than in $\{0,1,2\}$.

Indeed, in general, much less is known. For a lower bound on the maximal value of $T(S)$, a fairly good bound is given by the following example.

\[prop:twelfth\] Regardless of the values of $a_1, a_2 {\text{ and }}a_3$, there are choices of $S$ with $|S|$ arbitrarily large, for which $T(S) {\geqslant}\frac{1}{12}|S|^2 + O(|S|)$.

The idea behind the construction is to split $S$ into three pieces $S_1, S_2 {\text{ and }}S_3$, of roughly equal size, for which there are many solutions to $a_1x_1 + a_2x_2 + a_3x_3 = 0$ with each $x_i$ taken from $S_i$. Let $M$ be a large integer, which we assume to be divisible by 6. We will define $$\begin{aligned}
S_1 &= a_2a_3[-M/6, M/6] \\
S_2 &= a_1a_3[-M/6, M/6] \\
S_3 &= a_1a_2[-M/6, M/6], \end{aligned}$$ where $[-M/6, M/6]$ refers to the set of integers with absolute value no greater than $M/6$, and set $S = S_1 \cup S_2 \cup S_3$. Then, $|S|$ is certainly no more than $M$.

However, we may find a large collection of triples $(x_1, x_2, x_3)$ by choosing $x_1 \in S_1 {\text{ and }}x_2 \in S_2$ arbitrarily, and selecting those for which $x_3 = \frac{-a_1x_1-a_2x_2}{a_3}$ is in $S_3$. If $x_1 = a_2a_3x_1' {\text{ and }}x_2 = a_1a_3x_2'$, then we have $x_3 = -a_1a_2(x_1' + x_2')$. Therefore, a pair $(x_1', x_2')$ will give rise to a solution precisely when $|x_1' + x_2'| {\leqslant}M/6$.

We may compute the number of such pairs $(x_1', x_2')$ as the sum $$\sum_{x_1' = -M/6}^{M/6} M/3 + 1 - |x_1'| = \frac{1}{12}M^2 + O(M).$$ Thus, the number of triples is at least $\frac{1}{12}|S|^2 + O(|S|)$.

Given this, it is natural to define the following quantity:

Define $\gamma_{a_1,a_2,a_3}$ by $$\gamma_{a_1,a_2,a_3} = \limsup_{|S| \rightarrow \infty} \dfrac{T(S)}{|S|^2}$$ where $S$ runs over subsets of ${\mathbb{Z}}$.

Thus, the assertion that $$\label{eqn:gamma_uniform_bound}
\frac{1}{12} {\leqslant}\gamma_{a_1, a_2, a_3} {\leqslant}\frac{3}{4}$$ holds for all $a_1, a_2$ and $a_3$ follows from Proposition \[prop:twelfth\] and the work of Hardy and Littlewood in [@HLIneqNotes].

As far as the author is aware, exact values for $\gamma_{a_1, a_2, a_3}$ are only known in cases for which $|a_1a_2a_3| {\leqslant}2$ (this includes the cases previously discussed). In particular, we have $$\begin{aligned}
\gamma_{1,1,\pm 1} &= \frac{3}{4} \label{eqn:trivial_case}\\ 
\gamma_{1,-2,\pm 1} &= \frac{1}{2} \label{eqn:abc_is_2}\end{aligned}$$ $\gamma_{1,-2,1}$ is [@GreenSisask Theorem 1.2], and $\gamma_{1,-2,-1} = \frac{1}{2}$ is [@LevPinchasi Theorem 2]. The same holds in the third non-equivalent case with $|a_1a_2a_3| = 2$, namely $\gamma_{1, 2, 1} = \frac{1}{2}$. Even the value of $\gamma_{1,2,-3}$ is not known, although the author conjectures that it is $\frac{1}{3}$, which is the value calculated for $S = [-M/2, M/2]$.

The main theorem of this paper is a converse, of sorts, to Proposition \[prop:twelfth\]. In particular, we will prove the following.

\[thm:main\_theorem\] The constant $\frac{1}{12}$ in the statement of Proposition \[prop:twelfth\] is optimal, in the following sense. For any ${\varepsilon}> 0$, there exists a choice of $a_1, a_2 {\text{ and }}a_3$ for which $\gamma_{a_1, a_2, a_3} {\leqslant}\frac{1}{12} + {\varepsilon}$.

In view of this theorem, (\[eqn:gamma\_uniform\_bound\]) gives the best possible bounds on $\gamma_{a_1, a_2, a_3}$ that are independent of the coefficients $a_i$.

The plan for this paper is as follows. In Section \[sec:import\_lemmas\], we will record some additive combinatorial lemmas that we will need in order to establish Theorem \[thm:main\_theorem\]. In Section \[sec:proof\_of\_thm\], we will use these lemmas to prove Theorem \[thm:main\_theorem\].

One might also ask about generalising Theorem \[thm:main\_theorem\] to other settings. For instance, given a system of $m$ linear equations in $k$ variables (where we assume that $m {\leqslant}k - 2$), can we prove an analogue of Theorem \[thm:main\_theorem\]?

If $m = 1$, then an analogue of Proposition \[prop:twelfth\] holds for any value of $k {\geqslant}3$. Set $$\label{eqn:definition_of_sigma}
\sigma_k = \int_{-\infty}^{\infty} \left(\frac{\sin \pi x}{\pi x} \right)^k dx.$$ Then, for any choice of coefficients $a_1, \dots, a_k$, there are sets $S$ with at least $\frac{\sigma_k}{k^{k-1}}|S|^{k-1} + O(|S|^{k-2})$ solutions to $a_1x_1 + \dots + a_kx_k = 0$. We will discuss (\[eqn:definition\_of\_sigma\]) further in Section \[sec:generalisation\_to\_k\_var\].

Furthermore, the corresponding analogue of Theorem \[thm:main\_theorem\] holds. For any ${\varepsilon}> 0$, there are choices of coefficients $a_1, \dots, a_k$ for which any large set $S$ must have no more than $\left(\frac{\sigma_k}{k^{k-1}} + \varepsilon\right)|S|^{k-1}$ solutions. For instance, for any small positive ${\varepsilon}$ we can find coefficients $a_1, a_2, a_3 {\text{ and }}a_4$ with the property that $
T(S) {\leqslant}\left( \frac{1}{96} + {\varepsilon}\right) |S|^3,
$ where $T(S)$ counts the number of solutions to $a_1x_1 + a_2x_2 + a_3x_3 + a_4x_4 = 0.$ We will discuss this in Section \[sec:generalisation\_to\_k\_var\].

On the other hand, the opposite is true in the case that $m > 1$. Indeed, it is possible to show that there is *no* constant $c > 0$, such that for any system of 2 equations in 4 variables, there are large sets $S$ with at least $c |S|^2$ solutions to the system. We will prove this fact in Section \[sec:generalisation\_to\_systems\].

Notation {#notation .unnumbered}
--------

As we have already noted, $T(S)$ will be the number of solutions to $a_1x_1 + a_2x_2 + a_3x_3$ in S. We can extend this by defining $T(S_1, S_2, S_3)$ to be the number of solutions to $a_1x_1 + a_2x_2 + a_3x_3$, where $x_i \in S_i$.

We will use the notation $a \cdot S$ to denote the set $\{ax, x \in S\}$.

We will also make frequent use of the Vinogradov notation $f \ll g$ to mean that $f = O(g)$. When the $\ll$ is subscripted, we allow the implicit constant to depend on the subscripts.

The author is supported by an EPSRC grant EP/N509711/1. The author would like to thank his supervisor, Ben Green, for his continued support and encouragement, and the anonymous referee for a thorough reading of a previous version of this paper.

This version of the paper replaces a previous version [@me]. The argument used to prove Theorem \[thm:main\_theorem\] is replaced with a new argument which avoids appealing to the arithmetic regularity lemma (and can handle a wider class of equations), and the results of Section \[sec:generalisation\_to\_systems\] are new to this version.

Additive Combinatorial Lemmas {#sec:import_lemmas}
=============================

In this section, we will collect some lemmas that will be necessary for the proof of Theorem \[thm:main\_theorem\].

For any set $A \subseteq {\mathbb{Z}}$, let $\delta[A]$ be its growth under the differencing operator, $\frac{|A-A|}{|A|}$. If $A {\text{ and }}B$ are two sets of integers, let the *additive energy* between $A {\text{ and }}B, E(A, B)$, be defined by $$E(A,B) = \# \{(a_1,b_1,a_2,b_2) \in A \times B \times A \times B: a_1 + b_1 = a_2 + b_2\}.$$ It is easy to see that this satisfies the following inequalities:

\[eqn:bound\_energy\] E(A,B) &|A|\^2|B|\
E(A,B) &|A||B|\^2\
E(A,B) &|A|\^[3/2]{}|B|\^[3/2]{},

the third of which follows immediately from the first two.

We will require the following lemma, which states that, when two sets $A {\text{ and }}B$ have $\delta[A] {\text{ and }}\delta[B]$ small, and if $E(A, B)$ is large, then $|A - B|$ is also small.

\[lem:gs\_doubling\_lem\] Suppose that $A, B \subseteq {\mathbb{Z}}$ are sets with $E(A, B) {\geqslant}\eta |A|^{3/2}|B|^{3/2}$.

Then, $|A - B| {\leqslant}\frac{\delta[A]\delta[B]}{\eta} |A|^{1/2}|B|^{1/2}$.

We will also require a weak form of a structure theorem due to Green and Sisask.

\[thm:green\_sisask\_structure\] Let ${\varepsilon}_1 \in (0,1/2)$ be a parameter. Then there are choices of (large) integers $K_1 = K_1({\varepsilon}_1) {\text{ and }}K_2 = K_2({\varepsilon}_1)$ with the following property. For any set $S \subseteq {\mathbb{Z}}$, there is a decomposition of $S$ as a disjoint union $S_1 \amalg \dots \amalg S_n \amalg S_0$ such that

1.  $|S_i| {\geqslant}|S|/K_1$ for $i=1,\dots,n$;

2.  $\delta[S_i] {\leqslant}K_2$ for $i = 1,\dots,n$;

3.  $E(S_0,S) {\leqslant}{\varepsilon}_1 |S|^3$.

Observe that property (1) guarantees that $n {\leqslant}K_1$.

The quantity $T(S_1, S_2, S_3)$ is related to the additive energy via the following lemma.

\[lem:easy\_TNRG\_lemma\] Suppose that $S_1, S_2 {\text{ and }}S_3 \subseteq {\mathbb{Z}}$ are finite sets. Then $$T(S_1, S_2, S_3)^2 {\leqslant}E(a_1\cdot S_1, a_2\cdot S_2)|S_3|.$$

For any $t \in {\mathbb{Z}}$, let $\mu(t)$ denote the number of ways of writing $t = a_1x_1 + a_2x_2$, for $x_i \in S_i$. Thus, by definition, $$E(a_1\cdot S_1, a_2\cdot S_2) = \sum_{t} \mu(t)^2.$$ Now, we see that $$T(S_1, S_2, S_3)^2 = \left(\sum_{t \in -a_3 \cdot S_3} \mu(t)\right)^2 {\leqslant}\left(\sum_t \mu(t)^2\right)|S_3| = E(a_1\cdot S_1, a_2\cdot S_2) |S_3|,$$ the inequality following from Cauchy-Schwarz. This completes the proof of Lemma \[lem:easy\_TNRG\_lemma\].

The following two facts are standard results in additive combinatorics.

\[lem:ruzsa\_triangle\] For sets $A, B, C \subseteq {\mathbb{Z}}$, $$|A - C| |B| {\leqslant}|A - B||B - C|.$$

\[lem:energy\_cs\] For sets $A, B \subseteq {\mathbb{Z}}$, $$E(A, B) {\leqslant}E(A,A)^{1/2} E(B,B)^{1/2}.$$

We will require the following lemma bounding $T(S_1, S_2, S_3)$.

\[lem:uniform\_bound\_symmetric\] Suppose that $S_1, S_2, S_3 \subseteq {\mathbb{Z}}$ are sets with sizes $s_1, s_2 {\text{ and }}s_3$ respectively. Then, we have the bound $$\label{eqn:uniform_bound}
T(S_1, S_2, S_3) {\leqslant}\frac{1}{4}\left(s_1s_2 + s_2s_3 + s_1s_3 + 1\right).$$

We will first prove Lemma \[lem:uniform\_bound\_symmetric\] in the case that $a_1, a_2 {\text{ and }}a_3$ are all 1.

Without loss of generality, assume that $s_1 {\leqslant}s_2 {\leqslant}s_3$.

Suppose first that $s_3 {\geqslant}s_1 + s_2$. In that case, we have $$\begin{aligned}
T(S_1, S_2, S_3) &{\leqslant}s_1s_2 \\
&{\leqslant}\frac{1}{4} (s_1 + s_2)^2 \\
&{\leqslant}\frac{1}{4} (s_1s_3 + s_2s_3).\end{aligned}$$ The first line follows from the trivial observation that for each pair of $x \in S_1 {\text{ and }}y \in S_2$, there can be at most one solution to $x + y + z = 0$ with $z \in S_3$. The third line follows from our assumption on $s_3$. Thus, (\[eqn:uniform\_bound\]) follows in this case.

Now, suppose that $s_3 < s_1 + s_2$. In this case, we may apply [@LevPinchasi Lemma 2], which states that $$T(S_1, S_2, S_3) {\leqslant}\frac{2(s_1s_2 + s_2s_3 + s_3s_1) - (s_1^2 + s_2^2 + s_3^2) + 1}{4}.$$ (\[eqn:uniform\_bound\]) follows in this case via an easy application of the Cauchy-Schwarz inequality.

Finally, for arbitrary coefficients $a_1, a_2 {\text{ and }}a_3$, observe that $$\begin{aligned}
T_{a_1, a_2, a_3}(S_1, S_2, S_3) &= T_{1,1,1}(a_1 \cdot S_1, a_2 \cdot S_2, a_3 \cdot S_3) \\
&{\leqslant}\frac{1}{4}\left(s_1s_2 + s_2s_3 + s_1s_3 + 1\right).\end{aligned}$$ This completes the proof of Lemma \[lem:uniform\_bound\_symmetric\].

Finally, we will require the following theorem of Bukh:

\[thm:bukh\_sod\_thm\] Given two coprime integers $\lambda_1 {\text{ and }}\lambda_2$, we have that for any $S \subseteq {\mathbb{Z}}$, $$|\lambda_1 \cdot S + \lambda_2 \cdot S| {\geqslant}(|\lambda_1| + |\lambda_2|)|S| - o_{\lambda_1, \lambda_2}(|S|)$$

Proof of Theorem \[thm:main\_theorem\] {#sec:proof_of_thm}
======================================

In this section, we will use the lemmas of Section \[sec:import\_lemmas\] to prove Theorem \[thm:main\_theorem\]. We must prove that, given a suitable choice of $a_1, a_2 {\text{ and }}a_3$, all sufficiently large sets $S$ have $T(S) {\leqslant}\left(\frac{1}{12} + {\varepsilon}\right)|S|^2$.

Let ${\varepsilon}> 0$. Given our choice of ${\varepsilon}$, we must choose the values of the coefficients $a_1, a_2 {\text{ and }}a_3$; we will do so later. Suppose that $S$ is a sufficiently large set. We will immediately apply the structure theorem, Theorem \[thm:green\_sisask\_structure\], to $S$, with ${\varepsilon}_1 = \left(\frac{{\varepsilon}}{6}\right)^4$. This gives us a decomposition $S = S_1 \amalg \dots \amalg S_n \amalg S_0$. We will start by showing that the contribution to $T(S)$ from solutions $a_1x_1 + a_2x_2 + a_3x_3 = 0$, with at least one of the $x_i$ taken from $S_0$, is small.

\[lem:ignore\_S0\] The number of solutions to $a_1x_1 + a_2x_2 + a_3x_3 = 0$ in $S$, where some $x_i$ is taken from $S_0$, is no greater than $\frac{{\varepsilon}}{2}|S|^2$.

The number of such solutions may be upper bounded by $$T(S_0, S, S) + T(S, S_0, S) + T(S, S, S_0),$$ and so it suffices to show that each term is no greater than $\frac{{\varepsilon}}{6}|S|^2$.

Applying Lemmas \[lem:easy\_TNRG\_lemma\] and \[lem:energy\_cs\], we have $$\begin{aligned}
T(S_0, S, S)^2 &{\leqslant}E(a_1 \cdot S_0, a_2 \cdot S) |S| \\
&{\leqslant}E(S_0, S_0)^{1/2} E(S, S)^{1/2} |S| \\
&{\leqslant}{\varepsilon}_1^{1/2} |S|^4,\end{aligned}$$ from which it follows that $T(S_0, S, S) {\leqslant}{\varepsilon}_1^{1/4}|S|^2$. By our choice of ${\varepsilon}_1$, this gives exactly what we claimed.

At this point, we must bound the number of solutions to $a_1x_1 + a_2x_2 + a_3x_3 = 0$ where each of $x_1, x_2 {\text{ and }}x_3$ is taken from an $S_i$ with $i {\geqslant}1$. To do this, we will start by restricting which triples $(i, j, k)$ can have the property that there are many solutions with $x_1 \in S_i, x_2 \in S_j {\text{ and }}x_3 \in S_k$. For instance, the fact that $\delta[S_1]$ is small, together with an assumption that $a_1$ and $a_2$ are coprime and $|a_1 + a_2|$ is large, will imply that there cannot be too many solutions with $x_1, x_2 {\text{ and }}x_3$ all in $S_1$.

In particular, this will give us a fairly rigid structure on the collection of triples $S_i, S_j, S_k$ such that $T(S_i, S_j, S_k)$ can give a non-trivial contribution to $T(S, S, S)$. In order to quantify this structure, we will draw a labelled digraph $G$ whose vertices correspond to the $S_i$ with $i {\geqslant}1$. We will draw an edge from $S_i$ to $S_j$ with label $\frac{a_1}{a_2}$ if and only if $T(S_i, S_j, S) {\geqslant}\frac{{\varepsilon}}{24 K_1^2} |S|^2$, where $K_1$ is as in the statement of Theorem \[thm:green\_sisask\_structure\]. Similarly, we will draw an edge with label $\frac{a_3}{a_2}$ if $T(S, S_j, S_i) {\geqslant}\frac{{\varepsilon}}{24 K_1^2} |S|^2$, and similarly for the other four possible labels.

In particular, observe that if there is an edge from $S_i$ to $S_j$ with label $x$, then there will be an edge from $S_j$ to $S_i$ with label $x^{-1}$. Our definition of $G$ does not necessarily preclude the existence of multiple edges between $S_i$ and $S_j$ (with different labels), or edges from $S_i$ to $S_i$. However, as part of the proof, we will show that this cannot happen, provided that we assume a suitable hypothesis on $a_1, a_2 {\text{ and }}a_3$.

First, we will show that $G$ captures almost all of the solutions to $a_1x_1 + a_2x_2 + a_3x_3 = 0$.

\[lem:ignore\_bad\_triples\] Say that a triple $S_i, S_j {\text{ and }}S_k$ is *good* if and only if the six relevant edges are present. For example, $S_i \rightarrow S_j$ has label $\frac{a_1}{a_2}$, $S_k \rightarrow S_j$ has label $\frac{a_3}{a_2}$, and so on. Say that a triple is *bad* otherwise.

Then, the total number of solutions to $a_1x_1 + a_2x_2 + a_3x_3 = 0$ among all of the bad triples is at most $\frac{{\varepsilon}}{4} |S|^2$.

There are six ways a triple $(S_i, S_j, S_k)$ can be bad. One such way is if there is no edge from $S_i$ to $S_j$ with label $\frac{a_1}{a_2}$.

Let us count the total number of solutions among triples for which the $\frac{a_1}{a_2}$ edge is missing. That is $$\begin{aligned}
\sum_{\text{such } S_i, S_j} T(S_i, S_j, S) &{\leqslant}K_1^2 \frac{{\varepsilon}}{24 K_1^2} |S|^2 \\
&= \frac{{\varepsilon}}{24} |S|^2,\end{aligned}$$ since the number of pairs $S_i, S_j$ is bounded by $K_1^2$.

Summing this over the six possible ways for a triple to be bad completes the proof of Lemma \[lem:ignore\_bad\_triples\].

In view of Lemmas \[lem:ignore\_S0\] and \[lem:ignore\_bad\_triples\], it remains to show that the number of solutions among the good triples is at most $\left(\frac{1}{12} + \frac{{\varepsilon}}{4}\right)|S|^2$, for a suitable choice of the coefficients $a_1, a_2 {\text{ and }}a_3$. The values we will choose are $a_1 = 1, a_2 = M {\text{ and }}a_3 = M+1$, where $$\label{eqn:condition_on_M}
M > \left(\frac{1000 K_1^4K_2^2}{{\varepsilon}^2}\right)^{K_1}.$$

We can now prove the following lemma:

\[lem:no\_bad\_cycles\] With the values of $a_1, a_2 {\text{ and }}a_3$ that we have chosen, the product of the labels along any cycle in $G$ must be 1.

This immediately tells us that $G$ has no loops (edges from a vertex to itself). In view of the fact that an edge from $S_i$ to $S_j$ with label $x$ is accompanied by an edge from $S_j$ to $S_i$ with label $x^{-1}$, this also tells us that there can be at most one edge from $S_i$ to $S_j$.

We have chosen particular values of the $a_i$ for simplicity; indeed, we only need a single choice of coefficients to work in order to establish Theorem \[thm:main\_theorem\]. However, the same argument is able to establish Lemma \[lem:no\_bad\_cycles\], and thus also Theorem \[thm:main\_theorem\], for a much wider class of equations. For example, whenever $a_1, a_2 {\text{ and }}a_3$ are coprime, and at least two of the three coefficients are large enough, then the analogue of Lemma \[lem:no\_bad\_cycles\] holds, and thus $\gamma_{a_1, a_2, a_3} < 1/12 + {\varepsilon}$.

Conversely, it does not suffice for just one of the $a_i$ to be large. For example, if $a_1 = a_2 = 1$, then it can be shown that, for $S$ a slightly modified version of the set in Proposition \[prop:twelfth\], $T_{1, 1, a_3}(S) > \frac{1}{5} |S|^2$ for any $a_3$.

Suppose there is a cycle whose label product is not 1; consider a shortest such cycle. By minimality, such a cycle may have no repeated vertices, and thus must have at most $K_1$ vertices. Thus, without loss of generality the cycle is $S_1, S_2, \dots, S_k, S_1$, where $S_i \rightarrow S_{i+1}$ has label $t_i$ (with $S_{k+1} = S_1$), and $k {\leqslant}K_1$.

By Lemma \[lem:easy\_TNRG\_lemma\], we deduce that for each $i$, $$E(t_i \cdot S_i, S_{i+1}) {\geqslant}\frac{{\varepsilon}^2}{576 K_1^4}|S|^3.$$

Now, let us apply Lemma \[lem:gs\_doubling\_lem\] to $S_i {\text{ and }}S_{i+1}$. We have that $$E(t_i \cdot S_i, S_{i+1}) {\geqslant}\frac{{\varepsilon}^2}{576 K_1^4} |S_i|^{3/2}|S_{i+1}|^{3/2},$$ and so we deduce that $$\begin{aligned}
|t_i \cdot S_i - S_{i+1}| &{\leqslant}\delta[S_i] \delta[S_{i+1}] |S_i|^{1/2}|S_{i+1}|^{1/2} \frac{576K_1^4}{{\varepsilon}^2} \nonumber\\
&{\leqslant}\frac{576 K_1^4K_2^2}{{\varepsilon}^2}|S_i|^{1/2}|S_{i+1}|^{1/2}.\end{aligned}$$

Now, we can prove, by inductively applying Lemma \[lem:ruzsa\_triangle\], that $$|t_1t_2 \dots t_i \cdot S_1 - S_{i+1}| {\leqslant}\left(\frac{576 K_1^4K_2^2}{{\varepsilon}^2}\right)^i |S_1|^{1/2}|S_{i+1}|^{1/2}.$$ Thus, setting $i=k$, we learn that $$|t_1t_2 \dots t_k \cdot S_1 - S_1| {\leqslant}\left(\frac{576 K_1^4K_2^2}{{\varepsilon}^2}\right)^{K_1} |S_1|,$$ since $k {\leqslant}K_1$.

By hypothesis, $t_1t_2 \dots t_k \neq 1$. However, we know that $t_1t_2\dots t_k$ can be written in the form $M^{e_1}(M+1)^{e_2}$ for some integers $e_i$ not both zero. Suppose that $e_1$ is nonzero; the argument is similar if $e_2$ is nonzero.

Write $t_1t_2 \dots t_k = \frac{r}{s}$ for coprime integers $r {\text{ and }}s$; our hypothesis tells us that $M$ must divide $r$ or $s$. Therefore, $$|r| + |s| > \left(\frac{1000 K_1^4K_2^2}{{\varepsilon}^2}\right)^{K_1},$$ as a consequence of (\[eqn:condition\_on\_M\]).

Thus, we have shown that $|r \cdot S_1 - s \cdot S_1| {\leqslant}\left(\frac{576 K_1^4K_2^2}{{\varepsilon}^2}\right)^{K_1} |S_1|$. But, if $S_1$ is sufficiently large, this contradicts Theorem \[thm:bukh\_sod\_thm\], which states that $$|r \cdot S_1 - s \cdot S_1| > \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 depend on the path chosen.

Now, for each $d$, let $R_d = \cup_{i : d(i) = d} S_i$. Suppose that $S_i, S_j, S_k$ is a good triple, in that order (so, for example, the label on $S_i \rightarrow S_j$ is $a_2/a_1$). Then, setting $d$ = $a_1d(i)$, we have that $d(i) = d/a_1, d(j) = d/a_2 {\text{ and }}d(k) = d/a_3$.

Therefore, all of the solutions coming from the good triple $S_i, S_j, S_k$ will be counted in $T(R_{d/a_1}, R_{d/a_2}, R_{d/a_3})$, and so an upper bound for the total number of solutions coming from good triples is $$\sum_{d} T(R_{d/a_1}, R_{d/a_2}, R_{d/a_3}),$$ where the sum is taken over all $d$ such that all three of the $R_i$ exist (in particular, there can be no more than $n$ terms in the sum).

We may apply Lemma \[lem:uniform\_bound\_symmetric\] to give an upper bound for this. $$\begin{aligned}
\sum_{d} T(R_{d/a_1}, R_{d/a_2}, R_{d/a_3}) &{\leqslant}\frac{1}{4}\sum_d |R_{d/a_1}| |R_{d/a_2}| + |R_{d/a_1}| |R_{d/a_3}| + |R_{d/a_2}| |R_{d/a_3}| + 1 \nonumber\\
&{\leqslant}\frac{1}{4}\sum_{d_1 \sim d_2} |R_{d_1}||R_{d_2}| + K_1, \label{eqn:sum_of_RR}\end{aligned}$$ where the sum on the second line is over *unordered* pairs $d_1, d_2$ such that $d_1/d_2$ is equal to the ratio between two of the $a_i$. The second inequality follows because if $d_1 \sim d_2$, 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 in more than 3 variables {#sec:generalisation_to_k_var}
==================================

A fairly natural extension of Theorem \[thm:main\_theorem\] is to ask if a similar result holds for $k$-variable equations $$\label{eqn:to_solve_k_var}
a_1x_1 + \dots + a_kx_k = 0.$$ As before, let $T(S)$ be the number of solutions to (\[eqn:to\_solve\_k\_var\]) in $S$. Similarly, let $T(S_1, \dots, S_k)$ denote the number of solutions with $x_i$ taken from $S_i$. We have a trivial upper bound for $T(S)$, namely that $T(S) {\leqslant}|S|^{k-1}$.

Before presenting our analogous example to Proposition \[prop:twelfth\], we require some notation and definitions. Let $I_x : {\mathbb{R}}\rightarrow {\mathbb{R}}$ denote the indicator function of a (real) interval of length $x$ centred at the origin, so $I_x(y) = 1$ if and only if $|y| {\leqslant}\frac{x}{2}$, and $I_x(y) = 0$ otherwise.

\[def:defn\_of\_sigma\] For an integer $k {\geqslant}3$, define $$\label{eqn:interval_formula_for_sigma}
\sigma_k = (\underbrace{I_1 \ast \dots \ast I_1}_k)(0).$$

In the introduction, we gave the following formula for $\sigma_k$: $$\tag{\ref{eqn:definition_of_sigma}}
\sigma_k = \int_{-\infty}^{\infty} \left(\frac{\sin \pi x}{\pi x} \right)^k dx.$$ The equivalence of these forms follows from taking a Fourier transform and applying the convolution identity; the details can be seen in [@BorweinIntegral].

See also [@nathanson], where it can be shown that $\sigma_{2h}$ is the leading coefficient of the polynomial $\Psi_{h}(n)$.

$\sigma_k$ obeys a simple asymptotic (see for example [@Polya4Asymp], or [@GoddardAsymptotic] for more terms): $$\sigma_k = \sqrt{\frac{6}{k \pi}} \left(1 + O(1/k)\right)$$ as $k \rightarrow \infty$.

We may interpret $\sigma_k$ combinatorially. If $f_k$ is the probability density function of a sum of $k$ independent random variables distributed uniformly on $[-1/2, 1/2]$, then $\sigma_k = f_k(0)$. Thus, the form of the asymptotic for $\sigma_k$ is not surprising, in view of the Central Limit theorem.

\[def:definition\_of\_phi\] For $t_1, \dots, t_k$ positive real numbers, define the function $\Phi = \Phi_k$ by $$\label{eqn:definition_of_phi}
\Phi(t_1, \dots, t_k) = (I_{t_1} \ast \dots \ast I_{t_k})(0).$$

In particular, $\sigma_k = \Phi_k(1, \dots, 1)$.

There is an explicit formula for $\Phi$. In general, we have $$\label{eqn:phi_closed_form_k_var}
\Phi_k(t_1, \dots, t_k) = \frac{1}{(k-1)!2^k}\sum_{{\varepsilon}\in \{\pm 1\}^{k}} \omega ({\varepsilon}) ({\varepsilon}\cdot \mathbf{t})^{k-1} \operatorname{sgn}({\varepsilon}\cdot \mathbf{t}),$$ where $\omega({\varepsilon}) = \prod_i {\varepsilon}_i$ and ${\varepsilon}\cdot \mathbf{t} = \sum_i {\varepsilon}_it_i$ and $\operatorname{sgn}$ denotes the sign function. This is established in [@BorweinIntegral].

For $k = 3$, we can write (for $t_1 {\leqslant}t_2 {\leqslant}t_3$) $$\label{eqn:phi_closed_form_3_var}
\Phi_3(t_1,t_2,t_3) = \begin{cases}
t_1t_2 & t_3{\geqslant}t_1+t_2\\
\dfrac{2(t_1t_2+t_2t_3+t_1t_3) - (t_1^2+t_2^2+t_3^2)}{4} & \text{ otherwise}.
\end{cases}$$

In analogy with Proposition \[prop:twelfth\], we have the following.

\[prop:twelfth\_k\_var\] Let $k {\geqslant}3$ be an integer. For any equation $a_1x_1 + \dots + a_kx_k = 0,$ there are large sets $S$ for which $$\label{eqn:size_of_S_k_var}
T(S) {\geqslant}\frac{\sigma_k}{k^{k-1}} |S|^{k-1} + O(|S|^{k-2}).$$

The proof of Proposition \[prop:twelfth\_k\_var\] will rely on the following fact, which states that, when the coefficients $a_i$ are all 1, long progressions behave somewhat like real intervals.

\[prop:intervals\_like\_progressions\] Suppose $S_1, \dots, S_k$ are arithmetic progressions centred at the origin, with the same common difference. Let $s_i$ be the number of terms in $S_i$.

Then, the number of solutions to $x_1 + \dots + x_k = 0$ where each $x_i \in S_i$ is $$\Phi(s_1, \dots, s_k) + O_k((s_1 + \dots + s_k)^{k-2}).$$

We may assume without loss of generality that the progressions $S_i$ have common difference 1. To prove Proposition \[prop:intervals\_like\_progressions\], it suffices to use the following observation.

Suppose that $y_1, \dots, y_{k-1}$ are elements of the real intervals $I_{s_1}, \dots, I_{s_{k-1}}$. Then, we have the following two implications for $k-1$-tuples of real numbers $y_1, \dots, y_{k-1}$.

-   If $|y_1 + \dots + y_{k-1}| {\leqslant}\frac{s_k}{2},$ then $\left|\lfloor y_1\rfloor + \dots + \lfloor y_{k-1}\rfloor \right| {\leqslant}\frac{s_k}{2} + k;$

-   If $\left|\lfloor y_1\rfloor + \dots + \lfloor y_{k-1}\rfloor \right| {\leqslant}\frac{s_k}{2} - k,$ then $|y_1 + \dots + y_{k-1}| {\leqslant}\frac{s_k}{2}.$

Now, $T(S_1, \dots, S_k)$ counts the number of $k-1$-tuples of integers $(x_i)_{i=1}^{k-1}$ with $x_i \in S_i$, such that $- \sum_i x_i \in S_k$.

Up to an error which is at most $O_k((s_1 + \dots + s_k)^{k-2})$, this can be written as an integral $$\int_{-s_1/2}^{s_1/2} \dots \int_{-s_{k-1}/2}^{s_{k-1}/2} {\mathds{1}}_{|\lfloor y_1\rfloor + \dots + \lfloor y_{k-1}\rfloor | {\leqslant}s_k/2}dy_1 \dots dy_{k-1}.$$ The two implications above allow us to show that, up to acceptable error, this is equal to $$\int_{-s_1/2}^{s_1/2} \dots \int_{-s_{k-1}/2}^{s_{k-1}/2} {\mathds{1}}_{|y_1+ \dots + y_{k-1} | {\leqslant}s_k/2}dy_1 \dots dy_{k-1},$$ which is equal to $\Phi(s_1, \dots, s_k)$; we omit the details.

We are now ready to prove Proposition \[prop:twelfth\_k\_var\].

As in Proposition \[prop:twelfth\], we will consider $S$ as the union of $k$ sets $S_1, \dots, S_k$, with the property that $T(S_1, \dots, S_k)$ is large.

The way we will do this is as follows. Let $M$ be a large integer, which we assume to be divisible by $2k$. Define $$S_i = \frac{1}{a_i}[-M/2k, M/2k]$$ for each $i$ with $1 {\leqslant}i {\leqslant}k$, where we may normalise the sets to consist of integers by multiplying by $\prod_i a_i$. Then, let $S = \cup_i S_i$, so that $|S| {\leqslant}M$.

It remains to show that $T(S_1, \dots, S_k) {\geqslant}\frac{\sigma_k}{k^{k-1}} M^{k-1} + O(M^{k-2}).$ But this follows as an easy consequence of Proposition \[prop:intervals\_like\_progressions\]. Indeed, $$\begin{aligned}
T(S_1, \dots, S_k) &= \Phi_k(M/k, \dots, M/k) + O(M^{k-2})\\
&= \left(\frac{M}{k}\right)^{k-1}\Phi_k(1, \dots, 1) + O(M^{k-2}) \\
&= \frac{\sigma_k}{k^{k-1}} M^{k-1} + O(M^{k-2}).\end{aligned}$$

Perhaps unsurprisingly, Theorem \[thm:main\_theorem\] also generalises to this setting.

\[thm:main\_theorem\_k\_var\] Let ${\varepsilon}> 0$. Then, there exist coefficients $a_1, \dots, a_k$ with the property that, for any suitably large set $S$, $$T(S) {\leqslant}\left( \frac{\sigma_k}{k^{k-1}} + {\varepsilon}\right)|S|^{k-1} + o(|S|^{k-1}).$$

The proof of Theorem \[thm:main\_theorem\_k\_var\] is broadly similar to the proof of Theorem \[thm:main\_theorem\]. There are two main places in which the argument slightly differs. Firstly, we must generalise Lemma \[lem:easy\_TNRG\_lemma\] to give a bound for $T(S_1, \dots, S_k)$ in terms of $E(S_1, S_2)$:

\[lem:easy\_TNRG\_lemma\_k\_var\] Suppose that $S_1, \dots, S_k \subseteq {\mathbb{Z}}$ are finite sets. Then $$T(S_1, \dots, S_k)^2 {\leqslant}E(a_1 \cdot S_1, a_2 \cdot S_2) \left(|S_3||S_4|\dots |S_k|\right)^{2 - 1/(k-2)}.$$

For any $t \in {\mathbb{Z}}$, let $\mu(t)$ denote the number of ways of writing $t = a_1x_1 + a_2x_2$, for $x_i \in S_i$. Thus, by definition, $$E(a_1\cdot S_1, a_2\cdot S_2) = \sum_t \mu(t)^2.$$ Define $\nu(t)$ to be the number of ways of writing $t = -a_3x_3 - \dots - a_kx_k$, for $x_i \in S_i$. Thus, we see that $$\begin{aligned}
T(S_1, \dots, S_k)^2 &= \left(\sum_t \mu(t) \nu(t)\right)^2 \\
&{\leqslant}\left(\sum_t \mu(t)^2\right)\left(\sum_t \nu(t)^2\right) \\
&= E(a_1\cdot S_1, a_2\cdot S_2)\left(\sum_t \nu(t)^2\right).\end{aligned}$$ Finally, we observe that $\sum_t \nu(t)^2$ represents the number of solutions to the equation $$a_3x_3 + \dots + a_kx_k = a_3x_3' + \dots + a_kx_k',$$ and so we can bound it by $(|S_3| \dots |S_k|)^{2 - \frac{1}{k-2}},$ by the same argument used in (\[eqn:bound\_energy\]) to bound the energy.

Secondly, we will have to apply a $k$ variable analogue of Lemma \[lem:uniform\_bound\_symmetric\]. The analogue of this is the following:

\[lem:uniform\_bound\_symmetric\_k\_var\] Suppose that $S_1, \dots, S_k \subseteq {\mathbb{Z}}$ are sets with $|S_i| = s_i$. Then $$T(S_1, \dots, S_k) {\leqslant}\frac{\sigma_k}{k} \left( \sum_i \hat{s_i} \right) + O\left(\sum_i s_i \right)^{k-2},$$ where $\hat{s_i} = \prod_{j \neq i} s_j$.

This lemma is actually weaker than Lemma \[lem:uniform\_bound\_symmetric\], where the error term was $O(1)$. The weaker error term here comes from our reduction to the real case using Proposition \[prop:intervals\_like\_progressions\]; an inductive proof would likely give an $O(\sum s_i)^{k-3}$ error term. However, the $O(\sum s_i)^{k-2}$ error term is sufficient for our purpose.

If $k$ is even, we can actually deduce a stronger version of (\[eqn:to\_prove\_about\_convolution\]) by using Hölder’s inequality. We have $$\begin{aligned}
\Phi_k(s_1, \dots, s_k) &= \frac{1}{2\pi} \int_{-\infty}^{\infty} \widehat{I_{s_1}}(r) \dots \widehat{I_{s_k}}(r) dr \\
&{\leqslant}\frac{1}{2\pi}\left( \prod_i \int_{-\infty}^{\infty} \widehat{I_{s_i}}(r) dr \right)^{1/k} \\
&= \prod_i \Phi_k(s_i, \dots, s_i)^{1/k} \\
&= \sigma_k (s_1 \dots s_k)^{1 - 1/k},\end{aligned}$$ where the second line used Hölder’s inequality along with the fact that $k$ is even. This is stronger than (\[eqn:to\_prove\_about\_convolution\]) via an application of the AM-GM inequality.

It is unclear whether the stronger version holds in the case that $k$ is odd; indeed, it is not too hard to establish for $k = 3$ by using (\[eqn:phi\_closed\_form\_3\_var\]). However, this stronger form is not necessary, so we only prove the version we need.

First, observe that the statement of the lemma is unchanged if we assume without loss of generality that each $a_i$ is 1, since we may replace $S_i$ with $a_i \cdot S_i$.

The first step in the proof is to apply [@lev_max Theorem 1], which says that we may take each $S_i$ to be an interval of length $s_i$, roughly centred at the origin (depending on the parity of $s_i$), in order to maximise $T(S_1, \dots, S_k)$. We may immediately apply Proposition \[prop:intervals\_like\_progressions\], which says that $$T(S_1, \dots, S_k) = \Phi_k(s_1, \dots, s_k) + O((s_1 + \dots + s_k)^{k-2}).$$ Thus, it suffices to prove that $$\label{eqn:to_prove_about_convolution}
\Phi(s_1, \dots, s_k) {\leqslant}\frac{\sigma_k}{k} \left( \sum_i \hat{s_i} \right).$$ This will follow if we can prove that, for positive real numbers $t_1, \dots, t_k$, $$\label{eqn:to_prove_about_phi_flipped}
t_1\dots t_k \Phi(t^{-1}_1, \dots, t^{-1}_k) {\leqslant}\frac{\sigma_k}{k}(t_1 + \dots + t_k).$$

To prove (\[eqn:to\_prove\_about\_phi\_flipped\]), first observe that equality holds in the case that all of the $t_i$ are equal. Indeed, when $t_i = 1$ the relation follows from the definition of $\sigma$, and for other constant values of $t_i$ the equality follows by homogeneity.

Set $\Theta(t_1, \dots, t_k) = t_1 \dots t_k \Phi(t^{-1}_1, \dots, t^{-1}_k)$. To prove that $\Theta(t_1, \dots, t_k)$ achieves its maximum value (with $t_1 + \dots + t_k$ fixed) when all of the $t_i$ are equal, observe that it will suffice to prove the following claim.

\[clm:make\_si\_equal\] If $t_1 + t_2$ is fixed (as well as each of $t_3, \dots, t_k$), then $\Theta(t_1, \dots, t_k)$ achieves its maximum when $t_1 = t_2$.

To see that this claim is sufficient, observe that we may repeatedly replace the largest and smallest of the $t_i$ with their average. In doing so, $\max t_i - \min t_i$ will tend to 0, and we can use the continuity of $\Theta$ to obtain the result.

To prove Claim \[clm:make\_si\_equal\], recall the expression for $\Theta(t_1, \dots, t_k)$: $$\begin{aligned}
\Theta(t_1, \dots, t_k) &= t_1t_2 (t_3\dots t_k) (I_{t^{-1}_1} \ast I_{t^{-1}_2}) \ast (I_{t^{-1}_3} \ast \dots \ast I_{t^{-1}_k})(0) \\
&= (t_1 t_2 (I_{t^{-1}_1} \ast I_{t^{-1}_2}) \ast g)(0),\end{aligned}$$ where $g(x) = t_3 \dots t_k (I_{t^{-1}_3} \ast \dots \ast I_{t^{-1}_k})(x)$.

Now, observe that $g$ may be written as a combination of intervals, in the following sense: $$g(x) = \int_0^{\infty} h(r) I_r(x) dr,$$ for some function $h : {\mathbb{R}}_{>0} \rightarrow {\mathbb{R}}_{>0}$ with bounded support. (The exception is when $k = 3$, in which case $g$ is just a single interval. But that will not affect the remainder of the proof of Claim \[clm:make\_si\_equal\].)

To see why this is the case, we may use induction. If $k = 4$, then suppose without loss of generality that $t_3 {\leqslant}t_4$. Then, we take $h(r) = t_3t_4$ if $\frac{t_3^{-1} - t_4^{-1}}{2} {\leqslant}r {\leqslant}\frac{t_3^{-1} + t_4^{-1}}{2}$, and 0 otherwise. For $k > 4$, it is easiest to apply the induction hypothesis to $I_{t^{-1}_3} \ast \dots \ast I_{t^{-1}_{k-1}}$, and then use a similar decomposition to the one we used for the $k=4$ case. We omit the details.

In view of this decomposition, proving Claim \[clm:make\_si\_equal\] may be reduced to the following claim:

\[clm:make\_si\_equal\_against\_indicator\] Fix $t_1 + t_2$. Then, for any choice of $t$, we have that $t_1 t_2 (I_{t^{-1}_1} \ast I_{t^{-1}_2} \ast I_t)(0)$ is maximised when $t_1 = t_2$.

In fact, the easiest way to prove Claim \[clm:make\_si\_equal\_against\_indicator\] is via the following explicit formula for $(I_a \ast I_b \ast I_c)(0)$: $$\label{eqn:formula_for_phi_3}
(I_a \ast I_b \ast I_c)(0) = \begin{cases}
ab & c{\geqslant}a+b\\
\dfrac{2(ab+bc+ca) - (a^2+b^2+c^2)}{4} & \text{ otherwise},
\end{cases}$$ assuming that $c {\geqslant}a,b$ without loss of generality.

Given (\[eqn:formula\_for\_phi\_3\]), we can prove that $\Theta(a, b, c)$ is a concave function. If, for instance, $c^{-1} > a^{-1} + b^{-1}$, then $\Theta(a, b, c) = c$ which is clearly concave. When $a^{-1}, b^{-1} {\text{ and }}c^{-1}$ satisfy the triangle inequality, then $$\Theta(a, b, c) = \dfrac{2(a + b + c) - (abc^{-1} + ab^{-1}c + a^{-1}bc)}{4}.$$ We may prove that this is concave by computing the Hessian matrix and showing that it is nonpositive-definite everywhere; for instance, by using Sylvester’s Rule. We omit the details.

In particular, $t \Theta(t_1, t_2, t^{-1}) = t_1 t_2 (I_{t^{-1}_1} \ast I_{t^{-1}_2} \ast I_t)(0)$ is concave as a function of $t_1 {\text{ and }}t_2$. Therefore, $$\frac{1}{2}\left(t \Theta(t_1, t_2, t^{-1}) + t \Theta(t_2, t_1, t^{-1})\right) {\leqslant}t \Theta\left(\frac{t_1+t_2}{2}, \frac{t_1+t_2}{2}, t^{-1}\right),$$ which is exactly the statement of Claim \[clm:make\_si\_equal\_against\_indicator\]. This completes the proof of Claim \[clm:make\_si\_equal\], and thus Lemma \[lem:uniform\_bound\_symmetric\_k\_var\].

Armed with our more general Lemmas \[lem:easy\_TNRG\_lemma\_k\_var\] and \[lem:uniform\_bound\_symmetric\_k\_var\], we may use an argument similar to the proof of Theorem \[thm:main\_theorem\] in section 3 in order to prove Theorem \[thm:main\_theorem\_k\_var\].

Select $a_1, \dots, a_k$ to be coprime integers so that $a_1 = 1$, and $|a_i|$ is sufficiently large for $i \neq 1$. Let $S$ be a large set of integers.

With Lemma \[lem:easy\_TNRG\_lemma\_k\_var\] replacing Lemma \[lem:easy\_TNRG\_lemma\], much of the argument is the same as the proof of Theorem \[thm:main\_theorem\]:

-   We start by using Theorem \[thm:green\_sisask\_structure\] to split $S = S_1 \amalg \dots \amalg S_n \amalg S_0$, and show that $S_0$ can be ignored.

-   We can define the labelled digraph $G$ which captures almost all of the solutions to $a_1x_1 + \dots + a_kx_k = 0$.

-   We can prove that the product of the labels along a cycle must be 1, allowing us to define the function $d : [n] \rightarrow {\mathbb{Q}}$ as in (\[eqn:defn\_of\_depth\]).

-   This allows us to show that an upper bound for the number of solutions coming from good $k$-tuples is $$\sum_d T(R_{d/a_1}, \dots, R_{d/a_k}),$$ where $R_{d}$ is the union of the $S_i$ with $d(i) = d$ (as in the case $k=3$, this sum can have no more than $n$ terms).

Lemma \[lem:uniform\_bound\_symmetric\_k\_var\] allows us to bound this: $$\begin{aligned}
\sum_d T(R_{d/a_1}, \dots, R_{d/a_k}) &{\leqslant}\sum_d \frac{\sigma_k}{k} \sum_i \widehat{R_{d/a_i}} + O(K_1 |S|^{k-2}) \nonumber\\
&{\leqslant}\frac{\sigma_k}{k} \sum_{(d_1, \dots, d_{k-1})} |R_{d_1}|\dots|R_{d_{k-1}}| + O(K_1 |S|^{k-2}).\label{eqn:sum_as_Rdi_k}\end{aligned}$$ On the first line, $\widehat{R_{a/d_i}}$ denotes the product of the other $|R_{d/a_j}|$, and the error term comes from the fact that there are at most $n < K_1$ terms in the sum on the left hand side. On the second line, the sum is over unordered $k-1$-tuples $(d_1, \dots, d_{k-1})$ for which, for some ordering of the $a_i$, we have that $a_{i_1}d_1 = \dots = a_{i_{k-1}}d_{k-1}$; there can only be one such ordering by coprimality.

Now, for $i = 0, 1, \dots, k-1$, define the quantity $X_i$ by $$X_i = \sum_{\substack{d = a_2^{e_2} \dots a_k^{e_k} \\ e_2 + 2e_3 + \dots + (k-1)e_k \equiv d \mod k}} |R_d|.$$ Note that if $d$ is such that $R_d$ is nonempty, then the representation of $d$ as a product $d = a_2^{e_2} \dots a_k^{e_k}$ exists due to how we constructed the labels, and is unique due to the coprimality of the $a_i$.

Now, suppose that $R_{d_1}$ and $R_{d_2}$ appear together in at least one term on the right hand side of (\[eqn:sum\_as\_Rdi\_k\]). Then, $d_1/d_2 = a_i/a_j$ for some $i \neq j$, and so $R_{d_1} {\text{ and }}R_{d_2}$ contribute to different $X_i$.

Thus, we may upper bound the sum in the right hand side of (\[eqn:sum\_as\_Rdi\_k\]): $$\begin{aligned}
\sum_{(d_1, \dots, d_{k-1})} |R_{d_1}|\dots|R_{d_{k-1}}| {\leqslant}\sum_i \widehat{X_i},\end{aligned}$$ where $\widehat{X_i} = \prod_{j \neq i}X_j$. This bound follows from the fact that each unordered $k-1$-tuple $|R_{d_1}|\dots |R_{d_{k-1}}|$ on the left hand side contributes to exactly one of the terms on the right hand side.

Finally, observe that $$\sum_i \widehat{X_i} {\leqslant}\frac{1}{k^{k-2}} \left(\sum_i X_i\right)^{k-1}.$$ To see why, observe that if $X_i + X_j$ is kept fixed, moving $X_i$ and $X_j$ closer together increases the value of the left hand side without changing the right hand side. Thus the left hand side is maximised when the $X_i$ are all the same, at which point equality occurs.

Putting all of this together, we learn that $$\sum_d T(R_{d/a_1}, \dots, R_{d/a_k}) {\leqslant}\frac{\sigma_k}{k^{k-1}} |S|^{k-1} + O(|S|^{k-2}),$$ which gives the bound in the statement of Theorem \[thm:main\_theorem\_k\_var\] when $|S|$ is large enough.

Systems of more than one equation {#sec:generalisation_to_systems}
=================================

Another way in which one might wish to extend Theorem \[thm:main\_theorem\] is to ask if a similar result holds for systems of $m$ equations in $k$ variables. One might imagine that a result of the following form ought to hold.

Suppose that $k {\geqslant}m+2$ and $m {\geqslant}1.$ Does there exist an explicit positive constant $\sigma_{m, k}$ with the following properties:

-   For any system $\mathcal{A}$ of $m$ equations in $k$ variables, there are be large sets $S$, for which there are at least $(\sigma_{m, k} - o(1)) |S|^{k-m}$ $k$-tuples in $S$ satisfying $\mathcal{A}$.

-   For any ${\varepsilon}> 0$, there are systems such that the number of $k$-tuples satisfying $\mathcal{A}$ in *any* large $S \subseteq {\mathbb{Z}}$ is no more than $(\sigma_{m, k} + {\varepsilon})|S|^{k - m}$.

Thus, Theorems \[thm:main\_theorem\] and \[thm:main\_theorem\_k\_var\] tell us that $\sigma_{m, k}$ exists whenever $m = 1$, and that $\sigma_{1, k} = \sigma_k$. However, it turns out that when $m > 1$, not even the first of these has a positive answer, in the following sense.

\[thm:no\_system\_thm\] Let ${\varepsilon}> 0$. Then, there exists a non-degenerate system of two equations in four variables with the property that for any large enough $S$, there are no more than ${\varepsilon}|S|^2$ solutions to the system in $S$.

It is easy to see that Theorem \[thm:no\_system\_thm\] implies the analogous result for any choice of $k, m$ with $k {\geqslant}m+2$ and $m > 1$.

The goal of this section is to prove Theorem \[thm:no\_system\_thm\].

We will prove Theorem \[thm:no\_system\_thm\] for the following system:

\[eqn:the\_system\] x + y &= z\
x + My &= w,

where $M$ is a sufficiently large constant (in terms of ${\varepsilon}$) to be chosen later.

We will start by borrowing the following lemma, which appears as part of the proof of the Balog-Szemerédi-Gowers theorem.

\[lem:BSGLemma\] Let $G$ be a bipartite graph with vertex sets $A$ and $B$ and edge set $E \subseteq A \times B$. Suppose that $|E| {\geqslant}{\varepsilon}|A||B|$, for some ${\varepsilon}> 0$. Then we can find subsets $A' \subseteq A$ and $B' \subseteq B$, with $|A'| \gg_{\varepsilon}|A|$ and $|B'| \gg_{\varepsilon}|B|,$ such that, whenever $a \in A'$ and $b \in B'$, there are $ \gg_{\varepsilon}|A||B|$ paths of length three from $a$ to $b$ in $G$.

Let $S$ be a sufficiently large set (in terms of $M {\text{ and }}{\varepsilon}$), and suppose that there are more than ${\varepsilon}|S|^2$ solutions to (\[eqn:the\_system\]) in $S$. Consider the bipartite graph on vertex set $A \amalg B$, where $A = B = S$; that is, both parts of $G$ are $S$. Draw an edge from $a$ to $b$ if and only if there is a solution to (\[eqn:the\_system\]) with $x = a {\text{ and }}y = b$; in other words, if $a + b {\text{ and }}a + Mb$ are both in $S$. In particular, $G$ has at least ${\varepsilon}|S|^2$ edges.

We may immediately apply Lemma \[lem:BSGLemma\] to $G$. This gives us sets $A' \subseteq A {\text{ and }}B' \subseteq B$ such that, for any $a \in A' {\text{ and }}b \in B'$, there are $\gg_{\varepsilon}|S|^2$ paths of length 3 in $G$ from $a$ to $b$.

These sets $A'$ and $B'$ satisfy $|A' + B'| \ll_{\varepsilon}|S|$ and $|A' + M \cdot B'| \ll_{\varepsilon}|S|$.

To prove this claim, we can use an argument similar to that used in the proof of the Balog-Szemerédi-Gowers theorem. Showing that $|A' + B'| \ll_{\varepsilon}|S|$ and $|A' + M \cdot B'| \ll_{\varepsilon}|S|$ are similar, so we will only do the former.

Let $X$ denote the set of triples $(x, y, z)$ of elements of $(A + B) \cap S$, for which $x - y + z \in A' + B'$. We may trivially upper bound $|X|$; indeed, $|(A + B) \cap S| {\leqslant}|S|$, so $|X| {\leqslant}|S|^3$.

For a lower bound on $|X|$, consider an element $a + b$ of $A' + B'$. By definition, there are $\gg_{\varepsilon}|S|^2$ paths of length 3 from $a$ to $b$ in $G$. Each such path may be written $a \sim b', a' \sim b', a' \sim b$ for some $a' \in A, b' \in B$. In other words, $a + b', a' + b' {\text{ and }}a + b'$ are all in $S$.

Now, $(a+b') - (a'+b') + (a'+b) = (a+b),$ so we have located a triple $x, y, z \in (A+B)\cap S$ with $x - y + z = a+b$. These triples will be different for different paths, and so there must be $\gg_{\varepsilon}|S|^2$ such triples.

There are $|A' + B'|$ elements of $A' + B'$, each of which gives $\gg_{\varepsilon}|S|^2$ triples $x, y, z$. Thus, we have that $|A' + B'| |S|^2 \ll_{\varepsilon}|S|^3$, and thus $|A' + B'| \ll_{\varepsilon}|S|$, as required.

Let us now see how we may use this claim to complete the proof of Theorem \[thm:no\_system\_thm\]. Lemma \[lem:ruzsa\_triangle\] immediately tells us that $|B' - M \cdot B'| \ll_{\varepsilon}|S|$, and thus that $|B' - M \cdot B'| \ll_{\varepsilon}|B'|$. This contradicts Theorem \[thm:bukh\_sod\_thm\], provided that $M$ is sufficiently large.

[15]{} \[1\][\#1]{} \[1\][`#1`]{} urlstyle \[1\][doi: \#1]{}

J. Aaronson. Maximising the number of solutions to a linear equation in a set of integers. *arXiv preprint arXiv:1801.07135v2*, 2018.

B. Bhattacharya, S. Ganguly, X. Shao, and Y. Zhao. Upper tails for arithmetic progressions in a random set. *arXiv preprint arXiv:1605.02994*, 2016.

D. Borwein and J. Borwein. Some remarkable properties of sinc and related integrals. *Ramanujan J.*, 50 (1):0 73–89, 2001.

B. Bukh. Sums of dilates. *Combin. Probab. Comput.*, 170 (5):0 627–639, 2008.

R. M. Gabriel. The [R]{}earrangement of [P]{}ositive [F]{}ourier [C]{}oefficients. *Proc. London Math. Soc. (2)*, 330 (1):0 32–51, 1931.

S. Ganguly. Personal communication, 2018.

L. S. Goddard. Lii. the accumulation of chance effects and the gaussian frequency distribution. *The London, Edinburgh, and Dublin Philosophical Magazine and Journal of Science*, 360 (257):0 428–433, 1945.

B. Green and O. Sisask. On the maximal number of 3-term arithmetic progressions in subsets of [${\mathbb}Z/p{\mathbb}Z$]{}. *Bull. Lond. Math. Soc.*, 400 (6):0 945–955, 2008.

G. H. Hardy and J. E. Littlewood. Notes on the theory of series (viii): an inequality. *Journal of the London Mathematical Society*, 10 (2):0 105–110, 1928.

G. H. Hardy, J. E. Littlewood, and G. P[ó]{}lya. *Inequalities*. Cambridge university press, 1952.

V. Lev. On the number of solutions of a linear equation over finite sets. *J. Combin. Theory Ser. A*, 830 (2):0 251–267, 1998.

V. Lev and R. Pinchasi. Solving [$a\pm b=2c$]{} in elements of finite sets. *Acta Arith.*, 1630 (2):0 127–140, 2014.

M. B. Nathanson. Growth polynomials for additive quadruples and [$(h,k)$]{}-tuples. *Acta Math. Hungar.*, 1430 (1):0 44–57, 2014.

G. Polya. Berechnung eines bestimmten [I]{}ntegrals. *Math. Ann.*, 740 (2):0 204–212, 1913.

T. Tao and V. H. Vu. *Additive combinatorics*, volume 105 of *Cambridge Studies in Advanced Mathematics*. Cambridge University Press, Cambridge, 2010.
