File: algrep.gd

package info (click to toggle)
gap 4r4p4-1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 25,972 kB
  • ctags: 6,672
  • sloc: ansic: 95,121; sh: 3,137; makefile: 219; perl: 11; awk: 6
file content (602 lines) | stat: -rw-r--r-- 23,391 bytes parent folder | download | duplicates (4)
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
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
#############################################################################
##
#W  algrep.gd                  GAP library               Willem de Graaf
##
#H  @(#)$Id: algrep.gd,v 4.19 2002/11/22 15:24:09 gap Exp $
##
#Y  Copyright (C)  1997,  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 contains the declarations for general modules over algebras.
##
Revision.algrep_gd :=
    "@(#)$Id: algrep.gd,v 4.19 2002/11/22 15:24:09 gap Exp $";

#1
##  An algebra module is a vector space together with an action of an
##  algebra. So a module over an algebra is constructed by giving generators
##  of a vector space, and a function for calculating the action of
##  algebra elements on elements of the vector space. When creating an
##  algebra module, the generators of the vector space are wrapped up and
##  given the category `IsLeftAlgebraModuleElement' or
##  `IsRightModuleElement' if the algebra acts from the left, or right
##  respectively. (So in the case of a bi-module the elements get
##  both categories.) Most linear algebra computations are delegated to
##  the original vector space.
##
##  The transition between the original vector space and the corresponding
##  algebra module is handled by `ExtRepOfObj' and `ObjByExtRep'.
##  For an element `v' of the algebra module, `ExtRepOfObj( v )' returns
##  the underlying element of the original vector space. Furthermore, if `vec'
##  is an element of the original vector space, and `fam' the elements
##  family of the corresponding algebra module, then `ObjByExtRep( fam, vec )'
##  returns the corresponding element of the algebra module. Below is an
##  example of this.
##
##  The action of the algebra on elements of the algebra module is constructed
##  by using the operator `^'. If `x' is an element of an algebra `A', and
##  `v' an element of a left `A'-module, then `x^v' calculates the result
##  of the action of `x' on `v'. Similarly, if `v' is an element of
##  a right `A'-module, then `v^x' calculates the action of `x' on `v'.
##

##############################################################################
##
#C  IsAlgebraModuleElement( <obj> )
#C  IsAlgebraModuleElementCollection( <obj> )
#C  IsAlgebraModuleElementFamily( <fam> )
##
##  Category of algebra module elements. If an object has
##  `IsAlgebraModuleElementCollection', then it is an algebra module.
##  If a family has `IsAlgebraModuleElementFamily', then it is a family
##  of algebra module elements (every algebra module has its own elements
##  family).
##
DeclareCategory( "IsAlgebraModuleElement", IsVector );
DeclareCategoryCollections( "IsAlgebraModuleElement" );
DeclareCategoryFamily( "IsAlgebraModuleElement" );

##############################################################################
##
#C  IsLeftAlgebraModuleElement( <obj> )
#C  IsLeftAlgebraModuleElementCollection( <obj> )
##
##  Category of left algebra module elements. If an object has
##  `IsLeftAlgebraModuleElementCollection', then it is a left-algebra module.
##
DeclareCategory( "IsLeftAlgebraModuleElement", IsAlgebraModuleElement );
DeclareCategoryCollections( "IsLeftAlgebraModuleElement" );

##############################################################################
##
#C  IsRightAlgebraModuleElement( <obj> )
#C  IsRightAlgebraModuleElementCollection( <obj> )
##
##  Category of right algebra module elements. If an object has
##  `IsRightAlgebraModuleElementCollection', then it is a right-algebra module.
##
DeclareCategory( "IsRightAlgebraModuleElement", IsAlgebraModuleElement );
DeclareCategoryCollections( "IsRightAlgebraModuleElement" );

##############################################################################
##
#P   IsAlgebraModule( <M> )
##
##
DeclareProperty( "IsAlgebraModule", IsLeftModule );

##############################################################################
##
#P  IsLeftAlgebraModule( <M> )
##
##
DeclareProperty( "IsLeftAlgebraModule", IsLeftModule );

##############################################################################
##
#P  IsRightAlgebraModule( <M> )
##
##
DeclareProperty( "IsRightAlgebraModule", IsLeftModule );

##############################################################################
##
#A  LeftActingAlgebra( <V> )
##
##  Here <V> is a left-algebra module; this function returns the algebra
##  that acts from the left on <V>.
##
DeclareAttribute( "LeftActingAlgebra", IsAlgebraModule );

