This file is indexed.

/usr/share/gap/lib/utils.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
#############################################################################
##
#W  utils.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
##
##  This is a temporary file containing utilities for group chains.
##

#############################################################################
#############################################################################
##
##  General 
##
#############################################################################
#############################################################################

#############################################################################
##
#F  UseSubsetRelationNC( <super>, <sub> )
##
##  This would be a useful GAP fnc.  For UseSubsetRelation,
##    GAP currently requires:  FAMILY PREDICATE:  IS_IDENTICAL_OBJ
##
DeclareGlobalFunction( "UseSubsetRelationNC", [ IsCollection, IsCollection ] );

#############################################################################
##
#O  ImageUnderWord( <basicIm>, <word>, <orbitGenerators>, <homFromFree> )
##
DeclareOperation( "ImageUnderWord", [ IsList, IsWordWithInverse, IsList, IsGroupHomomorphism ] );

#############################################################################
##
#O  ImageUnderWord( <basicIm>, <word>, <orbitGenerators>, <homFromFree> )
##
##  The image of <basicIm> under <word> evaluated in the orbit generators.
##
DeclareOperation( "ImageUnderWord", [ IsInt, IsWordWithInverse, IsList, IsGroupHomomorphism ] );

#############################################################################
#############################################################################
##
##  Matrices and vectors
##
#############################################################################
#############################################################################

#############################################################################
##
#A  UnderlyingVectorSpace( <A> )
##
##  Underlying vector space of an algebra.
##
DeclareAttribute( "UnderlyingVectorSpace", IsAlgebra );

#############################################################################
##
#A  UnderlyingVectorSpace( <G> )
##
##  Underlying vector space of a matrix group.
##
DeclareAttribute( "UnderlyingVectorSpace", IsFFEMatrixGroup );

#############################################################################
##
#A  UnderlyingVectorSpace( <M> )
##
##  Underlying vector space of a matrix???
##
DeclareAttribute( "UnderlyingVectorSpace", IsMatrix );

#############################################################################
##
#O  FixedPointSpace( <matrix> )
##
##  The fixed point space of a matrix.
##
DeclareOperation( "FixedPointSpace", [ IsMatrix ] );

#############################################################################
##
#O  PermMatrixGroup( <G> )
##
##  Convert a permutation group to a group of permutation matrices over GF(2).
##
DeclareOperation( "PermMatrixGroup", [ IsPermGroup ] );

#############################################################################
##
#O  EnvelopingAlgebra( <G> )
##
##  The enveloping algebra of a matrix group.
##
DeclareOperation( "EnvelopingAlgebra", [ IsFFEMatrixGroup ] );

#############################################################################
##
#O  SpanOfMatrixGroup( <G> )
##
##  The vector space span of a matrix group.
##
DeclareOperation( "SpanOfMatrixGroup", [ IsFFEMatrixGroup ] );

#############################################################################
##
#P  IsUniformMatrixGroup( <G> )
##
##  Matrix group is uniform if fixed point space of every element
##  is either the trivial space or the entire space.
##
DeclareProperty( "IsUniformMatrixGroup", IsFFEMatrixGroup );

#############################################################################
##
#A  PreBasis( <H> )
##
##  Basis for the source of <H>, such that the images of the elements
##  are in the basis for the range.
##
DeclareAttribute( "PreBasis", IsVectorSpaceHomomorphism );

#############################################################################
##
#F Pullback( <H>, <v> )
##
##  Image(H, PullBack( H, v )) = v; # => true;
##
DeclareGlobalFunction( "PullBack", [ IsVectorSpaceHomomorphism, IsVector ] );

#############################################################################
##
#F  ImageMat( <H>, <A> )
##
##  v  := Random(Source(H));  A := Random(G);
##  Image(H, v)^ImageMat( H, A ) = Image(H, v^A); #  => true
##
DeclareGlobalFunction( "ImageMat", [ IsVectorSpaceHomomorphism, IsMatrix ] );

