1 Introduction

The additive energy is a central notion in additive combinatorics. This concept was introduced by Terence Tao and has been the subject of many works (See, e.g., [10, 11].) For a set \(A\subseteq {\mathbb {N}}\), the additive energy of A is defined as the number of quadruples \((a_1,a_2,a_3,a_4)\) for which \(a_1+a_2=a_3+a_4\), formally \(E(A):=|\{(a_1,a_2,a_3,a_4)\in A^4: \ a_1+a_2=a_3+a_4\}|\). The additive energy is similarly defined on an arbitrary structure X, where the addition is defined.

Let us remark that if A is a finite subset of the integers then for every \(x\in {\mathbb {Z}}\) \(d_A(x):=|\{(a_1,a_2)\in A^2: \ 0\ne x=a_2-a_1 \}|=2d^+_A(x):=|\{(a_1,a_2)\in A^2:\ a_1< a_2; \ x=a_2-a_1; \}|\) (indeed for every x, \(d_A(x)=d_A(-x)\)). If from the content is clear, we leave the subscript and we write simply d(x) or \(d^+(x)\). Furthermore (perhaps this is a folklore) \(\max _{A\in {\mathbb {N}}; \ |A|=n}E(A)=n^2+\frac{(n-1)n(2n-1)}{3}=(1+o(1))\frac{2}{3}n^3\). Indeed for every x where \(d(x)>0\) let i be the maximal index for which \(x=a_{i+1}-a_j; \ j\le i\). Then \(d(x)\le i\). The equality holds if A is an arithmetic progression with length n. A simply calculation shows the bound above.

Clearly \(|A|^2\ll E(A)\ll |A|^3\) holds, since the quadruple \((a_1,a_2,a_1,a_2)\) is always a solution and given \(a_1,a_2,a_3\) the term \(a_4\) is uniquely determined by them. (We will use the notation \(|X|\ll |Y|\) to denote the estimate \(|X|\le C|Y|\) for some absolute constant \(C>0\)). For every \(M\ge 2\) we write \([M]:=\{1,2,\ldots ,M\}\).

The aim of this note is twofold. In the first part of the paper we are going to investigate an inverse problem related to additive energy. In the second part, we consider how dense a subset of a finite structure can be for a given additive energy

2 An Inverse Problem

There are various type of inverse problems. Maybe the best known is the celebrated Freiman–Ruzsa result which describes the structure of sets with small doubling \(A+A; \ A\subseteq {\mathbb {N}}\) (see e.g. [11]).

An other problem which is due to S. Burr asked which property of an infinite sequence B ensures that \({\mathbb {N}}\setminus B\) can be written as a subset sum of an admissible sequence A, i.e. \({\mathbb {N}}{\setminus } B=P(A)=\{\sum _{a\in A'}a: A'\subseteq A; \ |A|<\infty \}\). This issue has a relatively large literature too (see. e.g. [2, 3]). We mention two other inverse problems which relate to the question of the present section. The first is originated from the folklore; it is known that for every finite set of integers A, \(2|A|-1\le |A+A|\le {|A|+1 \atopwithdelims ()2}\). Is it true that for every \(n,k\in {\mathbb {N}}\), \(k\in [2n-1, {n+1 \atopwithdelims ()2}]\) there is a set \(A\in {\mathbb {N}}\), \(|A|=n\) and \(|A+A|=k\)? For this (undergraduate) question the answer is yes.

The second question is due to Erdős and Szemerédi (see in [5]): It is easy to see that if \(A\subseteq {\mathbb {N}}\) then for the cardinality of the subset sums we have \({|A|+1\atopwithdelims ()2}\le |P(A)|\le 2^{|A|}\). They asked: is it true that for every t, \({n+1\atopwithdelims ()2}\le t\le 2^{n}\) there is a set of integers A with \(|A|=n\) and \(|P(A)|=t\)? In [H96] I gave an affirmative answer.

A similar question on additive energy would be the following. Write \(Set_G(n):=\{E(A): \ A\subseteq G; \ |A|=n \}\), where G is any additive structure.

While in the previous examples the possible values of \(A+A\) and P(A) were intervals one can guess that the set \(Set_G(n)\) is not one. For example let \(G=\{0,1\}^{n}\) and \(A=\{0,1\}^k\subseteq \{0,1\}^{n}\). Then it is easy to see, that the value of E(A) is \(6^k\).

Note that in [8] the authors have shown that if \(A\subseteq \{0,1\}^{n}\) then \(E(A)\le |A|^\varrho \), where \(\varrho =\log _26\), and the exponent cannot be replaced by any smaller quantity.

2.1 Integer Case

First we are going to investigate the case when \(G={\mathbb {Z}}\).

Theorem 2.1

Let \(\lfloor \frac{n}{3}\rfloor =k\), \(n\equiv r \pmod 4\). Let

$$\begin{aligned} {\mathcal {I}}:=\left[ 2n^2-n+66, k^2+\frac{(k-1)k(2k-1)}{3}-66\right] . \end{aligned}$$

Then \({\mathcal {I}}\cap Set_{\mathbb {Z}}(n)\) is an arithmetic progression in the form \(\{4k+r\}\). Moreover \({\mathcal {J}}:=Set_{\mathbb {Z}}(n)\cap (k^2+\frac{(k-1)k(2k-1)}{3}, \frac{n(n+1)2n+1)}{3}]\) contains \(\Omega (n^2)\) elements.

