This file is indexed.

/usr/share/gap/lib/ringpoly.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
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
#############################################################################
##
#W  ringpoly.gd                 GAP Library                      Frank Celler
##
##
#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 file contains  the categories, attributes, properties and operations
##  for polynomial rings and function fields.
##


#############################################################################
##
#C  IsPolynomialRing( <pring> )
##
##  <#GAPDoc Label="IsPolynomialRing">
##  <ManSection>
##  <Filt Name="IsPolynomialRing" Arg='pring' Type='Category'/>
##
##  <Description>
##  is the category of polynomial rings
##  </Description>
##  </ManSection>
##  <#/GAPDoc>
##
DeclareCategory( "IsPolynomialRing", IsRing );

#############################################################################
##
#C  IsFunctionField( <ffield> )
##
##  <#GAPDoc Label="IsFunctionField">
##  <ManSection>
##  <Filt Name="IsFunctionField" Arg='ffield' Type='Category'/>
##
##  <Description>
##  is the category of function fields
##  </Description>
##  </ManSection>
##  <#/GAPDoc>
##
DeclareCategory("IsFunctionField",IsRing);

#############################################################################
##
#C  IsUnivariatePolynomialRing( <pring> )
##
##  <#GAPDoc Label="IsUnivariatePolynomialRing">
##  <ManSection>
##  <Filt Name="IsUnivariatePolynomialRing" Arg='pring' Type='Category'/>
##
##  <Description>
##  is the category of polynomial rings with one indeterminate.
##  <Example><![CDATA[
##  gap> r:=UnivariatePolynomialRing(Rationals,"p");
##  Rationals[p]
##  gap> r2:=PolynomialRing(Rationals,["q"]);
##  Rationals[q]
##  gap> IsUnivariatePolynomialRing(r);
##  true
##  gap> IsUnivariatePolynomialRing(r2);
##  true
##  ]]></Example>
##  </Description>
##  </ManSection>
##  <#/GAPDoc>
##
DeclareCategory( "IsUnivariatePolynomialRing", IsPolynomialRing );

#############################################################################
##
#C  IsFiniteFieldPolynomialRing( <pring> )
##
##  <#GAPDoc Label="IsFiniteFieldPolynomialRing">
##  <ManSection>
##  <Filt Name="IsFiniteFieldPolynomialRing" Arg='pring' Type='Category'/>
##
##  <Description>
##  is the category of polynomial rings over a finite field
##  (see Chapter&nbsp;<Ref Chap="Finite Fields"/>).
##  </Description>
##  </ManSection>
##  <#/GAPDoc>
##
DeclareCategory( "IsFiniteFieldPolynomialRing", IsPolynomialRing );


#############################################################################
##
#C  IsAbelianNumberFieldPolynomialRing( <pring> )
##
##  <#GAPDoc Label="IsAbelianNumberFieldPolynomialRing">
##  <ManSection>
##  <Filt Name="IsAbelianNumberFieldPolynomialRing" Arg='pring' Type='Category'/>
##
##  <Description>
##  is the category of polynomial rings over a field of cyclotomics
##  (see the chapters&nbsp;<Ref Chap="Cyclotomic Numbers"/> and <Ref Chap="Abelian Number Fields"/>).
##  </Description>
##  </ManSection>
##  <#/GAPDoc>
##
DeclareCategory( "IsAbelianNumberFieldPolynomialRing", IsPolynomialRing );

#############################################################################
##
#C  IsAlgebraicExtensionPolynomialRing( <pring> )
##
##  <ManSection>
##  <Filt Name="IsAlgebraicExtensionPolynomialRing" Arg='pring' Type='Category'/>
##
##  <Description>
##  is the category of polynomial rings over a field that has been formed as
##  an <C>AlgebraicExtension</C> of a base field.
##  (see chapter&nbsp;<Ref Chap="Algebraic extensions of fields"/>).
##  </Description>
##  </ManSection>
##
DeclareCategory( "IsAlgebraicExtensionPolynomialRing", IsPolynomialRing );


