diff --git a/lib/grp.gd b/lib/grp.gd index 14da63dcd6..52a739f0e9 100644 --- a/lib/grp.gd +++ b/lib/grp.gd @@ -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..2b4edb98db --- /dev/null +++ b/tst/testinstall/opers/NormalClosure.tst @@ -0,0 +1,50 @@ +#@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> Index(F, H); +infinity +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);