# The largest $(k,\ell)$-sum-free subsets

Yifan Jing  Department of Mathematics, University of Illinois at Urbana-
Champaign, Urbana IL, USA<EMAIL_ADDRESS>and  Shukun Wu  Department of
Mathematics, University of Illinois at Urbana-Champaign, Urbana IL, USA
<EMAIL_ADDRESS>Dedicated to the memory of Jean Bourgain

###### Abstract.

Let $\mathscr{M}_{(2,1)}(N)$ be the infimum of the largest sum-free subset of
any set of $N$ positive integers. An old conjecture in additive combinatorics
asserts that there is a constant $c=c(2,1)$ and a function
$\omega(N)\to\infty$ as $N\to\infty$, such that
$cN+\omega(N)<\mathscr{M}_{(2,1)}(N)<(c+o(1))N$. The constant $c(2,1)$ is
determined by Eberhard, Green, and Manners, while the existence of $\omega(N)$
is still wide open.

In this paper, we study the analogous conjecture on $(k,\ell)$-sum-free sets
and restricted $(k,\ell)$-sum-free sets. We determine the constant $c(k,\ell)$
for every $(k,\ell)$-sum-free sets, and confirm the conjecture for infinitely
many $(k,\ell)$.

###### 2010 Mathematics Subject Classification:

Primary 11B30; Secondary 11K70, 05D10

##  1\. Introduction

In 1965, Erdős asked the following question [11]. Given an arbitrary sequence
$A$ of $N$ different positive integers, what is the size of the largest sum-
free subsequence of $A$? By _sum-free_ we mean that if $x,y,z\in A$, then
$x+y\neq z$. Let

$\mathscr{M}_{(2,1)}(N)=\inf_{\begin{subarray}{c}A\subseteq\mathbb{N}^{>0}\\\
|A|=N\end{subarray}}\max_{\begin{subarray}{c}S\subseteq A\\\ S\text{ is sum-
free}\end{subarray}}|S|.$

Using a beautiful probabilistic argument, Erdős showed that every $N$-element
set $A\subseteq\mathbb{N}^{>0}$ contains a sum-free subset of size at least
$N/3$, in other words, $\mathscr{M}_{(2,1)}(N)\geq N/3$. It turns out that it
is surprisingly hard to improve upon this bound. The result was later improved
by Alon and Kleitman [2], who showed that $\mathscr{M}_{(2,1)}(N)\geq(N+1)/3$.
Bourgain [7], using an entirely different Fourier analytic argument, showed
that $\mathscr{M}_{(2,1)}(N)\geq(N+2)/3$, which is the best lower bound on
$\mathscr{M}_{(2,1)}(N)$ to date. In particular, the following conjecture has
been made in a series of papers. See [11, 7, 10, 28] for example.

######  Conjecture 1.

There is a function $\omega(N)\to\infty$ as $N\to\infty$, such that

$\mathscr{M}_{(2,1)}(N)>\frac{N}{3}+\omega(N).$

On the other hand, a recent breakthrough by Eberhard, Green, and Manners [10]
proved that $\mathscr{M}_{(2,1)}(N)=(1/3+o(1))N$. More precisely, they showed
that for every $\varepsilon>0$, when $N$ is large enough, there is a set
$A\subseteq\mathbb{N}^{>0}$ of size $N$, such that every subset of $A$ of size
at least $(1/3+\varepsilon)N$ contains $x,y,z$ with $x+y=z$. This result is
one of the first beautiful applications of the arithmetic regularity lemma.
Later, using a completely different argument, the result is generalized by
Eberhard [9] to _$k$ -sum-free_ set. A set $A$ is $k$-sum-free if for every
$y,x_{1},\dots,x_{k}\in A$, $y\neq\sum_{i=1}^{k}x_{i}$. Eberhard proved that
for every $\varepsilon>0$, there is a set $A\subseteq\mathbb{N}^{>0}$ of size
$N$, such that every subset of $A$ of size at least $(1/(k+1)+\varepsilon)N$
contains a $k$-sum. For more background we refer to the survey [28].

In this paper, we study the analogue of the Erdős sum-free set problem for
$(k,\ell)$-sum-free sets. Given two positive integers $k,\ell$ with $k>\ell$,
a set $A$ is _$(k,\ell)$ -sum-free_ if for every
$x_{1},\dots,x_{k},y_{1},\dots,y_{\ell}\in A$,
$\sum_{i=1}^{k}x_{k}\neq\sum_{j=1}^{\ell}y_{j}$. For example, using the
notation of $(k,\ell)$-sum-free, sum-free is $(2,1)$-sum-free; $k$-sum-free is
$(k,1)$-sum-free. Finding largest $(k,\ell)$-sum-free sets in some given
structures is well-studied in the past fifty years, for example, the size of
the maximum $(k,\ell)$-sum-free sets in finite cyclic groups was determined
recently by Bajnok and Matzke [4], and the size in compact abelian groups was
determined by Kravitz [18].

For every $A\subseteq\mathbb{N}^{>0}$, let

$\mathscr{M}_{(k,\ell)}(A)=\max_{\begin{subarray}{c}S\subseteq A\\\ S\text{ is
}(k,\ell)\text{-sum-
free}\end{subarray}}|S|,\quad\text{and}\quad\mathscr{M}_{(k,\ell)}(N)=\inf_{\begin{subarray}{c}A\subseteq\mathbb{N}^{>0}\\\
|A|=N\end{subarray}}\mathscr{M}_{(k,\ell)}(A).$

The problem of determining $\mathscr{M}_{(k,\ell)}(N)$ is suggested by Bajnok
[3, Problem G.41]. In fact, we can also make the following conjecture for
$(k,\ell)$-sum-free set, which is an analogue of Conjecture 1.

######  Conjecture 2.

Let $k>\ell>0$. There is a constant $c=c(k,\ell)>0$, and a function
$\omega(N)\to\infty$ as $N\to\infty$, such that

$cN+\omega(N)<\mathscr{M}_{(k,\ell)}(N)<(c+\varepsilon)N,$

for every $\varepsilon>0$.

As we mentioned above, the constant $c(k,\ell)$ in Conjecture 2 for
$(k,\ell)=(2,1)$ is determined by Eberhard, Green, and Manners [10], and for
$(k,\ell)=(k,1)$ is determined by Eberhard [9]. The conjecture for
$(k,\ell)=(3,1)$ is confirmed by Bourgain [7].

Our first result determines the constant $c(k,\ell)$ in Conjecture 2 for every
$(k,\ell)$ (see statements (i) and (iv) of Theorem 1.1), which answers a
question asked by Bajnok [3] when the ambient group is $\mathbb{Z}$. The
statement (ii) of Theorem 1.1 also confirms Conjecture 2 for infinitely many
$(k,\ell)$.

######  Theorem 1.1.

Let $k,\ell$ be two positive integers and $k>\ell$. Then the following hold:

_(i)_ for every $k,\ell$, we have
$\mathscr{M}_{(k,\ell)}(N)\geq\frac{N}{k+\ell}$.

_(ii)_ suppose $k=5\ell$. Then

(1) $\mathscr{M}_{(k,\ell)}(N)\geq\frac{N}{k+\ell}+c\frac{\log N}{\log\log
N},$

where $c>0$ is an absolute constant that only depends on $k,\ell$.

_(iii)_ for every set $A$ of $N$ positive integers, for every positive even
integer $u$, there is an odd integer $v<u$ such that if $k=(u+v)\ell/(u-v)$,
then

(2) $\mathscr{M}_{(k,\ell)}(A)\geq\frac{N}{k+\ell}+c\frac{\log N}{\log\log
N},$

where $c>0$ is an absolute constant that only depends on $k,\ell$.

_(iv)_ for every $k,\ell$, we have
$\mathscr{M}_{(k,\ell)}(N)=\big{(}\frac{1}{k+\ell}+o(1)\big{)}N$.

We remark that Theorem 1.1 (iii) also implies estimate (1) when $k=3\ell$,
which in particular covers the $(3,1)$-sum-free case obtained by Bourgain.
This is because when $u=2$, the only possible value of $v$ is $1$, and this
gives us $k=3\ell$. It follows that estimate (2) holds for every $N$-element
set $A$ when $k=3\ell$. Hence, by the definition of
$\mathscr{M}_{(k,\ell)}(N)$, we prove estimate (1) when $k=3\ell$.

The upper bound construction given by Eberhard, Green, and Manners [10] for
$(2,1)$-sum-free set actually works in a more general setting: restricted
$(2,1)$-sum-free set. A set $A$ is _restricted $(k,\ell)$-sum-free_ if for
every $k$ distinct elements $a_{1},\dots,a_{k}$ in $A$, and $\ell$ distinct
elements $b_{1},\dots,b_{\ell}$ in $A$, we have
$\sum_{i=1}^{k}a_{i}\neq\sum_{j=1}^{\ell}b_{j}$. Let

$\widehat{\mathscr{M}}_{(k,\ell)}(N)=\inf_{\begin{subarray}{c}A\subseteq\mathbb{N}^{>0}\\\
|A|=N\end{subarray}}\max_{\begin{subarray}{c}S\subseteq A\\\ S\text{ is
restricted }(k,\ell)-\text{sum free}\end{subarray}}|S|.$

Clearly, we have that
$\mathscr{M}_{(k,\ell)}(N)\leq\widehat{\mathscr{M}}_{(k,\ell)}(N)$. Our next
theorem gives us an upper bound on $\widehat{\mathscr{M}}_{(k,\ell)}(N)$ when
$k\leq 2\ell+1$.

######  Theorem 1.2.

Let $k,\ell$ be positive integers, and $k\leq 2\ell+1$. Then

$\widehat{\mathscr{M}}_{(k,\ell)}(N)=\Big{(}\frac{1}{k+\ell}+o(1)\Big{)}N.$

### Overview

The paper is organized as follows. In the next section, we provide some basic
definitions and properties in additive combinatorics, harmonic analysis, and
model theory (or more precisely, nonstandard analysis) used later in the
proof. In Section 3, we prove a variant of the weak Littlewood conjecture,
based on the ideas introduced by Bourgain [7]. Theorem 1.1 (i) is proved by
using the probabilistic argument introduced by Erdős, and some structural
results for the $(k,\ell)$-sum-free open set on the torus. This is included in
Section 4. One of the main parts of the paper is to prove Theorem 1.1 (ii) and
(iii). The special case for $(3,1)$-sum-free set is proved by Bourgain [7],
but his argument relies heavily on the fact that a certain term of the Fourier
coefficient of the characteristic function is multiplicative, which is not
true for the other $(k,\ell)$. Here we introduce a different sieve function,
as well as a finer control on the functions we constructed. We will discuss it
in detail in Section 5. In Sections 6 and 7, we prove Theorem 1.1 (iv). The
proof goes by showing that the constructions given by Eberhard [9] for
$(k,1)$-sum-free sets, the Følner sequence, is still the correct construction
for the other $(k,\ell)$-sum-free sets. The new ingredients contain structural
results for the large infinite $(k,\ell)$-sum-free sets, which can be viewed
as a generalization of the Łuczak–Schoen Theorem [21]. We will prove Theorem
1.2 in Section 8. In Section 9, we make some concluding remarks, and pose some
open problems.

##  2\. Preliminaries

###  2.1. Additive combinatorics

Throughout the paper, we use standard definitions and notation in additive
combinatorics as given in [27]. Let $p$ be a prime, and let $m,n,N$ ranging
over positive integers. Given $a,b,N\in\mathbb{N}$ and $a<b$, let
$[a,b]:=[a,b]\cap\mathbb{N}$, and let $[N]:=[1,N]$. We use the standard
Vinogradov notation. That is, $f\ll g$ means $f=O(g)$, and $f\asymp g$ if
$f\ll g$ and $f\gg g$. Given $A,B\subseteq\mathbb{Z}$, we write

$A+B:=\\{a+b\mid a\in A,b\in B\\},\quad\text{and}\quad AB:=\\{ab\mid a\in
A,b\in B\\}.$

When $A=\\{x\\}$, we simply write $x+B:=\\{x\\}+B$ and $x\cdot B:=\\{x\\}B$.
Given $A\subseteq\mathbb{Z}$, let

$kA:=\\{a_{1}+\dots+a_{k}\mid a_{1},\dots,a_{k}\in A\\},$

for integer $k\geq 2$. For example, $2\cdot\mathbb{N}$ denotes the set of even
natural numbers, while $2\mathbb{N}$ denotes $\mathbb{N}+\mathbb{N}$ which is
still $\mathbb{N}$. Using this notation, a set $A$ is _$(k,\ell)$ -sum-free_
if $kA\cap\ell A=\varnothing$.

We also define the restricted sums. Let

$\displaystyle A\widehat{+}B:=\\{a+b\mid a\in A,b\in B,a\neq b\\},$
$\displaystyle\widehat{kA}:=\\{a_{1}+\dots+a_{k}\mid a_{1},\dots,a_{k}\in
A,\text{ all of them are distinct}\\}.$

Thus a set $A$ is _restricted $(k,\ell)$-sum-free_ if
$\widehat{kA}\cap\widehat{\ell A}=\varnothing$.

Let $f:\mathbb{Z}\to\mathbb{C}$ be a function. Define
$\widehat{f}:\mathbb{T}\to\mathbb{C}$, where
$\mathbb{T}=\mathbb{R}/\mathbb{Z}$ is the 1-dimensional torus, and for every
$r\in\mathbb{T}$,

$\widehat{f}(r)=\sum_{x}f(x)e(-rx),$

where $e(\theta)=e^{2\pi i\theta}$. By Fourier Inversion, for every
$x\in\mathbb{Z}$,

$f(x)=\int_{\mathbb{T}}\widehat{f}(r)e(rx)dr.$

Let $\mu:\mathbb{N}^{>0}\to\mathbb{C}$ be the _Möbius function_. Recall that
$\mu$ is supported on the square-free integers, and $\mu(n)=(-1)^{\omega(n)}$
when $n$ is square-free, where $\omega(n)$ counts the number of distinct prime
factors of $n$. By Inclusive-Exclusive Principle,

$\sum_{d\mid n}\mu(d)=\begin{cases}0\quad&\text{ if }n>1,\\\ 1&\text{ if
}n=1.\end{cases}$

###  2.2. Nonstandard analysis