Proof

Let us start by some easy observations. Let us note that the additive energy is invariant to the affine transformation, i.e. for every finite set B and integers \(a\ne 0, b\) \(E(B)=E(aB+b)\).

It is not too hard to show that the parity of \(A\subseteq {\mathbb {N}}\) and E(A) is the same. In fact we prove that for any set \(A\subseteq {\mathbb {N}}\), \(|A|\ge 3\), \(|A|\equiv E(A)\pmod 4\). Indeed, \(E(A)=\sum _x d_A^2(x)=d^2_A(0)+2\sum _{x\ne 0} d_A^{+2}(x)=|A|^2+2\sum _{x\ne 0} d_A^{+2}(x)\). It is easy to check that for every \(|A|=3\), we have \(E(A)\equiv 3\pmod 4\). Now let \(n\ge 3\), and consider \(|A'|=n+1\) with biggest element \(a_{n+1}\). Denote by \(A=A'{\setminus } a_{n+1}=\{a_1<a_2<\cdots <a_n\}\) and write \(x_j=a_{n+1}-a_j; \ j=1,2,\ldots , n\). Write \(E(A')=\sum _xd_{A'}^2(x)=d_{A'}^2(0) +2\sum _xd_{A'}^{+2}(x)\). \(d_{A'}(0)=n+1\) so \(d^2_{A'}(0)-d^2_{A}(0)=2n+1\). Let \(d^+_A(x_j)=t_j\ge 0\). Then \(|d_{A'}^{+2}(x_j)- d_A^{+2}(x_j)|=2t_j+1\). So \(E(A')-E(A)=2n+1+2\sum _{j=1}^n(2t_j+1)=4n+4\sum _{j=1}^nt_j+1\). Hence if \(|A|\equiv E(A)\equiv r \pmod 4\), then \(|A'|\equiv E(A')\equiv r+1 \pmod 4\) as we wanted.

In the first stage, we move downwards from the maximum energy value. So let \(A_0=\{a_i=i; \ i=1,2,\ldots n\}\). As we mentioned \(E(A_0)=(1+o(1))\frac{2}{3}n^3\). The maximal difference is \(n-1\), the minimal is 0, hence we can write \(E(A_0)=|A_0|^2+2\sum _{x=1}^{n-1}d^{+2}_{A_0}(x)\).

For \(1\le k\le n-2\) we are going to define the set \(A_0^{(k)}\) as follows: for \(i=1,2,\ldots n-1\) let \(a_i=i\) and let \(a_n=n+k\). Write shortly \(d_k(x)=d^+_{A_{n,k}}(x)\) and \(d_0(x)=d^+_{A_0}(x)\). For \(1\le x\le k\), \(d_k(x)=d_0(x)-1\) since \(a_n-a_i\ge k+1\) for \(i=1,2,\ldots , n-1\). For \(k<x\le n-1\) \(d_k(x)=d_0(x)\) and when \(n\le x\le n+k-1\) then \(d_k(x)=1\) since difference bigger than \(n-1\) does not occur in \(A_0-A_0\).

So we have

