File: fldabnum.gd

package info (click to toggle)
gap 4r4p10-2
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 29,224 kB
  • ctags: 7,084
  • sloc: ansic: 98,591; sh: 3,284; perl: 2,263; makefile: 467; awk: 6
file content (464 lines) | stat: -rw-r--r-- 18,306 bytes parent folder | download | duplicates (3)
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
#############################################################################
##
#W  fldabnum.gd                 GAP library                     Thomas Breuer
##
#H  @(#)$Id: fldabnum.gd,v 4.24.2.1 2005/08/10 16:38:44 gap Exp $
##
#Y  Copyright (C)  1996,  Lehrstuhl D fuer Mathematik,  RWTH Aachen,  Germany
#Y  (C) 1998 School Math and Comp. Sci., University of St.  Andrews, Scotland
#Y  Copyright (C) 2002 The GAP Group
##
##  This file declares operations for fields consisting of cyclotomics.
##
##  Note that we must distinguish abelian number fields and fields
##  that consist of cyclotomics.
##  (The image of the natural embedding of the rational number field
##  into a field of rational functions is of course an abelian number field
##  but its elements are not cyclotomics since this would be a property given
##  by their family.)
##
Revision.fldabnum_gd :=
    "@(#)$Id: fldabnum.gd,v 4.24.2.1 2005/08/10 16:38:44 gap Exp $";


#T add rings of integers in abelian number fields!
#T (NumberRing, IsIntegralBasis, NormalBasis)

#############################################################################
##
##  Abelian Number Fields
#1
##  An *abelian number field* is a field in characteristic zero
##  that is a finite dimensional normal extension of its prime field
##  such that the Galois group is abelian.
##  In {\GAP}, one implementation of abelian number fields is given by fields
##  of cyclotomic numbers (see Chapter~"Cyclotomic Numbers").
##  Note that abelian number fields can also be constructed with
##  the more general `AlgebraicExtension' (see~"AlgebraicExtension"),
##  a discussion of advantages and disadvantages can be found
##  in~"Internally Represented Cyclotomics".
##  The functions described in this chapter have been developed for fields
##  whose elements are in the filter `IsCyclotomic' (see~"IsCyclotomic"),
##  they may or may not work well for abelian number fields consisting of
##  other kinds of elements.
##
##  Throughout this chapter, $\Q_n$ will denote the cyclotomic field
##  generated by the field $\Q$ of rationals together with $n$-th roots of
##  unity.
##
##  In~"Construction of Abelian Number Fields", constructors for abelian
##  number fields are described,
##  "Operations for Abelian Number Fields" introduces operations for abelian
##  number fields,
##  "Integral Bases of Abelian Number Fields" deals with the vector space
##  structure of abelian number fields, and
##  "Galois Groups of Abelian Number Fields" describes field automorphisms
##  of abelian number fields,
##  % section about Gaussians here?
##


#############################################################################
##
#P  IsNumberField( <F> )
##
##  \index{number field}
##  returns `true' if the field <F> is a finite dimensional extension
##  of a prime field in characteristic zero, and `false' otherwise.
##
DeclareProperty( "IsNumberField", IsField );

InstallSubsetMaintenance( IsNumberField,
    IsField and IsNumberField, IsField );

InstallIsomorphismMaintenance( IsNumberField,
    IsField and IsNumberField, IsField );


#############################################################################
##
#P  IsAbelianNumberField( <F> )
##
##  \index{abelian number field}
##  returns `true' if the field <F> is a number field (see~"IsNumberField")
##  that is a Galois extension of the prime field, with abelian Galois group
##  (see~"GaloisGroup!of field").
##
DeclareProperty( "IsAbelianNumberField", IsField );

InstallTrueMethod( IsNumberField, IsAbelianNumberField );

InstallSubsetMaintenance( IsAbelianNumberField,
    IsField and IsAbelianNumberField, IsField );