We give some basic definitions in nonstandard analysis which will be used
later in the proofs. For more systematic accounts we refer to [5, 8]. Let $S$
be a set with infinitely many elements. An _ultrafilter_ $\mathscr{U}$ on $S$
is a collection of subsets of $S$, such that the characteristic function
$\mathbbm{1}_{\mathscr{U}}:2^{S}\to\\{0,1\\}$ is a finitely additive
$\\{0,1\\}$-valued probability measure on $S$. An ultrafilter is _principal_
if it consists of all sets containing some element $s\in S$. Let $\beta S$
denotes the collection of all ultrafilters. One can embed $S$ into $\beta S$,
by mapping $x\in S$ to the principal ultrafilter generated by $x$. By a
standard application of Zorn’s Lemma, $\beta S\setminus S$ is non-empty.

Fix $\mathscr{U}\in\beta\mathbb{N}\setminus\mathbb{N}$, and let $M_{n}$ be a
structure for each $n\in\mathbb{N}$. The _ultraproduct_
$\prod_{n\to\mathscr{U}}M_{n}$ is a space consists of all ultralimits
$\lim_{n\to\mathscr{U}}x_{n}$ of sequences $x_{n}$ defined in $M_{n}$, with
$\lim_{n\to\mathscr{U}}x_{n}=\lim_{n\to\mathscr{U}}y_{n}$ if two sequences
$\\{x_{n}\\}$ and $\\{y_{n}\\}$ agree on a set in $\mathscr{U}$. Let
${{}^{*}\mathbb{R}}:=\prod_{n\to\mathscr{U}}\mathbb{R}$ be the hyperreal
field. Every finite hyperreal number $\xi\in{{}^{*}\mathbb{R}}$ is infinitely
close to a unique real number $r\in\mathbb{R}$, called the _standard part_ of
$\xi$. In this case, we use the notation $r=\mathrm{st}(\xi)$.

Given a sequence of finite non-empty sets $F_{n}$, let $\mu_{n}(X)=|X\cap
F_{n}|/|F_{n}|$ be a uniform probability measure. Let
$F=\prod_{n\to\mathscr{U}}F_{n}$ be an ultraproduct. The _Loeb measure_ [19]
$\mu_{L}$ on $F$ is the unique probability measure on the $\sigma$-algebra
generated by the Boolean algebra of internal subsets of $F$, such that when
$X=\prod_{n\to\mathscr{U}}X_{n}$ is an internal subset of $F$, we have

$\mu_{L}(X)=\mathrm{st}\Big{(}\lim_{n\to\mathscr{U}}\mu_{n}(X_{n})\Big{)}.$

###  2.3. Determinants of certain matrices

We make use of the following lemma several times in the later proofs, which
records a fact about two special matrices.

######  Lemma 2.1.

Let $\theta_{1},\ldots,\theta_{n}\in\mathbb{R}$. Consider two matrices

$A_{n}=\left(\begin{array}[]{cccc}\sin\theta_{1}&\sin\theta_{2}&\cdots&\sin\theta_{n}\\\
\sin 2\theta_{1}&\sin 2\theta_{2}&\cdots&\sin 2\theta_{n}\\\
\cdots&\cdots&\cdots&\cdots\\\ \sin n\theta_{1}&\sin n\theta_{2}&\cdots&\sin
n\theta_{n}\end{array}\right),$

and

$B_{n}=\left(\begin{array}[]{cccc}1&1&\cdots&1\\\
\cos\theta_{1}&\cos\theta_{2}&\cdots&\cos\theta_{n}\\\ \cos 2\theta_{1}&\cos
2\theta_{2}&\cdots&\cos 2\theta_{n}\\\ \cdots&\cdots&\cdots&\cdots\\\
\cos(n\\!-\\!1)\theta_{1}&\cos(n\\!-\\!1)\theta_{2}&\cdots&\cos(n\\!-\\!1)\theta_{n}\end{array}\right).$

Then we have the formula:

(3)
$\det(A_{n})=2^{n-1}\big{(}\prod_{k=1}^{n}\sin\theta_{k}\big{)}\det(B_{n});$

and

(4) $\det(B_{n})=2^{(n-1)(n-2)/2}\prod_{1\leq k<l\leq
n}(\cos\theta_{l}-\cos\theta_{k}).$

As a result,

$\det(A_{n})=2^{n(n-1)/2}\big{(}\prod_{k=1}^{n}\sin\theta_{k}\big{)}\prod_{1\leq
k<l\leq n}(\cos\theta_{l}-\cos\theta_{k}).$

###### Proof.

For $k=1,2,\ldots n-1$, we subtract the $k$-th row from the $(k+1)$-th row in
$A_{n}$, and use the basic trigonometric identities so that

$\displaystyle\det(A_{n})$ $\displaystyle=$
$\displaystyle\det\left(\begin{array}[]{ccc}2\sin\frac{\theta_{1}}{2}\cos\frac{\theta_{1}}{2}&\cdots&2\sin\frac{\theta_{n}}{2}\cos\frac{\theta_{n}}{2}\\\
\cdots&\cdots&\cdots\\\
2\sin\frac{\theta_{1}}{2}\cos\frac{(2n\\!-\\!1)\theta_{1}}{2}&\cdots&2\sin\frac{\theta_{n}}{2}\cos\frac{(2n\\!-\\!1)\theta_{n}}{2}\end{array}\right)$
$\displaystyle=$ $\displaystyle
2^{n}\big{(}\prod_{k=1}^{n}\sin\frac{\theta_{k}}{2}\big{)}\det\left(\begin{array}[]{ccc}\cos\frac{\theta_{1}}{2}&\cdots&\cos\frac{\theta_{n}}{2}\\\
\cdots&\cdots&\cdots\\\
\cos\frac{(2n\\!-\\!1)\theta_{1}}{2}&\cdots&\cos\frac{(2n\\!-\\!1)\theta_{n}}{2}\end{array}\right)$
$\displaystyle=:$ $\displaystyle C_{n}\det(B_{n}^{\prime}).$

For $k=1,2,\ldots n-1$, we add the $k$-th row to the $k+1$-th row in
$B_{n}^{\prime}$, and use the basic trigonometric identities again so that

$\displaystyle\det(B_{n}^{\prime})$ $\displaystyle=$
$\displaystyle\det\left(\begin{array}[]{ccc}\cos\frac{\theta_{1}}{2}&\cdots&\cos\frac{\theta_{n}}{2}\\\
2\cos\frac{\theta_{1}}{2}\cos\theta_{1}&\cdots&2\cos\frac{\theta_{n}}{2}\cos\theta_{n}\\\
\cdots&\cdots&\cdots\\\
2\cos\frac{\theta_{1}}{2}\cos(n\\!-\\!1)\theta_{1}&\cdots&2\cos\frac{\theta_{n}}{2}\cos(n\\!-\\!1)\theta_{n}\end{array}\right)$
$\displaystyle=$ $\displaystyle
2^{n-1}\big{(}\prod_{k=1}^{n}\cos\frac{\theta_{k}}{2}\big{)}\det(B_{n})$

Combining the calculations above we prove (3).

As for (4), we let $T_{n}$ be the Chebyshev polynomial

$T_{n}(x)=\sum_{k=0}^{\lfloor{n/2}\rfloor}\binom{n}{2k}(x^{2}-1)^{k}x^{n-2k}.$

Thus, we have $T_{n}(\cos x)=\cos nx$. The coefficient of the leading term,
$x^{n}$ in $T_{n}(x)$ would be $a_{n}=2^{n-1}$. Combining this fact and
several elementary row operations, we get

$\displaystyle\det(B_{n})$ $\displaystyle=$ $\displaystyle
2^{(n-1)(n-2)/2}\det\left(\begin{array}[]{ccc}1&\cdots&1\\\
\cos\theta_{1}&\cdots&\cos\theta_{n}\\\ \cdots&\cdots&\cdots\\\
(\cos\theta_{1})^{n-1}&\cdots&(\cos\theta_{n})^{n-1}\end{array}\right)$
$\displaystyle=$ $\displaystyle 2^{(n-1)(n-2)/2}\prod_{1\leq k<l\leq
n}(\cos\theta_{l}-\cos\theta_{k}).$

The last equation comes from the determinant formula for Vandermonde martix. ∎

##  3\. A variant of the Littlewood conjecture

The Littlewood problem [15] is to ask that, what is

$I(N):=\min_{A\subseteq\mathbb{Z},|A|=N}\int_{\mathbb{T}}\Big{|}\sum_{n\in
A}e^{inx}\Big{|}d\mu(x)?$

The strong Littlewood conjecture asserts that the minimum occurs when $A$ is
an arithmetic progression. This conjecture is still widely open. However, the
weak Littlewood conjecture, $I(N)\gg\log N$, is resolved by McGehee, Pigno,
and Smith [22], and independently by Konyagin [17]. The analogous question in
discrete setting is also well studied, we refer to [13, 24, 25] for the
interested readers. In this section, we will develop a variant of the weak
Littlewood conjecture, based on the ideas given by Bourgain [7].

Let $\mathcal{N}$ be the set of natural numbers that only contains prime
factors at least $P$, where $P\asymp(\log N)^{100}$ is a prime. We will use
the following lemma from [7, Section 5].

######  Lemma 3.1.

Let $A$ be a finite subset of $\mathbb{Z}^{+}$ with $|A|=N$. For all $R\geq
1$, we define

$A_{R}=\\{m\in A:m<R\\}.$

Also, we use ${\rm Proj}_{R}\sum a_{k}e^{ikx}$ to denote the truncated sum
$\sum_{|k|\leq R}a_{k}e^{ikx}$. Assume $|a_{n}|\leq 1$ and $P>(\log N)^{20}$.
Then there is an absolute big constant $C$, such that

$\Bigg{\|}{\rm Proj}_{R}\sum_{\begin{subarray}{c}n\in\mathcal{N},m\in
A\end{subarray}}\frac{a_{n}}{n}e^{imnx}\Bigg{\|}_{2}<CP^{-1/15}|A_{R}|^{1/2}.$

With Lemma 3.1 in hand, we are able to prove our technical lemma:

######  Lemma 3.2.

Let $A$ be a finite subset of $\mathbb{N}^{>0}$ with $|A|=N$ and let $P>(\log
N)^{100}$. Assume $|a_{n}|\leq 1$. Then for any $r_{0}\in\mathbb{N}^{>0}$,
there exists a function $\Phi(x)$ with $\|\Phi\|_{\infty}<10$ such that

(8) $\Big{|}\Big{\langle}\sum_{m\in
A}(e^{imx}+e^{ir_{0}mx}),\Phi(x)\Big{\rangle}\Big{|}\geq c\log N;$

while for any $\beta\in\mathbb{Z}$,

(9) $\Big{|}\Big{\langle}\sum_{\begin{subarray}{c}n\in\mathcal{N},m\in
A\end{subarray}}\frac{a_{n}}{n}e^{i\beta mnx},\Phi(x)\Big{\rangle}\Big{|}\leq
C(\log N)^{-2}.$

Here $c,C$ are two absolute constants.

###### Proof.

For convenience, we assume $A=\\{m_{1},\ldots,m_{N}\\}$, and define

$G(x)=\sum_{j=1}^{N}e^{im_{j}x}+e^{ir_{0}m_{j}x}.$

Let $k_{0}$ be the largest natural number that $10^{6k_{0}}<N$. We group $A$
into disjoint subsets $\\{B_{k}\\}_{k=0}^{k_{0}}$ such that for $0\leq k\leq
k_{0}-1$, $|B_{k}|=10^{6k}$. Here $B_{0}=\\{m_{1}\\}$,
$B_{1}=\\{m_{2},\ldots,m_{10^{6}+1}\\},\cdots$ and
$B_{k_{0}}=A\setminus(\bigcup_{k\leq k_{0}-1}B_{k})$. From the construction we
know $|B_{k_{0}}|\asymp 10^{6k_{0}}$. For each $B_{k}$, we define

$\widetilde{P}_{k}=\frac{1}{|B_{k}|}\sum_{m\in B_{k}}e^{imx}.$

We also define, after setting $F_{M}=\sum_{|m|\leq M}\frac{M-|m|}{M}e^{imx}$
to be the $M$-Féjer kernel,

$P_{k}=\widetilde{P}_{k}\ast(e^{i\xi_{k}x}F_{|I_{k}|}).$

Here $I_{k}=[a_{k},b_{k}]$ is the interval with $a_{k}=\min\\{m,m\in
B_{k}\\}$, $b_{k}=\max\\{m,m\in B_{k}\\}$, and $\xi_{k}$ is the center of
$I_{k}$. As a result, we have

(10) ${\rm supp}(\widehat{P}_{k})={\rm
supp}(\widehat{\widetilde{P}_{k}})\subset I_{k},$

and

$\langle G,P_{k}\rangle>\frac{1}{2}.$

Next, for each $P_{k}$, we define a function $Q_{k}$ that served as a
“compensator”. Let $\mathcal{H}$ be the Hilbert transform in
$L^{2}(\mathbb{T})$ that $\widehat{\mathcal{H}{f}}(n)=-i{\rm
sgn}(n)\widehat{f}(n)$, so that $\mathcal{H}f(x)\in\mathbb{R}$ when $f$ is a
real-valued function. We set

(11)
$Q_{k}=\Big{(}e^{-(|\tilde{P}_{k}|-i\mathcal{H}[|\tilde{P}_{k}|])}\Big{)}\ast
F_{|I_{k}|}.$

Since the Fourier series of $|\tilde{P}_{k}|-i\mathcal{H}[|\tilde{P}_{k}|]$ is
supported in non-positive integers, the Fourier series of
$e^{-(|\tilde{P}_{k}|-i\mathcal{H}[|\tilde{P}_{k}|])}$ has the same support.
Hence

(12) ${\rm supp}(\widehat{Q}_{k})\subset[-|I_{k}|,0].$

Recall the inequality $|e^{-z}-1|\leq|z|$ if $z\in\mathbb{C}$ and ${\rm
Re}(z)\geq 0$. Thus, noticing that the Hilbert transform $\mathcal{H}$ is an
$L^{2}$ isometry, we have

$\|1-Q_{k}\|_{2}\leq\big{\|}e^{-(|\tilde{P}_{k}|-i\mathcal{H}[|\tilde{P}_{k}|])}-1\big{\|}_{2}\leq\|\tilde{P}_{k}\|_{2}+\|\mathcal{H}[|\tilde{P}_{k}|]\|_{2}<2|B_{k}|^{-1/2}.$