$$\begin{aligned} E(A_0)-E(A_{n,k})= & {} 2\sum _{x=1}^{n-1}d_0^2(x) -2\sum _{x=1}^{n+k-1}d_k^2(x)\\= & {} 2\sum _{x=1}^{n-1}d_0^2(x)-2\left[ \sum _{x=1}^k(d_0(x)-1)^2 +\sum _{x=k+1}^{n-1}d_0^2(x)+\sum _{x=n}^{n+k-1} 1\right] \\= & {} 2\sum _{x=1}^k(2d_0(x)-1)-2k=4\sum _{x=1}^k(n-x)-4k\\= & {} 4nk-2k^2-6k. \end{aligned}$$

Finally let \(A_1:=\{1,2,\ldots , n-1, 10^n\}\). Since every i, \(1\le i\le n-1\), \(d(a_n-a_i)\) remains 1 we have that for every \(1\le k\le n-2\) the gap between two consecutive values of energies is

$$\begin{aligned} E(A_0^{(k+1)})-E(A_0^{(k)})= & {} (E(A_0)-E(A_0^{(k)}))-(E(A_0) -E(A_0^{(k+1)}))\\= & {} 4n-4k-8. \end{aligned}$$

Continue the previous process to obtain the strictly decreasing sequence of energy values \(\{E(A_1^{(k)}); \ k=1,2 \ldots , n-3\}\) and generally for \(j=1,2,\ldots , m\) the sequence \(\{E(A_j^{(k)}); k=1,2 \ldots , n-j-2\}\), where m will be determine later.

So the end of the mth step we have the set \(A_{m+1}=\{1,2,\ldots , n-m, 10^m,10^{m+1},\ldots , 10^n\}\) and similarly, as we have seen in the previous process for \(k=1,2,\ldots , n-m-2\) we obtain

$$\begin{aligned} E\left( A_{m-1}^{(k+1)}\right) -E\left( A_{m-1}^{(k)}\right) <4(n-m-k)-7. \end{aligned}$$

(note that the elements \(10^m,\ldots , 10^n\) do not play a role in the change of energy).

The argument of this stage shows that \({\mathcal {J}}\) contains \(\Omega (n^2)\) elements.

In the second stage, we move upwards from this given energy value from appropriate m.

Lemma 2.2

