This file is indexed.

/usr/share/gap/lib/module.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
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
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
#############################################################################
##
#W  module.gd                   GAP library                     Thomas Breuer
##
##
#Y  Copyright (C)  1997,  Lehrstuhl D für 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 the operations for left modules, right modules,
##  and bimodules.
##


#############################################################################
##
#C  IsLeftOperatorAdditiveGroup( <D> )
##
##  <#GAPDoc Label="IsLeftOperatorAdditiveGroup">
##  <ManSection>
##  <Filt Name="IsLeftOperatorAdditiveGroup" Arg='D' Type='Category'/>
##
##  <Description>
##  A domain <A>D</A> lies in <C>IsLeftOperatorAdditiveGroup</C>
##  if it is an additive group that is closed under scalar multiplication
##  from the left, and such that
##  <M>\lambda * ( x + y ) = \lambda * x + \lambda * y</M>
##  for all scalars <M>\lambda</M> and elements <M>x, y \in D</M>
##  (here and below by scalars we mean elements of a domain acting
##  on <A>D</A> from left or right as appropriate).
##  </Description>
##  </ManSection>
##  <#/GAPDoc>
##
DeclareSynonym( "IsLeftOperatorAdditiveGroup",
        IsAdditiveGroup
    and IsExtLSet
    and IsDistributiveLOpDSum );


#############################################################################
##
#C  IsLeftModule( <M> )
##
##  <#GAPDoc Label="IsLeftModule">
##  <ManSection>
##  <Filt Name="IsLeftModule" Arg='M' Type='Category'/>
##
##  <Description>
##  A domain <A>M</A> lies in <C>IsLeftModule</C>
##  if it lies in <C>IsLeftOperatorAdditiveGroup</C>,
##  <E>and</E> the set of scalars forms a ring,
##  <E>and</E> <M>(\lambda + \mu) * x = \lambda * x + \mu * x</M>
##  for scalars <M>\lambda, \mu</M> and <M>x \in M</M>,
##  <E>and</E> scalar multiplication satisfies
##  <M>\lambda * (\mu * x) = (\lambda * \mu) * x</M>
##  for scalars <M>\lambda, \mu</M> and <M>x \in M</M>.
##  <Example><![CDATA[
##  gap> V:= FullRowSpace( Rationals, 3 );
##  ( Rationals^3 )
##  gap> IsLeftModule( V );
##  true
##  ]]></Example>
##  </Description>
##  </ManSection>
##  <#/GAPDoc>
##
DeclareSynonym( "IsLeftModule",
        IsLeftOperatorAdditiveGroup
    and IsLeftActedOnByRing
    and IsDistributiveLOpESum
    and IsAssociativeLOpEProd
    and IsTrivialLOpEOne );


#############################################################################
##
#C  IsRightOperatorAdditiveGroup( <D> )
##
##  <#GAPDoc Label="IsRightOperatorAdditiveGroup">
##  <ManSection>
##  <Filt Name="IsRightOperatorAdditiveGroup" Arg='D' Type='Category'/>
##
##  <Description>
##  A domain <A>D</A> lies in <C>IsRightOperatorAdditiveGroup</C>
##  if it is an additive group that is closed under scalar multiplication
##  from the right,
##  and such that <M>( x + y ) * \lambda = x * \lambda + y * \lambda</M>
##  for all scalars <M>\lambda</M> and elements <M>x, y \in D</M>.
##  </Description>
##  </ManSection>
##  <#/GAPDoc>
##
DeclareSynonym( "IsRightOperatorAdditiveGroup",
        IsAdditiveGroup
    and IsExtRSet
    and IsDistributiveROpDSum );


