Examples with the NumericalSgps GAP package

In this page we use Thebelab with a gap kernel to illustrate the examples. Kernel status:

Notable elements

We load NumericalSgps with LoadPackage("numericalsgps");. When pressing the "run" button, be patient, binder may take some time to start.

  gap>  LoadPackage("num");

We start by defining a numerical semigroup. There are many ways to do this depending on the information we have about it. If we know a system of generators, then we can do the following. We will store the semigroup in a variable called s.

    gap> s:=NumericalSemigroup(3,5,7); 

Indeed, \(\{3,5,7\}\) is a minimal generating set for s.

    gap> MinimalGenerators(s);

Membership can be detected with in:

        gap> 1 in s;

        gap> 100 in s;

The set of sporadic elements (elements up to the conductor, or small elements) of the semigroup are

    gap> SmallElements(s);

    gap> Conductor(s);

    gap> FrobeniusNumber(s);

This is also showing us the sets of gaps of s

        gap> Gaps(s);

        gap> Genus(s);

Recall that from the Apéry sets, one can retreive all this information.

        gap> AperyList(s);

If only the semigroup is given as argument, then the Apéry set is computed with respect to the multiplicity. Note that the output is a list, in the $i$th position we find the smallest element in s congruent with $i$ modulo the multiplicity (or the given element we specify as second argument).

        gap> AperyList(s,10);

It is well know that if the second argument is in the semigroup, then the output will have length precisely this argument. It not, the we get some extra elements.

    gap> AperyList(s,6);

The set of pseudo-Frobenius numbers can be computed as follows.

    gap> PseudoFrobeniusOfNumericalSemigroup(s);

    gap> Type(s);

Let us for instance check that Wilf's conjecture holds for all numerical semigroups with conductor equal to 20 (and thus Frobenius number 19).

    gap> ForAll(NumericalSemigroupsWithFrobeniusNumber(19), 
    > s->20<=EmbeddingDimension(s)*(Length(SmallElements(s))-1));
    true

We are substracting one to the number of small elements since we consider the conductor as small element.

The special gaps (those that can be use to extend the semigroup to another numerical semigroup) are

    gap> SpecialGaps(s);
    [ 4 ]
    gap> t:=AddSpecialGapOfNumericalSemigroup(4,s);
    
    gap> SmallElements(t);
    [ 0, 3 ]        
And the set of all oversemigroups:
    gap> OverSemigroupsNumericalSemigroup(s);

    gap> List(last,MinimalGenerators);

The set of fundamental gaps, is computed as follows. We can use fundamental gaps to define semigroups.

    gap> FundamentalGaps(s);

    gap> NumericalSemigroupByFundamentalGaps([4])=s;    

As we can do with small elements and gaps.

        gap> NumericalSemigroupByGaps(Gaps(s))=s;
        true
        gap> NumericalSemigroupBySmallElements(SmallElements(s))=s;
        true

Irreducible numerical semigroups

Our semigroup example `s` is not symmetric, but it is pseudo-symmetric.

    gap> IsIrreducible(s);
    true
    gap> IsSymmetric(s);
    false

Symmetric numerical semigroups have type one, whole pseudo-symmetric have type equal to two.

    gap> List(IrreducibleNumericalSemigroupsWithFrobeniusNumber(19),
    > MinimalGenerators);

Every numerical semigroup can be expressed (though not uniquely) as the intersection of irreducible numerical semigroups.

    gap> t:=NumericalSemigroup(10,11,12,13);

    gap> List(DecomposeIntoIrreducibles(t),MinimalGenerators);

We can actually find all oversemigroups of `t` that are irreducible.

    gap> o:=OverSemigroupsNumericalSemigroup(t);;
    gap> oi:=Filtered(o,IsIrreducible);;
    gap> Length(oi);
    35
    gap> t=Intersection(oi);
    true

There are some special families of symmetric numerical semigroups, as complete intersections, free, telescopic, ...

    gap> s:=NumericalSemigroup(4,6,9);
    gap> IsFree(s);
    true
    gap> lf:=FreeNumericalSemigroupsWithFrobeniusNumber(19);;
    gap> List(lf,MinimalGenerators);

Almost symmetric numerical semigroups

We can construct almost symmetric numerical semigruops from irreducible numerical semigroups by removing some of its elements.

    gap> AlmostSymmetricNumericalSemigroupsFromIrreducible(s);

    gap> List(last,MinimalGenerators);

Actually, one can compute with this idea the set of all almost symmetric numerical semigroups with given Frobenius number.

    gap> t:=First(AlmostSymmetricNumericalSemigroupsWithFrobeniusNumber(19),
    > s->not(IsIrreducible(s)));
    
    gap> MinimalGenerators(t);
    
    gap> Genus(t)=(FrobeniusNumber(t)+Type(t))/2;

Ideals

An ideal of a numerical semigroup can be defined by means of a generating system.

    gap> s:=NumericalSemigroup(6,9,20);

    gap> i:=[2,3]+s;

    gap> MinimalGenerators(i);

The above ideal is not included in its ambient semigroup, and so it is not integral.

    gap> IsIntegral(i);

    gap> AmbientNumericalSemigroupOfIdeal(i);

We can check membership with in.

    gap> 8 in s;
    false
    gap> 8 in i;
    true

Ideals also have conductors, since they are unions of translations of numerical semigroups.

    gap> Conductor(i);

    gap> SmallElements(i);

The basic operations include intersection, sum, addition, translations and difference.

    gap> j:=10+s;
    
    gap> i+j;

    gap> MinimalGenerators(i+j);

    gap> MinimalGenerators(10+i);

    gap> Difference(i,j);

    gap> MinimalGenerators(Intersection(i,j));