#############################################################################
##
#A  RightActingAlgebra( <V> )
##
##  Here <V> is a right-algebra module; this function returns the algebra
##  that acts from the right on <V>.
##
DeclareAttribute( "RightActingAlgebra", IsAlgebraModule );

##############################################################################
##
#O  ActingAlgebra( <V> )
##
##  Here <V> is an algebra module; this function returns the algebra
##  that acts on <V> (this is the same as `LeftActingAlgebra( <V> )' if <V> is
##  a left module, and `RightActingAlgebra( <V> )' if <V> is a right module;
##  it will signal an error if <V> is a bi-module).
##
DeclareOperation( "ActingAlgebra", [ IsAlgebraModule ] );


##############################################################################
##
#A  GeneratorsOfAlgebraModule( <M> )
##
##  A list of elements of <M> that generate <M> as an algebra module.
##
DeclareAttribute( "GeneratorsOfAlgebraModule", IsAlgebraModule );


##############################################################################
##
#O  LeftAlgebraModuleByGenerators( <A>, <op>, <gens> )
##
##  Constructs the left algebra module over <A> generated by the list of
##  vectors
##  <gens>. The action of <A> is described by the function <op>. This must
##  be a function of two arguments; the first argument is the algebra element,
##  and the second argument is a vector; it outputs the result of applying
##  the algebra element to the vector.
##
DeclareOperation( "LeftAlgebraModuleByGenerators", [ IsAlgebra, IS_FUNCTION,
                                           IsHomogeneousList ]);

##############################################################################
##
#O  RightAlgebraModuleByGenerators( <A>, <op>, <gens> )
##
##  Constructs the right algebra module over <A> generated by the list of
##  vectors
##  <gens>. The action of <A> is described by the function <op>. This must
##  be a function of two arguments; the first argument is a vector, and the
##  second argument is the algebra element; it outputs the result of applying
##  the algebra element to the vector.
##
DeclareOperation( "RightAlgebraModuleByGenerators", [ IsAlgebra, IS_FUNCTION,
                                           IsHomogeneousList ]);


##############################################################################
##
#O  BiAlgebraModuleByGenerators( <A>, <B>, <opl>, <opr>, <gens> )
##
##  Constructs the algebra bi-module over <A> and <B> generated by the list of
##  vectors
##  <gens>. The left action of <A> is described by the function <opl>,
##  and the right action of <B> by the function <opr>. <opl> must be a
##  function of two arguments; the first argument is the algebra element,
##  and the second argument is a vector; it outputs the result of applying
##  the algebra element on the left to the vector. <opr> must
##  be a function of two arguments; the first argument is a vector, and the
##  second argument is the algebra element; it outputs the result of applying
##  the algebra element on the right to the vector.
##
DeclareOperation( "BiAlgebraModuleByGenerators", [ IsAlgebra, IsAlgebra,
                       IS_FUNCTION, IS_FUNCTION, IsHomogeneousList ]);

##############################################################################
##
#O  LeftAlgebraModule( <A>, <op>, <V> )
##
##  Constructs the left algebra module over <A> with underlying space <V>.
##  The action of <A> is described by the function <op>. This must
##  be a function of two arguments; the first argument is the algebra element,
##  and the second argument is a vector from <V>; it outputs the result of 
##  applying the algebra element to the vector.
##
DeclareOperation( "LeftAlgebraModule", [ IsAlgebra, IS_FUNCTION,
                                           IsVectorSpace ]);

##############################################################################
##
#O  RightAlgebraModule( <A>, <op>, <V> )
##
##  Constructs the right algebra module over <A> with underlying space <V>.
##  The action of <A> is described by the function <op>. This must
##  be a function of two arguments; the first argument is a vector, from <V>
##  and the
##  second argument is the algebra element; it outputs the result of applying
##  the algebra element to the vector.
##
DeclareOperation( "RightAlgebraModule", [ IsAlgebra, IS_FUNCTION,
                                           IsVectorSpace ]);