Let \(X_0=\{x_i\}^m_{i=1}\) be an m element 10 lacunary sequence of integers, i.e. for \(i=1,2,\ldots m-1\), \(\frac{x_{i+1}}{x_i}\ge 10\). For \(k=1,2, \ldots , \lfloor m/3 \rfloor \) let \(X_k=(X_0{\setminus } \{x_{3i}\}^{k}_{i=1})\cup \{x'_{3i}\}^{k}_{i=1}\), where \(x'_{3i}=2x_{3i-1}-x_{3i-2}\). We have \(E(X_k)-E(X_{k-1})=4\).

Proof

Write briefly \(d^+_{X_k}=d^+\). Since X is a 10 lacunary sequence thus \(d^+(x_{3k}-x_{3k-1})=1\). Let us replace \(x_k\) by \(x'_{3k}=2x_{3k-1}-x_{3k-2}\). Then the difference \(x_{3k-1}-x_{3k}\) occurs twice instead of one, the differences \(x_{3k}-x_{3k-1}\) and \(x_{3k}-x_{3k-2}\) do not occur. The new difference will be \(x'_{3k}-x_{3k-2}\) with \(d(x'_{3k}-x_{3k-2})=1\). (The values of the other representation functions do not change, just the length of the differences).

So we have \(E(X_k)-E(X_{k-1})=2(d(x'_{3k}-x_{3k-2})^2 +d^{+2}(x'_{3k}-x_{3k-1})-d^{+2}(x_{3k-1}-x_{3k-2}) -d^{+2}(x_{3k}-x_{3k-1}))=2(1^2+2^2-1^2-1^2-1^2)=4\). \(\square \)

Now if \(m>\frac{3n}{4}\) than we have \(4n-4m-7<\frac{4m}{3}-1<4\lfloor \frac{m}{3}\rfloor \). By Lemma 2.2 we can fill the gaps in \(E(A_{m-1}^{(k+1)})-E(A_{m-1}^{(k)})\) by sequences with difference 4 in the interval \([2n^2-n, \frac{k(k+1)2k+1)}{3}]\). \(\square \)

3 Case \( A_1\times A_2\times \cdots \times A_n\in G=[M]^n\)

In this section, we address a similar issue to the 2.1 theorem, as well as a density vs. energy result related to one of Kane and Tao’s results (see [KT]).

Before our results, we will formulate an argument that we will use in the rest of the paper.

3.1 On Density and Additive Energy of \(A_1\times A_2\times \cdots \times A_n\); \(A_i \subseteq G; \ i=1,2,\ldots , n\)

Let G be any finite semigroup with \([G|=M\). Throughout the rest of the paper we will use the following argument:

If \(a\in G^r\) and \(b\in G^t\) are two elements, then ab means that a and b are literally contiguous (i.e. the two strings are concatenated), and \(ab\in G^{r+t}\).

Now let us assume that the sets \(U\subseteq G^t:=G_1\) and \(V\subseteq G^r:=G_2\) have been defined with \(|U|=M^{c_1t}\) and \(|V|=M^{c_2r}\). Let \(W:=\{uv: u\in U, \ v\in V\}\subseteq G^{r+t}\). Clearly \(|W|=|U||V|=M^{c_1t+c_2r}\).

Now we are going to show that if \(E(U)=|U|^{td_1}\) and \(E(V)=|V|^{rd_2}\) then \(E(W)=M^{td_1+rd_2}\). Let us assume that \((a_n,b_n,c_n,d_n)\in U^4\) and \((a'_n,b'_n,c'_n,d'_n)\in V^4\) two four-tuples for which \(a_n+b_n=c_n+d_n\) and \(a'_n+b'_n=c'_n+d'_n\) hold. Then clearly \((a_na'_n)+(b_nb'_n)=(c_nc'_n)+(d_nd'_n)\) also holds. Conversely assume that \((a_na''_n)+(b_nb''_n)=(c_nc''_n)+(d_nd''_n)\) holds, for some four-tuple \((a_na''_n),(b_nb''_n),(c_nc''_n),(d_nd''_n)\in W^4\). By the definition it implies that \(a_n+b_n=c_n+d_n\) and \(a''_n+b''_n=c''_n+d''_n\). Hence \(E(W)=E(U)E(V)=M^{td_1+rd_2}\).

One can see by induction that for every z, if \(U_i\subseteq G^{r_i}\), \(i=1,2,\ldots z\) and \(W=\{u_1u_2\cdots u_z: \ u_i\in U_i \ i=1,2,\ldots , z\}\) then \(|W|=\prod ^z_{i=1}|U_i|\) and \(E(W)=\prod ^z_{i=1}E(U_i)\).

3.2 Inverse Question in \([M]^n\)

In this section we will investigate sets in the form \(X=A_1\times A_2\times \cdots , \times A_n\subseteq [M]^n\), \(|A_1|=|A_2|=\cdots =|A_n|=w\le M\), \(1\le |X|=w^n\). Throughout this section write \(Set_{[M]^n}(w)=\{E(X_j): |X_j|=w^n; X_j\subseteq [M]^n\}\), in increasing order. Write shortly \(E_j:=E(X_j)\). One can guess that the sequence \(\{E_{j+1}-E_j\}\) is not bounded. The following example supports this view: Let \(G:=\{0,1,2\}^n\) and let \(X\subseteq G\) with \(|X|=3^m\cdot 2^k\); \(2\le k+m\le n\). It implies that there are subscripts \(i_1,i_2,\ldots , i_k\) and \(j_1,j_2,\ldots , j_m\), for which \(|A_{j_1}|=\cdots =|A_{j_m}|=3; \ |A_{i_1}|=\cdots =|A_{i_k}|=2\) and the cardinality of the rest (if they exist) is 1. A simple calculation shows that if \(Y\subseteq {\mathbb {Z}}\), \(|Y|=3\) then \(E(Y)=15\) or \(E(Y)=19\). If \(|T|=2\) then \(E(T)=6\). So by the argument of the previous section we have that for every \(|X|=3^m\cdot 2^k\); \(2\le k+m\le n\), \(E(X)=15^r19^s6^k\); \(r+s=m\). Hence for every j \(E_{j+1}-E_j\) is at least \(6^k\).

So instead of \(E_{j+1}-E_j\) it is reasonable to investigate \(E_{j+1}/E_j\).

Theorem 3.1

There are \(N:=c_1M^3\) many \(X_i\) in the form \(X_i=A_{i,1}\times A_{i,2}\times \cdots , \times A_{i,n}\subseteq [M]^n\) for which every \(1\le i\le N; \ 1\le j\le n\) we have \(|A_{i,j}|=w\), \(|X_1|=|X_2|=\cdots =|X_N|<M^n\), and such that for every \(1\le i\le N\), we have

$$\begin{aligned} E(X_i)/E(X_{i+1})\le \Big (1+\frac{c_2}{w^3}\Big ). \end{aligned}$$

Roughly speaking there is a long sequence \(\{E_j\}\subseteq Set_{[M]^n}(w^n)\) for which the ratio of the consecutive elements is close to 1. The constants \(c_1=1/27\) and \(c_2=360\) are admissible.

On the other hand

Theorem 3.2

Let \(Set_{[M]^n}(w^n)=\{E_j:j=1,2,\ldots \}\) be the increasing sequence of energies. Then there is an effectively computable constant C depending only on M and n, such that

$$\begin{aligned} \min _j E_{j+1}/E_j\ge \left( 1+\frac{1}{(en)^C}\right) . \end{aligned}$$

Proof of Theorem 3.1

As we have seen at the proof of Theorem 2.1 for any \(w\in N\) \(Set_{\mathbb {Z}}(w)\) contains an arithmetic progression \({\mathcal {A}}{\mathcal {P}}\) with difference 4 containing in an interval \([\beta _1w^3,\beta _2w^3]\), where \(\beta _1=1/90, \beta _2=2/90\) and w is big enough. Let \(L=\lfloor w^3/30\rfloor \), and let \(A_1,A_2,\ldots ,A_L\) be the sets for which \(\{E(A_1),E(A_2),\ldots ,E(A_L)\}= {\mathcal {A}}{\mathcal {P}}\). Now we are in the position to define the sets \(X_1,X_2,\ldots ,X_L\). Let \(X_1=A_1\times A_1\times \cdots \times A_1; \ X_2=A_1\times A_1\times \cdots \times A_2; \ldots ; X_L=A_1\times A_1\times \cdots \times A_L\). By the argument discussed in Sect. 3.1 we get \(|X_1|=|X_2|=\cdots =|X_L|=w^n\); and \(E(X_i)=E(A_1)^{L-1}E(A_i)\). Hence \(E(X_i)/E(X_{i+1})=E(A_{i+1})/E(A_i)=(E(A_i)+4)/E(A_i)\le (1+360/w^3)\). \(\square \)

Proof of Theorem 3.2

The proof is a simple consequence of the following lemma:

Lemma 3.3

Let \(1<b_1<b_2<\cdots <b_t\) be a sequence of integers and let \(z_1,z_2,\ldots , z_t\in {\mathbb {Z}}\). We have \(|b_1^{z_1}b_2^{z_2}\cdots b_t^{z_t}-1|>\frac{1}{(eB)^C}\) where \(B=\max \{|z_1|,|z_2|,\ldots , |z_r|\}\) and where C is an effectively computable constant depending only on t and on \(b_1,b_2,\ldots ,b_t\).

This lemma is a very special case of a theorem of Baker (see [1, 6]).

All energies in \(Set_{[M]^n}(w^n)=\{E_j:j=1,2,\ldots \}\) can be written in the form \(E_j=\prod ^t_{i=1}E^{u_i}(A_i)\), for some \(|A_i|=w\), \(\sum _i u_i\le n\). So we have \(\min _j E_{j+1}/E_j=\prod ^n_{i=1}E^{z_i}(A_i)\) with \(|z_i|\le n\), for some \(|A_i|=w\), \(i=1,2,\ldots n\). Now the theorem follows from Lemma 3.3. \(\square \)

3.3 Density versus Additive Energy

In [8] (see also a generalization in [4]) the authors investigated the following interesting question. Let \(A\subseteq \{0,1\}^{n}\) be any set, then what can we say on the maximum of E(A) if the cardinality of A is given? They showed that \(E(A)\le |A|^\varrho \), where \(\varrho =\log _26\), and the exponent cannot be replaced by any smaller quantity.

In this section we ask an opposite direction: For a given finite additive structure G and a parameter \(0<\eta <1\) what is

$$\begin{aligned} R_G(\delta ):=\max _{A\subseteq G}\left\{ \alpha :|A|=|G|^\alpha ; \ E_G(A)= |A|^{2+\delta }\right\} ? \end{aligned}$$

In the next theorem we show that this maximum exists and give its asymptotic value.

Let G be a finite abelian group and ket \(S\subseteq G\). S is said to be Sidon set if for every \(s_1+s_2=s_3+s_4; \ s_i\in S\) \(\{s_1,s_2\}=\{s_3,s_4\}\) holds. We say that G is S-good, if there is a Sidon set with \(|S|=(1+o(1))\sqrt{|G|}\) (see e.g. [9]). Note that for \(x\in S+S\), \(r_{S+S}(x)=2\), and so \(E(S)=4|S|^2\).

Theorem 3.4

Let \(G_1,G_2,\ldots G_n\) be S-good finite abelian groups, \(|G_1|=|G_2|=\cdots =|G_n|:=M\) and let \({\mathcal {G}}=G_1\times G_2\times \cdots \times G_n\). Fore every \(0<\delta <1\) we have \(R_{\mathcal {G}}(\delta )=\frac{1}{2-\delta }(1+o(1))\).

Proof

We assume that n is an arbitrary but fixed number and M is large enough. First we prove that \(R_{\mathcal {G}}(\delta )\le \frac{1}{2-\delta }\). Let \(|A|=|{\mathcal {G}}|^\alpha \) and \(E(A)=|A|^{2+\delta }\). Let us denote the representation function of \(A+A\) by \(r(x):=|\{(a,a')\in A^2: x=a+a'\}|\). Clearly \(\sum _xr(x)=|A|^2\) since we count all pairs of elements of A. Furthermore recall that \(\sum _xr^2_{A+A}(x)=E(A)\) since the sum counts all quadruples.

Now by the Cauchy inequality

$$\begin{aligned} |{\mathcal {G}}|^{4\alpha }= & {} |A|^4=\left( \sum _xr_{A+A}(x)\right) ^2 \le |A+A|\sum _xr^2_{A+A}(x)\\= & {} |A+A|E(A)\le |{\mathcal {G}}||A|^{2+\delta } =|{\mathcal {G}}|^{1+\alpha (2+\delta )}. \end{aligned}$$

Hence \(4\alpha \le 1+\alpha (2+\delta )\) which gives \(\alpha \le \frac{1}{2-\delta }\). Now we will complete our theorem showing the bound \((1+o(1))/(2-\delta )\).

Let \(1\le k\le n\). We are going to define sets \(A_k\subseteq {\mathcal {G}}\) for which \(E(A_k)=|A_k|^{2+\delta }\) and \(|A_k|=|{\mathcal {G}}|^{(1+o(1))/(2-\delta )}\).

Let \(A_k:=\prod _{i=1}^kS_i\times \prod _{j=k+1}^nG_j\), where for every i and j, \(|S_i|=(1+o(1))\sqrt{M}\) and clearly \(E(G_j)=M^3\), since every \(a,b,c\in G_j\) \(a+b-c\in G_j\).

We have \(|A_k|=(1+o(1))M^{k/2}M^{n-k}=(1+o(1))M^{n-k/2}\) and \(E(A_k)=(1+o(1))(4M)^kM^{3(n-k)}=(1+o(1))M^{3n-2k+2k\log 4/\log M}\).

Thus \(E(A_k)=(1+o(1))|A_k|^{\frac{6n-4k}{2n-k}+2k\log 4/\log M}=|A_k|^{2+\frac{2n-2k}{2n-k}(1+o(1))}\). So we have \(\alpha =\frac{2n-k}{2n}\), and \(\delta =\frac{2n-2k}{2n-k}(1+o(1))\). Now

$$\begin{aligned} \frac{1}{2-\delta }=\frac{1}{2-\frac{2n-2k}{2n-k}(1+o(1))} =\frac{2n-k}{2n}(1+o(1))=\alpha (1+o(1)). \end{aligned}$$

\(\square \)