#% -*- GAP -*-
#%Format: latex
#% This file is marked for TeX processing
#[caption]"Computing $\pi_1(\skeleton)$"
#================================================================
Reread("skeleton.txt");   #: (see \file{skeleton})
Reread("braid.txt");      #: (see \file{braid})
Reread("common.txt");     #: (see \file{common})
#================================================================
#: "Pi1(S[: simplified])": a `brute force' presentation for $\pi_1(\skeleton)$,%
#:    assuming~$\skeleton$ the extended skeleton of a subgroup of $\BG3$.%
#:    The "simplified" option tries to simplify the presentation obtained%
#:    by applying "SimplifiedFpGroup"
#----------------------------------------------------------------
Pi1 := function(S)   #"Pi1"
 local dp, hom, H, B; #: Using the true braid group reduces the number of relations
 dp := get(S, "Type"); #%
 dp := Lcm(dp[1]*2, dp[2]*3)/6;
 B := FreeGroup(2);  B := B/[B.1*B.2*B.1/(B.2*B.1*B.2), (B.1*B.2)^(3*dp)];
 hom := GroupHomomorphismByImagesNC(B, get(S, "Group"), [B.1, B.2],
                         [sigma1(S.X, S.Y), sigma2(S.X, S.Y)]);
 H := PreImages(hom, get(S, "Stabilizer"));
 H := Union(List(GeneratorsOfGroup(H), #: see \kwd{BraidRelations} in \file{braid}
          g -> BraidRelations(UnderlyingElement(g), G, [G.2, G.3])));
 H := G/Union(H, [rho^dp]);
 if ValueOption("simplified") = true then H := SimplifiedFpGroup(H); fi;
 return H;
end;
#================================================================