#############################################################################
##
#C  IsRationalsPolynomialRing( <pring> )
##
##  <#GAPDoc Label="IsRationalsPolynomialRing">
##  <ManSection>
##  <Filt Name="IsRationalsPolynomialRing" Arg='pring' Type='Category'/>
##
##  <Description>
##  is the category of polynomial rings over the rationals
##  (see Chapter&nbsp;<Ref Chap="Rational Numbers"/>).
##  <Example><![CDATA[
##  gap> r := PolynomialRing(Rationals, ["a", "b"] );;
##  gap> IsPolynomialRing(r);
##  true
##  gap> IsFiniteFieldPolynomialRing(r);
##  false
##  gap> IsRationalsPolynomialRing(r);
##  true
##  ]]></Example>
##  </Description>
##  </ManSection>
##  <#/GAPDoc>
##
DeclareCategory( "IsRationalsPolynomialRing",
    IsAbelianNumberFieldPolynomialRing );


#############################################################################
##
#A  CoefficientsRing( <pring> )
##
##  <#GAPDoc Label="CoefficientsRing">
##  <ManSection>
##  <Attr Name="CoefficientsRing" Arg='pring'/>
##
##  <Description>
##  returns the ring of coefficients of the polynomial ring <A>pring</A>,
##  that is the ring over which <A>pring</A> was defined.
##  <Example><![CDATA[
##  gap> r:=PolynomialRing(GF(7));
##  GF(7)[x_1]
##  gap> r:=PolynomialRing(GF(7),3);
##  GF(7)[x_1,x_2,x_3]
##  gap> IndeterminatesOfPolynomialRing(r);
##  [ x_1, x_2, x_3 ]
##  gap> r2:=PolynomialRing(GF(7),[5,7,12]);
##  GF(7)[x_5,x_7,x_12]
##  gap> CoefficientsRing(r);
##  GF(7)
##  gap> r:=PolynomialRing(GF(7),3);
##  GF(7)[x_1,x_2,x_3]
##  gap> r2:=PolynomialRing(GF(7),3,IndeterminatesOfPolynomialRing(r));
##  GF(7)[x_4,x_5,x_6]
##  gap> r:=PolynomialRing(GF(7),["x","y","z","z2"]);
##  GF(7)[x,y,z,z2]
##  ]]></Example>
##  </Description>
##  </ManSection>
##  <#/GAPDoc>
##
DeclareAttribute( "CoefficientsRing", IsPolynomialRing );

##  <#GAPDoc Label="[1]{ringpoly}">
##  Internally, indeterminates are created for a <E>family</E> of objects
##  (for example all elements of finite fields in characteristic <M>3</M> are in
##  one family). Thus a variable <Q>x</Q> over the
##  rationals is also an <Q>x</Q> over the integers,
##  while an <Q>x</Q> over <C>GF(3)</C> is different.
##  <P/>
##  Within one family, every indeterminate has a number <A>nr</A> and as
##  long as  no other names have been assigned, this indeterminate will be
##  displayed as
##  <Q><C>x_<A>nr</A></C></Q>. Indeterminate numbers can be arbitrary
##  nonnegative integers.
##  <P/>
##  It is possible to assign names to indeterminates; these names are
##  strings and only provide a means for printing the indeterminates in a
##  nice way. Indeterminates that have not been assigned a name will be
##  printed as <Q><C>x_<A>nr</A></C></Q>.
##  <P/>
##  (Because of this printing convention, the name <C>x_<A>nr</A></C> is interpreted
##  specially to always denote the variable with internal number <A>nr</A>.)
##  <P/>
##  The indeterminate names have not necessarily any relations to variable
##  names: this means that an indeterminate whose name is, say,  <Q><C>x</C></Q>
##  cannot be accessed using the variable <C>x</C>, unless <C>x</C> was defined to
##  be that indeterminate.
##  <#/GAPDoc>
##
##  <#GAPDoc Label="[2]{ringpoly}">
##  When asking for indeterminates with certain
##  names, &GAP; usually will take the first (with respect to the internal
##  numbering) indeterminates that are not
##  yet named, name these accordingly and return them. Thus when asking for
##  named indeterminates, no relation between names and indeterminate
##  numbers can be guaranteed. The attribute
##  <C>IndeterminateNumberOfLaurentPolynomial(<A>indet</A>)</C> will return
##  the number of the indeterminate <A>indet</A>.
##  <P/>
##  When asked to create an indeterminate with a name that exists already for
##  the family, &GAP; will by default return this existing indeterminate. If
##  you explicitly want a <E>new</E> indeterminate, distinct from the already
##  existing one with the <E>same</E> name, you can add the <C>new</C> option
##  to the function call. (This is in most cases not a good idea.)
##  <P/>
##  <Log><![CDATA[
##  gap> R:=PolynomialRing(GF(3),["x","y","z"]);
##  GF(3)[x,y,z]
##  gap> List(IndeterminatesOfPolynomialRing(R),
##  >   IndeterminateNumberOfLaurentPolynomial);
##  [ 1, 2, 3 ]
##  gap> R:=PolynomialRing(GF(3),["z"]);
##  GF(3)[z]
##  gap> List(IndeterminatesOfPolynomialRing(R),
##  >   IndeterminateNumberOfLaurentPolynomial);
##  [ 3 ]
##  gap> R:=PolynomialRing(GF(3),["x","y","z"]:new);
##  GF(3)[x,y,z]
##  gap> List(IndeterminatesOfPolynomialRing(R),
##  >   IndeterminateNumberOfLaurentPolynomial);
##  [ 4, 5, 6 ]
##  gap> R:=PolynomialRing(GF(3),["z"]);
##  GF(3)[z]
##  gap> List(IndeterminatesOfPolynomialRing(R),
##  >   IndeterminateNumberOfLaurentPolynomial);
##  [ 3 ]
##  ]]></Log>
##  <#/GAPDoc>
##