InstallIsomorphismMaintenance( IsAbelianNumberField,
    IsField and IsAbelianNumberField, IsField );


#############################################################################
##
#m  Conductor( <F> )
##
##  The attribute is defined in `cyclotom.g'.
##
InstallIsomorphismMaintenance( Conductor,
    IsField and IsAbelianNumberField, IsField );


#############################################################################
##
#M  IsFieldControlledByGaloisGroup( <cycfield> )
##
##  For finite fields and abelian number fields
##  (independent of the representation of their elements),
##  we know the Galois group and have a method for `Conjugates' that does
##  not use `MinimalPolynomial'.
##
InstallTrueMethod( IsFieldControlledByGaloisGroup,
    IsField and IsAbelianNumberField );


#############################################################################
##
#P  IsCyclotomicField( <F> )
##
##  returns `true' if the field <F> is a *cyclotomic field*, i.e.,
##  an abelian number field (see~"IsAbelianNumberField")
##  that can be generated by roots of unity.
##
DeclareProperty( "IsCyclotomicField", IsField );

InstallTrueMethod( IsAbelianNumberField, IsCyclotomicField );

InstallIsomorphismMaintenance( IsCyclotomicField,
    IsField and IsCyclotomicField, IsField );


#############################################################################
##
#A  GaloisStabilizer( <F> )
##
##  Let <F> be an abelian number field (see~"IsAbelianNumberField")
##  with conductor $n$, say.
##  (This means that the $n$-th cyclotomic field is the smallest cyclotomic
##  field containing <F>, see~"Conductor".)
##  `GaloisStabilizer' returns the set of all those integers $k$ in the range
##  from $1$ to $n$ such that the field automorphism induced by raising
##  $n$-th roots of unity to the $k$-th power acts trivially on <F>.
##
DeclareAttribute( "GaloisStabilizer", IsAbelianNumberField );

InstallIsomorphismMaintenance( GaloisStabilizer,
    IsField and IsAbelianNumberField, IsField );


#############################################################################
##
#V  Rationals . . . . . . . . . . . . . . . . . . . . . .  field of rationals
#P  IsRationals( <obj> )
##
##  `Rationals' is the field $\Q$ of rational integers,
##  as a set of cyclotomic numbers,
##  see Chapter~"Cyclotomic Numbers" for basic operations,
##  Functions for the field `Rationals' can be found in the
##  chapters~"Fields and Division Rings" and~"Abelian Number Fields".
##
##  `IsRationals' returns `true' for a prime field that consists of
##  cyclotomic numbers --for example the {\GAP} object `Rationals'--
##  and `false' for all other {\GAP} objects.
##
DeclareGlobalVariable( "Rationals", "field of rationals" );

DeclareSynonym( "IsRationals",
    IsCyclotomicCollection and IsField and IsPrimeField );

InstallTrueMethod( IsCyclotomicField, IsRationals );


#############################################################################
##
#V  GaussianRationals . . . . . . . . . . . . . . field of Gaussian rationals
#C  IsGaussianRationals( <obj> )
##
##  `GaussianRationals' is the field $\Q_4 = \Q(\sqrt{-1})$
##  of Gaussian rationals, as a set of cyclotomic numbers,
##  see Chapter~"Cyclotomic Numbers" for basic operations.
##  This field can also be obtained as `CF(4)' (see~"CyclotomicField").
##
##  The filter `IsGaussianRationals' returns `true' for the {\GAP} object
##  `GaussianRationals', and `false' for all other {\GAP} objects.
##
##  (For details about the field of rationals, see Chapter~"Rationals".)
##
DeclareGlobalVariable( "GaussianRationals",
    "field of Gaussian rationals (identical with CF(4))" );

DeclareCategory( "IsGaussianRationals", IsCyclotomicCollection and IsField );
#T better?


#############################################################################
##
#V  CYCLOTOMIC_FIELDS
##
##  At position <n>, the <n>-th cyclotomic field is stored.
##
DeclareGlobalVariable( "CYCLOTOMIC_FIELDS",
    "list, CYCLOTOMIC_FIELDS[n] = CF(n) if bound" );