##############################################################################
##
#O  BiAlgebraModule( <A>, <B>, <opl>, <opr>, <V> )
##
##  Constructs the algebra bi-module over <A> and <B> with underlying space 
##  <V>. The left action of <A> is described by the function <opl>,
##  and the right action of <B> by the function <opr>. <opl> must be a
##  function of two arguments; the first argument is the algebra element,
##  and the second argument is a vector from <V>; it outputs the result of 
##  applying
##  the algebra element on the left to the vector. <opr> must
##  be a function of two arguments; the first argument is a vector from <V>, 
##  and the
##  second argument is the algebra element; it outputs the result of applying
##  the algebra element on the right to the vector.
##
DeclareOperation( "BiAlgebraModule", [ IsAlgebra, IsAlgebra,
                       IS_FUNCTION, IS_FUNCTION, IsVectorSpace ]);



##############################################################################
##
#C  IsBasisOfAlgebraModuleElementSpace( <B> )
##
##  If a basis <B> lies in the category `IsBasisOfAlgebraModuleElementSpace',
##  then
##  <B> is a basis of a subspace of an algebra module. This means that
##  <B> has the record field `<B>!.delegateBasis' set. This last object
##  is a basis of the corresponding subspace of the vector space underlying
##  the algebra module (i.e., the vector
##  space spanned by all `ExtRepOfObj( v )' for `v' in
##  the algebra module).
##
DeclareCategory( "IsBasisOfAlgebraModuleElementSpace", IsBasis );

##############################################################################
##
#O  SubAlgebraModule( <M>, <gens> [,<"basis">] )
##
##  is the sub-module of the algebra module <M>, generated by the vectors
##  in <gens>. If as an optional argument the string `basis' is added, then
##  it is
##  assumed that the vectors in <gens> form a basis of the submodule.
##
DeclareOperation( "SubAlgebraModule", [ IsAlgebraModule,
                            IsAlgebraModuleElementCollection ] );

##############################################################################
##
#O  LeftModuleByHomomorphismToMatAlg( <A>, <hom> )
##
##  Here <A> is an algebra and <hom> a homomorphism from <A> into a matrix
##  algebra. This function returns the left <A>-module defined by the
##  homomorphism <hom>.
##
DeclareOperation( "LeftModuleByHomomorphismToMatAlg", [ IsAlgebra,
                                                 IsAlgebraHomomorphism ]);

##############################################################################
##
#O  RightModuleByHomomorphismToMatAlg( <A>, <hom> )
##
##  Here <A> is an algebra and <hom> a homomorphism from <A> into a matrix
##  algebra. This function returns the right <A>-module defined by the
##  homomorphism <hom>.
##
DeclareOperation( "RightModuleByHomomorphismToMatAlg", [ IsAlgebra,
                                                 IsAlgebraHomomorphism ]);

##############################################################################
##
#A  AdjointModule( <A> )
##
##  returns the <A>-module defined by the left action of <A> on itself.
##
DeclareAttribute( "AdjointModule", IsAlgebra );

##############################################################################
##
#A  FaithfulModule( <A> )
##
##  returns a faithful finite-dimensional left-module over the algebra <A>.
##  This is only implemented for associative algebras, and for Lie algebras
##  of characteristic $0$. (It may also work for certain Lie algebras
##  of characteristic $p>0$.)
##
DeclareAttribute( "FaithfulModule", IsAlgebra );


##############################################################################
##
#O  ModuleByRestriction( <V>, <sub> )
#O  ModuleByRestriction( <V>, <subl>, <subr> )
##
##  Here <V> is an algebra module and <sub> is a subalgebra
##  of the acting algebra of <V>. This function returns the
##  module that is the restriction of <V> to <sub>. So it has the
##  same underlying vector space as <V>, but the acting algebra is
##  <sub>.  If two subalgebras are given then <V> is assumed to be a
##  bi-module, and <subl> a subalgebra of the algebra acting on the left,
##  and <subr> a subalgebra of the algebra acting on the right.
##
DeclareOperation( "ModuleByRestriction", [ IsAlgebraModule, IsAlgebra ] );


##############################################################################
##
#O  NaturalHomomorphismBySubAlgebraModule( <V>, <W> )
##
##  Here <V> must be a sub-algebra module of <V>. This function returns
##  the projection from <V> onto `<V>/<W>'. It is a linear map, that is
##  also a module homomorphism. As usual images can be formed with
##  `Image( f, v )' and pre-images with `PreImagesRepresentative( f, u )'.
##
##  The quotient module can also be formed
##  by entering `<V>/<W>'.
##
##
DeclareOperation( "NaturalHomomorphismBySubAlgebraModule", [ IsAlgebraModule,
                                                IsAlgebraModule ] );