#############################################################################
##
#O  Indeterminate( <R>[, <nr>] )
#O  Indeterminate( <R>[, <name>][, <avoid>] )
#O  Indeterminate( <fam>, <nr> )
#O  X( <R>,[<nr>] )
#O  X( <R>,[<avoid>] )
#O  X( <R>,<name>[,<avoid>] )
#O  X( <fam>,<nr> )
##
##  <#GAPDoc Label="Indeterminate">
##  <ManSection>
##  <Heading>Indeterminate</Heading>
##  <Oper Name="Indeterminate" Arg='R[, nr]'
##   Label="for a ring (and a number)"/>
##  <Oper Name="Indeterminate" Arg='R[, name][, avoid]'
##   Label="for a ring (and a name, and an exclusion list)"/>
##  <Oper Name="Indeterminate" Arg='fam, nr'
##   Label="for a family and a number"/>
##  <Oper Name="X" Arg='R[, nr]'
##   Label="for a ring (and a number)"/>
##  <Oper Name="X" Arg='R[, name][, avoid]'
##   Label="for a ring (and a name, and an exclusion list)"/>
##  <Oper Name="X" Arg='fam, nr'
##   Label="for a family and a number"/>
##
##  <Description>
##  returns the indeterminate number <A>nr</A> over the ring <A>R</A>.
##  If <A>nr</A> is not given it defaults to 1.
##  If the number is not specified a list <A>avoid</A> of indeterminates
##  may be given.
##  The function will return an indeterminate that is guaranteed to be
##  different from all the indeterminates in the list <A>avoid</A>.
##  The third usage returns an indeterminate called <A>name</A>
##  (also avoiding the indeterminates in <A>avoid</A> if given).
##  <P/>
##  <Ref Oper="X" Label="for a ring (and a number)"/> is simply a synonym for
##  <Ref Oper="Indeterminate" Label="for a ring (and a number)"/>. However, 
##  we do not recommend to use this synonym which is supported only for the
##  backwards compatibility.
##  <P/>
##  <Example><![CDATA[
##  gap> x:=Indeterminate(GF(3),"x");
##  x
##  gap> y:=X(GF(3),"y");z:=X(GF(3),"X");
##  y
##  X
##  gap> X(GF(3),2);
##  y
##  gap> X(GF(3),"x_3");
##  X
##  gap> X(GF(3),[y,z]);
##  x
##  ]]></Example>
##  </Description>
##  </ManSection>
##  <#/GAPDoc>
##
DeclareOperation( "Indeterminate", [IsRing,IsPosInt] );
DeclareSynonym( "X", Indeterminate );


