From a48cdf4e28380a62ccd11e00246dbe67d47c9ee9 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Mon, 9 Mar 2020 23:37:35 +0100 Subject: [PATCH] NormalClosure: accept list of normal generators as input ... for the second argument --- lib/grp.gi | 6 ++++ tst/testinstall/opers/NormalClosure.tst | 40 +++++++++++++++++++++++++ 2 files changed, 46 insertions(+) create mode 100644 tst/testinstall/opers/NormalClosure.tst diff --git a/lib/grp.gi b/lib/grp.gi index c0f7456726e..a136f290c8c 100644 --- a/lib/grp.gi +++ b/lib/grp.gi @@ -2914,6 +2914,12 @@ function(G,U) return U; end); +InstallOtherMethod( NormalClosure, "generic method for a list of normal generators", + IsIdenticalObj, [ IsGroup, IsList ], SUM_FLAGS, +function(G, list) + return NormalClosure(G, Subgroup(G, list)); +end); + ############################################################################# ## #M NormalIntersection( , ) . . . . . intersection with normal subgrp diff --git a/tst/testinstall/opers/NormalClosure.tst b/tst/testinstall/opers/NormalClosure.tst new file mode 100644 index 00000000000..fd2e459ddc9 --- /dev/null +++ b/tst/testinstall/opers/NormalClosure.tst @@ -0,0 +1,40 @@ +gap> START_TEST("NormalClosure.tst"); + +# +# setup perm groups +# +gap> G := SymmetricGroup(4);; +gap> H := AlternatingGroup(4);; + +# normal closure of a subgroup +gap> G = NormalClosure(G, Group((1,2))); +true +gap> H = NormalClosure(G, Group((1,2,3))); +true + +# normal closure of a bunch of generators +gap> G = NormalClosure(G, [ (1,2) ]); +true +gap> H = NormalClosure(G, [ (1,2,3) ]); +true + +# +# setup fp groups +# +gap> G := FreeGroup(2);; + +# normal closure of a subgroup +gap> H := Subgroup(G, [G.1^2, G.2^2, Comm(G.1, G.2)]);; +gap> Index(G, H); +infinity +gap> N := NormalClosure(G, H);; +gap> Index(G, N); +4 + +# +gap> N := NormalClosure(G, [G.1^2, G.2^2, Comm(G.1, G.2)]);; +gap> Index(G, N); +4 + +# +gap> STOP_TEST("NormalClosure.tst", 1);