% generated by GAPDoc2LaTeX from XML source (Frank Luebeck)
\documentclass[11pt]{report}
\usepackage{a4wide}
\sloppy
\pagestyle{myheadings}
\usepackage{amssymb}
\usepackage[latin1]{inputenc}
\usepackage{makeidx}
\makeindex
\usepackage{epsfig}
\usepackage{color}
\definecolor{DarkOlive}{rgb}{0.1047,0.2412,0.0064}
\definecolor{FireBrick}{rgb}{0.5812,0.0074,0.0083}
\definecolor{RoyalBlue}{rgb}{0.0236,0.0894,0.6179}
\definecolor{RoyalGreen}{rgb}{0.0236,0.6179,0.0894}
\definecolor{RoyalRed}{rgb}{0.6179,0.0236,0.0894}
\definecolor{LightBlue}{rgb}{0.8544,0.9511,1.0000}
\definecolor{Black}{rgb}{0.0,0.0,0.0}
\definecolor{FuncColor}{rgb}{1.0,0.0,0.0}
%% strange name because of pdflatex bug:
\definecolor{Chapter }{rgb}{0.0,0.0,1.0}

\usepackage{fancyvrb}

\usepackage{pslatex}

\usepackage[
        a4paper=true,bookmarks=false,pdftitle={Written with GAPDoc},
        colorlinks=true,backref=page,breaklinks=true,linkcolor=RoyalBlue,
        citecolor=RoyalGreen,filecolor=RoyalRed,
        urlcolor=RoyalRed,pagecolor=RoyalBlue]{hyperref}

