From 8b1ff2400542e2a4fa33a6234ea2d1d5f33bcee7 Mon Sep 17 00:00:00 2001 From: Alexander Hulpke Date: Sat, 1 Dec 2018 11:05:36 +0100 Subject: [PATCH] ENHANCE: Special redispatch for Nat.Hom.ByNS if group is found out to be finite This is needed, as for matrix groups the earlier `NiceMonomorphism` dispatch does not hold. Test is only done before expesive action search is started, so negligible cost. Also added redispatches in case the NiceMonomorphism approach is ever removed. This fixes #3070 Added testfile --- lib/factgrp.gi | 18 ++++++++++++++++++ tst/testbugfix/2018-12-01-Nathom.tst | 5 +++++ 2 files changed, 23 insertions(+) create mode 100644 tst/testbugfix/2018-12-01-Nathom.tst diff --git a/lib/factgrp.gi b/lib/factgrp.gi index 9b0afb3823..29acdcd14b 100644 --- a/lib/factgrp.gi +++ b/lib/factgrp.gi @@ -1151,6 +1151,9 @@ function(G,N) return GenericFindActionKernel(G,N); end); +RedispatchOnCondition(FindActionKernel,IsIdenticalObj,[IsGroup,IsGroup], + [IsGroup and IsFinite,IsGroup],0); + InstallMethod(FindActionKernel,"general case: can't do",IsIdenticalObj, [IsGroup,IsGroup],0, function(G,N) @@ -1400,6 +1403,12 @@ local h; fi; if h=fail then # now we try to find a suitable operation + + # redispatch upon finiteness test, as following will fail in infinite case + if not HasIsFinite(G) and IsFinite(G) then + return NaturalHomomorphismByNormalSubgroupOp(G,N); + fi; + h:=FindActionKernel(G,N); if h<>fail then Info(InfoFactor,1,"Action of degree ", @@ -1415,6 +1424,15 @@ local h; return h; end); +RedispatchOnCondition(NaturalHomomorphismByNormalSubgroupNCOrig,IsIdenticalObj, + [IsGroup,IsGroup],[IsGroup and IsFinite,IsGroup],0); + +RedispatchOnCondition(NaturalHomomorphismByNormalSubgroupInParent,true, + [IsGroup],[IsGroup and IsFinite],0); + +RedispatchOnCondition(FactorGroupNC,IsIdenticalObj, + [IsGroup,IsGroup],[IsGroup and IsFinite,IsGroup],0); + ############################################################################# ## #M NaturalHomomorphismByNormalSubgroup( , ) . . for solvable factors diff --git a/tst/testbugfix/2018-12-01-Nathom.tst b/tst/testbugfix/2018-12-01-Nathom.tst new file mode 100644 index 0000000000..0419a4f50b --- /dev/null +++ b/tst/testbugfix/2018-12-01-Nathom.tst @@ -0,0 +1,5 @@ +# Reported in github PR 3070 +# Degenerate example where the subgroup can be formed without finiteness test (as the group +# is cyclic). +gap> G := Group([[[E(3),0,0],[0,E(3),0],[0,0,E(3)]],[[1,0,0],[0,0,1],[0,1,0]]]);; +gap> FactorGroup(G,Center(G));;