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

Quelle  IBNP.tex   Sprache: Latech

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

            \usepackage[all]{xy} 
        
\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{ IBNP \mbox{}}}\\
\vfill

\hypersetup{pdftitle= IBNP }
\markright{\scriptsize \mbox{}\hfill  IBNP  \hfill\mbox{}}
{\Huge \textbf{ Involutive Bases for Noncommutative Polynomials \mbox{}}}\\
\vfill

{\Huge  0.17 \mbox{}}\\[1cm]
{ 11 September 2025 \mbox{}}\\[1cm]
\mbox{}\\[2cm]
{\Large \textbf{ Gareth A. Evans\\
   \mbox{}}}\\
{\Large \textbf{ Christopher D. Wensley\\
   \mbox{}}}\\
\hypersetup{pdfauthor= Gareth A. Evans\\
   ;  Christopher D. Wensley\\
   }
\end{center}\vfill

\mbox{}\\
{\mbox{}\\
\small \noindent \textbf{ Gareth A. Evans\\
   }  Email: \href{mailto://gareth@mathemateg.com} {\texttt{gareth@mathemateg.com}}\\
  Address\begin{minipage}[t]{8cm}\noindent
 Ysgol y Creuddyn \\
 Ffordd Derwen, Bae Penrhyn \\
 Llandudno, LL30 3LB \\
 U.K.\\
 \end{minipage}
}\\
{\mbox{}\\
\small \noindent \textbf{ Christopher D. 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{IBNP} package provides methods for computing an involutive (Gr{\"o}bner) basis $B$ for an ideal $J$ over a polynomial ring $R$ in both the commutative and noncommutative cases. 

Secondly, methods are provided to involutively reduce a given polynomial to
its normal form in $R/J$. 

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/ibnp/issues/} {\texttt{https://github.com/gap\texttt{\symbol{45}}packages/ibnp/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} 2024\texttt{\symbol{45}}2025, Gareth Evans and Chris Wensley.

 The \textsf{IBNP} 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 with 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}{}
{
  The \textsf{IBNP} package provides methods for computing an involutive (Gr{\"o}bner) basis $B$ for an ideal $J$ over a polynomial ring $\mathbb{R}$ in both the commutative and noncommutative cases. Secondly, methods are
provided to involutively reduce a given polynomial to its normal form in $\mathbb{R}/J$. 

 This package was started using \textsf{GAP} 4.13.1 and first released with \textsf{GAP} 4.15.0. 

 The package is loaded with the command 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  
  !gapprompt@gap>| !gapinput@LoadPackage( "ibnp" ); |
  
\end{Verbatim}
 

 The package may be obtained as a compressed \texttt{.tar} file \texttt{IBNP\texttt{\symbol{45}}0.16.tar.gz} from the GitHub release site: \href{https://github.com/gap-packages/ibnp/releases/tag/v0.16} {\texttt{https://github.com/gap\texttt{\symbol{45}}packages/ibnp/releases/tag/v0.16}}. \index{GitHub repository} The package also has a GitHub repository at: \href{https://github.com/gap-packages/ibnp} {\texttt{https://github.com/gap\texttt{\symbol{45}}packages/ibnp}}. 

 Once the package is loaded, the manual \texttt{doc/manual.pdf} can be found in the documentation folder. The \texttt{html} versions, with or without MathJax, may be rebuilt as follows: 

 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  
  !gapprompt@gap>| !gapinput@ReadPackage( "ibnp""makedoc.g" ); |
  
\end{Verbatim}
 

 It is possible to check that the package has been installed correctly by
running the test files (this terminates the \textsf{GAP} session): 

 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  
  !gapprompt@gap>| !gapinput@TestPackage( "ibnp" );|
  Architecture: . . . . . 
  testing: . . . . . 
  . . . 
  #I  No errors detected while testing
  
\end{Verbatim}
 

 
\section{\textcolor{Chapter }{History}}\label{sec-history}
\logpage{[ 1, 1, 0 ]}
\hyperdef{L}{X811375BC7CA25F51}{}
{
  The theoretical basis behind this package is the Ph.D. thesis "Noncommutative
Involutive Bases" of Gareth Evans in 2005 \cite{gareth-thesis}. (The main concepts and results may also be found in the papers \cite{Beaumont} and \cite{EW-JSC}.) We quote here the summary from that thesis.

 \emph{The theory of Gr{\"o}bner Bases originated in the work of Buchberger \cite{buchberger} and is now considered to be one of the most important and useful areas of
symbolic computation. A great deal of effort has been put into improving
Buchberger's algorithm for computing a Gr{\"o}bner Basis, and indeed in
finding alternative methods of computing Gr{\"o}bner Bases. Two of these
methods include the Gr{\"o}bner Walk method \cite{onthewalk} and the computation of Involutive Bases \cite{yuyu}.} 

 \emph{By the mid 1980's, Buchberger's work had been generalised for noncommutative
polynomial rings by Bergman \cite{bergman} and Mora \cite{mora}. This thesis provides the corresponding generalisation for Involutive Bases
and (to a lesser extent) the Gr{\"o}bner Walk, with the main results being as
follows. } 
\begin{itemize}
\item  \emph{Algorithms for several new noncommutative involutive divisions are given,
including strong; weak; global and local divisions.} 
\item  \emph{An algorithm for computing a noncommutative Involutive Basis is given. When
used with one of the aforementioned involutive divisions, it is shown that
this algorithm returns a noncommutative Gr{\"o}bner Basis on termination.} 
\item  \emph{An algorithm for a noncommutative Gr{\"o}bner Walk is given, in the case of
conversion between two harmonious monomial orderings. It is shown that this
algorithm generalises to give an algorithm for performing a noncommutative
Involutive Walk, again in the case of conversion between two harmonious
monomial orderings.} 
\item  \emph{Two new properties of commutative involutive divisions are introduced
(stability and extendibility), respectively ensuring the termination of the
Involutive Basis algorithm and the applicability (under certain conditions) of
homogeneous methods of computing Involutive Bases.} 
\end{itemize}
 

 \emph{Source code for an initial implementation of an algorithm to compute
noncommutative Involutive Bases is provided in Appendix B. This source code,
written using ANSI C and a series of libraries (AlgLib) provided by MSSRC
forms part of a larger collection of programs providing examples for this
thesis, including implementations of the commutative and noncommutative
Gr{\"o}bner Basis algorithms \cite{buchberger}, \cite{mora}; the commutative Involutive Basis algorithm for the Pommaret and Janet
involutive divisions \cite{yuyu}; and the Knuth\texttt{\symbol{45}}Bendix critical pairs completion algorithm
for monoid rewrite systems \cite{knuth-bendix}.} 

 The implementations described in the last paragraph formed a package \emph{Involutive} in 2005. This was based on libraries developed by the \emph{Multidisciplinary Software Systems Research Corporation} (MSSRC) which apparently no longer exists. This software was provided for the
research by Larry Lambe who was an Honorary Professor in the Mathematics
Department at Bangor at that time. (For an example of his work, see \cite{lambe-radford}.) 

 It has long been our intention to make these algorithms available to the wider
symbolic computation community, and this \textsf{GAP} package is the result. Involutive Bases are constructed, but Gr{\"o}bner Walks
will have to wait until a later version. In place of the AlgLib library
functions we use the noncommutative polynomial operations provided by the \textsf{GBNP} \cite{GBNP} package. }

 }

  
\chapter{\textcolor{Chapter }{Using the packages \textsf{GBNP} and \textsf{NMO}}}\label{chap-desc}
\logpage{[ 2, 0, 0 ]}
\hyperdef{L}{X86057870803DCA93}{}
{
  This package deals with polynomials in noncommutative algebras and to do so
makes use of the noncommutative polynomial operations provided by the \textsf{GBNP} \cite{GBNP} package, and orderings provided by the \textsf{NMO} package, which is now included within \textsf{GBNP}. In this chapter we remind users how to call some of these operations. 
\section{\textcolor{Chapter }{Noncommutative polynomials (NPs)}}\label{sec-nps}
\logpage{[ 2, 1, 0 ]}
\hyperdef{L}{X783C6EC87988B533}{}
{
  Recall that the main datatype used by the \textsf{GBNP} package is a list of noncommutative polynomials (NPs). The data type for a
noncommutative polynomial (its NP format) is a list of two lists: 
\begin{itemize}
\item  The first is a list $m$ of monomials. 
\item  The second is a list $c$ of coefficients of these monomials. 
\end{itemize}
 The two lists have the same length. The polynomial represented by the ordered
pair $[m,c]$ is $\sum_i c_i m_i$. A monomial is a list of positive integers. They are interpreted as the
indices of the variables. So, if $k = [1,3,2,2,1]$ and the variables are $x,y,z$ (in this order), then $k$ represents the monomial $xzy^2x$. There are various ways to print these, but the default uses variables $a,b,c,\ldots$. The zero polynomial is represented by \texttt{[[],[]]} and the polynomial $1$ is represented by \texttt{[[[]],[1]]}. The algorithms are applicable for the algebra $\mathbb{F}[x_1,x_2,\ldots,x_t]$ of noncommutative polynomials in \mbox{\texttt{\mdseries\slshape t}} variables over the field $\mathbb{F}$. Accordingly, the list $c$ should contain elements of $\mathbb F$. 

 \index{NP2GP} \index{GP2NP} The \textsf{GBNP} functions \texttt{GP2NP} and \texttt{NP2GP} convert a polynomial to NP format and back again. Polynomials returned by \texttt{NP2GP} print with their coefficients enclosed in brackets. Polynomials may also be
printed using the function \texttt{PrintNP}. The function PrintNPList is used to print a list of NPs, with one polynomial
per line. The function \texttt{CleanNP} is used to collect terms and reorder them. The default ordering is first by
degree and then lexicographically \texttt{\symbol{45}} \texttt{MonomialGrlexOrdering}. Alternative orderings are available \texttt{\symbol{45}} see section \ref{sec-orderings}. 

 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  
  !gapprompt@gap>| !gapinput@A3 := FreeAssociativeAlgebraWithOne(Rationals,"a","b","c");;|
  !gapprompt@gap>| !gapinput@a := A3.1;; b := A3.2;; c := A3.3;;|
  !gapprompt@gap>| !gapinput@## define a polynomial and convert to NP-format|
  !gapprompt@gap>| !gapinput@p1 := 7*a^2*b*c + 8*b*c*a;|
  (8)*b*c*a+(7)*a^2*b*c
  !gapprompt@gap>| !gapinput@Lp1 := GP2NP( p1 );|
  [ [ [ 1, 1, 2, 3 ], [ 2, 3, 1 ] ], [ 7, 8 ] ]
  !gapprompt@gap>| !gapinput@## define an NP-poly; clean it; and convert to a polynomial|
  !gapprompt@gap>| !gapinput@Lp2 := [ [ [1,1], [1,2,1], [3], [1,1], [3,1,2] ], [5,6,7,8,9] ];;|
  !gapprompt@gap>| !gapinput@PrintNP( Lp2 );|
   5a^2 + 6aba + 7c + 8a^2 + 9cab
  !gapprompt@gap>| !gapinput@Lp2 := CleanNP( Lp2 );|
  [ [ [ 3, 1, 2 ], [ 1, 2, 1 ], [ 1, 1 ], [ 3 ] ], [ 9, 6, 13, 7 ] ]
  !gapprompt@gap>| !gapinput@## note the degree lexicographic ordering|
  !gapprompt@gap>| !gapinput@PrintNP( Lp2 );|
   9cab + 6aba + 13a^2 + 7c
  !gapprompt@gap>| !gapinput@p2 := NP2GP( Lp2, A3 );|
  (9)*c*a*b+(6)*a*b*a+(13)*a^2+(7)*c
  !gapprompt@gap>| !gapinput@PrintNPList( [ Lp1, Lp2, [ [], [] ], [ [ [] ], [9] ] ] );|
   7a^2bc + 8bca
   9cab + 6aba + 13a^2 + 7c
   0
   9 
  
\end{Verbatim}
 }

 
\section{\textcolor{Chapter }{Gr{\"o}bner Bases}}\label{sec-grob}
\logpage{[ 2, 2, 0 ]}
\hyperdef{L}{X7E4277497D877661}{}
{
  The \textsf{GBNP} package computes Gr{\"o}bner bases using the function \texttt{SGrobner}. In the example below the polynomials $\{p,q\}$ define an ideal in $\mathbb{Z}[a,b]$ which has a three element Gr{\"o}bner basis. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  
  !gapprompt@gap>| !gapinput@p := [ [ [2,2,2], [2,1], [1,2] ], [1,3,-1] ];;|
  !gapprompt@gap>| !gapinput@q := [ [ [1,1], [2] ], [1,1] ];; |
  !gapprompt@gap>| !gapinput@PrintNPList( [p,q] );|
   b^3 + 3ba - ab
   a^2 + b 
  !gapprompt@gap>| !gapinput@GB := SGrobner( [p,q] );;|
  !gapprompt@gap>| !gapinput@PrintNPList(GB);|
   a^2 + b 
   ba - ab 
   b^3 + 2ab 
  
\end{Verbatim}
 }

 
\section{\textcolor{Chapter }{Orderings for monomials}}\label{sec-orderings}
\logpage{[ 2, 3, 0 ]}
\hyperdef{L}{X7F82A3608248CD31}{}
{
  The three monomial orderings provided by the main \textsf{GAP} library are \texttt{MonomialLexOrdering}, \texttt{MonomialGrlexOrdering} and \texttt{MonomialGrevlexOrdering}. The first of these is the default used by \textsf{GBNP}. 

 The \textsf{NMO} package is now part of the package \textsf{GBNP}. It provides a choice of orderings on monomials, including lexicographic and
length\texttt{\symbol{45}}lexicographic ones. 

 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  
  !gapprompt@gap>| !gapinput@Lp1;|
  [ [ [ 1, 1, 2, 3 ], [ 2, 3, 1 ] ], [ 7, 8 ] ]
  !gapprompt@gap>| !gapinput@Lp2;|
  [ [ [ 3, 1, 2 ], [ 1, 2, 1 ], [ 1, 1 ], [ 3 ] ], [ 9, 6, 13, 7 ] ]
  !gapprompt@gap>| !gapinput@GtNPoly( Lp1, Lp2 );|
  true
  !gapprompt@gap>| !gapinput@## select the lexicographic ordering and reorder p1, p2|
  !gapprompt@gap>| !gapinput@lexord := NCMonomialLeftLexicographicOrdering( A3 );;|
  !gapprompt@gap>| !gapinput@PatchGBNP( lexord );|
  LtNP patched.
  GtNP patched.
  !gapprompt@gap>| !gapinput@Lp1 := CleanNP( Lp1 );|
  [ [ [ 2, 3, 1 ], [ 1, 1, 2, 3 ] ], [ 8, 7 ] ]
  !gapprompt@gap>| !gapinput@Lp2 := CleanNP( Lp2 );|
  [ [ [ 3, 1, 2 ], [ 3 ], [ 1, 2, 1 ], [ 1, 1 ] ], [ 9, 7, 6, 13 ] ]
  !gapprompt@gap>| !gapinput@GtNPoly( Lp1, Lp2 );|
  false
  !gapprompt@gap>| !gapinput@## revert to degree lex order|
  !gapprompt@gap>| !gapinput@UnpatchGBNP();;|
  LtNP restored.
  GtNP restored.
  !gapprompt@gap>| !gapinput@Lp1 := CleanNP( Lp1 );|
  [ [ [ 1, 1, 2, 3 ], [ 2, 3, 1 ] ], [ 7, 8 ] ]
  !gapprompt@gap>| !gapinput@Lp2 := CleanNP( Lp2 );|
  [ [ [ 3, 1, 2 ], [ 1, 2, 1 ], [ 1, 1 ], [ 3 ] ], [ 9, 6, 13, 7 ] ]
  !gapprompt@gap>| !gapinput@GtNPoly( Lp1, Lp2 );|
  true
  
\end{Verbatim}
 }

 }

  
\chapter{\textcolor{Chapter }{Commutative Involutive Bases}}\label{chap-ibases-cp}
\logpage{[ 3, 0, 0 ]}
\hyperdef{L}{X780AAD6F8095AE49}{}
{
  Given a Gr{\"o}bner Basis $G$ for an ideal $J$ over a polynomial ring $\mathbb{R}$, the remainder of any polynomial $p \in \mathbb{R}$ with respect to $G$ is unique. Although this remainder is unique, there may be many ways of
finding it, as it is possible that several polynomials in $G$ divide $p$, each giving a \emph{reduction path} for $p$. 
\section{\textcolor{Chapter }{Reduction Paths}}\label{sec-cib}
\logpage{[ 3, 1, 0 ]}
\hyperdef{L}{X7BBDABD3799443BB}{}
{
  
\subsection{\textcolor{Chapter }{An Example}}\label{subs-ch4ex402}
\logpage{[ 3, 1, 1 ]}
\hyperdef{L}{X7B5623E3821CC0D0}{}
{
  Consider the DegLex Gr{\"o}bner basis $G := \{g_1, g_2, g_3\} = \{a^2-2ab+3, \: 2ab+b^2+5, \:
\frac{5}{4}b^3-\frac{5}{2}a+\frac{37}{4}b\}$ over the polynomial ring $\mathbb{Q}[a,b]$, and consider the polynomial $p := a^2b+b^3+8b$. The remainder of $p$ with respect to $G$ is $0$ (so that $p$ is a member of the ideal $J$ generated by $G$), but there are two ways of obtaining this remainder, as shown in the
following diagram. 
\[ \vcenter{\xymatrix{ & a^2b+b^3+8b \ar[dl]_{g_1} \ar[dr]^{g_2} \\ 2ab^2+b^3+5b
\ar[d]_{g_2} && -\frac{1}{2}ab^2 + b^3 - \frac{5}{2}a+8b \ar[d]^{g_2} \\ 0 &&
\frac{5}{4}b^3-\frac{5}{2}a+\frac{37}{4}b \ar[d]^{g_3} \\ && 0 }} \]
 }

 An \emph{Involutive Basis} for $J$ is a Gr{\"o}bner Basis $G$ such that there is only \emph{one} possible reduction path for any polynomial $p \in \mathbb{R}$. In order to find such a basis, we restrict which reductions or divisions may
take place by requiring, for each potential reduction of a polynomial $p$ by a polynomial $g_i \in G$ (so that $LM(p) = LM(g_i)\times u$ for some monomial $u$), some extra conditions on the variables in $u$ to be satisfied, namely that all variables in $u$ have to be in a set of \emph{multiplicative variables} for $g_i$, a set that is determined by a particular choice of an \emph{involutive division}. }

 
\section{\textcolor{Chapter }{Commutative Involutive Divisions}}\label{sec-invdivc}
\logpage{[ 3, 2, 0 ]}
\hyperdef{L}{X7E43F2087BC8B4F9}{}
{
  Recall that a commutative monomial $u$ is divisible by another monomial $w$ if there exists a third monomial $u'$ such that $u = wu'$. We use the notation $w \mid u$ and refer to $w$ as a \emph{conventional} \index{conventional divisor} divisor of $u$. An involutive division $I$ partitions the variables in the polynomial ring into sets of \emph{multiplicative} and \emph{nonmultiplicative} variables for each polynomial. The set of multiplicative variables for $w$ is denoted by $M_I(w)$. Then $w$ is an \emph{involutive divisor} of $u$, \index{involutive divisor} written $w \mid_I u$, if all variables in $u'$ are in $M_I(w)$.
\subsection{\textcolor{Chapter }{Example}}\label{subs-ch4ex411}
\logpage{[ 3, 2, 1 ]}
\hyperdef{L}{X85861B017AEEC50B}{}
{
  Let $u := ab^3c$, $v := abc^3$ and $w := bc$ be three monomials over the polynomial ring $\mathbb{R} := \mathbb{Q}[a,b,c]$. Let an involutive division $I$ partition the variables in $\mathbb{R}$ into the following two sets of variables for the monomial $w$: multiplicative = $\{a,b\}$; nonmultiplicative = $\{c\}$. It is true that $w$ conventionally divides both monomials $u$ and $v$, but $w$ only involutively divides monomial $u$ as, defining $u' := ab^2$ and $v' := ac^2$ (so that $u = wu'$ and $v = wv'$), we observe that all variables in $u'$ are in $M_I(w)$, but the variables in $v'$ (in particular the variable $c$) are not all in $M_I(w)$. So $w \mid_I u$ and $w \nmid_I v$. }

 
\subsection{\textcolor{Chapter }{Selecting a Division}}\label{subs-select-divcp}
\logpage{[ 3, 2, 2 ]}
\hyperdef{L}{X83A3B3F77C712DA1}{}
{
  \index{CommutativeDivision} The global variable \texttt{CommutativeDivision} is a string which can take values "Pommaret""Thomas" or "Janet". The default
is "Pommaret". The example shows how to select the Pommaret division. }

 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  
  !gapprompt@gap>| !gapinput@CommutativeDivision := "Pommaret";|
  "Pommaret"
  
\end{Verbatim}
 
\subsection{\textcolor{Chapter }{Selecting an Ordering}}\label{subs-select-ordcp}
\logpage{[ 3, 2, 3 ]}
\hyperdef{L}{X785D706A86DD7343}{}
{
  \index{orderings} These three divisions are defined for a set of monomials, but we shall define
\texttt{DivisionRecord} below for a set of polynomials. The first step is therefore to select the
leading monomials from this set, and that will bepend of the \emph{ordering} chosen. We shall be using the orderings provided by the main \textsf{GAP} library as described in \ref{sec-orderings}. 

 When calling \texttt{MonomialLexOrdering}, \texttt{MonomialGrlexOrdering} etc., it is essential to provide a list of indeterminates, as shown in the
example. Otherwise some of the functions in this package will throw an error. }

 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  
  !gapprompt@gap>| !gapinput@R := PolynomialRing( Rationals, [ "x""y""z" ] );;|
  !gapprompt@gap>| !gapinput@x := R.1;; y := R.2;; z := R.3;;|
  !gapprompt@gap>| !gapinput@ord := MonomialLexOrdering( [x,y,z] );;|
  
\end{Verbatim}
 

\subsection{\textcolor{Chapter }{PommaretDivision}}
\logpage{[ 3, 2, 4 ]}\nobreak
\hyperdef{L}{X82712BA57EBE9170}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\enspace\texttt{PommaretDivision({\mdseries\slshape alg, mons, order})\index{PommaretDivision@\texttt{PommaretDivision}}
\label{PommaretDivision}
}\hfill{\scriptsize (operation)}}\\


 Let $\mathbb{R} = \mathbb{F}[a_1,\ldots,a_n]$ with $a_1 > a_2 > \ldots > a_n$, and let $w$ be a polynomial in $\mathbb{R}$ with leading monomoial $a_1^{e_1}a_2^{e_2} \ldots a_n^{e_n}$ where $e_i$ is the \emph{first} non\texttt{\symbol{45}}zero exponent. The Pommaret involutive division $\mathbb{P}$ sets $M_{\mathbb{P}}(w) = \{a_1, a_2, \ldots, a_i\}$. 

 Because $M_{\mathbb{P}}(w)$ does not depend in any way on the other leading monomials in \emph{polys}, this is a \emph{global} division. 

 In the example the first five monomials $u_i$ in $U$ contain a power of $x$, so $M_{\mathbb{P}}(u_i) = \{x\}$. Then $u_6$ involves $y$ and $z$, so $M_{\mathbb{P}}(u_6) = \{x,y\}$, and similarly $M_{\mathbb{P}}(u_7) = \{x,y,z\}$. 

 }

 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  
  !gapprompt@gap>| !gapinput@U := [ x^5*y^2*z, x^4*y*z^2, x^2*y^2*z, x*y*z^3, x*z^3, y^2*z, z ];|
  [ x^5*y^2*z, x^4*y*z^2, x^2*y^2*z, x*y*z^3, x*z^3, y^2*z, z ]
  !gapprompt@gap>| !gapinput@PommaretDivision( R, U, ord );|
  [ [ 1 ], [ 1 ], [ 1 ], [ 1 ], [ 1 ], [ 1, 2 ], [ 1 .. 3 ] ]
  
  
\end{Verbatim}
 

\subsection{\textcolor{Chapter }{ThomasDivision}}
\logpage{[ 3, 2, 5 ]}\nobreak
\hyperdef{L}{X8756720A86A6B125}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\enspace\texttt{ThomasDivision({\mdseries\slshape alg, mons, order})\index{ThomasDivision@\texttt{ThomasDivision}}
\label{ThomasDivision}
}\hfill{\scriptsize (operation)}}\\


 Let $\mathbb{R} = \mathbb{F}[a_1,\ldots,a_n]$ with $a_1 > a_2 > \ldots > a_n$, and let $P$ be a set of polynomials $P = \{p_1,\ldots,p_m\}$ in $\mathbb{R}$ with leading monomials $U = \{u_1,\ldots,u_m\}$ where $u_i = a_1^{e^1_i}a_2^{e^2_i} \ldots a_n^{e^n_i}$. The Thomas involutive division $\mathbb{T}$ sets $a_i$ to be multiplicative for $p_j$ and $u_j$ if $e^i_j = \max_k e^i_k$ for all $1 \leqslant k \leqslant m$. 

 In the example, using the same seven monomials, the highest powers of $[x,y,z]$ are $[5,2,3]$ respectively. So $x$ is multiplicative only for $u_1$, $y$ is multiplicative for $\{u_1,u_3,u_6\}$, and $z$ is multiplicative only for $u_4$ and $u_5$. Note that two of the monomials have no multiplicative variable. 

 }

 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  
  !gapprompt@gap>| !gapinput@ThomasDivision( R, U, ord );|
  [ [ 1, 2 ], [  ], [ 2 ], [ 3 ], [ 3 ], [ 2 ], [  ] ]
  
\end{Verbatim}
 

\subsection{\textcolor{Chapter }{JanetDivision}}
\logpage{[ 3, 2, 6 ]}\nobreak
\hyperdef{L}{X7E214DDF794BB14D}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\enspace\texttt{JanetDivision({\mdseries\slshape alg, mons, order})\index{JanetDivision@\texttt{JanetDivision}}
\label{JanetDivision}
}\hfill{\scriptsize (operation)}}\\


 Let $\mathbb{R} = \mathbb{F}[a_1,\ldots,a_n]$ with $a_1 > a_2 > \ldots > a_n$, and let $P$ be a set of polynomials $P = \{p_1,\ldots,p_m\}$ in $\mathbb{R}$ with leading monomials $U = \{u_1,\ldots,u_m\}$ where $u_i = a_1^{e^1_i}a_2^{e^2_i} \ldots a_n^{e^n_i}$. The Janet involutive division $\mathbb{J}$ sets $a_n$ to be multiplicative for $u_j$ provided $e^n_j = \max_k e^n_k$ for all $1 \leqslant k \leqslant m$. To determine whether $a_i$ is multiplicative for $u_j$, let $L = [e^{i+1}_j,e^{i+2}_j,\ldots,e^n_j]$. Let $S$ be the subset of $\{1,\ldots,m\}$ containing those $k$ such that $[e^{i+1}_k,e^{i+2}_k,\ldots,e^n_k] = L$. Then $a_i$ is multiplicative for $u_j$ provided $e^i_j = \max_{k \in S}e^i_k$. 

 In the example, recall that the exponent lists for the seven monomials are 
\[ [5,2,1],~~~ [4,1,2],~~~ [2,2,1],~~~ [1,1,3],~~~ [1,0,3],~~~ [0,2,1],~~~
[0,0,1]. \]
 As with the Thomas division, $\max_k e^3_k = 3$ and $z$ is multiplicative only for $u_4$ and $u_5$. 

 For $y$, $L = [1]$ when $k \in \{1,3,6,7\}$ and $\max_{\{1,3,6,7\}} e^2_k = 2$, so $y$ is multiplicative for $u_1, u_3$ and $u_6$, but not for $u_7$. $L = [2]$ only for $u_2$, so $y$ is multiplicative for $u_2$. $L = [3]$ for $u_4$ and $u_5$, and $e^2_4 > e^2_5$, so $y$ is multiplicative for $u_4$ but not $u_5$. 

 For $x$, $L = [2,1]$ for $k \in \{1,3,6\}$ and $e^1_1 = 5$ is greater than $e^1_3$ and $e^1_6$, so $x$ is multiplicative for $u_1$. The other values for $L$, namely $[1,2], [1,3], [0,3]$ and $[0,1]$, occur just once each, so $x$ is multiplicative for $u_2, u_4, u_5$ and $u_7$. 

 }

 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  
  !gapprompt@gap>| !gapinput@JanetDivision( R, U, ord );|
  [ [ 1, 2 ], [ 1, 2 ], [ 2 ], [ 1, 2, 3 ], [ 1, 3 ], [ 2 ], [ 1 ] ]
  
\end{Verbatim}
 

\subsection{\textcolor{Chapter }{DivisionRecord}}
\logpage{[ 3, 2, 7 ]}\nobreak
\hyperdef{L}{X8781FDB7865FA48B}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\enspace\texttt{DivisionRecord({\mdseries\slshape alg, polys, order})\index{DivisionRecord@\texttt{DivisionRecord}}
\label{DivisionRecord}
}\hfill{\scriptsize (function)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\enspace\texttt{DivisionRecordCP({\mdseries\slshape alg, polys, order})\index{DivisionRecordCP@\texttt{DivisionRecordCP}}
\label{DivisionRecordCP}
}\hfill{\scriptsize (operation)}}\\


 The global function \texttt{DivisionRecord} calls one of the operations \texttt{DivisionRecordCP} and \texttt{DivisionRecordNP}, depending on whether the algebra is commutative or not. In the commutative
case, this function finds the sets of multiplicative variables for a set of
polynomials using one of the involutive divisions listed above. The record
constructed has three fields: the chosen division; a list of lists of
positions of the multiplicative variables; and the set of polynomials. 

 In the following example, polynomials $\{u = b^3-3a, v=a^3-3b\}$ define an ideal and form a Gr{\"o}bner basis for that ideal. Using the
Pommaret division, $M_{\mathbb{P}}(u) = \{a,b\}$ and $M_{\mathbb{P}}(v) = \{a\}$. The variable \texttt{drec2.mvars} in the listing below contains the \emph{positions} of these variables in the generating set $\{a,b\}$. }

 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  
  !gapprompt@gap>| !gapinput@R := PolynomialRing( Rationals, [ "a""b" ] );;|
  !gapprompt@gap>| !gapinput@a := R.1;; b := R.2;;|
  !gapprompt@gap>| !gapinput@L2 := [ b^3 - 3*a, a^3 - 3*b ];;|
  !gapprompt@gap>| !gapinput@ord := MonomialGrlexOrdering( [a,b] );;|
  !gapprompt@gap>| !gapinput@GB2 := ReducedGroebnerBasis( L2, ord );;|
  !gapprompt@gap>| !gapinput@GB2 = L2;|
  true
  !gapprompt@gap>| !gapinput@CommutativeDivision := "Pommaret";;|
  !gapprompt@gap>| !gapinput@drec2 := DivisionRecordCP( R, L2, ord );|
  rec( div := "Pommaret", mvars := [ [ 1, 2 ], [ 1 ] ], 
    polys := [ b^3-3*a, a^3-3*b ] )
  
\end{Verbatim}
 In the \emph{reduction diagrams} below the nodes $(j,k)$ represent the monomials $a^jb^k$. The lead monomials of $u$ and $v$ are marked by these two names. In the left hand diagram the two shaded areas
indicate those monomials which are conventionally reducible by $u$ and by $v$, so that the doubly shaded area contains those monomials which are
conventionally reducible by both. For an involutive division, this must be
avoided. 

 In the right\texttt{\symbol{45}}hand diagram we see that $u$ involutively divides the same set of monomials in the main shaded area. On the
other hand $v$ just involutively divides monomials $\{a^j \mid j \ge 3\}$. So none of the monomials $\{a^jb, a^jb^2 \mid j \ge 3\}$ reduce by $v$ involutively. The operation \texttt{InvolutiveBasis}, to be described below, produces two further polynomials, $w = vb = a^3b-3b^2$ and $vb^2$ which reduces by $u$ to $x = a^3b^2 - 9a$. Both $w$ and $x$ have multiplicative variables $\{a\}$ and the monomials which they can reduce lie on the two horizantal line
segments in the right\texttt{\symbol{45}}hand diagram. In this way, all the
conventionally reducible monomials are involutively reducible by just one of $\{u,v,w,x\}$

 
\[ \vcenter{\xymatrix@=1em{ b & & & \ar@{-}[ddddrrrr] & \ar@{-}[dddrrr] &
\ar@{-}[ddrr] & \ar@{-}[dr] & & & & b & & & & & & & \\ : \ar[u] \ar@{-}[ur] &
\cdot & \cdot & \cdot \ar@{-}[ddddrrrr] & \cdot & \cdot & \cdot & & & & :
\ar[u] \ar@{-}[ur] & \cdot & \cdot & \cdot & \cdot & \cdot & \cdot & \\ 5
\ar@{-}[u] \ar@{-}[uurr] & \cdot & \cdot & \cdot \ar@{-}[ddddrrrr] & \cdot &
\cdot & \cdot & & & & 5 \ar@{-}[u] \ar@{-}[uurr] & \cdot & \cdot & \cdot &
\cdot & \cdot & \cdot & \\ 4 \ar@{-}[u] \ar@{-}[uuurrr] & \cdot & \cdot &
\cdot \ar@{-}[ddddrrrr] & \cdot & \cdot & \cdot & & & & 4 \ar@{-}[u]
\ar@{-}[uuurrr] & \cdot & \cdot & \cdot & \cdot & \cdot & \cdot & \\ u
\ar@{-}[u] \ar@{-}[rrrrrrr] \ar@{-}[uuuurrrr] & \cdot \ar@{-}[uuuurrrr] &
\cdot \ar@{-}[uuuurrrr] & \cdot \ar@{-}[dddrrr] \ar@{-}[uuuurrrr] & \cdot
\ar@{-}[uuurrr] & \cdot \ar@{-}[uurr] & \cdot \ar@{-}[ur] & & & & u \ar@{-}[u]
\ar@{-}[rrrrrrr] \ar@{-}[uuuurrrr] & \cdot \ar@{-}[uuuurrrr] & \cdot
\ar@{-}[uuuurrrr] & \cdot \ar@{-}[uuuurrrr] & \cdot \ar@{-}[uuurrr] & \cdot
\ar@{-}[uurr] & \cdot \ar@{-}[ur] & & \\ 2 \ar@{-}[u] & \cdot & \cdot & \cdot
\ar@{-}[ddrr] & \cdot & \cdot & \cdot & & & & 2 \ar@{-}[u] & \cdot & \cdot & x
\ar@{-}[rrrr]& \cdot & \cdot & \cdot & \\ 1 \ar@{-}[u] & \cdot & \cdot & \cdot
\ar@{-}[dr] & \cdot & \cdot & \cdot & & & & 1 \ar@{-}[u] & \cdot & \cdot & w
\ar@{-}[rrrr] & \cdot & \cdot & \cdot & \\ 0 \ar@{-}[r]\ar@{-}[u] & 1
\ar@{-}[r] & 2 \ar@{-}[r] & v \ar@{-}[r] \ar@{-}[uuuuuuu] & 4 \ar@{-}[r] & 5
\ar@{-}[r] & \cdots \ar[r] & a & & & 0 \ar@{-}[r]\ar@{-}[u] & 1 \ar@{-}[r] & 2
\ar@{-}[r] & v \ar@{-}[r] & 4 \ar@{-}[r] & 5 \ar@{-}[r] & \cdots \ar[r] & a }} \]
 

 The polynomial $p = a^3b^3 + 2a^3b + 3ab^3$ reduces involutively as follows. 
\[ p \stackrel{u}{\longrightarrow} 3a^4 + 2a^3b + 3ab^3
\stackrel{v}{\longrightarrow} 2a^3b + 3ab^3 + 9ab
\stackrel{w}{\longrightarrow} 3ab^3 + 9ab + 6b^2 \stackrel{u}{\longrightarrow}
9a^2 + 9ab + 6b^2 \]
 This reduction is computed in section \ref{InvolutiveBasis}. 

\subsection{\textcolor{Chapter }{IPolyReduce}}
\logpage{[ 3, 2, 8 ]}\nobreak
\hyperdef{L}{X79F5892C80AE2667}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\enspace\texttt{IPolyReduce({\mdseries\slshape algebra, polynomial, DivisionRecord, order})\index{IPolyReduce@\texttt{IPolyReduce}}
\label{IPolyReduce}
}\hfill{\scriptsize (function)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\enspace\texttt{IPolyReduceCP({\mdseries\slshape algebra, polynomial, DivisionRecord, order})\index{IPolyReduceCP@\texttt{IPolyReduceCP}}
\label{IPolyReduceCP}
}\hfill{\scriptsize (operation)}}\\


 The global function \texttt{IPolyReduce} calls one of the operations \texttt{IPolyReduceCP} and \texttt{IPolyReduceNP} depending on whether the algebra is commutative or not. This function reduces
a polynomial $p$ using the current overlap record for a basis, and an ordering. 

 In the example, using \texttt{drec2}, the polynomial $p$ reduces only to $2a^3b+9a^2+9ab$ 
\[ p \stackrel{u}{\longrightarrow} 3a^4 + 2a^3b + 3ab^3
\stackrel{v}{\longrightarrow} 2a^3b + 3ab^3 + 9ab
\stackrel{u}{\longrightarrow} 2a^3b + 9a^2 + 9ab \]
 because the polynomial $x$ is not available to reduce $2a^3b$ to $6b^2$. }

 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  
  !gapprompt@gap>| !gapinput@p := a^3*b^3 + 2*a^3*b + 3*a*b^3;;|
  !gapprompt@gap>| !gapinput@q := IPolyReduce( R, p, drec2, ord );|
  2*a^3*b+9*a^2+9*a*b
  
\end{Verbatim}
 

\subsection{\textcolor{Chapter }{LoggedIPolyReduce}}
\logpage{[ 3, 2, 9 ]}\nobreak
\hyperdef{L}{X7A36AE827C4012FF}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\enspace\texttt{LoggedIPolyReduce({\mdseries\slshape algebra, polynomial, DivisionRecord, order})\index{LoggedIPolyReduce@\texttt{LoggedIPolyReduce}}
\label{LoggedIPolyReduce}
}\hfill{\scriptsize (function)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\enspace\texttt{LoggedIPolyReduceCP({\mdseries\slshape algebra, polynomial, DivisionRecord, order})\index{LoggedIPolyReduceCP@\texttt{LoggedIPolyReduceCP}}
\label{LoggedIPolyReduceCP}
}\hfill{\scriptsize (operation)}}\\


 The global function \texttt{LoggedIPolyReduce} calls one of the operations \texttt{LoggedIPolyReduceCP} and \texttt{LoggedIPolyReduceNP} depending on whether the algebra is commutative or not. This function is
similar to \texttt{IPolyReduce}, reducing a polynomial $p$ using the current overlap record for a basis, and an ordering. It's output,
however, is a record containing, as well as the reduced polynomial $r$, logging information which shows how the reduction has been obtained: 
\[ p ~=~ r + \sum_i logs[i] * polys[i]. \]
 

 In the example \texttt{r.result} is equal to the previous result $q$, and the equation above is verified: 
\[ a^3b^3 + 2a^3b + 3ab^3 ~=~ (2a^3b+9a^2+9ab) + (a^3+3a)(b^3-3a) + 3a(a^3-3b). \]
 }

 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  
  !gapprompt@gap>| !gapinput@r := LoggedIPolyReduceCP( R, p, drec2, ord );|
  rec( logs := [ a^3+3*a, 3*a ], polys := [ b^3-3*a, a^3-3*b ], 
    result := 2*a^3*b+9*a^2+9*a*b )
  !gapprompt@gap>| !gapinput@r.result = q;|
  true
  !gapprompt@gap>| !gapinput@p = r.result + r.logs[1]*r.polys[1] + r.logs[2]*r.polys[2];|
  true
  
\end{Verbatim}
 

\subsection{\textcolor{Chapter }{IAutoreduce}}
\logpage{[ 3, 2, 10 ]}\nobreak
\hyperdef{L}{X7C58A339832877E9}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\enspace\texttt{IAutoreduce({\mdseries\slshape alg, polys, order})\index{IAutoreduce@\texttt{IAutoreduce}}
\label{IAutoreduce}
}\hfill{\scriptsize (function)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\enspace\texttt{IAutoreduceCP({\mdseries\slshape alg, polys, order})\index{IAutoreduceCP@\texttt{IAutoreduceCP}}
\label{IAutoreduceCP}
}\hfill{\scriptsize (operation)}}\\


 The global function \texttt{IAutoreduce} calls one of the operations \texttt{IAutoreduceCP} and \texttt{IAutoreduceNP} depending on whether the algebra is commutative or not. This function applies \texttt{IPolyReduce} to a list of polynomials recursively until no more reductions are possible.
More specifically, this function involutively reduces each member of a list of
polynomials with respect to all the other members of the list, removing the
polynomial from the list if it reduces involutively to $0$. This process is iterated until no more reductions are possible. 

 If no reduction takes place, so that the result is equal to the initial list
of polynomials, then \texttt{true} is returned. 

 In the example we form \texttt{L3} by adding $p$ to \texttt{L2}. On applying \texttt{IAutoreduceCP}, only $p$ reduces, and the concatenation of \texttt{L2} with $q$ is returned. Starting with \texttt{L4 = [u,v,w,x]}, there are no reductions, and \texttt{true} is returned. 

 }

 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  
  !gapprompt@gap>| !gapinput@L3 := Concatenation( L2, [p] );;|
  !gapprompt@gap>| !gapinput@IAutoreduceCP( R, L3, ord );|
  [ b^3-3*a, a^3-3*b, 2*a^3*b+9*a^2+9*a*b ]
  !gapprompt@gap>| !gapinput@L4 := Concatenation( L2, [ a^3*b-3*b^2, a^3*b^2-9*a ] );;|
  !gapprompt@gap>| !gapinput@IAutoreduceCP( R, L4, ord );|
  true
  
\end{Verbatim}
 }

 
\section{\textcolor{Chapter }{Computing a Commutative Involutive Basis}}\label{sec-compibc}
\logpage{[ 3, 3, 0 ]}
\hyperdef{L}{X864907F987701716}{}
{
  The involutive algorithm for constructing an involutive basis uses \emph{prolongations} an\emph{autoreduction}. 
\subsection{\textcolor{Chapter }{Prolongations and Autoreduction}}\label{subs-prolong}
\logpage{[ 3, 3, 1 ]}
\hyperdef{L}{X7ACAA0847CC0DBCC}{}
{
  Given a set of polynomials $P$, a \emph{prolongation} of $ p \in P$ is a product $pa_i$ where the generator $a_i$ is \emph{not} multiplicative with respect to the current involutive division. 

 A set of polynomials $P$ is said to be \emph{autoreduced} if no polynomial $p \in P$ contains a term which is involutively divisible by some polynomial $p' \in P \setminus \{p\}$.

 We denote by $rem_I(p,Q)$ the involutive remainder of polynomial $p$ with respect to a set of polynomials $Q$. Here is the \emph{Commutative Autoreduction Algorithm}: 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=]
  Input: a set of polynomials P = {p_1,p_2,...,p_n} and an involutive division I 
    while there exists p_i in P such that rem_I(p_i, P\{p_i}) <> p_i do
      q := Rem_I(p_i, P\{p_i});
      P := P\{p_i};
      if (q<>0) then
        P := P union {q};
      fi;
    od;
    return P;
\end{Verbatim}
 

 It can be shown that if $P$ is a set of polynomials over a polynomial ring $\mathbb{R} = \mathbb{F}[a_1,\ldots,a_n]$, such that $P$ is autoreduced with respect to an involutive division $I$, and if $p,q$ are two polynomials in $\mathbb{R}$, then $rem_I(p,P) + rem_I(q,P) = rem_I(p+q,P)$

 Given an involutive division $I$ and an admissible monomial ordering $O$, an autoreduced set of polynomials $P$ is a \emph{locally involutive basis} with respect to $I$ and $O$ if any prolongation of any $p_i \in P$ involutively reduces to zero using $P$. Further, $P$ is an \emph{involutive basis} with respect to $I$ and $O$ if any multiple $p_it$ of any $p_i \in P$ by any term $t$ involutively reduces to zero using $P$. 

 The \emph{Commutative Involutive Basis Algorithm}: 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=]
  Input: a basis F = {f_1,f_2,...,f_m} for an ideal J 
         over a commutative polynomial ring R[a_1,...,a_n];
         an admissible monomial ordering O; 
         a continuous and constructive involutive division I 
  Output: an involutive basis G = {g_1,g_2,...,g_k} for J (if it terminates)
    G := { };
    F := autoreduction of F with respect to O and I;
    while G = { } do
      P := set of all prolongations f_i*a_j, 1<=i<=m, 1<=j<=n;
      q := 0;
      while (P <> { }) and (q=0) do
        p := a polynomial in P with minimal lead monomial w.r.t. O;
        P := P {p};
        q := rem_I(p,F);
      od;
      if (q <> 0) then  ## new basis element found
        F := autoreduction of (F union {q})
      else  ## all the prolongations have reduced to zero
        G := F;
      fi;
    od;
    return G;
\end{Verbatim}
 

 }

 

\subsection{\textcolor{Chapter }{InvolutiveBasis}}
\logpage{[ 3, 3, 2 ]}\nobreak
\hyperdef{L}{X7B60A306820D4ED2}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\enspace\texttt{InvolutiveBasis({\mdseries\slshape alg, polys, order})\index{InvolutiveBasis@\texttt{InvolutiveBasis}}
\label{InvolutiveBasis}
}\hfill{\scriptsize (function)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\enspace\texttt{InvolutiveBasisCP({\mdseries\slshape alg, polys, order})\index{InvolutiveBasisCP@\texttt{InvolutiveBasisCP}}
\label{InvolutiveBasisCP}
}\hfill{\scriptsize (operation)}}\\


 The global function \texttt{InvolutiveBasis} calls one of the operations \texttt{InvolutiveBasisCP} and \texttt{InvolutiveBasisNP} depending on whether the algebra is commutative or not. This function finds an
involutive basis for the ideal generated by a set of polynomials, using a
chosen ordering, and returns a division record. 

 Any involutive basis returned by this algorithm is a Gr{\"o}bner basis, and
remainders are involutively unique with respect to this basis. 

 }

 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  
  !gapprompt@gap>| !gapinput@ibasP := InvolutiveBasis( R, L2, ord );|
  rec( div := "Pommaret", mvars := [ [ 1, 2 ], [ 1 ], [ 1 ], [ 1 ] ], 
    polys := [ b^3-3*a, a^3-3*b, a^3*b-3*b^2, a^3*b^2-9*a ] )
  !gapprompt@gap>| !gapinput@r := IPolyReduce( R, p, ibasP, ord );|
  9*a^2+9*a*b+6*b^2
  
\end{Verbatim}
 Here we have returned to the example in section \ref{DivisionRecord}. Starting with $F=\{u,v\}$, there is only one prolongation, $P=\{w=vb\}$, and $F$ becomes $\{u,v,w\}$. At the second iteration, $P=\{vb,wb\}$; $vb$ reduces to zero; $wb$ reduces to $x=a^3b^2-9a$; and $F$ becomes $\{u,v,w,x\}$. At the third iteration $P=\{vb,wb,xb\}$ and all three of these reduce to zero, so $G = F$ is returned. 

 It is then shown that the multiplicative variables for $\{u,v,w,x\}$ are $\{\{a,b\},\{a\},\{a\},\{a\}\}$. 

 Finally, the full reduction $r$ of $p$ is computed. 

 If, instead of the Pommaret division, we use Janet or Thomas we obtain: 

 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  
  !gapprompt@gap>| !gapinput@CommutativeDivision := "Janet";;|
  !gapprompt@gap>| !gapinput@ibasJ := InvolutiveBasis( R, L2, ord );;|
  !gapprompt@gap>| !gapinput@( ibasJ.mvars = ibasP.mvars ) and ( ibasJ.polys = ibasP.polys );|
  true
  !gapprompt@gap>| !gapinput@CommutativeDivision := "Thomas";;|
  !gapprompt@gap>| !gapinput@ibasT := InvolutiveBasis( R, L2, ord );|
  rec( div := "Thomas"
    mvars := [ [ 2 ], [ 1 ], [ 2 ], [ 1 ], [ 2 ], [ 1 ], [ 1, 2 ] ], 
    polys := [ b^3-3*a, a^3-3*b, a*b^3-3*a^2, a^3*b-3*b^2, a^2*b^3-9*b, 
        a^3*b^2-9*a, a^3*b^3-9*a*b ] )
  
\end{Verbatim}
 The Janet division gives the same involutive basis as Pommaret, but the Thomas
Division produces $7$, rather than $4$ polynomials: 
\[ [u,v,y,w,z,x,t] ~=~ [~ b^3-3a,a^3-3b,ab^3-3a^2,a^3b-3b^2,a^2b^3-9b,java.lang.NullPointerException
a^3b^2-9a,a^3b^3-9ab ~]. \]
 

 The multiplicative variables for these polynomials are $[ \{b\}\{a\}\{b\}\{a\}\{b\}\{a\}\{a,b\} ]$, so the reduction diagram for the Thomas basis is: 
\[ \vcenter{\xymatrix@=1em{ b & & & & & & & & \\ : \ar[u] & ;\cdot & \cdot & \cdot
\ar@{-}[ur] & \cdot & \cdot & \cdot & & \\ 5 \ar@{-}[u] & \cdot & \cdot &
\cdot \ar@{-}[uurr] & \cdot & \cdot & \cdot & & \\ 4 \ar@{-}[u] & \cdot &
\cdot & \cdot \ar@{-}[uuurrr] & \cdot & \cdot & \cdot & & \\ u \ar@{-}[u] & y
\ar@{-}[uuuu] & z \ar@{-}[uuuu] & t \ar@{-}[uuuurrrr] \ar@{-}[uuuu]
\ar@{-}[rrrr] & \cdot \ar@{-}[uuurrr] & \cdot \ar@{-}[uurr] & \cdot
\ar@{-}[ur] & & \\ 2 \ar@{-}[u] & \cdot & \cdot & x \ar@{-}[rrrr] & \cdot &
\cdot & \cdot & & \\ 1 \ar@{-}[u] & \cdot & \cdot & w \ar@{-}[rrrr] &&nbsp;\cdot &
\cdot & \cdot & & \\ 0 \ar@{-}[r]\ar@{-}[u] & 1 \ar@{-}[r] & 2 \ar@{-}[r] &&nbsp;v
\ar@{-}[r] & 4 \ar@{-}[r] & 5 \ar@{-}[r] & \cdots \ar[r] & a & }} \]
 The reduction of $p$ with this basis is: 
\[ p = a^3b^3 + 2a^3b + 3ab^3 \stackrel{t}{\longrightarrow} 2a^3b + 3ab^3 + 9ab
\stackrel{w}{\longrightarrow} 3ab^3 + 9ab + 6b^2 \stackrel{y}{\longrightarrow}
9a^2 + 9ab + 6b^2. \]
 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  
  !gapprompt@gap>| !gapinput@r := LoggedIPolyReduceCP( R, p, ibasT, ord );|
  rec( logs := [ 0, 0, 3, 2, 0, 0, 1 ], 
    polys := [ b^3-3*a, a^3-3*b, a*b^3-3*a^2, a^3*b-3*b^2, a^2*b^3-9*b, 
        a^3*b^2-9*a, a^3*b^3-9*a*b ], result := 9*a^2+9*a*b+6*b^2 )
  
\end{Verbatim}
 
\subsection{\textcolor{Chapter }{A more detailed example}}\label{subs-ex452}
\logpage{[ 3, 3, 3 ]}
\hyperdef{L}{X831D45437DE37177}{}
{
  Here we consider Example 4.5.2 in the thesis \cite{gareth-thesis}. On setting \texttt{InfoLevel(InfoIBNP)} to \texttt{1} some of the intermediate calculations are displayed. The setting of the
problem is a rational polynomial ring in three variables with the lex ordering $[x,y,z]$, using the Janet involutive division. 
\begin{itemize}
\item  the initial basis contains two polynomials $\{a=x^2+y^3,~b=x+z^3\}
\item  the reduced Gr{\"o}bner basis is $\{c=y^3+z^6,~b=x+z^3\}$, and the irreducible monomials are $\{z^k,~yz^k,~y^2z^k~|~ k \geqslant 0\}
\item  when starting to calculate an involutive basis, the autoreduction does nothing
because $x$ is not multiplicative for $b$ 
\item  the only prolongation is $bx = x^2+xz^3$ which reduces, on subtracting $a+bz^3$ and changing the sign, to $c=y^3+z^6$ 
\item  on restarting with basis $[c,b,a]$, autoreduction replaces $a$ with $a-c = d = x^2-z^6$ 
\item  there are then $3$ prolongations $[by,bx,dy]$ and $bx$ now reduces to zero 
\item  $by = e = xy+yz^3$ is then added to the basis: $[c,b,e,d]$ 
\item  $dy = x^2y-yz^6$ reduces to zero on adding $e(-x+z^3)$ 
\item  on restarting with basis $[c,b,e,d]$ there are $4$ prolongations $[by,ey,bx,dy]$ and of these only $f = ey = xy^2+y^2z^3$ does not reduce to zero 
\item  restarting with basis $[c,b,e,f,d]$, the $5$ prolongations $[by,ey,fy,bx,dy]$ all reduce to zero. 
\item  now see what happens when reducing $p = x^7+y^7+z^7$ using the basis $[c,b,e,f,d]$ 
\item  $x^7-dx^5 = x^5z^6$ and $x^5z^6 - dx^3z^6 = x^3z^{12}$ and $x^3z^{12}-dxz^{12} = xz^{18}$ and $xz^{18}-bz^{18}=-z^{21}$ 
\item  $y^7 - cy^4 = -y^4z^6$ and $-y^4z^6 + cyz^6 = yz^{12}$, so $p$ reduces to $-z^{21} + yz^{12} + z^7$. 
\end{itemize}
 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  
  !gapprompt@gap>| !gapinput@SetInfoLevel( InfoIBNP, 1 );; |
  !gapprompt@gap>| !gapinput@CommutativeDivision := "Janet";;|
  !gapprompt@gap>| !gapinput@R3 := PolynomialRing( Rationals, [ "x""y""z" ] );;|
  !gapprompt@gap>| !gapinput@x := R3.1;; y := R3.2;; z := R3.3;; |
  !gapprompt@gap>| !gapinput@ord3 := MonomialLexOrdering( [x,y,z] );;|
  !gapprompt@gap>| !gapinput@F := [ y^3 + x^2, z^3 + x ];;|
  !gapprompt@gap>| !gapinput@gbas := GrobnerBasis( F, ord3 );|
  [ y^3+x^2, z^3+x, -z^6-y^3 ]
  !gapprompt@gap>| !gapinput@rgbas := ReducedGrobnerBasis( F, ord3 );|
  [ z^6+y^3, z^3+x ]
  !gapprompt@gap>| !gapinput@ibasF := InvolutiveBasisCP( R3, F, ord3 );|
  #I  restarting with basis:
  [ z^3+x, y^3+x^2 ]
  #I  division record for basis: rec(
  div := "Janet",
  mvars := [ [ 2, 3 ], [ 1, 2, 3 ] ],
  polys := [ z^3+x, y^3+x^2 ] )
  #I  prolongations = [ x*z^3+x^2 ]
  #I  restarting with basis:
  [ z^6+y^3, z^3+x, y^3+x^2 ]
  #I  after autoreduction basis = 
  [ z^6+y^3, z^3+x, -z^6+x^2 ]
  #I  division record for basis: rec(
  div := "Janet",
  mvars := [ [ 1, 2, 3 ], [ 3 ], [ 1, 3 ] ],
  polys := [ z^6+y^3, z^3+x, -z^6+x^2 ] )
  #I  prolongations = [ y*z^3+x*y, x*z^3+x^2, -y*z^6+x^2*y ]
  #I  restarting with basis:
  [ z^6+y^3, z^3+x, y*z^3+x*y, -z^6+x^2 ]
  #I  division record for basis: rec(
  div := "Janet",
  mvars := [ [ 1, 2, 3 ], [ 3 ], [ 1, 3 ], [ 1, 3 ] ],
  polys := [ z^6+y^3, z^3+x, y*z^3+x*y, -z^6+x^2 ] )
  #I  prolongations = [ y*z^3+x*y, y^2*z^3+x*y^2, x*z^3+x^2, -y*z^6+x^2*y ]
  #I  restarting with basis:
  [ z^6+y^3, z^3+x, y*z^3+x*y, y^2*z^3+x*y^2, -z^6+x^2 ]
  #I  division record for basis: rec(
  div := "Janet",
  mvars := [ [ 1, 2, 3 ], [ 3 ], [ 1, 3 ], [ 1, 3 ], [ 1, 3 ] ],
  polys := [ z^6+y^3, z^3+x, y*z^3+x*y, y^2*z^3+x*y^2, -z^6+x^2 ] )
  #I  prolongations = [ y*z^3+x*y, y^2*z^3+x*y^2, y^3*z^3+x*y^3, x*z^3+x^2, -y*zjava.lang.NullPointerException
  ^6+x^2*y ]
  rec( div := "Janet"
    mvars := [ [ 1, 2, 3 ], [ 3 ], [ 1, 3 ], [ 1, 3 ], [ 1, 3 ] ], 
    polys := [ z^6+y^3, z^3+x, y*z^3+x*y, y^2*z^3+x*y^2, -z^6+x^2 ] )
  !gapprompt@gap>| !gapinput@## now for a reduction - reset the info level:|
  !gapprompt@gap>| !gapinput@SetInfoLevel( InfoIBNP, 2 );; |
  !gapprompt@gap>| !gapinput@p := x^7 + y^7 + z^7;;|
  !gapprompt@gap>| !gapinput@IPolyReduce( R3, p, ibasF, ord3 );|
  #I  reduced to: x^5*z^6+y^7+z^7
  #I  reduced to: x^3*z^12+y^7+z^7
  #I  reduced to: x*z^18+y^7+z^7
  #I  reduced to: -z^21+y^7+z^7
  #I  reduced to: -z^21-y^4*z^6+z^7
  #I  reduced to: -z^21+y*z^12+z^7
  -z^21+y*z^12+z^7
  
\end{Verbatim}
 }

 
\subsection{\textcolor{Chapter }{Using homogeneous polynomials}}\label{subs-hompolys}
\logpage{[ 3, 3, 4 ]}
\hyperdef{L}{X791740DF84B742A2}{}
{
  If the polynomials in an initial basis are not homogeneous \index{homogeneous polynomials} then they may be made homogeneous by introducing an additional variable. The
resulting involutive basis will contain only homogeneous polynomials. However,
if these are de\texttt{\symbol{45}}homogenised by setting the additional
variable equal to $1$, the resulting basis may not be involutive. 

 Applying this to the previous example, the resulting basis contains $10$ polynomials which include homogenised versions of $[c,b,e,f]$, but not $d$. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  
  !gapprompt@gap>| !gapinput@SetInfoLevel( InfoIBNP, 0 );|
  !gapprompt@gap>| !gapinput@R4 := PolynomialRing( Rationals, [ "x""y""z""t" ] );;|
  !gapprompt@gap>| !gapinput@x := R4.1;; y := R4.2;; z := R4.3;; t := R4.4;;|
  !gapprompt@gap>| !gapinput@H := [ x^2*t + y^3, x*t^2 + z^3 ];;|
  !gapprompt@gap>| !gapinput@ord4 := MonomialLexOrdering( [x,y,z,t] );;|
  !gapprompt@gap>| !gapinput@ibasH := InvolutiveBasisCP( R4, H, ord4 );|
  rec( div := "Janet",
    mvars := [ [ 1, 2, 3, 4 ], [ 1, 2, 3 ], [ 1, 3, 4 ], [ 1, 2, 3 ], 
        [ 1, 2, 3 ], [ 1, 3, 4 ], [ 1, 3, 4 ], [ 1, 2 ], [ 1, 2 ], [ 1, 2 ] ],
    polys := [ y^3*t^3+z^6, x*t^2+z^3, x*t^3+z^3*t, x*z^3-y^3*t, 
        x*z^3*t-y^3*t^2, x*y*t^3+y*z^3*t, x*y^2*t^3+y^2*z^3*t, x^2*t+y^3, 
        x^2*z*t+y^3*z, x^2*z^2*t+y^3*z^2 ] )
  
\end{Verbatim}
 }

 }

 }

  
\chapter{\textcolor{Chapter }{Functions for Noncommutative Monomials}}\label{chap-monom}
\logpage{[ 4, 0, 0 ]}
\hyperdef{L}{X872783907DFA29B7}{}
{
  A monomial, such as $ab^2a$ is represented in \textsf{GBNP} as the list $[1,2,2,1]$. Polynomials have a more complicated structure, for example $6ab^2a - 7ab + 8ba$ is represented in \textsf{GBNP} by $[ [ [1,2,2,1], [1,2], [2,1] ], [6,-7,8] ]$, which is a list of monomials followed by the corresponding list of
coefficients. Polynomials are dealt with in the following chapter. 

 As shown in Section \ref{sec-nps}, \textsf{GBNP} has functions \texttt{PrintNP} and \texttt{PrintNPList} to print a polynomial and a list of polynomials. Here we provide equivalent
functions for monomials. 
\section{\textcolor{Chapter }{Basic functions for monomials}}\label{sec-basic}
\logpage{[ 4, 1, 0 ]}
\hyperdef{L}{X846C3B0F79265278}{}
{
  
\subsection{\textcolor{Chapter }{Predefined algebras}}\label{sub-inbuilt-alg}
\logpage{[ 4, 1, 1 ]}
\hyperdef{L}{X84F106BB8093FCAE}{}
{
  For convenience of use in examples, three algebras over the rationals, \texttt{AlbebraIBNP} and \texttt{AlgebrakIBNP} with $k \in [2,3,4]$, are predefined in this package. \index{AlgebraIBNP} 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  
  !gapprompt@gap>| !gapinput@GeneratorsOfAlgebra( AlgebraIBNP );|
  [ (1)*<identity ...>, (1)*a, (1)*b ]
  !gapprompt@gap>| !gapinput@Algebra2IBNP = AlgebraIBNP;|
  true
  !gapprompt@gap>| !gapinput@A3 := Algebra3IBNP;|
  <algebra-with-one over Rationals, with 3 generators>
  
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{PrintNM}}
\logpage{[ 4, 1, 2 ]}\nobreak
\hyperdef{L}{X7D53D8657AEDFEB2}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\enspace\texttt{PrintNM({\mdseries\slshape monomial})\index{PrintNM@\texttt{PrintNM}}
\label{PrintNM}
}\hfill{\scriptsize (operation)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\enspace\texttt{PrintNMList({\mdseries\slshape list})\index{PrintNMList@\texttt{PrintNMList}}
\label{PrintNMList}
}\hfill{\scriptsize (operation)}}\\


 Recall, from \textsf{GBNP}, that the actual letters printed are controlled by the operation \texttt{GBNP.ConfigPrint}. }

 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  
  !gapprompt@gap>| !gapinput@GBNP.ConfigPrint( "a""b""c" );|
  !gapprompt@gap>| !gapinput@mon := [2,1,1,1,3,3,1];;|
  !gapprompt@gap>| !gapinput@PrintNM( mon );|
  ba^3c^2a
  !gapprompt@gap>| !gapinput@L := [ [1,2,2], [3,1,2], [3,3,3], [2], [ ] ];;|
  !gapprompt@gap>| !gapinput@PrintNMList( L );                            |
  ab^2
  cab
  c^3
  b
  1
  
\end{Verbatim}
 

\subsection{\textcolor{Chapter }{NM2GM}}
\logpage{[ 4, 1, 3 ]}\nobreak
\hyperdef{L}{X7AD4CF167E6B7D2E}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\enspace\texttt{NM2GM({\mdseries\slshape monomial, algebra})\index{NM2GM@\texttt{NM2GM}}
\label{NM2GM}
}\hfill{\scriptsize (operation)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\enspace\texttt{NM2GMList({\mdseries\slshape list, algebra})\index{NM2GMList@\texttt{NM2GMList}}
\label{NM2GMList}
}\hfill{\scriptsize (operation)}}\\


 Recall, from \textsf{GBNP}, that the functions \texttt{NP2GP} and \texttt{NP2GPList} convert a polynomial (or list of polynomials) in NP\texttt{\symbol{45}}format
to an element of the algebra. This package provides additional functions \texttt{NM2GM} and \texttt{NM2GMList} which do the equivalent conversion for monomials. }

 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  
  !gapprompt@gap>| !gapinput@m := NM2GM( mon, A3 );|
  (1)*b*a^3*c^2*a
  !gapprompt@gap>| !gapinput@NM2GMList( [ mon, Reversed(mon), Concatenation(mon,mon) ], A3 );|
  [ (1)*b*a^3*c^2*a, (1)*a*c^2*a^3*b, (1)*(b*a^3*c^2*a)^2 ]
  
\end{Verbatim}
 

\subsection{\textcolor{Chapter }{GM2NM}}
\logpage{[ 4, 1, 4 ]}\nobreak
\hyperdef{L}{X8719E2857E26325C}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\enspace\texttt{GM2NM({\mdseries\slshape monomial})\index{GM2NM@\texttt{GM2NM}}
\label{GM2NM}
}\hfill{\scriptsize (operation)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\enspace\texttt{GM2NMList({\mdseries\slshape list})\index{GM2NMList@\texttt{GM2NMList}}
\label{GM2NMList}
}\hfill{\scriptsize (operation)}}\\


 Recall, from \textsf{GBNP}, that the functions \texttt{GP2NP} and \texttt{GP2NPList} convert a polynomial (or list of polynomials) to the equivalent
NP\texttt{\symbol{45}}format. This package provides additional functions \texttt{GM2NM} and \texttt{GM2NMList} which do the equivalent conversion for monomials. }

 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  
  !gapprompt@gap>| !gapinput@a:=A3.1;; b:=A3.2;; c:=A3.3;;|
  !gapprompt@gap>| !gapinput@p := (a*b*c)^2;;             |
  !gapprompt@gap>| !gapinput@GM2NM(p);|
  [ 1, 2, 3, 1, 2, 3 ]
  !gapprompt@gap>| !gapinput@GM2NMList( [ p, p^2, a^3, b^4, c^5 ] );|
  [ [ 1, 2, 3, 1, 2, 3 ], [ 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3 ], [ 1, 1, 1 ], 
    [ 2, 2, 2, 2 ], [ 3, 3, 3, 3, 3 ] ]
  
\end{Verbatim}
 

\subsection{\textcolor{Chapter }{PrefixNM}}
\logpage{[ 4, 1, 5 ]}\nobreak
\hyperdef{L}{X7F72641C8441204E}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\enspace\texttt{PrefixNM({\mdseries\slshape monomial, posint})\index{PrefixNM@\texttt{PrefixNM}}
\label{PrefixNM}
}\hfill{\scriptsize (operation)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\enspace\texttt{SubwordNM({\mdseries\slshape monomial, posint, posint})\index{SubwordNM@\texttt{SubwordNM}}
\label{SubwordNM}
}\hfill{\scriptsize (operation)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\enspace\texttt{SuffixNM({\mdseries\slshape monomial, posint})\index{SuffixNM@\texttt{SuffixNM}}
\label{SuffixNM}
}\hfill{\scriptsize (operation)}}\\


 These are the three operations which pick a sublist from a monomial list. }

 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  
  !gapprompt@gap>| !gapinput@mon := [2,1,1,1,3,3,1];;|
  !gapprompt@gap>| !gapinput@PrefixNM( mon, 3 );|
  [ 2, 1, 1 ]
  !gapprompt@gap>| !gapinput@SubwordNM( mon, 3, 6 );|
  [ 1, 1, 3, 3 ]
  !gapprompt@gap>| !gapinput@SuffixNM( mon, 3 );|
  [ 3, 3, 1 ]
  
\end{Verbatim}
 

\subsection{\textcolor{Chapter }{SuffixPrefixPosNM}}
\logpage{[ 4, 1, 6 ]}\nobreak
\hyperdef{L}{X8046DF397ACA0E5E}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\enspace\texttt{SuffixPrefixPosNM({\mdseries\slshape monomial, monomial, posint, posint})\index{SuffixPrefixPosNM@\texttt{SuffixPrefixPosNM}}
\label{SuffixPrefixPosNM}
}\hfill{\scriptsize (operation)}}\\


 The operation \texttt{SuffixPrefixPosNM( left, right, start, limit)} looks for overlaps of type \emph{suffix of left = prefix of right}. The size of the smallest such overlap is returned. The overlaps which are
considered are controlled by the third and fourth arguments. We commence by
looking at the overlap of size \emph{start} and go no further than the overlap of size \emph{limit}. When no overlap exists, $0$ is returned. To test all possibilities, \emph{start} should be $1$ and \emph{limit} should be $min(|left|,|right|)-1$. It is the user's responsibility to make sure that these bounds are correct
\texttt{\symbol{45}} no checks are made. 

 }

 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  
  !gapprompt@gap>| !gapinput@m1 := [2,1,1,1,2,2,1,1];;           ## m1 = ba^3b^2a^2|
  !gapprompt@gap>| !gapinput@m2 := [1,1,2,2,1,1];;               ## m2 = a^2b^2a^2|
  !gapprompt@gap>| !gapinput@SuffixPrefixPosNM( m1, m2, 1, 5 );  ## overlap is a                   |
  1
  !gapprompt@gap>| !gapinput@SuffixPrefixPosNM( m1, m2, 2, 5 );  ## overlap is a^2|
  2
  !gapprompt@gap>| !gapinput@SuffixPrefixPosNM( m1, m2, 3, 5 );  ## no longer an overlap|
  0
  !gapprompt@gap>| !gapinput@SuffixPrefixPosNM( m2, m1, 1, 5 );  ## overlap is ba^2|
  3
  
\end{Verbatim}
 

\subsection{\textcolor{Chapter }{SubwordPosNM}}
\logpage{[ 4, 1, 7 ]}\nobreak
\hyperdef{L}{X82916CB37D346978}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\enspace\texttt{SubwordPosNM({\mdseries\slshape monomial, monomial, posint})\index{SubwordPosNM@\texttt{SubwordPosNM}}
\label{SubwordPosNM}
}\hfill{\scriptsize (operation)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\enspace\texttt{IsSubwordNM({\mdseries\slshape monomial, monomial})\index{IsSubwordNM@\texttt{IsSubwordNM}}
\label{IsSubwordNM}
}\hfill{\scriptsize (operation)}}\\


 The operation \texttt{SubwordPosNM( small, large, start );} answers the question for monomials \emph{Is small a subword of large?}. The value returned is the start position in \emph{large} of the first subword found. When no subword is found, $0$ is returned. The search commences at position \emph{start} in \emph{large} so, to test all possibilities, the third argument should be $1$. 

 To just ask whether or not \emph{small} is a subword of \emph{large}, use \texttt{IsSubwordNM( small, large);}. }

 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  
  !gapprompt@gap>| !gapinput@m3 := [ 1, 1, 2 ];;                 ## m3 = a^2b|
  !gapprompt@gap>| !gapinput@SubwordPosNM( m3, m1, 1 );|
  3                                        ## m1 = ba(a^b)ba^2
  !gapprompt@gap>| !gapinput@SubwordPosNM( m3, m2, 1 );|
  1                                        ## m2 = (a^2b)ba^2
  !gapprompt@gap>| !gapinput@SubwordPosNM( m3, m2, 2 );|
  0
  !gapprompt@gap>| !gapinput@IsSubwordNM( [ 2, 1, 2 ], m1 );|
  false
  
\end{Verbatim}
 

\subsection{\textcolor{Chapter }{LeadVarNM}}
\logpage{[ 4, 1, 8 ]}\nobreak
\hyperdef{L}{X83CF80DD7CD5F166}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\enspace\texttt{LeadVarNM({\mdseries\slshape monomial})\index{LeadVarNM@\texttt{LeadVarNM}}
\label{LeadVarNM}
}\hfill{\scriptsize (operation)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\enspace\texttt{LeadExpNM({\mdseries\slshape monomial})\index{LeadExpNM@\texttt{LeadExpNM}}
\label{LeadExpNM}
}\hfill{\scriptsize (operation)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\enspace\texttt{TailNM({\mdseries\slshape monomial})\index{TailNM@\texttt{TailNM}}
\label{TailNM}
}\hfill{\scriptsize (operation)}}\\


 Given the word $w = b^4a^3c^2$, represented by $[2,2,2,2,1,1,1,3,3]$, the \emph{lead variable} is $b$ or $2$, and the \emph{lead exponent} is $4$. Removing $b^4$ from $w$ leaves the \emph{tail} $a^3c^2$. }

 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  
  !gapprompt@gap>| !gapinput@mon4 := [2,2,2,2,1,1,1,3,3];;|
  !gapprompt@gap>| !gapinput@LeadVarNM( mon4 );           |
  2
  !gapprompt@gap>| !gapinput@LeadExpNM( mon4 );           |
  4
  !gapprompt@gap>| !gapinput@TailNM( mon4 );           |
  [ 1, 1, 1, 3, 3 ]
  
\end{Verbatim}
 

\subsection{\textcolor{Chapter }{DivNM}}
\logpage{[ 4, 1, 9 ]}\nobreak
\hyperdef{L}{X7CECFE0C86895946}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\enspace\texttt{DivNM({\mdseries\slshape monomial, monomial})\index{DivNM@\texttt{DivNM}}
\label{DivNM}
}\hfill{\scriptsize (operation)}}\\


 The operation \texttt{DivNM(large, small);} for two monomials returns all the ways that \emph{small} divides \emph{large} in the form of a list of pairs of monomials \emph{[left,right]} so that \emph{large = left*small*right}. In the example we search for subwords $ab$ of $m = abcababc$, returning $[ [abcab,c], [abc,abc], [1,cababc] ]$. }

 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  
  !gapprompt@gap>| !gapinput@GBNP.ConfigPrint( "a""b""c" );|
  !gapprompt@gap>| !gapinput@m := [ 1, 2, 3, 1, 2, 1, 2, 3 ];;|
  !gapprompt@gap>| !gapinput@d := [ 1, 2 ];;|
  !gapprompt@gap>| !gapinput@PrintNMList( [ m, d ] );|
  abcababc
  ab                
  !gapprompt@gap>| !gapinput@divs := DivNM( m, d ); |
  [ [ [ 1, 2, 3, 1, 2 ], [ 3 ] ], [ [ 1, 2, 3 ], [ 1, 2, 3 ] ], 
    [ [  ], [ 3, 1, 2, 1, 2, 3 ] ] ]
  !gapprompt@gap>| !gapinput@PrintNMList( divs[1] );|
  abcab
  c
  
\end{Verbatim}
 }

 }

  
\chapter{\textcolor{Chapter }{Functions for Noncommutative Polynomials}}\label{chap-poly}
\logpage{[ 5, 0, 0 ]}
\hyperdef{L}{X7BD27C5585EF8629}{}
{
  
\section{\textcolor{Chapter }{Basic functions for polynomials}}\label{sec-polyops}
\logpage{[ 5, 1, 0 ]}
\hyperdef{L}{X80FC94957D03EEA6}{}
{
  

\subsection{\textcolor{Chapter }{MaxDegreeNP}}
\logpage{[ 5, 1, 1 ]}\nobreak
\hyperdef{L}{X7A1E54F279CCCF65}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\enspace\texttt{MaxDegreeNP({\mdseries\slshape polylist})\index{MaxDegreeNP@\texttt{MaxDegreeNP}}
\label{MaxDegreeNP}
}\hfill{\scriptsize (operation)}}\\


 Given an \texttt{FAlgList}, this function calculates the degree of the lead term for each element of the
list and returns the largest value found. In the example this is $v$ with degree $4$ }

 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  
  !gapprompt@gap>| !gapinput@A2 := AlgebraIBNP;|
  <algebra-with-one over Rationals, with 2 generators>
  !gapprompt@gap>| !gapinput@a := A2.1;; b := A2.2;;|
  !gapprompt@gap>| !gapinput@ord := NCMonomialLeftLengthLexicographicOrdering( A2 );;|
  !gapprompt@gap>| !gapinput@u := [ [ [1,1,2], [2,1], [1] ], [3,2,-1] ];;|
  !gapprompt@gap>| !gapinput@v := [ [ [1,1,2,1], [1,2,2], [2,1] ], [4,-2,1] ];;|
  !gapprompt@gap>| !gapinput@w := [ [ [2,1,2], [1,2], [2] ], [2,-1,3] ];; |
  !gapprompt@gap>| !gapinput@L3 := [ u, v, w ];; |
  !gapprompt@gap>| !gapinput@PrintNPList( L3 ); |
   3a^2b + 2ba - a 
   4a^2ba - 2ab^2 + ba 
--> --------------------

--> maximum size reached

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

100%


¤ Dauer der Verarbeitung: 0.42 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.