We will use the functions $P_{k},Q_{k}$ to construct our test function $\Phi$.
Specifically, we let $\Phi_{0}=P_{0}$ and let

(13) $\Phi_{k}=Q_{k}\Phi_{k-1}+P_{k},\hskip 28.45274pt1\leq k\leq k_{0}.$

Define $\Phi=\Phi_{k_{0}}$. We can also write down the explicit formula for
$\Phi$ by

(14)
$\Phi=P_{k_{0}}+P_{k_{0}-1}Q_{k_{0}}+P_{k_{0}-2}Q_{k_{0}-1}Q_{k_{0}}+\cdots+P_{0}Q_{1}\cdots
Q_{k_{0}}.$

We claim that $\|\Phi\|_{\infty}<10$. To see this, we first recall the basic
inequality: $\frac{a}{10}+e^{-a}\leq 1$ if $a\geq 0$. Then, observing that
$|P_{0}|=1$ and

$\Big{\|}\frac{1}{10}|P_{k}|+|Q_{k}|\Big{\|}_{\infty}\leq\Big{\|}\big{(}\frac{1}{10}|\widetilde{P}_{k}|+e^{-|\widetilde{P}_{k}|}\big{)}\ast
F_{|I_{k}|}\Big{\|}_{\infty}\leq\Big{\|}\frac{1}{10}|\widetilde{P}_{k}|+e^{-|\widetilde{P}_{k}|}\Big{\|}_{\infty}\leq
1,$

we argue inductively using (13) to conclude our claim.

Next, we will verify (8). Write

$G_{1}(x)=\sum_{j=1}^{N}e^{im_{j}x},\hskip
28.45274ptG_{2}(x)=\sum_{j=1}^{N}e^{ir_{0}m_{j}x}.$

Also, recalling $b_{k}=\max\\{m,m\in B_{k}\\}$, we define two truncated series

$G_{1,k}(x)=\sum_{m\leq b_{k},m\in A}e^{imx},\hskip
28.45274ptG_{2,k}(x)=\sum_{m\leq b_{k},m\in A}e^{ir_{0}mx}.$

Therefore, using (10), (12), (14) and the fact $\widehat{P}_{k}\geq 0$,

(15) $\displaystyle|\langle G,\Phi\rangle|\\!\\!\\!$ $\displaystyle=$
$\displaystyle\\!\\!\\!\Big{|}\sum_{k=0}^{k_{0}}\langle
G,P_{k}\rangle+\sum_{k=0}^{k_{0}}\langle G_{1}+G_{2},P_{k}(1-Q_{k+1}\cdots
Q_{k_{0}})\rangle\Big{|}$ (16) $\displaystyle\geq$
$\displaystyle\\!\\!\\!\frac{k_{0}}{2}-\Big{|}\sum_{k=0}^{k_{0}}\langle
G_{1,k}+G_{2,k},P_{k}(1-Q_{k+1}\cdots Q_{k_{0}})\rangle\Big{|}.$

Observing that $\|P_{k}\|_{\infty},~{}\|Q_{k}\|_{\infty}\leq 1$ and

$1-Q_{k+1}\cdots
Q_{k_{0}}=(1-Q_{k+1})+Q_{k+1}(1-Q_{k+2})+\cdots+(1-Q_{k_{0}})Q_{k+1}\ldots
Q_{k_{0}-1},$

we can derive the following estimates for $0\leq k\leq k_{0}-1$:

(17) $\displaystyle|\langle G_{1,k},P_{k}(1-Q_{k+1}\cdots
Q_{k_{0}})\rangle|\leq\|G_{1,k}\|_{2}\cdot\|P_{k}(1-Q_{k+1}\cdots
Q_{M})\|_{2}$ $\displaystyle\leq 2\times
10^{3(k-1)}\sum_{j=k+1}^{k_{0}}\|1-Q_{j}\|_{2}\leq 8\times 10^{-3}.$

The last inequality follows from $\|1-Q_{j}\|_{2}\leq 2|B_{k}|^{-1/2}$.

Similarly, we can prove $|\langle G_{2,k},P_{k}(1-Q_{k+1}\cdots
Q_{k_{0}})\rangle|\leq 8\times 10^{-3}$. Plugging these two estimates back to
(16), summing up $k$ and using the triangle inequality so that we can conclude

$\langle G,\Phi\rangle\geq\frac{k_{0}}{3}.$

The desired estimate (8) follows readily as $k_{0}\geq(\log N)/100$.

Finally, we are going to verify (9). Let

$H(x)=\sum_{\begin{subarray}{c}n\in\mathcal{N},m\in
A\end{subarray}}\frac{a_{n}}{n}e^{i\beta mnx}.$

From (10) and (12), we know that for $k+1\leq j\leq k_{0}$,

${\rm supp}\\{\big{(}P_{k}(1-Q_{k+1}\cdots
Q_{j})\big{)}^{\wedge}\\}\subset[-b_{j},b_{k}].$

Thus, using (14) we have

(18) $\langle H,\Phi\rangle=\sum_{k=0}^{k_{0}}\langle
H,P_{k}\rangle+\sum_{k=0}^{k_{0}}\sum_{j=k+1}^{k_{0}}\langle
H,P_{k}Q_{k+1}\cdots Q_{j-1}(1-Q_{j})\rangle.$

Here we set $Q_{k+1}Q_{k}=1$ in convention. Since ${\rm
supp}(\widehat{P}_{k})\subset[0,b_{k}]$, we apply Lemma 3.1 so that

$|\langle H,P_{k}\rangle|\leq\|P_{k}\|_{2}\cdot\|{\rm
Proj}_{b_{k}}H\|_{2}<C10^{-3(k-1)}P^{-1/15}10^{3(k-1)}=CP^{-1/15}.$

Summing up all the $k\leq k_{0}$ using the triangle inequality, we can bound
the first term in (18) with

(19) $\sum_{k=0}^{k_{0}}|\langle H,P_{k}\rangle|<CP^{-1/15}k_{0}.$

For the second term in (18), we similarly have

$|\langle H,P_{k}Q_{k+1}\cdots
Q_{k_{j-1}}(1-Q_{j})\rangle|\leq\|1-Q_{j}\|_{2}\cdot\|{\rm
Proj}_{b_{j}}H\|_{2}<CP^{-1/15}.$

Summing up all the $k+1\leq j\leq k_{0}$ and $0\leq k\leq k_{0}$ using the
triangle inequality again, we therefore can conclude

(20) $\sum_{k=0}^{k_{0}}\sum_{j=k+1}^{k_{0}}|\langle H,P_{k}Q_{k+1}\cdots
Q_{j-1}(1-Q_{j})\rangle|<CP^{-1/15}k_{0}^{2}.$

We conclude the proof of (9) by the facts $k_{0}<\log N$ and $P>(\log
N)^{100}$. ∎

######  Remark 3.3.

The above argument can be easily generalized with (8) replaced by the
requirement

(21) $\Big{|}\Big{\langle}\sum_{m\in
A}\sum_{r\in\Lambda}e^{irmx},\Phi(x)\Big{\rangle}\Big{|}\geq c\log N.$

Here $\Lambda\subset\mathbb{N}^{>0}$, and the constant $c$ only depends on the
size of $\Lambda$.

As an application of Lemma 3.2, we have the following corollary:

######  Corollary 3.4.

Let $A$ be a finite subset of $\mathbb{N}^{>0}$ with $|A|=N$ and let $P>(\log
N)^{100}$. Recall that $\mathcal{N}$ is the set of natural numbers that only
contains prime factors at least $P$. Assume $|a_{n}|\leq 1$. Then for any
$r_{0}\in\mathbb{N}^{>0}$, $\Gamma\subset\mathbb{Z}$ with $|\Gamma|\leq\log
N$, we have

$\Bigg{\|}\sum_{m\in
A}\Big{(}e^{imx}+e^{ir_{0}mx}\Big{)}+\sum_{\begin{subarray}{c}n\in\mathcal{N},m\in
A\end{subarray}}\Big{(}\sum_{\beta\in\Gamma}\frac{a_{n}}{n}e^{i\beta
mnx}\Big{)}\Bigg{\|}_{1}\geq c\log N.$

###### Proof.

We apply Lemma 3.2 to obtain a function $\Phi(x)$ satisfying (8) and (9). Then
we can conclude the corollary as

$\displaystyle\Bigg{\|}\sum_{m\in
A}\Big{(}e^{imx}+e^{ir_{0}mx}\Big{)}+\sum_{\begin{subarray}{c}n\in\mathcal{N},m\in
A\end{subarray}}\Big{(}\sum_{\beta\in\Gamma}\frac{a_{n}}{n}e^{i\beta
mnx}\Big{)}\Bigg{\|}_{1}\|\Phi\|_{\infty}$
$\displaystyle\geq\Big{|}\Big{\langle}\sum_{m\in
A}(e^{imx}+e^{ir_{0}mx}),\Phi(x)\Big{\rangle}\Big{|}-\sum_{\beta\in\Gamma}\Big{|}\Big{\langle}\sum_{\begin{subarray}{c}n\in\mathcal{N},m\in
A\end{subarray}}\frac{a_{n}}{n}e^{i\beta mnx},\Phi(x)\Big{\rangle}\Big{|}$
$\displaystyle>c\log N.$

∎

##  4\. $(k,\ell)$-sum-free open sets in the torus

In this section, we use $\mu_{H}$ as the Haar probability measure on
$\mathbb{T}$.

######  Proposition 4.1.

Let $A\subseteq\mathbb{T}$ be a $(k,\ell)$-sum-free open set. Then
$\mu_{H}(A)\leq\frac{1}{k+\ell}$.

###### Proof.

Since $A$ is $(k,\ell)$-sum-free, we have $kA\cap\ell A=\varnothing$. In
particular, $\mu_{H}(kA)+\mu_{H}(\ell A)\leq 1$. By Kneser’s inequality [16],

$(k+\ell)\mu_{H}(A)\leq\mu_{H}(kA)+\mu_{H}(\ell A)\leq 1,$

which implies that $\mu_{H}(A)\leq 1/(k+\ell)$. ∎

Next, we construct some largest $(k,\ell)$-sum-free open sets in $\mathbb{T}$.
When $k-\ell\geq 2$, our construction is asymmetric, which will help us get a
better lower bound on $\mathscr{M}_{(k,\ell)}(N)$. We will discuss this in
details in the next section.

######  Lemma 4.2.

Let $k,\ell$ be two positive integers and $k>\ell$. For every integer
$t\in[k-\ell]$, set
$\Omega_{t}=\big{(}\frac{t-1}{k-\ell}+\frac{\ell}{k^{2}-\ell^{2}},\frac{t-1}{k-\ell}+\frac{k}{k^{2}-\ell^{2}}\big{)}$.
Then $\Omega_{t}$ is $(k,\ell)$-sum-free.

Lemma 4.2 is easy to verify, and we omit the details here. When $k=\ell+1$,
the following observation shows that all the possible $(k,\ell)$-sum-free open
sets with maximum measure are symmetric. Thus one cannot apply the method used
in the next section to improve the lower bound for the cases $k=\ell+1$.

######  Lemma 4.3.

Let $k=\ell+1$. Suppose $A\subseteq\mathbb{T}$ is a maximum $(k,\ell)$-sum-
free open set. Then $A$ is symmetric.

###### Proof.

Since $k=\ell+1$, $A$ is $(k,\ell)$-sum-free implies that $(\ell A-\ell A)\cap
A=\varnothing$. Hence $A\subseteq\mathbb{T}\setminus(\ell A-\ell A)$. By
Kneser’s inequality,

$\mu_{H}(\mathbb{T}\setminus(\ell A-\ell A))\leq 1-2\ell\mu_{H}(A).$

By Proposition 4.1, $\mu_{H}(A)=\frac{1}{2\ell+1}$. Thus
$A=\mathbb{T}\setminus(\ell A-\ell A)$, and this implies that $A$ is
symmetric. ∎

Using the argument by Erdős [11], Lemma 4.2 is able to give us the following
lower bound on the maximum $(k,\ell)$-sum-free subsets of any set of $N$
integers, which proves Theorem 1.1 (i).

######  Proposition 4.4.

Let $k,\ell$ be positive integers and $k>\ell$. Then for every
$A\subseteq\mathbb{N}^{>0}$ of size $N$, $A$ contains a $(k,\ell)$-sum-free
subsets of size at least $\frac{1}{k+\ell}N$.

###### Proof.

Let $\Omega_{t}$ be as in Lemma 4.2, and let $\mathbbm{1}_{\Omega}$ be the
characteristic function of $\Omega$ in $\mathbb{T}$. Thus by Fubini’s Theorem,

$\int_{\mathbb{T}}\sum_{n\in A}\mathbbm{1}_{\Omega}(nx)d\mu_{H}(x)=\sum_{n\in
A}\int_{\mathbb{T}}\mathbbm{1}_{\Omega}(nx)d\mu_{H}(x)=\frac{N}{k+\ell}.$

Therefore, by Pigeonhole principle, there exists $x\in\mathbb{T}$ such that

$|\\{n\in A\mid nx\in\Omega\\}|\geq\frac{N}{k+\ell},$

finishes the proof. ∎

##  5\. Lower Bounds

Let $k,\ell$ be two positive integers with $k-\ell\geq 2$. Let
$I=\\{1,\dots,k-\ell\\}$ be the index set. Set

$\Omega_{t}=\Big{(}\frac{t-1}{k-\ell}+\frac{\ell}{k^{2}-\ell^{2}},\frac{t-1}{k-\ell}+\frac{k}{k^{2}-\ell^{2}}\Big{)},$

for every $t\in I$. Let $\mathbbm{1}_{\Omega_{t}}$ be the indicator function
of $\Omega_{t}$. Given $A\subseteq\mathbb{N}^{>0}$ of size $N$, let
$\mathscr{M}(A)$ be the size of the maximum $(k,\ell)$-sum-free subset of $A$.
We have

(22) $\displaystyle\mathscr{M}(A)\geq\max_{x\in\mathbb{T}}\sum_{n\in
A}\mathbbm{1}_{\Omega_{t}}(nx),$

since $\Omega_{t}$ is $(k,\ell)$-sum-free for every $t$. Then