% write page numbers to a .pnr log file for online help
\newwrite\pagenrlog
\immediate\openout\pagenrlog =\jobname.pnr
\immediate\write\pagenrlog{PAGENRS := [}
\newcommand{\logpage}[1]{\protect\write\pagenrlog{#1, \thepage,}}
\newcommand{\Q}{\mathbb{Q}}
\newcommand{\R}{\mathbb{R}}
\newcommand{\C}{\mathbb{C}}
\newcommand{\Z}{\mathbb{Z}}
\newcommand{\N}{\mathbb{N}}
\newcommand{\F}{\mathbb{F}}

\newcommand{\GAP}{\textsf{GAP}}

\newsavebox{\backslashbox}
\sbox{\backslashbox}{\texttt{\symbol{92}}}
\newcommand{\bs}{\usebox{\backslashbox}}

\begin{document}

\logpage{[ 0, 0, 0 ]}
\begin{titlepage}
\begin{center}{\Huge \textbf{Numerical Semigroups}}\\[1cm]
\markright{\scriptsize \mbox{}\hfill Numerical Semigroups \hfill\mbox{}}
{( Version 0.92 ) }\\[1cm]
\mbox{}\\[2cm]
{\large \textbf{ Manuel Delgado   }}\\
{\large \textbf{ Pedro García-Sánchez   }}\\
{\large \textbf{ José João Morais  }}\\
\end{center}\vfill

\mbox{}\\
{\mbox{}\\
\small \noindent \textbf{ Manuel Delgado   } --- Email: \href{mailto://mdelgado@fc.up.pt}{\texttt{mdelgado@fc.up.pt}}\\
 --- Homepage: \href{http://www.fc.up.pt/cmup/mdelgado}{\texttt{http://www.fc.up.pt/cmup/mdelgado}}}\\
{\mbox{}\\
\small \noindent \textbf{ Pedro García-Sánchez   } --- Email: \href{mailto://pedro@ugr.es}{\texttt{pedro@ugr.es}}\\
 --- Homepage: \href{http://www.ugr.es/~pedro}{\texttt{http://www.ugr.es/\~{}pedro}}}\\
{\mbox{}\\
\small \noindent \textbf{ José João Morais  } --- Email: \href{mailto://jjoao@netcabo.pt}{\texttt{jjoao@netcabo.pt}}}\\
\end{titlepage}

\newpage\setcounter{page}{2}
{\small 
\section*{Copyright}
\logpage{[ 0, 0, 1 ]}
 {\copyright} 2005 by Manuel Delgado, Pedro García-Sánchez and José João Morais

 We adopt the copyright regulations of \textsf{GAP} as detailed in the copyright notice in the \textsf{GAP} manual. }\\[1cm]
{\small 
\section*{Acknowledgements}
\logpage{[ 0, 0, 2 ]}
 The first author's work was (partially) supported by the \emph{Centro de Matemática da Universidade do Porto} (CMUP), financed by FCT (Portugal) through the programmes POCTI (Programa
Operacional "Ciência, Tecnologia, Inovação") and POSI (Programa Operacional
Sociedade da Informação), with national and European Community structural
funds and a sabbatical grant of FCT. 

 The second author was supported by the project MTM2004-01446 and FEDER founds. 

 The third author acknowledges financial support of FCT and the POCTI program
through a scholarship given by \emph{Centro de Matemática da Universidade do Porto}. 

 The authors whish to thank J. I. García-García for many helpfull discussions
and for helping in the programming of preliminary versions of some functions. }\\[1cm]
{\small 
\section*{Colophon}
\logpage{[ 0, 0, 3 ]}
 This work started when the first author visited the University of Granada in
part of a sabbatical year. Bug reports, suggestions and comments are, of
course, welcome. Please use our email addresses to this effect. }\\[1cm]
\newpage

\def\contentsname{Contents\logpage{[ 0, 0, 4 ]}}

\tableofcontents
\newpage

 
\chapter{\textcolor{Chapter }{ Introduction }}\label{Intro}
\logpage{[ 1, 0, 0 ]}
{
  A \emph{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. The smallest positive integer belonging to a numerical semigroup is
its \emph{multiplicity}. 

 Let $S$ be a numerical semigroup and $A$ be a subset of $S$. We say that $A$ is a \emph{system of generators} of $S$ if $S=\{ k_1 a_1+\cdots+ k_n a_n\ |\ n,k_1,\ldots,k_n\in{\mathbb N},
a_1,\ldots,a_n\in A\}$. The set $A$ is a \emph{minimal system of generators} of $S$ if no proper subset of $A$ is a system of generators of $S$. 

 Every numerical semigroup has a unique minimal system of generators. This is a
data that can be used in order to uniquely define a numerical semigroup.
Observe that since the complement of a numerical semigroup in the set of
nonnegative integers is finite, this implies that the greatest common divisor
of the elements of a numerical semigroup is 1, and the same condition must be
fulfilled by its minimal system of generators (or by any of its systems of
generators). 

 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 \label{zl1}\emph{Apéry set} of $S$ with respect to $s$. Note that a nonnegative integer $x$ congruent with $i$ modulo $s$ belongs to $S$ if and only if $w(i)\leq x$. Thus the pair $(s,{\rm Ap}(S,s))$ fully determines the numerical semigroup $S$ (and can be used to easily solve the membership problem to $S$). This set is in fact one of the most powerfull tools known for numerical
semigroups, and it is used almost everywhere in the computation of components
and invariants associated to a numerical semigroup. Usually the element $s$ is taken to be the multiplicity, since in this way the resulting Apéry set is
the smallest possible. 

 A \label{xx1}\emph{gap} of a numerical semigroup $S$ is a nonnegative integer not belonging to $S$. The set of gaps of $S$ is usually denoted by ${\rm H}(S)$, and clearly determines uniquely $S$. Note that if $x$ is a gap of $S$, then so are all the nonnegative integers dividing it. Thus in order to
describe $S$ we do not need to know all its gaps, but only those that are maximal with
respect to the partial order induced by division in ${\mathbb N}$. These gaps are called \label{lab1}\emph{fundamental gaps}. 

 The largest nonnegative integer not belonging to a numerical semigroup $S$ is the \emph{Frobenius number} of $S$. If $S$ is the set of nonnegative integers, then clearly its Frobenius number is $-1$, otherwise its Frobenius number coincides with the maximum of the gaps (or
fundamental gaps) of $S$. In this package we refer to the elements in the semigroup that are less than
or equal to the Frobenius number plus 1 as \label{zlab1}\emph{small elements} of the semigroup. Observe that from the definition, if $S$ is a numerical semigroup with Frobenius number $f$, then $f+{\mathbb N}\setminus\{0\}\subseteq S$. An integer $z$ is a \label{lab2}\emph{pseudo-Frobenius number} of $S$ if $z+S\setminus\{0\}\subseteq S$. Thus the Frobenius number of $S$ is one of its pseudo-Frobenius numbers. The \emph{type} of a numerical semigroup is the cardinality of the set of its pseudo-Frobenius
numbers. 

 The number of numerical semigroups having a given Frobenius number is finite.
The elements in this set of numerical semigroups that are maximal with respect
to set inclusion are precisely those numerical semigroups that cannot be
expressed as intersection of two other numerical semigroups containing them
properly, and thus they are known as \emph{irreducible} numerical semigroups. Clearly, every numerical semigroup is the intersection
of (finitely many) irreducible numerical semigroups. 

 A numerical semigroup $S$ with Frobenius number $f$ is \emph{symmetric} if for every integer $x$, either $x\in S$ or $f-x\in S$. The set of irreducible numerical semigroups with odd Frobenius number
coincides with the set of symmetric numerical semigroups. The numerical
semigroup $S$ is \emph{pseudo-symmetric} if $f$ is even and for every integer $x$ not equal to $f/2$ either $x\in S$ or $f-x\in S$. The set of irreducible numerical semigroups with even Frobenius number is
precisely the set of pseudo-symmetric numerical semigroups. These two classes
of numerical semigroups have been widely studied in the literature due to
their nice applications in Algebraic Geometry. This is probably one of the
main reasons that made people turn their attention on numerical semigroups
again in the last decades. Symmetric numerical semigroups can be also
characterized as those with type one, and pseudo-symmetric numerical
semigroups are those numerical semigroups with type two and such that its
pseudo-Frobenius numbers are its Frobenius number and its Frobenius number
divided by two. 

 Another class of numerical semigroups that catched the attention of
researchers working on Algebraic Geometry and Commutative Ring Theory is the
class of numerical semigroups with maximal embedding dimension. The \emph{embedding dimension} of a numerical semigroup is the cardinality of its minimal system of
generators. It can be shown that the embedding dimension is at most the
multiplicity of the numerical semigroup. Thus \emph{maximal embedding dimension} numerical semigroups are those numerical semigroups for which their embedding
dimension and multiplicity coincide. These numerical semigroups have nice
maximal properties, not only (of course) related to their embedding dimension,
but also by means of their presentations. Among maximal embedding dimension
there are two classes of numerical semigroups that have been studied due to
the connections with the equivalence of algebroid branches. A numerical
semigroup $S$ is Arf if for every $x\geq y\geq z\in S$, then $x+y-z\in S$; and it is \emph{saturated} if the following condition holds: if $s,s_1,\ldots,s_r\in S$ are such that $s_i\leq s$ for all $i\in \{1,\ldots,r\}$ and $z_1,\ldots,z_r\in {\mathbb Z}$ are such that $z_1s_1+\cdots+z_rs_r\geq 0$, then $s+z_1s_1+\cdots +z_rs_r\in S$. 

 If we look carefully inside the set of fundamental gaps of a numerical
semigroup, we see that there are some fulfilling the condition that if they
are added to the given numerical semigroup, then the resulting set is again a
numerical semigroup. These elements are called \label{lab3}\emph{special gaps} of the numerical semigroup. A numerical semigroup other than the set of
nonnegative integers is irreducible if and only if it has only a special gap. 

 The inverse operation to the one described in the above paragraph is that of
removing an element of a numerical semigroup. If we want the resulting set to
be a numerical semigroup, then the only thing we can remove is a minimal
generator. 

 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 \label{llab1}\emph{proportionally modular}. 

 A sequence of positive rational numbers $ a_1/b_1 < \cdots < a_n/b_n$ with $a_i,b_i$ positive integers is a \emph{Bézout sequence} if $ a_{i+1}b_i - a_i b_{i+1}=1$ for all $i\in \{1,\ldots,n-1\}$. If $ a/b=a_1/b_1 < \cdots < a_n/b_n =c/d$, then ${\rm S}([a/b,c/d])=\langle a_1,\ldots,a_n\rangle$. Bézout sequences are not only interesting for this fact, they have shown to
be a major tool in the study of proportionally modular numerical semigroups. 

 If $S$ is a numerical semigroup and $k$ is a positive integer, then the set $S/k=\{ x\in {\mathbb N} \ |\ kx\in S\}$ is a numerical semigroup, known as the \emph{quotient} $S$ by $k$. 

 Let $m$ be a positive integer. A \label{llab2}\emph{subadditive} function with period $m$ is a map $f:{\mathbb N}\to {\mathbb N}$ such that $ f(0)=0$, $f(x+y)\leq f(x)+f(y)$ and $f(x+m)=f(x)$. If $f$ is a subadditive function with period $m$, then the set ${\rm M}_f=\{ x\in {\mathbb N}\ |\ f(x)\leq x\}$ is a numerical semigroup. Moreover, every numerical semigroup is of this form.
Thus a numerical semigroup can be given by a subadditive function with a given
period. If $S$ is a numerical semigroup and $s\in S, s\not=0$, and ${\rm Ap}(S,s)=\{ w(0),w(1),\ldots, w(s-1)\}$, then $f(x)=w(x \ mod\ s)$ is a subadditive function with period $s$ such that ${\rm M}_f=S$. 

 Let $S$ be a numerical semigroup generated by $\{n_1,\ldots,n_k\}$. Then we can define the following morphism (called sometimes the
factorization morphism) by $\varphi: {\mathbb N}^k \to S,\ \varphi(a_1,\ldots,a_k)=a_1n_1+\cdots+a_kn_k$. If $\sigma$ is the kernel congruence of $\varphi$ (that is, $a\sigma b$ if $\varphi(a)=\varphi(b)$), then $S$ is isomorphic to ${\mathbb N}^k/\sigma$. A \emph{presentation} for $S$ is a system of generators (as a congruence) of $\sigma$. If $\{n_1,\ldots,n_p\}$ is a minimal system of generators, then a \emph{minimal presentation} is a presentation such that none of its proper subsets is a presentation.
Minimal presentations of numerical semigroups coincide with presentations with
minimal cardinality, though in general these two concepts are not the same for
an arbitrary commutative semigroup. 

 A set $I$ of integers is an \emph{ideal relative to a numerical semigroup} $S$ provided that $I+S\subseteq I$ and that there exists $d\in S$ such that $d+I\subseteq S$. If $I\subseteq S$, we simply say that $I$ is an \emph{ideal} of $S$. If $I$ and $J$ are relative ideals of $S$, then so is $I-J=\{z\in {\mathbb Z}\ |\ z+J\subseteq I\}$, and it is tightly related to the operation ":" of ideals in a commutative
ring. 

 In this package we have implemented the functions needed to deal with the
elements exposed in this introduction. }

 
\chapter{\textcolor{Chapter }{ Numerical Semigroups }}\logpage{[ 2, 0, 0 ]}
{
  This chapter describes how to create numerical semigroups in \textsf{GAP} and perform some basic tests. 
\section{\textcolor{Chapter }{ Generating Numerical Semigroups }}\logpage{[ 2, 1, 0 ]}
{
  Recalling some definitions from Chapter \ref{Intro}. 

 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 \emph{small elements} of the semigroup. 

 A \emph{gap} of a numerical semigroup $S$ is a nonnegative integer not belonging to $S$. The \emph{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 \emph{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 \emph{proportionally modular}. If $C = 1$, then it is said to be \emph{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 \textsf{GAP}. 

 To create a numerical semigroup in \textsf{GAP} the function \texttt{NumericalSemigroup} is used. 

\subsection{\textcolor{Chapter }{NumericalSemigroup}}
\logpage{[ 2, 1, 1 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{NumericalSemigroup( Type, List )\index{NumericalSemigroup@\texttt{NumericalSemigroup}}
\label{NumericalSemigroup}
}\hfill{\scriptsize (function)}}\\


 \texttt{Type} 

 May be \texttt{"generators"}, \texttt{"minimalgenerators"}, \texttt{"modular"}, \texttt{"propmodular"}, \texttt{"elements"}, \texttt{"gaps"}, \texttt{"fundamentalgaps"}, \texttt{"subadditive"} or \texttt{"apery"} according to whether the semigroup is to be given by means of a condition of
the form $ ax \ mod\ m$ {\textless}$= x$, a system of generators, a condition of the form $ ax \ mod\ m$ {\textless}$= 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. 

 \texttt{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$. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
  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
  
  ....................................
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{ModularNumericalSemigroup}}
\logpage{[ 2, 1, 2 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{ModularNumericalSemigroup( a, b )\index{ModularNumericalSemigroup@\texttt{ModularNumericalSemigroup}}
\label{ModularNumericalSemigroup}
}\hfill{\scriptsize (function)}}\\


 Given two positive integers \mbox{\texttt{a}} and \mbox{\texttt{b}}, this function returns a modular numerical semigroup satisfying $ax \ mod\ b <= x$. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
  gap> ModularNumericalSemigroup(3,7);
  <Modular numerical semigroup satisfying 3x mod 7 <= x >
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{ProportionallyModularNumericalSemigroup}}
\logpage{[ 2, 1, 3 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{ProportionallyModularNumericalSemigroup( a, b, c )\index{ProportionallyModularNumericalSemigroup@\texttt{ProportionallyModularNumericalSemigroup}}
\label{ProportionallyModularNumericalSemigroup}
}\hfill{\scriptsize (function)}}\\


 Given three integers \mbox{\texttt{a}}, \mbox{\texttt{b}} and \mbox{\texttt{c}}, this function returns a proportionally modular numerical semigroup
satisfying $ax\ mod\ b <= cx$. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
  gap> ProportionallyModularNumericalSemigroup(-3,7,12);
  <Proportionally modular numerical semigroup satisfying -3x mod 7 <= 12x >
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{NumericalSemigroupByGenerators}}
\logpage{[ 2, 1, 4 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{NumericalSemigroupByGenerators( List )\index{NumericalSemigroupByGenerators@\texttt{NumericalSemigroupByGenerators}}
\label{NumericalSemigroupByGenerators}
}\hfill{\scriptsize (function)}}\\
\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{NumericalSemigroupByMinimalGenerators( List )\index{NumericalSemigroupByMinimalGenerators@\texttt{NumericalSemigroupByMinimalGenerators}}
\label{NumericalSemigroupByMinimalGenerators}
}\hfill{\scriptsize (function)}}\\
\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{NumericalSemigroupByMinimalGeneratorsNC( List )\index{NumericalSemigroupByMinimalGeneratorsNC@\texttt{NumericalSemigroupByMinimalGeneratorsNC}}
\label{NumericalSemigroupByMinimalGeneratorsNC}
}\hfill{\scriptsize (function)}}\\
\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{NumericalSemigroupByInterval( List )\index{NumericalSemigroupByInterval@\texttt{NumericalSemigroupByInterval}}
\label{NumericalSemigroupByInterval}
}\hfill{\scriptsize (function)}}\\
\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{NumericalSemigroupByOpenInterval( List )\index{NumericalSemigroupByOpenInterval@\texttt{NumericalSemigroupByOpenInterval}}
\label{NumericalSemigroupByOpenInterval}
}\hfill{\scriptsize (function)}}\\
\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{NumericalSemigroupBySubAdditiveFunction( List )\index{NumericalSemigroupBySubAdditiveFunction@\texttt{NumericalSemigroupBySubAdditiveFunction}}
\label{NumericalSemigroupBySubAdditiveFunction}
}\hfill{\scriptsize (function)}}\\
\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{NumericalSemigroupByAperyList( List )\index{NumericalSemigroupByAperyList@\texttt{NumericalSemigroupByAperyList}}
\label{NumericalSemigroupByAperyList}
}\hfill{\scriptsize (function)}}\\
\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{NumericalSemigroupBySmallElements( List )\index{NumericalSemigroupBySmallElements@\texttt{NumericalSemigroupBySmallElements}}
\label{NumericalSemigroupBySmallElements}
}\hfill{\scriptsize (function)}}\\
\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{NumericalSemigroupByGaps( List )\index{NumericalSemigroupByGaps@\texttt{NumericalSemigroupByGaps}}
\label{NumericalSemigroupByGaps}
}\hfill{\scriptsize (function)}}\\
\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{NumericalSemigroupByFundamentalGaps( List )\index{NumericalSemigroupByFundamentalGaps@\texttt{NumericalSemigroupByFundamentalGaps}}
\label{NumericalSemigroupByFundamentalGaps}
}\hfill{\scriptsize (function)}}\\


The function \texttt{NumericalSemigroup} (\ref{NumericalSemigroup}) 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. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
  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
  ...
\end{Verbatim}
 }

 }

 
\section{\textcolor{Chapter }{Some basic tests}}\logpage{[ 2, 2, 0 ]}
{
  This section describes some basic tests on numerical semigroups.The first
described tests refer to the way the semigroup was created. Then are presented
functions to test if a given list represents the small elements, gaps or the
Apéry set (see \ref{zlab1}) of a numerical semigroup; to test if an integer belongs to a numerical
semigroup and if a numerical semigroup is a subsemigroup of another one. 

\subsection{\textcolor{Chapter }{IsNumericalSemigroup}}
\logpage{[ 2, 2, 1 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{IsNumericalSemigroup( NS )\index{IsNumericalSemigroup@\texttt{IsNumericalSemigroup}}
\label{IsNumericalSemigroup}
}\hfill{\scriptsize (attribute)}}\\
\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{IsNumericalSemigroupByGenerators( NS )\index{IsNumericalSemigroupByGenerators@\texttt{IsNumericalSemigroupByGenerators}}
\label{IsNumericalSemigroupByGenerators}
}\hfill{\scriptsize (attribute)}}\\
\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{IsNumericalSemigroupByMinimalGenerators( NS )\index{IsNumericalSemigroupByMinimalGenerators@\texttt{IsNumericalSemigroupByMinimalGenerators}}
\label{IsNumericalSemigroupByMinimalGenerators}
}\hfill{\scriptsize (attribute)}}\\
\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{IsNumericalSemigroupByInterval( NS )\index{IsNumericalSemigroupByInterval@\texttt{IsNumericalSemigroupByInterval}}
\label{IsNumericalSemigroupByInterval}
}\hfill{\scriptsize (attribute)}}\\
\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{IsNumericalSemigroupByOpenInterval( NS )\index{IsNumericalSemigroupByOpenInterval@\texttt{IsNumericalSemigroupByOpenInterval}}
\label{IsNumericalSemigroupByOpenInterval}
}\hfill{\scriptsize (attribute)}}\\
\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{IsNumericalSemigroupBySubAdditiveFunction( NS )\index{IsNumericalSemigroupBySubAdditiveFunction@\texttt{IsNumericalSemigroupBySubAdditiveFunction}}
\label{IsNumericalSemigroupBySubAdditiveFunction}
}\hfill{\scriptsize (attribute)}}\\
\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{IsNumericalSemigroupByAperyList( NS )\index{IsNumericalSemigroupByAperyList@\texttt{IsNumericalSemigroupByAperyList}}
\label{IsNumericalSemigroupByAperyList}
}\hfill{\scriptsize (attribute)}}\\
\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{IsNumericalSemigroupBySmallElements( NS )\index{IsNumericalSemigroupBySmallElements@\texttt{IsNumericalSemigroupBySmallElements}}
\label{IsNumericalSemigroupBySmallElements}
}\hfill{\scriptsize (attribute)}}\\
\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{IsNumericalSemigroupByGaps( NS )\index{IsNumericalSemigroupByGaps@\texttt{IsNumericalSemigroupByGaps}}
\label{IsNumericalSemigroupByGaps}
}\hfill{\scriptsize (attribute)}}\\
\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{IsNumericalSemigroupByFundamentalGaps( NS )\index{IsNumericalSemigroupByFundamentalGaps@\texttt{IsNumericalSemigroupByFundamentalGaps}}
\label{IsNumericalSemigroupByFundamentalGaps}
}\hfill{\scriptsize (attribute)}}\\
\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{IsProportionallyModularNumericalSemigroup( NS )\index{IsProportionallyModularNumericalSemigroup@\texttt{IsProportionallyModularNumericalSemigroup}}
\label{IsProportionallyModularNumericalSemigroup}
}\hfill{\scriptsize (attribute)}}\\
\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{IsModularNumericalSemigroup( NS )\index{IsModularNumericalSemigroup@\texttt{IsModularNumericalSemigroup}}
\label{IsModularNumericalSemigroup}
}\hfill{\scriptsize (attribute)}}\\


 \mbox{\texttt{NS}} is a numerical semigroup and these attributes are available (their names
should be self explanatory). 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
  gap> s:=NumericalSemigroup(3,7);
  <Numerical semigroup with 2 generators>
  gap> AperyListOfNumericalSemigroupWRTElement(s,30);;
  gap> t:=NumericalSemigroupByAperyList(last);
  <Numerical semigroup>
  gap> IsNumericalSemigroupByGenerators(s);
  true
  gap> IsNumericalSemigroupByGenerators(t);
  false
  gap> IsNumericalSemigroupByAperyList(s);
  true
  gap> IsNumericalSemigroupByAperyList(t);
  true
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{RepresentsSmallElementsOfNumericalSemigroup}}
\logpage{[ 2, 2, 2 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{RepresentsSmallElementsOfNumericalSemigroup( L )\index{RepresentsSmallElementsOfNumericalSemigroup@\texttt{RepresentsSmallElementsOfNumericalSemigroup}}
\label{RepresentsSmallElementsOfNumericalSemigroup}
}\hfill{\scriptsize (attribute)}}\\


 Tests if the list \mbox{\texttt{L}} (which has to be a set) may represent the ``small" # elements of a numerical
semigroup. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
  gap> L:=[ 0, 3, 6, 9, 11, 12, 14, 15, 17, 18, 20 ];
  [ 0, 3, 6, 9, 11, 12, 14, 15, 17, 18, 20 ]
  gap> RepresentsSmallElementsOfNumericalSemigroup(L);
  true
  gap> L:=[ 6, 9, 11, 12, 14, 15, 17, 18, 20 ];
  [ 6, 9, 11, 12, 14, 15, 17, 18, 20 ]
  gap> RepresentsSmallElementsOfNumericalSemigroup(L);
  false
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{RepresentsGapsOfNumericalSemigroup}}
\logpage{[ 2, 2, 3 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{RepresentsGapsOfNumericalSemigroup( L )\index{RepresentsGapsOfNumericalSemigroup@\texttt{RepresentsGapsOfNumericalSemigroup}}
\label{RepresentsGapsOfNumericalSemigroup}
}\hfill{\scriptsize (attribute)}}\\


 Tests if the list \mbox{\texttt{L}} may represent the gaps (see \ref{xx1}) of a numerical semigroup. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
  gap> s:=NumericalSemigroup(3,7);
  <Numerical semigroup with 2 generators>
  gap> L:=GapsOfNumericalSemigroup(s);
  [ 1, 2, 4, 5, 8, 11 ]
  gap> RepresentsGapsOfNumericalSemigroup(L);
  true
  gap> L:=Set(List([1..21],i->RandomList([1..50])));
  [ 2, 6, 7, 8, 10, 12, 14, 19, 24, 28, 31, 35, 42, 50 ]
  gap> RepresentsGapsOfNumericalSemigroup(L);
  false
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{IsAperyListOfNumericalSemigroup}}
\logpage{[ 2, 2, 4 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{IsAperyListOfNumericalSemigroup( L )\index{IsAperyListOfNumericalSemigroup@\texttt{IsAperyListOfNumericalSemigroup}}
\label{IsAperyListOfNumericalSemigroup}
}\hfill{\scriptsize (function)}}\\


 Tests whether a list \mbox{\texttt{L}} of integers may represent the Apéry list of a numerical semigroup. It returns \texttt{true} when the periodic function represented by \mbox{\texttt{L}} is subadditive (see \texttt{RepresentsPeriodicSubAdditiveFunction} (\ref{RepresentsPeriodicSubAdditiveFunction})) and the remainder of the division of \texttt{L[i]} by the length of \mbox{\texttt{L}} is \texttt{i} and returns \texttt{false} otherwise (the crieterium used is the one explained in \cite{R96}). 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
  gap> IsAperyListOfNumericalSemigroup([0,21,7,28,14]);
  true
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{IsSubsemigroupOfNumericalSemigroup}}
\logpage{[ 2, 2, 5 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{IsSubsemigroupOfNumericalSemigroup( S, T )\index{IsSubsemigroupOfNumericalSemigroup@\texttt{IsSubsemigroupOfNumericalSemigroup}}
\label{IsSubsemigroupOfNumericalSemigroup}
}\hfill{\scriptsize (function)}}\\


 \mbox{\texttt{S}} and \mbox{\texttt{T}} are numerical semigroups. Tests whether \mbox{\texttt{T}} is contained in \mbox{\texttt{S}}. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
  gap> S := NumericalSemigroup("modular", 5,53);
  <Modular numerical semigroup satisfying 5x mod 53 <= x >
  gap> T := NumericalSemigroup(2,3);
  <Numerical semigroup with 2 generators>
  gap> IsSubsemigroupOfNumericalSemigroup(T,S);
  true
  gap> IsSubsemigroupOfNumericalSemigroup(S,T);
  false
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{BelongsToNumericalSemigroup}}
\logpage{[ 2, 2, 6 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{BelongsToNumericalSemigroup( n, S )\index{BelongsToNumericalSemigroup@\texttt{BelongsToNumericalSemigroup}}
\label{BelongsToNumericalSemigroup}
}\hfill{\scriptsize (operation)}}\\


 \mbox{\texttt{n}} is an integer and \mbox{\texttt{S}} is a numerical semigroup. Tests whether \mbox{\texttt{n}} belongs to \mbox{\texttt{S}}. \texttt{n in S} is the short for \texttt{BelongsToNumericalSemigroup(n,S)}. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
  gap> S := NumericalSemigroup("modular", 5,53);
  <Modular numerical semigroup satisfying 5x mod 53 <= x >
  gap> BelongsToNumericalSemigroup(15,S);
  false
  gap> 15 in S;
  false
  gap> SmallElementsOfNumericalSemigroup(S);
  [ 0, 11, 12, 13, 22, 23, 24, 25, 26, 32, 33, 34, 35, 36, 37, 38, 39, 43 ]
  gap> BelongsToNumericalSemigroup(13,S);
  true
  gap> 13 in S;
  true
\end{Verbatim}
 }

 }

 }

 