#############################################################################
##
#F  ExtendToBasis( <V>, <vects> )
##
##  Extend <vects> to a basis.
##
DeclareGlobalFunction( "ExtendToBasis", [ IsVectorSpace, IsList ] );

#############################################################################
##
#F  ProjectionOntoVectorSubspace( <V>, <W> )
##
##  Returns the projection of <V> onto <W>
##
DeclareGlobalFunction( "ProjectionOntoVectorSubspace", 
    [ IsVectorSpace, IsVectorSpace ] );

#############################################################################
##
#F  IsomorphismToFullRowSpace( <V> )
##
##  Returns the isomorphism from <V> to the appropriate row space.
##
DeclareGlobalFunction( "IsomorphismToFullRowSpace", [ IsVectorSpace ] );

#############################################################################
##
#F  ProjectionOntoFullRowSpace( <V>, <W> )
##
##  Returns the projection from <V> onto a full row space isomorphic to <W>.
##
DeclareGlobalFunction( "ProjectionOntoFullRowSpace", 
    [ IsVectorSpace, IsVectorSpace ] );


#############################################################################
#############################################################################
##
##  Groups
##
#############################################################################
#############################################################################

#############################################################################
##
#F  RandomSubprod( <grp> )
##
##  Returns a random subproduct of the generators of <grp>.
##
DeclareGlobalFunction( "RandomSubprod", [ IsGroup, IsVectorSpace ] );

#############################################################################
##
#F  RandomNormalSubproduct( <grp>, <subgp> )
##
##  Returns a random normal subproduct.
##
DeclareGlobalFunction( "RandomNormalSubproduct", [ IsGroup, IsGroup ] );

#############################################################################
##
#F  RandomCommutatorSubproduct( <grp1>, <grp2> )
##
##  Returns a random commutator subproduct.
##
DeclareGlobalFunction( "RandomCommutatorSubproduct", [ IsGroup, IsGroup ] );

#############################################################################
##
#P  IsCharacteristicMatrixPGroup( <H> )
#P  IsNoncharacteristicMatrixPGroup( <H> )
##
##  A matrix group is a characteristic $p$-group if it is a $p$-group
##  and $p$ is also the characteristic of the underlying field.
##
##     HasIsCharacteristicMatrixPGroup to true.  Hence, we have three cases:
##     (1) HasIsCharacteristicMatrixPGroup false
##     (2) HasIsCharacteristicMatrixPGroup true, and IsCharacteristicMatrixPGroup true
##     (3) HasIsCharacteristicMatrixPGroup true, and IsCharacteristicMatrixPGroup false
##     The last case should be synonymous with IsNoncharacteristicMatrixPGroup
##     Hence, when an IsCharacteristicMatrixPGroup method is applicable, the
##     IsNoncharacteristicMatrixPGroup method will also be applicable, but
##     the IsCharacteristicMatrixPGroup will be considered more specific, and
##     so will always be preferred over the IsNoncharacteristicMatrixPGroup method.
##  DeclareSynonym( "IsNoncharacteristicMatrixPGroup", HasIsCharacteristicMatrixPGroup );
##  gdc - This is bogus.  We should just have two separate attributes
##        with an immediate method connecting them.
##  InstallImmediateMethod( IsNoncharacteristicMatrixPGroup, HasIsCharacteristicMatrixPGroup,
##                          0, grp -> not IsCharacteristicMatrixPGroup );
DeclareProperty( "IsCharacteristicMatrixPGroup", IsFFEMatrixGroup );
DeclareProperty( "IsNoncharacteristicMatrixPGroup", IsFFEMatrixGroup );

#############################################################################
##
#O  SizeUpperBound( <G> )
##
##  Return an upper bound on the order of the group <G>.
##
DeclareOperation( "SizeUpperBound", [ IsGroup ] );

#############################################################################
##
#F  DecomposeEltIntoPElts( <elt> )
#F  DecomposeEltIntoPElts( <elt>, <ordOfElt> )
##
##  Produces list of elements:  [p, elti], where p prime,
##  elti has order a power of p, and cyclic group generated by elt
##  is same as group generated by union of elements, elti.
##  NO CHECKING:  If you lie about the order, you get a false result.
##    This seems to be similar to GAP's IndependentGeneratorsOfAbelianGroup(),
##    but we need the extra information
##
DeclareGlobalFunction( "DecomposeEltIntoPElts" );

