This file is indexed.

/usr/share/gap/lib/grpchain.gd is in gap-libs 4r7p5-2.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
#############################################################################
##
#W  grpchain.gd			GAP Library		       Gene Cooperman
#W							     and Scott Murray
##
##
#Y  Copyright (C)  1996,  Lehrstuhl D für Mathematik,  RWTH Aachen,  Germany
#Y  (C) 1999 School Math and Comp. Sci., University of St Andrews, Scotland
#Y  Copyright (C) 2002 The GAP Group
##
##  Requires: transversal
##

#1
##  Data structures for storing general group chains. Note that this does 
##  *not* replace `StabChain'.
##  The group attribute `ChainSubgroup(<G>)' stores the next group down 
##  in the chain (i.e.~the structure is recursive).  `ChainSubgroup(<G>)' 
##  should have an attribute `Transversal' which describes a transversal 
##  of `ChainSubgroup(<G>)' in <G>, as in `gptransv.[gd,gi]'.
##  
##  The command `ChainSubgroup' will use the default method for computing
##  chains -- currently this is random Schreier-Sims, unless the group is
##  nilpotent.
##  *Warning:* This algorithm is Monte-Carlo.
##  `ChainSubgroup' is mutable, since it may start as the trivial subgroup,
##  and then grow as elements are sifted in, and some stick.
##  This allows us to do, if we want, things like:
##  
##  \){\kernttindent}SetChainSubgroup(<G>, ClosureGroup(ChainSubgroup(<G>), %
##  <siftee>) );
##  
##  Whether this code is used instead of previous methods is determined by 
##  4 variables which control the behaviour of the filter `IsChainTypeGroup'.
##  See the file `gap.../lib/grpchain.gd' for details.
##  

DeclareInfoClass( "InfoChain" );

#############################################################################
#############################################################################
##
##  Control variables
##
#############################################################################
#############################################################################

##  Use chain subgroups for matrix groups
UseMatrixChainSubgroups := false;

##  Use chain subgroups for permutation groups
UsePermChainSubgroups := false;

##  Use our code rather than StabChain
UseStabChainViaChainSubgroup := false;

##  Cutoff for using our code rather than nice homomorphisms for mx grps
SmallSpaceCutoff := 50000;

#############################################################################
##
#A  ChainSubgroup( <G> )
##
##  Computes the chain, if necessary, and returns the next subgroup in the 
##  chain.  The current default is to use the random Schreier-Sims algorithm,
##  unless the group is known to be nilpotent, in which case `MakeHomChain'
##  is used.
##
DeclareAttribute( "ChainSubgroup", IsGroup, "mutable" );

#############################################################################
##
#A  Transversal( <G> )
##
##  The transversal of the group <G> in the previous subgroup of the chain.
##
DeclareAttribute( "Transversal", IsGroup );  


#############################################################################
##
#O  IsInChain( <G> )
##
##  A group <G> is in a chain if it has either a `ChainSubgroup' or 
##  a `Transversal'.
##
DeclareFilter( "IsInChain" );     
InstallTrueMethod( IsInChain, HasChainSubgroup );
InstallTrueMethod( IsInChain, HasTransversal );  

#############################################################################
##
#P  IsFFEMatrixGroupOverLargeSpace( <G> )
##
##  Is the underlying vector space of size less than SmallSpaceCutoff?
##
DeclareProperty( "IsFFEMatrixGroupOverLargeSpace", IsGroup );
InstallImmediateMethod( IsFFEMatrixGroupOverLargeSpace,
    IsFFEMatrixGroup and HasDimensionOfMatrixGroup and HasFieldOfMatrixGroup, 0,
    G -> Size( FieldOfMatrixGroup(G) ) ^ DimensionOfMatrixGroup( G )
         >= SmallSpaceCutoff );

#############################################################################
##
#P  IsChainTypeGroup( <G> )
##
##  returns `true' if the group <G> is ``chain type'', i.e. it is the kind
##  of group where computations are best done with chains.
##
DeclareProperty( "IsChainTypeGroup", IsGroup );
InstallImmediateMethod( IsChainTypeGroup, IsPermGroup, 0,
                        G -> UsePermChainSubgroups ) ;
