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:
Trueif the ambient group identity belongs to \(A\), andFalseotherwise.- 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:
Trueif \(A-A = G\), andFalseotherwise.- 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:
Trueif \(A+A = G\), andFalseotherwise.- 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:
Trueif \(|A+A| \le K|A|\), andFalseotherwise.- Return type:
bool
- Raises:
ValueError – If
Kis negative.
Notes
For the empty set, this predicate returns
Truefor every nonnegativeK, 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:
Trueif \(\operatorname{Stab}(A)\) is the trivial subgroup, andFalseotherwise.- 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:
Trueif \(A\) is a coset of some subgroup of the ambient group, andFalseotherwise.- 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:
Trueif \(|A-A| > |A+A|\), andFalseotherwise.- 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:
Trueif \(|A+A| \le 2|A|\), andFalseotherwise.- 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:
Trueif \(|A+A| \le \frac{3}{2}|A|\), andFalseotherwise.- 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:
Trueif \(A = \varnothing\), andFalseotherwise.- 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:
Trueif \(\operatorname{Stab}(A)\) has more than one element, andFalseotherwise.- 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:
Trueif \(A\) is a Sidon set, andFalseotherwise.- 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:
Trueif \(A\) is a subgroup of its ambient group, andFalseotherwise.- 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:
Trueif \((A+A)\cap A = \varnothing\), andFalseotherwise.- 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:
Trueif \(A = -A\), andFalseotherwise.- 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:
Trueif \(|A| \le 1\), andFalseotherwise.- 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:
Trueif \(A = G\), andFalseotherwise.- 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:
Trueif \(A+A\) is periodic, andFalseotherwise.- Return type:
bool