##############################################################################
##
#O  MatrixOfAction( <B>, <x> )
#O  MatrixOfAction( <B>, <x>, <side> )
##
##  Here <B> is a basis of an algebra module and <x> is an element
##  of the algebra that acts on this module. This function returns
##  the matrix of the action of <x> with respect to <B>. If <x> acts
##  from the left, then the coefficients of the images of the basis
##  elements of <B> (under the action of <x>) are the columns of the output.
##  If <x> acts from the
##  right, then they are the rows of the output.
##
##  If the module is a bi-module, then the third parameter <side> must
##  be specified. This is the string `left', or `right' depending whether
##  <x> acts from the left or the right.
##
DeclareOperation( "MatrixOfAction", [ IsBasisOfAlgebraModuleElementSpace,
                                         IsObject ] );

#############################################################################
##
#C  IsMonomialElement( <obj> )
##
##  If the object <obj> lies in the category `IsMonomialElement', then
##  it is a linear combination of monomials. This category is used to set
##  up some basic functionality and linear algebra for tensor elements,
##  wedge elements, symmetric power elements (in order not to have to copy
##  esentially the same code for all these elements).
##
DeclareCategory( "IsMonomialElement", IsVector );
DeclareCategoryCollections( "IsMonomialElement" );
DeclareCategoryFamily( "IsMonomialElement" );

#############################################################################
##
#O  ConvertToNormalFormMonomialElement( <me> )
##
##  Converts the monomial element to some normal form (e.g., if it is a
##  tensor element v\otimes w, it will expand v and w on a basis of the
##  underlying vector spaces).
##
DeclareOperation( "ConvertToNormalFormMonomialElement",
                                      [ IsMonomialElement ] );

##############################################################################
##
#C  IsTensorElement( <obj> )
##
##  An element of the tensor product of algebra modules lies in the
##  category `IsTensorElement'.
##
DeclareCategory( "IsTensorElement", IsMonomialElement );
DeclareCategoryCollections( "IsTensorElement" );

##############################################################################
##
#O  TensorProduct( <list> )
#O  TensorProduct( <V>, <W> )
##
##  Here <list> must be a list of vector spaces. This function returns
##  the tensor product of the elements in the list. The vector spaces
##  must be defined over the same field.
##
##  In the second form is short for `TensorProduct( [ <V>, <W> ] )'.
##
##  Elements of the tensor product $V_1\otimes \cdots \otimes V_k$ are
##  linear combinations of $v_1\otimes\cdots \otimes v_k$, where
##  the $v_i$ are arbitrary basis elements of $V_i$. In {\GAP} a tensor
##  element like that is printed as
##  \begintt
##     v_1<x> ... <x>v_k
##  \endtt
##  Furthermore, the zero of a tensor product is printed as
##  \begintt
##   <0-tensor>
##  \endtt
##  This does not mean that all tensor products have the
##  same zero element: zeros of different tensor products have different
##  families.
##
DeclareOperation( "TensorProduct", [ IsList ] );


###############################################################################
##
#O  TensorProductOfAlgebraModules( <list> )
#O  TensorProductOfAlgebraModules( <V>, <W> )
##
##  Here the elements of <list> must be algebra modules. 
##  The tensor product is returned as an algebra module. 
##
DeclareOperation( "TensorProductOfAlgebraModules", [ IsList ] );

###############################################################################
##
#C  IsWedgeElement( <obj> )
##
##  An element of an exterior power of an algebra module lies in the
##  category `IsWedgeElement'.
##
DeclareCategory( "IsWedgeElement", IsMonomialElement );
DeclareCategoryCollections( "IsWedgeElement" );


##############################################################################
##
#O  ExteriorPower( <V>, <k> )
##
##  Here <V> must be a vector space. This function returns the <k>-th
##  exterior power of <V>.
##
##  Elements of the exterior power $\bigwedge^k V$ are
##  linear combinations of $v_{i_1}\wedge\cdots \wedge v_{i_k}$, where
##  the $v_{i_j}$ are basis elements of $V$, and
##  $1\leq i_1\<i_2\cdots \<i_k$. In {\GAP} a wedge
##  element like that is printed as
##  \begintt
##     v_1/\ ... /\v_k
##  \endtt
##  Furthermore, the zero of an exterior power is printed as
##  \begintt
##   <0-wedge>
##  \endtt
##  This does not mean that all exterior powers have the
##  same zero element: zeros of different exterior powers have different
##  families.
##
DeclareOperation( "ExteriorPower", [ IsLeftModule, IsInt ] );

