properties

graphcalc.additive_combinatorics.properties.contains_zero(A: AdditiveSet) bool[source]

Return whether the additive identity belongs to the set.

Parameters:

A (AdditiveSet) – Input additive set.

Returns:

True if the ambient group identity belongs to \(A\), and False otherwise.

Return type:

bool

graphcalc.additive_combinatorics.properties.has_full_diffset(A: AdditiveSet) bool[source]

Return whether the self-difference set fills the ambient group.

Parameters:

A (AdditiveSet) – Input additive set.

Returns:

True if \(A-A = G\), and False otherwise.

Return type:

bool

graphcalc.additive_combinatorics.properties.has_full_sumset(A: AdditiveSet) bool[source]

Return whether the self-sumset fills the ambient group.

Parameters:

A (AdditiveSet) – Input additive set.

Returns:

True if \(A+A = G\), and False otherwise.

Return type:

bool

graphcalc.additive_combinatorics.properties.has_small_doubling(A: AdditiveSet, K: float) bool[source]

Return whether the set has doubling at most K.

Parameters:
  • A (AdditiveSet) – Input additive set.

  • K (float) – Doubling threshold.

Returns:

True if \(|A+A| \le K|A|\), and False otherwise.

Return type:

bool

Raises:

ValueError – If K is negative.

Notes

For the empty set, this predicate returns True for every nonnegative K, since both sides of the inequality are zero.

graphcalc.additive_combinatorics.properties.is_aperiodic(A: AdditiveSet) bool[source]

Return whether the set has trivial additive stabilizer.

Parameters:

A (AdditiveSet) – Input additive set.

Returns:

True if \(\operatorname{Stab}(A)\) is the trivial subgroup, and False otherwise.

Return type:

bool

graphcalc.additive_combinatorics.properties.is_coset(A: AdditiveSet) bool[source]

Return whether the set is a coset of a subgroup.

Parameters:

A (AdditiveSet) – Input additive set.

Returns:

True if \(A\) is a coset of some subgroup of the ambient group, and False otherwise.

Return type:

bool

Notes

The empty set is not considered a coset here.

graphcalc.additive_combinatorics.properties.is_difference_larger_than_sumset(A: AdditiveSet) bool[source]

Return whether the self-difference set is larger than the self-sumset.

Parameters:

A (AdditiveSet) – Input additive set.

Returns:

True if \(|A-A| > |A+A|\), and False otherwise.

Return type:

bool

graphcalc.additive_combinatorics.properties.is_doubling_at_most_2(A: AdditiveSet) bool[source]

Return whether the set has doubling at most 2.

Parameters:

A (AdditiveSet) – Input additive set.

Returns:

True if \(|A+A| \le 2|A|\), and False otherwise.

Return type:

bool

graphcalc.additive_combinatorics.properties.is_doubling_at_most_3_over_2(A: AdditiveSet) bool[source]

Return whether the set has doubling at most \(3/2\).

Parameters:

A (AdditiveSet) – Input additive set.

Returns:

True if \(|A+A| \le \frac{3}{2}|A|\), and False otherwise.

Return type:

bool

graphcalc.additive_combinatorics.properties.is_empty_set(A: AdditiveSet) bool[source]

Return whether the additive set is empty.

Parameters:

A (AdditiveSet) – Input additive set.

Returns:

True if \(A = \varnothing\), and False otherwise.

Return type:

bool

graphcalc.additive_combinatorics.properties.is_periodic(A: AdditiveSet) bool[source]

Return whether the set has nontrivial additive stabilizer.

Parameters:

A (AdditiveSet) – Input additive set.

Returns:

True if \(\operatorname{Stab}(A)\) has more than one element, and False otherwise.

Return type:

bool

graphcalc.additive_combinatorics.properties.is_sidon(A: AdditiveSet) bool[source]

Return whether the set is a Sidon set.

Parameters:

A (AdditiveSet) – Input additive set.

Returns:

True if \(A\) is a Sidon set, and False otherwise.

Return type:

bool

Notes

This implementation checks uniqueness of unordered pair sums.

graphcalc.additive_combinatorics.properties.is_subgroup(A: AdditiveSet) bool[source]

Return whether the set is an additive subgroup of its ambient group.

Parameters:

A (AdditiveSet) – Input additive set.

Returns:

True if \(A\) is a subgroup of its ambient group, and False otherwise.

Return type:

bool

Notes

In an abelian group, closure under subtraction and containment of the identity are equivalent to being a subgroup.

graphcalc.additive_combinatorics.properties.is_sum_free(A: AdditiveSet) bool[source]

Return whether the set is sum-free.

Parameters:

A (AdditiveSet) – Input additive set.

Returns:

True if \((A+A)\cap A = \varnothing\), and False otherwise.

Return type:

bool

graphcalc.additive_combinatorics.properties.is_symmetric(A: AdditiveSet) bool[source]

Return whether the set is symmetric under additive inversion.

Parameters:

A (AdditiveSet) – Input additive set.

Returns:

True if \(A = -A\), and False otherwise.

Return type:

bool

graphcalc.additive_combinatorics.properties.is_trivial_set(A: AdditiveSet) bool[source]

Return whether the additive set has cardinality at most one.

Parameters:

A (AdditiveSet) – Input additive set.

Returns:

True if \(|A| \le 1\), and False otherwise.

Return type:

bool

graphcalc.additive_combinatorics.properties.is_whole_group(A: AdditiveSet) bool[source]

Return whether the additive set equals its ambient group.

Parameters:

A (AdditiveSet) – Input additive set.

Returns:

True if \(A = G\), and False otherwise.

Return type:

bool

graphcalc.additive_combinatorics.properties.sumset_is_periodic(A: AdditiveSet) bool[source]

Return whether the self-sumset has nontrivial stabilizer.

Parameters:

A (AdditiveSet) – Input additive set.

Returns:

True if \(A+A\) is periodic, and False otherwise.

Return type:

bool