#############################################################################
##
#O  PGroupGeneratorsOfAbelianGroup( <H> )
##
##  Produces list of p-groups, each elt of form [p, pgroupGenerators, exponent]
##
DeclareOperation( "PGroupGeneratorsOfAbelianGroup", 
    [ IsGroup and IsAbelian ] );

#############################################################################
##
#A  GeneratorOfCyclicGroup( <G> )
##
##  Cyclic groups must have a single generator.  Store it.
##  This is useful for groups given with multiple generators which are 
##  later shown to be cyclic.
##  Note this gives an implicit presentation for the group.
##
DeclareAttribute( "GeneratorOfCyclicGroup", IsGroup and IsCyclic );

#############################################################################
##
#A  IndependentGeneratorsOfAbelianMatrixGroup( <H> )
##
##  Note this gives an implicit presentation for the group.
##  This should replace the current matrix group method for 
##  IndependentGeneratorsOfAbelianGroup.
##
DeclareAttribute( "IndependentGeneratorsOfAbelianMatrixGroup",
                  IsGroup and IsFFEMatrixGroup and IsAbelian );
DeclareAttribute( "IndependentGeneratorsOfAbelianMatrixGroup",
                  IsAdditiveGroup );

#############################################################################
##
#F  IsInCenter( <G>, <g> )
#F  IsInCentre( <G>, <g> )
##
##  Is <g> in the centre of <G>?
##
DeclareGlobalFunction( "IsInCenter", [ IsGroup, IsAssociativeElement ] );

#############################################################################
##
#F  UnipotentSubgroup( <n>, <p> )
##
##  Returns the unipotent subgroup of GL( <n>, <p> ).
##  Currently <p> must be prime.
##
DeclareGlobalFunction( "UnipotentSubgroup", [ IsInt, IsInt ] );


#############################################################################
#############################################################################
##
##  Matrix group recognition
##
#############################################################################
#############################################################################

#############################################################################
##
#O  NaturalHomomorphismByInvariantSubspace( <A>, <W> )
##
##  The natural homomorphism of a matrix algebra <A> given by an invariant 
##  subspace <W> of the underlying vector space.
##
DeclareOperation( "NaturalHomomorphismByInvariantSubspace",
    [ IsAlgebra, IsVectorSpace ] );

#############################################################################
##
#O  NaturalHomomorphismByInvariantSubspace( <G>, <W> )
##
##  The natural homomorphism of a matrix group <G> given by an invariant 
##  subspace <W> of the underlying vector space.
##
DeclareOperation( "NaturalHomomorphismByInvariantSubspace",
    [ IsFFEMatrixGroup, IsVectorSpace ] );

#############################################################################
##
#O  NaturalHomomorphismByFixedPointSubspace( <G>, <W> )
##
##  The natural homomorphism given by a fixed point subspace.
##
DeclareOperation( "NaturalHomomorphismByFixedPointSubspace",
    [ IsFFEMatrixGroup, IsVectorSpace ] );

#############################################################################
##
#O  NaturalHomomorphismByHomVW( <G>, <W> )
##
##  We are in the case of Hom(V,W)
##  Get hom from g to Hom(V,W) by g-> (v -> v*g-v) for v in V,
##  and interpret result as f in Hom(V,W), by images on Basis(V)
##  where Hom(V,W) is viewed as additive group.
##  NOTE: v*(hg)-v=(v*h-v)*g+(v*g-v),\phi(h*g)=\phi(h)\circ\phi(g)
##  This is Hom from mult. grp. to additive grp.
##  Action of G on this is  v*g^(-1)*f*g when W<V is G-invar.
##  This needs a better name.
##
DeclareOperation( "NaturalHomomorphismByHomVW",
    [ IsFFEMatrixGroup, IsVectorSpace ] );


#E