InstallFlushableValue( CYCLOTOMIC_FIELDS,
    [ Rationals,,, GaussianRationals ] );


#############################################################################
##
#F  CyclotomicField( <n> )  . . . . . . .  create the <n>-th cyclotomic field
#F  CyclotomicField( <gens> )
#F  CyclotomicField( <subfield>, <n> )
#F  CyclotomicField( <subfield>, <gens> )
##
##  The first version creates the <n>-th cyclotomic field $\Q_n$.
##  The second version creates the smallest cyclotomic field containing the
##  elements in the list <gens>.
##  In both cases the field can be generated as an extension of a designated
##  subfield <subfield> (cf.~"Integral Bases of Abelian Number Fields").
##
##  \indextt{CF}
##  `CyclotomicField' can be abbreviated to `CF',
##  this form is used also when {\GAP} prints cyclotomic fields.
##
##  Fields constructed with the one argument version of `CF' are stored in
##  the global list `CYCLOTOMIC_FIELDS',
##  so repeated calls of `CF' just fetch these field objects after they have
##  been created once.
#T  The cache can be flushed by ...
##
DeclareGlobalFunction( "CyclotomicField" );

DeclareSynonym( "CF", CyclotomicField );


#############################################################################
##
#V  ABELIAN_NUMBER_FIELDS
##
##  At position <n>, those fields with conductor <n> are stored that are not
##  cyclotomic fields.
##  The list for cyclotomic fields is `CYCLOTOMIC_FIELDS'.
##
DeclareGlobalVariable( "ABELIAN_NUMBER_FIELDS",
    "list of lists, at position [1][n] stabilizers, at [2][n] the fields" );
InstallFlushableValue( ABELIAN_NUMBER_FIELDS, [ [], [] ] );


#############################################################################
##
#F  AbelianNumberField( <n>, <stab> ) . . . .  create an abelian number field
##
##  For a positive integer <n> and a list <stab> of prime residues modulo
##  <n>, `AbelianNumberField' returns the fixed field of the group described
##  by <stab> (cf.~"GaloisStabilizer"), in the <n>-th cyclotomic field.
##  `AbelianNumberField' is mainly thought for internal use and for printing
##  fields in a standard way;
##  `Field' (see~"Field", cf.~also~"Operations for Abelian Number Fields")
##  is probably more suitable if one knows generators of the field in
##  question.
##
##  \indextt{NF}
##  `AbelianNumberField' can be abbreviated to `NF',
##  this form is used also when {\GAP} prints abelian number fields.
##
##  Fields constructed with `NF' are stored in the global list
##  `ABELIAN_NUMBER_FIELDS',
##  so repeated calls of `NF' just fetch these field objects after they have
##  been created once.
#T  The cache can be flushed by ...
##
DeclareGlobalFunction( "AbelianNumberField" );

DeclareSynonym( "NF", AbelianNumberField );
DeclareSynonym( "NumberField", AbelianNumberField );