#############################################################################
##
##


#############################################################################
##
#O  UnivariatePolynomialRing( <R>[, <nr>] )
#O  UnivariatePolynomialRing( <R>[, <name>][, <avoid>] )
##
##  <#GAPDoc Label="UnivariatePolynomialRing">
##  <ManSection>
##  <Heading>UnivariatePolynomialRing</Heading>
##  <Oper Name="UnivariatePolynomialRing" Arg='R[, nr]'
##   Label="for a ring (and an indeterminate number)"/>
##  <Oper Name="UnivariatePolynomialRing" Arg='R[, name][, avoid]'
##   Label="for a ring (and a name and an exclusion list)"/>
##
##  <Description>
##  returns a univariate polynomial ring in the indeterminate <A>nr</A> over
##  the base ring <A>R</A>.
##  If <A>nr</A> is not given it defaults to 1.
##  <P/>
##  If the number is not specified a list <A>avoid</A> of indeterminates may
##  be given.
##  Then the function will return a ring in an indeterminate that is
##  guaranteed to be different from all the indeterminates in <A>avoid</A>.
##  <P/>
##  Also a string <A>name</A> can be prescribed as the name of the
##  indeterminate chosen
##  (also avoiding the indeterminates in the list <A>avoid</A> if given).
##  </Description>
##  </ManSection>
##  <#/GAPDoc>
##
DeclareOperation( "UnivariatePolynomialRing", [IsRing] );

#############################################################################
##
#A  IndeterminatesOfPolynomialRing( <pring> )
#A  IndeterminatesOfFunctionField( <ffield> )
##
##  <#GAPDoc Label="IndeterminatesOfPolynomialRing">
##  <ManSection>
##  <Attr Name="IndeterminatesOfPolynomialRing" Arg='pring'/>
##  <Attr Name="IndeterminatesOfFunctionField" Arg='ffield'/>
##
##  <Description>
##  returns a list of the indeterminates of the polynomial ring <A>pring</A>,
##  respectively the function field <A>ffield</A>.
##  </Description>
##  </ManSection>
##  <#/GAPDoc>
##
DeclareAttribute( "IndeterminatesOfPolynomialRing", IsPolynomialRing );
DeclareSynonymAttr("IndeterminatesOfFunctionField",
                   IndeterminatesOfPolynomialRing);


#############################################################################
##
#O  PolynomialRing( <R>, <rank>[, <avoid>] )
#O  PolynomialRing( <R>, <names>[, <avoid>] )
#O  PolynomialRing( <R>, <indets> )
#O  PolynomialRing( <R>, <indetnums> )
##
##  <#GAPDoc Label="PolynomialRing">
##  <ManSection>
##  <Heading>PolynomialRing</Heading>
##  <Oper Name="PolynomialRing" Arg='R, rank[, avoid]'
##   Label="for a ring and a rank (and an exclusion list)"/>
##  <Oper Name="PolynomialRing" Arg='R, names[, avoid]'
##   Label="for a ring and a list of names (and an exclusion list)"/>
##  <Oper Name="PolynomialRing" Arg='R, indets'
##   Label="for a ring and a list of indeterminates"/>
##  <Oper Name="PolynomialRing" Arg='R, indetnums'
##   Label="for a ring and a list of indeterminate numbers"/>
##
##  <Description>
##  creates a polynomial ring over the ring <A>R</A>.
##  If a positive integer <A>rank</A> is given,
##  this creates the polynomial ring in <A>rank</A> indeterminates.
##  These indeterminates will have the internal index numbers 1 to
##  <A>rank</A>.
##  The second usage takes a list <A>names</A> of strings and returns a
##  polynomial ring in indeterminates labelled by <A>names</A>.
##  These indeterminates have <Q>new</Q> internal index numbers as if they
##  had been created by calls to
##  <Ref Func="Indeterminate" Label="for a ring (and a number)"/>.
##  (If the argument <A>avoid</A> is given it contains indeterminates that
##  should be avoided, in this case internal index numbers are incremented
##  to skip these variables.)
##  In the third version, a list of indeterminates <A>indets</A> is given.
##  This creates the polynomial ring in the indeterminates <A>indets</A>.
##  Finally, the fourth version specifies indeterminates by their index
##  numbers.
##  <P/>
##  To get the indeterminates of a polynomial ring use
##  <Ref Func="IndeterminatesOfPolynomialRing"/>.
##  (Indeterminates created independently with
##  <Ref Func="Indeterminate" Label="for a ring (and a number)"/>
##  will usually differ, though they might be given the same name and display
##  identically, see Section&nbsp;<Ref Sect="Indeterminates"/>.)
##  </Description>
##  </ManSection>
##  <#/GAPDoc>
##
DeclareOperation( "PolynomialRing",
    [ IsRing, IsObject ] );