#############################################################################
##
#C  IsRightModule( <M> )
##
##  <#GAPDoc Label="IsRightModule">
##  <ManSection>
##  <Filt Name="IsRightModule" Arg='M' Type='Category'/>
##
##  <Description>
##  A domain <A>M</A> lies in <C>IsRightModule</C> if it lies in
##  <C>IsRightOperatorAdditiveGroup</C>,
##  <E>and</E> the set of scalars forms a ring,
##  <E>and</E> <M>x * (\lambda + \mu) = x * \lambda + x * \mu</M>
##  for scalars <M>\lambda, \mu</M> and <M>x \in M</M>,
##  <E>and</E> scalar multiplication satisfies
##  <M>(x * \mu) * \lambda = x * (\mu * \lambda)</M>
##  for scalars <M>\lambda, \mu</M> and <M>x \in M</M>.
##  </Description>
##  </ManSection>
##  <#/GAPDoc>
##
DeclareSynonym( "IsRightModule",
        IsRightOperatorAdditiveGroup
    and IsRightActedOnByRing
    and IsDistributiveROpESum
    and IsAssociativeROpEProd
    and IsTrivialROpEOne );


#############################################################################
##
#C  IsFreeLeftModule( <M> )
##
##  <#GAPDoc Label="IsFreeLeftModule">
##  <ManSection>
##  <Filt Name="IsFreeLeftModule" Arg='M' Type='Category'/>
##
##  <Description>
##  A left module is free as module if it is isomorphic to a direct sum of
##  copies of its left acting domain.
##  <P/>
##  Free left modules can have bases.
##  <P/>
##  The characteristic (see&nbsp;<Ref Func="Characteristic"/>) of a
##  free left module is defined as the characteristic of its left acting
##  domain (see&nbsp;<Ref Func="LeftActingDomain"/>).
##  </Description>
##  </ManSection>
##  <#/GAPDoc>
##
DeclareCategory( "IsFreeLeftModule", IsLeftModule );


#############################################################################
##
#P  IsFiniteDimensional( <M> )
##
##  <#GAPDoc Label="IsFiniteDimensional">
##  <ManSection>
##  <Prop Name="IsFiniteDimensional" Arg='M'/>
##
##  <Description>
##  is <K>true</K> if <A>M</A> is a free left module that is finite dimensional
##  over its left acting domain, and <K>false</K> otherwise.
##  <Example><![CDATA[
##  gap> V:= FreeLeftModule( Rationals, [ [ 1, 0 ], [ 0, 1 ], [ 1, 1 ] ] );;
##  gap> IsFiniteDimensional( V );
##  true
##  ]]></Example>
##  </Description>
##  </ManSection>
##  <#/GAPDoc>
##
DeclareProperty( "IsFiniteDimensional", IsFreeLeftModule );

InstallSubsetMaintenance( IsFiniteDimensional,
    IsFreeLeftModule and IsFiniteDimensional, IsFreeLeftModule );

InstallFactorMaintenance( IsFiniteDimensional,
    IsFreeLeftModule and IsFiniteDimensional,
    IsObject, IsFreeLeftModule );

InstallTrueMethod( IsFiniteDimensional, IsFreeLeftModule and IsFinite );


#############################################################################
##
#P  IsFullRowModule( <M> )
##
##  <#GAPDoc Label="IsFullRowModule">
##  <ManSection>
##  <Prop Name="IsFullRowModule" Arg='M'/>
##
##  <Description>
##  A <E>full row module</E> is a module <M>R^n</M>,
##  for a ring <M>R</M> and a nonnegative integer <M>n</M>.
##  <P/>
##  More precisely, a full row module is a free left module over a ring
##  <M>R</M> such that the elements are row vectors of the same length
##  <M>n</M> and with entries in <M>R</M> and such that the dimension is
##  equal to <M>n</M>.
##  <P/>
##  Several functions delegate their tasks to full row modules,
##  for example <Ref Func="Iterator"/> and <Ref Func="Enumerator"/>.
##  </Description>
##  </ManSection>
##  <#/GAPDoc>
##
DeclareProperty( "IsFullRowModule", IsFreeLeftModule, 20 );