\chapter{\textcolor{Chapter }{ Basic operations with numerical semigroups }}\logpage{[ 3, 0, 0 ]}
{
  
\section{\textcolor{Chapter }{ The definitions }}\logpage{[ 3, 1, 0 ]}
{
  

\subsection{\textcolor{Chapter }{MultiplicityOfNumericalSemigroup}}
\logpage{[ 3, 1, 1 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{MultiplicityOfNumericalSemigroup( NS )\index{MultiplicityOfNumericalSemigroup@\texttt{MultiplicityOfNumericalSemigroup}}
\label{MultiplicityOfNumericalSemigroup}
}\hfill{\scriptsize (attribute)}}\\


 \mbox{\texttt{NS}} is a numerical semigroup. Returns the multiplicity of \mbox{\texttt{NS}}, which is the smallest positive integer belonging to \mbox{\texttt{NS}}. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
  gap> S := NumericalSemigroup("modular", 7,53);
  <Modular numerical semigroup satisfying 7x mod 53 <= x >
  gap> MultiplicityOfNumericalSemigroup(S);
  8
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{GeneratorsOfNumericalSemigroup}}
\logpage{[ 3, 1, 2 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{GeneratorsOfNumericalSemigroup( S )\index{GeneratorsOfNumericalSemigroup@\texttt{GeneratorsOfNumericalSemigroup}}
\label{GeneratorsOfNumericalSemigroup}
}\hfill{\scriptsize (function)}}\\
\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{GeneratorsOfNumericalSemigroupNC( S )\index{GeneratorsOfNumericalSemigroupNC@\texttt{GeneratorsOfNumericalSemigroupNC}}
\label{GeneratorsOfNumericalSemigroupNC}
}\hfill{\scriptsize (function)}}\\
\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{MinimalGeneratingSystemOfNumericalSemigroup( S )\index{MinimalGeneratingSystemOfNumericalSemigroup@\texttt{MinimalGeneratingSystemOfNumericalSemigroup}}
\label{MinimalGeneratingSystemOfNumericalSemigroup}
}\hfill{\scriptsize (attribute)}}\\


 \mbox{\texttt{S}} is a numerical semigroup. \texttt{GeneratorsOfNumericalSemigroup} returns a set of generators of \texttt{S}, which may not be minimal. \texttt{GeneratorsOfNumericalSemigroupNC} returns the set of generators recorded in \texttt{S!.generators}, which may not be minimal. \texttt{MinimalGeneratingSystemOfNumericalSemigroup} returns the minimal set of generators of \texttt{S}. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
  gap> S := NumericalSemigroup("modular", 5,53);
  <Modular numerical semigroup satisfying 5x mod 53 <= x >
  gap> GeneratorsOfNumericalSemigroup(S);
  [ 11, 12, 13, 32, 53 ]
  gap> S := NumericalSemigroup(3, 5, 53);
  <Numerical semigroup with 3 generators>
  gap> GeneratorsOfNumericalSemigroup(S);
  [ 3, 5, 53 ]
  gap> MinimalGeneratingSystemOfNumericalSemigroup(S);
  [ 3, 5 ]
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SmallElementsOfNumericalSemigroup}}
\logpage{[ 3, 1, 3 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SmallElementsOfNumericalSemigroup( NS )\index{SmallElementsOfNumericalSemigroup@\texttt{SmallElementsOfNumericalSemigroup}}
\label{SmallElementsOfNumericalSemigroup}
}\hfill{\scriptsize (attribute)}}\\


 \texttt{NS} is a numerical semigroup. It returns the list of small elements of \texttt{NS}. Of course, the time consumed to return a result may depend on the way the