InstallImmediateMethod( IsChainTypeGroup, IsFFEMatrixGroupOverLargeSpace, 0,
                        G -> UseMatrixChainSubgroups );

InstallMethod( IsChainTypeGroup, "default:  false if no immediate method ran",
               true, [ IsGroup ], 0, ReturnFalse );

#############################################################################
##
#P  IsStabChainViaChainSubgroup( <G> )
##
##  returns `true' if stabiliser chains for <G> are to be computed with our 
##  code rather than with `StabChain'.
##
DeclareProperty( "IsStabChainViaChainSubgroup", IsPermGroup );                       
InstallImmediateMethod( IsStabChainViaChainSubgroup, IsPermGroup, 0,
                        G -> UseStabChainViaChainSubgroup ) ;

#############################################################################
##
#P  GeneratingSetIsComplete( <G> )
##
##  returns `true' if the generating set of the group <G> is complete.  For 
##  example, for a stabiliser subgroup this is true if our strong generators
##  have been verified.
##
DeclareProperty( "GeneratingSetIsComplete", IsGroup );


#############################################################################
#############################################################################
##
##  General chain utilities
##
#############################################################################
#############################################################################

#############################################################################
##
#O  SiftOneLevel( <G>, <g> )
##
##  Sift <g> though one level of the chain.
##
DeclareOperation( "SiftOneLevel", 
    [ IsGroup and HasChainSubgroup, IsAssociativeElement ] );

#############################################################################
##
#O  Sift( <G>, <g> )
##
##  Sift <g> through the entire chain.
##
DeclareOperation( "Sift", 
    [ IsGroup, IsAssociativeElement ] );

#############################################################################
##
#F  SizeOfChainOfGroup( <G> )
##
##  Uses the chain to compute the size of a group.  Unlike `Size(<G>)',
##  this does not set the `Size' attribute, which is useful if the chain is
##  not known to be complete.
##  
DeclareGlobalFunction( "SizeOfChainOfGroup", [IsGroup] );

#############################################################################
##
#F  TransversalOfChainSubgroup( <G> )
##
##  Returns the transversal of the next group in the chain, inside <G>.
##
DeclareGlobalFunction( "TransversalOfChainSubgroup", [IsGroup] );

#############################################################################
##
#F  ChainStatistics( <G> )
##
##  Returns a record containing useful statistics about the chain of <G>.
##
DeclareGlobalFunction( "ChainStatistics", [IsGroup and HasChainSubgroup ] );

#############################################################################
##
#F  HasChainHomomorphicImage( <G> )
##
##  Does <G> have a chain subgroup derived from a homomorphic image?
##  This will be `false' for stabiliser, trivial, and sift function chain 
##  subgroups.  It will be true for homomorphism and direct product chain
##  subgroups.
##
DeclareGlobalFunction( "HasChainHomomorphicImage" );

#############################################################################
##
#F  ChainHomomorphicImage( <G> )
##
##  Returns the chain homomorphic image, or `fail' if no such image exists.
##
DeclareGlobalFunction( "ChainHomomorphicImage" );



#############################################################################
#############################################################################
##
##  Stabiliser chain utilities
##
#############################################################################
#############################################################################

#############################################################################
##
#A  BaseOfGroup( <G> )
##
##  If the group <G> has a chain consisting entirely of stabiliser subgroups,
##  then this command returns the base as a list.  This command does not 
##  compute a base, however.
##
DeclareAttribute( "BaseOfGroup", IsGroup and IsInChain );


#############################################################################
##
#O  ExtendedGroup( <G>, <g> )
##
##  Add a new Schreier generator for <G>.
##
DeclareOperation( "ExtendedGroup", 
    [ IsGroup and IsInChain, IsAssociativeElement ] );


#############################################################################
##
#F  StrongGens( <G> )
##
##  Returns a list of generating sets for each level of the chain.
##
DeclareGlobalFunction( "StrongGens", [ IsGroup ] );