#############################################################################
##
#P  IsFullMatrixModule( <M> )
##
##  <#GAPDoc Label="IsFullMatrixModule">
##  <ManSection>
##  <Prop Name="IsFullMatrixModule" Arg='M'/>
##
##  <Description>
##  A <E>full matrix module</E> is a module <M>R^{{[m,n]}}</M>,
##  for a ring <M>R</M> and two nonnegative integers <M>m</M>, <M>n</M>.
##  <P/>
##  More precisely, a full matrix module is a free left module over a ring
##  <M>R</M> such that the elements are <M>m</M> by <M>n</M> matrices with
##  entries in <M>R</M> and such that the dimension is equal to <M>m n</M>.
##  </Description>
##  </ManSection>
##  <#/GAPDoc>
##
DeclareProperty( "IsFullMatrixModule", IsFreeLeftModule, 20 );


#############################################################################
##
#C  IsHandledByNiceBasis( <M> )
##
##  <#GAPDoc Label="IsHandledByNiceBasis">
##  <ManSection>
##  <Filt Name="IsHandledByNiceBasis" Arg='M' Type='Category'/>
##
##  <Description>
##  For a free left module <A>M</A> in this category, essentially all operations
##  are performed using a <Q>nicer</Q> free left module,
##  which is usually a row module.
##  </Description>
##  </ManSection>
##  <#/GAPDoc>
##
DeclareCategory( "IsHandledByNiceBasis",
    IsFreeLeftModule and IsAttributeStoringRep );
#T individually choose for each repres. in this category?
#T why not `DeclareFilter' ?


#############################################################################
##
#A  Dimension( <M> )
##
##  <#GAPDoc Label="Dimension">
##  <ManSection>
##  <Attr Name="Dimension" Arg='M'/>
##
##  <Description>
##  A free left module has dimension <M>n</M> if it is isomorphic to a direct sum
##  of <M>n</M> copies of its left acting domain.
##  <P/>
##  (We do <E>not</E> mark <Ref Attr="Dimension"/> as invariant under isomorphisms
##  since we want to call <Ref Oper="UseIsomorphismRelation"/> also for free left modules
##  over different left acting domains.)
##  <Example><![CDATA[
##  gap> V:= FreeLeftModule( Rationals, [ [ 1, 0 ], [ 0, 1 ], [ 1, 1 ] ] );;
##  gap> Dimension( V );
##  2
##  ]]></Example>
##  </Description>
##  </ManSection>
##  <#/GAPDoc>
##
DeclareAttribute( "Dimension", IsFreeLeftModule );


############################################################################
##
#A  GeneratorsOfLeftOperatorAdditiveGroup( <D> )
##
##  <#GAPDoc Label="GeneratorsOfLeftOperatorAdditiveGroup">
##  <ManSection>
##  <Attr Name="GeneratorsOfLeftOperatorAdditiveGroup" Arg='D'/>
##
##  <Description>
##  returns a list of elements of <A>D</A> that generates <A>D</A> as a left operator
##  additive group.
##  </Description>
##  </ManSection>
##  <#/GAPDoc>
##
DeclareAttribute( "GeneratorsOfLeftOperatorAdditiveGroup",
    IsLeftOperatorAdditiveGroup );


############################################################################
##
#A  GeneratorsOfLeftModule( <M> )
##
##  <#GAPDoc Label="GeneratorsOfLeftModule">
##  <ManSection>
##  <Attr Name="GeneratorsOfLeftModule" Arg='M'/>
##
##  <Description>
##  returns a list of elements of <A>M</A> that generate <A>M</A> as a left module.
##  <Example><![CDATA[
##  gap> V:= FullRowSpace( Rationals, 3 );;
##  gap> GeneratorsOfLeftModule( V );
##  [ [ 1, 0, 0 ], [ 0, 1, 0 ], [ 0, 0, 1 ] ]
##  ]]></Example>
##  </Description>
##  </ManSection>
##  <#/GAPDoc>
##
DeclareSynonymAttr( "GeneratorsOfLeftModule",
    GeneratorsOfLeftOperatorAdditiveGroup );


