From 51d0b3bf0ae3eb4d1333cb79ec5b49e1bee25b36 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Mon, 4 May 2020 16:38:03 +0200 Subject: [PATCH] NormalClosure: accept list of normal generators as input ... for the second argument --- lib/grp.gd | 11 ++++-- lib/grp.gi | 12 +++++++ tst/testinstall/opers/NormalClosure.tst | 48 +++++++++++++++++++++++++ 3 files changed, 69 insertions(+), 2 deletions(-) create mode 100644 tst/testinstall/opers/NormalClosure.tst diff --git a/lib/grp.gd b/lib/grp.gd index 14da63dcd6..2c9b98c17c 100644 --- a/lib/grp.gd +++ b/lib/grp.gd @@ -1278,8 +1278,8 @@ DeclareGlobalFunction("MaximalSolvableSubgroups"); ## ## is the smallest normal subgroup of G that has a solvable factor group. ## PerfectResiduum(Group((1,2,3,4,5),(1,2))); -## Group([ (1,3,2), (1,4,3), (2,5,4) ]) +## gap> PerfectResiduum(SymmetricGroup(5)); +## Alt( [ 1 .. 5 ] ) ## ]]> ## ## @@ -3127,13 +3127,20 @@ DeclareOperation( "IsSubnormal", [ IsGroup, IsGroup ] ); ## <#GAPDoc Label="NormalClosure"> ## ## +## ## ## ## The normal closure of U in G is the smallest normal subgroup ## of the closure of G and U which contains U. +##

+## The second argument may also be a list of group elements, in which +## case the normal closure of the group generated by these elements is +## computed. ## NormalClosure(g,Subgroup(g,[(1,2,3)])) = Group([ (1,2,3), (2,3,4) ]); ## true +## gap> NormalClosure(g,[(1,2,3)]) = Group([ (1,2,3), (2,3,4) ]); +## true ## gap> NormalClosure(g,Group((3,4,5))) = Group([ (3,4,5), (1,5,4), (1,2,5) ]); ## true ## ]]> diff --git a/lib/grp.gi b/lib/grp.gi index c0f7456726..3a411be444 100644 --- a/lib/grp.gi +++ b/lib/grp.gi @@ -2914,6 +2914,18 @@ function(G,U) return U; end); +InstallOtherMethod( NormalClosure, "generic method for a list of generators", + IsIdenticalObj, [ IsGroup, IsList ], +function(G, list) + return NormalClosure(G, Group(list, One(G))); +end); + +InstallOtherMethod( NormalClosure, "generic method for an empty list of generators", + [ IsGroup, IsList and IsEmpty ], +function(G, list) + return TrivialSubgroup(G); +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 0000000000..3b12d8c7c7 --- /dev/null +++ b/tst/testinstall/opers/NormalClosure.tst @@ -0,0 +1,48 @@ +#@local S4, A4, S5, F, H, N +gap> START_TEST("NormalClosure.tst"); + +# +# setup perm groups +# +gap> S4 := SymmetricGroup(4);; +gap> A4 := AlternatingGroup(4);; +gap> S5 := SymmetricGroup(5);; + +# normal closure of a subgroup +gap> S4 = NormalClosure(S4, Group((1,2))); +true +gap> A4 = NormalClosure(S4, Group((1,2,3))); +true +gap> S5 = NormalClosure(S4, Group((4,5))); +true + +# normal closure of a bunch of generators +gap> S4 = NormalClosure(S4, [ (1,2) ]); +true +gap> A4 = NormalClosure(S4, [ (1,2,3) ]); +true +gap> S5 = NormalClosure(S4, [ (4,5) ]); +true +gap> IsTrivial(NormalClosure(S4, [ ])); # corner case +true + +# +# setup fp groups +# +gap> F := FreeGroup(2);; + +# normal closure of a subgroup +gap> H := Subgroup(F, [F.1^2, F.2^2, Comm(F.1, F.2)]);; +gap> N := NormalClosure(F, H);; +gap> Index(F, N); +4 + +# +gap> N := NormalClosure(F, [F.1^2, F.2^2, Comm(F.1, F.2)]);; +gap> Index(F, N); +4 +gap> IsTrivial(NormalClosure(F, [ ])); # corner case +true + +# +gap> STOP_TEST("NormalClosure.tst", 1);