(23) $\displaystyle\max_{x\in\mathbb{T}}\sum_{n\in
A}\mathbbm{1}_{\Omega_{t}}(nx)=\frac{N}{k+\ell}+\max_{x\in\mathbb{T}}\sum_{n\in
A}\Big{(}\mathbbm{1}_{\Omega_{t}}-\frac{1}{k+\ell}\Big{)}(nx),$

for every $t\in I$. We introduce a balanced function
$f_{t}:\mathbb{T}\to\mathbb{C}$ defined by
$f_{t}=\mathbbm{1}_{\Omega_{t}}-\frac{1}{k+\ell}$. By orthogonality of
characters we have

$\widehat{f_{t}}(n)=\begin{cases}0\quad&\text{ if }n=0,\\\
\widehat{\mathbbm{1}_{\Omega_{t}}}(n)&\text{ else}.\end{cases}$

By Fourier inversion, when $n>0$,

$\displaystyle\widehat{f_{t}}(n)$
$\displaystyle=\int_{\mathbb{T}}\mathbbm{1}_{\Omega_{t}}(x)e(-nx)d\mu(x)$
$\displaystyle=\frac{1}{2\pi
in}\Big{(}-e\big{(}-\frac{(t-1)n}{k-\ell}-\frac{nk}{k^{2}-\ell^{2}}\big{)}+e\big{(}-\frac{(t-1)n}{k-\ell}-\frac{n\ell}{k^{2}-\ell^{2}}\big{)}\Big{)}.$

Simplify $\widehat{f}_{t}(n)$ as

$\displaystyle\widehat{f_{t}}(n)$ $\displaystyle=\frac{1}{2\pi
n}e\Big{(}\frac{(2t-1)n}{2(k-\ell)}\Big{)}\Big{(}\sin(\frac{2kn\pi}{k^{2}-\ell^{2}}-\frac{\pi
n}{k-\ell})-\sin(\frac{2\ell n\pi}{k^{2}-\ell^{2}}-\frac{\pi
n}{k-\ell})\Big{)}$ $\displaystyle=\frac{1}{\pi
n}e\Big{(}\frac{(2t-1)n}{2(k-\ell)}\Big{)}\sin\Big{(}\frac{n\pi}{k+\ell}\Big{)}.$

Hence, for every $t\in I$ we have

$\displaystyle f_{t}(x)=\sum_{n\neq 0}\widehat{f_{1}}(n)e(nx)=\sum_{n\neq
0}\frac{1}{\pi
n}e\Big{(}\frac{(2t-1)n}{2(k-\ell)}\Big{)}\sin\Big{(}\frac{n\pi}{k+\ell}\Big{)}e(nx).$

Let $F(x):=\sum_{t\in I}f_{t}(x)$. The sine terms cancel when summing up $t$
as

$\sum_{t=1}^{k-\ell}\sin\Big{(}\frac{(2t-1)n\pi}{k-\ell}\Big{)}=0,$

so we get

$\displaystyle F(x)$ $\displaystyle=\frac{1}{\pi}\sum_{n\geq
1}\frac{1}{n}\sin\Big{(}\frac{n\pi}{k+\ell}\Big{)}\alpha(n)\big{(}e(nx)+e(-nx)\big{)},$

where $\alpha(n):\mathbb{Z}\to\mathbb{C}$ is defined by

$\alpha(n)=\sum_{t\in
I}\cos\Big{(}\frac{(2t-1)n\pi}{k-\ell}\Big{)}=\begin{cases}0\quad&\text{ when
}(k-\ell)\nmid n,\\\ (-1)^{s}(k-\ell)&\text{ when }n=(k-\ell)s.\end{cases}$

Therefore, we have

(24) $F(x)=\frac{2}{\pi}\sum_{n\geq
1}\frac{(-1)^{n}}{n}\sin\Big{(}\frac{(k-\ell)n\pi}{k+\ell}\Big{)}\cos(2\pi(k-\ell)nx).$

In the rest of the section, we let $k-\ell$ be an even integer. Set

$I_{1}=\\{1,\dots,(k-\ell)/2\\},\quad I_{2}=\\{(k-\ell)/2+1,\dots,k-\ell\\}.$

We define a ($\frac{k-\ell}{2}\times\frac{k-\ell}{2}$)-matrix $D=(d_{ij})$,
such that

$d_{ij}=\sin\Big{(}\frac{i(2j-1)\pi}{k-\ell}\Big{)}$

for every $i,j\in I_{1}$.

Let $\bm{\lambda}=(\lambda_{1},\dots,\lambda_{(k-\ell)/2})$ be a vector. By
Lemma 2.1, there is $\bm{\lambda}\in\mathbb{R}^{(k-\ell)/2}$, with
$|\lambda_{i}|\leq k^{k}$, such that $D\bm{\lambda}^{T}=(0,\dots,0,1)^{T}$.
Fix this $\bm{\lambda}$, and let

$G(x)=\sum_{j\in I_{1}}\lambda_{j}f_{j}(x)-\sum_{t\in
I_{2}}\lambda_{k-\ell+1-t}f_{t}(x).$

Observe that for any $n\in\mathbb{N}^{>0}$,

$\sum_{t\in
I_{1}}\lambda_{t}\cos\Big{(}\frac{(2t-1)n\pi}{k-\ell}\Big{)}=\sum_{t\in
I_{2}}\lambda_{k-\ell+1-t}\cos\Big{(}\frac{(2t-1)n\pi}{k-\ell}\Big{)}.$

As a result, we have

$G(x)=\frac{1}{\pi}\sum_{n\geq
1}\frac{1}{n}\sin\Big{(}\frac{n\pi}{k+\ell}\Big{)}\beta(n)\sin(2\pi nx),$

where

$\displaystyle\beta(n)$ $\displaystyle=\sum_{j\in
I_{2}}\lambda_{k-j}\sin\Big{(}\frac{(2j-1)n\pi}{k-\ell}\Big{)}-\sum_{t\in
I_{1}}\lambda_{t}\sin\Big{(}\frac{(2t-1)n\pi}{k-\ell}\Big{)}$
$\displaystyle=\begin{cases}0\quad&\text{ when
}n\neq\frac{k-\ell}{2}(2s-1),\\\ 2(-1)^{s+1}&\text{ when
}n=\frac{k-\ell}{2}(2s-1).\end{cases}$

Therefore, we get

(25) $G(x)=\frac{2}{\pi(k-\ell)}\sum_{n\geq
1}\frac{\gamma(n)}{n}\sin\Big{(}\frac{(k-\ell)n\pi}{2(k+\ell)}\Big{)}\sin(\pi(k-\ell)nx),$

where $\gamma(n)=\beta((k-\ell)n/2).$ We now split the proof into two cases.

###  5.1. Proof of Theorem 1.1 (ii)

Now we have $k=5\ell$. On one hand, by equation (24), we have

$F(x)=-\frac{\sqrt{3}}{\pi}\sum_{n\geq 1}\frac{\psi(n)}{n}\cos(8\pi\ell nx),$

where

$\psi(n)=\begin{cases}1&\text{ when }n\equiv 1,2\pmod{6},\\\ -1&\text{ when
}n\equiv 4,5\pmod{6},\\\ 0&\text{ otherwise}.\end{cases}$

Note that $\psi(n)$ is _not_ a multiplicative function. Using the Möbius
function $\mu$, we define a weighted Möbius function $\eta$ that

$\eta(n)=\begin{cases}\mu(n)&\text{ when }n\equiv 1,4\pmod{6},\\\
-\mu(n)&\text{ when }n\equiv 2,5\pmod{6},\\\ 0&\text{ otherwise. }\end{cases}$

Set $P\asymp(\log N)^{100}$ a prime. Let $\mathcal{M}_{1}$ be the set of
square-free integers such that for every $n\in\mathcal{M}_{1}$ we have $3\nmid
n$, all the prime factors of $n$ are at most $P$, and we further require that
$1\in\mathcal{M}_{1}$. Then, we have

$\displaystyle\sum_{m\in\mathcal{M}_{1}}\frac{\eta(m)}{m}F(mx)=-\frac{\sqrt{3}}{\pi}\sum_{n\geq
1}\frac{1}{n}\cos(8\pi\ell nx)\sum_{m\in\mathcal{M}_{1},m\mid
n}\eta(m)\psi\Big{(}\frac{n}{m}\Big{)},$

where

$\displaystyle\sum_{m\in\mathcal{M}_{1},m\mid
n}\eta(m)\psi\Big{(}\frac{n}{m}\Big{)}=\sum_{\begin{subarray}{c}m\in\mathcal{M}_{1},m\mid
n\\\ 2\nmid
m\end{subarray}}\eta(m)\psi\Big{(}\frac{n}{m}\Big{)}+\sum_{\begin{subarray}{c}m\in\mathcal{M}_{1},m\mid
n\\\ 2\mid m\end{subarray}}\eta(m)\psi\Big{(}\frac{n}{m}\Big{)}=:I_{1}+I_{2}.$

Note that $I_{1}+I_{2}=0$ when $3\mid n$. Also, recall that $\mathcal{N}$ is
the set defined in Section 3 that contains integers only having prime factors
at least $P$. It follows that for any odd integer $n\not\in\mathcal{N}$ with
$3\nmid n$,

(26) $\sum_{\begin{subarray}{c}m\in\mathcal{M}_{1},m\mid
n\end{subarray}}\eta(m)\psi\Big{(}\frac{n}{m}\Big{)}=\psi(n)\sum_{\begin{subarray}{c}m\in\mathcal{M}_{1},m\mid
n\end{subarray}}\mu(m)=0.$

As a consequence, when $n$ is an odd integer with $n\not\in\mathcal{N}$, we
have $I_{1}=I_{2}=0$, unless $n=1$; When $n$ is an even integer with
$n/2\not\in\mathcal{N}$ and $n\neq 2^{d}$, we have $I_{1}(n)=0$ and
$I_{2}(n)=I_{1}(n/2)=0$. When $n=2^{d}$, we have

$I_{1}+I_{2}=\psi(2^{d})+\psi(2^{d-1})=\begin{cases}2&\text{ when }d=1,\\\
0&\text{ when }d>1.\end{cases}$

Therefore,

$\displaystyle\sum_{m\in\mathcal{M}_{1}}\frac{\eta(m)}{m}F\Big{(}\frac{mx}{4}\Big{)}\\!\\!\\!$
$\displaystyle=$
$\displaystyle\\!\\!\\!-\frac{\sqrt{3}}{\pi}\Bigg{(}\cos(2\pi\ell
x)+\cos(4\pi\ell x)+$
$\displaystyle\sum_{n\in\mathcal{N}}\frac{\psi(n)}{n}\cos(2\pi\ell
nx)+\sum_{n\in 2\cdot\mathcal{N}}\frac{\psi(n)+\psi(n/2)}{n}\cos(2\pi\ell
nx)\Bigg{)},$

On the other hand, by equation (25), we get

$G(x)=\frac{\sqrt{3}}{\pi}\sum_{n\geq 1}\frac{\pi(n)}{n}\sin(4\pi\ell nx),$

where

$\pi(n)=\begin{cases}1&\text{ when }n\equiv\pm 1\pmod{12},\\\ -1&\text{ when
}n\equiv\pm 5\pmod{12},\\\ 0&\text{ otherwise. }\end{cases}$

Note that $\pi(n)$ is a multiplicative function. Let $\mathcal{M}$ be the set
of square-free integers such that for every $n\in\mathcal{M}$, all the prime
factors of $n$ are at most $P$, and $1\in\mathcal{M}$. Thus by the basic
properties of the Möbius function, we have

$\displaystyle\sum_{m\in\mathcal{M}}\frac{\mu(m)\pi(m)}{m}G(mx)$
$\displaystyle=\frac{\sqrt{3}}{\pi(k-\ell)}\sum_{n\geq
1}\frac{\pi(n)}{n}\sin(4\pi\ell nx)\sum_{m\in\mathcal{M},m\mid n}\mu(m)$
$\displaystyle=\frac{\sqrt{3}}{\pi(k-\ell)}\Bigg{(}\sin(4\pi\ell
x)+\sum_{n\in\mathcal{N}}\frac{\pi(n)}{n}\sin(4\pi\ell nx)\Bigg{)}.$

Now we are going to apply Corollary 3.4 to obtain a lower bound of
$\mathscr{M}(A)$. Let

$\pi^{\prime}(n)=\begin{cases}\pi(n)&\text{ when }2\nmid n,\\\ \pi(n/2)&\text{
when }2\mid n\text{ and }4\nmid n,\\\ 0&\text{ otherwise,}\end{cases}$

and let

$\psi^{\prime}(n)=\begin{cases}\psi(n)&\text{ when }2\nmid n,\\\
\psi(n)+\psi(n/2)&\text{ when }2\mid n\text{ and }4\nmid n,\\\ 0&\text{
otherwise.}\end{cases}$

We have

$\displaystyle\,\log N$ $\displaystyle\ll$ $\displaystyle\,\Bigg{\|}\sum_{m\in
A}\big{(}\cos(2\pi\ell mx)+\cos(4\pi\ell mx)+i\sin(2\pi\ell mx)+i\sin(4\pi\ell
mx)\big{)}$ $\displaystyle\,+\sum_{m\in
A}\sum_{n\in\mathcal{N}\cup(2\cdot\mathcal{N})}\frac{1}{n}\Big{(}\psi^{\prime}(n)\cos(2\pi\ell
mnx)+i\pi^{\prime}(n)\sin(2\pi\ell mnx)\Big{)}\Bigg{\|}_{L^{1}(\mathbb{T})}$
$\displaystyle\ll$
$\displaystyle\,\Bigg{\|}\sum_{t\in\mathcal{M}_{1}}\frac{\eta(t)}{t}\sum_{m\in
A}F\Big{(}\frac{tmx}{4}\Big{)}\Bigg{\|}_{L^{1}(\mathbb{T})}+\Bigg{\|}\sum_{t\in\mathcal{M}}\frac{\mu(t)\pi(t)}{t}\sum_{m\in
A}G\Big{(}\frac{tmx}{2}\Big{)}\Bigg{\|}_{L^{1}(\mathbb{T})}$
$\displaystyle\,+\Bigg{\|}\sum_{t\in\mathcal{M}}\frac{\mu(t)\pi(t)}{t}\sum_{m\in
A}G(tmx)\Bigg{\|}_{L^{1}(\mathbb{T})}$ $\displaystyle\ll$
$\displaystyle\,\sum_{t\in\mathcal{M}_{1}}\bigg{|}\frac{\eta(t)}{t}\bigg{|}\bigg{\|}\sum_{m\in
A}F(mx)\bigg{\|}_{L^{1}(\mathbb{T})}+2\sum_{t\in\mathcal{M}}\bigg{|}\frac{\mu(t)\pi(t)}{t}\bigg{|}\Bigg{\|}\sum_{m\in
A}G(mx)\bigg{\|}_{L^{1}(\mathbb{T})}$ $\displaystyle\ll$
$\displaystyle\,\prod_{p\leq
P}\Big{(}1+\frac{1}{p}\Big{)}\bigg{(}\sum_{t=1}^{k-\ell}\bigg{\|}\sum_{m\in
A}f_{t}(mx)\bigg{\|}_{L^{1}(\mathbb{T})}+2\sum_{t\in I_{1}\cup
I_{2}}\lambda_{t}\bigg{\|}\sum_{m\in
A}f_{t}(mx)\bigg{\|}_{L^{1}(\mathbb{T})}\bigg{)}.$