#############################################################################
##
#A  GeneratorsOfRightOperatorAdditiveGroup( <D> )
##
##  <#GAPDoc Label="GeneratorsOfRightOperatorAdditiveGroup">
##  <ManSection>
##  <Attr Name="GeneratorsOfRightOperatorAdditiveGroup" Arg='D'/>
##
##  <Description>
##  returns a list of elements of <A>D</A> that generates <A>D</A> as a right operator
##  additive group.
##  </Description>
##  </ManSection>
##  <#/GAPDoc>
##
DeclareAttribute( "GeneratorsOfRightOperatorAdditiveGroup",
    IsRightOperatorAdditiveGroup );


#############################################################################
##
#A  GeneratorsOfRightModule( <M> )
##
##  <#GAPDoc Label="GeneratorsOfRightModule">
##  <ManSection>
##  <Attr Name="GeneratorsOfRightModule" Arg='M'/>
##
##  <Description>
##  returns a list of elements of <A>M</A> that generate <A>M</A> as a left module.
##  </Description>
##  </ManSection>
##  <#/GAPDoc>
##
DeclareSynonymAttr( "GeneratorsOfRightModule",
    GeneratorsOfRightOperatorAdditiveGroup );


#############################################################################
##
#A  TrivialSubmodule( <M> )
##
##  <#GAPDoc Label="TrivialSubmodule">
##  <ManSection>
##  <Attr Name="TrivialSubmodule" Arg='M'/>
##
##  <Description>
##  returns the zero submodule of <A>M</A>.
##  <Example><![CDATA[
##  gap> V:= LeftModuleByGenerators(Rationals, [[ 1, 0, 0 ], [ 0, 1, 0 ]]);;
##  gap> TrivialSubmodule( V );
##  <vector space over Rationals, with 0 generators>
##  ]]></Example>
##  </Description>
##  </ManSection>
##  <#/GAPDoc>
##
DeclareSynonymAttr( "TrivialSubmodule", TrivialSubadditiveMagmaWithZero );


#############################################################################
##
#O  AsLeftModule( <R>, <D> )
##
##  <#GAPDoc Label="AsLeftModule">
##  <ManSection>
##  <Oper Name="AsLeftModule" Arg='R, D'/>
##
##  <Description>
##  if the domain <A>D</A> forms an additive group and is closed under left
##  multiplication by the elements of <A>R</A>, then <C>AsLeftModule( <A>R</A>, <A>D</A> )</C>
##  returns the domain <A>D</A> viewed as a left module.
##  <Example><![CDATA[
##  gap> coll:= [[0*Z(2),0*Z(2)], [Z(2),0*Z(2)], [0*Z(2),Z(2)], [Z(2),Z(2)]];
##  [ [ 0*Z(2), 0*Z(2) ], [ Z(2)^0, 0*Z(2) ], [ 0*Z(2), Z(2)^0 ], 
##    [ Z(2)^0, Z(2)^0 ] ]
##  gap> AsLeftModule( GF(2), coll );
##  <vector space of dimension 2 over GF(2)>
##  ]]></Example>
##  </Description>
##  </ManSection>
##  <#/GAPDoc>
##
DeclareOperation( "AsLeftModule", [ IsRing, IsCollection ] );


#############################################################################
##
#O  ClosureLeftModule( <M>, <m> )
##
##  <#GAPDoc Label="ClosureLeftModule">
##  <ManSection>
##  <Oper Name="ClosureLeftModule" Arg='M, m'/>
##
##  <Description>
##  is the left module generated by the left module generators of <A>M</A> and the
##  element <A>m</A>.
##  <Example><![CDATA[
##  gap> V:= LeftModuleByGenerators(Rationals, [ [ 1, 0, 0 ], [ 0, 1, 0 ] ]);
##  <vector space over Rationals, with 2 generators>
##  gap> ClosureLeftModule( V, [ 1, 1, 1 ] );
##  <vector space over Rationals, with 3 generators>
##  ]]></Example>
##  </Description>
##  </ManSection>
##  <#/GAPDoc>
##
DeclareOperation( "ClosureLeftModule", [ IsLeftModule, IsVector ] );