The colon operation of ideals of rings translates in ideals of numerical semigroups to \(I-J=\{z\in \mathbb{Z} \mid z+J\subseteq I\}\).

        gap> MinimalGenerators(i-j);

There are a couple of special ideals, one is the maximal ideal and the other the canonical (unique up to translations).

        gap> m:=MaximalIdealOfNumericalSemigroup(s);

        gap> c:=CanonicalIdealOfNumericalSemigroup(s);

        gap> c-(c-i)=i;

        gap> MinimalGenerators(m);

        gap> MinimalGenerators(c);

        gap> IsCanonicalIdeal(10+c);

The blow up of an ideal $I$ of a numerical semigroup \(S\) is defined as \(\bigcup_{n\in \mathbb{N}}(nI-nI)\).

    gap> MinimalGenerators(BlowUpIdealOfNumericalSemigroup(i));

    gap> List([1..10], n->HilbertFunctionOfIdealOfNumericalSemigroup(n,i));

If the ideal is the maximal ideal, then it coincides with the Lipman semigroup of \(S\).

    gap> MinimalGenerators(BlowUpOfNumericalSemigroup(s));

    gap> LipmanSemigroup(s);

    gap> MinimalGenerators(last);

One can keep computing Lipman semigroups until we reach \(\mathbb{N}\), and the multiplicities of these semigroups conform the multiplicity sequence of \(S\)

    gap> MultiplicitySequenceOfNumericalSemigroup(s);

Minimal presentations

The set of factorizations of an element in a numerical semigroup can be obtained as follows.
    gap> s:=NumericalSemigroup(6,9,20);

    gap> FactorizationsElementWRTNumericalSemigroup(36,s);

And the set of \(\mathcal{R}\)-classes as

    gap> RClassesOfSetOfFactorizations(last);

The set of Betti elements is

    gap> BettiElementsOfNumericalSemigroup(s);

And a minimal presentation is obtained with

    gap> MinimalPresentationOfNumericalSemigroup(s);
Recall that we can produce this also by using elimination.
    gap> x:=Indeterminate(Rationals,"x");;  
    gap> y:=Indeterminate(Rationals,"y");;
    gap> z:=Indeterminate(Rationals,"z");;
    gap> t:=Indeterminate(Rationals,"t");;
    gap> R:=PolynomialRing(Rationals,[x,y,z,t]);

    gap> i:=Ideal(R,[x-t^6,y-t^9,z-t^20]);

    gap> GroebnerBasis(i,EliminationOrdering([t]));
The graph $G_n$ can be calculated in the following way.
    gap> GraphAssociatedToElementInNumericalSemigroup(60,s);
In this example, it has three vertices and a single edge. We can also calculate the shaded set of an element.
    gap> ShadedSetOfElementInNumericalSemigroup(60,s);
The Hilbert series (or generating function of $S$) is computed via the polynomial associated to $S$.
    gap> HilbertSeriesOfNumericalSemigroup(s,x);

    gap> NumericalSemigroupPolynomial(s,x);
Actually, this polynomial has all its roots in the unit circle.
    gap> IsKroneckerPolynomial(last);

Nonunique factorization invariants

We already know how to compute the set of factorizations of an element in the semigroup. The set of lengths is calculated as follows.

Sets of lengths

    gap> LengthsOfFactorizationsElementWRTNumericalSemigroup(100,s);

 Elasticity

The elasticity of an element and of the whole numerical semigroup can be computed with the following functions.
    gap> ElasticityOfFactorizationsElementWRTNumericalSemigroup(100,s);

    gap> ElasticityOfNumericalSemigroup(s);

Delta sets

The set of distances or Delta set:
    gap> DeltaSetOfFactorizationsElementWRTNumericalSemigroup(100,s);
Or even of the whole semigroups
    gap> DeltaSetOfNumericalSemigroup(s);
Recall that the maximum is reached in the Betti elements of the semigroup.
    gap> List(B,b->DeltaSetOfFactorizationsElementWRTNumericalSemigroup(b,s));

Catenary degree

The catenary degree of a numerical semigroup is achieved in one of its Betti elements.
    gap> List(B, b->CatenaryDegreeOfElementInNumericalSemigroup(b,s));

    gap> CatenaryDegreeOfNumericalSemigroup(s);

Omega primality

The omega primality of an element or of the semigroup (maximum of its atoms) can be computed as follows.
    gap> OmegaPrimalityOfElementInNumericalSemigroup(100,s);

    gap> OmegaPrimalityOfNumericalSemigroup(s);
Because for the atoms we obtain
    gap> A:=MinimalGenerators(s);

    gap> List(A, a->OmegaPrimalityOfElementInNumericalSemigroup(a,s));

Tame degree

We have specific funtions to compute the tame degree of an element in a numerical semigroup and the tame degree of the whole semigroup.
    gap> TameDegreeOfElementInNumericalSemigroup(100,s);

    gap> TameDegreeOfNumericalSemigroup(s);

    gap> l:=Intersection(s,[1..100]);

    gap> List(l,x->TameDegreeOfElementInNumericalSemigroup(x,s));

Random

Looking for a four generated numerical semigroup with 7 relators.
    gap> l:=List([1..20], _->RandomNumericalSemigroup(5,500));;
    gap> ll:=Filtered(l, s->EmbeddingDimension(s)=4);;
    gap> Filtered(ll, s->Length(MinimalPresentationOfNumericalSemigroup(s))=7);
    gap> MinimalGenerators(last[1]);