By Mertens’ estimates we get

$\prod_{p\leq P}\Big{(}1+\frac{1}{p}\Big{)}\ll\log P\asymp\log\log N.$

Hence there is $t\in I$ such that $\big{\|}\sum_{m\in
A}f_{t}(mx)\big{\|}_{L^{1}(\mathbb{T})}\gg\frac{\log N}{\log\log N}$.

Note that,

$\int_{\mathbb{T}}\sum_{n\in A}f_{t}(nx)dx=0.$

Thus we have

$\max_{x\in\mathbb{T}}\sum_{n\in A}f_{t}(nx)\geq\frac{1}{2}\bigg{\|}\sum_{n\in
A}f_{t}(nx)\bigg{\|}_{L^{1}(\mathbb{T})}.$

Together with (22) and (23), we get

$\mathscr{M}(A)-\frac{N}{k+\ell}\gg\frac{\log N}{\log\log N},$

and this proves Theorem 1.1 (ii).

###  5.2. Proof of Theorem 1.1 (iii)

Let $u$ be an even integer, and let $t=u/2$ in this subsection. Consider the
following matrix

$X=\left(\begin{array}[]{cccc}\sin(\pi/u)&\sin(3\pi/u)&\cdots&\sin((2t-1)\pi/u)\\\
\sin(2\pi/u)&\sin(6\pi/u)&\cdots&\sin(2(2t-1)\pi/u)\\\
\cdots&\cdots&\cdots&\cdots\\\
\sin(t\pi/u)&\sin(3t\pi/u)&\cdots&\sin(t(2t-1)\pi/u)\end{array}\right).$

By Lemma 2.1, there is $\bm{\alpha}\in\mathbb{R}^{t}$, with $|\alpha_{i}|\leq
t^{t}$, such that $X\bm{\alpha}^{T}=(-1,\dots,0,0)^{T}$.

For each odd integer $v$ ranging from the interval $[1,u)$, define
$\mathcal{P}_{v}$ to be an infinite collection of pairs $(k_{v},\ell_{v})$ of
positive integers such that $k_{v}=(u+v)\ell_{v}/(u-v)$. Let $F_{(k,\ell)}(x)$
and $G_{(k,\ell)}(x)$ be the function constructed in (24) and (25) with
respect to the pair $(k,\ell)$. Note that in the current constructions, for
every $(k_{1},\ell_{1}),(k_{2},\ell_{2})\in\mathcal{P}_{v}$, we have

$F_{(k_{1},\ell_{1})}\Big{(}\frac{x}{k_{1}-\ell_{1}}\Big{)}=F_{(k_{2},\ell_{2})}\Big{(}\frac{x}{k_{2}-\ell_{2}}\Big{)},$

and we denote the above function by $F_{v}(x)$ since it only depends on $v$.
Similarly, we also have

$(k_{1}-\ell_{1})G_{(k_{1},\ell_{1})}\Big{(}\frac{x}{k_{1}-\ell_{1}}\Big{)}=(k_{2}-\ell_{2})G_{(k_{2},\ell_{2})}\Big{(}\frac{x}{k_{2}-\ell_{2}}\Big{)},$

and we denote the above function by $G_{v}(x)$.

Let $\bm{F}(x)=\left(F_{1}(x),F_{3}(x),\dots F_{2t-1}(x)\right),$ and we
construct

$F(x):=\bm{F}(x)\bm{\alpha}^{T}=\frac{2}{\pi}\sum_{n\geq
1}\frac{\Phi(n)}{n}\cos(2\pi nx),$

where

$\Phi(n):=\begin{cases}1&\text{ when }n\equiv 1,u-1\pmod{2u},\\\ -1&\text{
when }n\equiv u+1,-1\pmod{2u},\\\ 0&\text{ otherwise, }\end{cases}$

since in this case $k_{v}-\ell_{v}$ is always even for every
$(k_{v},\ell_{v})$ in $\mathcal{P}_{v}$. Note that $\Phi(n)$ is a
multiplicative function. Let $\mathcal{M}$ be the set of square-free integers
that only contains prime factors at most $P$ and $1\in\mathcal{M}$, hence we
have

$\sum_{m\in\mathcal{M}}\frac{\Phi(m)\mu(m)}{m}F(mx)=\frac{2}{\pi}\Big{(}\cos(2\pi
x)+\sum_{n\in\mathcal{N}}\frac{\Phi(n)}{n}\cos(2\pi nx)\Big{)}.$

Similarly, we consider the matrix

$Y=\left(\begin{array}[]{cccc}\sin(\pi/2u)&\sin(3\pi/2u)&\cdots&\sin((2t-1)\pi/2u)\\\
\sin(3\pi/2u)&\sin(9\pi/2u)&\cdots&\sin(3(2t-1)\pi/2u)\\\
\cdots&\cdots&\cdots&\cdots\\\
\sin((2t-1)\pi/2u)&\sin(3(2t-1)\pi/2u)&\cdots&\sin((2t-1)^{2}\pi/2u)\end{array}\right).$

By Lemma 2.1, there is $\bm{\beta}\in\mathbb{R}^{t}$, with $|\beta_{i}|\leq
t^{t}$, such that $Y\bm{\beta}^{T}=(1,\dots,0,0)^{T}$. Let
$\bm{G}(x)=\left(G_{1}(x),G_{3}(x),\dots,G_{2t-1}(x)\right),$ and we construct

$G(x):=\bm{G}(x)\bm{\beta}^{T}=\frac{2}{\pi}\sum_{n\geq
1}\frac{\Psi(n)}{n}\sin(2\pi nx),$

where

$\Psi(n):=\begin{cases}1&\text{ when }n\equiv\pm 1\pmod{4u},\\\ -1&\text{ when
}n\equiv\pm(2u-1)\pmod{4u},\\\ 0&\text{ otherwise. }\end{cases}$

We also have $\Psi(n)$ is a multiplicative function. Hence

$\sum_{m\in\mathcal{M}}\frac{\Psi(m)\mu(m)}{m}G(mx)=\frac{2}{\pi}\Big{(}\sin(2\pi
x)+\sum_{n\in\mathcal{N}}\frac{\Psi(n)}{n}\sin(2\pi nx)\Big{)}.$

Finally, we apply Corollary 3.4. Using a similar computation employed in
Section 5.1, we obtain that

$\max\Big{\\{}\Big{\|}\sum_{m\in
A}F(mx)\Big{\|}_{L^{1}(\mathbb{T})},\Big{\|}\sum_{m\in
A}G(mx)\Big{\|}_{L^{1}(\mathbb{T})}\Big{\\}}\gg\frac{\log N}{\log\log N}.$

This implies there is an odd integer $v\in[1,u)$ such that

$\max\Big{\\{}\Big{\|}\sum_{m\in
A}F_{v}(mx)\Big{\|}_{L^{1}(\mathbb{T})},\Big{\|}\sum_{m\in
A}G_{v}(mx)\Big{\|}_{L^{1}(\mathbb{T})}\Big{\\}}\gg\frac{\log N}{\log\log N}.$

Therefore, from a similar argument we used in Section 5.1, we can conclude
that the size of the maximal $(k_{v},\ell_{v})$-sum-free subset of $A$ for
every $(k_{v},\ell_{v})\in\mathcal{P}_{v}$ is at least

$\frac{N}{k_{v}+\ell_{v}}+c\frac{\log N}{\log\log N}$

for some positive $c$. This proves Theorem 1.1 (iii).

##  6\. Structure of infinite $(k,\ell)$-sum-free sets

Given $A\subseteq\mathbb{N}^{>0}$, the _upper density_ of $A$ is defined as

$\overline{d}(A)=\limsup_{N\to\infty}\frac{|A\cap[N]|}{N}.$

We also define the _upper density on multiples_ of $A$ by

$\widetilde{d}(A)=\limsup_{N\to\infty}\limsup_{n\to\infty}\frac{|A\cap(N!\cdot[n])|}{n}.$

In this section, we will prove the following theorem, which will be used in
the next section when constructing the upper bound estimate for Theorem 1
(iv).

######  Theorem 6.1.

Suppose that $A\subseteq\mathbb{N}^{>0}$, and $A$ is $(k,\ell)$-sum-free. Then
$\widetilde{d}(A)\leq\frac{1}{k+\ell}$.

We break the proof of this theorem into three lemmas. The first lemma says
that if a $(k,\ell)$-sum-free set $A$ contains a certain long arithmetic
progression, then the upper density of $A$ is bounded.

######  Lemma 6.2.

Let $A\subseteq\mathbb{N}^{>0}$ be a $(k,\ell)$-sum-free set. Let $x,s,d,m$ be
positive integers, such that $s\in\ell A-(k-1)A$, $x+d\cdot[m]\subseteq A$,
and $s$ is in the coset $x+d\cdot\mathbb{Z}$. Then

$\overline{d}(A)\leq\frac{m+k+\ell-2}{(k+\ell)m+2(k+\ell-2)}.$

###### Proof.

Since $s\in\ell A-(k-1)A$ and $A$ is $(k,\ell)$-sum-free, we have $s\notin A$.
We will only consider $s\leq x$, and the case when $s\geq x+m$ follows from
the same proof. Since $x+d\cdot[m]\subseteq A$, then
$\big{(}x+d\cdot[m]\big{)}\cap\big{(}\ell A-(k-1)A\big{)}=\varnothing.$ Thus,
there is $s_{0}\in x+d\cdot\mathbb{Z}$, such that $s_{0}\in\ell A-(k-1)A$, and

(27) $\big{(}s_{0}+d\cdot[m]\big{)}\cap\big{(}\ell
A-(k-1)A\big{)}=\varnothing.$

Let $s_{0}=\sum_{i=1}^{\ell}a_{i}-\sum_{j=1}^{k-1}b_{j}$, where
$a_{i},b_{j}\in A$ for every $1\leq i\leq\ell$ and $1\leq j\leq k-1$.

Let $B\subseteq A$ such that

$B:=\\{b\in A\mid\big{(}b+d\cdot[m]\big{)}\cap A\neq\varnothing\\}.$

Set $a_{0}=b_{0}=0$. Given integers $1\leq u\leq k-1$ and $2\leq v\leq\ell$,
let

$\mathcal{C}(u)=B+\sum_{j=1}^{k-u}b_{j}+(u-1)a_{1},\quad\quad\mathcal{D}(v)=B+\sum_{j=0}^{\ell-v}a_{j}+\sum_{i=0}^{v-1}b_{i},$

and $\mathcal{C}(k)=A+(k-1)a_{1}$,
$\mathcal{D}(1)=A+\sum_{j=1}^{\ell-1}a_{j}$. Let
$\mathscr{F}=\\{\mathcal{C}(u),\mathcal{D}(v)\mid u\in[k],v\in[\ell]\\}$ be
the collection of all $\mathcal{C}(u)$ and $\mathcal{D}(v)$.

######  Claim 1.

Elements in $\mathscr{F}$ are pairwise disjoint.

_Proof of Claim 1._ Observe that for every $u\in[k]$ and $v\in[\ell]$,
$\mathcal{C}(u)\cap\mathcal{D}(v)=\varnothing$. Otherwise, we will get
$kA\cap\ell A\neq\varnothing$, contradicts that $A$ is $(k,\ell)$-sum-free.
Let $u_{1},u_{2}\in[k]$ and $u_{1}<u_{2}$. Suppose that
$\mathcal{C}(u_{1})\cap\mathcal{C}(u_{2})\neq\varnothing$. Then there exist
$y_{1}\in B$ and $y_{2}\in A$, such that

$y_{1}+\sum_{j=k-u_{2}+1}^{k-u_{1}}b_{j}=y_{2}+(u_{2}-u_{1})a_{1}.$

Then

$\displaystyle s_{0}$
$\displaystyle=\sum_{i=1}^{\ell}a_{i}-\sum_{j=1}^{k-1}b_{j}$
$\displaystyle=y_{1}+\sum_{i=2}^{\ell}a_{i}-y_{2}-(u_{2}-u_{1}-1)a_{1}-\sum_{j\in[1,k-u_{2}]\cup[k-u_{1}+1,k-1]}b_{j}.$

Since $y_{1}\in B$, thus there is $r\in[m]$ such that $y_{1}+rd\in A$. This
implies $s_{0}+rd\in\ell A-(k-1)A$, contradicts (27).

Suppose $\mathcal{D}(v_{1})\cap\mathcal{D}(v_{2})\neq\varnothing$ for some
$v_{1},v_{2}\in[\ell]$ and $v_{1}<v_{2}$. Similarly, there exist $y_{1}\in A$
and $y_{2}\in B$, such that

$y_{1}+\sum_{j=\ell-v_{2}+1}^{\ell-
v_{1}}a_{j}=y_{2}+\sum_{i=v_{1}}^{v_{2}-1}b_{i}.$

Let $c_{0}=0$, and let $c_{1},\dots,c_{v_{2}-v_{1}-1}\in A$ if
$v_{2}>v_{1}+1$. Therefore

$\displaystyle s_{0}=y_{2}+\sum_{j\in[0,\ell-v_{2}]\cup[\ell-
v_{1}+1,\ell]}a_{j}+\sum_{t=0}^{v_{2}-v_{1}-1}c_{t}-y_{1}-\sum_{i\in[0,v_{1}-1]\cup[v_{2},k-1]}b_{i}-\sum_{t=0}^{v_{2}-v_{1}-1}c_{t}.$