semigroup is given. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
  gap> SmallElementsOfNumericalSemigroup(NumericalSemigroup(3,5,7));
  [ 0, 3, 5 ]
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{AperyListOfNumericalSemigroupWRTElement}}
\logpage{[ 3, 1, 4 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{AperyListOfNumericalSemigroupWRTElement( S, m )\index{AperyListOfNumericalSemigroupWRTElement@\texttt{AperyListOfNumericalSemigroupWRTElement}}
\label{AperyListOfNumericalSemigroupWRTElement}
}\hfill{\scriptsize (operation)}}\\


 \mbox{\texttt{S}} is a numerical semigroup and \mbox{\texttt{m}} is a positive element of \mbox{\texttt{S}}. Computes the Apéry list of \mbox{\texttt{S}} wrt \mbox{\texttt{m}}. It contains for every $i\in \{0,\ldots,\mbox{\texttt{m}}-1\}$, in the $i+1$th position, the smallest element in the semigroup congruent with $i$ modulo \mbox{\texttt{m}}. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
  gap> S := NumericalSemigroup("modular", 5,53);
  <Modular numerical semigroup satisfying 5x mod 53 <= x >
  gap> AperyListOfNumericalSemigroupWRTElement(S,12);
  [ 0, 13, 26, 39, 52, 53, 54, 43, 32, 33, 22, 11 ]
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{DrawAperyListOfNumericalSemigroup}}
\logpage{[ 3, 1, 5 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{DrawAperyListOfNumericalSemigroup( ap )\index{DrawAperyListOfNumericalSemigroup@\texttt{DrawAperyListOfNumericalSemigroup}}
\label{DrawAperyListOfNumericalSemigroup}
}\hfill{\scriptsize (function)}}\\


 \mbox{\texttt{ap}} is the Apéry list of a numerical semigroup. This function draws the graph $(ap, E)$ where the edge $u -> v$ is in $E$ iff $v - u$ is in $ap$. To use this function, \texttt{Graphviz} (\href{http://www.graphviz.org}{\texttt{http://www.graphviz.org}}) should be installed and also \texttt{Evince} (\href{http://www.gnome.org/projects/evince/}{\texttt{http://www.gnome.org/projects/evince/}}) or \texttt{ggv} (\href{http://directory.fsf.org/ggv.html}{\texttt{http://directory.fsf.org/ggv.html}}). }

 

\subsection{\textcolor{Chapter }{AperyListOfNumericalSemigroupAsGraph}}
\logpage{[ 3, 1, 6 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{AperyListOfNumericalSemigroupAsGraph( ap )\index{AperyListOfNumericalSemigroupAsGraph@\texttt{AperyListOfNumericalSemigroupAsGraph}}
\label{AperyListOfNumericalSemigroupAsGraph}
}\hfill{\scriptsize (function)}}\\


 \mbox{\texttt{ap}} is the Apéry list of a numerical semigroup. This function returns the
adjacency list of the graph $(ap, E)$ where the edge $u -> v$ is in $E$ iff $v - u$ is in $ap$. The 0 is ignored. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
  gap> s:=NumericalSemigroup(3,7);
  <Numerical semigroup with 2 generators>
  gap> AperyListOfNumericalSemigroupWRTElement(s,10);
  [ 0, 21, 12, 3, 14, 15, 6, 7, 18, 9 ]
  gap> AperyListOfNumericalSemigroupAsGraph(last);
  [ ,, [ 3, 6, 9, 12, 15, 18, 21 ],,, [ 6, 9, 12, 15, 18, 21 ], 
  [ 7, 14, 21 ],, [ 9, 12, 15, 18, 21 ],,, [ 12, 15, 18, 21 ],, 
  [ 14, 21 ], [ 15, 18, 21 ],,, [ 18, 21 ],,, [ 21 ] ]
\end{Verbatim}
 }

 }

 
\section{\textcolor{Chapter }{Frobenius Number}}\logpage{[ 3, 2, 0 ]}
{
  The largest nonnegative integer not belonging to a numerical semigroup $S$ is the \emph{Frobenius number} of $S$. If $S$ is the set of nonnegative integers, then clearly its Frobenius number is $-1$, otherwise its Frobenius number coincides with the maximum of the gaps (or
fundamental gaps) of $S$. An integer $z$ is a \emph{pseudo-Frobenius number} of $S$ if $z+S\setminus\{0\}\subseteq S$. 

\subsection{\textcolor{Chapter }{FrobeniusNumberOfNumericalSemigroup}}
\logpage{[ 3, 2, 1 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{FrobeniusNumberOfNumericalSemigroup( NS )\index{FrobeniusNumberOfNumericalSemigroup@\texttt{FrobeniusNumberOfNumericalSemigroup}}
\label{FrobeniusNumberOfNumericalSemigroup}
}\hfill{\scriptsize (attribute)}}\\


 \texttt{NS} is a numerical semigroup. It returns the Frobenius number of \texttt{NS}. Of course, the time consumed to return a result may depend on the way the
semigroup is given or on the knowledge already produced on the semigroup. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
  gap> FrobeniusNumberOfNumericalSemigroup(NumericalSemigroup(3,5,7));
  4
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{FrobeniusNumber}}
\logpage{[ 3, 2, 2 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{FrobeniusNumber( NS )\index{FrobeniusNumber@\texttt{FrobeniusNumber}}
\label{FrobeniusNumber}
}\hfill{\scriptsize (attribute)}}\\


 This is just a synonym of \texttt{FrobeniusNumberOfNumericalSemigroup} (\ref{FrobeniusNumberOfNumericalSemigroup}). }

 

\subsection{\textcolor{Chapter }{PseudoFrobeniusOfNumericalSemigroup}}
\logpage{[ 3, 2, 3 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{PseudoFrobeniusOfNumericalSemigroup( S )\index{PseudoFrobeniusOfNumericalSemigroup@\texttt{PseudoFrobeniusOfNumericalSemigroup}}
\label{PseudoFrobeniusOfNumericalSemigroup}
}\hfill{\scriptsize (attribute)}}\\


 \texttt{S} is a numerical semigroup. It returns set of pseudo-Frobenius numbers of \mbox{\texttt{S}}. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
  gap> S := NumericalSemigroup("modular", 5,53);
  <Modular numerical semigroup satisfying 5x mod 53 <= x >
  gap> PseudoFrobeniusOfNumericalSemigroup(S);
  [ 21, 40, 41, 42 ]
\end{Verbatim}
 }

 }

 
\section{\textcolor{Chapter }{Gaps}}\logpage{[ 3, 3, 0 ]}
{
  A \emph{gap} of a numerical semigroup $S$ is a nonnegative integer not belonging to $S$. The \emph{fundamental gaps} of $S$ are those gaps that are maximal with respect to the partial order induced by
division in ${\mathbb N}$. The \emph{special gaps} of a numerical semigroup $S$, are those fundamental gaps such that if they are added to the given
numerical semigroup, then the resulting set is again a numerical semigroup. 

\subsection{\textcolor{Chapter }{GapsOfNumericalSemigroup}}
\logpage{[ 3, 3, 1 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{GapsOfNumericalSemigroup( NS )\index{GapsOfNumericalSemigroup@\texttt{GapsOfNumericalSemigroup}}
\label{GapsOfNumericalSemigroup}
}\hfill{\scriptsize (attribute)}}\\


 \texttt{NS} is a numerical semigroup. It returns the set of gaps of \texttt{NS}. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
  gap> GapsOfNumericalSemigroup(NumericalSemigroup(3,5,7));
  [ 1, 2, 4 ]
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{FundamentalGapsOfNumericalSemigroup}}
\logpage{[ 3, 3, 2 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{FundamentalGapsOfNumericalSemigroup( S )\index{FundamentalGapsOfNumericalSemigroup@\texttt{FundamentalGapsOfNumericalSemigroup}}
\label{FundamentalGapsOfNumericalSemigroup}
}\hfill{\scriptsize (attribute)}}\\


 \texttt{S} is a numerical semigroup. It returns the set of fundamental gaps of \mbox{\texttt{S}}. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
  gap> S := NumericalSemigroup("modular", 5,53);
  <Modular numerical semigroup satisfying 5x mod 53 <= x >
  gap> FundamentalGapsOfNumericalSemigroup(S);
  [ 16, 17, 18, 19, 27, 28, 29, 30, 31, 40, 41, 42 ]
  gap> GapsOfNumericalSemigroup(S);
  [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 14, 15, 16, 17, 18, 19, 20, 21, 27, 28, 29,
    30, 31, 40, 41, 42 ]
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SpecialGapsOfNumericalSemigroup}}
\logpage{[ 3, 3, 3 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SpecialGapsOfNumericalSemigroup( S )\index{SpecialGapsOfNumericalSemigroup@\texttt{SpecialGapsOfNumericalSemigroup}}
\label{SpecialGapsOfNumericalSemigroup}
}\hfill{\scriptsize (attribute)}}\\


 \texttt{S} is a numerical semigroup. It returns the special gaps of \mbox{\texttt{S}}. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
  gap> S := NumericalSemigroup("modular", 5,53);
  <Modular numerical semigroup satisfying 5x mod 53 <= x >
  gap> SpecialGapsOfNumericalSemigroup(S);
  [ 40, 41, 42 ]
\end{Verbatim}
 }

 }

 }

 
\chapter{\textcolor{Chapter }{ Presentations of Numerical Semigroups }}\logpage{[ 4, 0, 0 ]}
{
  In this chapter we explain how to compute a minimal presentation of a
numerical semigroup. There are three functions involved in this process. 
\section{\textcolor{Chapter }{Presentations of Numerical Semigroups}}\logpage{[ 4, 1, 0 ]}
{
  

\subsection{\textcolor{Chapter }{FortenTruncatedNCForNumericalSemigroups}}
\logpage{[ 4, 1, 1 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{FortenTruncatedNCForNumericalSemigroups( L )\index{FortenTruncatedNCForNumericalSemigroups@\texttt{FortenTruncatedNCForNumericalSemigroups}}
\label{FortenTruncatedNCForNumericalSemigroups}
}\hfill{\scriptsize (function)}}\\


 \mbox{\texttt{L}} contains the list of coefficients of a single linear equation. This function
gives a minimal generator of the affine semigroup of nonnegative solutions of
this equation with the first coordinate equal to one (see \cite{MR1283022}). Returns \texttt{fail} if no solution exists. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
  gap> FortenTruncatedNCForNumericalSemigroups([ -57, 3 ]);
  [ 1, 19 ]
  gap> FortenTruncatedNCForNumericalSemigroups([ -57, 33 ]);
  fail
  gap> FortenTruncatedNCForNumericalSemigroups([ -57, 19 ]);
  [ 1, 3 ]
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{MinimalPresentationOfNumericalSemigroup}}
\logpage{[ 4, 1, 2 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{MinimalPresentationOfNumericalSemigroup( S )\index{MinimalPresentationOfNumericalSemigroup@\texttt{MinimalPresentationOfNumericalSemigroup}}
\label{MinimalPresentationOfNumericalSemigroup}
}\hfill{\scriptsize (function)}}\\


 \mbox{\texttt{S}} is a numerical semigroup. The output is a list of lists with two elements.
Each list of two elements represents a relation between the minimal generators
of the numerical semigroup. If $ \{ \{x_1,y_1\},\ldots,\{x_k,y_k\}\} $ is the output and $ \{m_1,\ldots,m_n\} $ is the minimal system of generators of the numerical semigroup, then $ \{x_i,y_i\}=\{\{a_{i_1},\ldots,a_{i_n}\},\{b_{i_1},\ldots,b_{i_n}\}\}$ and $ a_{i_1}m_1+\cdots+a_{i_n}m_n= b_{i_1}m_1+ \cdots +b_{i_n}m_n.$ 

 Any other relation among the minimal generators of the semigroup can be
deduced from the ones given in the output. 

 The algorithm implemented is described in \cite{Ros96} (see also \cite{RGS99}). 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
  gap> s:=NumericalSemigroup(3,5,7);
  <Numerical semigroup with 3 generators>
  gap> MinimalPresentationOfNumericalSemigroup(s);
  [ [ [ 1, 0, 1 ], [ 0, 2, 0 ] ], [ [ 4, 0, 0 ], [ 0, 1, 1 ] ],
    [ [ 3, 1, 0 ], [ 0, 0, 2 ] ] ]
  
                          
\end{Verbatim}
 The first element in the list means that $ 1\times 3+1\times 7=2\times 5 $, and so on. }

 

\subsection{\textcolor{Chapter }{GraphAssociatedToElementInNumericalSemigroup}}
\logpage{[ 4, 1, 3 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{GraphAssociatedToElementInNumericalSemigroup( n, S )\index{GraphAssociatedToElementInNumericalSemigroup@\texttt{GraphAssociatedToElementInNumericalSemigroup}}
\label{GraphAssociatedToElementInNumericalSemigroup}
}\hfill{\scriptsize (function)}}\\


 \mbox{\texttt{S}} is a numerical semigroup and \mbox{\texttt{n}} is an element in \mbox{\texttt{S}}. 

 The output is a pair. If $ \{m_1,\ldots,m_n\} $ is the set of minimal generators of \mbox{\texttt{S}}, then the first component is the set of vertices of the graph associated to \mbox{\texttt{n}} in \mbox{\texttt{S}}, that is, the set $\{ m_i \ |\ n-m_i\in S\} $, and the second component is the set of edges of this graph, that is, $ \{ \{m_i,m_j\} \ |\ n-(m_i+m_j)\in S\}.$ 

 This function is used to compute a minimal presentation of the numerical
semigroup \mbox{\texttt{S}}, as explained in \cite{Ros96}. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
  gap> s:=NumericalSemigroup(3,5,7);
  <Numerical semigroup with 3 generators>
  gap> GraphAssociatedToElementInNumericalSemigroup(10,s);
  [ [ 3, 5, 7 ], [ [ 3, 7 ], [ 5, 5 ], [ 7, 3 ] ] ]
  
                          
\end{Verbatim}
 }

 }

 }

 