#############################################################################
##
#O  LeftModuleByGenerators( <R>, <gens>[, <zero>] )
##
##  <#GAPDoc Label="LeftModuleByGenerators">
##  <ManSection>
##  <Oper Name="LeftModuleByGenerators" Arg='R, gens[, zero]'/>
##
##  <Description>
##  returns the left module over <A>R</A> generated by <A>gens</A>.
##  <Example><![CDATA[
##  gap> coll:= [ [Z(2),0*Z(2)], [0*Z(2),Z(2)], [Z(2),Z(2)] ];;
##  gap> V:= LeftModuleByGenerators( GF(16), coll );
##  <vector space over GF(2^4), with 3 generators>
##  ]]></Example>
##  </Description>
##  </ManSection>
##  <#/GAPDoc>
##
DeclareOperation( "LeftModuleByGenerators", [ IsRing, IsCollection ] );
DeclareOperation( "LeftModuleByGenerators",
    [ IsRing, IsListOrCollection, IsObject ] );


#############################################################################
##
#O  UseBasis( <V>, <gens> )
##
##  <#GAPDoc Label="UseBasis">
##  <ManSection>
##  <Oper Name="UseBasis" Arg='V, gens'/>
##
##  <Description>
##  The vectors in the list <A>gens</A> are known to form a basis of the
##  free left module <A>V</A>.
##  <Ref Oper="UseBasis"/> stores information in <A>V</A> that can be derived form this fact,
##  namely
##  <List>
##  <Item>
##    <A>gens</A> are stored as left module generators if no such generators were
##    bound (this is useful especially if <A>V</A> is an algebra),
##  </Item>
##  <Item>
##    the dimension of <A>V</A> is stored.
##  </Item>
##  </List>
##  <Example><![CDATA[
##  gap> V:= FreeLeftModule( Rationals, [ [ 1, 0 ], [ 0, 1 ], [ 1, 1 ] ] );;
##  gap> UseBasis( V, [ [ 1, 0 ], [ 1, 1 ] ] );
##  gap> V;  # now V knows its dimension
##  <vector space of dimension 2 over Rationals>
##  ]]></Example>
##  </Description>
##  </ManSection>
##  <#/GAPDoc>
##
DeclareOperation( "UseBasis", [ IsFreeLeftModule, IsHomogeneousList ] );


#############################################################################
##
#F  FreeLeftModule( <R>, <gens>[, <zero>][, "basis"] )
##
##  <#GAPDoc Label="FreeLeftModule">
##  <ManSection>
##  <Func Name="FreeLeftModule" Arg='R, gens[, zero][, "basis"]'/>
##
##  <Description>
##  <C>FreeLeftModule( <A>R</A>, <A>gens</A> )</C> is the free left module
##  over the ring <A>R</A>, generated by the vectors in the collection
##  <A>gens</A>.
##  <P/>
##  If there are three arguments, a ring <A>R</A> and a collection
##  <A>gens</A> and an element <A>zero</A>,
##  then <C>FreeLeftModule( <A>R</A>, <A>gens</A>, <A>zero</A> )</C> is the
##  <A>R</A>-free left module generated by <A>gens</A>,
##  with zero element <A>zero</A>.
##  <P/>
##  If the last argument is the string <C>"basis"</C> then the vectors in
##  <A>gens</A> are known to form a basis of the free module.
##  <P/>
##  It should be noted that the generators <A>gens</A> must be vectors,
##  that is, they must support an addition and a scalar action of <A>R</A>
##  via left multiplication.
##  (See also Section&nbsp;<Ref Sect="Constructing Domains"/>
##  for the general meaning of <Q>generators</Q> in &GAP;.)
##  In particular, <Ref Func="FreeLeftModule"/> is <E>not</E> an equivalent
##  of commands such as <Ref Func="FreeGroup" Label="for given rank"/>
##  in the sense of a constructor of a free group on abstract generators.
##  Such a construction seems to be unnecessary for vector spaces,
##  for that one can use for example row spaces
##  (see&nbsp;<Ref Func="FullRowSpace"/>) in the finite dimensional case
##  and polynomial rings
##  (see&nbsp;<Ref Func="PolynomialRing" Label="for a ring and a rank (and an exclusion list)"/>)
##  in the infinite dimensional case.
##  Moreover, the definition of a <Q>natural</Q> addition for elements of a
##  given magma (for example a permutation group) is possible via the
##  construction of magma rings (see Chapter <Ref Chap="Magma Rings"/>).
##  <Example><![CDATA[
##  gap> V:= FreeLeftModule(Rationals, [[ 1, 0, 0 ], [ 0, 1, 0 ]], "basis");
##  <vector space of dimension 2 over Rationals>
##  ]]></Example>
##  </Description>
##  </ManSection>
##  <#/GAPDoc>
##
DeclareGlobalFunction( "FreeLeftModule" );