Observe $y_{2}\in B$ implies that there is $r\in[m]$, such that $y_{2}+rd\in
A$. Hence $s_{0}+rd\in\ell A-(k-1)A$, which contradicts (27). ∎

By Claim 1, we obtain

(28) $(k+\ell-2)\overline{d}(B)+2\overline{d}(A)\leq 1.$

On the other hand, let $\mathcal{N}(t)=A\setminus B+td$ for every $t\in[m]$,
and let

$\mathscr{G}=\Big{\\{}A,A-(k-1)x+\sum_{i=1}^{\ell-1}a_{i},\mathcal{N}(t)\
\Big{|}\ t\in[m]\Big{\\}}.$

######  Claim 2.

Elements in $\mathscr{G}$ are pairwise disjoint.

_Proof of Claim 2._ Suppose there are $u,v\in[m]$, $u<v$, such that
$\mathcal{N}(u)\cap\mathcal{N}(v)\neq\varnothing$. Thus we have $c\in
A\setminus B$ such that $c_{1}+(u-v)d\in A$, and this contradicts the
assumption of $B$. Same conclusion holds if
$A\cap\mathcal{N}(u)\neq\varnothing$. Observe that if
$A\cap(A-(k-1)x+\sum_{i=1}^{\ell-1}a_{i})\neq\varnothing$, it will contradict
that $A$ is $(k,\ell)$-sum-free. Finally, we assume that there are
$c_{1},c_{2}\in A$, $u\in[m]$ such that

$c_{1}+ud=c_{2}-(k-1)x+\sum_{i=1}^{\ell-1}a_{i}.$

Thus, $c_{1}+x+ud+(k-2)x=c_{2}+\sum_{i=1}^{\ell-1}a_{i}$. Since
$x+d\cdot[m]\subseteq A$, this contradicts $A$ is $(k,\ell)$-sum-free. ∎

Thus, by Claim 2, we get

$(m+2)\overline{d}(A)-m\overline{d}(B)\leq 1.$

Together with (28), this finishes the proof. ∎

The next lemma is a finite version of the Szemerédi Theorem [26], and we will
use it to find the arithmetic progression in Lemma 6.2.

######  Lemma 6.3 ([26]).

For every $\varepsilon>0$ and $m\in\mathbb{N}^{>0}$, there is
$L=L(\varepsilon,m)>0$ such that every set $A\subseteq\mathbb{N}^{>0}$ with
$\overline{d}(A)>\varepsilon$, there exist $x\in\mathbb{N}$, $d<L$, and
$x+d\cdot[m]\subseteq A$.

Our final lemma says that a $(k,\ell)$-sum-free set $A$ with large upper
density should be periodic. This structural result can be viewed as a
generalization of the Łuczak–Schoen Theorem [21].

######  Lemma 6.4.

Let $\varepsilon>0$. Then there is $D>0$ such that the following holds. Let
$A\subseteq\mathbb{N}^{>0}$ be a $(k,\ell)$-sum-free set, and
$\overline{d}(A)>\frac{1}{k+\ell}+\varepsilon$. Then $A$ is contained in a
periodic $(k,\ell)$-sum-free set with period $D$.

###### Proof.

We pick $m\in\mathbb{N}^{>0}$ such that

(29) $\frac{m+k+\ell-2}{(k+\ell)m+2(k+\ell-2)}<\frac{1}{k+\ell}+\varepsilon.$

Let $L=L(\varepsilon,m)$ be as in Lemma 6.3. Let $D=L!$. Suppose the lemma
fails. Let $C\subseteq\mathbb{N}^{>0}$ be a periodic set with period $D$,
consists of all positive integers in every coset $a+D\cdot\mathbb{Z}$ for
$a\in A$. Thus $C$ is not $(k,\ell)$-sum-free. This means, there are
$a_{1},\dots,a_{\ell}$ and $b_{1},\dots,b_{k}$ in $C$ such that
$\sum_{i=1}^{\ell}a_{i}=\sum_{j=1}^{k}b_{j}$. Let $P$ be the “$(k,\ell)$-sum-
free” part of $C$. That is,

$P=C\setminus\big{(}\ell C-(k-1)C\big{)}.$

Set $a_{0}=b_{0}=0$. For every $u\in[k]$ and $v\in[\ell]$, let

$\mathcal{M}(u)=P+\sum_{j=0}^{k-u}b_{j}+(u-1)a_{1},\qquad\mathcal{N}(v)=P+\sum_{i=0}^{\ell-v}a_{i}+(v-1)b_{1}.$

Let $\mathscr{F}$ be the collection of all $\mathcal{M}(u)$ and
$\mathcal{N}(v)$.

######  Claim 3.

Elements in $\mathscr{F}$ are pairwise disjoint.

_Proof of Claim 3._ Observe that for every $u\in[k]$ and $v\in[\ell]$,
$\mathcal{M}(u)\cap\mathcal{N}(v)=\varnothing$. Otherwise there are
$p_{1},p_{2}\in P$, such that

$p_{1}=p_{2}+\sum_{i=0}^{\ell-v}a_{1}+(v-1)b-\sum_{j=0}^{k-u}b_{j}-(u-1)a_{1}\in\ell
C-(k-1)C,$

contradicts the assumption of $P$. Now, suppose $u_{1},u_{2}\in[k]$,
$u_{1}<u_{2}$, such that
$\mathcal{M}(u_{1})\cap\mathcal{M}(u_{2})\neq\varnothing$. The case that
$\mathcal{N}(v_{1})\cap\mathcal{N}(v_{2})\neq\varnothing$ can be proved in the
same way. Thus, there exist $p_{1},p_{2}\in P$, such that

$p_{1}+\sum_{j=k-u_{2}+1}^{k-u_{1}}b_{j}=p_{2}+(u_{2}-u_{1})a_{1}.$

This implies

$0=\sum_{j=1}^{k}b_{j}-\sum_{i=1}^{\ell}a_{i}=p_{2}+(u_{2}-u_{1}-1)a_{1}+\sum_{j\in[0,k-u_{2}]\cup[k-u_{1}+1,k]}b_{j}-\sum_{i=2}^{\ell}a_{i}-p_{1},$

hence $P\cap(\ell C-(k-1)C)\neq\varnothing$, contradiction. ∎

By Claim 3, we obtain that $\overline{d}(P)\leq\frac{1}{k+\ell}$. This means,
$\overline{d}(A\setminus P)\geq\varepsilon$. By Lemma 6.3, $A\setminus P$
contains a progression $x+d\cdot[m]$, and $d<L$. By the way we construct $P$,
there are $s_{1},\dots,s_{\ell}$ and $t_{1},\dots,t_{k-1}$ in $C$ such that

$x+dm=\sum_{i=1}^{\ell}s_{i}-\sum_{j=1}^{k-1}t_{j}.$

Hence there are $e_{1},\dots,e_{\ell}$ and $f_{1},\dots,f_{k-1}$ in $A$, such
that for every $i\in[\ell]$ and $j\in[k-1]$, we have that $e_{i}\in
s_{i}+D\cdot\mathbb{Z}$, and $f_{j}\in t_{j}+D\cdot\mathbb{Z}$. Let
$s=\sum_{i=1}^{\ell}e_{i}-\sum_{j=1}^{k-1}f_{j}$, thus $s\in\ell A-(k-1)A$,
and $s\in x+D\cdot\mathbb{Z}$. Since $d\mid D$, we have $s\in
x+d\cdot\mathbb{Z}$. By Lemma 6.2, we have that

$\overline{d}(A)\leq\frac{m+k+\ell-2}{(k+\ell)m+2(k+\ell-2)},$

and this contradicts (29). ∎

Now we can prove the main result of this section.

###### Proof of Theorem 6.1.

Let $A/N!:=\\{a\mid aN!\in A\\}$. Thus $\widetilde{d}(A)>0$ implies that
$A/N!$ contains a multiple of every natural number. In particular, $A/N!$ is
not contained in a periodic $(k,\ell)$-sum-free set. By Lemma 6.4,
$\overline{d}(A/N!)\leq\frac{1}{k+\ell}$. Observe that
$\widetilde{d}(A)=\limsup_{N\to\infty}\overline{d}(A/N!)$, thus
$\widetilde{d}(A)\leq\frac{1}{k+\ell}$. ∎

##  7\. Upper bound constructions

Recall a _Følner sequence_ in $(\mathbb{N},\cdot)$ is any sequence
$\Phi:m\mapsto\Phi_{m}$ of finite non-empty subsets of $\mathbb{N}$, such that
for every $a\in\mathbb{N}$,

$\lim_{m\to\infty}\frac{|\Phi_{m}\triangle(a\cdot\Phi_{m})|}{|\Phi_{m}|}=0.$

Følner sequence has been used as some good constructions in many additive
combinatorics problems, see [23, 6] for example. In this section, we will show
that the sets in Følner sequence will never have large $(k,\ell)$-sum-free
subsets. In fact, we will prove the following theorem.

######  Theorem 7.1.

Let $\Phi=\\{\Phi_{m}\\}$ be a Følner sequence in $(\mathbb{N},\cdot)$.
Suppose there are infinitely many $m$ such that $\Phi_{m}$ has a
$(k,\ell)$-sum-free set of size at least $\delta|\Phi_{m}|$ for some positive
real number $\delta\leq 1$. Then there exists a $(k,\ell)$-sum-free set
$A\subseteq\mathbb{N}$ such that $\widetilde{d}(A)\geq\delta$.

Theorem 1.1 (iv) follows easily from Theorem 7.1 and Theorem 6.1.

###### Proof of Theorem 7.1.

By passing to a subsequence, we may assume for every $\Phi_{m}\in\Phi$, there
is a $(k,\ell)$-sum-free set $\phi_{m}\subseteq\Phi_{m}$, such that
$|\phi_{m}|/|\Phi_{m}|\geq\delta$. Let $\beta\mathbb{N}$ be the collection of
ultrafilters, and let $\mathscr{U}\in\beta\mathbb{N}\setminus\mathbb{N}$ be a
non-principal ultrafilter. Let
${}^{*}\mathbb{Z}=\prod_{m\to\mathscr{U}}\mathbb{Z}$ be the ultrapower of
$\mathbb{Z}$. Let $\Sigma$ be the Loeb $\sigma$-algebra on ${}^{*}\mathbb{Z}$.
Let $\mu_{L}$ be the Loeb measure induced by $\mu_{m}$, where
$\mu_{m}(X)=|X\cap\Phi_{m}|/|\Phi_{m}|$ for every $X\subseteq\mathbb{Z}$. Let
$\phi=\prod_{m\to\mathscr{U}}\phi_{m}$ be the internal set. Then by Łoś’s
Theorem, $\phi$ is $(k,\ell)$-sum-free, and

$\mu_{L}(\phi)=\mathrm{st}\left(\lim_{m\to\mathscr{U}}\mu_{m}(\phi_{m})\right)\geq\delta.$

######  Claim 4.

For every $a\in\mathbb{N}$, the map $x\mapsto ax$ is $\Sigma$-measurable and
$\mu_{L}$-preserving.

_Proof of Claim 4._ Note that $x\mapsto ax$ sends internal sets to internal
sets, thus it is $\Sigma$-measurable. For every $X\subseteq\mathbb{Z}$, since

$\mu_{m}(X)-\mu_{m}(a\cdot X)=\frac{|X\cap\Phi_{m}|-|(a\cdot
X)\cap\Phi_{m}|}{|\Phi_{m}|}\leq\frac{|(a\cdot\Phi_{m})\triangle\Phi_{m}|}{|\Phi_{m}|}\to
0$

as $m\to\infty$, it preserves the Loeb measure $\mu_{L}$. ∎

Now we are able to apply the probabilistic argument used in the proof of
Proposition 4.1 on the set $\phi$. For every
$x\in{{}^{*}\mathbb{Z}}\setminus\\{0\\}$, let $A_{x}:=\\{a\in\mathbb{N}\mid
ax\in\phi\\}$. Thus $A_{x}$ is $(k,\ell)$-sum-free. By Claim 4,
$\widetilde{d}(A_{x})$ is $\Sigma$-measurable on $x$. Suppose $x$ is chosen
uniformly at random with respect to the measure $\mu_{L}$. By Fatou’s Lemma,

$\displaystyle\mathbb{E}(\widetilde{d}(A_{x}))$
$\displaystyle\geq\limsup_{N\to\infty}\limsup_{n\to\infty}\mathbb{E}\left(\frac{|A_{x}\cap(N!\cdot[n])|}{n}\right)$
$\displaystyle=\limsup_{N\to\infty}\limsup_{n\to\infty}\frac{1}{n}\sum_{j=1}^{n}\mathbb{P}(jN!x\in\phi).$

By Claim 4, we have

$\mathbb{E}(\widetilde{d}(A_{x}))\geq\limsup_{N\to\infty}\limsup_{n\to\infty}\frac{1}{n}\sum_{j=1}^{n}\mathbb{P}(x\in\phi)=\mu_{L}(\phi)\geq\delta.$

Thus by Pigeonhole Principle, there exists a set $A_{x}\subseteq\mathbb{N}$
for some $x\in{{}^{*}\mathbb{Z}}\setminus\\{0\\}$ such that
$\widetilde{d}(A_{x})\geq\delta$. ∎

##  8\. Restricted $(k,\ell)$-sum-free sets

In this section, we prove Theorem 1.2. Since restricted $(k,\ell)$-sum-free
can be expressed by first order formula, once we prove the conclusion in
Theorem 6.1 also works for restricted $(k,\ell)$-sum-free sets, Theorem 1.2
follows by using the same proof in Theorem 7.1. More precisely, in the proof
of Theorem 7.1, if $A_{x}=\\{a\in\mathbb{N}\mid ax\in\phi\\}$ is not
restricted $(k,\ell)$-sum-free for some
$x\in{{}^{*}\mathbb{Z}}\setminus\\{0\\}$, since the map $a\mapsto ax$ is
injective, we also have that $\phi$ is not restricted $(k,\ell)$-sum-free.

We first consider the analogue of Lemma 6.2 for restricted $(k,\ell)$-sum-free
sets. The similar argument also works here, with a different and more involved
constructions of sets $\mathcal{C}(u)$, $\mathcal{D}(v)$, and
$\mathcal{N}(t)$, and a more careful analysis. These new constructions will
lead a slightly different structure for the large infinite restricted
$(k,\ell)$-sum-free sets in Lemma 8.2, compared to the non-restricted setting.