\chapter{\textcolor{Chapter }{ Constructing numerical semigroups from others }}\logpage{[ 5, 0, 0 ]}
{
  
\section{\textcolor{Chapter }{ Adding and removing elements of a numerical semigroup }}\logpage{[ 5, 1, 0 ]}
{
  In this section we show how to construct new numerical semigroups from a given
numerical semigroup. Two dual operations are presented. The first one removes
a minimal generator from a numerical semigroup. The second adds a special gap
to a semigroup (see \cite{RGGJ03}). 

\subsection{\textcolor{Chapter }{RemoveMinimalGeneratorFromNumericalSemigroup}}
\logpage{[ 5, 1, 1 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{RemoveMinimalGeneratorFromNumericalSemigroup( n, S )\index{RemoveMinimalGeneratorFromNumericalSemigroup@\texttt{RemoveMinimalGeneratorFromNumericalSemigroup}}
\label{RemoveMinimalGeneratorFromNumericalSemigroup}
}\hfill{\scriptsize (function)}}\\


 \mbox{\texttt{S}} is a numerical semigroup and \mbox{\texttt{n}} is one if its minimal generators. 

 The output is the numerical semigroup $ \mbox{\texttt{S}} \setminus\{\mbox{\texttt{n}}\} $ (see \cite{RGGJ03}; $S\setminus\{n\}$ is a numerical semigroup if and only if $n$ is a minimal generator of $S$). 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
  gap> s:=NumericalSemigroup(3,5,7);
  <Numerical semigroup with 3 generators>
  gap> RemoveMinimalGeneratorFromNumericalSemigroup(7,s);
  <Numerical semigroup with 3 generators>
  gap> MinimalGeneratingSystemOfNumericalSemigroup(last);
  [ 3, 5 ]
  
                          
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{AddSpecialGapOfNumericalSemigroup}}
\logpage{[ 5, 1, 2 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{AddSpecialGapOfNumericalSemigroup( g, S )\index{AddSpecialGapOfNumericalSemigroup@\texttt{AddSpecialGapOfNumericalSemigroup}}
\label{AddSpecialGapOfNumericalSemigroup}
}\hfill{\scriptsize (function)}}\\


 \mbox{\texttt{S}} is a numerical semigroup and \mbox{\texttt{g}} is a special gap of \mbox{\texttt{S}} 

 The output is the numerical semigroup $ \mbox{\texttt{S}} \cup\{\mbox{\texttt{g}}\} $ (see \cite{RGGJ03}, where it is explained why this set is a numerical semigroup). 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
  gap> s:=NumericalSemigroup(3,5,7);
  <Numerical semigroup with 3 generators>
  gap> s2:=RemoveMinimalGeneratorFromNumericalSemigroup(5,s);
  <Numerical semigroup with 3 generators>
  gap> s3:=AddSpecialGapOfNumericalSemigroup(5,s2);
  <Numerical semigroup>
  gap> SmallElementsOfNumericalSemigroup(s) =
  > SmallElementsOfNumericalSemigroup(s3);
  true                
  gap> s=s3;
  true
  
                          
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{IntersectionOfNumericalSemigroups}}
\logpage{[ 5, 1, 3 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{IntersectionOfNumericalSemigroups( S, T )\index{IntersectionOfNumericalSemigroups@\texttt{IntersectionOfNumericalSemigroups}}
\label{IntersectionOfNumericalSemigroups}
}\hfill{\scriptsize (function)}}\\


 \mbox{\texttt{S}} and \mbox{\texttt{T}} are numerical semigroups. Computes the intersection of \mbox{\texttt{S}} and \mbox{\texttt{T}} (which is a numerical semigroup). 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
  gap> S := NumericalSemigroup("modular", 5,53);
  <Modular numerical semigroup satisfying 5x mod 53 <= x >
  gap> T := NumericalSemigroup(2,17);
  <Numerical semigroup with 2 generators>
  gap> SmallElementsOfNumericalSemigroup(S);
  [ 0, 11, 12, 13, 22, 23, 24, 25, 26, 32, 33, 34, 35, 36, 37, 38, 39, 43 ]
  gap> SmallElementsOfNumericalSemigroup(T);
  [ 0, 2, 4, 6, 8, 10, 12, 14, 16 ]
  gap> IntersectionOfNumericalSemigroups(S,T);
  <Numerical semigroup>
  gap> SmallElementsOfNumericalSemigroup(last);
  [ 0, 12, 22, 23, 24, 25, 26, 32, 33, 34, 35, 36, 37, 38, 39, 43 ]
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{QuotientOfNumericalSemigroup}}
\logpage{[ 5, 1, 4 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{QuotientOfNumericalSemigroup( S, n )\index{QuotientOfNumericalSemigroup@\texttt{QuotientOfNumericalSemigroup}}
\label{QuotientOfNumericalSemigroup}
}\hfill{\scriptsize (function)}}\\


 \mbox{\texttt{S}} is a numerical semigroup and \mbox{\texttt{n}} is an integer. Computes the quotient of \mbox{\texttt{S}} by \mbox{\texttt{n}}, that is, the set $\{ x\in {\mathbb N}\ |\ nx \in S\}$, which is again a numerical semigroup. \texttt{S / n} may be used as a short for \texttt{QuotientOfNumericalSemigroup(S, n)}. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
  gap> s:=NumericalSemigroup(3,29);
  <Numerical semigroup with 2 generators>
  gap> SmallElementsOfNumericalSemigroup(s);
  [ 0, 3, 6, 9, 12, 15, 18, 21, 24, 27, 29, 30, 32, 33, 35, 36, 38, 
    39, 41, 42, 44, 45, 47, 48, 50, 51, 53, 54, 56 ]
  gap> t:=QuotientOfNumericalSemigroup(s,7);
  <Numerical semigroup>
  gap> SmallElementsOfNumericalSemigroup(t);
  [ 0, 3, 5, 6, 8 ]
  gap> u := s / 7;
  <Numerical semigroup>
  gap> SmallElementsOfNumericalSemigroup(u);
  [ 0, 3, 5, 6, 8 ]
\end{Verbatim}
 }

 }

 
\section{\textcolor{Chapter }{ Constructing the set of all numerical semigroups containing a given numerical
semigroup }}\logpage{[ 5, 2, 0 ]}
{
  In order to construct the set of numerical semigroups containing a fixed
numerical semigroup $S$, one first constructs its unitary extensions, that is to say, the sets $S\cup\{g\}$ that are numerical semigroups with $g$ a positive integer. This is achieved by constructing the special gaps of the
semigroup, and then adding each of them to the numerical semigroup. Then we
repeat the process for each of this new numerical semigroups until we reach $ {\mathbb N} $. 

 These procedures are described in \cite{RGGJ03}. 

\subsection{\textcolor{Chapter }{OverSemigroupsNumericalSemigroup}}
\logpage{[ 5, 2, 1 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{OverSemigroupsNumericalSemigroup( s )\index{OverSemigroupsNumericalSemigroup@\texttt{OverSemigroupsNumericalSemigroup}}
\label{OverSemigroupsNumericalSemigroup}
}\hfill{\scriptsize (function)}}\\


 \mbox{\texttt{s}} is a numerical semigroup. The output is the set of numerical semigroups
containing it. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
  gap> OverSemigroupsNumericalSemigroup(NumericalSemigroup(3,5,7));
  [ <Numerical semigroup with 1 generators>, <Numerical semigroup>,
    <Numerical semigroup>, <Numerical semigroup with 3 generators> ]
  ]]
  
  gap> List(last,s->MinimalGeneratingSystemOfNumericalSemigroup(s));
  [ [ 1 ], [ 3, 4, 5 ], [ 2, 3 ], [ 3, 5, 7 ] ]
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{NumericalSemigroupsWithFrobeniusNumber}}
\logpage{[ 5, 2, 2 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{NumericalSemigroupsWithFrobeniusNumber( f )\index{NumericalSemigroupsWithFrobeniusNumber@\texttt{NumericalSemigroupsWithFrobeniusNumber}}
\label{NumericalSemigroupsWithFrobeniusNumber}
}\hfill{\scriptsize (function)}}\\


 \mbox{\texttt{f}} is an non zero integer greater than or equal to -1. The output is the set of
numerical semigroups with Frobenius number \mbox{\texttt{f}}. The algorithm implemented is given in \cite{RGGJ04}. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
  gap> Length(NumericalSemigroupsWithFrobeniusNumber(20));
  900
  
                          
\end{Verbatim}
 }

 }

 }

 
