  
  [1X12 [33X[0;0YForman's discrete Morse theory[133X[101X
  
  [33X[0;0YIn  this  chapter  a  framework  is  provided to use Forman's discrete Morse
  theory [For95] within [5Xsimpcomp[105X. See Section [14X2.6[114X for a brief introduction.[133X
  
  [33X[0;0YNote:  this  is  not  to  be  confused  with Banchoff and Kühnel's theory of
  regular simplexwise linear functions which is described in Chapter [14X11[114X.[133X
  
  
  [1X12.1 [33X[0;0YFunctions using discrete Morse theory[133X[101X
  
  [1X12.1-1 SCCollapseGreedy[101X
  
  [29X[2XSCCollapseGreedy[102X( [3Xcomplex[103X ) [32X method
  [6XReturns:[106X  [33X[0;10Ysimplicial  complex of type [10XSCSimplicialComplex[110X upon success, [9Xfail[109X
            otherwise.[133X
  
  [33X[0;0YEmploys  a  greedy  collapsing  algorithm to collapse the simplicial complex
  [3Xcomplex[103X. See also [2XSCCollapseLex[102X ([14X12.1-2[114X) and [2XSCCollapseRevLex[102X ([14X12.1-3[114X).[133X
  
  [4X[32X  Example  [32X[104X
    [4X[28X gap> SCLib.SearchByName("T^2"){[1..6]}; [128X[104X
    [4X[28X [ [ 4, "T^2 (VT)" ], [ 5, "T^2 (VT)" ], [ 9, "T^2 (VT)" ], [ 10, "T^2 (VT)" ],[128X[104X
    [4X[28X   [ 18, "T^2 (VT)" ], [ 20, "(T^2)#2" ] ][128X[104X
    [4X[28X gap> torus:=SCLib.Load(last[1][1]);;[128X[104X
    [4X[28X gap> bdtorus:=SCDifference(torus,SC([torus.Facets[1]]));;[128X[104X
    [4X[28X gap> coll:=SCCollapseGreedy(bdtorus);[128X[104X
    [4X[28X [SimplicialComplex[128X[104X
    [4X[28X [128X[104X
    [4X[28X  Properties known: Dim, FacetsEx, Name, Vertices.[128X[104X
    [4X[28X [128X[104X
    [4X[28X  Name="collapsed version of T^2 (VT) \ unnamed complex 8"[128X[104X
    [4X[28X  Dim=1[128X[104X
    [4X[28X [128X[104X
    [4X[28X /SimplicialComplex][128X[104X
    [4X[28X gap> coll.Facets;[128X[104X
    [4X[28X [ [ 1, 3 ], [ 1, 5 ], [ 2, 3 ], [ 2, 5 ], [ 3, 4 ], [ 3, 7 ], [ 4, 7 ] ][128X[104X
    [4X[28X gap> sphere:=SCBdSimplex(4);;                              [128X[104X
    [4X[28X gap> bdsphere:=SCDifference(sphere,SC([sphere.Facets[1]]));;[128X[104X
    [4X[28X gap> coll:=SCCollapseGreedy(bdsphere);[128X[104X
    [4X[28X [SimplicialComplex[128X[104X
    [4X[28X [128X[104X
    [4X[28X  Properties known: Dim, FVector, FacetsEx, IsPure, Name, NumFaces[], [128X[104X
    [4X[28X                    SkelExs[], Vertices.[128X[104X
    [4X[28X [128X[104X
    [4X[28X  Name="collapsed version of S^3_5 \ unnamed complex 12"[128X[104X
    [4X[28X  Dim=0[128X[104X
    [4X[28X  FVector=[ 1 ][128X[104X
    [4X[28X  IsPure=true[128X[104X
    [4X[28X [128X[104X
    [4X[28X /SimplicialComplex][128X[104X
    [4X[28X gap> coll.Facets;                     [128X[104X
    [4X[28X [ [ 5 ] ][128X[104X
    [4X[28X [128X[104X
  [4X[32X[104X
  
  [1X12.1-2 SCCollapseLex[101X
  
  [29X[2XSCCollapseLex[102X( [3Xcomplex[103X ) [32X method
  [6XReturns:[106X  [33X[0;10Ysimplicial  complex of type [10XSCSimplicialComplex[110X upon success, [9Xfail[109X
            otherwise.[133X
  
  [33X[0;0YEmploys  a  greedy collapsing algorithm in lexicographical order to collapse
  the  simplicial  complex  [3Xcomplex[103X.  See  also  [2XSCCollapseGreedy[102X ([14X12.1-1[114X) and
  [2XSCCollapseRevLex[102X ([14X12.1-3[114X).[133X
  
  [4X[32X  Example  [32X[104X
    [4X[28X gap> s:=SCSurface(1,true);;[128X[104X
    [4X[28X gap> s:=SCDifference(s,SC([SCFacets(s)[1]]));;[128X[104X
    [4X[28X gap> coll:=SCCollapseGreedy(s);[128X[104X
    [4X[28X [SimplicialComplex[128X[104X
    [4X[28X [128X[104X
    [4X[28X  Properties known: Dim, FacetsEx, Name, Vertices.[128X[104X
    [4X[28X [128X[104X
    [4X[28X  Name="collapsed version of T^2 \ unnamed complex 18"[128X[104X
    [4X[28X  Dim=1[128X[104X
    [4X[28X [128X[104X
    [4X[28X /SimplicialComplex][128X[104X
    [4X[28X gap> coll.Facets;[128X[104X
    [4X[28X [ [ 1, 3 ], [ 1, 5 ], [ 3, 6 ], [ 3, 7 ], [ 5, 6 ], [ 6, 7 ] ][128X[104X
    [4X[28X gap> sphere:=SCBdSimplex(4);;                              [128X[104X
    [4X[28X gap> ball:=SCDifference(sphere,SC([sphere.Facets[1]]));;[128X[104X
    [4X[28X gap> coll:=SCCollapseLex(ball);[128X[104X
    [4X[28X [SimplicialComplex[128X[104X
    [4X[28X [128X[104X
    [4X[28X  Properties known: Dim, FVector, FacetsEx, IsPure, Name, NumFaces[], [128X[104X
    [4X[28X                    SkelExs[], Vertices.[128X[104X
    [4X[28X [128X[104X
    [4X[28X  Name="collapsed version of S^3_5 \ unnamed complex 22"[128X[104X
    [4X[28X  Dim=0[128X[104X
    [4X[28X  FVector=[ 1 ][128X[104X
    [4X[28X  IsPure=true[128X[104X
    [4X[28X [128X[104X
    [4X[28X /SimplicialComplex][128X[104X
    [4X[28X gap> coll.Facets;                     [128X[104X
    [4X[28X [ [ 5 ] ][128X[104X
    [4X[28X [128X[104X
  [4X[32X[104X
  
  [1X12.1-3 SCCollapseRevLex[101X
  
  [29X[2XSCCollapseRevLex[102X( [3Xcomplex[103X ) [32X method
  [6XReturns:[106X  [33X[0;10Ysimplicial  complex of type [10XSCSimplicialComplex[110X upon success, [9Xfail[109X
            otherwise.[133X
  
  [33X[0;0YEmploys  a  greedy  collapsing algorithm in reverse lexicographical order to
  collapse  the simplicial complex [3Xcomplex[103X. See also [2XSCCollapseGreedy[102X ([14X12.1-1[114X)
  and [2XSCCollapseLex[102X ([14X12.1-2[114X).[133X
  
  [4X[32X  Example  [32X[104X
    [4X[28X gap> s:=SCSurface(1,true);;[128X[104X
    [4X[28X gap> s:=SCDifference(s,SC([SCFacets(s)[1]]));;[128X[104X
    [4X[28X gap> coll:=SCCollapseGreedy(s);[128X[104X
    [4X[28X [SimplicialComplex[128X[104X
    [4X[28X [128X[104X
    [4X[28X  Properties known: Dim, FacetsEx, Name, Vertices.[128X[104X
    [4X[28X [128X[104X
    [4X[28X  Name="collapsed version of T^2 \ unnamed complex 28"[128X[104X
    [4X[28X  Dim=1[128X[104X
    [4X[28X [128X[104X
    [4X[28X /SimplicialComplex][128X[104X
    [4X[28X gap> coll.Facets;[128X[104X
    [4X[28X [ [ 1, 3 ], [ 1, 6 ], [ 3, 6 ], [ 3, 7 ], [ 6, 7 ] ][128X[104X
    [4X[28X gap> sphere:=SCBdSimplex(4);;                              [128X[104X
    [4X[28X gap> ball:=SCDifference(sphere,SC([sphere.Facets[1]]));;[128X[104X
    [4X[28X gap> coll:=SCCollapseRevLex(ball);[128X[104X
    [4X[28X [SimplicialComplex[128X[104X
    [4X[28X [128X[104X
    [4X[28X  Properties known: Dim, FVector, FacetsEx, IsPure, Name, NumFaces[], [128X[104X
    [4X[28X                    SkelExs[], Vertices.[128X[104X
    [4X[28X [128X[104X
    [4X[28X  Name="collapsed version of S^3_5 \ unnamed complex 32"[128X[104X
    [4X[28X  Dim=0[128X[104X
    [4X[28X  FVector=[ 1 ][128X[104X
    [4X[28X  IsPure=true[128X[104X
    [4X[28X [128X[104X
    [4X[28X /SimplicialComplex][128X[104X
    [4X[28X gap> coll.Facets;                     [128X[104X
    [4X[28X [ [ 1 ] ][128X[104X
    [4X[28X [128X[104X
  [4X[32X[104X
  
  [1X12.1-4 SCHasseDiagram[101X
  
  [29X[2XSCHasseDiagram[102X( [3Xc[103X ) [32X function
  [6XReturns:[106X  [33X[0;10Ytwo lists of lists upon success, [10Xfail[110X otherweise.[133X
  
  [33X[0;0YComputes  the  Hasse  diagram  of  [10XSCSimplicialComplex[110X  object  [3Xc[103X. The Hasse
  diagram  is  returned  as two sets of lists. The first set of lists contains
  the  upward  part of the Hasse diagram, the second set of lists contains the
  downward part of the Hasse diagram.[133X
  
  [33X[0;0YThe  [22Xi[122X-th  list  of  each set of lists represents the incidences between the
  [22X(i-1)[122X-faces  and  the  [22Xi[122X-faces.  The faces are given by their indices of the
  face lattice.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[28X gap> c:=SCBdSimplex(3);;[128X[104X
    [4X[28X gap> HD:=SCHasseDiagram(c);[128X[104X
    [4X[28X [ [ [ [ 1, 2, 3 ], [ 1, 4, 5 ], [ 2, 4, 6 ], [ 3, 5, 6 ] ], [128X[104X
    [4X[28X       [ [ 1, 2 ], [ 1, 3 ], [ 2, 3 ], [ 1, 4 ], [ 2, 4 ], [ 3, 4 ] ] ], [128X[104X
    [4X[28X   [ [ [ 2, 1 ], [ 3, 1 ], [ 4, 1 ], [ 3, 2 ], [ 4, 2 ], [ 4, 3 ] ], [128X[104X
    [4X[28X       [ [ 4, 2, 1 ], [ 5, 3, 1 ], [ 6, 3, 2 ], [ 6, 5, 4 ] ] ] ][128X[104X
    [4X[28X [128X[104X
  [4X[32X[104X
  
  [1X12.1-5 SCMorseEngstroem[101X
  
  [29X[2XSCMorseEngstroem[102X( [3Xcomplex[103X ) [32X function
  [6XReturns:[106X  [33X[0;10Ytwo lists of small integer lists upon success, [10Xfail[110X otherweise.[133X
  
  [33X[0;0YBuilds  a discrete Morse function following the Engstroem method by reducing
  the  input complex to smaller complexes defined by minimal link and deletion
  operations. See [Eng09] for details.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[28X gap> c:=SCBdSimplex(3);;[128X[104X
    [4X[28X gap> f:=SCMorseEngstroem(c);[128X[104X
    [4X[28X [ [ [ 2 ], [ 2, 3 ], [ 2, 4 ], [ 2 .. 4 ], [  ], [ 3 ], [ 4 ], [ 3, 4 ], [128X[104X
    [4X[28X       [ 1, 3 ], [ 1, 3, 4 ], [ 1 ], [ 1, 4 ], [ 1, 2, 4 ], [ 1, 2 ], [128X[104X
    [4X[28X       [ 1 .. 3 ] ], [ [ 2 ], [ 1 .. 3 ] ] ][128X[104X
    [4X[28X [128X[104X
  [4X[32X[104X
  
  [1X12.1-6 SCMorseRandom[101X
  
  [29X[2XSCMorseRandom[102X( [3Xcomplex[103X ) [32X function
  [6XReturns:[106X  [33X[0;10Ytwo lists of small integer lists upon success, [10Xfail[110X otherweise.[133X
  
  [33X[0;0YBuilds  a  discrete  Morse  function  following  Lutz and Benedetti's random
  discrete  Morse theory approach: Faces are paired with free co-dimension one
  faces  until  now  free  faces  remain.  Then  a critical face is removed at
  random. See [BL14a] for details.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[28X gap> c:=SCBdSimplex(3);;[128X[104X
    [4X[28X gap> f:=SCMorseRandom(c);;[128X[104X
    [4X[28X gap> Size(f[2]);[128X[104X
    [4X[28X 2[128X[104X
    [4X[28X [128X[104X
  [4X[32X[104X
  
  [1X12.1-7 SCMorseRandomLex[101X
  
  [29X[2XSCMorseRandomLex[102X( [3Xcomplex[103X ) [32X function
  [6XReturns:[106X  [33X[0;10Ytwo lists of small integer lists upon success, [10Xfail[110X otherweise.[133X
  
  [33X[0;0YBuilds  a  discrete Morse function following Adiprasito, Benedetti and Lutz'
  lexicographic  random  discrete  Morse theory approach. See [BL14a], [BL14b]
  for details.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[28X gap> c := SCSurface(3,true);;[128X[104X
    [4X[28X gap> f:=SCMorseRandomLex(c);;[128X[104X
    [4X[28X gap> Size(f[2]);[128X[104X
    [4X[28X 8[128X[104X
    [4X[28X [128X[104X
  [4X[32X[104X
  
  [1X12.1-8 SCMorseRandomRevLex[101X
  
  [29X[2XSCMorseRandomRevLex[102X( [3Xcomplex[103X ) [32X function
  [6XReturns:[106X  [33X[0;10Ytwo lists of small integer lists upon success, [10Xfail[110X otherweise.[133X
  
  [33X[0;0YBuilds  a  discrete Morse function following Adiprasito, Benedetti and Lutz'
  reverse  lexicographic  random  discrete Morse theory approach. See [BL14a],
  [BL14b] for details.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[28X gap> c := SCSurface(5,false);;[128X[104X
    [4X[28X gap> f:=SCMorseRandomRevLex(c);;[128X[104X
    [4X[28X gap> Size(f[2]);[128X[104X
    [4X[28X 7[128X[104X
    [4X[28X [128X[104X
  [4X[32X[104X
  
  [1X12.1-9 SCMorseSpec[101X
  
  [29X[2XSCMorseSpec[102X( [3Xcomplex[103X, [3Xiter[103X[, [3Xmorsefunc[103X] ) [32X function
  [6XReturns:[106X  [33X[0;10Ya list upon success, [10Xfail[110X otherweise.[133X
  
  [33X[0;0YComputes  [3Xiter[103X  versions  of  a  discrete  Morse function of [3Xcomplex[103X using a
  randomised  method  specified  by [3Xmorsefunc[103X (default choice is [2XSCMorseRandom[102X
  ([14X12.1-6[114X),  other  randomised methods available are [2XSCMorseRandomLex[102X ([14X12.1-7[114X)
  [2XSCMorseRandomRevLex[102X  ([14X12.1-8[114X),  and  [2XSCMorseUST[102X  ([14X12.1-10[114X)).  The  result is
  referred  to  by  the Morse spectrum of [3Xcomplex[103X and is returned in form of a
  list  containing  all  Morse  vectors  sorted  by  number of critical points
  together  with  the  actual  vector  of  critical  points and how often they
  ocurred (see [BL14a] for details).[133X
  
  [4X[32X  Example  [32X[104X
    [4X[28X gap> c:=SCSeriesTorus(2);;[128X[104X
    [4X[28X gap> f:=SCMorseSpec(c,30);[128X[104X
    [4X[28X [ [ 4, [ 1, 2, 1 ], 30 ] ][128X[104X
    [4X[28X [128X[104X
  [4X[32X[104X
  
  [4X[32X  Example  [32X[104X
    [4X[28X gap> c:=SCSeriesHomologySphere(2,3,5);;[128X[104X
    [4X[28X gap> f:=SCMorseSpec(c,30,SCMorseRandom);[128X[104X
    [4X[28X [ [ 6, [ 1, 2, 2, 1 ], 27 ], [ 8, [ 1, 3, 3, 1 ], 3 ] ][128X[104X
    [4X[28X gap> f:=SCMorseSpec(c,30,SCMorseRandomLex);[128X[104X
    [4X[28X [ [ 6, [ 1, 2, 2, 1 ], 29 ], [ 8, [ 1, 3, 3, 1 ], 1 ] ][128X[104X
    [4X[28X gap> f:=SCMorseSpec(c,30,SCMorseRandomRevLex);[128X[104X
    [4X[28X [ [ 6, [ 1, 2, 2, 1 ], 7 ], [ 8, [ 1, 3, 3, 1 ], 9 ], [128X[104X
    [4X[28X   [ 8, [ 2, 3, 2, 1 ], 1 ], [ 10, [ 1, 4, 4, 1 ], 11 ], [128X[104X
    [4X[28X   [ 12, [ 1, 5, 5, 1 ], 1 ], [ 14, [ 1, 6, 6, 1 ], 1 ] ][128X[104X
    [4X[28X gap> f:=SCMorseSpec(c,30,SCMorseUST);[128X[104X
    [4X[28X [ [ 6, [ 1, 2, 2, 1 ], 18 ], [ 8, [ 1, 3, 3, 1 ], 8 ], [128X[104X
    [4X[28X   [ 10, [ 1, 4, 4, 1 ], 3 ], [ 12, [ 1, 5, 5, 1 ], 1 ] ][128X[104X
    [4X[28X [128X[104X
  [4X[32X[104X
  
  [1X12.1-10 SCMorseUST[101X
  
  [29X[2XSCMorseUST[102X( [3Xcomplex[103X ) [32X function
  [6XReturns:[106X  [33X[0;10Ya  random  Morse  function  of  a simplicial complex and a list of
            critical faces.[133X
  
  [33X[0;0YBuilds a random Morse function by removing a uniformly sampled spanning tree
  from the dual 1-skeleton followed by a collapsing approach. [3Xcomplex[103X needs to
  be  a  closed  weak  pseudomanifold  for  this  to  work. For details of the
  algorithm, see [PS14].[133X
  
  [4X[32X  Example  [32X[104X
    [4X[28X gap> c:=SCBdSimplex(3);;[128X[104X
    [4X[28X gap> f:=SCMorseUST(c);;[128X[104X
    [4X[28X gap> Size(f[2]);[128X[104X
    [4X[28X 2[128X[104X
    [4X[28X [128X[104X
  [4X[32X[104X
  
  [1X12.1-11 SCSpanningTreeRandom[101X
  
  [29X[2XSCSpanningTreeRandom[102X( [3XHD[103X, [3Xtop[103X ) [32X function
  [6XReturns:[106X  [33X[0;10Ya list of edges upon success, [10Xfail[110X otherweise.[133X
  
  [33X[0;0YComputes  a  uniformly sampled spanning tree of the complex belonging to the
  Hasse  diagram  [3XHD[103X using Wilson's algorithm (see [Wil96]). If [3Xtop = true[103X the
  output  is  a  spanning tree of the dual graph of the underlying complex. If
  [3Xtop  =  false[103X  the  output is a spanning tree of the primal graph (i.e., the
  [22X1[122X-skeleton.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[28X gap> c:=SCSurface(1,false);;[128X[104X
    [4X[28X gap> HD:=SCHasseDiagram(c);;[128X[104X
    [4X[28X gap> stTop:=SCSpanningTreeRandom(HD,true);[128X[104X
    [4X[28X [ 3, 10, 13, 8, 1, 15, 12, 6, 14 ][128X[104X
    [4X[28X gap> stBot:=SCSpanningTreeRandom(HD,false);[128X[104X
    [4X[28X [ 10, 6, 9, 5, 13 ][128X[104X
    [4X[28X [128X[104X
  [4X[32X[104X
  
  [1X12.1-12 SCHomology[101X
  
  [29X[2XSCHomology[102X( [3Xcomplex[103X ) [32X method
  [6XReturns:[106X  [33X[0;10Ya list of pairs of the form [10X[ integer, list ][110X upon success[133X
  
  [33X[0;0YComputes  the  homology  groups  of a given simplicial complex [3Xcomplex[103X using
  [2XSCMorseRandom[102X     ([14X12.1-6[114X)     to    obtain    a    Morse    function    and
  [10XSmithNormalFormIntegerMat[110X.  Use  [2XSCHomologyEx[102X  ([14X12.1-13[114X)  to use alternative
  methods  to  compute  discrete  Morse  functions  (such  as [2XSCMorseEngstroem[102X
  ([14X12.1-5[114X), or [2XSCMorseUST[102X ([14X12.1-10[114X)) or the Smith normal form.[133X
  
  [33X[0;0YThe  output is a list of homology groups of the form [22X[H_0,....,H_d][122X, where [22Xd[122X
  is  the dimension of [3Xcomplex[103X. The format of the homology groups [22XH_i[122X is given
  in terms of their maximal cyclic subgroups, i.e. a homology group [22XH_i≅ Z^f +
  Z  /  t_1  Z  ×  dots  ×  Z  /  t_n  Z[122X  is  returned  in form of a list [22X[ f,
  [t_1,...,t_n]  ][122X,  where [22Xf[122X is the (integer) free part of [22XH_i[122X and [22Xt_i[122X denotes
  the torsion parts of [22XH_i[122X ordered in weakly increasing size.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[28X gap> c:=SCSeriesTorus(2);;[128X[104X
    [4X[28X gap> f:=SCHomology(c);[128X[104X
    [4X[28X [ [ 0, [  ] ], [ 2, [  ] ], [ 1, [  ] ] ][128X[104X
    [4X[28X [128X[104X
  [4X[32X[104X
  
  [1X12.1-13 SCHomologyEx[101X
  
  [29X[2XSCHomologyEx[102X( [3Xc[103X, [3Xmorsechoice[103X, [3Xsmithchoice[103X ) [32X method
  [6XReturns:[106X  [33X[0;10Ya  list  of pairs of the form [10X[ integer, list ][110X upon success, fail
            otherwise.[133X
  
  [33X[0;0YComputes  the  homology  groups  of  a  given simplicial complex [3Xc[103X using the
  function   [3Xmorsechoice[103X   for   discrete   Morse  function  computations  and
  [3Xsmithchoice[103X for Smith normal form computations.[133X
  
  [33X[0;0YThe  output is a list of homology groups of the form [22X[H_0,....,H_d][122X, where [22Xd[122X
  is  the dimension of [3Xcomplex[103X. The format of the homology groups [22XH_i[122X is given
  in terms of their maximal cyclic subgroups, i.e. a homology group [22XH_i≅ Z^f +
  Z  /  t_1  Z  ×  dots  ×  Z  /  t_n  Z[122X  is  returned  in form of a list [22X[ f,
  [t_1,...,t_n]  ][122X,  where [22Xf[122X is the (integer) free part of [22XH_i[122X and [22Xt_i[122X denotes
  the torsion parts of [22XH_i[122X ordered in weakly increasing size.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[28X gap> c:=SCSeriesTorus(2);;[128X[104X
    [4X[28X gap> f:=SCHomology(c);[128X[104X
    [4X[28X [ [ 0, [  ] ], [ 2, [  ] ], [ 1, [  ] ] ][128X[104X
    [4X[28X [128X[104X
  [4X[32X[104X
  
  [4X[32X  Example  [32X[104X
    [4X[28X gap> c := SCSeriesHomologySphere(2,3,5);;[128X[104X
    [4X[28X gap> SCHomologyEx(c,SCMorseRandom,SmithNormalFormIntegerMat); time;[128X[104X
    [4X[28X [ [ 0, [  ] ], [ 0, [  ] ], [ 0, [  ] ], [ 1, [  ] ] ][128X[104X
    [4X[28X 44[128X[104X
    [4X[28X gap> c := SCSeriesHomologySphere(2,3,5);;[128X[104X
    [4X[28X gap> SCHomologyEx(c,SCMorseRandomLex,SmithNormalFormIntegerMat); time;[128X[104X
    [4X[28X [ [ 0, [  ] ], [ 0, [  ] ], [ 0, [  ] ], [ 1, [  ] ] ][128X[104X
    [4X[28X 76[128X[104X
    [4X[28X gap> c := SCSeriesHomologySphere(2,3,5);;[128X[104X
    [4X[28X gap> SCHomologyEx(c,SCMorseRandomRevLex,SmithNormalFormIntegerMat); time;[128X[104X
    [4X[28X [ [ 0, [  ] ], [ 0, [  ] ], [ 0, [  ] ], [ 1, [  ] ] ][128X[104X
    [4X[28X 60[128X[104X
    [4X[28X gap> c := SCSeriesHomologySphere(2,3,5);;[128X[104X
    [4X[28X gap> SCHomologyEx(c,SCMorseEngstroem,SmithNormalFormIntegerMat); time;[128X[104X
    [4X[28X [ [ 0, [  ] ], [ 0, [  ] ], [ 0, [  ] ], [ 1, [  ] ] ][128X[104X
    [4X[28X 132[128X[104X
    [4X[28X gap> c := SCSeriesHomologySphere(2,3,5);;[128X[104X
    [4X[28X gap> SCHomologyEx(c,SCMorseUST,SmithNormalFormIntegerMat); time;[128X[104X
    [4X[28X [ [ 0, [  ] ], [ 0, [  ] ], [ 0, [  ] ], [ 1, [  ] ] ][128X[104X
    [4X[28X 160[128X[104X
    [4X[28X [128X[104X
  [4X[32X[104X
  
  [1X12.1-14 SCIsSimplyConnected[101X
  
  [29X[2XSCIsSimplyConnected[102X( [3Xc[103X ) [32X function
  [6XReturns:[106X  [33X[0;10Ya boolean value upon success, [10Xfail[110X otherweise.[133X
  
  [33X[0;0YComputes  if  the  [10XSCSimplicialComplex[110X  object  [3Xc[103X  is  simply connected. The
  algorithm is a heuristic method and is described in [PS14]. Internally calls
  [2XSCIsSimplyConnectedEx[102X ([14X12.1-15[114X).[133X
  
  [4X[32X  Example  [32X[104X
    [4X[28X gap> rp2:=SCSurface(1,false);;[128X[104X
    [4X[28X gap> SCIsSimplyConnected(rp2);[128X[104X
    [4X[28X false[128X[104X
    [4X[28X gap> c:=SCBdCyclicPolytope(8,18);;[128X[104X
    [4X[28X gap> SCIsSimplyConnected(c);[128X[104X
    [4X[28X true[128X[104X
    [4X[28X [128X[104X
  [4X[32X[104X
  
  [1X12.1-15 SCIsSimplyConnectedEx[101X
  
  [29X[2XSCIsSimplyConnectedEx[102X( [3Xc[103X[, [3Xtop[103X, [3Xtries[103X] ) [32X function
  [6XReturns:[106X  [33X[0;10Ya boolean value upon success, [10Xfail[110X otherweise.[133X
  
  [33X[0;0YComputes  if  the  [10XSCSimplicialComplex[110X  object  [3Xc[103X  is  simply connected. The
  optional  boolean  argument  [3Xtop[103X  determines whether a spanning graph in the
  dual  or  the  primal graph of [3Xc[103X will be used for a collapsing sequence. The
  optional  positive integer argument [3Xtries[103X determines the number of times the
  algorithm  will  try  to  find  a  collapsing  sequence.  The algorithm is a
  heuristic method and is described in [PS14].[133X
  
  [4X[32X  Example  [32X[104X
    [4X[28X gap> rp2:=SCSurface(1,false);;[128X[104X
    [4X[28X gap> SCIsSimplyConnectedEx(rp2);[128X[104X
    [4X[28X false[128X[104X
    [4X[28X gap> c:=SCBdCyclicPolytope(8,18);;[128X[104X
    [4X[28X gap> SCIsSimplyConnectedEx(c);[128X[104X
    [4X[28X true[128X[104X
    [4X[28X [128X[104X
  [4X[32X[104X
  
  [1X12.1-16 SCIsSphere[101X
  
  [29X[2XSCIsSphere[102X( [3Xc[103X ) [32X function
  [6XReturns:[106X  [33X[0;10Ya boolean value upon success, [10Xfail[110X otherweise.[133X
  
  [33X[0;0YDetermines whether the [10XSCSimplicialComplex[110X object [3Xc[103X is a topological sphere.
  In  dimension  [22X≠  4[122X the algorithm determines whether [3Xc[103X is PL-homeomorphic to
  the  standard  sphere.  In  dimension  [22X4[122X  the  PL type is not specified. The
  algorithm  uses  a  result due to [KS77] stating that, in dimension [22X≠ 4[122X, any
  simply  connected homology sphere with PL structure is a standard PL sphere.
  The  function  calls  [2XSCIsSimplyConnected[102X  ([14X12.1-14[114X)  which uses a heuristic
  method described in [PS14].[133X
  
  [4X[32X  Example  [32X[104X
    [4X[28X gap> c:=SCBdCyclicPolytope(4,20);;[128X[104X
    [4X[28X gap> SCIsSphere(c);[128X[104X
    [4X[28X true[128X[104X
    [4X[28X gap> c:=SCSurface(1,true);;[128X[104X
    [4X[28X gap> SCIsSphere(c);[128X[104X
    [4X[28X false[128X[104X
    [4X[28X [128X[104X
  [4X[32X[104X
  
  [1X12.1-17 SCIsManifold[101X
  
  [29X[2XSCIsManifold[102X( [3Xc[103X ) [32X function
  [6XReturns:[106X  [33X[0;10Ya boolean value upon success, [10Xfail[110X otherweise.[133X
  
  [33X[0;0YThe  algorithm  is  a  heuristic  method  and is described in [PS14] in more
  detail. Internally calls [2XSCIsManifoldEx[102X ([14X12.1-18[114X).[133X
  
  [4X[32X  Example  [32X[104X
    [4X[28X gap> c:=SCBdCyclicPolytope(4,20);;[128X[104X
    [4X[28X gap> SCIsManifold(c);[128X[104X
    [4X[28X true[128X[104X
    [4X[28X [128X[104X
  [4X[32X[104X
  
  [1X12.1-18 SCIsManifoldEx[101X
  
  [29X[2XSCIsManifoldEx[102X( [3Xc[103X[, [3Xaut[103X, [3Xquasi[103X] ) [32X function
  [6XReturns:[106X  [33X[0;10Ya boolean value upon success, [10Xfail[110X otherweise.[133X
  
  [33X[0;0YIf  the  boolean argument [3Xaut[103X is [10Xtrue[110X the automorphism group is computed and
  only  one  link  per orbit is checked to be a sphere. If [3Xaut[103X is not provided
  symmetry  information  is  only  used  if  the automorphism group is already
  known.  If the boolean argument [3Xquasi[103X is [10Xfalse[110X the algorithm returns whether
  or  not  [3Xc[103X  is  a combinatorial manifold. If [3Xquasi[103X is [10Xtrue[110X the [22X4[122X-dimensional
  links  are not verified to be standard PL [22X4[122X-spheres and [3Xc[103X is a combinatorial
  manifold  modulo  the smooth Poincare conjecture. By default [3Xquasi[103X is set to
  [10Xfalse[110X.  The  algorithm  is  a heuristic method and is described in [PS14] in
  more detail.[133X
  
  [33X[0;0YSee  [2XSCBistellarIsManifold[102X  ([14X9.2-6[114X)  for  an alternative method for manifold
  verification.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[28X gap> c:=SCBdCyclicPolytope(4,20);;[128X[104X
    [4X[28X gap> SCIsManifold(c);[128X[104X
    [4X[28X true[128X[104X
    [4X[28X [128X[104X
  [4X[32X[104X
  