######  Lemma 8.1.

Let $k,\ell$ be positive integers, and $\ell<k\leq 2\ell+1$. Suppose
$A\subseteq\mathbb{N}^{>0}$ be a restricted $(k,\ell)$-sum-free set. Define
$W\subseteq\mathbb{N}^{>0}$, satisfies that for every $w\in W$, there are
$\ell$ distinct elements $y_{1},\dots,y_{\ell}\in A$, and $k-1$ distinct
elements $z_{1},\dots,z_{k-1}\in A$, such that $w\neq z_{i}$ for $i\in[k-1]$,
and $w=\sum_{j=1}^{\ell}y_{j}-\sum_{i=1}^{k-1}z_{i}$. Let $x,s,d,m$ be
integers, such that $s\in W$, $m>k+\ell$, $x+d\cdot[m]\subseteq A$, and $s$ is
in the coset $x+d\cdot\mathbb{Z}$. Then

$\overline{d}(A)\leq\frac{m-2}{(k+\ell)(m-k-\ell)+2(k+\ell-2)}.$

###### Proof.

$s\in W$ implies that $s\notin A$ since $A$ is restricted $(k,\ell)$-sum-free.
We only consider the case when $s<x$. Since $A\cap W=\varnothing$, there is
$s_{0}\in x+d\cdot\mathbb{Z}$ such that $s_{0}\in W$ and
$(s_{0}+d\cdot[m])\cap W=\varnothing$. Thus there are $\ell$ distinct elements
$a_{1},\dots,a_{l}\in A$, and $k-1$ distinct elements $b_{1},\dots,b_{k-1}\in
A$, $s_{0}\neq b_{j}$ for every $j\in[k-1]$, and
$s_{0}=\sum_{i=1}^{\ell}a_{i}-\sum_{j=1}^{k-1}b_{j}$. Let $\mathcal{E}$
consists of $k-1$ distinct elements $e_{1},\dots,e_{k-1}\in A$, and all of
them are disjoint from $\\{a_{i}\\}_{i=1}^{\ell}$, $\\{b_{j}\\}_{j=1}^{k-1}$,
$\\{s_{0}\\}$ and $s_{0}+d\cdot[m]$. Let

(30)
$A^{\prime}=A\setminus\Big{(}\bigcup_{i=1}^{\ell}\\{a_{i}\\}\cup\bigcup_{j=1}^{k-1}\\{b_{j}\\}\cup\mathcal{E}\cup\\{s_{0}\\}\cup(s_{0}+d\cdot[m])\Big{)}.$

Observe that

(31) $(s_{0}+d\cdot[m])\cap\\{b_{j}\\}_{j=1}^{k-1}=\varnothing,$

since $b_{j}\in W$ for every $j\in[k-1]$. Let $m^{\prime}=m-k-\ell$, we claim
that

(32) $(s_{0}+d\cdot[m^{\prime}])\cap\\{a_{i}\\}_{i=1}^{\ell}=\varnothing.$

Otherwise, suppose there is $r\in[m^{\prime}]$ such that $s_{0}+rd=a_{t}$ for
some $t\in[\ell]$. Then

$x^{\prime}+\sum_{j=1}^{k-1}b_{j}=x^{\prime}+rd+\sum_{j=1,j\neq
t}^{\ell}a_{j}.$

By taking $x^{\prime}\in x+d\cdot[0,m-r]$, then both $x^{\prime}$ and
$x^{\prime}+rd$ are in $A$. Since $m-r\geq k+\ell$, there is
$\alpha\in[0,m-r]$ such that $x+\alpha d\notin\\{b_{j}\\}_{j=1}^{k-1}$, and
$x+(\alpha+r)d\notin\\{a_{i}\\}_{i=1}^{\ell}$. This contradicts that $A$ is
restricted $(k,\ell)$-sum-free.

Let $B=\\{b\in A^{\prime}\mid(b+d\cdot[m^{\prime}])\cap A\neq\varnothing\\},$
and let

$B^{\prime}=B\setminus\left(\Big{(}\bigcup_{i=1}^{\ell}\\{a_{i}\\}\cup\mathcal{E}\Big{)}-d\cdot[m^{\prime}]\right).$

Let $c_{0}=0$, $c_{i}=a_{i}$ when $i\in[\ell]$, and $c_{j}=a_{j-\ell}$ when
$j\in[\ell+1,k-1]$. For $u\in[k-1]$ and $v\in[2,\ell]$, let

$\mathcal{C}(u)=B^{\prime}+\sum_{j=1}^{k-u}b_{j}+\sum_{i=0}^{u-1}c_{i},\quad\mathcal{D}(v)=B^{\prime}+\sum_{i=0}^{\ell-v}a_{i}+\sum_{j=0}^{v-1}b_{j},$

and $\mathcal{C}(k)=A^{\prime}+\sum_{i=0}^{k-1}c_{i}$,
$\mathcal{D}(1)=A^{\prime}+\sum_{i=1}^{\ell-1}a_{i}$. Let $\mathscr{F}$
consists of all $\mathcal{C}(u)$ and $\mathcal{D}(v)$, then Claim 1 still
holds. In fact, suppose there are $u_{1},u_{2}\in[k]$, $u_{1}<u_{2}$ such that
$\mathcal{C}(u_{1})\cap\mathcal{C}(u_{2})\neq\varnothing$ (the case when
$\mathcal{D}(v_{1})\cap\mathcal{D}(v_{2})\neq\varnothing$ is simpler). Then
there exist $y_{1}\in B^{\prime}$, $y_{2}\in A^{\prime}$ such that

$y_{1}+\sum_{j=k-u_{2}+1}^{k-u_{1}}b_{j}=y_{2}+\sum_{i=u_{1}}^{u_{2}-1}c_{i}.$

Let $e_{0}=0$, and $e_{1},\dots,e_{u_{2}-u_{1}-1}\in\mathcal{E}$ if
$u_{2}>u_{1}+1$. If $u_{2}\leq\ell$, we have

$s_{0}=y_{1}+\sum_{i\in[0,u_{1}-1]\cup[u_{2},\ell]}a_{i}+\sum_{t=0}^{u_{2}-u_{1}-1}e_{t}-y_{2}-\sum_{j\in[0,k-u_{2}]\cup[k-u_{1}+1,k-1]}b_{j}-\sum_{t=0}^{u_{2}-u_{1}-1}e_{t}.$

If $u_{1}\geq\ell+1$, we get

$s_{0}=y_{1}+\sum_{i\in[0,u_{1}-1-\ell]\cup[u_{2}-\ell,\ell]}a_{i}+\sum_{t=0}^{u_{2}-u_{1}-1}e_{t}-y_{2}-\sum_{j\in[0,k-u_{2}]\cup[k-u_{1}+1,k-1]}b_{j}-\sum_{t=0}^{u_{2}-u_{1}-1}e_{t}.$

If $u_{1}\leq\ell$, $u_{2}\geq\ell+1$, and $u_{2}-u_{1}+1\leq\ell$,

$s_{0}=y_{1}+\sum_{i\in[u_{2}-\ell,u_{1}-1]}a_{i}+\sum_{t=0}^{u_{2}-u_{1}-1}e_{t}-y_{2}-\sum_{j\in[0,k-u_{2}]\cup[k-u_{1}+1,k-1]}b_{j}-\sum_{t=0}^{u_{2}-u_{1}-1}e_{t}.$

If $u_{1}\leq\ell$, $u_{2}\geq\ell+1$, and $u_{2}-u_{1}\geq\ell$. Let
$e_{0}=0$, $e_{1},\dots,e_{\ell-1}\in\mathcal{E}$ if $\ell>1$. Thus

$s_{0}=y_{1}+\sum_{t=0}^{\ell-1}e_{t}-y_{2}-\sum_{j\in[0,k-u_{2}]\cup[k-u_{1}+1,k-1]}b_{j}-\sum_{t=0}^{\ell-1}e_{t}-\sum_{i=u_{1}}^{u_{2}-1-\ell}a_{i}.$

Note that $k\leq 2\ell+1$ implies $u_{2}-1-\ell\leq\ell$.

In any case, since $y_{1}\in B$, by (30), (31), and (32), there is
$r\in[m^{\prime}]$ such that $s_{0}+rd\in W$, which contradicts the assumption
of $s_{0}$. Therefore,

(33) $(k+\ell-2)\overline{d}(B)+2\overline{d}(A)\leq 1,$

since $\overline{d}(A^{\prime})=\overline{d}(A)$ and
$\overline{d}(B^{\prime})=\overline{d}(B)$.

We also modify the construction of $\mathcal{N}(t)$ in a similar way. For
every $t\in[m^{\prime}]$, let $\mathcal{N}(t)=A^{\prime}\setminus B+td$. Let
$e_{0}=0$, and $e_{1},\dots,e_{k-2}\in\mathcal{E}$ if $k\geq 3$. Let
$A^{\prime\prime}=A^{\prime}\setminus(x+d\cdot[m^{\prime}])$. Define

$\mathscr{G}=\Big{\\{}\mathcal{N}(t),A^{\prime},A^{\prime\prime}+\sum_{i=1}^{\ell-1}a_{i}-x-\sum_{j=0}^{k-2}e_{j}\
\Big{|}\ t\in[m^{\prime}]\Big{\\}}$

Then by using the similar argument, it is easy to see that Claim 2 still
holds. We omit the details here. We have

$(m-k-\ell+2)\overline{d}(A)-(m-k-\ell)\overline{d}(B)\leq 1,$

since $\overline{d}(A^{\prime\prime})=\overline{d}(A)$. Together with (33),
finishes the proof. ∎

Next, we consider the analogue of Lemma 6.4 for restricted $(k,\ell)$-sum-free
sets. The structure here is slightly different from the $(k,\ell)$-sum-free
sets.

######  Lemma 8.2.

Let $\varepsilon>0$ and let $k,\ell$ be positive integers with $\ell<k\leq
2\ell+1$. Then there is $D>0$ such that the following holds. Let
$A\subseteq\mathbb{N}^{>0}$ be a restricted $(k,\ell)$-sum-free set, and
$\overline{d}(A)>\frac{1}{k+\ell}+\varepsilon$. Then after removing at most
$D(2k+\ell)$ elements from $A$, it is contained in a periodic restricted
$(k,\ell)$-sum-free set with period $D$.

###### Proof.

We pick $m>k+\ell$ such that

(34)
$\frac{m-2}{(k+\ell)(m-k-\ell)+2(k+\ell-2)}<\frac{1}{k+\ell}+\varepsilon.$

Let $L=L(\varepsilon,m)$ be as in Lemma 6.3, and let $D=L!$. We consider the
partition of $\mathbb{N}$ into cosets:

$\mathbb{N}=\bigcup_{x\in[D]}x+D\cdot\mathbb{N}.$

For every $x\in[D]$, let $\mathbb{N}_{x}=x+D\cdot\mathbb{N}$, and
$A_{x}=A\cap\mathbb{N}_{x}$. Let $A^{\prime}$ be a subset of $A$, obtained by
removing $A_{x}$ from $A$ when $|A_{x}|<2k+\ell$. Hence
$\overline{d}(A^{\prime})=\overline{d}(A)$. Next, we are going to show that
$A^{\prime}$ is contained in a periodic restricted $(k,\ell)$-sum-free set
with period $D$. Suppose this is not the case. Let

$C=\Big{(}\bigcup_{a\in
A^{\prime}}a+D\cdot\mathbb{Z}\Big{)}\cap\mathbb{N}^{>0}.$

Thus $C$ is not restricted $(k,\ell)$-sum-free. This means, there are $\ell$
distinct elements $a_{1},\dots,a_{\ell}\in C$ and $k$ distinct elements
$b_{1},\dots,b_{k}\in C$, such that
$\sum_{i=1}^{\ell}a_{i}=\sum_{j=1}^{k}b_{j}$. Let $P$ be the “$(k,\ell)$-sum-
free” part of $C$, that for every $w\in P$, every $k-1$ distinct elements
$y_{1},\dots,y_{k-1}\in C\setminus\\{w\\}$, and every $\ell$ distinct elements
$z_{1},\dots,z_{\ell}\in C$, we have
$w+\sum_{i=1}^{k-1}y_{i}\neq\sum_{j=1}^{\ell}z_{j}$. Let $e_{0}=0$, and let
$\mathcal{E}$ consists of $k-1$ distinct elements $e_{1},\dots,e_{k-1}\in C$,
such that $\mathcal{E}$ is disjoint from $\\{a_{i}\\}_{i=1}^{\ell}$ and
$\\{b_{j}\\}_{j=1}^{k}$.

$P^{\prime}=P\setminus\Big{(}\bigcup_{i=1}^{\ell}\\{a_{i}\\}\cup\bigcup_{j=1}^{k}\\{b_{j}\\}\cup\mathcal{E}\Big{)}.$

Set $a_{0}=b_{0}=c_{0}=0$. Let $c_{t}=a_{t}$ when $t\in[\ell]$, and
$c_{t}=a_{t-\ell}$ when $t\in[\ell+1,k-1]$. For every $u\in[k]$ and
$v\in[\ell]$, let

$\mathcal{M}(u)=P^{\prime}+\sum_{j=0}^{k-u}b_{j}+\sum_{t=0}^{u-1}c_{t},\qquad\mathcal{N}(v)=P^{\prime}+\sum_{i=0}^{\ell-v}a_{i}+\sum_{t=0}^{v-1}b_{t}.$

Let $\mathscr{F}$ be the collection of all $\mathcal{M}(u)$ and
$\mathcal{N}(v)$. Then elements in $\mathscr{F}$ are pairwise disjoint.
Otherwise, suppose there are $u_{1},u_{2}\in[k]$, $u_{1}<u_{2}$ such that
$\mathcal{M}(u_{1})\cap\mathcal{M}(u_{2})\neq\varnothing$ (the case when
$\mathcal{N}(v_{1})\cap\mathcal{N}(v_{2})\neq\varnothing$ is simpler). Thus,
there are $y_{1},y_{2}\in P^{\prime}$, such that

$y_{1}+\sum_{k-u_{2}+1}^{k-u_{1}}b_{j}=y_{2}+\sum_{t=u_{1}}^{u_{2}-1}c_{t}.$