##############################################################################
##
#O  ExteriorPowerOfAlgebraModule( <V>, <k> )
##
##  Here <V> must be an algebra module, defined over a Lie algebra. 
##  This function returns the <k>-th exterior power of <V> as an 
##  algebra module.
##
##
DeclareOperation( "ExteriorPowerOfAlgebraModule", [ IsAlgebraModule, IsInt ] );


##############################################################################
##
#C  IsSymmetricPowerElement( <obj> )
##
##  An element of a symmetric power of an algebra module lies in the
##  category `IsSymmetricPowerElement'.
##
DeclareCategory( "IsSymmetricPowerElement", IsMonomialElement );
DeclareCategoryCollections( "IsSymmetricPowerElement" );


##############################################################################
##
#O  SymmetricPower( <V>, <k> )
##
##  Here <V> must be a vector space. This function returns the <k>-th
##  symmetric power of <V>.
##
DeclareOperation( "SymmetricPower", [ IsLeftModule, IsInt ] );

##############################################################################
##
#O  SymmetricPowerOfAlgebraModule( <V>, <k> )
##
##  Here <V> must be an algebra module. This function returns the <k>-th
##  symmetric power of <V> (as an algebra module).
##
DeclareOperation( "SymmetricPowerOfAlgebraModule",[ IsAlgebraModule,IsInt ]);


##############################################################################
##
#C  IsDirectSumElement( <obj> )
##
##  An element of the direct sum of algebra modules lies in the category
##  `IsDirectSumElement'.
##
DeclareCategory( "IsDirectSumElement", IsVector );
DeclareCategoryCollections( "IsDirectSumElement" );
DeclareCategoryFamily( "IsDirectSumElement" );

##############################################################################
##
#O  DirectSumOfAlgebraModules( <list> )
#O  DirectSumOfAlgebraModules( <V>, <W> )
##
##  Here <list> must be a list of algebra modules. This function returns the
##  direct sum of the elements in the list (as an algebra module).
##  The modules must be defined over the same algebras.
##
##  In the second form is short for `DirectSumOfAlgebraModules( [ <V>, <W> ] )'
##
DeclareOperation( "DirectSumOfAlgebraModules", [ IsList ] );

#############################################################################
##
#C  IsSparseRowSpaceElement( <vec> )
#C  IsSparseRowSpaceElementCollection( <coll> )
#C  IsSparseRowSpaceElementFamily( <fam> )
##
##  An object lying in the category `IsSparseRowSpaceElement' is an
##  element of a full row space, of which all elements are sparsely
##  represented.
##
DeclareCategory( "IsSparseRowSpaceElement", IsVector );
DeclareCategoryCollections( "IsSparseRowSpaceElement" );
DeclareCategoryFamily( "IsSparseRowSpaceElement" );
#T Can this be clean?
#T Elements of row spaces are row vectors,
#T and these are lists, so their family is obviously the collections family
#T of the list entries.
#T The concept of different *representations* for the same object should be
#T used to implement sparse and dense lists;
#T regarding sparse and dense lists as different (and in the case of different
#T families even incomparable) elements may be easy to implement but is not
#T desirable!
#T TB, January 12th, 2000.


##############################################################################
##
#O  FullSparseRowSpace( <R>, <n> )
##
##  Is the full sparse row space over the ring <R> with dimension <n>.
##
DeclareOperation( "FullSparseRowSpace", [ IsRing, IsInt ] );


#############################################################################
##
#F  IsDirectSumElementsSpace( <V> )
##
##  ...
##
DeclareHandlingByNiceBasis( "IsDirectSumElementsSpace",
    "for free left modules of direct-sum-elements" );

###############################################################################
##
#O   TranslatorSubalgebra( <M>, <U>, <W> )
##
##   Here <M> is an algebra module, and <U> and <W> are two subspaces of <M>. 
##   Let <A> be the algebra acting on <M>. This function returns the subspace
##   of elements of <A> that map <U> into <W>. If <W> is a sub-algebra-module
##   (i.e., closed under the action of <A>), then this space is a subalgebra
##   of <A>. 
##
##   This function works for left, or right modules over a
##   finite-dimensional algebra. We
##   stress that it is not checked whether <U> and <W> are indeed subspaces
##   of <M>. If this is not the case nothing is guaranteed about the behaviour
##   of the function.
##
DeclareOperation( "TranslatorSubalgebra", 
[ IsAlgebraModule, IsFreeLeftModule, IsFreeLeftModule ] );



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