Skip to content

Commit

Permalink
NormalClosure: accept list of normal generators as input
Browse files Browse the repository at this point in the history
... for the second argument
  • Loading branch information
fingolfin committed May 6, 2020
1 parent 5011e6b commit 63d2b80
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 2 deletions.
11 changes: 9 additions & 2 deletions lib/grp.gd
Original file line number Diff line number Diff line change
Expand Up @@ -1278,8 +1278,8 @@ DeclareGlobalFunction("MaximalSolvableSubgroups");
## <Description>
## is the smallest normal subgroup of <A>G</A> that has a solvable factor group.
## <Example><![CDATA[
## gap> 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 ] )
## ]]></Example>
## </Description>
## </ManSection>
Expand Down Expand Up @@ -3127,13 +3127,20 @@ DeclareOperation( "IsSubnormal", [ IsGroup, IsGroup ] );
## <#GAPDoc Label="NormalClosure">
## <ManSection>
## <Oper Name="NormalClosure" Arg='G, U'/>
## <Oper Name="NormalClosure" Arg='G, list' Label="for group and a list"/>
##
## <Description>
## The normal closure of <A>U</A> in <A>G</A> is the smallest normal subgroup
## of the closure of <A>G</A> and <A>U</A> which contains <A>U</A>.
## <P/>
## 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.
## <Example><![CDATA[
## gap> 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
## ]]></Example>
Expand Down
12 changes: 12 additions & 0 deletions lib/grp.gi
Original file line number Diff line number Diff line change
Expand Up @@ -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( <G>, <U> ) . . . . . intersection with normal subgrp
Expand Down
48 changes: 48 additions & 0 deletions tst/testinstall/opers/NormalClosure.tst
Original file line number Diff line number Diff line change
@@ -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);

0 comments on commit 63d2b80

Please sign in to comment.