\chapter{\textcolor{Chapter }{ Irreducible numerical semigroups }}\logpage{[ 6, 0, 0 ]}
{
  
\section{\textcolor{Chapter }{ Irreducible numerical semigroups }}\logpage{[ 6, 1, 0 ]}
{
  An irreducible numerical semigroup is a semigroup that cannot be expressed as
the intersection of numerical semigroups properly containing it. 

 It is not difficult to prove that a semigroup is irreducible if and only if it
is maximal (with respect to set inclusion) in the set of all numerical
semigroup having its same Frobenius number (see \cite{RB03}). Hence, according to \cite{FGH87} (respectively \cite{BDF97}), symmetric (respectively pseudo-symmetric) numerical semigroups are those
irreducible numerical semigroups with odd (respectively even) Frobenius
number. 

 In \cite{RGGJ03} it is shown that a numerical semigroup is irreducible if and only if it has
only one special gap. We use this characterization. 

 In this section we show how to construct the set of all numerical semigroups
with a given Frobenius number. First we construct an irreducible numerical
semigroup with the given Frobenius number (as explained in \cite{RGS04}), and then we construct the rest from it. That is why we have separated both
functions. 

 Every numerical semigroup can be expressed as an intersection of irreducible
numerical semigroups. If $S$ can be expressed as $S=S_1\cap \cdots\cap S_n$, with $S_i$ irreducible numerical semigroups, and no factor can be removed, then we say
that this decomposition is minimal. Minimal decompositions can be computed by
using Algorithm 26 in \cite{RGGJ03}. 

\subsection{\textcolor{Chapter }{IsIrreducibleNumericalSemigroup}}
\logpage{[ 6, 1, 1 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{IsIrreducibleNumericalSemigroup( s )\index{IsIrreducibleNumericalSemigroup@\texttt{IsIrreducibleNumericalSemigroup}}
\label{IsIrreducibleNumericalSemigroup}
}\hfill{\scriptsize (function)}}\\


 \mbox{\texttt{s}} is a numerical semigroup. The output is true if \mbox{\texttt{s}} is irreducible, false otherwise. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
  gap> IsIrreducibleNumericalSemigroup(NumericalSemigroup(4,6,9));
  true
  gap> IsIrreducibleNumericalSemigroup(NumericalSemigroup(4,6,7,9));
  false
  
                          
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{IsSymmetricNumericalSemigroup}}
\logpage{[ 6, 1, 2 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{IsSymmetricNumericalSemigroup( s )\index{IsSymmetricNumericalSemigroup@\texttt{IsSymmetricNumericalSemigroup}}
\label{IsSymmetricNumericalSemigroup}
}\hfill{\scriptsize (function)}}\\


 \mbox{\texttt{s}} is a numerical semigroup. The output is true if \mbox{\texttt{s}} is symmetric, false otherwise. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
  gap> IsSymmetricNumericalSemigroup(NumericalSemigroup(10,23));      
  true            
  gap> IsSymmetricNumericalSemigroup(NumericalSemigroup(10,11,23));
  false
  
                          
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{IsPseudoSymmetricNumericalSemigroup}}
\logpage{[ 6, 1, 3 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{IsPseudoSymmetricNumericalSemigroup( s )\index{IsPseudoSymmetricNumericalSemigroup@\texttt{IsPseudoSymmetricNumericalSemigroup}}
\label{IsPseudoSymmetricNumericalSemigroup}
}\hfill{\scriptsize (function)}}\\


 \mbox{\texttt{s}} is a numerical semigroup. The output is true if \mbox{\texttt{s}} is pseudo-symmetric, false otherwise. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
  gap> IsPseudoSymmetricNumericalSemigroup(NumericalSemigroup(6,7,8,9,11));
  true
  gap> IsPseudoSymmetricNumericalSemigroup(NumericalSemigroup(4,6,9));
  false
  
                          
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{AnIrreducibleNumericalSemigroupWithFrobeniusNumber}}
\logpage{[ 6, 1, 4 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{AnIrreducibleNumericalSemigroupWithFrobeniusNumber( f )\index{AnIrreducibleNumericalSemigroupWithFrobeniusNumber@\texttt{AnIrreducibleNumericalSemigroupWithFrobeniusNumber}}
\label{AnIrreducibleNumericalSemigroupWithFrobeniusNumber}
}\hfill{\scriptsize (function)}}\\


 \mbox{\texttt{f}} is an integer greater than or equal to -1. The output is an irreducible
numerical semigroup with frobenius number \mbox{\texttt{ f}}. From the way the procedure is implemented, the resulting semigroup has at
most four generators (see \cite{RGS04}). 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
  gap> FrobeniusNumber(AnIrreducibleNumericalSemigroupWithFrobeniusNumber(28));
  28
  
                          
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{IrreducibleNumericalSemigroupsWithFrobeniusNumber}}
\logpage{[ 6, 1, 5 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{IrreducibleNumericalSemigroupsWithFrobeniusNumber( f )\index{IrreducibleNumericalSemigroupsWithFrobeniusNumber@\texttt{IrreducibleNumericalSemigroupsWithFrobeniusNumber}}
\label{IrreducibleNumericalSemigroupsWithFrobeniusNumber}
}\hfill{\scriptsize (function)}}\\


 \mbox{\texttt{f}} is an integer greater than or equal to -1. The output is the set of all
irreducible numerical semigroups with frobenius number \mbox{\texttt{f}}. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
  gap> Length(IrreducibleNumericalSemigroupsWithFrobeniusNumber(39));
  227
  
                          
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{DecomposeIntoIrreducibles}}
\logpage{[ 6, 1, 6 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{DecomposeIntoIrreducibles( s )\index{DecomposeIntoIrreducibles@\texttt{DecomposeIntoIrreducibles}}
\label{DecomposeIntoIrreducibles}
}\hfill{\scriptsize (function)}}\\


 \mbox{\texttt{s}} is a numerical semigroup. The output is a set of irreducible numerical
semigroups containing it. These elements appear in a minimal decomposition of \mbox{\texttt{s}} as intersection into irreducibles. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
  gap> DecomposeIntoIrreducibles(NumericalSemigroup(5,6,8));
  [ <Numerical semigroup>, <Numerical semigroup> ]
  
                          
\end{Verbatim}
 }

 }

 }

 
\chapter{\textcolor{Chapter }{ Ideals of numerical semigroups }}\logpage{[ 7, 0, 0 ]}
{
  
\section{\textcolor{Chapter }{ Ideals of numerical semigroups }}\logpage{[ 7, 1, 0 ]}
{
  Let $S$ be a numerical semigroup. A set $I$ of integers is an \emph{ideal relative} to a numerical semigroup $S$ provided that $I+S\subseteq I$ and that there exists $d\in S$ such that $d+I\subseteq S$. 

 If $\{i_1,\ldots,i_k\}$ is a subset of ${\mathbb Z}$, then the set $I=\{i_1,\ldots,i_k\}+S=\bigcup_{n=1}^k i_n+S$ is an ideal relative to $S$, and $\{i_1,\ldots, 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 \cite{BDF97}). 

\subsection{\textcolor{Chapter }{IdealOfNumericalSemigroup}}
\logpage{[ 7, 1, 1 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{IdealOfNumericalSemigroup( l, S )\index{IdealOfNumericalSemigroup@\texttt{IdealOfNumericalSemigroup}}
\label{IdealOfNumericalSemigroup}
}\hfill{\scriptsize (function)}}\\


 \mbox{\texttt{S}} is a numerical semigroup and \mbox{\texttt{l}} a list of integers. 

 The output is the ideal of \mbox{\texttt{S}} generated by \mbox{\texttt{l}} 

 There are several shortcuts for this function, as shown in the example. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
  gap> IdealOfNumericalSemigroup([3,5],NumericalSemigroup(9,11));
  <Ideal of numerical semigroup>
  gap> [3,5]+NumericalSemigroup(9,11);
  <Ideal of numerical semigroup>
  gap> last=last2;
  true
  gap> 3+NumericalSemigroup(5,9);
  <Ideal of numerical semigroup>
  
                          
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{IsIdealOfNumericalSemigroup}}
\logpage{[ 7, 1, 2 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{IsIdealOfNumericalSemigroup( Obj )\index{IsIdealOfNumericalSemigroup@\texttt{IsIdealOfNumericalSemigroup}}
\label{IsIdealOfNumericalSemigroup}
}\hfill{\scriptsize (function)}}\\


 Tests if the object \mbox{\texttt{Obj}} is an ideal of a numerical semigroup. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
  gap> I:=[1..7]+NumericalSemigroup(7,19);
  <Ideal of numerical semigroup>
  gap> IsIdealOfNumericalSemigroup(I);
  true
  gap> IsIdealOfNumericalSemigroup(2);
  false
  
                          
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{MinimalGeneratingSystemOfIdealOfNumericalSemigroup}}
\logpage{[ 7, 1, 3 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{MinimalGeneratingSystemOfIdealOfNumericalSemigroup( I )\index{MinimalGeneratingSystemOfIdealOfNumericalSemigroup@\texttt{MinimalGeneratingSystemOfIdealOfNumericalSemigroup}}
\label{MinimalGeneratingSystemOfIdealOfNumericalSemigroup}
}\hfill{\scriptsize (function)}}\\


 \mbox{\texttt{I}} is an ideal of a numerical semigroup. 

 The output is the minimal system of generators of \mbox{\texttt{I}}. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
  gap> I:=[3,5,9]+NumericalSemigroup(2,11);
  <Ideal of numerical semigroup>
  gap> MinimalGeneratingSystemOfIdealOfNumericalSemigroup(I);
  [ 3 ]
  
                          
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{GeneratorsOfIdealOfNumericalSemigroup}}
\logpage{[ 7, 1, 4 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{GeneratorsOfIdealOfNumericalSemigroup( I )\index{GeneratorsOfIdealOfNumericalSemigroup@\texttt{GeneratorsOfIdealOfNumericalSemigroup}}
\label{GeneratorsOfIdealOfNumericalSemigroup}
}\hfill{\scriptsize (function)}}\\
\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{GeneratorsOfIdealOfNumericalSemigroupNC( I )\index{GeneratorsOfIdealOfNumericalSemigroupNC@\texttt{GeneratorsOfIdealOfNumericalSemigroupNC}}
\label{GeneratorsOfIdealOfNumericalSemigroupNC}
}\hfill{\scriptsize (function)}}\\


 \mbox{\texttt{I}} is an ideal of a numerical semigroup. 

 The output of \texttt{GeneratorsOfIdealOfNumericalSemigroup} is a system of generators of the ideal. If the minimal system of generators is
known, then it is used as output. \texttt{GeneratorsOfIdealOfNumericalSemigroupNC} always returns the set of generators stored in \mbox{\texttt{I!.generators}}. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
  gap> I:=[3,5,9]+NumericalSemigroup(2,11);
  <Ideal of numerical semigroup>
  gap> GeneratorsOfIdealOfNumericalSemigroup(I);
  [ 3, 5, 9 ]
  gap> MinimalGeneratingSystemOfIdealOfNumericalSemigroup(I);
  [ 3 ]
  gap> GeneratorsOfIdealOfNumericalSemigroup(I);
  [ 3 ]
  gap> GeneratorsOfIdealOfNumericalSemigroupNC(I);
  [ 3, 5, 9 ]
  
                          
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{AmbientNumericalSemigroupOfIdeal}}
\logpage{[ 7, 1, 5 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{AmbientNumericalSemigroupOfIdeal( I )\index{AmbientNumericalSemigroupOfIdeal@\texttt{AmbientNumericalSemigroupOfIdeal}}
\label{AmbientNumericalSemigroupOfIdeal}
}\hfill{\scriptsize (function)}}\\


 \mbox{\texttt{I}} is an ideal of a numerical semigroup, say $S$. 

 The output is $S$. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
  gap> I:=[3,5,9]+NumericalSemigroup(2,11);
  <Ideal of numerical semigroup>
  gap> AmbientNumericalSemigroupOfIdeal(I);
  <Numerical semigroup with 2 generators>
  
                          
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SmallElementsOfIdealOfNumericalSemigroup}}
\logpage{[ 7, 1, 6 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SmallElementsOfIdealOfNumericalSemigroup( I )\index{SmallElementsOfIdealOfNumericalSemigroup@\texttt{SmallElementsOfIdealOfNumericalSemigroup}}
\label{SmallElementsOfIdealOfNumericalSemigroup}
}\hfill{\scriptsize (function)}}\\


 \mbox{\texttt{I}} is an ideal of a numerical semigroup. 

 The output is a list with the elements in \mbox{\texttt{I}} that are less than or equal to the greatest integer not belonging to the ideal
