  
  [1m[4m[31m7. Ideals of numerical semigroups[0m
  
  
  [1m[4m[31m7.1 Ideals of numerical semigroups[0m
  
  Let  S be a numerical semigroup. A set I of integers is an [22m[36mideal relative[0m to
  a  numerical  semigroup  S provided that I+Ssubseteq I and that there exists
  din S such that d+Isubseteq S.
  
  If  i_1,...,i_k  is a subset of Z, then the set I=i_1,...,i_k+S=bigcup_n=1^k
  i_n+S  is an ideal relative to S, and i_1,..., i_k is a system of generators
  of I. A system of generators M is minimal if no proper subset of M generates
  the same ideal. Usually, ideals are specified by means of its generators and
  the  ambient  numerical  semigroup  to  which  they  are  ideals  (for  more
  information see for instance [VF97]).
  
  [1m[4m[31m7.1-1 IdealOfNumericalSemigroup[0m
  
  [1m[34m> IdealOfNumericalSemigroup( [0m[22m[34ml, S[0m[1m[34m ) ________________________________[0mfunction
  
  [22m[34mS[0m is a numerical semigroup and [22m[34ml[0m a list of integers.
  
  The output is the ideal of [22m[34mS[0m generated by [22m[34ml[0m
  
  There are several shortcuts for this function, as shown in the example.
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35mgap> IdealOfNumericalSemigroup([3,5],NumericalSemigroup(9,11));[0m
    [22m[35m<Ideal of numerical semigroup>[0m
    [22m[35mgap> [3,5]+NumericalSemigroup(9,11);[0m
    [22m[35m<Ideal of numerical semigroup>[0m
    [22m[35mgap> last=last2;[0m
    [22m[35mtrue[0m
    [22m[35mgap> 3+NumericalSemigroup(5,9);[0m
    [22m[35m<Ideal of numerical semigroup>[0m
    [22m[35m[0m
    [22m[35m                        [0m
  [22m[35m------------------------------------------------------------------[0m
  
  [1m[4m[31m7.1-2 IsIdealOfNumericalSemigroup[0m
  
  [1m[34m> IsIdealOfNumericalSemigroup( [0m[22m[34mObj[0m[1m[34m ) _______________________________[0mfunction
  
  Tests if the object [22m[34mObj[0m is an ideal of a numerical semigroup.
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35mgap> I:=[1..7]+NumericalSemigroup(7,19);[0m
    [22m[35m<Ideal of numerical semigroup>[0m
    [22m[35mgap> IsIdealOfNumericalSemigroup(I);[0m
    [22m[35mtrue[0m
    [22m[35mgap> IsIdealOfNumericalSemigroup(2);[0m
    [22m[35mfalse[0m
    [22m[35m[0m
    [22m[35m                        [0m
  [22m[35m------------------------------------------------------------------[0m
  
  [1m[4m[31m7.1-3 MinimalGeneratingSystemOfIdealOfNumericalSemigroup[0m
  
  [1m[34m> MinimalGeneratingSystemOfIdealOfNumericalSemigroup( [0m[22m[34mI[0m[1m[34m ) __________[0mfunction
  
  [22m[34mI[0m is an ideal of a numerical semigroup.
  
  The output is the minimal system of generators of [22m[34mI[0m.
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35mgap> I:=[3,5,9]+NumericalSemigroup(2,11);[0m
    [22m[35m<Ideal of numerical semigroup>[0m
    [22m[35mgap> MinimalGeneratingSystemOfIdealOfNumericalSemigroup(I);[0m
    [22m[35m[ 3 ][0m
    [22m[35m[0m
    [22m[35m                        [0m
  [22m[35m------------------------------------------------------------------[0m
  
  [1m[4m[31m7.1-4 GeneratorsOfIdealOfNumericalSemigroup[0m
  
  [1m[34m> GeneratorsOfIdealOfNumericalSemigroup( [0m[22m[34mI[0m[1m[34m ) _______________________[0mfunction
  [1m[34m> GeneratorsOfIdealOfNumericalSemigroupNC( [0m[22m[34mI[0m[1m[34m ) _____________________[0mfunction
  
  [22m[34mI[0m is an ideal of a numerical semigroup.
  
  The   output   of   [22m[32mGeneratorsOfIdealOfNumericalSemigroup[0m  is  a  system  of
  generators  of the ideal. If the minimal system of generators is known, then
  it is used as output. [22m[32mGeneratorsOfIdealOfNumericalSemigroupNC[0m always returns
  the set of generators stored in [22m[34mI!.generators[0m.
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35mgap> I:=[3,5,9]+NumericalSemigroup(2,11);[0m
    [22m[35m<Ideal of numerical semigroup>[0m
    [22m[35mgap> GeneratorsOfIdealOfNumericalSemigroup(I);[0m
    [22m[35m[ 3, 5, 9 ][0m
    [22m[35mgap> MinimalGeneratingSystemOfIdealOfNumericalSemigroup(I);[0m
    [22m[35m[ 3 ][0m
    [22m[35mgap> GeneratorsOfIdealOfNumericalSemigroup(I);[0m
    [22m[35m[ 3 ][0m
    [22m[35mgap> GeneratorsOfIdealOfNumericalSemigroupNC(I);[0m
    [22m[35m[ 3, 5, 9 ][0m
    [22m[35m[0m
    [22m[35m                        [0m
  [22m[35m------------------------------------------------------------------[0m
  
  [1m[4m[31m7.1-5 AmbientNumericalSemigroupOfIdeal[0m
  
  [1m[34m> AmbientNumericalSemigroupOfIdeal( [0m[22m[34mI[0m[1m[34m ) ____________________________[0mfunction
  
  [22m[34mI[0m is an ideal of a numerical semigroup, say S.
  
  The output is S.
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35mgap> I:=[3,5,9]+NumericalSemigroup(2,11);[0m
    [22m[35m<Ideal of numerical semigroup>[0m
    [22m[35mgap> AmbientNumericalSemigroupOfIdeal(I);[0m
    [22m[35m<Numerical semigroup with 2 generators>[0m
    [22m[35m[0m
    [22m[35m                        [0m
  [22m[35m------------------------------------------------------------------[0m
  
  [1m[4m[31m7.1-6 SmallElementsOfIdealOfNumericalSemigroup[0m
  
  [1m[34m> SmallElementsOfIdealOfNumericalSemigroup( [0m[22m[34mI[0m[1m[34m ) ____________________[0mfunction
  
  [22m[34mI[0m is an ideal of a numerical semigroup.
  
  The  output  is a list with the elements in [22m[34mI[0m that are less than or equal to
  the greatest integer not belonging to the ideal plus one.
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35mgap> I:=[3,5,9]+NumericalSemigroup(2,11);[0m
    [22m[35m<Ideal of numerical semigroup>[0m
    [22m[35mgap> SmallElementsOfIdealOfNumericalSemigroup(I);[0m
    [22m[35m[ 3, 5, 7, 9, 11, 13 ][0m
    [22m[35mgap> J:=[2,11]+NumericalSemigroup(2,11);[0m
    [22m[35m<Ideal of numerical semigroup>[0m
    [22m[35mgap> SmallElementsOfIdealOfNumericalSemigroup(J);[0m
    [22m[35m[ 2, 4, 6, 8, 10 ][0m
    [22m[35m[0m
    [22m[35m                        [0m
  [22m[35m------------------------------------------------------------------[0m
  
  [1m[4m[31m7.1-7 BelongsToIdealOfNumericalSemigroup[0m
  
  [1m[34m> BelongsToIdealOfNumericalSemigroup( [0m[22m[34mn, I[0m[1m[34m ) _______________________[0mfunction
  
  [22m[34mI[0m is an ideal of a numerical semigroup, [22m[34mn[0m is an integer.
  
  The output is true if [22m[34mn[0m belongs to [22m[34mI[0m.
  
  [22m[34m n in I[0m can be used for short.
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35mgap> J:=[2,11]+NumericalSemigroup(2,11);[0m
    [22m[35m<Ideal of numerical semigroup>[0m
    [22m[35mgap> BelongsToIdealOfNumericalSemigroup(9,J);[0m
    [22m[35mfalse[0m
    [22m[35mgap> 9 in J;[0m
    [22m[35mfalse[0m
    [22m[35mgap> BelongsToIdealOfNumericalSemigroup(10,J);[0m
    [22m[35mtrue[0m
    [22m[35mgap> 10 in J;[0m
    [22m[35mtrue[0m
    [22m[35m[0m
    [22m[35m                        [0m
  [22m[35m------------------------------------------------------------------[0m
  
  [1m[4m[31m7.1-8 SumIdealsOfNumericalSemigroup[0m
  
  [1m[34m> SumIdealsOfNumericalSemigroup( [0m[22m[34mI, J[0m[1m[34m ) ____________________________[0mfunction
  
  [22m[34mI, J[0m are ideals of a numerical semigroup.
  
  The output is the sum of both ideals i+j | iin [22m[34mI[0m, jin [22m[34mJ[0m.
  
  [22m[34mI + J[0m is a synonym of this function.
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35mgap> I:=[3,5,9]+NumericalSemigroup(2,11);[0m
    [22m[35m<Ideal of numerical semigroup>[0m
    [22m[35mgap> J:=[2,11]+NumericalSemigroup(2,11);[0m
    [22m[35m<Ideal of numerical semigroup>[0m
    [22m[35mgap> I+J;[0m
    [22m[35m<Ideal of numerical semigroup>[0m
    [22m[35mgap> MinimalGeneratingSystemOfIdealOfNumericalSemigroup(last);[0m
    [22m[35m[ 5, 14 ][0m
    [22m[35mgap> SumIdealsOfNumericalSemigroup(I,J);[0m
    [22m[35m<Ideal of numerical semigroup>[0m
    [22m[35mgap> MinimalGeneratingSystemOfIdealOfNumericalSemigroup(last);[0m
    [22m[35m[ 5, 14 ][0m
    [22m[35m[0m
    [22m[35m                        [0m
  [22m[35m------------------------------------------------------------------[0m
  
  [1m[4m[31m7.1-9 MultipleOfIdealOfNumericalSemigroup[0m
  
  [1m[34m> MultipleOfIdealOfNumericalSemigroup( [0m[22m[34mn, I[0m[1m[34m ) ______________________[0mfunction
  
  [22m[34mI[0m is an ideal of a numerical semigroup, [22m[34mn[0m is a non negative integer.
  
  The output is the ideal [22m[34mI[0m+cdots+[22m[34mI[0m ([22m[34mn[0m times).
  
  [22m[34m n * I[0m can be used for short.
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35mgap> I:=[0,1]+NumericalSemigroup(3,5,7);[0m
    [22m[35m<Ideal of numerical semigroup>[0m
    [22m[35mgap> MinimalGeneratingSystemOfIdealOfNumericalSemigroup(2*I);[0m
    [22m[35m[ 0, 1, 2 ][0m
    [22m[35m[0m
    [22m[35m                        [0m
  [22m[35m------------------------------------------------------------------[0m
  
  [1m[4m[31m7.1-10 SubtractIdealsOfNumericalSemigroup[0m
  
  [1m[34m> SubtractIdealsOfNumericalSemigroup( [0m[22m[34mI, J[0m[1m[34m ) _______________________[0mfunction
  
  [22m[34mI, J[0m are ideals of a numerical semigroup.
  
  The output is the ideal zin Z | z+[22m[34mJ[0msubseteq [22m[34mI[0m.
  
  [22m[34mI  -  J[0m  is  a  synonym  of  this function. The following example appears in
  [HS04].
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35mgap> S:=NumericalSemigroup(14, 15, 20, 21, 25);[0m
    [22m[35m<Numerical semigroup with 5 generators>[0m
    [22m[35mgap> I:=[0,1]+S;[0m
    [22m[35m<Ideal of numerical semigroup>[0m
    [22m[35mgap> II:=(0+S)-I;[0m
    [22m[35m<Ideal of numerical semigroup>[0m
    [22m[35mgap> MinimalGeneratingSystemOfIdealOfNumericalSemigroup(I);[0m
    [22m[35m[ 0, 1 ][0m
    [22m[35mgap> MinimalGeneratingSystemOfIdealOfNumericalSemigroup(II);[0m
    [22m[35m[ 14, 20 ][0m
    [22m[35mgap> MinimalGeneratingSystemOfIdealOfNumericalSemigroup(I+II);[0m
    [22m[35m[ 14, 15, 20, 21 ][0m
    [22m[35m[0m
    [22m[35m                        [0m
  [22m[35m------------------------------------------------------------------[0m
  
  [1m[4m[31m7.1-11 DifferenceOfIdealsOfNumericalSemigroup[0m
  
  [1m[34m> DifferenceOfIdealsOfNumericalSemigroup( [0m[22m[34mI, J[0m[1m[34m ) ___________________[0mfunction
  
  [22m[34mI, J[0m are ideals of a numerical semigroup. [22m[34mJ[0m must be contained in [22m[34mI[0m.
  
  The output is the set [22m[34mI[0m\ [22m[34mJ[0m.
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35mgap> S:=NumericalSemigroup(14, 15, 20, 21, 25);[0m
    [22m[35m<Numerical semigroup with 5 generators>[0m
    [22m[35mgap> I:=[0,1]+S;[0m
    [22m[35m<Ideal of numerical semigroup>[0m
    [22m[35mgap> 2*I-2*I;[0m
    [22m[35m<Ideal of numerical semigroup>[0m
    [22m[35mgap> I-I;[0m
    [22m[35m<Ideal of numerical semigroup>[0m
    [22m[35mgap> DifferenceOfIdealsOfNumericalSemigroup(last2,last);[0m
    [22m[35m[ 26, 27, 37, 38 ][0m
    [22m[35m[0m
    [22m[35m                        [0m
  [22m[35m------------------------------------------------------------------[0m
  
  [1m[4m[31m7.1-12 HilbertFunctionOfIdealOfNumericalSemigroup[0m
  
  [1m[34m> HilbertFunctionOfIdealOfNumericalSemigroup( [0m[22m[34mn, I[0m[1m[34m ) _______________[0mfunction
  
  [22m[34mI[0m  is an ideal of a numerical semigroup, [22m[34mn[0m is a non negative integer. [22m[34mI[0m must
  be contained in its ambient semigroup.
  
  The output is the cardinality of the set [22m[34mn[0m[22m[34mI[0m\ ([22m[34mn[0m+1)[22m[34mI[0m.
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35mgap> I:=[6,9,11]+NumericalSemigroup(6,9,11);;[0m
    [22m[35mgap> List([1..7],n->HilbertFunctionOfIdealOfNumericalSemigroup(n,I));[0m
    [22m[35m[ 3, 11, 24, 48, 96, 192, 384 ][0m
    [22m[35m[0m
    [22m[35m                        [0m
  [22m[35m------------------------------------------------------------------[0m
  
  [1m[4m[31m7.1-13 BlowUpIdealOfNumericalSemigroup[0m
  
  [1m[34m> BlowUpIdealOfNumericalSemigroup( [0m[22m[34mI[0m[1m[34m ) _____________________________[0mfunction
  
  [22m[34mI[0m is an ideal of a numerical semigroup.
  
  The output is the ideal bigcup_n>= 0 n[22m[34mI[0m-n[22m[34mI[0m.
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35mgap> I:=[0,2]+NumericalSemigroup(6,9,11);;[0m
    [22m[35mgap> BlowUpIdealOfNumericalSemigroup(I);;[0m
    [22m[35mgap> SmallElementsOfIdealOfNumericalSemigroup(last);[0m
    [22m[35m[ 0, 2, 4, 6, 8 ][0m
    [22m[35m[0m
    [22m[35m                        [0m
  [22m[35m------------------------------------------------------------------[0m
  
  [1m[4m[31m7.1-14 MaximalIdealOfNumericalSemigroup[0m
  
  [1m[34m> MaximalIdealOfNumericalSemigroup( [0m[22m[34mS[0m[1m[34m ) ____________________________[0mfunction
  
  Returns the maximal ideal of the numerical semigroup [22m[34mS[0m.
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35mgap> MaximalIdealOfNumericalSemigroup(NumericalSemigroup(3,7));[0m
    [22m[35m<Ideal of numerical semigroup>[0m
    [22m[35m[0m
    [22m[35m                        [0m
  [22m[35m------------------------------------------------------------------[0m
  