#############################################################################
#2
##  Each abelian number field is naturally a vector space over $\Q$.
##  Moreover, if the abelian number field $F$ contains the $n$-th cyclotomic
##  field $\Q_n$ then $F$ is a vector space over $\Q_n$.
##  In {\GAP}, each field object represents a vector space object over a
##  certain subfield $S$, which depends on the way $F$ was constructed.
##  The subfield $S$ can be accessed as the value of the attribute
##  `LeftActingDomain' (see~"LeftActingDomain").
##
##  The return values of `NF' (see~"AbelianNumberField") and of the one
##  argument versions of `CF' (see~"CyclotomicField") represent vector spaces
##  over $\Q$,
##  and the return values of the two argument version of `CF' represent
##  vector spaces over the field that is given as the first argument.
##  For an abelian number field <F> and a subfield <S> of <F>,
##  a {\GAP} object representing <F> as a vector space over <S> can be
##  constructed using `AsField' (see~"AsField").
##
##  \index{cyclotomic fields!CanonicalBasis}
##  Let <F> be the cyclotomic field $\Q_n$, represented as a vector space
##  over the subfield <S>.
##  If <S> is the cyclotomic field $\Q_m$, with $m$ a divisor of $n$,
##  then `CanonicalBasis( <F> )' returns the Zumbroich basis of <F> relative
##  to <S>, which consists of the roots of unity $`E(<n>)'^i$ where <i> is
##  an element of the list `ZumbroichBase( <n>, <m> )' (see~"ZumbroichBase").
##  If <S> is an abelian number field that is not a cyclotomic field
##  then `CanonicalBasis( <F> )' returns a normal <S>-basis of <F>, i.e.,
##  a basis that is closed under the field automorphisms of <F>.
##
##  \index{abelian number fields!CanonicalBasis}
##  Let <F> be the abelian number field `NF( <n>, <stab> )', with conductor
##  <n>, that is itself not a cyclotomic field,
##  represented as a vector space over the subfield <S>.
##  If <S> is the cyclotomic field $\Q_m$, with $m$ a divisor of $n$,
##  then `CanonicalBasis( <F> )' returns the Lenstra basis of <F> relative
##  to <S> that consists of the sums of roots of unity described by
##  `LenstraBase( <n>, <stab>, <stab>, <m> )' (see~"LenstraBase").
##  If <S> is an abelian number field that is not a cyclotomic field
##  then `CanonicalBasis( <F> )' returns a normal <S>-basis of <F>.
##


#############################################################################
##
#F  ZumbroichBase( <n>, <m> )
##
##  Let <n> and <m> be positive integers, such that <m> divides <n>.
##  `ZumbroichBase' returns the set of exponents <i> for which `E(<n>)^<i>'
##  belongs to the (generalized) Zumbroich basis of the cyclotomic field
##  $\Q_n$, viewed as a vector space over $\Q_m$.
##
##  This basis is defined as follows.
##  Let $P$ denote the set of prime divisors of <n>,
##  $<n> = \prod_{p\in P} p^{\nu_p}$, and
##  $<m> = \prod_{p\in P} p^{\mu_p}$ with $\mu_p \leq \nu_p$.
##  Let $e_n = `E(<n>)'$,
##  and $\{ e_{n_1}^j\}_{j\in J} \otimes \{ e_{n_2}^k\}_{k\in K} =
##  \{ e_{n_1}^j \cdot e_{n_2}^k\}_{j\in J, k\in K}$.
##
##  Then the basis is
##  $$
##  B_{n,m} = \bigotimes_{p\in P}
##    \bigotimes_{k=\mu_p}^{\nu_p-1} \{ e_{p^{k+1}}^j\}_{j\in J_{k,p}}
##    {\rm\ \ where\ \ }
##  J_{k,p} = \left\{
##     \matrix{ \{ 0 \} & ; & k=0, p=2 \cr
##              \{ 0, 1 \} & ; & k > 0, p=2 \cr
##              \{ 1, \ldots, p-1 \} & ; & k = 0, p\not= 2 \cr
##              \{ -\frac{p-1}{2}, \ldots, \frac{p-1}{2} \} & ; &
##                               k > 0, p\not= 2 \cr
##  }
##  \right.
##  $$
##
##  $B_{n,1}$ is equal to the basis of $\Q_n$ over the rationals which is
##  introduced in~\cite{Zum89}.
##  Also the conversion of arbitrary sums of roots of unity into its
##  basis representation, and the reduction to the minimal cyclotomic field
##  are described in this thesis.
##  (Note that the notation here is slightly different from that there.)
##
##  $B_{n,m}$ consists of roots of unity, it is an integral basis
##  (that is, exactly the integral elements in $\Q_n$ have integral
##  coefficients w.r.t.~$B_{n,m}$, cf.~"IsIntegralCyclotomic"),
##  it is a normal basis for squarefree $n$
##  and closed under complex conjugation for odd $n$.
##
##  *Note:*
##  For $<n> \equiv 2 \pmod 4$, we have
##  `ZumbroichBase(<n>, 1) = 2 * ZumbroichBase(<n>/2, 1)' and
##  `List( ZumbroichBase(<n>, 1), x -> E(<n>)^x ) =
##   List( ZumbroichBase(<n>/2, 1), x -> E(<n>/2)^x )'.
##
DeclareGlobalFunction( "ZumbroichBase" );