plus one. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
  gap> I:=[3,5,9]+NumericalSemigroup(2,11);
  <Ideal of numerical semigroup>
  gap> SmallElementsOfIdealOfNumericalSemigroup(I);
  [ 3, 5, 7, 9, 11, 13 ]
  gap> J:=[2,11]+NumericalSemigroup(2,11);
  <Ideal of numerical semigroup>
  gap> SmallElementsOfIdealOfNumericalSemigroup(J);
  [ 2, 4, 6, 8, 10 ]
  
                          
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{BelongsToIdealOfNumericalSemigroup}}
\logpage{[ 7, 1, 7 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{BelongsToIdealOfNumericalSemigroup( n, I )\index{BelongsToIdealOfNumericalSemigroup@\texttt{BelongsToIdealOfNumericalSemigroup}}
\label{BelongsToIdealOfNumericalSemigroup}
}\hfill{\scriptsize (function)}}\\


 \mbox{\texttt{I}} is an ideal of a numerical semigroup, \mbox{\texttt{n}} is an integer. 

 The output is true if \mbox{\texttt{n}} belongs to \mbox{\texttt{I}}. 

 \mbox{\texttt{ n in I}} can be used for short. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
  gap> J:=[2,11]+NumericalSemigroup(2,11);
  <Ideal of numerical semigroup>
  gap> BelongsToIdealOfNumericalSemigroup(9,J);
  false
  gap> 9 in J;
  false
  gap> BelongsToIdealOfNumericalSemigroup(10,J);
  true
  gap> 10 in J;
  true
  
                          
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SumIdealsOfNumericalSemigroup}}
\logpage{[ 7, 1, 8 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SumIdealsOfNumericalSemigroup( I, J )\index{SumIdealsOfNumericalSemigroup@\texttt{SumIdealsOfNumericalSemigroup}}
\label{SumIdealsOfNumericalSemigroup}
}\hfill{\scriptsize (function)}}\\


 \mbox{\texttt{I, J}} are ideals of a numerical semigroup. 

 The output is the sum of both ideals $\{ i+j \ |\ i\in \mbox{\texttt{I}}, j\in \mbox{\texttt{J}}\}$. 

 \mbox{\texttt{I + J}} is a synonym of this function. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
  gap> I:=[3,5,9]+NumericalSemigroup(2,11);
  <Ideal of numerical semigroup>
  gap> J:=[2,11]+NumericalSemigroup(2,11);
  <Ideal of numerical semigroup>
  gap> I+J;
  <Ideal of numerical semigroup>
  gap> MinimalGeneratingSystemOfIdealOfNumericalSemigroup(last);
  [ 5, 14 ]
  gap> SumIdealsOfNumericalSemigroup(I,J);
  <Ideal of numerical semigroup>
  gap> MinimalGeneratingSystemOfIdealOfNumericalSemigroup(last);
  [ 5, 14 ]
  
                          
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{MultipleOfIdealOfNumericalSemigroup}}
\logpage{[ 7, 1, 9 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{MultipleOfIdealOfNumericalSemigroup( n, I )\index{MultipleOfIdealOfNumericalSemigroup@\texttt{MultipleOfIdealOfNumericalSemigroup}}
\label{MultipleOfIdealOfNumericalSemigroup}
}\hfill{\scriptsize (function)}}\\


 \mbox{\texttt{I}} is an ideal of a numerical semigroup, \mbox{\texttt{n}} is a non negative integer. 

 The output is the ideal $\mbox{\texttt{I}}+\cdots+\mbox{\texttt{I}}$ (\mbox{\texttt{n}} times). 

 \mbox{\texttt{ n * I}} can be used for short. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
  gap> I:=[0,1]+NumericalSemigroup(3,5,7);
  <Ideal of numerical semigroup>
  gap> MinimalGeneratingSystemOfIdealOfNumericalSemigroup(2*I);
  [ 0, 1, 2 ]
  
                          
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SubtractIdealsOfNumericalSemigroup}}
\logpage{[ 7, 1, 10 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SubtractIdealsOfNumericalSemigroup( I, J )\index{SubtractIdealsOfNumericalSemigroup@\texttt{SubtractIdealsOfNumericalSemigroup}}
\label{SubtractIdealsOfNumericalSemigroup}
}\hfill{\scriptsize (function)}}\\


 \mbox{\texttt{I, J}} are ideals of a numerical semigroup. 

 The output is the ideal $\{ z\in {\mathbb Z}\ |\ z+\mbox{\texttt{J}}\subseteq \mbox{\texttt{I}}\}$. 

 \mbox{\texttt{I - J}} is a synonym of this function. The following example appears in \cite{HS04}. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
  gap> S:=NumericalSemigroup(14, 15, 20, 21, 25);
  <Numerical semigroup with 5 generators>
  gap> I:=[0,1]+S;
  <Ideal of numerical semigroup>
  gap> II:=(0+S)-I;
  <Ideal of numerical semigroup>
  gap> MinimalGeneratingSystemOfIdealOfNumericalSemigroup(I);
  [ 0, 1 ]
  gap> MinimalGeneratingSystemOfIdealOfNumericalSemigroup(II);
  [ 14, 20 ]
  gap> MinimalGeneratingSystemOfIdealOfNumericalSemigroup(I+II);
  [ 14, 15, 20, 21 ]
  
                          
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{DifferenceOfIdealsOfNumericalSemigroup}}
\logpage{[ 7, 1, 11 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{DifferenceOfIdealsOfNumericalSemigroup( I, J )\index{DifferenceOfIdealsOfNumericalSemigroup@\texttt{DifferenceOfIdealsOfNumericalSemigroup}}
\label{DifferenceOfIdealsOfNumericalSemigroup}
}\hfill{\scriptsize (function)}}\\


 \mbox{\texttt{I, J}} are ideals of a numerical semigroup. \mbox{\texttt{J}} must be contained in \mbox{\texttt{I}}. 

 The output is the set $\mbox{\texttt{I}}\setminus \mbox{\texttt{J}}$. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
  gap> S:=NumericalSemigroup(14, 15, 20, 21, 25);
  <Numerical semigroup with 5 generators>
  gap> I:=[0,1]+S;
  <Ideal of numerical semigroup>
  gap> 2*I-2*I;
  <Ideal of numerical semigroup>
  gap> I-I;
  <Ideal of numerical semigroup>
  gap> DifferenceOfIdealsOfNumericalSemigroup(last2,last);
  [ 26, 27, 37, 38 ]
  
                          
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{HilbertFunctionOfIdealOfNumericalSemigroup}}
\logpage{[ 7, 1, 12 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{HilbertFunctionOfIdealOfNumericalSemigroup( n, I )\index{HilbertFunctionOfIdealOfNumericalSemigroup@\texttt{HilbertFunctionOfIdealOfNumericalSemigroup}}
\label{HilbertFunctionOfIdealOfNumericalSemigroup}
}\hfill{\scriptsize (function)}}\\


 \mbox{\texttt{I}} is an ideal of a numerical semigroup, \mbox{\texttt{n}} is a non negative integer. \mbox{\texttt{I}} must be contained in its ambient semigroup. 

 The output is the cardinality of the set $\mbox{\texttt{n}}\mbox{\texttt{I}}\setminus (\mbox{\texttt{n}}+1)\mbox{\texttt{I}}$. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
  gap> I:=[6,9,11]+NumericalSemigroup(6,9,11);;
  gap> List([1..7],n->HilbertFunctionOfIdealOfNumericalSemigroup(n,I));
  [ 3, 11, 24, 48, 96, 192, 384 ]
  
                          
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{BlowUpIdealOfNumericalSemigroup}}
\logpage{[ 7, 1, 13 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{BlowUpIdealOfNumericalSemigroup( I )\index{BlowUpIdealOfNumericalSemigroup@\texttt{BlowUpIdealOfNumericalSemigroup}}
\label{BlowUpIdealOfNumericalSemigroup}
}\hfill{\scriptsize (function)}}\\


 \mbox{\texttt{I}} is an ideal of a numerical semigroup. 

 The output is the ideal $\bigcup_{n\geq 0} n\mbox{\texttt{I}}-n\mbox{\texttt{I}}$. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
  gap> I:=[0,2]+NumericalSemigroup(6,9,11);;
  gap> BlowUpIdealOfNumericalSemigroup(I);;
  gap> SmallElementsOfIdealOfNumericalSemigroup(last);
  [ 0, 2, 4, 6, 8 ]
  
                          
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{MaximalIdealOfNumericalSemigroup}}
\logpage{[ 7, 1, 14 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{MaximalIdealOfNumericalSemigroup( S )\index{MaximalIdealOfNumericalSemigroup@\texttt{MaximalIdealOfNumericalSemigroup}}
\label{MaximalIdealOfNumericalSemigroup}
}\hfill{\scriptsize (function)}}\\


 Returns the maximal ideal of the numerical semigroup \mbox{\texttt{S}}. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
  gap> MaximalIdealOfNumericalSemigroup(NumericalSemigroup(3,7));
  <Ideal of numerical semigroup>
  
                          
\end{Verbatim}
 }

 }

 }

 
