Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/GAP/pkg/groupoids/doc/   (Algebra von RWTH Aachen Version 4.15.1©)  Datei vom 11.8.2025 mit Größe 259 kB image not shown  

Quelle  groupoids.tex   Sprache: Latech

 
% generated by GAPDoc2LaTeX from XML source (Frank Luebeck)
\documentclass[a4paper,11pt]{report}

            \usepackage[all]{xy} 
            \newcommand{\Aut} {\mathrm{Aut}}
            \newcommand{\AUT} {\mathrm{AUT}}
            \newcommand{\Inn} {\mathrm{Inn}}
        
\usepackage[top=37mm,bottom=37mm,left=27mm,right=27mm]{geometry}
\sloppy
\pagestyle{myheadings}
\usepackage{amssymb}
\usepackage[utf8]{inputenc}
\usepackage{makeidx}
\makeindex
\usepackage{color}
\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{linkColor}{rgb}{0.0,0.0,0.554}
\definecolor{citeColor}{rgb}{0.0,0.0,0.554}
\definecolor{fileColor}{rgb}{0.0,0.0,0.554}
\definecolor{urlColor}{rgb}{0.0,0.0,0.554}
\definecolor{promptColor}{rgb}{0.0,0.0,0.589}
\definecolor{brkpromptColor}{rgb}{0.589,0.0,0.0}
\definecolor{gapinputColor}{rgb}{0.589,0.0,0.0}
\definecolor{gapoutputColor}{rgb}{0.0,0.0,0.0}

%%  for a long time these were red and blue by default,
%%  now black, but keep variables to overwrite
\definecolor{FuncColor}{rgb}{0.0,0.0,0.0}
%% strange name because of pdflatex bug:
\definecolor{Chapter }{rgb}{0.0,0.0,0.0}
\definecolor{DarkOlive}{rgb}{0.1047,0.2412,0.0064}


\usepackage{fancyvrb}

\usepackage{mathptmx,helvet}
\usepackage[T1]{fontenc}
\usepackage{textcomp}


\usepackage[
            pdftex=true,
            bookmarks=true,        
            a4paper=true,
            pdftitle={Written with GAPDoc},
            pdfcreator={LaTeX with hyperref package / GAPDoc},
            colorlinks=true,
            backref=page,
            breaklinks=true,
            linkcolor=linkColor,
            citecolor=citeColor,
            filecolor=fileColor,
            urlcolor=urlColor,
            pdfpagemode={UseNone}, 
           ]{hyperref}

\newcommand{\maintitlesize}{\fontsize{50}{55}\selectfont}

% 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,}}
%% were never documented, give conflicts with some additional packages

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

%% nicer description environments, allows long labels
\usepackage{enumitem}
\setdescription{style=nextline}

%% depth of toc
\setcounter{tocdepth}{1}





