Some basic tests This section describes some basic tests on numerical semigroups. The first described tests refer to what the semigroup is currently known to be (not necessarily the way it was created). Then are presented functions to test if a given list represents the small elements, gaps or the Apéry set (see ) of a numerical semigroup; to test if an integer belongs to a numerical semigroup and if a numerical semigroup is a subsemigroup of another one. NS is a numerical semigroup and these attributes are available (their names should be self explanatory).
gap> s:=NumericalSemigroup(3,7); <Numerical semigroup with 2 generators> gap> AperyListOfNumericalSemigroupWRTElement(s,30);; gap> t:=NumericalSemigroupByAperyList(last); <Numerical semigroup> gap> IsNumericalSemigroupByGenerators(s); true gap> IsNumericalSemigroupByGenerators(t); false gap> IsNumericalSemigroupByAperyList(s); false gap> IsNumericalSemigroupByAperyList(t); true
Tests if the list L (which has to be a set) may represent the ``small" elements of a numerical semigroup.
gap> L:=[ 0, 3, 6, 9, 11, 12, 14, 15, 17, 18, 20 ]; [ 0, 3, 6, 9, 11, 12, 14, 15, 17, 18, 20 ] gap> RepresentsSmallElementsOfNumericalSemigroup(L); true gap> L:=[ 6, 9, 11, 12, 14, 15, 17, 18, 20 ]; [ 6, 9, 11, 12, 14, 15, 17, 18, 20 ] gap> RepresentsSmallElementsOfNumericalSemigroup(L); false
Tests if the list L may represent the gaps (see ) of a numerical semigroup.
gap> s:=NumericalSemigroup(3,7); <Numerical semigroup with 2 generators> gap> L:=GapsOfNumericalSemigroup(s); [ 1, 2, 4, 5, 8, 11 ] gap> RepresentsGapsOfNumericalSemigroup(L); true gap> L:=Set(List([1..21],i->RandomList([1..50]))); [ 2, 6, 7, 8, 10, 12, 14, 19, 24, 28, 31, 35, 42, 50 ] gap> RepresentsGapsOfNumericalSemigroup(L); false
Tests whether a list L of integers may represent the Apéry list of a numerical semigroup. It returns true when the periodic function represented by L is subadditive (see ) and the remainder of the division of L[i] by the length of L is i and returns false otherwise (the criterium used is the one explained in ).
gap> IsAperyListOfNumericalSemigroup([0,21,7,28,14]); true
S and T are numerical semigroups. Tests whether T is contained in S.
gap> S := NumericalSemigroup("modular", 5,53); <Modular numerical semigroup satisfying 5x mod 53 <= x > gap> T:=NumericalSemigroup(2,3); <Numerical semigroup with 2 generators> gap> IsSubsemigroupOfNumericalSemigroup(T,S); true gap> IsSubsemigroupOfNumericalSemigroup(S,T); false
S is a numerical semigroup. T can be a numerical semigroup, in which case the function is just a synonym of , or a list of integers, in which case tests whether all elements of the list belong to S.
gap> ns1 := NumericalSemigroup(5,7);; gap> ns2 := NumericalSemigroup(5,7,11);; gap> IsSubset(ns1,ns2); false gap> IsSubset(ns2,[5,15]); true gap> IsSubset(ns1,[5,11]); false gap> IsSubset(ns2,ns1); true
n is an integer and S is a numerical semigroup. Tests whether n belongs to S. \in(n,S) calls the infix variant n in S, and both can be seen as a short for BelongsToNumericalSemigroup(n,S). Several methods are implemented for membership, depending on the properties of S known. For instance, there are methods if any of the following information is known: Apéry set, small elements, defining (proportionally) modular Diophantine equation, fundamental gaps, gaps, generators.
gap> S := NumericalSemigroup("modular", 5,53); <Modular numerical semigroup satisfying 5x mod 53 <= x > gap> BelongsToNumericalSemigroup(15,S); false gap> 15 in S; false gap> SmallElementsOfNumericalSemigroup(S); [ 0, 11, 12, 13, 22, 23, 24, 25, 26, 32, 33, 34, 35, 36, 37, 38, 39, 43 ] gap> BelongsToNumericalSemigroup(13,S); true gap> 13 in S; true