\chapter{\textcolor{Chapter }{ Numerical semigroups with maximal embedding dimension }}\logpage{[ 8, 0, 0 ]}
{
  
\section{\textcolor{Chapter }{ Numerical semigroups with maximal embedding dimension }}\logpage{[ 8, 1, 0 ]}
{
  If $S$ is a numerical semigroup and $m$ is its multiplicity (the least positive integer belonging to it), then the
embedding dimension $e$ of $S$ (the cardinality of the minimal system of generators of $S$) is less than or equal to $m$. We say that $S$ has maximal embedding dimension (MED for short) when $e=m$. The intersection of two numerical semigroups with the same multiplicity and
maximal embedding dimension is again of maximal embedding dimension. Thus we
define the MED closure of a non-empty subset of positive integers $M=\{m < m_1 < \cdots < m_n <\cdots\}$ with $\gcd(M)=1$ as the intersection of all MED numerical semigroups with multiplicity $m$. 

 Given a MED numerical semigroup $S$, we say that $M=\{m_1 < \cdots< m_k\}$ is a MED system of generators if the MED closure of $M$ is $S$. Moreover, $M$ is a minimal MED generating system for $S$ provided that every proper subset of $M$ is not a MED system of generators of $S$. Minimal MED generating systems are unique, and in general are smaller that
the classical minimal generating systems (see \cite{RGGB03}). 

\subsection{\textcolor{Chapter }{IsMEDNumericalSemigroup}}
\logpage{[ 8, 1, 1 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{IsMEDNumericalSemigroup( S )\index{IsMEDNumericalSemigroup@\texttt{IsMEDNumericalSemigroup}}
\label{IsMEDNumericalSemigroup}
}\hfill{\scriptsize (function)}}\\


 \mbox{\texttt{S}} is a numerical semigroup. 

 Returns true if \mbox{\texttt{S}} is a MED numerical semigroup and false otherwise. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
  gap> IsMEDNumericalSemigroup(NumericalSemigroup(3,5,7)); 
  true 
  gap> IsMEDNumericalSemigroup(NumericalSemigroup(3,5)); 
  false
  
                          
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{MEDNumericalSemigroupClosure}}
\logpage{[ 8, 1, 2 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{MEDNumericalSemigroupClosure( S )\index{MEDNumericalSemigroupClosure@\texttt{MEDNumericalSemigroupClosure}}
\label{MEDNumericalSemigroupClosure}
}\hfill{\scriptsize (function)}}\\


 \mbox{\texttt{S}} is a numerical semigroup. 

 Returns the MED closure of \mbox{\texttt{S}}. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
  gap> MEDNumericalSemigroupClosure(NumericalSemigroup(3,5)); 
  <Numerical semigroup> 
  gap> MinimalGeneratingSystemOfNumericalSemigroup(last); 
  [ 3, 5, 7 ]
  
                          
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{MinimalMEDGeneratingSystemOfMEDNumericalSemigroup}}
\logpage{[ 8, 1, 3 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{MinimalMEDGeneratingSystemOfMEDNumericalSemigroup( S )\index{MinimalMEDGeneratingSystemOfMEDNumericalSemigroup@\texttt{MinimalMEDGeneratingSystemOfMEDNumericalSemigroup}}
\label{MinimalMEDGeneratingSystemOfMEDNumericalSemigroup}
}\hfill{\scriptsize (function)}}\\


 \mbox{\texttt{S}} is a MED numerical semigroup. 

 Returns the minimal MED generating system of \mbox{\texttt{S}}. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
  gap> MinimalMEDGeneratingSystemOfMEDNumericalSemigroup( 
  > NumericalSemigroup(3,5,7)); 
  [ 3, 5 ]
  
                          
\end{Verbatim}
 }

 }

 
\section{\textcolor{Chapter }{ Numerical semigroups with the Arf property and Arf closures }}\logpage{[ 8, 2, 0 ]}
{
  Numerical semigroups with the Arf property are a special kind of numerical
semigroups with maximal embedding dimension. A numerical semigroup $S$ is Arf if for every $x,y,z$ in $S$ with $x\geq y\geq z$, one has that $x+y-z\in S$. 

 The intersection of two Arf numerical semigroups is again Arf, and thus we can
consider the Arf closure of a set of nonnegative integers with greatest common
divisor equal to one. Analogously as with MED numerical semigroups, we define
Arf systems of generators and minimal Arf generating system for an Arf
numerical semigroup. These are also unique(see \cite{RGGB04}). 

\subsection{\textcolor{Chapter }{IsArfNumericalSemigroup}}
\logpage{[ 8, 2, 1 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{IsArfNumericalSemigroup( S )\index{IsArfNumericalSemigroup@\texttt{IsArfNumericalSemigroup}}
\label{IsArfNumericalSemigroup}
}\hfill{\scriptsize (function)}}\\


 \mbox{\texttt{S}} is a numerical semigroup. 

 Returns true if \mbox{\texttt{S}} is an Arf numerical semigroup and false otherwise. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
  gap>  IsArfNumericalSemigroup(NumericalSemigroup(3,5,7)); 
  true 
  gap>  IsArfNumericalSemigroup(NumericalSemigroup(3,7,11)); 
  false 
  gap> IsMEDNumericalSemigroup(NumericalSemigroup(3,7,11)); 
  true
  
                          
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{ArfNumericalSemigroupClosure}}
\logpage{[ 8, 2, 2 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{ArfNumericalSemigroupClosure( S )\index{ArfNumericalSemigroupClosure@\texttt{ArfNumericalSemigroupClosure}}
\label{ArfNumericalSemigroupClosure}
}\hfill{\scriptsize (function)}}\\


 \mbox{\texttt{S}} is a numerical semigroup. 

 Returns the Arf closure of \mbox{\texttt{S}}. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
  gap> ArfNumericalSemigroupClosure(NumericalSemigroup(3,7,11)); 
  <Numerical semigroup> 
  gap> MinimalGeneratingSystemOfNumericalSemigroup(last); 
  [ 3, 7, 8 ]
  
                          
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{MinimalArfGeneratingSystemOfArfNumericalSemigroup}}
\logpage{[ 8, 2, 3 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{MinimalArfGeneratingSystemOfArfNumericalSemigroup( S )\index{MinimalArfGeneratingSystemOfArfNumericalSemigroup@\texttt{MinimalArfGeneratingSystemOfArfNumericalSemigroup}}
\label{MinimalArfGeneratingSystemOfArfNumericalSemigroup}
}\hfill{\scriptsize (function)}}\\


 \mbox{\texttt{S}} is an Arf numerical semigroup. 

 Returns the minimal MED generating system of \mbox{\texttt{S}}. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
  gap> MinimalArfGeneratingSystemOfArfNumericalSemigroup( 
  > NumericalSemigroup(3,7,8)); 
  [ 3, 7 ]
  
                          
\end{Verbatim}
 }

 }

 }

 

\appendix


\chapter{\textcolor{Chapter }{Generalities}}\logpage{[ "A", 0, 0 ]}
{
 Here we describe some functions which are not specific for numerical
semigroups but are used to do computations with them. As they may have
interest by themselves, we decribe them here. 
\section{\textcolor{Chapter }{Bézout sequences}}\logpage{[ "A", 1, 0 ]}
{
 A sequence of positive rational numbers $ a_1/b_1 < \cdots < a_n/b_n$ with $a_i,b_i$ positive integers is a \emph{Bézout sequence} if $ a_{i+1}b_i - a_i b_{i+1}=1$ for all $i\in \{1,\ldots,n-1\}$. 

 The following function uses an algorithm presented in \cite{Ros05}. 

\subsection{\textcolor{Chapter }{BezoutSequence}}
\logpage{[ "A", 1, 1 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{BezoutSequence( arg )\index{BezoutSequence@\texttt{BezoutSequence}}
\label{BezoutSequence}
}\hfill{\scriptsize (function)}}\\


 \mbox{\texttt{arg}} consits of two rational numbers or a list of two rational numbers. The output
is a Bézout sequence with ends the two rational numbers given. (Warning:
rational numbers are silently transformed into irreducible fractions.) 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
  gap> BezoutSequence(4/5,53/27);
  [ 4/5, 1, 3/2, 5/3, 7/4, 9/5, 11/6, 13/7, 15/8, 17/9, 19/10, 21/11, 23/12,
    25/13, 27/14, 29/15, 31/16, 33/17, 35/18, 37/19, 39/20, 41/21, 43/22,
    45/23, 47/24, 49/25, 51/26, 53/27 ]
  
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{IsBezoutSequence}}
\logpage{[ "A", 1, 2 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{IsBezoutSequence( L )\index{IsBezoutSequence@\texttt{IsBezoutSequence}}
\label{IsBezoutSequence}
}\hfill{\scriptsize (function)}}\\


 \mbox{\texttt{L}} is a list of rational numbers. \texttt{IsBezoutSequence} returns \texttt{true} or \texttt{false} according to whether \mbox{\texttt{L}} is a Bézout sequence or not. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
  gap> IsBezoutSequence([ 4/5, 1, 3/2, 5/3, 7/4, 9/5, 11/6]);
  true
  gap> IsBezoutSequence([ 4/5, 1, 3/2, 5/3, 7/4, 9/5, 11/3]);
  Take the 6 and the 7 elements of the sequence
  false
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{CeilingOfRational}}
\logpage{[ "A", 1, 3 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{CeilingOfRational( r )\index{CeilingOfRational@\texttt{CeilingOfRational}}
\label{CeilingOfRational}
}\hfill{\scriptsize (function)}}\\


 Returns the smallest integer greater than or equal to the rational \mbox{\texttt{r}}. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
  gap> CeilingOfRational(3/5);
  1
\end{Verbatim}
 }

 }

 
\section{\textcolor{Chapter }{Periodic subadditive functions}}\logpage{[ "A", 2, 0 ]}
{
 A periodic function $f$ of period $m$ from the set $ {\mathbb N} $ of natural numbers into itself may be specified through a list of $m$ natural numbers. The function $f$ is said to be \emph{subadditive} if $f(i+j)\leq f(i)+f(j)$ and $f(0)=0$. 

\subsection{\textcolor{Chapter }{RepresentsPeriodicSubAdditiveFunction}}
\logpage{[ "A", 2, 1 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{RepresentsPeriodicSubAdditiveFunction( L )\index{RepresentsPeriodicSubAdditiveFunction@\texttt{RepresentsPeriodicSubAdditiveFunction}}
\label{RepresentsPeriodicSubAdditiveFunction}
}\hfill{\scriptsize (function)}}\\


 \mbox{\texttt{L}} is a list of integers. \texttt{RepresentsPeriodicSubAdditiveFunction} returns \texttt{true} or \texttt{false} according to whether \mbox{\texttt{L}} represents a periodic subAdditive function $f$ periodic of period $m$ or not. To avoid defining $f(0)$ (which we assume to be 0) we define $f(m)=0$ and so the last element of the list must be 0. This technical need is due to
the fact that positions in a list must be positive (not a 0). 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
  gap> RepresentsPeriodicSubAdditiveFunction([1,2,3,4,0]);
  true
\end{Verbatim}
 }

 }

 }


\chapter{\textcolor{Chapter }{Random functions}}\logpage{[ "B", 0, 0 ]}
{
 Here we describe some functions which allow to create several "random"
objects. 
\section{\textcolor{Chapter }{Random functions}}\logpage{[ "B", 1, 0 ]}
{
 

\subsection{\textcolor{Chapter }{RandomNumericalSemigroup}}
\logpage{[ "B", 1, 1 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{RandomNumericalSemigroup( n, m )\index{RandomNumericalSemigroup@\texttt{RandomNumericalSemigroup}}
\label{RandomNumericalSemigroup}
}\hfill{\scriptsize (attribute)}}\\


 Returns a ``random" numerical semigroup with no more than \mbox{\texttt{n}} generators in [1..\mbox{\texttt{m}}]. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
  gap> RandomNumericalSemigroup(3,9);
  <Numerical semigroup with 3 generators>
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{RandomListForNS}}
\logpage{[ "B", 1, 2 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{RandomListForNS( n, m )\index{RandomListForNS@\texttt{RandomListForNS}}
\label{RandomListForNS}
}\hfill{\scriptsize (attribute)}}\\


 Returns a set of length not greater than \mbox{\texttt{n}} of random integers in \mbox{\texttt{[1..m]}} whose GCD is 1. It is used to create "random" numerical semigroups. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
  gap> RandomListForNS(13,79);
  [ 22, 26, 29, 31, 34, 46, 53, 61, 62, 73, 76 ]
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{RandomModularNumericalSemigroup}}
\logpage{[ "B", 1, 3 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{RandomModularNumericalSemigroup( k )\index{RandomModularNumericalSemigroup@\texttt{RandomModularNumericalSemigroup}}
\label{RandomModularNumericalSemigroup}
}\hfill{\scriptsize (attribute)}}\\


 Returns a ``random" modular numerical semigroup. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
  gap> RandomModularNumericalSemigroup(9);
  <Modular numerical semigroup satisfying 5x mod 6 <= x >
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{RandomProportionallyModularNumericalSemigroup}}
\logpage{[ "B", 1, 4 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{RandomProportionallyModularNumericalSemigroup( k )\index{RandomProportionallyModularNumericalSemigroup@\texttt{RandomProportionallyModularNumericalSemigroup}}
\label{RandomProportionallyModularNumericalSemigroup}
}\hfill{\scriptsize (attribute)}}\\


 Returns a ``random" proportionally modular numerical semigroup (see \ref{llab1}). 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
  gap> RandomProportionallyModularNumericalSemigroup(9);
  <Proportionally modular numerical semigroup satisfying 2x mod 3 <= 2x >
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{RandomListRepresentingSubAdditiveFunction}}
\logpage{[ "B", 1, 5 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{RandomListRepresentingSubAdditiveFunction( m, a )\index{RandomListRepresentingSubAdditiveFunction@\texttt{RandomListRepresentingSubAdditiveFunction}}
\label{RandomListRepresentingSubAdditiveFunction}
}\hfill{\scriptsize (attribute)}}\\


 Produces a ``random" list representing a subadditive function (see \ref{llab2}) which is periodic with period \mbox{\texttt{m}} (or less). When possible, the images are in \mbox{\texttt{[a..20*a]}}. (Otherwise, the list of possible images is enlarged.) 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
  gap> RandomListRepresentingSubAdditiveFunction(7,9);
  [ 173, 114, 67, 0 ]
  gap> RepresentsPeriodicSubAdditiveFunction(last);
  true
\end{Verbatim}
 }

 }

 }

\def\bibname{References\logpage{[ "Bib", 0, 0 ]}}

\bibliographystyle{alpha}
\bibliography{NumericalSgpsMan}

\def\indexname{Index\logpage{[ "Ind", 0, 0 ]}}


\printindex

\newpage
\immediate\write\pagenrlog{["End"], \arabic{page}];}
\immediate\closeout\pagenrlog
\end{document}