#############################################################################
##
#F  FullRowModule( <R>, <n> )
##
##  <#GAPDoc Label="FullRowModule">
##  <ManSection>
##  <Func Name="FullRowModule" Arg='R, n'/>
##
##  <Description>
##  is the row module <C><A>R</A>^<A>n</A></C>,
##  for a ring <A>R</A> and a nonnegative integer <A>n</A>.
##  <Example><![CDATA[
##  gap> V:= FullRowModule( Integers, 5 );
##  ( Integers^5 )
##  ]]></Example>
##  </Description>
##  </ManSection>
##  <#/GAPDoc>
##
DeclareGlobalFunction( "FullRowModule" );


#############################################################################
##
#F  FullMatrixModule( <R>, <m>, <n> )
##
##  <#GAPDoc Label="FullMatrixModule">
##  <ManSection>
##  <Func Name="FullMatrixModule" Arg='R, m, n'/>
##
##  <Description>
##  is the matrix module <C><A>R</A>^[<A>m</A>,<A>n</A>]</C>,
##  for a ring <A>R</A> and nonnegative integers <A>m</A> and <A>n</A>.
##  <Example><![CDATA[
##  gap> FullMatrixModule( GaussianIntegers, 3, 6 );
##  ( GaussianIntegers^[ 3, 6 ] )
##  ]]></Example>
##  </Description>
##  </ManSection>
##  <#/GAPDoc>
##
DeclareGlobalFunction( "FullMatrixModule" );


#############################################################################
##
#F  StandardGeneratorsOfFullMatrixModule( <M> )
##
##  <ManSection>
##  <Func Name="StandardGeneratorsOfFullMatrixModule" Arg='M'/>
##
##  <Description>
##  </Description>
##  </ManSection>
##
DeclareGlobalFunction( "StandardGeneratorsOfFullMatrixModule" );


#############################################################################
##
#F  Submodule( <M>, <gens>[, "basis"] )  submodule of <M> generated by <gens>
##
##  <#GAPDoc Label="Submodule">
##  <ManSection>
##  <Func Name="Submodule" Arg='M, gens[, "basis"]'/>
##
##  <Description>
##  is the left module generated by the collection <A>gens</A>,
##  with parent module <A>M</A>.
##  If the string <C>"basis"</C> is entered as the third argument then
##  the submodule of <A>M</A> is created for which the list <A>gens</A>
##  is known to be a list of basis vectors;
##  in this case, it is <E>not</E> checked whether <A>gens</A> really is
##  linearly independent and whether all in <A>gens</A> lie in <A>M</A>.
##  <Example><![CDATA[
##  gap> coll:= [ [Z(2),0*Z(2)], [0*Z(2),Z(2)], [Z(2),Z(2)] ];;
##  gap> V:= LeftModuleByGenerators( GF(16), coll );;
##  gap> W:= Submodule( V, [ coll[1], coll[2] ] );
##  <vector space over GF(2^4), with 2 generators>
##  gap> Parent( W ) = V;
##  true
##  ]]></Example>
##  </Description>
##  </ManSection>
##  <#/GAPDoc>
##
DeclareGlobalFunction( "Submodule" );


