Add foundational additive-combinatorics operations over finite subsets of commutative semigroups.
Scope
Add support for:
$$S + S = \{a+b : a,b\in S\}.$$
- The restricted two-fold sumset
$$S \mathbin{\hat{+}} S
=
\{a+b : a,b\in S,\ a\ne b\}.$$
- Additive representations of an element $$s$$:
$$R_S(s)
=
\{(a,b)\in S^2 : a+b=s\}.$$
- The additive representation function:
$$r_S(s)=|R_S(s)|.$$
The fundamental definitions should require only a CommutativeSemigroup<A> and a finite unordered set.
For an AbelianGroup<A>, provide an optimized representation lookup using
$$b=s-a,$$
reducing exhaustive pair search from (O(|S|^2)) to expected (O(|S|)) when set membership is hash-backed.
Design notes
The representation function should be treated as the central abstraction. Its support is the two-fold sumset:
$$\textrm{supp}(r_S)=S+S.$$
Do not introduce a SidonSet<A> type in this issue.
Suggested package:
org.vorpal.kosmos.combinatorics.additive
Add foundational additive-combinatorics operations over finite subsets of commutative semigroups.
Scope
Add support for:
The fundamental definitions should require only a
CommutativeSemigroup<A>and a finite unordered set.For an
AbelianGroup<A>, provide an optimized representation lookup usingreducing exhaustive pair search from (O(|S|^2)) to expected (O(|S|)) when set membership is hash-backed.
Design notes
The representation function should be treated as the central abstraction. Its support is the two-fold sumset:
Do not introduce a
SidonSet<A>type in this issue.Suggested package:
org.vorpal.kosmos.combinatorics.additive