#############################################################################
##
#F  ChainSubgroupByStabiliser( <G>, <basePoint>, <Action> )
##
##  Form a chain subgroup by stabilising <basePoint> under the given action.
##  The subgroup will start with no generators, and will have a transversal
##  by Schreier tree.
##
DeclareGlobalFunction( "ChainSubgroupByStabiliser", 
    [ IsGroup, IsObject, IsFunction ] );

#############################################################################
##
#A  OrbitGeneratorsOfGroup( <G> )
##
##  Generators used to compute the orbit of <G>.  Used by `baseim.[gd,gi]'.
##
DeclareAttribute( "OrbitGeneratorsOfGroup", IsGroup );


#############################################################################
#############################################################################
##
##  Hom coset chain utilities
##
#############################################################################
#############################################################################

#############################################################################
##
#F  ChainSubgroupByHomomorphism( <hom> )
##
##  Form a chain subgroup by the kernel of <hom>.
##  The subgroup will start with no generators, and will have a <hom>
##  transversal.
##
DeclareGlobalFunction( "ChainSubgroupByHomomorphism", [ IsGroupHomomorphism ] );

#############################################################################
##
#F  ChainSubgroupByProjectionFunction( <G>, <kernelSubgp>, <imgSubgp>, %
#F  <projFnc> )
##
##  When the homomorphism of a quotient group is a projection, then
##  there is an internal semidirect product, for which `TransversalElt()'
##  has a direct implementation as the projection.
##  <hom> will be the projection, and `<elt> -> ImageElm(<hom>, <elt>)' is 
##  the map.
##
DeclareGlobalFunction( "ChainSubgroupByProjectionFunction",
    [ IsGroup, IsGroup, IsFunction ]); # Ideally, IsProjection, if it existed.

#############################################################################
##
#F  QuotientGroupByChainHomomorphicImage( <quo>[, <quo2>] )
##
##  This function deals with quotient groups of quotient groups in a chain.
##
DeclareGlobalFunction( "QuotientGroupByChainHomomorphicImage" );

#############################################################################
##
#A  ChainSubgroupQuotient( <G> )
##
##  The quotient by the chain subgroup.
##
DeclareAttribute( "ChainSubgroupQuotient", IsGroup );




#############################################################################
#############################################################################
##
##  Direct sum chain utilities
##
#############################################################################
#############################################################################

#############################################################################
##
#F  ChainSubgroupByDirectProduct( <proj>, <inj > )
##
##  Form a chain subgroup by internal direct product.
##
DeclareGlobalFunction( "ChainSubgroupByDirectProduct", 
    [ IsGroupHomomorphism, IsGroupHomomorphism ] );

#############################################################################
##
#F  ChainSubgroupByPSubgroupOfAbelian( <G>, <p> )
##
##  <G> is an abelian group, <p> a prime involved in <G>.
##  Form a direct sum chain where the subgroup is the <p>-prime part of <G>.
##
DeclareGlobalFunction( "ChainSubgroupByPSubgroupOfAbelian", 
    [ IsGroup and IsAbelian, IsInt ] );



#############################################################################
#############################################################################
##
##  Trivial subgroup chain utilities
##
#############################################################################
#############################################################################

#############################################################################
##
#F  ChainSubgroupByTrivialSubgroup( <G> )
##
##  Form a chain subgroup by enumerating the group.
##
DeclareGlobalFunction( "ChainSubgroupByTrivialSubgroup", 
    [ IsGroup ] );

#############################################################################
#############################################################################
##
##  Sift function chain utilities
##
#############################################################################
#############################################################################

#############################################################################
##
#F  ChainSubgroupBySiftFunction( <G>, <subgroup>, <siftFnc> )
##
##  Form a chain subgroup using a sift function.
##
DeclareGlobalFunction( "ChainSubgroupBySiftFunction", 
    [ IsGroup, IsGroup, IsFunction ] );


#############################################################################
##
#E  grpchain.gd . . . . . . . . . . . . . . . . . . . . . . . . . . ends here
##