%% command for ColorPrompt style examples
\newcommand{\gapprompt}[1]{\color{promptColor}{\bfseries #1}}
\newcommand{\gapbrkprompt}[1]{\color{brkpromptColor}{\bfseries #1}}
\newcommand{\gapinput}[1]{\color{gapinputColor}{#1}}


\begin{document}

\logpage{[ 0, 0, 0 ]}
\begin{titlepage}
\mbox{}\vfill

\begin{center}{\maintitlesize \textbf{ groupoids \mbox{}}}\\
\vfill

\hypersetup{pdftitle= groupoids }
\markright{\scriptsize \mbox{}\hfill  groupoids  \hfill\mbox{}}
{\Huge \textbf{ Calculations with finite groupoids and their homomorphisms \mbox{}}}\\
\vfill

{\Huge  1.79 \mbox{}}\\[1cm]
{ 11 September 2025 \mbox{}}\\[1cm]
\mbox{}\\[2cm]
{\Large \textbf{ Emma J. Moore\\
 \mbox{}}}\\
{\Large \textbf{ Chris Wensley\\
   \mbox{}}}\\
\hypersetup{pdfauthor= Emma J. Moore\\
 ;  Chris Wensley\\
   }
\end{center}\vfill

\mbox{}\\
{\mbox{}\\
\small \noindent \textbf{ Chris Wensley\\
   }  Email: \href{mailto://cdwensley.maths@btinternet.com} {\texttt{cdwensley.maths@btinternet.com}}\\
  Homepage: \href{https://github.com/cdwensley} {\texttt{https://github.com/cdwensley}}}\\
\end{titlepage}

\newpage\setcounter{page}{2}
{\small 
\section*{Abstract}
\logpage{[ 0, 0, 1 ]}
 The \textsf{groupoids} package provides functions for computation with groupoids (categories with
every arrow invertible) and their morphisms; for graphs of groups, and graphs
of groupoids. The most basic structure introduced is that of \emph{magma with objects}; followed by \emph{semigroup with objects}; then \emph{monoid with objects}; and finally \emph{groupoid}, which is a \emph{group with objects}. 

It provides normal forms for Free Products with Amalgamation and for
HNN\texttt{\symbol{45}}extensions when the initial groups have rewrite systems
and the subgroups have finite index. 

The \textsf{groupoids} package was originally implemented in 2000 (as \textsf{GraphGpd}) when the first author was studying for a Ph.D. in Bangor. 

The package was then renamed \textsf{Gpd} and version 1.07 was released in July 2011, ready for \textsf{GAP} 4.5. 

\textsf{Gpd} became an accepted \textsf{GAP} package in May 2015. 

In April 2017 the package was renamed again, as \textsf{groupoids}. 

Later versions implement many of the constructions described in the paper \cite{AlWe} for automorphisms of groupoids. 

Bug reports, comments, suggestions for additional features, and offers to
implement some of these, will all be very welcome. 

Please submit any issues at \href{https://github.com/gap-packages/groupoids/issues/} {\texttt{https://github.com/gap\texttt{\symbol{45}}packages/groupoids/issues/}} or send an email to the second author at \href{mailto://cdwensley.maths@btinternet.com} {\texttt{cdwensley.maths@btinternet.com}}. 

 \mbox{}}\\[1cm]
{\small 
\section*{Copyright}
\logpage{[ 0, 0, 2 ]}
 {\copyright} 2000\texttt{\symbol{45}}2025, Emma Moore and Chris Wensley.

 The \textsf{groupoids} package is free software; you can redistribute it and/or modify it under the
terms of the GNU General Public License as published by the Free Software
Foundation; either version 2 of the License, or (at your option) any later
version. \mbox{}}\\[1cm]
{\small 
\section*{Acknowledgements}
\logpage{[ 0, 0, 3 ]}
 This documentation was prepared using the \textsf{GAPDoc} \cite{GAPDoc} and \textsf{AutoDoc} \cite{AutoDoc} packages.

 The procedure used to produce new releases uses the package \textsf{GitHubPagesForGAP} \cite{GitHubPagesForGAP} and the package \textsf{ReleaseTools}.

 \mbox{}}\\[1cm]
\newpage

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

\tableofcontents
\newpage

  
\chapter{\textcolor{Chapter }{Introduction}}\label{chap-intro}
\logpage{[ 1, 0, 0 ]}
\hyperdef{L}{X7DFB63A97E67C0A1}{}
{
  Groupoids are mathematical categories in which every arrow is invertible. The \textsf{groupoids} package provides functions for the computation with groupoids and their
morphisms; for graphs of groups and graphs of groupoids. The package is far
from complete, and development continues. 

 It was used by Emma Moore in her thesis \cite{emma-thesis} to calculate normal forms for \emph{free products with amalgamation}, and for \emph{HNN\texttt{\symbol{45}}extensions} when the initial groups have rewriting systems. 

 The package may be obtained as a compressed tar file \texttt{groupoids\texttt{\symbol{45}}version.number.tar.gz} by ftp from one of the following sites: 
\begin{itemize}
\item  the \textsf{groupoids} GitHub site: \href{https://github.com/gap-packages.github.io/groupoids/} {\texttt{https://github.com/gap\texttt{\symbol{45}}packages.github.io/groupoids/}}. 
\item  any \textsf{GAP} archive, e.g. \href{https://www.gap-system.org/Packages/packages.html} {\texttt{https://www.gap\texttt{\symbol{45}}system.org/Packages/packages.html}}; 
\end{itemize}
 The package also has a GitHub repository at: \href{https://github.com/gap-packages/groupoids/} {\texttt{https://github.com/gap\texttt{\symbol{45}}packages/groupoids/}}. 

 The information parameter \texttt{InfoGroupoids} takes default value \texttt{1} which, for the benefit of new users, causes more messages to be printed out
when operations fail. When raised to a higher value, additional information is
printed out. 

 Help is available in the usual way. 

 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  
  !gapprompt@gap>| !gapinput@LoadPackage( "groupoids" );|
  
\end{Verbatim}
 For version 1.05 the package was completely restructured, starting with \emph{magmas with objects} and their mappings, and building up to groupoids via semigroups with objects
and monoids with objects. From version 1.07 the package includes some
functions to implement constructions for automorphisms and homotopies, as
described in \cite{AlWe}. More functions will be released when time permits. 

 Once the package is loaded, it is possible to check the installation has
proceeded correctly by running the test suite of the package with the command \texttt{ ReadPackage("groupoids","tst/testing.g"); }. Additional tests may be run using \texttt{ ReadPackage("groupoids","tst/testextra.g");.} (The file \texttt{"tst/testall.g"} is used for automated testing.) 

 You may reference this package by mentioning \cite{BrMoPoWe}, \cite{emma-thesis} and \cite{AlWe}. 

 Additional information on \emph{Computational Higher Dimensional Algebra} can be found in the notes on crossed modules at: \href{https://github.com/cdwensley/xmod-notes} {\texttt{https://github.com/cdwensley/xmod\texttt{\symbol{45}}notes}}. }

  
\chapter{\textcolor{Chapter }{Many\texttt{\symbol{45}}object structures}}\label{chap-mwp}
\logpage{[ 2, 0, 0 ]}
\hyperdef{L}{X8361CEA4856430C6}{}
{
  The aim of this package is to provide operations for finite groupoids. A \emph{groupoid} is constructed from a group and a set of objects. In order to provide a
sequence of categories, with increasing structure, mimicing those for groups,
we introduce in this chapter the notions of \emph{magma with objects}; \emph{semigroup with objects} and \emph{monoid with objects}. The next chapter introduces morphisms of these structures. At a first
reading of this manual, the user is advised to skip quickly through these
first two chapters, and then move on to groupoids in Chapter \ref{chap-gpd}. 

 The definitions of the standard properties of groupoids can be found in Philip
Higgins' book ``Categories and Groupoids'' \cite{HiGpd} (originally published in 1971, reprinted by TAC in 2005), and in Ronnie
Brown's book ``Topology'' \cite{BrTop}, revised and reissued as ``Topology and Groupoids'' \cite{BrTopGpd}.
\section{\textcolor{Chapter }{Magmas with objects; arrows}}\label{sec-mwo}
\logpage{[ 2, 1, 0 ]}
\hyperdef{L}{X7920BF45828AE5DE}{}
{
  A \emph{magma with objects} $M$ consists of a set of \emph{objects} Ob$(M)$, and a set of \emph{arrows} Arr$(M)$ together with \emph{tail} and \emph{head} maps $t,h :$ Arr$(M) \to$ Ob$(M)$, and a \emph{partial multiplication} $* :$ Arr$(M) \to $ Arr$(M)$, with $a*b$ defined precisely when the head of $a$ coincides with the tail of $b$. We write an arrow $a$ with tail $u$ and head $v$ as $(a : u \to v)$. 

 When this multiplication is associative we obtain a \emph{semigroup with objects}. 

 A \emph{loop} is an arrow whose tail and head are the same object. An \emph{identity arrow} at object $u$ is a loop $(1_u : u \to u)$ such that $a*1_u=a$ and $1_u*b=b$ whenever $u$ is the head of $a$ and the tail of $b$. When $M$ is a semigroup with objects and every object has an identity arrow, we obtain
\emph{monoid with objects}, which is just the usual notion of mathematical category. 

 An arrow $(a : u \to v)$ in a monoid with objects has \emph{inverse} $(a^{-1} : v \to u)$ provided $a*a^{-1} = 1_u$ and $a^{-1}*a = 1_v$. A monoid with objects in which every arrow has an inverse is a \emph{group with objects}, usually called a \emph{groupoid}. 

\subsection{\textcolor{Chapter }{MagmaWithObjects}}
\logpage{[ 2, 1, 1 ]}\nobreak
\hyperdef{L}{X7C51D7847BD23284}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\enspace\texttt{MagmaWithObjects({\mdseries\slshape args})\index{MagmaWithObjects@\texttt{MagmaWithObjects}}
\label{MagmaWithObjects}
}\hfill{\scriptsize (function)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\enspace\texttt{SinglePieceMagmaWithObjects({\mdseries\slshape magma, obs})\index{SinglePieceMagmaWithObjects@\texttt{SinglePieceMagmaWithObjects}}
\label{SinglePieceMagmaWithObjects}
}\hfill{\scriptsize (operation)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\enspace\texttt{ObjectList({\mdseries\slshape mwo})\index{ObjectList@\texttt{ObjectList}!for magmas with objects}
\label{ObjectList:for magmas with objects}
}\hfill{\scriptsize (attribute)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\enspace\texttt{RootObject({\mdseries\slshape mwo})\index{RootObject@\texttt{RootObject}!for magmas with objects}
\label{RootObject:for magmas with objects}
}\hfill{\scriptsize (attribute)}}\\


 The simplest construction for a magma with objects $M$ is to take a magma $m$ and an ordered set $s$, and form arrows $(u,a,v)$ for every $a$ in $m$ and $u,v$ in $s$. Multiplication is defined by $(u,a,v)*(v,b,w) = (u,a*b,w)$. In this package we prefer to write $(u,a,v)$ as $(a : u \to v)$, so that the multiplication rule becomes $(a : u \to v)*(b : v \to w) = (a*b : u \to w)$. 

 Any finite, ordered set is in principle acceptable as the object list of $M$, but most of the time we find it convenient to restrict ourselves to sets of
non\texttt{\symbol{45}}positive integers. 

 This is the only construction implemented here for magmas, semigroups, and
monoids with objects, and these all have the property \texttt{IsDirectProductWithCompleteDigraph}. There are other constructions implemented for groupoids. 

 The \emph{root object} of $M$ is the first element in $s$. 

 }

 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  
  !gapprompt@gap>| !gapinput@tm := [[1,2,4,3],[1,2,4,3],[3,4,2,1],[3,4,2,1]];; |
  !gapprompt@gap>| !gapinput@Display( tm );|
  [ [  1,  2,  4,  3 ],
    [  1,  2,  4,  3 ],
    [  3,  4,  2,  1 ],
    [  3,  4,  2,  1 ] ]
  !gapprompt@gap>| !gapinput@m := MagmaByMultiplicationTable( tm );;  SetName( m, "m" );|
  !gapprompt@gap>| !gapinput@m1 := MagmaElement(m,1);;  m2 := MagmaElement(m,2);; |
  !gapprompt@gap>| !gapinput@m3 := MagmaElement(m,3);;  m4 := MagmaElement(m,4);; |
  !gapprompt@gap>| !gapinput@M78 := MagmaWithObjects( m, [-8,-7] ); |
  magma with objects :-
      magma = m
    objects = [ -8, -7 ]
  !gapprompt@gap>| !gapinput@SetName( M78, "M78" ); |
  !gapprompt@gap>| !gapinput@[ IsAssociative(M78), IsCommutative(M78) ]; |
  [ false, false ]
  !gapprompt@gap>| !gapinput@[ RootObject( M78 ), ObjectList( M78 ) ]; |
  [ -8, [ -8, -7 ] ]
  
\end{Verbatim}
 

\subsection{\textcolor{Chapter }{IsDomainWithObjects}}
\logpage{[ 2, 1, 2 ]}\nobreak
\hyperdef{L}{X87D1C0BC86749E6D}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\enspace\texttt{IsDomainWithObjects({\mdseries\slshape obj})\index{IsDomainWithObjects@\texttt{IsDomainWithObjects}}
\label{IsDomainWithObjects}
}\hfill{\scriptsize (Category)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\enspace\texttt{IsMagmaWithObjects({\mdseries\slshape obj})\index{IsMagmaWithObjects@\texttt{IsMagmaWithObjects}}
\label{IsMagmaWithObjects}
}\hfill{\scriptsize (Category)}}\\


 The output from function \texttt{MagmaWithObjects} lies in the categories \texttt{IsDomainWithObjects}, \texttt{IsMagmaWithObjects} and \texttt{CategoryCollections(IsMultiplicativeElementWithObjects)}. As composition is only partial, the output does \emph{not} lie in the category \texttt{IsMagma}. 

 }

 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  
  !gapprompt@gap>| !gapinput@[ IsDomainWithObjects(M78), IsMagmaWithObjects(M78), IsMagma(M78) ]; |
  [ true, true, false ]
  
\end{Verbatim}
 

\subsection{\textcolor{Chapter }{Arrow}}
\logpage{[ 2, 1, 3 ]}\nobreak
\label{man-arrow}
\hyperdef{L}{X86247DFC8242CEBE}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\enspace\texttt{Arrow({\mdseries\slshape mwo, elt, tail, head})\index{Arrow@\texttt{Arrow}}
\label{Arrow}
}\hfill{\scriptsize (operation)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\enspace\texttt{ElementOfArrow({\mdseries\slshape arr})\index{ElementOfArrow@\texttt{ElementOfArrow}!for magmas with objects}
\label{ElementOfArrow:for magmas with objects}
}\hfill{\scriptsize (operation)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\enspace\texttt{TailOfArrow({\mdseries\slshape arr})\index{TailOfArrow@\texttt{TailOfArrow}!for magmas with objects}
\label{TailOfArrow:for magmas with objects}
}\hfill{\scriptsize (operation)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\enspace\texttt{HeadOfArrow({\mdseries\slshape arr})\index{HeadOfArrow@\texttt{HeadOfArrow}!for magmas with objects}
\label{HeadOfArrow:for magmas with objects}
}\hfill{\scriptsize (operation)}}\\


 Arrows in a magma with objects lie in the category \index{IsMultiplicativeElementWithObjects@\texttt{IsMultiplicativeElementWithObjects}} \texttt{IsMultiplicativeElementWithObjects}. An attempt to multiply two arrows which do not compose resuts in \texttt{fail} being returned. Each arrow $arr = (a : u \to v)$ has three components. The magma \emph{element} $a \in m$ may be accessed by \texttt{ElementOfArrow(arr)}. Similarly, the \emph{tail} object $u$ and the \emph{head} object $v$ may be obtained using \texttt{TailOfArrow(arr)} and \texttt{HeadOfArrow(arr)} respectively. The operation \texttt{MultiplicativeElementWithObjects} is a synonym for \texttt{Arrow} since this was used in older versions of the package. 

 }

 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  
  !gapprompt@gap>| !gapinput@a78 := Arrow( M78, m2, -7, -8 ); |
  [m2 : -7 -> -8]
  !gapprompt@gap>| !gapinput@a78 in M78; |
  true
  !gapprompt@gap>| !gapinput@b87 := Arrow( M78, m4, -8, -7 );;|
  !gapprompt@gap>| !gapinput@[ ElementOfArrow( b87 ), TailOfArrow( b87 ), HeadOfArrow( b87 ) ]; |
  [ m4, -8, -7 ]
  !gapprompt@gap>| !gapinput@ba := b87*a78;;  ab := a78*b87;;  [ ba, ab ];|
  [ [m4 : -8 -> -8], [m3 : -7 -> -7] ]
  !gapprompt@gap>| !gapinput@[ a78^2, ba^2, ba^3 ]; |
  [ fail, [m1 : -8 -> -8], [m3 : -8 -> -8] ]
  !gapprompt@gap>| !gapinput@## this demonstrates non-associativity with a78*b87*a78:|
  !gapprompt@gap>| !gapinput@[ a78*ba, ab*a78, a78*ba=ab*a78 ]; |
  [ [m3 : -7 -> -8], [m4 : -7 -> -8], false ]
  
\end{Verbatim}
 

\subsection{\textcolor{Chapter }{IsSinglePieceDomain}}
\logpage{[ 2, 1, 4 ]}\nobreak
\hyperdef{L}{X7B3352148103FD05}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\enspace\texttt{IsSinglePieceDomain({\mdseries\slshape mwo})\index{IsSinglePieceDomain@\texttt{IsSinglePieceDomain}}
\label{IsSinglePieceDomain}
}\hfill{\scriptsize (property)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\enspace\texttt{IsSinglePiece({\mdseries\slshape mwo})\index{IsSinglePiece@\texttt{IsSinglePiece}}
\label{IsSinglePiece}
}\hfill{\scriptsize (property)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\enspace\texttt{IsDirectProductWithCompleteDigraph({\mdseries\slshape mwo})\index{IsDirectProductWithCompleteDigraph@\texttt{IsDirectProductWithCompleteDigraph}}
\label{IsDirectProductWithCompleteDigraph}
}\hfill{\scriptsize (property)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\enspace\texttt{IsDiscreteMagmaWithObjects({\mdseries\slshape mwo})\index{IsDiscreteMagmaWithObjects@\texttt{IsDiscreteMagmaWithObjects}}
\label{IsDiscreteMagmaWithObjects}
}\hfill{\scriptsize (property)}}\\


 If the partial composition is forgotten, then what remains is a digraph
(usually with multiple edges and loops). Thus the notion of \emph{connected component} may be inherited by magmas with objects from digraphs. Unfortunately the terms \texttt{Component} and \texttt{Constituent} are already in considerable use elsewhere in \textsf{GAP}, so (and this may change if a more suitable word is suggested) we use the
term \texttt{IsSinglePieceDomain} to describe an object with an underlying connected digraph. The property \texttt{IsSinglePiece} is a synonym for \texttt{IsSinglePieceDomain and IsMagmaWithObjects}. When each connected component has a single object, and there is more than
one component, the magma with objects is \emph{discrete}. 

 }

 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  
  !gapprompt@gap>| !gapinput@IsSinglePiece( M78 ); |
  true
  !gapprompt@gap>| !gapinput@IsDirectProductWithCompleteDigraph( M78 );|
  true
  !gapprompt@gap>| !gapinput@IsDiscreteMagmaWithObjects( M78 ); |
  false
  
\end{Verbatim}
 }

 
\section{\textcolor{Chapter }{Semigroups with objects}}\label{sec-swo}
\logpage{[ 2, 2, 0 ]}
\hyperdef{L}{X7FDF94E8791B9BC1}{}
{
  

\subsection{\textcolor{Chapter }{SemigroupWithObjects}}
\logpage{[ 2, 2, 1 ]}\nobreak
\hyperdef{L}{X8519787D833653A7}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\enspace\texttt{SemigroupWithObjects({\mdseries\slshape args})\index{SemigroupWithObjects@\texttt{SemigroupWithObjects}}
\label{SemigroupWithObjects}
}\hfill{\scriptsize (function)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\enspace\texttt{SinglePieceSemigroupWithObjects({\mdseries\slshape sgp, obs})\index{SinglePieceSemigroupWithObjects@\texttt{SinglePieceSemigroupWithObjects}}
\label{SinglePieceSemigroupWithObjects}
}\hfill{\scriptsize (operation)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\enspace\texttt{MagmaWithSingleObject({\mdseries\slshape dom, obj})\index{MagmaWithSingleObject@\texttt{MagmaWithSingleObject}!for semigroups}
\label{MagmaWithSingleObject:for semigroups}
}\hfill{\scriptsize (operation)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\enspace\texttt{IsSemigroupWithObjects({\mdseries\slshape obj})\index{IsSemigroupWithObjects@\texttt{IsSemigroupWithObjects}}
\label{IsSemigroupWithObjects}
}\hfill{\scriptsize (filter)}}\\


 The constructions in section \ref{sec-mwo} give a \texttt{SinglePieceSemigroupWithObjects} when the magma is a semigroup. In the following example we use a
transformation semigroup and $3$ objects. 

 

 }

 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  
  !gapprompt@gap>| !gapinput@t := Transformation( [1,1,2,3] );; |
  !gapprompt@gap>| !gapinput@s := Transformation( [2,2,3,3] );;|
  !gapprompt@gap>| !gapinput@r := Transformation( [2,3,4,4] );; |
  !gapprompt@gap>| !gapinput@sgp := Semigroup( t, s, r );; |
  !gapprompt@gap>| !gapinput@SetName( sgp, "sgp" ); |
  !gapprompt@gap>| !gapinput@S123 := SemigroupWithObjects( sgp, [-3,-2,-1] ); |
  semigroup with objects :-
      magma = sgp<t,s,r>
    objects = [ -3, -2, -1 ]
  !gapprompt@gap>| !gapinput@[ IsAssociative(S123), IsCommutative(S123) ];|
  [ true, false ]
  !gapprompt@gap>| !gapinput@t12 := Arrow( S123, t, -1, -2 );|
  [Transformation( [ 1, 1, 2, 3 ] ) : -1 -> -2]
  !gapprompt@gap>| !gapinput@s23 := Arrow( S123, s, -2, -3 );|
  [Transformation( [ 2, 2, 3, 3 ] ) : -2 -> -3]
  !gapprompt@gap>| !gapinput@r31 := Arrow( S123, r, -3, -1 );|
  [Transformation( [ 2, 3, 4, 4 ] ) : -3 -> -1]
  !gapprompt@gap>| !gapinput@ts13 := t12 * s23;|
  [Transformation( [ 2, 2, 2, 3 ] ) : -1 -> -3]
  !gapprompt@gap>| !gapinput@sr21 := s23 * r31;|
  [Transformation( [ 3, 3, 4, 4 ] ) : -2 -> -1]
  !gapprompt@gap>| !gapinput@rt32 := r31 * t12;|
  [Transformation( [ 1, 2, 3, 3 ] ) : -3 -> -2]
  !gapprompt@gap>| !gapinput@tsr1 := ts13 * r31;|
  [Transformation( [ 3, 3, 3 ] ) : -1 -> -1]
  
\end{Verbatim}
 A magma, semigroup, monoid, or group $M$ can be made into a magma with objects by the addition of a single object. The
two are algebraically isomorphic, and there is one arrow (a loop) for each
element in $M$. In the example we take the transformation semigroup above, which has size $17$ at the object $0$. 

 

 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  
  !gapprompt@gap>| !gapinput@S0 := MagmaWithSingleObject( sgp, 0 );|
  semigroup with objects :-
      magma = sgp<t,s,r>
    objects = [ 0 ]
  !gapprompt@gap>| !gapinput@t0 := Arrow( S0, t, 0, 0 );            |
  [Transformation( [ 1, 1, 2, 3 ] ) : 0 -> 0]
  !gapprompt@gap>| !gapinput@Size( S0 );|
  17
  
\end{Verbatim}
 }

 
\section{\textcolor{Chapter }{Monoids with objects}}\label{monwo}
\logpage{[ 2, 3, 0 ]}
\hyperdef{L}{X86C32E6981557ED0}{}
{
  

\subsection{\textcolor{Chapter }{MonoidWithObjects}}
\logpage{[ 2, 3, 1 ]}\nobreak
\hyperdef{L}{X7A271B1A7F2FF245}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\enspace\texttt{MonoidWithObjects({\mdseries\slshape args})\index{MonoidWithObjects@\texttt{MonoidWithObjects}}
\label{MonoidWithObjects}
}\hfill{\scriptsize (function)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\enspace\texttt{SinglePieceMonoidWithObjects({\mdseries\slshape mon, obs})\index{SinglePieceMonoidWithObjects@\texttt{SinglePieceMonoidWithObjects}}
\label{SinglePieceMonoidWithObjects}
}\hfill{\scriptsize (operation)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\enspace\texttt{IsMonoidWithObjects({\mdseries\slshape obj})\index{IsMonoidWithObjects@\texttt{IsMonoidWithObjects}}
\label{IsMonoidWithObjects}
}\hfill{\scriptsize (filter)}}\\


 The constructions in section \ref{sec-mwo} give a \texttt{SinglePieceMonoidWithObjects} when the magma is a monoid. The example uses a finitely presented monoid with $2$ generators and $2$ objects. 

 }

 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  
  !gapprompt@gap>| !gapinput@fm := FreeMonoid( 2, "f" );;|
  !gapprompt@gap>| !gapinput@em := One( fm );;|
  !gapprompt@gap>| !gapinput@gm := GeneratorsOfMonoid( fm );;|
  !gapprompt@gap>| !gapinput@mon := fm/[ [gm[1]^3,em], [gm[1]*gm[2],gm[2]] ];; |
  !gapprompt@gap>| !gapinput@M49 := MonoidWithObjects( mon, [-9,-4] ); |
  monoid with objects :-
      magma = Monoid( [ f1, f2 ] )
    objects = [ -9, -4 ]
  !gapprompt@gap>| !gapinput@ktpo := KnownTruePropertiesOfObject( M49 );|
  [ "IsDuplicateFree""IsAssociative""IsSinglePieceDomain"
    "IsDirectProductWithCompleteDigraphDomain" ]
  !gapprompt@gap>| !gapinput@catobj := CategoriesOfObject( M49 );; |
  [ "IsListOrCollection""IsCollection""IsExtLElement"
    "CategoryCollections(IsExtLElement)""IsExtRElement"
    "CategoryCollections(IsExtRElement)"
    "CategoryCollections(IsMultiplicativeElement)""IsGeneralizedDomain"
    "IsDomainWithObjects"
    "CategoryCollections(IsMultiplicativeElementWithObjects)"
    "CategoryCollections(IsMultiplicativeElementWithObjectsAndOnes)"
    "CategoryCollections(IsMultiplicativeElementWithObjectsAndInverses)"
    "IsMagmaWithObjects""IsSemigroupWithObjects""IsMonoidWithObjects" ]
  
\end{Verbatim}
 }

 
\section{\textcolor{Chapter }{Generators of magmas with objects}}\label{genwo}
\logpage{[ 2, 4, 0 ]}
\hyperdef{L}{X842D1B0C7A76CC15}{}
{
  

\subsection{\textcolor{Chapter }{GeneratorsOfMagmaWithObjects}}
\logpage{[ 2, 4, 1 ]}\nobreak
\hyperdef{L}{X83239B307EE95054}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\enspace\texttt{GeneratorsOfMagmaWithObjects({\mdseries\slshape mwo})\index{GeneratorsOfMagmaWithObjects@\texttt{GeneratorsOfMagmaWithObjects}}
\label{GeneratorsOfMagmaWithObjects}
}\hfill{\scriptsize (operation)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\enspace\texttt{GeneratorsOfSemigroupWithObjects({\mdseries\slshape swo})\index{GeneratorsOfSemigroupWithObjects@\texttt{GeneratorsOfSemigroupWithObjects}}
\label{GeneratorsOfSemigroupWithObjects}
}\hfill{\scriptsize (operation)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\enspace\texttt{GeneratorsOfMonoidWithObjects({\mdseries\slshape mwo})\index{GeneratorsOfMonoidWithObjects@\texttt{GeneratorsOfMonoidWithObjects}}
\label{GeneratorsOfMonoidWithObjects}
}\hfill{\scriptsize (operation)}}\\


 For a magma or semigroup with objects, the generating set consists of arrows $(g : u \to v)$ for every pair of objects $u,v$ and every generating element for the magma or semigroup. 

 For a monoid with objects, the generating set consists of two parts. Firstly,
there is a loop at the root object $r$ for each generator of the monoid. Secondly, for each object $u$ distinct from $r$, there are arrows $(1 : r \to u)$ and $(1 : u \to r)$. (Perhaps only one of each pair is required?) Then 
\[ (e : u \to v ) = (1 : u \to r)*(e : r \to r)*(1 : r \to v). \]
 

 

 }

 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  
  !gapprompt@gap>| !gapinput@GeneratorsOfMagmaWithObjects( M78 );|
  [ [m1 : -8 -> -8], [m2 : -8 -> -8], [m3 : -8 -> -8], [m4 : -8 -> -8], 
    [m1 : -8 -> -7], [m2 : -8 -> -7], [m3 : -8 -> -7], [m4 : -8 -> -7], 
    [m1 : -7 -> -8], [m2 : -7 -> -8], [m3 : -7 -> -8], [m4 : -7 -> -8], 
    [m1 : -7 -> -7], [m2 : -7 -> -7], [m3 : -7 -> -7], [m4 : -7 -> -7] ]
  !gapprompt@gap>| !gapinput@genS := GeneratorsOfSemigroupWithObjects( S123 );;|
  !gapprompt@gap>| !gapinput@Length( genS );                                   |
  27
  !gapprompt@gap>| !gapinput@genM := GeneratorsOfMonoidWithObjects( M49 );|
  [ [f1 : -9 -> -9], [f2 : -9 -> -9], [<identity ...> : -9 -> -4], 
    [<identity ...> : -4 -> -9] ]
  !gapprompt@gap>| !gapinput@g1:=genM[2];; g2:=genM[3];; g3:=genM[4];; g4:=genM[5];; |
  !gapprompt@gap>| !gapinput@[g4,g2,g1,g3];|
  [ [<identity ...> : -4 -> -9], [f2 : -9 -> -9], [f1 : -9 -> -9], 
    [<identity ...> : -9 -> -4] ]
  !gapprompt@gap>| !gapinput@g4*g2*g1*g3;|
  [f2*f1 : -4 -> -4]
  
\end{Verbatim}
 }

 
\section{\textcolor{Chapter }{Structures with more than one piece}}\label{sec-pieces}
\logpage{[ 2, 5, 0 ]}
\hyperdef{L}{X7C7007207FD91BB0}{}
{
  

\subsection{\textcolor{Chapter }{UnionOfPieces (for magmas with objects)}}
\logpage{[ 2, 5, 1 ]}\nobreak
\hyperdef{L}{X781FB06382E08115}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\enspace\texttt{UnionOfPieces({\mdseries\slshape pieces})\index{UnionOfPieces@\texttt{UnionOfPieces}!for magmas with objects}
\label{UnionOfPieces:for magmas with objects}
}\hfill{\scriptsize (operation)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\enspace\texttt{Pieces({\mdseries\slshape mwo})\index{Pieces@\texttt{Pieces}!for magmas with objects}
\label{Pieces:for magmas with objects}
}\hfill{\scriptsize (attribute)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\enspace\texttt{PieceOfObject({\mdseries\slshape mwo, obj})\index{PieceOfObject@\texttt{PieceOfObject}}
\label{PieceOfObject}
}\hfill{\scriptsize (operation)}}\\


 A magma with objects whose underlying digraph has two or more connected
components can be constructed by taking the union of two or more connected
structures. These, in turn, can be combined together. The only requirement is
that all the object lists should be disjoint. The pieces are ordered by the
order of their root objects. 

 

 }

 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  
  !gapprompt@gap>| !gapinput@N1 := UnionOfPieces( [ M78, S123 ] ); |
  magma with objects having 2 pieces :-
  1: M78
  2: semigroup with objects :-
      magma = sgp<t,s,r>
    objects = [ -3, -2, -1 ]
  !gapprompt@gap>| !gapinput@ObjectList( N1 ); |
  [ -8, -7, -3, -2, -1 ]
  !gapprompt@gap>| !gapinput@Pieces(N1);|
  [ M78, semigroup with objects :-
          magma = sgp<t,s,r>
        objects = [ -3, -2, -1 ]
       ]
  !gapprompt@gap>| !gapinput@PieceOfObject( N1, -7 ); |
  M78
  !gapprompt@gap>| !gapinput@N2 := UnionOfPieces( [ M49, S0 ] );  |
  semigroup with objects having 2 pieces :-
  1: monoid with objects :-
      magma = Monoid( [ f1, f2 ] )
    objects = [ -9, -4 ]
  2: semigroup with objects :-
      magma = sgp<t,s,r>
    objects = [ 0 ]
  !gapprompt@gap>| !gapinput@ObjectList( N2 ); |
  [ -9, -4, 0 ]
  !gapprompt@gap>| !gapinput@N3 := UnionOfPieces( [ N1, N2] );  |
  magma with objects having 4 pieces :-
  1: monoid with objects :-
      magma = Monoid( [ f1, f2 ] )
    objects = [ -9, -4 ]
  2: M78
  3: semigroup with objects :-
      magma = sgp<t,s,r>
    objects = [ -3, -2, -1 ]
  4: semigroup with objects :-
      magma = sgp<t,s,r>
    objects = [ 0 ]
  !gapprompt@gap>| !gapinput@ObjectList( N3 ); |
  [ -9, -8, -7, -4, -3, -2, -1, 0 ]
  !gapprompt@gap>| !gapinput@Length( GeneratorsOfMagmaWithObjects( N3 ) ); |
  50
  !gapprompt@gap>| !gapinput@## the next command returns fail since the object sets are not disjoint: |
  !gapprompt@gap>| !gapinput@N4 := UnionOfPieces( [ S123, MagmaWithSingleObject( sgp, -2 ) ] );  |
  fail
  
\end{Verbatim}
 }

 }

  
\chapter{\textcolor{Chapter }{Mappings of many\texttt{\symbol{45}}object structures}}\label{chap-homwo}
\logpage{[ 3, 0, 0 ]}
\hyperdef{L}{X78FC7902804CED8E}{}
{
  A \emph{homomorphism} $f$ from a magma with objects $M$ to a magma with objects $N$ consists of 
\begin{itemize}
\item  a map $f_O$ from the objects of $M$ to those of $N$, 
\item  a map $f_A$ from the arrows of $M$ to those of $N$. 
\end{itemize}
 The map $f_A$ is required to be compatible with the tail and head maps and to preserve
multiplication: 
\[ f_A(a : u \to v) * f_A(b : v \to w) ~=~ f_A(a*b : u \to w) \]
 with tail $f_O(u)$ and head $f_O(w)$. 

 When the underlying magma of $M$ is a monoid or group, the map $f_A$ is required to preserve identities and inverses. 

 
\section{\textcolor{Chapter }{Homomorphisms of magmas with objects}}\label{sec-mwohom}
\logpage{[ 3, 1, 0 ]}
\hyperdef{L}{X82F856A086B93832}{}
{
  

\subsection{\textcolor{Chapter }{MagmaWithObjectsHomomorphism}}
\logpage{[ 3, 1, 1 ]}\nobreak
\hyperdef{L}{X86E00FEA7FF38FEA}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\enspace\texttt{MagmaWithObjectsHomomorphism({\mdseries\slshape args})\index{MagmaWithObjectsHomomorphism@\texttt{MagmaWithObjectsHomomorphism}}
\label{MagmaWithObjectsHomomorphism}
}\hfill{\scriptsize (function)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\enspace\texttt{HomomorphismFromSinglePiece({\mdseries\slshape src, rng, hom, imobs})\index{HomomorphismFromSinglePiece@\texttt{HomomorphismFromSinglePiece}}
\label{HomomorphismFromSinglePiece}
}\hfill{\scriptsize (operation)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\enspace\texttt{HomomorphismToSinglePiece({\mdseries\slshape src, rng, images})\index{HomomorphismToSinglePiece@\texttt{HomomorphismToSinglePiece}!for magmas with objects}
\label{HomomorphismToSinglePiece:for magmas with objects}
}\hfill{\scriptsize (operation)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\enspace\texttt{MappingToSinglePieceData({\mdseries\slshape mwohom})\index{MappingToSinglePieceData@\texttt{MappingToSinglePieceData}!for magmas with objects}
\label{MappingToSinglePieceData:for magmas with objects}
}\hfill{\scriptsize (attribute)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\enspace\texttt{PiecesOfMapping({\mdseries\slshape mwohom})\index{PiecesOfMapping@\texttt{PiecesOfMapping}}
\label{PiecesOfMapping}
}\hfill{\scriptsize (attribute)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\enspace\texttt{IsomorphismNewObjects({\mdseries\slshape src, objlist})\index{IsomorphismNewObjects@\texttt{IsomorphismNewObjects}!for magmas with objects}
\label{IsomorphismNewObjects:for magmas with objects}
}\hfill{\scriptsize (operation)}}\\


 There are a variety of homomorphism constructors. 

 The simplest construction gives a homomorphism $M \to N$ with both $M$ and $N$ connected. It is implemented as \index{IsMappingToSinglePieceRep@\texttt{IsMappingToSinglePieceRep}} \texttt{IsMappingToSinglePieceRep} with attributes \index{Source@\texttt{Source}} \texttt{Source}, \index{Range@\texttt{Range}} \texttt{Range} and \texttt{MappingToSinglePieceData}. The operation requires the following information: 
\begin{itemize}
\item  a magma homomorphism \texttt{hom} from the underlying magma of $M$ to the underlying magma of $N$, 
\item  a list \texttt{imobs} of the images of the objects of $M$. 
\end{itemize}
 In the first example we construct endomappings of \texttt{m} and \texttt{M78}. 

 }

 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  
  !gapprompt@gap>| !gapinput@tup1 := [ DirectProductElement([m1,m2]), DirectProductElement([m2,m1]), |
  !gapprompt@>| !gapinput@             DirectProductElement([m3,m4]), DirectProductElement([m4,m3]) ];; |
  !gapprompt@gap>| !gapinput@f1 := GeneralMappingByElements( m, m, tup1 ); |
  <general mapping: m -> m >
  !gapprompt@gap>| !gapinput@IsMagmaHomomorphism( f1 ); |
  true
  !gapprompt@gap>| !gapinput@hom1 := MagmaWithObjectsHomomorphism( M78, M78, f1, [-7,-8] ); |
  magma with objects homomorphism : M78 -> M78
  [ [ <mapping: m -> m >, [ -7, -8 ] ] ]
  !gapprompt@gap>| !gapinput@[ Source( hom1 ), Range( hom1 ) ]; |
  [ M78, M78 ]
  !gapprompt@gap>| !gapinput@b87;|
  [m4 : -8 -> -7]
  !gapprompt@gap>| !gapinput@im1 := ImageElm( hom1, b87 );|
  [m3 : -7 -> -8]
  !gapprompt@gap>| !gapinput@i65 := IsomorphismNewObjects( M78, [-6,-5] ); |
  magma with objects homomorphism : [ [ IdentityMapping( m ), [ -6, -5 ] ] ]
  !gapprompt@gap>| !gapinput@ib87 := ImageElm( i65, b87 );|
  [m4 : -6 -> -5]
  !gapprompt@gap>| !gapinput@M65 := Range( i65);; |
  !gapprompt@gap>| !gapinput@SetName( M65, "M65" ); |
  !gapprompt@gap>| !gapinput@j65 := InverseGeneralMapping( i65 );; |
  !gapprompt@gap>| !gapinput@ImagesOfObjects( j65 ); |
  [ -8, -7 ]
  !gapprompt@gap>| !gapinput@comp := j65 * hom1;|
  magma with objects homomorphism : M65 -> M78
  [ [ <mapping: m -> m >, [ -7, -8 ] ] ]
  !gapprompt@gap>| !gapinput@ImageElm( comp, ib87 );|
  [m3 : -7 -> -8]
  
\end{Verbatim}
 A homomorphism \emph{to} a connected magma with objects may have a source with several pieces, and so
is a union of homomorphisms \emph{from} single pieces. 

 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  
  !gapprompt@gap>| !gapinput@M4 := UnionOfPieces( [ M78, M65 ] );;|
  !gapprompt@gap>| !gapinput@images := [ MappingToSinglePieceData( hom1 )[1], |
  !gapprompt@>| !gapinput@MappingToSinglePieceData( j65 )[1] ]; |
  [ [ <mapping: m -> m >, [ -7, -8 ] ], [ IdentityMapping( m ), [ -8, -7 ] ] ]
  !gapprompt@gap>| !gapinput@map4 := HomomorphismToSinglePiece( M4, M78, images ); |
  magma with objects homomorphism : 
  [ [ <mapping: m -> m >, [ -7, -8 ] ], [ IdentityMapping( m ), [ -8, -7 ] ] ]
  !gapprompt@gap>| !gapinput@ImageElm( map4, b87 ); |
  [m3 : -7 -> -8]
  !gapprompt@gap>| !gapinput@ImageElm( map4, ib87 );|
  [m4 : -8 -> -7]
  
\end{Verbatim}
 }

 
\section{\textcolor{Chapter }{Homomorphisms of semigroups and monoids with objects}}\label{sec-sgphom}
\logpage{[ 3, 2, 0 ]}
\hyperdef{L}{X7C4D1AEE80D41A35}{}
{
  The next example exhibits a homomorphism between transformation semigroups
with objects. 

 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  
  !gapprompt@gap>| !gapinput@t2 := Transformation( [2,2,4,1] );; |
  !gapprompt@gap>| !gapinput@s2 := Transformation( [1,1,4,4] );;|
  !gapprompt@gap>| !gapinput@r2 := Transformation( [4,1,3,3] );; |
  !gapprompt@gap>| !gapinput@sgp2 := Semigroup( [ t2, s2, r2 ] );;|
  !gapprompt@gap>| !gapinput@SetName( sgp2, "sgp" );|
  !gapprompt@gap>| !gapinput@##  apparently no method for transformation semigroups available for: |
  !gapprompt@gap>| !gapinput@##  nat := NaturalHomomorphismByGenerators( sgp, sgp2 );  so we use: |
  !gapprompt@gap>| !gapinput@##  in the function flip below t is a transformation on [1..n] |
  !gapprompt@gap>| !gapinput@flip := function( t ) |
  !gapprompt@>| !gapinput@    local i, j, k, L, L2, n; |
  !gapprompt@>| !gapinput@    n := DegreeOfTransformation( t );  |
  !gapprompt@>| !gapinput@    L := ImageListOfTransformation( t ); |
  !gapprompt@>| !gapinput@    if IsOddInt(n) then n:=n+1; L1:=Concatenation(L,[n]); |
  !gapprompt@>| !gapinput@                   else L1:=L; fi; |
  !gapprompt@>| !gapinput@    L2 := ShallowCopy( L1 );|
  !gapprompt@>| !gapinput@    for i in [1..n] do |
  !gapprompt@>| !gapinput@        if IsOddInt(i) then j:=i+1; else j:=i-1; fi; |
  !gapprompt@>| !gapinput@        k := L1[j]; |
  !gapprompt@>| !gapinput@        if IsOddInt(k) then L2[i]:=k+1; else L2[i]:=k-1; fi; |
  !gapprompt@>| !gapinput@    od; |
  !gapprompt@>| !gapinput@    return( Transformation( L2 ) ); |
  !gapprompt@>| !gapinput@end;; |
  !gapprompt@gap>| !gapinput@smap := MappingByFunction( sgp, sgp2, flip );; |
  !gapprompt@gap>| !gapinput@ok := RespectsMultiplication( smap ); |
  true
  !gapprompt@gap>| !gapinput@[ t, ImageElm( smap, t ) ]; |
  [ Transformation( [ 1, 1, 2, 3 ] ), Transformation( [ 2, 2, 4, 1 ] ) ]
  !gapprompt@gap>| !gapinput@[ s, ImageElm( smap, s ) ]; |
  [ Transformation( [ 2, 2, 3, 3 ] ), Transformation( [ 1, 1, 4, 4 ] ) ]
  !gapprompt@gap>| !gapinput@[ r, ImageElm( smap, r ) ]; |
  [ Transformation( [ 2, 3, 4, 4 ] ), Transformation( [ 4, 1, 3, 3 ] ) ]
  !gapprompt@gap>| !gapinput@SetName( smap, "smap" ); |
  !gapprompt@gap>| !gapinput@T123 := SemigroupWithObjects( sgp2, [-13,-12,-11] );; |
  !gapprompt@gap>| !gapinput@shom := MagmaWithObjectsHomomorphism( S123, T123, smap, [-11,-12,-13] );; |
  !gapprompt@gap>| !gapinput@it12 := ImageElm( shom, t12 );;  [ t12, it12 ]; |
  [ [Transformation( [ 1, 1, 2, 3 ] ) : -1 -> -2], 
    [Transformation( [ 2, 2, 4, 1 ] ) : -13 -> -12] ]
  !gapprompt@gap>| !gapinput@is23 := ImageElm( shom, s23 );;  [ s23, is23 ]; |
  [ [Transformation( [ 2, 2, 3, 3 ] ) : -2 -> -3], 
    [Transformation( [ 1, 1, 4, 4 ] ) : -12 -> -11] ]
  !gapprompt@gap>| !gapinput@ir31 := ImageElm( shom, r31 );;  [ r31, ir31 ]; |
  [ [Transformation( [ 2, 3, 4, 4 ] ) : -3 -> -1], 
    [Transformation( [ 4, 1, 3, 3 ] ) : -11 -> -13] ]
  
\end{Verbatim}
 }

 
\section{\textcolor{Chapter }{Homomorphisms to more than one piece}}\label{sec-hompieces}
\logpage{[ 3, 3, 0 ]}
\hyperdef{L}{X795C8DE37AED7B44}{}
{
  

\subsection{\textcolor{Chapter }{HomomorphismByUnion (for magmas with objects)}}
\logpage{[ 3, 3, 1 ]}\nobreak
\hyperdef{L}{X7AE44D9485EB50F1}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\enspace\texttt{HomomorphismByUnion({\mdseries\slshape src, rng, homs})\index{HomomorphismByUnion@\texttt{HomomorphismByUnion}!for magmas with objects}
\label{HomomorphismByUnion:for magmas with objects}
}\hfill{\scriptsize (operation)}}\\


 When $f : M \to N$ and $N$ has more than one connected component, then $M$ also has more than one component and $f$ is a union of homomorphisms, one for each piece in the range. 

 See section \ref{sec-genhoms} for the equivalent operation with groupoids. 

 }

 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  
  !gapprompt@gap>| !gapinput@N4 := UnionOfPieces( [ M78, T123 ] );; |
  !gapprompt@gap>| !gapinput@h14 := HomomorphismByUnionNC( N1, N4, [ hom1, shom ] ); |
  magma with objects homomorphism : 
  [ magma with objects homomorphism : M78 -> M78
      [ [ <mapping: m -> m >, [ -7, -8 ] ] ], magma with objects homomorphism : 
      [ [ smap, [ -11, -12, -13 ] ] ] ]
  !gapprompt@gap>| !gapinput@ImageElm( h14, a78 );|
  [m1 : -8 -> -7]
  !gapprompt@gap>| !gapinput@ImageElm( h14, r31 );|
  [Transformation( [ 4, 1, 3, 3 ] ) : -11 -> -13]
  
\end{Verbatim}
 

\subsection{\textcolor{Chapter }{IsInjectiveOnObjects}}
\logpage{[ 3, 3, 2 ]}\nobreak
\hyperdef{L}{X7C053B0379DDCE13}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\enspace\texttt{IsInjectiveOnObjects({\mdseries\slshape mwohom})\index{IsInjectiveOnObjects@\texttt{IsInjectiveOnObjects}}
\label{IsInjectiveOnObjects}
}\hfill{\scriptsize (property)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\enspace\texttt{IsSurjectiveOnObjects({\mdseries\slshape mwohom})\index{IsSurjectiveOnObjects@\texttt{IsSurjectiveOnObjects}}
\label{IsSurjectiveOnObjects}
}\hfill{\scriptsize (property)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\enspace\texttt{IsBijectiveOnObjects({\mdseries\slshape mwohom})\index{IsBijectiveOnObjects@\texttt{IsBijectiveOnObjects}}
\label{IsBijectiveOnObjects}
}\hfill{\scriptsize (property)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\enspace\texttt{IsEndomorphismWithObjects({\mdseries\slshape mwohom})\index{IsEndomorphismWithObjects@\texttt{IsEndomorphismWithObjects}}
\label{IsEndomorphismWithObjects}
}\hfill{\scriptsize (property)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\enspace\texttt{IsAutomorphismWithObjects({\mdseries\slshape mwohom})\index{IsAutomorphismWithObjects@\texttt{IsAutomorphismWithObjects}}
\label{IsAutomorphismWithObjects}
}\hfill{\scriptsize (property)}}\\


 The meaning of these five properties is obvious. }

 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  
  !gapprompt@gap>| !gapinput@IsInjectiveOnObjects( h14 );|
  true
  !gapprompt@gap>| !gapinput@IsSurjectiveOnObjects( h14 );|
  true
  !gapprompt@gap>| !gapinput@IsBijectiveOnObjects( h14 ); |
  true
  !gapprompt@gap>| !gapinput@IsEndomorphismWithObjects( h14 ); |
  false
  !gapprompt@gap>| !gapinput@IsAutomorphismWithObjects( h14 ); |
  false
  
\end{Verbatim}
 }

 
\section{\textcolor{Chapter }{Mappings defined by a function}}\label{sec-mapbyfun}
\logpage{[ 3, 4, 0 ]}
\hyperdef{L}{X7B9D71BB7BAEFAAA}{}
{
  

\subsection{\textcolor{Chapter }{MappingWithObjectsByFunction}}
\logpage{[ 3, 4, 1 ]}\nobreak
\hyperdef{L}{X81B64F9A855D265F}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\enspace\texttt{MappingWithObjectsByFunction({\mdseries\slshape src, rng, fun, imobs})\index{MappingWithObjectsByFunction@\texttt{MappingWithObjectsByFunction}}
\label{MappingWithObjectsByFunction}
}\hfill{\scriptsize (operation)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\enspace\texttt{IsMappingWithObjectsByFunction({\mdseries\slshape map})\index{IsMappingWithObjectsByFunction@\texttt{IsMappingWithObjectsByFunction}}
\label{IsMappingWithObjectsByFunction}
}\hfill{\scriptsize (property)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\enspace\texttt{UnderlyingFunction({\mdseries\slshape map})\index{UnderlyingFunction@\texttt{UnderlyingFunction}}
\label{UnderlyingFunction}
}\hfill{\scriptsize (attribute)}}\\


 More general mappings, which need not preserve multiplication, are available
using this operation. See chapter \ref{chap-gpdaut} for an application. }

 
\begin{Verbatim}[commandchars=@|C,fontsize=\small,frame=single,label=Example]
  
  @gapprompt|gap>C @gapinput|swap := function(a) return Arrow(M78,a![1],a![3],a![2]); end;      C
  function( a ) ... end
  @gapprompt|gap>C @gapinput|swapmap := MappingWithObjectsByFunction( M78, M78, swap, [-7,-8] );C
  magma with objects mapping by function : M78 -> M78
  function: function ( a )
      return Arrow( M78, a![1], a![3], a![2] );
  end
  
  @gapprompt|gap>C @gapinput|a78; ImageElm( swapmap, a78 );              C
  [m2 : -7 -> -8]
  [m2 : -8 -> -7]
  
\end{Verbatim}
 }

 }

  
\chapter{\textcolor{Chapter }{Groupoids}}\label{chap-gpd}
\logpage{[ 4, 0, 0 ]}
\hyperdef{L}{X82F6A1AB798648F4}{}
{
  A \emph{groupoid} is a (mathematical) category in which every element is invertible. It consists
of a set of \emph{pieces}, each of which is a connected groupoid. The usual terminology is `connected
component', but in \textsf{GAP} `component' is used for `record component', so we use the term \emph{single piece}.

 The simplest form for a \emph{single piece groupoid} is the direct product of a group and a complete digraph, and so is determined
by a set of \emph{objects} \texttt{obs} $= \Omega$ (the least of which is the \emph{root object}), and a \emph{root group} \texttt{grp} $= G$. Then the elements of the groupoid are \emph{arrows} $(g : o_1 \to o_2)$, stored as triples \texttt{[g,o1,o2]}, where $g \in G$ and $o_1,o_2 \in \Omega$. The objects will generally be chosen to be consecutive negative integers,
but any suitable ordered set is acceptable, and `consecutive' is not a
requirement. The root group will usually be taken to be a permutation group,
but pc\texttt{\symbol{45}}groups, fp\texttt{\symbol{45}}groups and matrix
groups are also supported. 

 A \emph{group} may be considered as a single piece groupoid with one object. 

 A \emph{groupoid} is a set of one or more single piece groupoids, its \emph{pieces}, and is represented as \texttt{IsGroupoidRep}, with attribute \texttt{PiecesOfGroupoid}. 

 The underlying digraph of a single piece groupoid is a regular, complete
digraph on the object set $\Omega$ with $|G|$ arrows from any one object to any other object. It will be convenient to
specify a set of \emph{rays} \index{rays@} consisting of $|\Omega|$ arrows $(r_i : o_1 \to o_i)$, where $o_1$ is the root object and $r_1$ is the identity in $G$. In the simplest examples all the $r_i$ will be identity elements, but other rays are useful when forming subgroupoids
(see \texttt{SubgroupoidWithRays} (\ref{SubgroupoidWithRays})). 

 A groupoid is \emph{homogeneous} if it has two of more isomorphic pieces, with identical groups. The special
case of \emph{homogeneous, discrete} groupoids, where each piece has a single object, is given its own
representation. These are used in the \textsf{XMod} package as the source of a crossed modules of groupoids. 

 For the definitions of the standard properties of groupoids we refer to R.
Brown's book ``Topology'' \cite{BrTop}, recently revised and reissued as ``Topology and Groupoids'' \cite{BrTopGpd}.
\section{\textcolor{Chapter }{Groupoids: their properties and attributes}}\label{sec-gpds}
\logpage{[ 4, 1, 0 ]}
\hyperdef{L}{X7AC321DC7E3C6167}{}
{
  

\subsection{\textcolor{Chapter }{SinglePieceGroupoid}}
\logpage{[ 4, 1, 1 ]}\nobreak
\hyperdef{L}{X8406913B7ED86CFE}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\enspace\texttt{SinglePieceGroupoid({\mdseries\slshape grp, obs})\index{SinglePieceGroupoid@\texttt{SinglePieceGroupoid}}
\label{SinglePieceGroupoid}
}\hfill{\scriptsize (operation)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\enspace\texttt{Groupoid({\mdseries\slshape args})\index{Groupoid@\texttt{Groupoid}}
\label{Groupoid}
}\hfill{\scriptsize (function)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\enspace\texttt{MagmaWithSingleObject({\mdseries\slshape gp, obj})\index{MagmaWithSingleObject@\texttt{MagmaWithSingleObject}!for groups}
\label{MagmaWithSingleObject:for groups}
}\hfill{\scriptsize (operation)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\enspace\texttt{IsGroupoid({\mdseries\slshape mwo})\index{IsGroupoid@\texttt{IsGroupoid}}
\label{IsGroupoid}
}\hfill{\scriptsize (Category)}}\\


 The simplest construction of a groupoid is as the direct product of a group
and a complete digraph. Such a groupoid will be called a \index{standard groupoid@standard groupoid} \emph{standard groupoid}. Many subgroupoids of such a groupoid do not have this simple form, and will
be considered in section \ref{sec-subgpds}. The global function \texttt{Groupoid} will normally find the appropriate constructor to call, the options being: 
\begin{itemize}
\item  the object group and a set of objects; 
\item  a group being converted to a groupoid and a single object; 
\item  a list of groupoids which have already been constructed (see \ref{sec-union-gpds}). 
\end{itemize}
 

 Methods for \texttt{ViewObj}, \texttt{PrintObj} and \texttt{Display} are provided for groupoids and the other types of object in this package.
Users are advised to supply names for all the groups and groupoids they
construct. 

 }

 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  
  !gapprompt@gap>| !gapinput@a4 := Group( (1,2,3), (2,3,4) );; |
  !gapprompt@gap>| !gapinput@d8 := Group( (5,6,7,8), (5,7) );;|
  !gapprompt@gap>| !gapinput@SetName( a4, "a4" );  SetName( d8, "d8" ); |
  !gapprompt@gap>| !gapinput@Ga4 := SinglePieceGroupoid( a4, [-15 .. -11] ); |
  single piece groupoid: < a4, [ -15 .. -11 ] >
  !gapprompt@gap>| !gapinput@Gd8 := Groupoid( d8, [-9,-8,-7] );|
  single piece groupoid: < d8, [ -9, -8, -7 ] >
  !gapprompt@gap>| !gapinput@c6 := Group( (11,12,13)(14,15) );;|
  !gapprompt@gap>| !gapinput@SetName( c6, "c6" );|
  !gapprompt@gap>| !gapinput@Gc6 := MagmaWithSingleObject( c6, -10 );|
  single piece groupoid: < c6, [ -10 ] >
  !gapprompt@gap>| !gapinput@IsGroupoid( Gc6 ); |
  true
  !gapprompt@gap>| !gapinput@SetName( Ga4, "Ga4" );  SetName( Gd8, "Gd8" );  SetName( Gc6, "Gc6" );  |
  
\end{Verbatim}
 More operations for constructing groupoids are described in the following
subsections: 
\begin{itemize}
\item  Homogeneous groupoids (see \ref{sec-homogeneous}); 
\item  Direct products of groupoids (see \ref{sec-directprod}); 
\item  A variety of subgroupoid constructions in section \ref{sec-subgpds}; 
\item  Groupoids formed using group isomorphisms in section \ref{sec-gpd-isos}; 
\item  Groupoids whose objects form a monoid in section \ref{sec-mon-gpd}. 
\end{itemize}
 

\subsection{\textcolor{Chapter }{ObjectList (for groupoids)}}
\logpage{[ 4, 1, 2 ]}\nobreak
\hyperdef{L}{X813B084184AAA890}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\enspace\texttt{ObjectList({\mdseries\slshape gpd})\index{ObjectList@\texttt{ObjectList}!for groupoids}
\label{ObjectList:for groupoids}
}\hfill{\scriptsize (attribute)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\enspace\texttt{RootObject({\mdseries\slshape gpd})\index{RootObject@\texttt{RootObject}!for groupoids}
\label{RootObject:for groupoids}
}\hfill{\scriptsize (attribute)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\enspace\texttt{RootGroup({\mdseries\slshape gpd})\index{RootGroup@\texttt{RootGroup}}
\label{RootGroup}
}\hfill{\scriptsize (attribute)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\enspace\texttt{ObjectGroup({\mdseries\slshape gpd, obj})\index{ObjectGroup@\texttt{ObjectGroup}}
\label{ObjectGroup}
}\hfill{\scriptsize (operation)}}\\


 The \texttt{ObjectList} of a groupoid is the sorted list of its objects. The \texttt{RootObject} in a single\texttt{\symbol{45}}piece groupoid is the object with the least
label. A \emph{loop} is an arrow of the form $(g : o \to o)$, and the loops at a particular object $o$ form a group, the \texttt{ObjectGroup} at $o$. The \texttt{RootGroup} is the \texttt{ObjectGroup} at the \texttt{RootObject}. 

 In the example, the groupoids \texttt{Gf2c6} and \texttt{Gabc} illustrate that the objects need not be integers. 

 }

 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  
  !gapprompt@gap>| !gapinput@ObjectList( Ga4 );|
  [ -15 .. -11 ] 
  !gapprompt@gap>| !gapinput@f2 := FreeGroup(2);;|
  !gapprompt@gap>| !gapinput@Gf2d8 := Groupoid( d8, GeneratorsOfGroup(f2) );|
  single piece groupoid: < d8, [ f1, f2 ] >
  !gapprompt@gap>| !gapinput@Arrow( Gf2d8, (6,8), f2.1, f2.2 );|
  [(6,8) : f1 -> f2]
  !gapprompt@gap>| !gapinput@Gabc := Groupoid( c6, [ "a""b""c" ] );|
  single piece groupoid: < c6, [ "a""b""c" ] >
  !gapprompt@gap>| !gapinput@Arrow( Gabc, (14,15), "c""b" );|
  [(14,15) : c -> b]
  
\end{Verbatim}
 

\subsection{\textcolor{Chapter }{IsPermGroupoid}}
\logpage{[ 4, 1, 3 ]}\nobreak
\hyperdef{L}{X8511D3EE845CC930}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\enspace\texttt{IsPermGroupoid({\mdseries\slshape gpd})\index{IsPermGroupoid@\texttt{IsPermGroupoid}}
\label{IsPermGroupoid}
}\hfill{\scriptsize (property)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\enspace\texttt{IsPcGroupoid({\mdseries\slshape gpd})\index{IsPcGroupoid@\texttt{IsPcGroupoid}}
\label{IsPcGroupoid}
}\hfill{\scriptsize (property)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\enspace\texttt{IsFpGroupoid({\mdseries\slshape gpd})\index{IsFpGroupoid@\texttt{IsFpGroupoid}}
\label{IsFpGroupoid}
}\hfill{\scriptsize (property)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\enspace\texttt{IsMatrixGroupoid({\mdseries\slshape gpd})\index{IsMatrixGroupoid@\texttt{IsMatrixGroupoid}}
\label{IsMatrixGroupoid}
}\hfill{\scriptsize (property)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\enspace\texttt{IsFreeGroupoid({\mdseries\slshape gpd})\index{IsFreeGroupoid@\texttt{IsFreeGroupoid}}
\label{IsFreeGroupoid}
}\hfill{\scriptsize (property)}}\\


 A groupoid is a permutation groupoid if all its pieces have permutation root
groups. Most of the examples in this chapter are permutation groupoids, but in
principle any type of group known to \textsf{GAP} may be used. 

 In the following example \texttt{Gf2} is an fp\texttt{\symbol{45}}groupoid and also a free groupoid, \texttt{Gq8} is a pc\texttt{\symbol{45}}groupoid, and \texttt{Gsl43} is a matrix groupoid. See section \ref{sec-mxreps} for matrix representations of groupoids. 

 }

 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  
  !gapprompt@gap>| !gapinput@f2 := FreeGroup( 2 );;|
  !gapprompt@gap>| !gapinput@Gf2 := Groupoid( f2, -20 );;|
  !gapprompt@gap>| !gapinput@SetName( f2, "f2" );  SetName( Gf2, "Gf2" ); |
  !gapprompt@gap>| !gapinput@q8 := QuaternionGroup( 8 );;|
  !gapprompt@gap>| !gapinput@genq8 := GeneratorsOfGroup( q8 );;|
  !gapprompt@gap>| !gapinput@x := genq8[1];;  y := genq8[2];;|
  !gapprompt@gap>| !gapinput@Gq8 := Groupoid( q8, [ -18, -17 ] );;|
  !gapprompt@gap>| !gapinput@SetName( q8, "q8" );  SetName( Gq8, "Gq8" );|
  !gapprompt@gap>| !gapinput@sl43 := SpecialLinearGroup( 4, 3 );;|
  !gapprompt@gap>| !gapinput@Gsl43 := SinglePieceGroupoid( sl43, [-23,-22,-21] );;|
  !gapprompt@gap>| !gapinput@SetName( sl43, "sl43" );  SetName( Gsl43, "Gsl43" );|
  !gapprompt@gap>| !gapinput@[ IsMatrixGroupoid( Gsl43 ), IsFpGroupoid( Gf2 ), IsFreeGroupoid( Gf2 ),|
  !gapprompt@>| !gapinput@     IsPcGroupoid( Gq8 ), IsPermGroupoid( Ga4 ) ]; |
  [ true, true, true, true, true ]
  
\end{Verbatim}
 

\subsection{\textcolor{Chapter }{UnionOfPieces (for groupoids)}}
\logpage{[ 4, 1, 4 ]}\nobreak
\label{sec-union-gpds}
\hyperdef{L}{X8681D15C7CA15F87}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\enspace\texttt{UnionOfPieces({\mdseries\slshape pieces})\index{UnionOfPieces@\texttt{UnionOfPieces}!for groupoids}
\label{UnionOfPieces:for groupoids}
}\hfill{\scriptsize (operation)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\enspace\texttt{Pieces({\mdseries\slshape gpd})\index{Pieces@\texttt{Pieces}!for groupoids}
\label{Pieces:for groupoids}
}\hfill{\scriptsize (attribute)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\enspace\texttt{Size({\mdseries\slshape gpd})\index{Size@\texttt{Size}}
\label{Size}
}\hfill{\scriptsize (attribute)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\enspace\texttt{ReplaceOnePieceInUnion({\mdseries\slshape U, old{\textunderscore}piece, new{\textunderscore}piece})\index{ReplaceOnePieceInUnion@\texttt{ReplaceOnePieceInUnion}}
\label{ReplaceOnePieceInUnion}
}\hfill{\scriptsize (operation)}}\\


 When a groupoid consists of two or more pieces, we require their object lists
to be disjoint. The operation \texttt{UnionOfPieces} and the attribute \texttt{Pieces}, introduced in section \ref{sec-pieces}, are also used for groupoids. The pieces are sorted by the least object in
their object lists. The \index{ObjectList@\texttt{ObjectList}!for groupoids} \texttt{ObjectList} is the sorted concatenation of the objects in the pieces. 

 The \texttt{Size} of a groupoid is the number of its arrows. For a single piece groupoid, this
is the product of the size of the group with the square of the number of
objects. For a non\texttt{\symbol{45}}connected groupoid, the size is the sum
of the sizes of its pieces. 

 One of the pieces in a groupoid may be replaced by an alternative piece using
the operation \texttt{ReplaceOnePieceInUnion}. The \emph{old{\textunderscore}piece} may be either the \emph{position} of the piece to be replaced, or one of the pieces in \texttt{U}. The objects in the new piece may or may not overlap the objects in the piece
being removed \texttt{\symbol{45}}\texttt{\symbol{45}} we just require that
the object lists in the new union are disjoint. 

 }

 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  
  !gapprompt@gap>| !gapinput@U3 := UnionOfPieces( [ Ga4, Gc6, Gd8 ] );;|
  !gapprompt@gap>| !gapinput@Display( U3 );|
  groupoid with 3 pieces:
  < objects: [ -15 .. -11 ]
      group: a4 = <[ (1,2,3), (2,3,4) ]> >
  < objects: [ -10 ]
      group: c6 = <[ (11,12,13)(14,15) ]> >
  < objects: [ -9, -8, -7 ]
      group: d8 = <[ (5,6,7,8), (5,7) ]> >
  !gapprompt@gap>| !gapinput@Pieces( U3 );|
  [ Ga4, Gc6, Gd8 ]
  !gapprompt@gap>| !gapinput@ObjectList( U3 );|
  [ -15, -14, -13, -12, -11, -10, -9, -8, -7 ]
  !gapprompt@gap>| !gapinput@[ Size(Ga4), Size(Gd8), Size(Gc6), Size(U3) ];|
  [ 300, 72, 6, 378 ]
  !gapprompt@gap>| !gapinput@U2 := Groupoid( [ Gf2, Gq8 ] );;|
  !gapprompt@gap>| !gapinput@[ Size(Gf2), Size(Gq8), Size(U2) ];           |
  [ infinity, 32, infinity ]
  !gapprompt@gap>| !gapinput@U5 := UnionOfPieces( [ U3, U2 ] );|
  groupoid with 5 pieces:
  [ Gf2, Gq8, Ga4, Gc6, Gd8 ]
  !gapprompt@gap>| !gapinput@V3 := ReplaceOnePieceInUnion( U3, Gd8, Gq8 ); |
  groupoid with 3 pieces:
  [ Gq8, Ga4, Gc6 ]
  !gapprompt@gap>| !gapinput@ObjectList( V3 );             |
  [ -18, -17, -15, -14, -13, -12, -11, -10 ]
  
\end{Verbatim}
 

\subsection{\textcolor{Chapter }{HomogeneousGroupoid}}
\logpage{[ 4, 1, 5 ]}\nobreak
\label{sec-homogeneous}
\hyperdef{L}{X855F318181808814}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\enspace\texttt{HomogeneousGroupoid({\mdseries\slshape gpd, oblist})\index{HomogeneousGroupoid@\texttt{HomogeneousGroupoid}}
\label{HomogeneousGroupoid}
}\hfill{\scriptsize (operation)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\enspace\texttt{PieceIsomorphisms({\mdseries\slshape hgpd})\index{PieceIsomorphisms@\texttt{PieceIsomorphisms}}
\label{PieceIsomorphisms}
}\hfill{\scriptsize (attribute)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\enspace\texttt{HomogeneousDiscreteGroupoid({\mdseries\slshape gp, obs})\index{HomogeneousDiscreteGroupoid@\texttt{HomogeneousDiscreteGroupoid}}
\label{HomogeneousDiscreteGroupoid}
}\hfill{\scriptsize (operation)}}\\


 Special functions are provided for the case where a groupoid has more than one
connected component, and when these components are identical except for their
object sets. Such groupoids are said to be \emph{homogeneous}. 

 The operation \texttt{HomogeneousGroupoid} is used when the components each contain more than one object. The arguments
consist of a single piece groupoid \texttt{gpd} and a list of lists of objects \texttt{oblist}, each of whose lists has the same length as the object list \texttt{obs} of \texttt{gpd}. Note that \texttt{gpd} is \emph{not} included as one of the pieces in the output unless \texttt{obs} is included as one of the lists in \texttt{oblist}. 

 The \texttt{PieceIsomorphisms} of a homogeneous groupoid are isomorphisms from the first piece to each of the
others. See Chapter \ref{chap-gpdhom} for details of groupoid isomorphisms. 

 The operation \texttt{HomogeneousDiscreteGroupoid} is used when the components each have a single object. In this case the first
argument is just a group \texttt{\symbol{45}}\texttt{\symbol{45}} the root
group for each component. These groupoids are used in the \textsf{XMod} package as the source of many crossed modules of groupoids. 

 Both types of groupoid have the property \index{IsHomogeneousDomainWithObjects@\texttt{IsHomogeneousDomainWithObjects}} \texttt{IsHomogeneousDomainWithObjects}. In the latter case a separate representation \index{IsHomogeneousDomainWithObjectsRep@\texttt{IsHomogeneousDiscreteGroupoidRep}} \texttt{IsHomogeneousDiscreteGroupoidRep} is used. 

 }

 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  
  !gapprompt@gap>| !gapinput@HGd8 := HomogeneousGroupoid( Gd8, |
  !gapprompt@>| !gapinput@               [ [-39,-38,-37], [-36,-35,-34], [-33,-32,-31] ] );|
  homogeneous groupoid with 3 pieces:
  1:  single piece groupoid: < d8, [ -39, -38, -37 ] >
  2:  single piece groupoid: < d8, [ -36, -35, -34 ] >
  3:  single piece groupoid: < d8, [ -33, -32, -31 ] >
  !gapprompt@gap>| !gapinput@Size( HGd8 );   ## 8x3x3 + 8x3x3 + 8x3x3|
  216
  !gapprompt@gap>| !gapinput@PieceIsomorphisms( HGd8 );|
  [ groupoid homomorphism : 
      [ [ [(5,6,7,8) : -39 -> -39], [(5,7) : -39 -> -39], [() : -39 -> -38], 
            [() : -39 -> -37] ], 
        [ [(5,6,7,8) : -36 -> -36], [(5,7) : -36 -> -36], [() : -36 -> -35], 
            [() : -36 -> -34] ] ], groupoid homomorphism : 
      [ [ [(5,6,7,8) : -39 -> -39], [(5,7) : -39 -> -39], [() : -39 -> -38], 
            [() : -39 -> -37] ], 
        [ [(5,6,7,8) : -33 -> -33], [(5,7) : -33 -> -33], [() : -33 -> -32], 
            [() : -33 -> -31] ] ] ]
  !gapprompt@gap>| !gapinput@HDc6 := HomogeneousDiscreteGroupoid( c6, [-27..-24] ); |
  homogeneous, discrete groupoid: < c6, [ -27 .. -24 ] >
  !gapprompt@gap>| !gapinput@Size( HDc6 );   ## 6x4|
  24
  !gapprompt@gap>| !gapinput@RepresentationsOfObject( Gd8 );|
  [ "IsComponentObjectRep""IsAttributeStoringRep""IsMWOSinglePieceRep" ]
  !gapprompt@gap>| !gapinput@RepresentationsOfObject( HGd8 );|
  [ "IsComponentObjectRep""IsAttributeStoringRep""IsPiecesRep" ]
  !gapprompt@gap>| !gapinput@RepresentationsOfObject( HDc6 );|
  [ "IsComponentObjectRep""IsAttributeStoringRep"
    "IsHomogeneousDiscreteGroupoidRep" ]
  !gapprompt@gap>| !gapinput@ktpo := KnownTruePropertiesOfObject( HDc6 );; |
  !gapprompt@gap>| !gapinput@ans := |
  !gapprompt@>| !gapinput@[ "IsDuplicateFree""IsAssociative""IsCommutative", |
  !gapprompt@>| !gapinput@  "IsDiscreteDomainWithObjects""IsHomogeneousDomainWithObjects" ];;|
  !gapprompt@gap>| !gapinput@ForAll( ans, a -> ( a in ktpo ) ); |
  true
  
\end{Verbatim}
 

\subsection{\textcolor{Chapter }{DirectProductOp}}
\logpage{[ 4, 1, 6 ]}\nobreak
\label{sec-directprod}
\hyperdef{L}{X78E8FE0C7F599F5A}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\enspace\texttt{DirectProductOp({\mdseries\slshape list, gpd})\index{DirectProductOp@\texttt{DirectProductOp}}
\label{DirectProductOp}
}\hfill{\scriptsize (operation)}}\\
--> --------------------

--> maximum size reached

--> --------------------

100%


¤ Dauer der Verarbeitung: 0.21 Sekunden  (vorverarbeitet)  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung ist noch experimentell.