#############################################################################
##
#F  LenstraBase( <n>, <stabilizer>, <super>, <m> )
##
##  Let <n> and <m> be positive integers, such that <m> divides <n>,
##  <stabilizer> be a list of prime residues modulo <n>, which describes
##  a subfield of the <n>-th cyclotomic field (see~"GaloisStabilizer"),
##  and <super> be a list representing a supergroup of the group given by
##  <stabilizer>.
##
##  `LenstraBase' returns a list $[ b_1, b_2, \ldots, b_k ]$ of lists,
##  each $b_i$ consisting of integers such that the elements
##  $\sum_{j\in b_i} `E(n)'^j$ form a basis of the abelian number field
##  `NF( <n>, <stabilizer> )', as a vector space over the <m>-th
##  cyclotomic field (see~"AbelianNumberField").
##
##  This basis is an integral basis,
##  that is, exactly the integral elements in `NF( <n>, <stabilizer> )'
##  have integral coefficients.
##  (For details about this basis, see~\cite{Bre97}.)
##
##  If possible then the result is chosen such that the group described by
##  <super> acts on it, consistently with the action of <stabilizer>,
##  i.e., each orbit of <super> is a union of orbits of <stabilizer>.
##  (A usual case is `<super> = <stabilizer>', so there is no additional
##  condition.
##
##  *Note:*
##  The $b_i$ are in general not sets, since for `<stabilizer> = <super>',
##  the first entry is always an element of `ZumbroichBase( <n>, <m> )';
##  this property is used by `NF' (see~"AbelianNumberField")
##  and `Coefficients' (see~"Integral Bases of Abelian Number Fields").
##
##  <stabilizer> must not contain the stabilizer of a proper
##  cyclotomic subfield of the <n>-th cyclotomic field,
##  i.e., the result must describe a basis for a field with conductor <n>.
##
DeclareGlobalFunction( "LenstraBase" );


#############################################################################
##
#V  Cyclotomics . . . . . . . . . . . . . . . . . . domain of all cyclotomics
##
##  is the domain of all cyclotomics.
##
DeclareGlobalVariable( "Cyclotomics", "domain of all cyclotomics" );


#############################################################################
##
#F  ANFAutomorphism( <F>, <k> )  . .  automorphism of an abelian number field
##
##  Let <F> be an abelian number field and <k> an integer that is coprime to
##  the conductor (see~"Conductor") of <F>.
##  Then `ANFAutomorphism' returns the automorphism of <F> that is defined as
##  the linear extension of the map that raises each root of unity in <F>
##  to its <k>-th power.
##
DeclareGlobalFunction( "ANFAutomorphism" );


#############################################################################
##
#A  ExponentOfPowering( <map> )
##
##  For a mapping <map> that raises each element of its preimage to the same
##  positive power, `ExponentOfPowering' returns the smallest positive number
##  $n$ with this property.
##
##  Examples of such mappings are Frobenius automorphisms
##  (see~"FrobeniusAutomorphism").
##
##  The action of a Galois automorphism of an abelian number field is given
##  by the $\Q$-linear extension of raising each root of unity to the same
##  power $n$, see~"ANFAutomorphism".
##  For such a field automorphism, `ExponentOfPowering' returns $n$.
##
DeclareAttribute( "ExponentOfPowering", IsMapping );


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