#############################################################################
##
#F  SubmoduleNC( <M>, <gens>[, "basis"] )
##
##  <#GAPDoc Label="SubmoduleNC">
##  <ManSection>
##  <Func Name="SubmoduleNC" Arg='M, gens[, "basis"]'/>
##
##  <Description>
##  <Ref Func="SubmoduleNC"/> does the same as <Ref Func="Submodule"/>,
##  except that it does not check whether all in <A>gens</A> lie in <A>M</A>.
##  </Description>
##  </ManSection>
##  <#/GAPDoc>
##
DeclareGlobalFunction( "SubmoduleNC" );


#############################################################################
##
#P  IsRowModule( <V> )
##
##  <#GAPDoc Label="IsRowModule">
##  <ManSection>
##  <Prop Name="IsRowModule" Arg='V'/>
##
##  <Description>
##  A <E>row module</E> is a free left module whose elements are row vectors.
##  </Description>
##  </ManSection>
##  <#/GAPDoc>
##
DeclareProperty( "IsRowModule", IsFreeLeftModule );

InstallTrueMethod( IsRowModule, IsFullRowModule );


#############################################################################
##
#P  IsMatrixModule( <V> )
##
##  <#GAPDoc Label="IsMatrixModule">
##  <ManSection>
##  <Prop Name="IsMatrixModule" Arg='V'/>
##
##  <Description>
##  A <E>matrix module</E> is a free left module whose elements are matrices.
##  </Description>
##  </ManSection>
##  <#/GAPDoc>
##
DeclareProperty( "IsMatrixModule", IsFreeLeftModule );

InstallTrueMethod( IsMatrixModule, IsFullMatrixModule );


#############################################################################
##
#A  DimensionOfVectors( <M> ) . . . . . . . . . .  for row and matrix modules
##
##  <#GAPDoc Label="DimensionOfVectors">
##  <ManSection>
##  <Attr Name="DimensionOfVectors" Arg='M'/>
##
##  <Description>
##  For a left module <A>M</A> that consists of row vectors
##  (see&nbsp;<Ref Func="IsRowModule"/>),
##  <Ref Func="DimensionOfVectors"/> returns the common length of all row
##  vectors in <A>M</A>.
##  For a left module <A>M</A> that consists of matrices
##  (see&nbsp;<Ref Func="IsMatrixModule"/>),
##  <Ref Func="DimensionOfVectors"/> returns the common matrix dimensions
##  (see&nbsp;<Ref Func="DimensionsMat"/>) of all matrices in <A>M</A>.
##  <Example><![CDATA[
##  gap> DimensionOfVectors( GF(2)^5 );
##  5
##  gap> DimensionOfVectors( GF(2)^[2,3] );
##  [ 2, 3 ]
##  ]]></Example>
##  </Description>
##  </ManSection>
##  <#/GAPDoc>
##
DeclareAttribute( "DimensionOfVectors", IsFreeLeftModule );


#############################################################################
##
#M  IsFiniteDimensional( <M> )  . . . . . .  row modules are always fin. dim.
#M  IsFiniteDimensional( <M> )  . . . . . matrix modules are always fin. dim.
##
##  Any free left module in the filter `IsRowModule' or `IsMatrixModule'
##  is finite dimensional.
##
InstallTrueMethod( IsFiniteDimensional, IsRowModule and IsFreeLeftModule );
InstallTrueMethod( IsFiniteDimensional,
    IsMatrixModule and IsFreeLeftModule );


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