1############################################################################
2##
3#W  manual.tst 			The LPRES-package	        René Hartung
4##
5
6gap> START_TEST("Checking the examples from the manual...");
7
8############################################################################
9##
10##  Section II An Introduction to L-presented groups
11##
12gap> Unbind(a); Unbind(b); Unbind(c); Unbind(d);
13gap> F:=FreeGroup( "a", "b", "c", "d" );
14<free group on the generators [ a, b, c, d ]>
15gap> AssignGeneratorVariables( F );
16#I  Assigned the global variables [ a, b, c, d ]
17gap> frels:=[ a^2, b^2, c^2, d^2, b*c*d ];;
18gap> endos:=[ GroupHomomorphismByImagesNC( F, F, [ a, b, c, d ], [ c^a, d, b, c ]) ];;
19gap> irels:=[ Comm( d, d^a ), Comm( d, d^(a*c*a*c*a) ) ];;
20gap> G:=LPresentedGroup( F, frels, endos, irels );
21<LpGroup on the generators [ a, b, c, d ]>
22gap> Unbind(a);Unbind(b);Unbind(c);Unbind(d);
23
24gap> LamplighterGroup( IsLpGroup, 2 );
25<LpGroup on the generators [ a, t, u ]>
26gap> LamplighterGroup( IsLpGroup, CyclicGroup(3) );
27<LpGroup on the generators [ a, t, u ]>
28
29gap> F:=FreeGroup( 2 );;
30gap> G:=LPresentedGroup( F, [ F.1^2 ], [ IdentityMapping( F ) ], [ F.2 ] );;
31gap> FreeGroupOfLpGroup( G ) = F;
32true
33gap> GeneratorsOfGroup( G );
34[ f1, f2 ]
35gap> FreeGeneratorsOfLpGroup( G );
36[ f1, f2 ]
37gap> last = last2;
38false
39gap> UnderlyingElement( G.1 );
40f1
41gap> last in F;
42true
43gap> ElementOfLpGroup( ElementsFamily( FamilyObj( G ) ), last2 ) in G;
44true
45
46gap> F:=FreeGroup( 2 );;
47gap> G:=LPresentedGroup( F, [ F.1^2 ], [ IdentityMapping( F ) ], [ F.2 ] );
48<LpGroup on the generators [ f1, f2 ]>
49gap> FixedRelatorsOfLpGroup( G );
50[ f1^2 ]
51gap> IteratedRelatorsOfLpGroup( G );
52[ f2 ]
53gap> EndomorphismsOfLpGroup( G );
54[ IdentityMapping( <free group on the generators [ f1, f2 ]> ) ]
55
56gap> F:=FreeGroup( "a", "b", "c", "d" );;
57gap> AssignGeneratorVariables( F );
58#I  Assigned the global variables [ a, b, c, d ]
59gap> frels:=[ a^2, b^2, c^2, d^2, b*c*d ];;
60gap> endos:=[ GroupHomomorphismByImagesNC( F, F, [ a, b, c, d ], [ c^a, d, b, c ]) ];;
61gap> irels:=[ Comm( d, d^a ), Comm( d, d^(a*c*a*c*a) ) ];;
62gap> G:=LPresentedGroup( F, frels, endos, irels );
63<LpGroup on the generators [ a, b, c, d ]>
64gap> SetUnderlyingInvariantLPresentation( G, G );;
65gap> Unbind(a);Unbind(b);Unbind(c);Unbind(d);
66
67gap> F := FreeGroup( "a" );
68<free group on the generators [ a ]>
69gap> H := F / [ F.1^3 ];
70<fp group on the generators [ a ]>
71gap> U := ExamplesOfLPresentations( 8 );
72<invariant LpGroup of size infinity on the generators [ t, u, v ]>
73gap> aut:=GroupHomomorphismByImagesNC( U, U, [ U.1, U.2, U.3 ], [ U.2, U.3, U.1 ] );
74[ t, u, v ] -> [ u, v, t ]
75gap> SplitExtensionByAutomorphismsLpGroup( U, H, [ aut ] );
76<LpGroup on the generators [ t, u, v, a ]>
77
78gap> F:=FreeGroup( 2 );
79<free group on the generators [ f1, f2 ]>
80gap> G:=F/[ F.1^2, F.2^2, Comm( F.1, F.2 ) ];
81<fp group on the generators [ f1, f2 ]>
82gap> IsomorphismLpGroup( G );
83[ f1, f2 ] -> [ f1, f2 ]
84gap> Range(last);
85<invariant LpGroup on the generators [ f1, f2 ]>
86gap> Display(last);
87generators = [ f1, f2 ]
88fixed relators = [ ]
89endomorphism = [
90IdentityMapping( <free group on the generators [ f1, f2 ]> ) ]
91iterated relators = [
92f1^2,
93f2^2,
94f1^-1*f2^-1*f1*f2 ]
95
96############################################################################
97##
98##  Section III Nilpotent Quotients of L-presented groups
99##
100gap> G := ExamplesOfLPresentations( 1 );;
101gap> H := NilpotentQuotient( G, 5 );
102Pcp-group with orders [ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
103gap> lcs := LowerCentralSeries( H );
104[ Pcp-group with orders [ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ],
105  Pcp-group with orders [ 2, 2, 2, 2, 2, 2, 2 ],
106  Pcp-group with orders [ 2, 2, 2, 2, 2 ], Pcp-group with orders [ 2, 2, 2 ],
107  Pcp-group with orders [ 2, 2 ], Pcp-group with orders [  ] ]
108gap> List( [ 1..5 ], x -> lcs[ x ] / lcs[ x+1 ] );
109[ Pcp-group with orders [ 2, 2, 2 ], Pcp-group with orders [ 2, 2 ],
110  Pcp-group with orders [ 2, 2 ], Pcp-group with orders [ 2 ],
111  Pcp-group with orders [ 2, 2 ] ]
112
113gap> G := ExamplesOfLPresentations( 1 );
114<invariant LpGroup of size infinity on the generators [ a, b, c, d ]>
115gap> epi := NqEpimorphismNilpotentQuotient( G, 5 );
116[ a, b, c, d ] -> [ g1, g2*g3, g2, g3 ]
117gap> H := Image( epi );
118Pcp-group with orders [ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
119gap> NilpotencyClassOfGroup( H );
1205
121gap> H := NilpotentQuotient( G, 7 );
122Pcp-group with orders [ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
123gap> NilpotentQuotient( G, 10 );
124Pcp-group with orders [ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
125gap> NqEpimorphismNilpotentQuotient( G, H );
126[ a, b, c, d ] -> [ g1, g2*g3, g2, g3 ]
127gap> Image( last );
128Pcp-group with orders [ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
129
130gap> G := ExamplesOfLPresentations( 1 );;
131gap> AbelianInvariants( G );
132[ 2, 2, 2 ]
133
134gap> F := FreeGroup( "a", "b", "c", "d" );
135<free group on the generators [ a, b, c, d ]>
136gap> AssignGeneratorVariables( F );
137#I  Assigned the global variables [ a, b, c, d ]
138gap> rels := [ a^2, b^2, c^2, d^2, b*d*c ];;
139gap> endos := [ GroupHomomorphismByImagesNC( F, F, [ a, b, c, d ], [ c^a, d, b, c ]) ];;
140gap> itrels := [ Comm( d, d^a ), Comm( d, d^(a*c*a*c*a) ) ];;
141gap> G := LPresentedGroup( F, rels, endos, itrels );
142<LpGroup on the generators [ a, b, c, d ]>
143gap> List( rels, x -> x^endos[1] );
144[ a^-1*c^2*a, d^2, b^2, c^2, d*c*b ]
145
146gap> SetIsInvariantLPresentation( G, true );
147gap> NilpotentQuotient( G, 4 );
148Pcp-group with orders [ 2, 2, 2, 2, 2, 2, 2, 2 ]
149gap> Unbind(a); Unbind(b); Unbind(c); Unbind(d);
150
151gap> F := FreeGroup( "a", "b", "c", "d" );
152<free group on the generators [ a, b, c, d ]>
153gap> AssignGeneratorVariables( F );
154#I  Assigned the global variables [ a, b, c, d ]
155gap> rels := [ a^2, b^2, c^2, d^2, b*d*c ];;
156gap> endos := [ GroupHomomorphismByImagesNC( F, F, [ a, b, c, d ], [ c^a, d, b, c ]) ];;
157gap> itrels := [ Comm( d, d^a ), Comm( d, d^(a*c*a*c*a) ) ];;
158gap> G := LPresentedGroup( F, rels, endos, itrels );
159<LpGroup on the generators [ a, b, c, d ]>
160gap> List( rels, x -> x^endos[1] );
161[ a^-1*c^2*a, d^2, b^2, c^2, d*c*b ]
162
163gap> U := LPresentedGroup( F, rels, endos, itrels );
164<LpGroup on the generators [ a, b, c, d ]>
165gap> SetUnderlyingInvariantLPresentation( G, U );
166gap> NilpotentQuotient( G, 4 );
167Pcp-group with orders [ 2, 2, 2, 2, 2, 2, 2, 2 ]
168gap> Unbind(a); Unbind(b); Unbind(c); Unbind(d);
169
170gap> F := FreeGroup( "a", "b", "c", "d" );
171<free group on the generators [ a, b, c, d ]>
172gap> AssignGeneratorVariables( F );
173#I  Assigned the global variables [ a, b, c, d ]
174gap> rels := [ a^2, b^2, c^2, d^2, b*d*c ];;
175gap> endos := [ GroupHomomorphismByImagesNC( F, F, [ a, b, c, d ], [ c^a, d, b, c ]) ];;
176gap> itrels := [ Comm( d, d^a ), Comm( d, d^(a*c*a*c*a) ) ];;
177gap> G := LPresentedGroup( F, rels, endos, itrels );
178<LpGroup on the generators [ a, b, c, d ]>
179gap> List( rels, x -> x^endos[1] );
180[ a^-1*c^2*a, d^2, b^2, c^2, d*c*b ]
181
182gap> SetUnderlyingInvariantLPresentation( G, UnderlyingAscendingLPresentation( G ) );
183gap> NilpotentQuotient( G, 4 );
184Pcp-group with orders [ 2, 2, 2, 2, 2, 2, 2, 2 ]
185gap> Unbind(a); Unbind(b); Unbind(c); Unbind(d);
186
187############################################################################
188##
189##  Section IV The underlying functions
190##
191gap> G := ExamplesOfLPresentations( 1 );
192<invariant LpGroup of size infinity on the generators [ a, b, c, d ]>
193gap> Q := InitQuotientSystem( G );
194rec( Definitions := [ 1, 3, 4 ], Epimorphism := [ a, b, c, d ] ->
195    [ g1, g2*g3, g2, g3 ], Imgs := [ 1, [ 2, 1, 3, 1 ], 2, 3 ],
196  Lpres := <invariant LpGroup of size infinity on the generators
197    [ a, b, c, d ]>, Pccol := <<from the left collector with 3 generators>>,
198  Weights := [ 1, 1, 1 ] )
199gap> ExtendQuotientSystem( Q );
200rec( Definitions := [ 1, 3, 4, [ 2, 1 ], [ 3, 1 ] ],
201  Epimorphism := [ a, b, c, d ] -> [ g1, g2*g3, g2, g3 ],
202  Imgs := [ 1, [ 2, 1, 3, 1 ], 2, 3 ],
203  Lpres := <invariant LpGroup of size infinity on the generators
204    [ a, b, c, d ]>, Pccol := <<from the left collector with 5 generators>>,
205  Weights := [ 1, 1, 1, 2, 2 ] )
206gap> G := ExamplesOfLPresentations( 1 );;
207gap> NilpotentQuotient( G, 5 );
208Pcp-group with orders [ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
209gap> NilpotentQuotientSystem( G );
210rec( Definitions := [ 1, 3, 4, [ 2, 1 ], [ 3, 1 ], [ 4, 2 ], [ 4, 3 ],
211      [ 7, 1 ], [ 8, 2 ], [ 8, 3 ] ], Epimorphism := [ a, b, c, d ] ->
212    [ g1, g2*g3, g2, g3 ], Imgs := [ 1, [ 2, 1, 3, 1 ], 2, 3 ],
213  Lpres := <invariant LpGroup of size infinity on the generators
214    [ a, b, c, d ]>, Pccol := <<from the left collector with 10 generators>>,
215  Weights := [ 1, 1, 1, 2, 2, 3, 3, 4, 5, 5 ] )
216gap> NilpotencyClassOfGroup( PcpGroupByCollectorNC( last.Pccol ) );
2175
218
219gap> G:=ExamplesOfLPresentations( 3 );;
220gap> HasIsInvariantLPresentation( G );
221false
222gap> NilpotentQuotient( G, 3 );
223Pcp-group with orders [ 0, 2, 2, 2 ]
224gap> NilpotentQuotients( G );
225[ [ a, t, u ] -> [ g2, g1, g2 ], [ a, t, u ] -> [ g2, g1, g2 ],
226  [ a, t, u ] -> [ g2, g1, g2 ] ]
227gap> Range( last[2] );
228Pcp-group with orders [ 0, 2, 2 ]
229
230gap> NilpotentQuotientSystem( UnderlyingInvariantLPresentation( G ) );
231rec( Definitions := [ 1, 2, 3, [ 2, 1 ], [ 3, 2 ], [ 4, 1 ], [ 4, 2 ],
232      [ 5, 2 ], [ 5, 3 ] ], Epimorphism := [ a, t, u ] -> [ g1, g2, g3 ],
233  Imgs := [ 1, 2, 3 ], Lpres := <invariant LpGroup on the generators
234    [ a, t, u ]>, Pccol := <<from the left collector with 9 generators>>,
235  Weights := [ 1, 1, 1, 2, 2, 3, 3, 3, 3 ] )
236
237gap> IL := InfoLevel(InfoLPRES);;
238gap> SetInfoLevel( InfoLPRES, 1 );;
239gap> G:=ExamplesOfLPresentations( 1 );
240#I  The Grigorchuk group on 4 generators from [Lys85]
241<invariant LpGroup of size infinity on the generators [ a, b, c, d ]>
242gap> NilpotentQuotient( G, 3 );
243#I  Class 1: 3 generators with relative orders: [ 2, 2, 2 ]
244#I  Class 2: 2 generators with relative orders: [ 2, 2 ]
245#I  Class 3: 2 generators with relative orders: [ 2, 2 ]
246Pcp-group with orders [ 2, 2, 2, 2, 2, 2, 2 ]
247gap> SetInfoLevel(InfoLPRES, IL);
248
249################################################################
250# L-presentation of IA subgroup
251gap> f := FreeGroup(3);
252<free group on the generators [ f1, f2, f3 ]>
253gap> a := AutomorphismGroup(f);;
254gap> map := EmbeddingOfIASubgroup(a);;
255gap> ia := Source(map);
256<invariant LpGroup on the generators [ C(1,2), C(1,3), C(2,1), C(2,3), C(3,1), C(3,2), M(1,[2,3]),
257  M(2,[1,3]), M(3,[1,2]) ]>
258gap> freemap := GroupHomomorphismByFunction(FreeGroupOfLpGroup(ia),a,x->ElementOfLpGroup(FamilyObj(One(ia)),x)^map);;
259gap> ForAll(IteratedRelatorsOfLpGroup(ia),x->IsOne(x^freemap));
260true
261gap> endos := EndomorphismsOfLpGroup(ia);;
262gap> ForAll([1..Length(endos)],i->ForAll(GeneratorsOfGroup(FreeGroupOfLpGroup(ia)),x->(x^endos[i])^freemap=(x^freemap)^ia!.Gendos[i]));
263true
264
265gap> STOP_TEST( "ManualExamples.tst", 100000);
266