#############################################################################
##
#O  MinimalPolynomial( <R>, <elm>[, <ind>] )
##
##  <#GAPDoc Label="MinimalPolynomial">
##  <ManSection>
##  <Oper Name="MinimalPolynomial" Arg='R, elm[, ind]'/>
##
##  <Description>
##  returns the <E>minimal polynomial</E> of <A>elm</A> over the ring <A>R</A>,
##  expressed in the indeterminate number <A>ind</A>.
##  If <A>ind</A> is not given, it defaults to 1.
##  <P/>
##  The minimal polynomial is the monic polynomial of smallest degree with
##  coefficients in <A>R</A> that has value zero at <A>elm</A>.
##  <Example><![CDATA[
##  gap> MinimalPolynomial(Rationals,[[2,0],[0,2]]);
##  x-2
##  ]]></Example>
##  </Description>
##  </ManSection>
##  <#/GAPDoc>
##
DeclareOperation( "MinimalPolynomial",
    [ IsRing, IsMultiplicativeElement and IsAdditiveElement, IsPosInt] );

#############################################################################
##
#O  FunctionField( <R>, <rank>[, <avoid>] )
#O  FunctionField( <R>, <names>[, <avoid>] )
#O  FunctionField( <R>, <indets> )
#O  FunctionField( <R>, <indetnums> )
##
##  <#GAPDoc Label="FunctionField">
##  <ManSection>
##  <Heading>FunctionField</Heading>
##  <Oper Name="FunctionField" Arg='R, rank[, avoid]'
##   Label="for an integral ring and a rank (and an exclusion list)"/>
##  <Oper Name="FunctionField" Arg='R, names[, avoid]'
##   Label="for an integral ring and a list of names (and an exclusion list)"/>
##  <Oper Name="FunctionField" Arg='R, indets'
##   Label="for an integral ring and a list of indeterminates"/>
##  <Oper Name="FunctionField" Arg='R, indetnums'
##   Label="for an integral ring and a list of indeterminate numbers"/>
##
##  <Description>
##  creates a function field over the integral ring <A>R</A>.
##  If a positive integer <A>rank</A> is given,
##  this creates the function field in <A>rank</A> indeterminates.
##  These indeterminates will have the internal index numbers 1 to
##  <A>rank</A>.
##  The second usage takes a list <A>names</A> of strings and returns a
##  function field in indeterminates labelled by <A>names</A>.
##  These indeterminates have <Q>new</Q> internal index numbers as if they
##  had been created by calls to
##  <Ref Func="Indeterminate" Label="for a ring (and a number)"/>.
##  (If the argument <A>avoid</A> is given it contains indeterminates that
##  should be avoided, in this case internal index numbers are incremented
##  to skip these variables.)
##  In the third version, a list of indeterminates <A>indets</A> is given.
##  This creates the function field in the indeterminates <A>indets</A>.
##  Finally, the fourth version specifies indeterminates by their index
##  number.
##  <P/>
##  To get the indeterminates of a function field use
##  <Ref Func="IndeterminatesOfFunctionField"/>.
##  (Indeterminates created independently with
##  <Ref Func="Indeterminate" Label="for a ring (and a number)"/>
##  will usually differ, though they might be given the same name and display
##  identically, see Section&nbsp;<Ref Sect="Indeterminates"/>.)
##  </Description>
##  </ManSection>
##  <#/GAPDoc>
##
DeclareOperation("FunctionField",[IsRing,IsObject]);


#############################################################################
##
#E