1#############################################################################
2##
3#W  catenary-tame.gd        Manuel Delgado <mdelgado@fc.up.pt>
4#W                          Pedro A. Garcia-Sanchez <pedro@ugr.es>
5#W                          Jose Morais <josejoao@fc.up.pt>
6##
7##
8#Y  Copyright 2005 by Manuel Delgado,
9#Y  Pedro Garcia-Sanchez and Jose Joao Morais
10#Y  We adopt the copyright regulations of GAP as detailed in the
11#Y  copyright notice in the GAP manual.
12##
13#############################################################################
14
15#############################################################################
16##
17#F  NSGPfactorizationsNC(n,l)
18##
19##  <n> is a nonnegative integer and <l> is a list of positive integers.
20##  Returns a list with the different factorizations of n as a linear
21##  combination with elements in l.
22##
23#############################################################################
24DeclareGlobalFunction( "NSGPfactorizationsNC" );
25
26
27#############################################################################
28##
29#F  CatenaryDegreeOfNumericalSemigroup(s)
30##
31##  Computes the catenary degree of the numerical semigroup <s>.
32##
33##  The definition of catenary degree can be found in
34##  the book:
35##   -A. Geroldinger and F. Halter-Koch, Non-unique
36##    Factorizations: Algebraic, Combinatorial and
37##    Analytic Theory, Pure and AppliedMathematics,
38##    vol. 278, Chapman & Hall/CRC, 2006.
39##  The algorithm used appears in
40##   -S. T. Chapman, P. A. Garcia-Sanchez,
41##    D. Llena, V. Ponomarenko, and J. C. Rosales,
42##    The catenary and tame degree in finitely generated
43##    cancellative monoids, Manuscripta Mathematica 120 (2006) 253--264
44##
45#############################################################################
46DeclareGlobalFunction( "CatenaryDegreeOfNumericalSemigroup" );
47DeclareOperation("CatenaryDegree",[IsNumericalSemigroup]);
48#############################################################################
49##
50#F  CatenaryDegreeOfElementInNumericalSemigroup(s)
51##
52## This function returns the catenary cegree in a numerical semigroup S of
53## a positive integer n
54##
55##
56DeclareGlobalFunction( "CatenaryDegreeOfElementInNumericalSemigroup" );
57DeclareOperation("CatenaryDegree",[IsNumericalSemigroup,IsInt]);
58DeclareOperation("CatenaryDegree",[IsInt,IsNumericalSemigroup]);
59
60#############################################################################
61##
62#F  TameDegreeOfElementInNumericalSemigroup(n,s)
63##
64##  Computes the tame degre of the element <n> of the numerical semigroup <s>.
65##  Used for the computation of the tame degree of s, but can
66##  be used separately.
67##
68##  The definition of tame degree appears in
69##   -A. Geroldinger and F. Halter-Koch, Non-unique
70##    Factorizations: Algebraic, Combinatorial and
71##    Analytic Theory, Pure and AppliedMathematics,
72##    vol. 278, Chapman & Hall/CRC, 2006.
73##  The algorithm used appears in
74##   -S. T. Chapman, P. A. Garcia-Sanchez,
75##    D. Llena, V. Ponomarenko, and J. C. Rosales,
76##    The catenary and tame degree in finitely generated
77##    cancellative monoids, Manuscripta Mathematica 120 (2006) 253--264
78##
79#############################################################################
80DeclareGlobalFunction( "TameDegreeOfElementInNumericalSemigroup" );
81DeclareOperation("TameDegree",[IsInt,IsNumericalSemigroup]);
82DeclareOperation("TameDegree",[IsNumericalSemigroup,IsInt]);
83
84#############################################################################
85##
86#F  TameDegreeOfNumericalSemigroup(s)
87##
88##  Computes the tame degree of a numerical semigroup <s>.
89##
90##  The definition of tame degree appears in
91##   -A. Geroldinger and F. Halter-Koch, Non-unique
92##    Factorizations: Algebraic, Combinatorial and
93##    Analytic Theory, Pure and AppliedMathematics,
94##    vol. 278, Chapman & Hall/CRC, 2006.
95##  The algorithm used appears in
96##   -S. T. Chapman, P. A. Garcia-Sanchez,
97##    D. Llena,  The catenary and tame degree of numerical
98##    semigroups, Forum Math. 2007 1--13.
99##
100#############################################################################
101DeclareGlobalFunction( "TameDegreeOfNumericalSemigroup" );
102DeclareOperation("TameDegree",[IsNumericalSemigroup]);
103
104#############################################################################
105##
106#F  FactorizationsElementWRTNumericalSemigroup(n,s)
107##
108##  Computes the set of factorizations
109##  of an element <n> as linear combinations
110##  with nonnegative coefficients of the minimal generators
111##  of the semigroup <s>.
112##
113#############################################################################
114DeclareGlobalFunction( "FactorizationsElementWRTNumericalSemigroup" );
115DeclareOperation("Factorizations",[IsInt,IsNumericalSemigroup]);
116DeclareOperation("Factorizations",[IsNumericalSemigroup,IsInt]);
117
118#############################################################################
119##
120#F  LengthsOfFactorizationsElementWRTNumericalSemigroup(n,s)
121##
122##  Computes the lengths of the set of
123##  factorizations of an element <n> as linear combinations
124##  with nonnegative coefficients of the minimal generators
125##  of the semigroup <s>.
126##
127#############################################################################
128DeclareGlobalFunction( "LengthsOfFactorizationsElementWRTNumericalSemigroup" );
129
130
131#############################################################################
132##
133#F  ElasticityOfFactorizationsElementWRTNumericalSemigroup(n,s)
134##
135##  Computes the quotient (maximum length)/(minimum lenght) of the
136##  factorizations of an element <n> as linear combinations
137##  with nonnegative coefficients of the minimal generators
138##  of the semigroup <s>.
139##
140#############################################################################
141DeclareGlobalFunction( "ElasticityOfFactorizationsElementWRTNumericalSemigroup" );
142DeclareOperation("Elasticity",[IsPosInt,IsNumericalSemigroup]);
143DeclareOperation("Elasticity",[IsNumericalSemigroup,IsPosInt]);
144
145#############################################################################
146##
147#F  ElasticityOfNumericalSemigroup(s)
148##
149##  Computes the supremum of the elasticities of the
150##  factorizations of the elements of <s>.
151##  From [CHM06, GHKb] this is precisely np/n1
152##  with n1 the multiplicity of <s> and np the greatest
153##  generator.
154##
155#############################################################################
156DeclareGlobalFunction( "ElasticityOfNumericalSemigroup" );
157DeclareOperation("Elasticity",[IsNumericalSemigroup]);
158
159#############################################################################
160##
161#F  DeltaSetOfFactorizationsElementWRTNumericalSemigroup(n,s)
162##
163##  Computes the set of differences between
164##  two consecutive lengths of factorizations of
165##  an element <n> as linear combinations
166##  with nonnegative coefficients of the minimal generators
167##  of the semigroup <s>.
168##
169#############################################################################
170DeclareGlobalFunction( "DeltaSetOfFactorizationsElementWRTNumericalSemigroup" );
171DeclareOperation("DeltaSet",[IsInt,IsNumericalSemigroup]);
172DeclareOperation("DeltaSet",[IsNumericalSemigroup,IsInt]);
173
174#############################################################################
175##
176#F  MaximumDegreeOfElementWRTNumericalSemigroup(n,s)
177##
178##  Computes the maximum length of the
179##  factorizations of an element <n> as linear combinations
180##  with nonnegative coefficients of the minimal generators
181##  of the semigroup <s>.
182##
183#############################################################################
184DeclareGlobalFunction( "MaximumDegreeOfElementWRTNumericalSemigroup" );
185DeclareOperation("MaximumDegree",[IsInt,IsNumericalSemigroup]);
186DeclareOperation("MaximumDegree",[IsNumericalSemigroup,IsInt]);
187
188#############################################################################
189##
190#F  OmegaPrimalityOfElementInNumericalSemigroup(n,s)
191##
192##  Computes the omega primality of an elmenent n in S, as explained in
193##  V. Blanco, P. A. Garc\'{\i}a-S\'anchez, A. Geroldinger,
194##  Semigroup-theoretical characterizations of arithmetical invariants with
195##  applications to numerical monoids and Krull monoids, {arXiv}:1006.4222v1.
196##
197#############################################################################
198DeclareGlobalFunction("OmegaPrimalityOfElementInNumericalSemigroup");
199DeclareOperation("OmegaPrimality",[IsInt,IsNumericalSemigroup]);
200DeclareOperation("OmegaPrimality",[IsNumericalSemigroup,IsInt]);
201
202
203#############################################################################
204##
205#F  OmegaPrimalityOfNumericalSemigroup(s)
206##
207##  Computes the maximum of omega primality of the minimal generators of S.
208##
209#############################################################################
210DeclareGlobalFunction("OmegaPrimalityOfNumericalSemigroup");
211DeclareOperation("OmegaPrimality",[IsNumericalSemigroup]);
212
213#############################################################################
214##
215#F  FactorizationsIntegerWRTList(n,ls)
216##
217##  Computes the set of factorizations
218##  of an integer n as linear combinations
219##  with nonnegative coefficients of the elements in the list ls
220##  Makes use of RestrictedPartitions
221#############################################################################
222DeclareGlobalFunction("FactorizationsIntegerWRTList");
223
224#############################################################################
225##
226#F  LengthsOfFactorizationsIntegerWRTList(n,ls)
227##
228##  Computes the lengths of the set of
229##  factorizations of an  integer <n> as linear combinations
230##  with nonnegative coefficients of the elements in the list <ls>
231##
232#############################################################################
233DeclareGlobalFunction("LengthsOfFactorizationsIntegerWRTList");
234
235#############################################################################
236##
237#F  DeltaSetOfSetOfIntegers(n,s)
238##
239##  Computes the set of differences between
240##  two consecutive lengths of factorizations of
241##  an integer <n> as linear combinations
242##  with nonnegative coefficients of the elements in the list <ls>
243##
244#############################################################################
245DeclareGlobalFunction("DeltaSetOfSetOfIntegers");
246DeclareOperation("DeltaSet",[IsHomogeneousList]);
247
248#############################################################################
249##
250#F  CatenaryDegreeOfSetOfFactorizations(fact)
251##
252##  Computes the catenary degree of the set of factorizations
253##
254#############################################################################
255DeclareGlobalFunction("CatenaryDegreeOfSetOfFactorizations");
256DeclareOperation("CatenaryDegree",[IsRectangularTable]);
257
258#############################################################################
259##
260#F  TameDegreeOfSetOfFactorizations(fact)
261##
262##  Computes the tame degree of the set of factorizations
263##
264#############################################################################
265DeclareGlobalFunction("TameDegreeOfSetOfFactorizations");
266DeclareOperation("TameDegree",[IsRectangularTable]);
267
268
269#############################################################################
270##
271#F  RClassesOfSetOfFactorizations(l)
272##
273##  Determine the set of R-classes (Chapter 7 [RGBook] of a set of factorizations
274##
275#############################################################################
276DeclareGlobalFunction("RClassesOfSetOfFactorizations");
277
278########################################################
279#  MaximalDenumerantOfElementInNumericalSemigroup(x,s)
280#  returns the number of factorizations of maximal length of x in
281#  the numerical semigroup s
282########################################################
283DeclareGlobalFunction("MaximalDenumerantOfElementInNumericalSemigroup");
284DeclareOperation("MaximalDenumerant",[IsInt,IsNumericalSemigroup]);
285DeclareOperation("MaximalDenumerant",[IsNumericalSemigroup,IsInt]);
286
287########################################################
288#  MaximalDenumerantOfSetOfFactorizations(ls)
289#  returns the number of factorizations of maximal length in ls
290########################################################
291DeclareGlobalFunction("MaximalDenumerantOfSetOfFactorizations");
292
293########################################################
294# MaximalDenumerantOfNumericalSemigroup(s)
295# computes the maximal denumerant of a numerical semigroup
296# by using de algorithm given by Bryant and Hamblin
297# Semigroup Forum 86 (2013), 571-582
298########################################################
299DeclareGlobalFunction("MaximalDenumerantOfNumericalSemigroup");
300DeclareOperation("MaximalDenumerant",[IsNumericalSemigroup]);
301
302########################################################
303# AdjustmentOfNumericalSemigroup(s)
304# computes the adjustment a numerical semigroup
305# by using de algorithm given by Bryant and Hamblin
306# Semigroup Forum 86 (2013), 571-582
307########################################################
308DeclareGlobalFunction("AdjustmentOfNumericalSemigroup");
309DeclareOperation("Adjustment",[IsNumericalSemigroup]);
310
311##############################################################
312# IsAdditiveNumericalSemigroup(s)
313# Detects if s is an additive numerical semigroup, that is,
314# ord(m+x)=ord(x)+1 for all x in s. For these semigroups gr_m(K[[s]]) is
315# Cohen-Macaulay.
316# We use Proposition 4.7 in  Semigroup Forum 86 (2013), 571-582
317##############################################################
318DeclareGlobalFunction("IsAdditiveNumericalSemigroup");
319
320##############################################################
321# IsSuperSymmetricNumericalSemigroup(s)
322# Detects if s is a numerical semigroup is supersymmetric, that is,
323# it is symmetric, additive and whenever w+w'=f+m
324# (with m the multiplicity and f the Frobenius number) we have
325# ord(w+w')=ord(w)+ord(w')
326##############################################################
327DeclareGlobalFunction("IsSuperSymmetricNumericalSemigroup");
328
329#######################################################################
330# BelongsToHomogenizationOfNumericalSemigroup(n,s)
331# checks if the pair n belongs to the homogenization of s
332#######################################################################
333DeclareGlobalFunction("BelongsToHomogenizationOfNumericalSemigroup");
334
335#######################################################################
336# FactorizationsInHomogenizationOfNumericalSemigroup(n,s)
337# computes the set of factorizations of  n with respect to generators of
338# the homogenization of s
339#######################################################################
340DeclareGlobalFunction("FactorizationsInHomogenizationOfNumericalSemigroup");
341
342#######################################################################
343# HomogeneousBettiElementsOfNumericalSemigroup(s)
344#  Computes the Betti elements of the Homogenization of s
345#  uses Cox-Little-O'Shea, Chapter 8, Theorem 4  for finding
346#  a system of generators of the ideal of S^h
347#######################################################################
348DeclareGlobalFunction("HomogeneousBettiElementsOfNumericalSemigroup");
349
350####################################################################
351#F HomogeneousCatenaryDegreeOfNumericalSemigroup(s) computes the
352##  homogeneous catenary degree of the numerical semigroup s ([GSOSN])
353####################################################################
354DeclareGlobalFunction("HomogeneousCatenaryDegreeOfNumericalSemigroup");
355
356########################################
357#F DenumerantOfElementInNumericalSemigroup(n,s)
358## returns the denumerant
359########################################
360DeclareGlobalFunction("DenumerantOfElementInNumericalSemigroup");
361### as function
362DeclareOperation("DenumerantFunction",[IsNumericalSemigroup]);
363
364####################################################################
365#F MoebiusFunctionAssociatedToNumericalSemigroup(s,x)
366## Computes the value in x of  Moebius function of the poset
367## associated to a numerial semigroup s
368## -Chappelon and Ramirez Alfonsin, Semigroup Forum 87 (2013), 313-330
369####################################################################
370DeclareGlobalFunction("MoebiusFunctionAssociatedToNumericalSemigroup");
371DeclareOperation("MoebiusFunction",[IsNumericalSemigroup]);
372
373###################################################################
374#F  AdjacentCatenaryDegreeOfSetOfFactorizations(ls)
375## computes the adjacent catenary degree of the set of factorizations ls
376###################################################################
377DeclareGlobalFunction("AdjacentCatenaryDegreeOfSetOfFactorizations");
378
379###################################################################
380#F EqualCatenaryDegreeOfSetOfFactorizations(ls)
381## computes the equal catenary degree of of the set of factorizations
382###################################################################
383DeclareGlobalFunction("EqualCatenaryDegreeOfSetOfFactorizations");
384
385###################################################################
386#F MonotoneCatenaryDegreeOfSetOfFactorizations(ls)
387## computes the equal catenary degree of of the set of factorizations
388###################################################################
389DeclareGlobalFunction("MonotoneCatenaryDegreeOfSetOfFactorizations");
390
391############################################################
392#F LShapesOfNumericalSemigroup(s)
393## computes the set of LShapes associated to S (see [AG-GS])
394##########################################################
395DeclareGlobalFunction("LShapesOfNumericalSemigroup");
396DeclareOperation("LShapes",[IsNumericalSemigroup]);
397
398###########################################################################
399#F  DegreesOfMonotonePrimitiveElementsOfNumericalSemigroup(s)
400##
401## Computes the sets of elements in s, such that there exists a minimal
402## solution to msg*x-msg*y = 0, |x|<=|y| such that x,y are factorizations of s
403## Used to compute the monotone catenary degree of the semigroup s
404##
405#############################################################################
406DeclareGlobalFunction("DegreesOfMonotonePrimitiveElementsOfNumericalSemigroup");
407
408###########################################################################
409#F  DegreesOfEqualPrimitiveElementsOfNumericalSemigroup(s)
410##
411## Computes the sets of elements in s, such that there exists a minimal
412## solution to msg*x-msg*y = 0, |x|=|y| such that x,y are factorizations of s
413## Used to compute the equal catenary degree of the semigroup
414##
415#############################################################################
416DeclareGlobalFunction("DegreesOfEqualPrimitiveElementsOfNumericalSemigroup");
417
418####################################################################
419#F EqualCatenaryDegreeOfNumericalSemigroup(s) computes the
420##  adjacent catenary degree of the numerical semigroup s
421##  the equal catenary degree is reached in the set of primitive
422##  elements of s (see [PH])
423####################################################################
424DeclareGlobalFunction("EqualCatenaryDegreeOfNumericalSemigroup");
425
426####################################################################
427#F MonotoneCatenaryDegreeOfNumericalSemigroup(s) computes the
428##  adjacent catenary degree of the numerical semigroup s
429##  the monotone catenary degree is reached in the set of primitive
430##  elements of s (see [PH])
431####################################################################
432DeclareGlobalFunction("MonotoneCatenaryDegreeOfNumericalSemigroup");
433
434
435
436###########################################################################
437#####################################################################
438##
439#O FengRaoDistance(NS,r,m)
440##
441#Computes the r-th Feng-Rao distance of the element m in the numerical semigroup NS
442#function originally implemented by Benjamin Heredia
443#Based on the paper...
444##
445#####################################################################
446DeclareOperation("FengRaoDistance",[IsNumericalSemigroup,IsPosInt,IsPosInt]);
447
448###########################################################################
449###########################################################################
450##
451#O FengRaoNumber(NS,r)
452#O FengRaoNumber(r,NS)
453# returns the r-Feng Rao number of a numerical semigroup NS
454########
455# based on [DelgadoFarranGarcia-SanchezLlena2013MC]
456#################################################
457#####################################################################
458DeclareOperation("FengRaoNumber",[IsNumericalSemigroup,IsPosInt]);
459DeclareOperation("FengRaoNumber",[IsPosInt,IsNumericalSemigroup]);
460