/* Function Conditions Input : x an element of a minimal parabolic subgroup Typex an index determining the minimal parabolic subgroup to which x belongs SchlafliSymb the Coxeter matrix of the geometry rho a vector built using a backtracking method which contains the elements of the minimal parabolic subgroups as detailed in section 4.1 G the group of the coset geometry H the potential Borel of the apartment as detailed in section 4.1 Output : - true if x satisfies the conditions detailed after lemma 4.1 - false otherwise */ function Conditions(x,Typex,SchlafliSymb,rho,G,H) for i:=1 to Typex-1 do y := rho[i]; if not (#sub eq #H*2*SchlafliSymb[i,Typex]) then return false; end if; end for; return true; end function; /* Procedure GoodElts Input : counter an index SchlafliSymb the Coxeter matrix of the geometry element a vector of sets that contain the elements as in lemma 4.1 rho a vector built using a backtracking method which contains the elements of the minimal parabolic subgroups as detailed in section 4.1 G the group of the coset geometry H the potential Borel of the apartment IndexMax the rank of the coset geometry ListOfGoodElts a vector Output : - GoodElts builds a vector ListOfGoodElts of all possible combinations of elements of the minimal parabolic subgroups as detailed after lemma 4.1 */ procedure GoodElts(counter,SchlafliSymb,~elements,~rho,~G,~H,IndexMax, ~ListOfGoodElts) for x in elements[counter] do if Conditions(x,counter,SchlafliSymb,rho,G,H) then rho[counter] := x; if counter lt IndexMax then GoodElts(counter+1,SchlafliSymb,~elements,~rho,~G,~H,IndexMax,~ListOfGoodElts); else elt := rho; Append(~ListOfGoodElts,elt); end if; end if; end for; end procedure; /* Function HasApartment Input : CG a coset geometry CoxCG the Coxeter Matrix MaxPara an indexed set containing the maximal parabolic subgroups of CG MinPara an indexed set containing the minimal parabolic subgroups of CG StopAfterFound a boolean set to true if only one example of N satisfying Definition 2.5 is needed, and set to false if all N satisfying Definition 2.5 must be returned. Output : - a boolean true or false - an indexed set of numbers of conjugacy classes of subgroups of the Borel subgroups where N can be found - an indexed set of subgroups N */ function HasApartment(CG,CoxCG,MaxPara,MinPara,StopAfterFound) HasAparts := false; Classes := {@@}; ListOfN := {@@}; G := Group(CG); B := Borel(CG); lB := SubgroupLattice(B); RankCG := Rank(CG); SchlafliSymb := {2} join {CoxCG[i][j] : j in {i+1.. RankCG}, i in {1..RankCG-1}}; ProductSymb := 2*LCM(SchlafliSymb); for i := 1 to #lB do Rep := Group(lB!i); // Check condition of Proposition 2.5 if (#Normalizer(G,Rep) mod (#Rep*ProductSymb) eq 0) then for g in Transversal(B,Normalizer(B,Rep)) do Candidates := []; H := Rep^g; j := 1; CanContinue := true; while (CanContinue and (j le RankCG)) do for k := 1 to RankCG do q,alpha := quo; Append(~Candidates, {G|h*x : h in H, x in {y@@alpha : y in q | Order(y) eq 2}}); end for; if #Candidates[j] eq 0 then CanContinue := false; end if; j := j+1; end while; if CanContinue then rho := [Id(G) : j in [1..RankCG]]; ListOfGoodElts := []; for x in Candidates[1] do rho[1] := x; GoodElts(2,CoxCG,~Candidates,~rho,~G,~H,RankCG,~ListOfGoodElts); for elt in ListOfGoodElts do rho := SequenceToSet(elt); N := sub; BN := sub; if #BN eq #G then SubgroupsOfN := {}; for l := 1 to RankCG do SubgroupsOfN := SubgroupsOfN join {N meet MaxPara[l]}; end for; SCG := CosetGeometry(N,SubgroupsOfN); if (IsThin(SCG) and IsFTGeometry(SCG) and IsResiduallyConnected(SCG)) then HasAparts := true; Classes := Classes join {@i@}; ListOfN := ListOfN join {@N@}; if StopAfterFound then return HasAparts,Classes,ListOfN; end if; end if; end if; end for; rho := [Id(G) : j in [1..RankCG]]; ListOfGoodElts := []; end for; end if; end for; end if; end for; return HasAparts,Classes,ListOfN; end function;