Sumset representation function (source code)

= Sumset representation function
{title2=$r_{A+B}(s)$}

= Sum representation function
{synonym}

For <finite sets> $A,B\subseteq G$ in an <abelian group> $G$, the <sumset representation function> is
$$
r_{A+B}(s)=\bigl|\{(a,b)\in A\times B:a+b=s\}\bigr|,\qquad s\in G.
$$
It counts <ordered pairs> in the <Cartesian product>, so $(a,b)$ and $(b,a)$ are different when $a\ne b$, even though <commutativity> makes their sums equal. It is zero outside the <sumset>, and
$$
\sum_{s\in G}r_{A+B}(s)=|A|\,|B|.
$$
For $A=\{0,1,2,3\}$, its values at $s=0,1,\ldots,6$ are $1,2,3,4,3,2,1$. For $B=\{0,1,4,10\}$, its values at the increasing elements of $B+B$ are $1,2,1,2,2,1,2,2,2,1$. Both lists total sixteen, but the first concentrates more <ordered pairs> on fewer sums. This distinction is what <additive energy> quantifies.

\Image[/sumset-pair-sums.png]
{title=Ordered-pair sums and representation counts for an arithmetic progression and a spread-out integer set}