% 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{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},
        pdfcreator={LaTeX with hyperref package / 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{\textsf{ResClasses}}}\\[1cm]
\hypersetup{pdftitle=\textsf{ResClasses}}
\markright{\scriptsize \mbox{}\hfill \textsf{ResClasses} \hfill\mbox{}}
{\Large \textbf{ Set-Theoretic Computations with Residue Classes }}\\[1cm]
{ Version 2.3.3 }\\[1cm]
{August 11, 2006}\\[1cm]
\mbox{}\\[2cm]
{\large \textbf{ Stefan Kohl    }}\\
\hypersetup{pdfauthor= Stefan Kohl    }
\end{center}\vfill

\mbox{}\\
{\mbox{}\\
\small \noindent \textbf{ Stefan Kohl    } --- Email: \href{mailto://kohl@mathematik.uni-stuttgart.de}{\texttt{kohl@mathematik.uni-stuttgart.de}}\\
 --- Homepage: \href{http://www.cip.mathematik.uni-stuttgart.de/~kohlsn}{\texttt{http://www.cip.mathematik.uni-stuttgart.de/\~{}kohlsn}}\\
 --- Address: \begin{minipage}[t]{8cm}\noindent
 Institut für Geometrie und Topologie \\
 Universität Stuttgart \\
 70550 Stuttgart \\
 Germany \end{minipage}
}\\
\end{titlepage}

\newpage\setcounter{page}{2}
{\small 
\section*{Abstract}
\logpage{[ 0, 0, 2 ]}
 \textsf{ResClasses} is a package for \textsf{GAP} 4 which implements set-theoretic unions of residue classes of the ring of
integers, of its semilocalisations and of univariate polynomial rings over
finite fields as \textsf{GAP} domains. 

 It provides basic functionality for computing with these sets, like forming
intersections, unions and differences. It supports these operations also in
the case that one of the operands is a finite set of ring elements. The
package further implements the mentioned semilocalisations $\Z_{(\pi)}$ of~$\Z$ as \textsf{GAP} domains. }\\[1cm]
{\small 
\section*{Copyright}
\logpage{[ 0, 0, 1 ]}
 {\copyright} 2003 - 2006 by Stefan Kohl 

 This package is distributed under the GNU General Public License. }\\[1cm]
\newpage

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

\tableofcontents
\newpage

        
\chapter{\textcolor{Chapter }{Preface}}\label{ch:preface}
\logpage{[ 1, 0, 0 ]}
{
  This package provides an easy-to-use implementation of residue classes as sets
which permits to form unions, intersections and differences and which
interacts smoothly with finite sets of ring elements w.r.t. these operations.
The functionality of this package is used in a group theoretical context by
the \textsf{RCWA} package written by the same author. 

 The implementation of unions of residue classes with fixed representatives
follows a suggestion by Wolfgang~Rump.  }

         
\chapter{\textcolor{Chapter }{Unions of Residue Classes}}\label{ch:UnionsOfResidueClasses}
\logpage{[ 2, 0, 0 ]}
{
   
\section{\textcolor{Chapter }{Entering residue classes and unions thereof}}\label{sec:DefiningUnionsOfResidueClasses}
\logpage{[ 2, 1, 0 ]}
{
  

\subsection{\textcolor{Chapter }{ResidueClass (R, m, r)}}
\logpage{[ 2, 1, 1 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{ResidueClass( R, m, r )\index{ResidueClass@\texttt{ResidueClass}!R, m, r}
\label{ResidueClass:R, m, r}
}\hfill{\scriptsize (function)}}\\
\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{ResidueClass( m, r )\index{ResidueClass@\texttt{ResidueClass}!m, r}
\label{ResidueClass:m, r}
}\hfill{\scriptsize (function)}}\\
\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{ResidueClass( r, m )\index{ResidueClass@\texttt{ResidueClass}!r, m}
\label{ResidueClass:r, m}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
 In the three-argument form the residue class \mbox{\texttt{r}}~mod~\mbox{\texttt{m}} of the ring~\mbox{\texttt{R}}, and in the two-argument form the residue class \mbox{\texttt{r}}~mod~\mbox{\texttt{m}} of the integers. 



 In the two-argument case, \mbox{\texttt{r}} and \mbox{\texttt{m}} must not be negative, and \mbox{\texttt{r}} is assumed to lie in the range \texttt{[0..\mbox{\texttt{m}}-1]}. The latter is used to decide which of the two arguments is the modulus~\mbox{\texttt{m}} and which is the residue~\mbox{\texttt{r}}. For convenience, in the two-argument case it is permitted to enclose the
argument list in list brackets. 

 \index{IsResidueClass@\texttt{IsResidueClass}!U} \index{Modulus@\texttt{Modulus}!cl} \index{Residue@\texttt{Residue}!cl} Residue classes have the property \texttt{IsResidueClass}. Rings are regarded as residue class 0~(mod~1), and therefore have this property. There are operations \texttt{Modulus} and \texttt{Residue} to retrieve the modulus~\mbox{\texttt{m}} resp. residue~\mbox{\texttt{r}} of a residue class. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
  
  gap> ResidueClass(2,3);
  The residue class 2(3) of Z
  gap> ResidueClass(Z_pi([2,5]),2,1);
  The residue class 1(2) of Z_( 2, 5 )
  gap> R := PolynomialRing(GF(2),1);;
  gap> x := Indeterminate(GF(2),1);; SetName(x,"x");
  gap> ResidueClass(R,x+One(R),Zero(R));
  The residue class 0*Z(2) ( mod x+Z(2)^0 ) of GF(2)[x]
  
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{ResidueClassUnion (R, m, r)}}
\logpage{[ 2, 1, 2 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{ResidueClassUnion( R, m, r )\index{ResidueClassUnion@\texttt{ResidueClassUnion}!R, m, r}
\label{ResidueClassUnion:R, m, r}
}\hfill{\scriptsize (function)}}\\
\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{ResidueClassUnion( R, m, r, included, excluded )\index{ResidueClassUnion@\texttt{ResidueClassUnion}!R, m, r, included, excluded}
\label{ResidueClassUnion:R, m, r, included, excluded}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
 The union of the residue classes \mbox{\texttt{r}}[$i$]~mod~\mbox{\texttt{m}} of the ring~\mbox{\texttt{R}}, plus / minus finite sets \mbox{\texttt{included}} and \mbox{\texttt{excluded}} of elements of~\mbox{\texttt{R}}. 



 \pagebreak[4] 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
  
  gap> ResidueClassUnion(Integers,6,[2,4]);
  Union of the residue classes 2(6) and 4(6) of Z
  gap> ResidueClassUnion(Integers,5,[1,2],[3,8],[-4,1]);
  (Union of the residue classes 1(5) and 2(5) of Z) U [ 3, 8 ] \ [ -4, 1 ]
  gap> ResidueClassUnion(Z_pi([2,3]),8,[3,5]);
  <union of 2 residue classes (mod 8) of Z_( 2, 3 )>
  gap> ResidueClassUnion(R,x^2,[One(R),x],[Zero(R)],[One(R)]);
  <union of 2 residue classes (mod x^2) of GF(2)[x]> U [ 0*Z(2) ] \ [ Z(2)^0 ]
  
\end{Verbatim}
 }

 \index{Modulus@\texttt{Modulus}!U} \index{Residues@\texttt{Residues}!U} \index{IncludedElements@\texttt{IncludedElements}!U} \index{ExcludedElements@\texttt{ExcludedElements}!U} For extracting the components of a residue class union as passed as arguments
to \texttt{ResidueClassUnion} (\ref{ResidueClassUnion:R, m, r}), there are operations \texttt{Modulus}, \texttt{Residues}, \texttt{IncludedElements} and \texttt{ExcludedElements}. 

 \index{ResidueClassUnionViewingFormat@\texttt{ResidueClassUnionViewingFormat}!format} The user has the choice between a longer and more descriptive and a shorter
and less bulky output format for residue classes and unions thereof: 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
  
  gap> ResidueClassUnionViewingFormat("short");
  gap> ResidueClassUnion(Integers,12,[0,1,4,7,8]);  
  0(4) U 1(6)
  gap> ResidueClassUnionViewingFormat("long");    
  gap> ResidueClassUnion(Integers,12,[0,1,4,7,8]);
  Union of the residue classes 0(4) and 1(6) of Z
  
\end{Verbatim}
 

\subsection{\textcolor{Chapter }{AllResidueClassesModulo (R, m)}}
\logpage{[ 2, 1, 3 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{AllResidueClassesModulo( R, m )\index{AllResidueClassesModulo@\texttt{AllResidueClassesModulo}!R, m}
\label{AllResidueClassesModulo:R, m}
}\hfill{\scriptsize (function)}}\\
\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{AllResidueClassesModulo( m )\index{AllResidueClassesModulo@\texttt{AllResidueClassesModulo}!m}
\label{AllResidueClassesModulo:m}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
 A sorted list of all residue classes (mod~\mbox{\texttt{m}}) of the ring~\mbox{\texttt{R}}. 



 If the argument \mbox{\texttt{R}} is omitted it defaults to the default ring of \mbox{\texttt{m}} -- cp. the documentation of \texttt{DefaultRing} in the \textsf{GAP} reference manual. \index{AllResidues@\texttt{AllResidues}!R, m} A transversal for the residue classes (mod~\mbox{\texttt{m}}) can be obtained by the function \texttt{AllResidues(\mbox{\texttt{R}},\mbox{\texttt{m}})}. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
  
  gap> AllResidueClassesModulo(Integers,2);
  [ The residue class 0(2) of Z, The residue class 1(2) of Z ]
  gap> AllResidueClassesModulo(Z_pi(2),2);
  [ The residue class 0(2) of Z_( 2 ), The residue class 1(2) of Z_( 2 ) ]
  gap> AllResidueClassesModulo(R,x);
  [ The residue class 0*Z(2) ( mod x ) of GF(2)[x], 
    The residue class Z(2)^0 ( mod x ) of GF(2)[x] ]
  gap> AllResidues(Integers,6); 
  [ 0 .. 5 ]
  gap> AllResidues(Z_pi(2),100);
  [ 0 .. 3 ]
  gap> AllResidues(R,x^3);  
  [ 0*Z(2), Z(2)^0, x, x+Z(2)^0, x^2, x^2+Z(2)^0, x^2+x, x^2+x+Z(2)^0 ]
  
\end{Verbatim}
 }

 }

  
\section{\textcolor{Chapter }{Methods for unions of residue classes}}\label{sec:MethodsForResidueClassUnions}
\logpage{[ 2, 2, 0 ]}
{
  \index{Print@\texttt{Print}!U} \index{String@\texttt{String}!U} \index{Display@\texttt{Display}!U} There are methods for \texttt{Print}, \texttt{String} and \texttt{Display} which are applicable to unions of residue classes. There is a method for \texttt{in} which tests whether some ring element lies in a given union of residue
classes. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
  
  gap> Print(ResidueClass(1,2),"\n");
  ResidueClassUnion( Integers, 2, [ 1 ] )
  gap> 1 in ResidueClass(1,2);
  true
  
\end{Verbatim}
 \index{Union@\texttt{Union}!U1, U2} \index{Intersection@\texttt{Intersection}!U1, U2} \index{Difference@\texttt{Difference}!U1, U2} \index{IsSubset@\texttt{IsSubset}!U1, U2} There are methods for \texttt{Union}, \texttt{Intersection}, \texttt{Difference} and \texttt{IsSubset} available for unions of residue classes. They also accept finite subsets of
the base ring as arguments. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
  
  gap> S := Union(ResidueClass(0,2),ResidueClass(0,3));         
  Z \ Union of the residue classes 1(6) and 5(6) of Z
  gap> Intersection(S,ResidueClass(0,7));
  Union of the residue classes 0(14) and 21(42) of Z
  gap> Difference(S,ResidueClass(2,4));
  Union of the residue classes 0(4) and 3(6) of Z
  gap> IsSubset(ResidueClass(0,2),ResidueClass(4,8));
  true
  gap> Union(S,[1..10]);
  (Union of the residue classes 0(2) and 3(6) of Z) U [ 1, 5, 7 ]
  gap> Intersection(S,[1..10]);
  [ 2, 3, 4, 6, 8, 9, 10 ]
  gap> Difference(S,[1..10]);
  (Union of the residue classes 0(2) and 3(6) of Z) \ [ 2, 3, 4, 6, 8, 9, 10 ]
  gap> Difference(Integers,[1..10]);
  Z \ <set of cardinality 10>
  gap> IsSubset(S,[1..10]);
  false
  
\end{Verbatim}
 If the underlying ring has a residue class ring of a given cardinality~$t$, then a residue class can be written as a disjoint union of $t$ residue classes with equal moduli: 

\subsection{\textcolor{Chapter }{SplittedClass (cl, t)}}
\logpage{[ 2, 2, 1 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SplittedClass( cl, t )\index{SplittedClass@\texttt{SplittedClass}!cl, t}
\label{SplittedClass:cl, t}
}\hfill{\scriptsize (operation)}}\\
\textbf{\indent Returns:\ }
 A partition of the residue class \mbox{\texttt{cl}} into \mbox{\texttt{t}} residue classes with equal moduli, provided that such a partition exists.
Otherwise \texttt{fail}. 



 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
  
  gap> SplittedClass(ResidueClass(1,2),2);
  [ The residue class 1(4) of Z, The residue class 3(4) of Z ]
  gap> SplittedClass(ResidueClass(Z_pi(3),3,0),2);
  fail
  
\end{Verbatim}
 }

 Often one needs a partition of a given union of residue classes into ``few'' residue classes. Ensuring to get always a partition of minimal possible length
seems to be algorithmically difficult. The following operation finds usually ``reasonably short'' partitions: 

\subsection{\textcolor{Chapter }{AsUnionOfFewClasses (U)}}
\logpage{[ 2, 2, 2 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{AsUnionOfFewClasses( U )\index{AsUnionOfFewClasses@\texttt{AsUnionOfFewClasses}!U}
\label{AsUnionOfFewClasses:U}
}\hfill{\scriptsize (operation)}}\\
\textbf{\indent Returns:\ }
 A set of disjoint residue classes whose union is \mbox{\texttt{U}}. 



 As the name of the operation suggests, it is taken care that the number of
residue classes in the returned list is kept ``reasonably small''. It is not necessarily minimal. No care is taken of \texttt{IncludedElements} and \texttt{ExcludedElements}. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
  
  gap> AsUnionOfFewClasses(Difference(Integers,ResidueClass(0,12)));
  [ The residue class 1(2) of Z, The residue class 2(4) of Z, 
    The residue class 4(12) of Z, The residue class 8(12) of Z ]
  
\end{Verbatim}
 }

 One can compute the sets of sums, differences, products and quotients of the
elements of a union of residue classes and an element of the base ring: 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
  
  gap> ResidueClass(0,2) + 1;
  The residue class 1(2) of Z
  gap> ResidueClass(0,2) - 2 = ResidueClass(0,2); 
  true
  gap> 3 * ResidueClass(0,2);
  The residue class 0(6) of Z
  gap> ResidueClass(0,2)/2;
  Integers
  
\end{Verbatim}
 The \emph{natural density} of a residue class $r(m)$ of a ring~$R$ is defined by $1/|R/mR|$, and the \emph{natural density} of a union~$U$ of finitely many residue classes is defined by the sum of the densities of the
elements of a partition of~$U$ into finitely many residue classes: 

\subsection{\textcolor{Chapter }{Density (U)}}
\logpage{[ 2, 2, 3 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{Density( U )\index{Density@\texttt{Density}!U}
\label{Density:U}
}\hfill{\scriptsize (operation)}}\\
\textbf{\indent Returns:\ }
 The natural density of~\mbox{\texttt{U}} as a subset of the underlying ring. 



 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
  
  gap> Density(ResidueClass(0,2));
  1/2
  gap> Density(Difference(Integers,ResidueClass(0,5)));
  4/5
  
\end{Verbatim}
 }

 \index{Iterator@\texttt{Iterator}!U} \index{NextIterator@\texttt{NextIterator}!iter} For looping over unions of residue classes of the integers, there are methods
for the operations \texttt{Iterator} and \texttt{NextIterator}. }

  
\section{\textcolor{Chapter }{The categories and families of unions of residue classes}}\label{sec:CategoriesOfUnionsOfResidueClasses}
\logpage{[ 2, 3, 0 ]}
{
  

\subsection{\textcolor{Chapter }{IsUnionOfResidueClasses (U)}}
\logpage{[ 2, 3, 1 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{IsUnionOfResidueClasses( U )\index{IsUnionOfResidueClasses@\texttt{IsUnionOfResidueClasses}!U}
\label{IsUnionOfResidueClasses:U}
}\hfill{\scriptsize (filter)}}\\
\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{IsUnionOfResidueClassesOfZ( U )\index{IsUnionOfResidueClassesOfZ@\texttt{IsUnionOfResidueClassesOfZ}!U}
\label{IsUnionOfResidueClassesOfZ:U}
}\hfill{\scriptsize (filter)}}\\
\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{IsUnionOfResidueClassesOfZ{\_}pi( U )\index{IsUnionOfResidueClassesOfZpi@\texttt{IsUnionOfResidueClassesOfZ{\_}pi}!U}
\label{IsUnionOfResidueClassesOfZpi:U}
}\hfill{\scriptsize (filter)}}\\
\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{IsUnionOfResidueClassesOfGFqx( U )\index{IsUnionOfResidueClassesOfGFqx@\texttt{IsUnionOfResidueClassesOfGFqx}!U}
\label{IsUnionOfResidueClassesOfGFqx:U}
}\hfill{\scriptsize (filter)}}\\
\textbf{\indent Returns:\ }
 \texttt{true} if \mbox{\texttt{U}} is a union of residue classes resp. a union of residue classes of the ring of
integers resp. a union of residue classes of a semilocalization of the ring of
integers resp. a union of residue classes of a polynomial ring in one variable
over a finite field, and \texttt{false} otherwise. 



 Often the same methods can be used for residue classes of the ring of integers
and of its semilocalizations. For this reason there is a category \texttt{IsUnionOfResidueClassesOfZOrZ{\textunderscore}pi} which is the union of \texttt{IsUnionOfResidueClassesOfZ} and \texttt{IsUnionOfResidueClassesOfZ{\textunderscore}pi}. \index{IsUnionOfResidueClassesOfZOrZ_pi@\texttt{IsUnionOfResidueClassesOfZOrZ{\textunderscore}pi}!U} The internal representation of unions of residue classes is called \texttt{IsResidueClassUnionSparseRep}. \index{IsResidueClassUnionSparseRep@\texttt{IsResidueClassUnionSparseRep}} }

 

\subsection{\textcolor{Chapter }{ResidueClassUnionsFamily (R)}}
\logpage{[ 2, 3, 2 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{ResidueClassUnionsFamily( R )\index{ResidueClassUnionsFamily@\texttt{ResidueClassUnionsFamily}!R}
\label{ResidueClassUnionsFamily:R}
}\hfill{\scriptsize (function)}}\\
\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{ResidueClassUnionsFamily( R, fixedreps )\index{ResidueClassUnionsFamily@\texttt{ResidueClassUnionsFamily}!R, fixedreps}
\label{ResidueClassUnionsFamily:R, fixedreps}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
 The family of unions of residue classes resp. the family of unions of residue
classes with fixed representatives of the ring~\mbox{\texttt{R}}, depending on whether \mbox{\texttt{fixedreps}} is present and \texttt{true}. 



 The ring \mbox{\texttt{R}} can be retrieved as \texttt{UnderlyingRing(ResidueClassUnionsFamily(\mbox{\texttt{R}}))}. Unions of residue classes with fixed representatives are described in the
next chapter. }

 }

  }

         
\chapter{\textcolor{Chapter }{Unions of Residue Classes with Fixed Representatives}}\label{ch:UnionsOfResidueClassesWithFixedReps}
\logpage{[ 3, 0, 0 ]}
{
  \textsf{ResClasses} supports computations with unions of residue classes which are endowed with
distinguished (``fixed'') representatives. These unions of residue classes can be viewed as multisets
of ring elements. The residue classes forming such a union do not need to be
disjoint or even only distinct.  
\section{\textcolor{Chapter }{ Entering unions of residue classes with fixed representatives }}\label{sec:DefiningUnionsOfResidueClassesWithFixedReps}
\logpage{[ 3, 1, 0 ]}
{
  

\subsection{\textcolor{Chapter }{ResidueClassWithFixedRep (R, m, r)}}
\logpage{[ 3, 1, 1 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{ResidueClassWithFixedRep( R, m, r )\index{ResidueClassWithFixedRep@\texttt{ResidueClassWithFixedRep}!R, m, r}
\label{ResidueClassWithFixedRep:R, m, r}
}\hfill{\scriptsize (function)}}\\
\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{ResidueClassWithFixedRep( m, r )\index{ResidueClassWithFixedRep@\texttt{ResidueClassWithFixedRep}!m, r}
\label{ResidueClassWithFixedRep:m, r}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
 The residue class \mbox{\texttt{r}}~mod~\mbox{\texttt{m}} of the ring~\mbox{\texttt{R}}, with the fixed representative~\mbox{\texttt{r}}. 



 If the argument \mbox{\texttt{R}} is omitted, it defaults to \texttt{Integers}. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
  
  gap> ResidueClassWithFixedRep(Integers,2,1);
  [1/2]
  
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{ResidueClassUnionWithFixedReps (R, classes)}}
\logpage{[ 3, 1, 2 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{ResidueClassUnionWithFixedReps( R, classes )\index{ResidueClassUnionWithFixedReps@\texttt{ResidueClassUnionWithFixedReps}!R, classes}
\label{ResidueClassUnionWithFixedReps:R, classes}
}\hfill{\scriptsize (function)}}\\
\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{ResidueClassUnionWithFixedReps( classes )\index{ResidueClassUnionWithFixedReps@\texttt{ResidueClassUnionWithFixedReps}!classes}
\label{ResidueClassUnionWithFixedReps:classes}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
 The union of the residue classes \mbox{\texttt{classes}}[$i$][2] mod \mbox{\texttt{classes}}[$i$][1] of the ring \mbox{\texttt{R}}, with fixed representatives \mbox{\texttt{classes}}[$i$][2]. 



 The argument \mbox{\texttt{classes}} must be a list of pairs of elements of the ring \mbox{\texttt{R}}. Their first entries -- the moduli -- must be nonzero. If the argument \mbox{\texttt{R}} is omitted, it defaults to \texttt{Integers}. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
  
  gap> ResidueClassUnionWithFixedReps(Integers,[[2,4],[3,9]]);
  [4/2] U [9/3]
  
\end{Verbatim}
 }

 \index{Modulus@\texttt{Modulus}!U} \index{Classes@\texttt{Classes}!U} \index{AsListOfClasses@\texttt{AsListOfClasses}!U} There is a method for the operation \texttt{Modulus} which returns the lcm of the moduli of the residue classes forming such a
union. Further there is an operation \texttt{Classes} for retrieving the list of classes which has been passed as an argument to \texttt{ResidueClassUnionWithFixedReps}. The operation \texttt{AsListOfClasses} does the same except that the returned list contains residue classes instead
of pairs \texttt{[\mbox{\texttt{modulus}},\mbox{\texttt{residue}}]}. There are methods for \texttt{Print}, \texttt{String} and \texttt{Display} available for unions of residue classes with fixed representatives. 

\subsection{\textcolor{Chapter }{AllResidueClassesWithFixedRepsModulo (R, m)}}
\logpage{[ 3, 1, 3 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{AllResidueClassesWithFixedRepsModulo( R, m )\index{AllResidueClassesWithFixedRepsModulo@\texttt{AllResidueClassesWithFixedRepsModulo}!R, m}
\label{AllResidueClassesWithFixedRepsModulo:R, m}
}\hfill{\scriptsize (function)}}\\
\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{AllResidueClassesWithFixedRepsModulo( m )\index{AllResidueClassesWithFixedRepsModulo@\texttt{AllResidueClassesWithFixedRepsModulo}!m}
\label{AllResidueClassesWithFixedRepsModulo:m}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
 A sorted list of all residue classes (mod~\mbox{\texttt{m}}) of the ring~\mbox{\texttt{R}}, with fixed representatives. 



 If the argument \mbox{\texttt{R}} is omitted it defaults to the default ring of~\mbox{\texttt{m}}, cp. the documentation of \texttt{DefaultRing} in the \textsf{GAP} reference manual. The representatives are the same as those chosen by the
operation \texttt{mod}. See also \texttt{AllResidueClassesModulo} (\ref{AllResidueClassesModulo:R, m}). 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
  
  gap> AllResidueClassesWithFixedRepsModulo(Z_pi(2),4);
  [ [0/4], [1/4], [2/4], [3/4] ]
  gap> AllResidueClassesWithFixedRepsModulo(9);
  [ [0/9], [1/9], [2/9], [3/9], [4/9], [5/9], [6/9], [7/9], [8/9] ]
  
\end{Verbatim}
 }

 }

  
\section{\textcolor{Chapter }{ Methods for unions of residue classes with fixed representatives }}\label{sec:MethodsForResidueClassUnions}
\logpage{[ 3, 2, 0 ]}
{
  Throughout this chapter, the argument \mbox{\texttt{R}} denotes the underlying ring, and the arguments \mbox{\texttt{U}}, \mbox{\texttt{U1}} and~\mbox{\texttt{U2}} denote unions of residue classes of \mbox{\texttt{R}} with fixed representatives. 

 Unions of residue classes with fixed representatives are multisets. Elements
and residue classes can be contained with multiplicities: 

\subsection{\textcolor{Chapter }{Multiplicity (x, U)}}
\logpage{[ 3, 2, 1 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{Multiplicity( x, U )\index{Multiplicity@\texttt{Multiplicity}!x, U}
\label{Multiplicity:x, U}
}\hfill{\scriptsize (method)}}\\
\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{Multiplicity( cl, U )\index{Multiplicity@\texttt{Multiplicity}!cl, U}
\label{Multiplicity:cl, U}
}\hfill{\scriptsize (method)}}\\
\textbf{\indent Returns:\ }
 The multiplicity of \mbox{\texttt{x}} in~\mbox{\texttt{U}} regarded as a multiset of ring elements, resp. the multiplicity of the residue
class \mbox{\texttt{cl}} in~\mbox{\texttt{U}} regarded as a multiset of residue classes. 



 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
  
  gap> U := ResidueClassUnionWithFixedReps(Integers,[[2,0],[3,0]]);
  [0/2] U [0/3]
  gap> List([0..23],n->Multiplicity(n,U));
  [ 2, 0, 1, 1, 1, 0, 2, 0, 1, 1, 1, 0, 2, 0, 1, 1, 1, 0, 2, 0, 1, 1, 1, 0 ]
  gap> Multiplicity(ResidueClassWithFixedRep(2,0),U);
  1
  
\end{Verbatim}
 }

 \index{Density@\texttt{Density}!U} \index{IsOverlappingFree@\texttt{IsOverlappingFree}!U} \index{AsOrdinaryUnionOfResidueClasses@\texttt{AsOrdinaryUnionOfResidueClasses}!U} Let \texttt{U} be a union of residue classes with fixed representatives. The multiset \texttt{U} can have an attribute \texttt{Density} which denotes its \emph{natural density} as a multiset, i.e. elements with multiplicity~$k$ count $k$-fold. The multiset \texttt{U} has the property \texttt{IsOverlappingFree} if it consists of pairwise disjoint residue classes. The set-theoretic union
of the residue classes forming \texttt{U} can be determined by the operation \texttt{AsOrdinaryUnionOfResidueClasses}. The object returned by this operation is an ``ordinary'' residue class union as described in Chapter~\ref{ch:UnionsOfResidueClasses}. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
  
  gap> U := ResidueClassUnionWithFixedReps(Integers,[[2,0],[3,0]]);
  [0/2] U [0/3]
  gap> Density(U);
  5/6
  gap> IsOverlappingFree(U);
  false
  gap> AsOrdinaryUnionOfResidueClasses(U);
  Z \ Union of the residue classes 1(6) and 5(6) of Z
  gap> Density(last);
  2/3
  
\end{Verbatim}
 In the sequel we abbreviate the term ``the multiset of ring elements endowed with the structure of a union of residue
classes with fixed representatives'' by ``the multiset''. 

 There are methods for \texttt{+} and \texttt{-} available for computing the multiset of sums $u + x$, $u \in U$, the multiset of differences $u - x$ resp. $x - u$, $u \in U$ and the multiset of the additive inverses of the elements of~$U$. Further there are methods for \texttt{*} and \texttt{/} available for computing the multiset of products $x \cdot u$, $u \in U$ and the multiset of quotients $u/x$, $u \in U$. The division method requires all elements of~\texttt{U} to be divisible by~$x$. If the underlying ring is the ring of integers, scalar multiplication and
division leave $\delta$ invariant ($\rightarrow$~\texttt{Delta} (\ref{Delta:U})). 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
  
  gap> U := ResidueClassUnionWithFixedReps(Integers,[[2,0],[3,0]]);
  [0/2] U [0/3]
  gap> U + 7;
  [7/2] U [7/3]
  gap> U - 7; 7 - U; -U;
  [-7/2] U [-7/3]
  [7/-3] U [7/-2]
  [0/-3] U [0/-2]
  gap> V := 2 * U;
  [0/4] U [0/6]
  gap> V/2;
  [0/2] U [0/3]
  
\end{Verbatim}
 \pagebreak[4] 

\subsection{\textcolor{Chapter }{Union (U1, U2)}}
\logpage{[ 3, 2, 2 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{Union( U1, U2 )\index{Union@\texttt{Union}!U1, U2}
\label{Union:U1, U2}
}\hfill{\scriptsize (method)}}\\
\textbf{\indent Returns:\ }
 The union of \mbox{\texttt{U1}} and~\mbox{\texttt{U2}}. 



 The multiplicity of any ring element resp. residue class in the union is the
sum of its multiplicities in the arguments. It holds \texttt{Delta(Union(\mbox{\texttt{U1}},\mbox{\texttt{U2}})) = Delta(\mbox{\texttt{U1}}) + Delta(\mbox{\texttt{U2}})}. ($\rightarrow$~\texttt{Delta} (\ref{Delta:U})). 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
  
  gap> U := ResidueClassUnionWithFixedReps(Integers,[[2,0],[3,0]]);
  [0/2] U [0/3]
  gap> Union(U,U);                                      
  [0/2] U [0/2] U [0/3] U [0/3]
  
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{Intersection (U1, U2)}}
\logpage{[ 3, 2, 3 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{Intersection( U1, U2 )\index{Intersection@\texttt{Intersection}!U1, U2}
\label{Intersection:U1, U2}
}\hfill{\scriptsize (method)}}\\
\textbf{\indent Returns:\ }
 The intersection of \mbox{\texttt{U1}} and~\mbox{\texttt{U2}}. 



 The multiplicity of any residue class in the intersection is the minimum of
its multiplicities in the arguments. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
  
  gap> U := ResidueClassUnionWithFixedReps(Integers,[[2,0],[3,0]]);
  [0/2] U [0/3]
  gap> Intersection(U,ResidueClassWithFixedRep(2,0));
  [0/2]
  gap> Intersection(U,ResidueClassWithFixedRep(6,0));
  Empty union of residue classes of Z with fixed representatives
  
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{Difference (U1, U2)}}
\logpage{[ 3, 2, 4 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{Difference( U1, U2 )\index{Difference@\texttt{Difference}!U1, U2}
\label{Difference:U1, U2}
}\hfill{\scriptsize (method)}}\\
\textbf{\indent Returns:\ }
 The difference of \mbox{\texttt{U1}} and~\mbox{\texttt{U2}}. 



 The multiplicity of any residue class in the difference is its multiplicity in~\mbox{\texttt{U1}} minus its multiplicity in~\mbox{\texttt{U2}}, if this value is nonnegative. The difference of the empty residue class
union with fixed representatives and some residue class $[r/m]$ is set equal to $[(m-r)/m]$. It holds \texttt{Delta(Difference(\mbox{\texttt{U1}},\mbox{\texttt{U2}})) = Delta(\mbox{\texttt{U1}}) - Delta(\mbox{\texttt{U2}})}. ($\rightarrow$~\texttt{Delta} (\ref{Delta:U})). 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
  
  gap> U := ResidueClassUnionWithFixedReps(Integers,[[2,0],[3,0]]);
  [0/2] U [0/3]
  gap> V := ResidueClassUnionWithFixedReps(Integers,[[3,0],[5,2]]);
  [0/3] U [2/5]
  gap> Difference(U,V);
  [0/2] U [3/5]
  
\end{Verbatim}
 }

 }

  
\section{\textcolor{Chapter }{ The invariant Delta }}\label{sec:DeltaAndRho}
\logpage{[ 3, 3, 0 ]}
{
  

\subsection{\textcolor{Chapter }{Delta (U)}}
\logpage{[ 3, 3, 1 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{Delta( U )\index{Delta@\texttt{Delta}!U}
\label{Delta:U}
}\hfill{\scriptsize (attribute)}}\\
\textbf{\indent Returns:\ }
 The value of the invariant $\delta$ of the residue class union~\mbox{\texttt{U}}. 



 For a residue class $[r/m]$ with fixed representative we set $\delta([r/m]) := r/m - 1/2$ and extend this definition additively to unions of such residue classes. If no
representatives are fixed, this definition is still unique (mod~1). There is a related invariant~$\rho$ which is defined by $e^{\pi i \delta(U)}$. The corresponding attribute is called \texttt{Rho}. \index{Rho@\texttt{Rho}!U} 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
  
  gap> U := ResidueClassUnionWithFixedReps(Integers,[[2,3],[3,4]]);
  [3/2] U [4/3]
  gap> Delta(U) = (3/2-1/2) + (4/3-1/2);
  true
  gap> V := RepresentativeStabilizingRefinement(U,3);
  [3/6] U [5/6] U [7/6] U [4/9] U [7/9] U [10/9]
  gap> Delta(V) = Delta(U);
  true
  gap> Rho(V);
  E(12)^11
  
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{RepresentativeStabilizingRefinement (U, k)}}
\logpage{[ 3, 3, 2 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{RepresentativeStabilizingRefinement( U, k )\index{RepresentativeStabilizingRefinement@\texttt{RepresentativeStabilizingRefinement}!U, k}
\label{RepresentativeStabilizingRefinement:U, k}
}\hfill{\scriptsize (method)}}\\
\textbf{\indent Returns:\ }
 The representative stabilizing refinement of \mbox{\texttt{U}} into $k$~parts. 



 The \emph{representative stabilizing refinement} of a residue class $[r/m]$ of $\Z$ into $k$ parts is defined by $[r/km] \cup [(r+m)/km] \cup \dots \cup [(r+(k-1)m)/km]$. This definition is extended in the obvious way to unions of residue classes. 

 If the argument \mbox{\texttt{k}} is zero, the method performs a simplification of \mbox{\texttt{U}} by joining appropriate residue classes, if this is possible. 

 In any case the value of \texttt{Delta(\mbox{\texttt{U}})} is invariant under this operation ($\rightarrow$~\texttt{Delta} (\ref{Delta:U})). 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
  
  gap> U := ResidueClassUnionWithFixedReps(Integers,[[2,0],[3,0]]);
  [0/2] U [0/3]
  gap> RepresentativeStabilizingRefinement(U,4);   
  [0/8] U [2/8] U [4/8] U [6/8] U [0/12] U [3/12] U [6/12] U [9/12]
  gap> RepresentativeStabilizingRefinement(last,0);
  [0/2] U [0/3]
  
\end{Verbatim}
 }

 }

  
\section{\textcolor{Chapter }{ The categories of unions of residue classes with fixed rep's }}\label{sec:CategoriesOfUnionsOfResidueClassesWithFixedReps}
\logpage{[ 3, 4, 0 ]}
{
  The names of the categories of unions of residue classes with fixed
representatives are derived from the names of those of the ``ordinary'' unions of residue classes given in Section~\ref{sec:CategoriesOfUnionsOfResidueClasses} by appending \texttt{WithFixedRepresentatives}. }

  }

         
\chapter{\textcolor{Chapter }{Semilocalizations of the Integers}}\label{ch:Z_pi}
\logpage{[ 4, 0, 0 ]}
{
  In this package, the semilocalizations $\Z_{(\pi)}$ of the ring of integers are used as base rings for unions of residue classes.  
\section{\textcolor{Chapter }{Entering semilocalizations of the integers}}\label{sec:DefiningZ_pi}
\logpage{[ 4, 1, 0 ]}
{
  

\subsection{\textcolor{Chapter }{Z{\_}pi (pi)}}
\logpage{[ 4, 1, 1 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{Z{\_}pi( pi )\index{Zpi@\texttt{Z{\_}pi}!pi}
\label{Zpi:pi}
}\hfill{\scriptsize (function)}}\\
\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{Z{\_}pi( p )\index{Zpi@\texttt{Z{\_}pi}!p}
\label{Zpi:p}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
 The ring $\Z_{(\pi)}$ resp. the ring $\Z_{(p)}$. 



 The returned ring has the property \texttt{IsZ{\textunderscore}pi}. The set \mbox{\texttt{pi}} of noninvertible primes can be retrieved by the operation \texttt{NoninvertiblePrimes}. \index{IsZ_pi@\texttt{IsZ{\textunderscore}pi}!R} \index{NoninvertiblePrimes@\texttt{NoninvertiblePrimes}!R} 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
  
  gap> R := Z_pi(2);
  Z_( 2 )
  gap> S := Z_pi([2,5,7]);
  Z_( 2, 5, 7 )
  
\end{Verbatim}
 }

 }

  
\section{\textcolor{Chapter }{Methods for semilocalizations of the integers}}\label{sec:MethodsForZ_pi}
\logpage{[ 4, 2, 0 ]}
{
  \index{StandardAssociate@\texttt{StandardAssociate}!R, x} \index{Gcd@\texttt{Gcd}!R, x, y} \index{Lcm@\texttt{Lcm}!R, x, y} \index{Factors@\texttt{Factors}!R, x} \index{IsUnit@\texttt{IsUnit}!R, x} There are methods for the operations \texttt{in}, \texttt{Intersection}, \texttt{IsSubset}, \texttt{StandardAssociate}, \texttt{Gcd}, \texttt{Lcm}, \texttt{Factors} and \texttt{IsUnit} available for semilocalizations of the integers. For the documentation of
these operations, see the \textsf{GAP} reference manual. The standard associate of an element of a ring $\Z_{(\pi)}$ is defined by the product of the noninvertible prime factors of its numerator. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
  
  gap> 4/7 in R; 3/2 in R;
  true
  false
  gap> Intersection(R,Z_pi([3,11])); IsSubset(R,S);
  Z_( 2, 3, 11 )
  true
  
\end{Verbatim}
 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
  
  gap> StandardAssociate(R,-6/7);
  2
  gap> Gcd(S,90/3,60/17,120/33);
  10
  gap> Lcm(S,90/3,60/17,120/33);
  40
  gap> Factors(R,840);
  [ 105, 2, 2, 2 ]
  gap> Factors(R,-2/3);
  [ -1/3, 2 ]
  gap> IsUnit(S,3/11);
  true
  
\end{Verbatim}
  }

  }

         
\chapter{\textcolor{Chapter }{Installation and auxiliary functions}}\label{ch:InstallationAndAuxiliaryFunctions}
\logpage{[ 5, 0, 0 ]}
{
   
\section{\textcolor{Chapter }{Requirements}}\label{sec:Requirements}
\logpage{[ 5, 1, 0 ]}
{
  The \textsf{ResClasses} package needs at least \textsf{GAP}~4.4.7 and \textsf{GAPDoc}~0.999~\cite{GAPDoc}. It can be used under UNIX, under Windows and on the MacIntosh. \textsf{ResClasses} is completely written in the \textsf{GAP} language and does neither contain nor require external binaries. }

  
\section{\textcolor{Chapter }{Installation}}\label{sec:Installation}
\logpage{[ 5, 2, 0 ]}
{
  Like any other \textsf{GAP} package, \textsf{ResClasses} must be installed in the \texttt{pkg} subdirectory of the \textsf{GAP} distribution. This is accomplished by extracting the distribution file in this
directory. By default, the package \textsf{ResClasses} is autoloaded. If you have switched autoloading of packages off, you can load \textsf{ResClasses} via \texttt{LoadPackage( "resclasses" );}. }

  
\section{\textcolor{Chapter }{The testing routine}}\label{sec:TheTestingRoutine}
\logpage{[ 5, 3, 0 ]}
{
  

\subsection{\textcolor{Chapter }{ResClassesTest}}
\logpage{[ 5, 3, 1 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{ResClassesTest(  )\index{ResClassesTest@\texttt{ResClassesTest}}
\label{ResClassesTest}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
 Nothing. 



 Performs tests of the \textsf{ResClasses} package. Errors, i.e. differences to the correct results of the test
computations, are reported. The processed test files are in the directory \texttt{pkg/resclasses/tst}. }

 }

  
\section{\textcolor{Chapter }{Building the manual}}\label{sec:BuildingTheManual}
\logpage{[ 5, 4, 0 ]}
{
  

\subsection{\textcolor{Chapter }{ResClassesBuildManual}}
\logpage{[ 5, 4, 1 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{ResClassesBuildManual(  )\index{ResClassesBuildManual@\texttt{ResClassesBuildManual}}
\label{ResClassesBuildManual}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
 Nothing. 



 This function is a development tool which builds the manual of the \textsf{ResClasses} package in the file formats {\LaTeX}, DVI, Postscript, PDF, HTML and ASCII text. This is accomplished using the \textsf{GAPDoc} package by Frank Lübeck and Max Neunhöffer. Building the manual is possible
only on UNIX systems and requires {\LaTeX}, PDF{\LaTeX} and \textsf{dvips}. As all files generated by this function are included in the distribution
file anyway, users will not need it. }

 }

  }

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

\bibliographystyle{alpha}
\bibliography{resclasses.bib}

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


\printindex

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