#% -*- GAP -*-
#% This file is marked for TeX processing
#[caption]"Shortcuts for computing $\pi_1$"
#================================================================
#: A few shortcuts and service functions used in the computations,%
#: \cf. \autoref{ch.sextics}
#----------------------------------------------------------------
Reread("pi1.txt");   #: (see \file{pi1})
#[skiplines] %
\0 := 0; # For TeX compatibility
g := []; h := []; P := []; # just bind the variables
#[endskip] %
#: A service function: stores "g := G/[arg];" and its commutant "h"%
#:   and returns "h"
DS := function(arg) #"DS"
 g := G/Union(arg); h := DerivedSubgroup(g); return h;
end;
#: Simplifying a presentation of a normal subgroup%
#: (for groups suspected to be $\BG3$ or $\MG$)
simplify := function(arg)  #"simplify"
 P := PresentationNormalClosure(g, Subgroup(g, arg)); SimplifyPresentation(P);
end;
#: Analyzing various quotients%
#: (to prove that a group is \emph{not} $\BG3$ or $\MG$)
qgroup := function(arg) return FactorGroupFpGroupByRels(g, arg); end; #"qgroup"
qsize := function(arg) return Size(CallFuncList(qgroup, arg)); end; #"qsize"
#----------------------------------------------------------------
#: This function returns a list of $\bA$ type relations,%
#:   united with a predefined list "fixed"
#: The chains to the regions are passed in "chains" (usually predefined),%
#:   and their widths (braid indices) are in "wd",%
#:   which may be shorter than "chains"%
#:   (\eg, "wd" can be passed as "arg" from a function with a%
#:   variable number of arguments)
#----------------------------------------------------------------
fixed := [];    #: usually, relations at infinity
AA := function(chains, wd) #"AA"
 return Union(List([1..Length(wd)], i -> RA(chains[i], wd[i])), fixed);
end;
#================================================================
#[endinput]
