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 Frobenius number plus 1 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 \ mod\ 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 several 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. Type

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 condition of the form ax \ mod\ m &tlt;= x, a system of generators, a condition of the form ax \ mod\ m &tlt;= cx, a set of all elements up to the Frobenius number +1, 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 Frobenius number +1, 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. 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); <Numerical semigroup with 2 generators> gap> s = s1; true ....................................

Given two positive integers a and b, this function returns a modular numerical semigroup satisfying ax \ mod\ b <= 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\ mod\ b <= cx. gap> ProportionallyModularNumericalSemigroup(3,7,12); <Proportionally modular numerical semigroup satisfying 3x mod 7 <= 12x >
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); <Numerical semigroup with 2 generators> 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 ...