Large additive energy, and numbers having many representations as differences Let $A$ be a set of $N$ distinct positive integers. For every integer $n$, write $rep(n)$ for the number of representations of $n$ as a difference of two elements of $A$. Then the additive energy of $A$ is given by $\sum_n rep(n)^2$.
Assume that the additive energy is large (between $N^3/(\log N)$ and $N^3$, say). Examples for this would be the sets
$$
\{1, \dots, N\}
$$
or
$$
\{k, 2k, \dots, Nk\}
$$
or
$$
\{k+1, k+2, \dots, k+N\}
$$
for some positive integer $k$, or randomly (in a suitable way) constructed subsets of a segment of the positive integers. 
Now in all these examples, the set of those number $n$ for which $rep(n)$ is large (in other words, those numbers which make the essential contribution to the additive energy) has a very strong structure (it is an interval, or consists of a fixed integer multiple of all integers in an interval). This seems to be necessary - for example, it seems that for the sets $\{n: ~rep(n) \geq N/100\}$ or $\{n: ~rep(n) \geq N/\sqrt{\log N}\}$ one cannot get any arbitrary subset of $\mathbb{N}$, but only sets which have a very strong ("interval-like" or "self-similar") structure. 
Is there any theory for this? 
 A: Let $S_\delta$ be the set of $n$ such that $1_A\ast 1_A(n)\geq \delta N$. It is indeed true that $S_\delta$ is forced to be quite structured. There are a number of results in this direction, here's a sample. 
The dimension of a set $S$ is the smallest set $\Lambda$ such that every element of $S$ is a sum of the shape $\sum \epsilon_\lambda \lambda$ for some $\epsilon_\lambda\in\{-1,0,1\}$. This is quite a strong measure of additive structure -- for example, the interval $\{1,\ldots,N\}$ has dimension $O(\log N)$. 
Shrekdov and Yekhanin (https://arxiv.org/pdf/1004.2294.pdf, Theorem 3.1) showed that $S_\delta$ has dimension $O(\delta^{-1} \log N)$. So if $\delta$ is some constant, then $S_\delta$ has essentially minimal dimension.
If you want to extract something that actually looks like an interval, then this is what Freiman-type theorems can deliver. Balog-Szemeredi-Gowers will find some $S'\subset S_\delta$ which is reasonably large ($\lvert S'\rvert \gg \delta^{O(1)}\lvert S_\delta\rvert$) such that $\lvert S'+S'\rvert \ll \lvert S'\rvert'$, and then Freiman-Ruzsa theorems  (see this survey of Sanders https://arxiv.org/abs/1212.0458 for the latest bounds available) tell you that $S'$ can be efficiently covered by a generalised arithmetic progression. This is more structural information than the dimension bound above, but the quantitative bounds are worse.
Another way to say that $S_\delta$ is structured is to say that it contains a large difference set $A'-A'\subset S_\delta$. Almost-sharp bounds are known for this - see Sanders https://arxiv.org/abs/0807.5106 for the upper bound and Wolf http://juliawolf.org/research/preprints/popdiffweb.pdf for the lower boud.
