Skip to content

Commit

Permalink
CLEANUP: Make MaxesAlmostSimple an operation.
Browse files Browse the repository at this point in the history
This permits packages to overload new methods without touching existing
code.
Also have simple group imply almost simple group.
  • Loading branch information
hulpke authored and alex-konovalov committed Sep 9, 2018
1 parent 4d92d97 commit 84c293f
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 39 deletions.
7 changes: 6 additions & 1 deletion lib/grp.gd
Original file line number Diff line number Diff line change
Expand Up @@ -710,6 +710,9 @@ InstallTrueMethod( IsSimpleGroup, IsSporadicSimpleGroup );
DeclareProperty( "IsAlmostSimpleGroup", IsGroup );
InstallTrueMethod( IsGroup, IsAlmostSimpleGroup );

# a simple group is almost simple
InstallTrueMethod( IsAlmostSimpleGroup, IsSimpleGroup );


#############################################################################
##
Expand Down Expand Up @@ -1221,7 +1224,9 @@ DeclareAttribute("TryMaximalSubgroupClassReps",IsGroup,"mutable");
# utility function in maximal subgroups code
DeclareGlobalFunction("TryMaxSubgroupTainter");
DeclareGlobalFunction("DoMaxesTF");
DeclareGlobalFunction("MaxesAlmostSimple");

# make this an operation to allow for overloading and TryNextMethod();
DeclareOperation("MaxesAlmostSimple",[IsGroup]);

#############################################################################
##
Expand Down
81 changes: 43 additions & 38 deletions lib/maxsub.gi
Original file line number Diff line number Diff line change
Expand Up @@ -536,42 +536,16 @@ local hom,embs,s,k,agens,ad,i,j,perm,dia,ggens,e,tgens,d,m,reco,emba,outs,id;
return m;
end);

InstallGlobalFunction(MaxesAlmostSimple,function(G)
local id,m,epi,cnt,h;

# is a permutation degree too big?
if IsPermGroup(G) then
if NrMovedPoints(G)>
SufficientlySmallDegreeSimpleGroupOrder(Size(PerfectResiduum(G))) then
h:=G;
for cnt in [1..5] do
epi:=SmallerDegreePermutationRepresentation(h);
if NrMovedPoints(Range(epi))<NrMovedPoints(h) then
m:=MaxesAlmostSimple(Image(epi,G));
m:=List(m,x->PreImage(epi,x));
return m;
fi;
# new group to avoid storing the map
h:=Group(GeneratorsOfGroup(G));
SetSize(h,Size(G));
od;
fi;


# Are just finding out that a group is symmetric or alternating?
# if so, try to use method that uses data library
if
#not (HasIsNaturalSymmetricGroup(G) or HasIsNaturalAlternatingGroup(G)) and
(IsNaturalSymmetricGroup(G) or IsNaturalAlternatingGroup(G)) then
Info(InfoLattice,1,"MaxesAlmostSimple: Use S_n/A_n");
m:=MaximalSubgroupsSymmAlt(G,false);
if m<>fail then
return m;
fi;
fi;
fi;
InstallMethod(MaxesAlmostSimple,"fallback to lattice",true,[IsGroup],0,
function(G)
if ValueOption("cheap")=true then return [];fi;
Info(InfoLattice,1,"MaxesAlmostSimple: Fallback to lattice");
return MaxesByLattice(G);
end);

# is the degree bad?
InstallMethod(MaxesAlmostSimple,"table of marks and linear",true,[IsGroup],0,
function(G)
local m,id,epi;

# does the table of marks have it?
m:=TomDataMaxesAlmostSimple(G);
Expand All @@ -595,10 +569,41 @@ local id,m,epi,cnt,h;
fi;

fi;
TryNextMethod();
end);

if ValueOption("cheap")=true then return [];fi;
Info(InfoLattice,1,"MaxesAlmostSimple: Fallback to lattice");
return MaxesByLattice(G);
InstallMethod(MaxesAlmostSimple,"permutation group",true,[IsPermGroup],0,
function(G)
local m,epi,cnt,h;

# Are we just finding out that a group is symmetric or alternating?
# if so, try to use method that uses data library
if (IsNaturalSymmetricGroup(G) or IsNaturalAlternatingGroup(G)) then
Info(InfoLattice,1,"MaxesAlmostSimple: Use S_n/A_n");
m:=MaximalSubgroupsSymmAlt(G,false);
if m<>fail then
return m;
fi;
fi;

# is a permutation degree too big?
if NrMovedPoints(G)>
SufficientlySmallDegreeSimpleGroupOrder(Size(PerfectResiduum(G))) then
h:=G;
for cnt in [1..5] do
epi:=SmallerDegreePermutationRepresentation(h);
if NrMovedPoints(Range(epi))<NrMovedPoints(h) then
m:=MaxesAlmostSimple(Image(epi,G));
m:=List(m,x->PreImage(epi,x));
return m;
fi;
# re-create group to avoid storing the map
h:=Group(GeneratorsOfGroup(G));
SetSize(h,Size(G));
od;
fi;

TryNextMethod();
end);

BindGlobal("MaxesType4a",function(w,G,a,t,n)
Expand Down

0 comments on commit 84c293f

Please sign in to comment.