Generating Numerical Semigroups Recalling some definitions from Chapter .

A numerical semigroup is a subset of the set {\mathbb N} of nonnegative integers that is closed under addition, contains 0 and whose complement in {\mathbb N} is finite.

We refer to the elements in a numerical semigroup that are less than or equal to the conductor as small elements of the semigroup.

A gap of a numerical semigroup S is a nonnegative integer not belonging to S. The fundamental gaps of S are those gaps that are maximal with respect to the partial order induced by division in {\mathbb N}.

Given a numerical semigroup S and a nonzero element s in it, one can consider for every integer i ranging from 0 to s-1, the smallest element in S congruent with i modulo s, say w(i) (this element exists since the complement of S in {\mathbb N} is finite). Clearly w(0)=0. The set {\rm Ap}(S,s)=\{ w(0),w(1),\ldots, w(s-1)\} is called the Apéry set of S with respect to s.

Let a,b,c,d be positive integers such that a/b < c/d, and let I=[a/b,c/d]. Then the set {\rm S}(I)={\mathbb N}\cap \bigcup_{n\geq 0} n I is a numerical semigroup. This class of numerical semigroups coincides with that of sets of solutions to equations of the form A x \bmod\ B \leq C x with A,B,C positive integers. A numerical semigroup in this class is said to be proportionally modular. If C = 1, then it is said to be modular.

There are different ways to specify a numerical semigroup S, namely, by its generators; by its gaps, its fundamental or special gaps by its Apéry set, just to name some. In this section we describe functions that may be used to specify, in one of these ways, a numerical semigroup in &GAP;.

To create a numerical semigroup in &GAP; the function NumericalSemigroup is used. Representation

May be "generators", "minimalgenerators", "modular", "propmodular", "elements", "gaps", "fundamentalgaps", "subadditive" or "apery" according to whether the semigroup is to be given by means of a system of generators, a minimal system of generators, a condition of the form ax \bmod\ m \le x, a condition of the form ax \bmod\ m\le cx, a set of all elements up to the conductor, the set of gaps, the set of fundamental gaps, a periodic subaditive function, or the Apéry set.

When no string is given as first argument it is assumed that the numerical semigroup will be given by means of a set of generators.

List

When the semigroup is given through a set of generators, this set may be given as a list or through its individual elements.

The set of all elements up to the conductor, the set of gaps, the set of fundamental gaps or the Apéry set are given through lists.

A periodic subadditive function with period m is given through the list of images of the elements, from 1 to m. The image of m has to be 0.

Numerical semigroups generated by an interval of positive integers and embedding dimension two numerical semigroups are known to be proportionally modular, and thus they are treated as such (unles the representation "minimalgenerators" is specified), since membership and other problems are solved faster for these semigroups.

gap> s1 := NumericalSemigroup("generators",3,5,7); <Numerical semigroup with 3 generators> gap> s2 := NumericalSemigroup("generators",[3,5,7]); <Numerical semigroup with 3 generators> gap> s1=s2; true gap> s := NumericalSemigroup("minimalgenerators",3,7); <Numerical semigroup with 2 generators> gap> s := NumericalSemigroup("modular",3,5); <Modular numerical semigroup satisfying 3x mod 5 <= x > gap> s1:=NumericalSemigroup("generators",2,5); <Modular numerical semigroup satisfying 5x mod 10 <= x > gap> s = s1; true gap> s:=NumericalSemigroup(4,5,6); <Proportionally modular numerical semigroup satisfying 6x mod 24 <= 2x >

Once it is known that a numerical semigroup contains the element 1, i.e. the semigroup is \mathbb N, the semigroup is treated as such.
gap> NumericalSemigroup(1); <The numerical semigroup N> gap> NumericalSemigroupByInterval(1/3,1/2); <The numerical semigroup N>
Given two positive integers a and b, this function returns a modular numerical semigroup satisfying ax \bmod\ b \le x.
gap> ModularNumericalSemigroup(3,7); <Modular numerical semigroup satisfying 3x mod 7 <= x >
Given three positive integers a, b and c, this function returns a proportionally modular numerical semigroup satisfying ax\bmod\ b \le cx.
gap> ProportionallyModularNumericalSemigroup(3,7,12); <Proportionally modular numerical semigroup satisfying 3x mod 7 <= 12x >
When c=1, the semigroup is seen as a modular numerical semigroup.
gap> NumericalSemigroup("propmodular",67,98,1); <Modular numerical semigroup satisfying 67x mod 98 <= x >
The function is a front-end for these functions. The argument of each of these functions is a list representing an entity of the type to which the function's name refers.
gap> s:=NumericalSemigroup(3,11); <Modular numerical semigroup satisfying 22x mod 33 <= x > gap> GapsOfNumericalSemigroup(s); [ 1, 2, 4, 5, 7, 8, 10, 13, 16, 19 ] gap> t:=NumericalSemigroupByGaps(last); <Numerical semigroup> gap> s=t; true gap> AperyListOfNumericalSemigroupWRTElement(s,20);; gap> t:=NumericalSemigroupByAperyList(last); <Numerical semigroup> gap> s=t; true