Let $e_{1},\dots,e_{u_{2}-u_{1}-1}\in\mathcal{E}$ if $u_{2}>u_{1}+1$. If
$u_{2}\leq\ell$, we have

$\displaystyle 0$ $\displaystyle=\sum_{i=1}^{\ell}a_{i}-\sum_{j=1}^{k}b_{j}$
$\displaystyle=y_{1}+\sum_{i\in[0,u_{1}-1]\cup[u_{2},\ell]}a_{i}+\sum_{t=0}^{u_{2}-u_{1}-1}e_{t}-y_{2}-\sum_{j\in[0,k-u_{2}]\cup[k-u_{1}+1,k]}b_{j}-\sum_{t=0}^{u_{2}-u_{1}-1}e_{t}.$

If $u_{1}\geq\ell+1$, we have

$0=y_{1}+\sum_{i\in[0,u_{1}-1-\ell]\cup[u_{2}-\ell,\ell]}a_{i}+\sum_{t=0}^{u_{2}-u_{1}-1}e_{t}-y_{2}-\sum_{j\in[0,k-u_{2}]\cup[k-u_{1}+1,k]}b_{j}-\sum_{t=0}^{u_{2}-u_{1}-1}e_{t}.$

If $u_{1}\leq\ell$, $u_{2}\geq\ell+1$, and $\ell\geq u_{2}-u_{1}$, we get

$0=y_{1}+\sum_{i=u_{2}-\ell}^{u_{1}-1}a_{i}+\sum_{t=0}^{u_{2}-u_{1}-1}e_{t}-y_{2}-\sum_{j\in[0,k-u_{2}]\cup[k-u_{1}+1,k]}b_{j}-\sum_{t=0}^{u_{2}-u_{1}-1}e_{t}.$

If $u_{1}\leq\ell$, $u_{2}\geq\ell+1$, and $\ell<u_{2}-u_{1}$. Let
$e_{1},\dots,e_{\ell-1}\in\mathcal{E}$ if $\ell>1$, we get

$0=y_{1}+\sum_{t=0}^{\ell-1}e_{t}-y_{2}-\sum_{j\in[0,k-u_{2}]\cup[k-u_{1}+1,k]}b_{j}-\sum_{i=u_{1}}^{u_{2}-1-\ell}a_{i}-\sum_{t=0}^{\ell-1}e_{t}.$

In any case, we get a contradiction with the assumption of $P^{\prime}$ and
the fact that $y_{2}\in P^{\prime}$. Therefore,

$\overline{d}(P)\leq\frac{1}{k+\ell},$

since $\overline{d}(P^{\prime})=\overline{d}(P)$. This means,
$\overline{d}(A^{\prime}\setminus P)\geq\varepsilon$. By Lemma 6.3,
$A^{\prime}\setminus P$ contains a progression $x+d\cdot[m]$, and $d<L$. By
the way we construct $P$, there are $\ell$ distinct elements
$s_{1},\dots,s_{\ell}\in C$ and $k-1$ distinct elements $t_{1},\dots,t_{k-1}$
in $C\setminus\\{x+m\\}$ such that

$x+m=\sum_{i=1}^{\ell}s_{i}-\sum_{j=1}^{k-1}t_{j}.$

By the way we construct $A^{\prime}$, for every $r\in[D]$, if
$|A^{\prime}\cap\mathbb{N}_{r}|>0$, then $|A^{\prime}\cap\mathbb{N}_{r}|\geq
2k+\ell$. Thus, there are $\ell$ distinct elements
$\alpha_{1},\dots,\alpha_{\ell}\in A^{\prime}$ and $k-1$ distinct elements
$\beta_{1},\dots,\beta_{k-1}\in A^{\prime}$, such that for every $i\in[\ell]$
and $j\in[k-1]$, we have that $\alpha_{i}\in s_{i}+D\cdot\mathbb{Z}$, and
$\beta_{j}\in t_{j}+D\cdot\mathbb{Z}$. Let
$s=\sum_{i=1}^{\ell}\alpha_{i}-\sum_{j=1}^{k-1}\beta_{j}$. Note that
$|A^{\prime}\cap\mathbb{N}_{r}|\geq 2k+\ell$ also implies that there is
$r^{\prime}\in[\ell]$, and $M\subseteq\mathbb{N}^{>0}$, $|M|\geq k$, such that

$\alpha_{r^{\prime}}+D\cdot M\subseteq
A^{\prime},\quad(\alpha_{r^{\prime}}+D\cdot
M)\cap\bigcup_{i=1}^{\ell}\\{\alpha_{i}\\}=\varnothing.$

Thus if $s\cap\\{\beta_{j}\\}_{j=1}^{k-1}\neq\varnothing$, then by changing
$\alpha_{r^{\prime}}$ by $\alpha_{r^{\prime}}+nD$ for some $n\in M$, one can
make $s+nD\cap\\{\beta_{j}\\}_{j=1}^{k-1}=\varnothing$. Since $d\mid D$, we
have $s\in x+d\cdot\mathbb{Z}$. By Lemma 6.2, we have that

$\overline{d}(A)\leq\frac{m-2}{(k+\ell)(m-k-\ell)+2(k+\ell-2)},$

and this contradicts (34). ∎

Let $A$ be a restricted $(k,\ell)$-sum-free set, and let $A^{\prime}$ be a
subset of $A$ obtained by removing finitely many elements from $A$. Observe
that, if $A^{\prime}$ is contained in a periodic restricted $(k,\ell)$-sum-
free set, then $A$ cannot contain a multiple of every natural number. Thus,
using the same proof in Theorem 6.1, we conclude that
$\widetilde{d}(A)\leq\frac{1}{k+\ell}$ if $A$ is restricted $(k,\ell)$-sum-
free.

##  9\. Concluding Remarks

In this paper, we first study $\mathscr{M}_{(k,\ell)}(N)$. In particular, we
prove that Conjecture 2 is true for infinitely many $(k,\ell)$. While solving
Conjecture 2 might not be a realistic target at the moment, the following
conjecture for the case when $k-\ell\geq 2$ might be feasible. This is because
in this case, Lemma 4.2 implies that we have two different asymmetric maximal
$(k,\ell)$-sum-free open sets in $\mathbb{T}$, and the technique developed in
this paper might be useful.

######  Conjecture 3.

Let $k,\ell$ be positive integers and $k\geq\ell+2$. Then there is a function
$\omega(N)\to\infty$ as $N\to\infty$, such that

$\mathscr{M}_{(k,\ell)}(N)\geq\frac{N}{k+\ell}+\omega(N).$

We also study $\widehat{\mathscr{M}}_{(k,\ell)}(N)$ in Theorem 1.2. As we can
see in the proofs in Section 8, when $k>2\ell+1$, the current strategy failed
to obtain disjoint sets $\mathcal{C}$ and $\mathcal{D}$ in the proof of Lemma
8.1, as well as disjoint sets $\mathcal{M}$ and $\mathcal{N}$ in the proof of
Lemma 8.2. Although we think it is very likely that the conclusion in Theorem
1.2 holds for every $k$ and $\ell$, the case $k>2\ell+1$ may require some new
ingredients.

######  Conjecture 4.

For every positive integers $k,\ell$ with $k>2\ell+1$,

$\widehat{\mathscr{M}}_{(k,\ell)}(N)=\Big{(}\frac{1}{k+\ell}+o(1)\Big{)}N.$

A $(k,\ell)$-sum-free set is a set forbidding a linear equation
$\sum_{i=1}^{\ell}x_{i}=\sum_{j=1}^{k}y_{j}$. Another interesting direction is
to consider the analogue problem on sets forbidding a system of linear
equations. One of the most interesting problems along this line might be
forbidding the projective cubes. Given a multiset $S=\\{s_{1},\dots,s_{d}\\}$,
a _$d$ -dimensional projective cube_ generated by $S$ is

$\square^{d}(S):=\Big{\\{}\sum_{i\in I}s_{i}\ \Big{|}\ \varnothing\neq
I\subseteq[d]\Big{\\}}.$

A set is _$\square^{d}$ -free_ if it does not contain any $d$-dimensional
projective cubes as its subsets. Extremal properties of projective cubes have
a vast literature, see e.g. [1, 12, 14, 20]. The problem on forbidding
$d$-dimensional projective cubes can be viewed as a generalization of sum-free
sets in another direction, since a sum-free set is also a $\square^{2}$-free
set. Thus, the following problem is worthwhile to pursue.

######  Question 5.

Let $d\geq 3$ be an integer. Define

$\mathscr{M}_{\square^{d}}(N):=\inf_{\begin{subarray}{c}A\subseteq\mathbb{N}^{>0}\\\
|A|=N\end{subarray}}\max_{\begin{subarray}{c}B\subseteq A\\\ B\text{ \emph{is}
}\square^{d}\text{\emph{-free}}\end{subarray}}|B|.$

Determine $\mathscr{M}_{\square^{d}}(N)$.

## Acknowledgements

The authors would like to thank Bela Bajnok and Noah Kravitz for pointing out
some missing references. They are also deeply indebted to the referee for
carefully reading the manuscript and pointing out several mistakes made in the
earlier versions.

## References

  * [1] Noga Alon and Gregory A. Freiman, _On sums of subsets of a set of integers_ , Combinatorica 8 (1988), no. 4, 297–306. MR 981887
  * [2] Noga Alon and Daniel Kleitman, _Sum-free subsets_ , A tribute to Paul Erdős, Cambridge Univ. Press, Cambridge, 1990, pp. 13–26. MR 1117002
  * [3] Béla Bajnok, _Additive combinatorics_ , Discrete Mathematics and its Applications (Boca Raton), CRC Press, Boca Raton, FL, 2018, A menu of research problems. MR 3887620
  * [4] Béla Bajnok and Ryan Matzke, _The maximum size of $(k,l)$-sum free sets in cyclic groups_, Bull. Aust. Math. Soc. 99 (2019), no. 2, 184–194. MR 3917232
  * [5] Vitaly Bergelson and Terence Tao, _Multiple recurrence in quasirandom groups_ , Geom. Funct. Anal. 24 (2014), no. 1, 1–48. MR 3177376
  * [6] Host Bernard, _A short proof of a conjecture of Erdős proved by Moreira, Richter and Robertson_ , Discrete Anal. (2019), Paper No. 19, 10\.
  * [7] Jean Bourgain, _Estimates related to sumfree subsets of sets of integers_ , Israel J. Math. 97 (1997), 71–92. MR 1441239
  * [8] Mauro Di Nasso, Isaac Goldbring, and Martino Lupini, _Nonstandard methods in ramsey theory and combinatorial number theory_ , Lecture Notes in Mathematics, vol. 2239, Springer, Cham, 2019.
  * [9] Sean Eberhard, _Følner sequences and sum-free sets_ , Bull. Lond. Math. Soc. 47 (2015), no. 1, 21–28. MR 3312960
  * [10] Sean Eberhard, Ben Green, and Freddie Manners, _Sets of integers with no large sum-free subset_ , Ann. of Math. (2) 180 (2014), no. 2, 621–652. MR 3224720
  * [11] Paul Erdős, _Extremal problems in number theory_ , Proc. Sympos. Pure Math., Vol. VIII, Amer. Math. Soc., Providence, R.I., 1965, pp. 181–189. MR 0174539
  * [12] Paul Erdős and Gregory Freiman, _On two additive problems_ , J. Number Theory 34 (1990), no. 1, 1–12. MR 1039762
  * [13] Ben Green and Sergei Konyagin, _On the Littlewood problem modulo a prime_ , Canad. J. Math. 61 (2009), no. 1, 141–164. MR 2488453
  * [14] David S. Gunderson and Vojtěch Rödl, _Extremal problems for affine cubes of integers_ , Combin. Probab. Comput. 7 (1998), no. 1, 65–79. MR 1611126
  * [15] Godfrey Harold Hardy and John Edensor Littlewood, _A new proof of a theorem on rearrangements_ , J. London Math. Soc. 23 (1948), 163–168. MR 28445
  * [16] Martin Kneser, _Summenmengen in lokalkompakten abelschen Gruppen_ , Math. Z. 66 (1956), 88–110. MR 81438
  * [17] Sergei Konyagin, _On the Littlewood problem_ , Izv. Akad. Nauk SSSR Ser. Mat. 45 (1981), no. 2, 243–265, 463. MR 616222
  * [18] Noah Kravitz, _The largest $(k,\ell)$-sum-free sets in compact abelian groups_, Integers, to appear, arXiv:1901.03233 (2019).
  * [19] Peter A. Loeb, _Conversion from nonstandard to standard measure spaces and applications in probability theory_ , Trans. Amer. Math. Soc. 211 (1975), 113–122. MR 390154
  * [20] Jason Long and Adam Zsolt Wagner, _The largest projective cube-free subsets of $\mathbb{Z}_{2^{n}}$_, European J. Combin. 81 (2019), 156–171. MR 3955104
  * [21] Tomasz Łuczak and Tomasz Schoen, _On infinite sum-free sets of natural numbers_ , J. Number Theory 66 (1997), no. 2, 211–224. MR 1473879
  * [22] O. Carruth McGehee, Louis Pigno, and Brent Smith, _Hardy’s inequality and the $L^{1}$-norm of exponential sums_, Ann. of Math. (2) 113 (1981), no. 3, 613–618. MR 621019
  * [23] Joel Moreira, Florian K. Richter, and Donald Robertson, _A proof of a sumset conjecture of Erdős_ , Ann. of Math. (2) 189 (2019), no. 2, 605–652. MR 3919363
  * [24] Tom Sanders, _The Littlewood-Gowers problem_ , J. Anal. Math. 101 (2007), 123–162. MR 2346542
  * [25] Tomasz Schoen, _On the Littlewood conjecture in $\mathbb{Z}/p\mathbb{Z}$_, Mosc. J. Comb. Number Theory 7 (2017), no. 3, 66–72. MR 3749577
  * [26] Endre Szemerédi, _On sets of integers containing no $k$ elements in arithmetic progression_, Acta Arith. 27 (1975), 199–245. MR 369312
  * [27] Terence Tao and Van Vu, _Additive combinatorics_ , Cambridge Studies in Advanced Mathematics, vol. 105, Cambridge University Press, Cambridge, 2010. MR 2573797
  * [28] by same author, _Sum-free sets in groups: a survey_ , J. Comb. 8 (2017), no. 3, 541–552. MR 3668880