This file is indexed.

/usr/share/gap/doc/ref/chap61.html is in gap-doc 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
 733
 734
 735
 736
 737
 738
 739
 740
 741
 742
 743
 744
 745
 746
 747
 748
 749
 750
 751
 752
 753
 754
 755
 756
 757
 758
 759
 760
 761
 762
 763
 764
 765
 766
 767
 768
 769
 770
 771
 772
 773
 774
 775
 776
 777
 778
 779
 780
 781
 782
 783
 784
 785
 786
 787
 788
 789
 790
 791
 792
 793
 794
 795
 796
 797
 798
 799
 800
 801
 802
 803
 804
 805
 806
 807
 808
 809
 810
 811
 812
 813
 814
 815
 816
 817
 818
 819
 820
 821
 822
 823
 824
 825
 826
 827
 828
 829
 830
 831
 832
 833
 834
 835
 836
 837
 838
 839
 840
 841
 842
 843
 844
 845
 846
 847
 848
 849
 850
 851
 852
 853
 854
 855
 856
 857
 858
 859
 860
 861
 862
 863
 864
 865
 866
 867
 868
 869
 870
 871
 872
 873
 874
 875
 876
 877
 878
 879
 880
 881
 882
 883
 884
 885
 886
 887
 888
 889
 890
 891
 892
 893
 894
 895
 896
 897
 898
 899
 900
 901
 902
 903
 904
 905
 906
 907
 908
 909
 910
 911
 912
 913
 914
 915
 916
 917
 918
 919
 920
 921
 922
 923
 924
 925
 926
 927
 928
 929
 930
 931
 932
 933
 934
 935
 936
 937
 938
 939
 940
 941
 942
 943
 944
 945
 946
 947
 948
 949
 950
 951
 952
 953
 954
 955
 956
 957
 958
 959
 960
 961
 962
 963
 964
 965
 966
 967
 968
 969
 970
 971
 972
 973
 974
 975
 976
 977
 978
 979
 980
 981
 982
 983
 984
 985
 986
 987
 988
 989
 990
 991
 992
 993
 994
 995
 996
 997
 998
 999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
         "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>GAP (ref) - Chapter 61: Vector Spaces</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<meta name="generator" content="GAPDoc2HTML" />
<link rel="stylesheet" type="text/css" href="manual.css" />
<script src="manual.js" type="text/javascript"></script>
<script type="text/javascript">overwriteStyle();</script>
</head>
<body class="chap61"  onload="jscontent()">


<div class="chlinktop"><span class="chlink1">Goto Chapter: </span><a href="chap0.html">Top</a>  <a href="chap1.html">1</a>  <a href="chap2.html">2</a>  <a href="chap3.html">3</a>  <a href="chap4.html">4</a>  <a href="chap5.html">5</a>  <a href="chap6.html">6</a>  <a href="chap7.html">7</a>  <a href="chap8.html">8</a>  <a href="chap9.html">9</a>  <a href="chap10.html">10</a>  <a href="chap11.html">11</a>  <a href="chap12.html">12</a>  <a href="chap13.html">13</a>  <a href="chap14.html">14</a>  <a href="chap15.html">15</a>  <a href="chap16.html">16</a>  <a href="chap17.html">17</a>  <a href="chap18.html">18</a>  <a href="chap19.html">19</a>  <a href="chap20.html">20</a>  <a href="chap21.html">21</a>  <a href="chap22.html">22</a>  <a href="chap23.html">23</a>  <a href="chap24.html">24</a>  <a href="chap25.html">25</a>  <a href="chap26.html">26</a>  <a href="chap27.html">27</a>  <a href="chap28.html">28</a>  <a href="chap29.html">29</a>  <a href="chap30.html">30</a>  <a href="chap31.html">31</a>  <a href="chap32.html">32</a>  <a href="chap33.html">33</a>  <a href="chap34.html">34</a>  <a href="chap35.html">35</a>  <a href="chap36.html">36</a>  <a href="chap37.html">37</a>  <a href="chap38.html">38</a>  <a href="chap39.html">39</a>  <a href="chap40.html">40</a>  <a href="chap41.html">41</a>  <a href="chap42.html">42</a>  <a href="chap43.html">43</a>  <a href="chap44.html">44</a>  <a href="chap45.html">45</a>  <a href="chap46.html">46</a>  <a href="chap47.html">47</a>  <a href="chap48.html">48</a>  <a href="chap49.html">49</a>  <a href="chap50.html">50</a>  <a href="chap51.html">51</a>  <a href="chap52.html">52</a>  <a href="chap53.html">53</a>  <a href="chap54.html">54</a>  <a href="chap55.html">55</a>  <a href="chap56.html">56</a>  <a href="chap57.html">57</a>  <a href="chap58.html">58</a>  <a href="chap59.html">59</a>  <a href="chap60.html">60</a>  <a href="chap61.html">61</a>  <a href="chap62.html">62</a>  <a href="chap63.html">63</a>  <a href="chap64.html">64</a>  <a href="chap65.html">65</a>  <a href="chap66.html">66</a>  <a href="chap67.html">67</a>  <a href="chap68.html">68</a>  <a href="chap69.html">69</a>  <a href="chap70.html">70</a>  <a href="chap71.html">71</a>  <a href="chap72.html">72</a>  <a href="chap73.html">73</a>  <a href="chap74.html">74</a>  <a href="chap75.html">75</a>  <a href="chap76.html">76</a>  <a href="chap77.html">77</a>  <a href="chap78.html">78</a>  <a href="chap79.html">79</a>  <a href="chap80.html">80</a>  <a href="chap81.html">81</a>  <a href="chap82.html">82</a>  <a href="chap83.html">83</a>  <a href="chap84.html">84</a>  <a href="chap85.html">85</a>  <a href="chap86.html">86</a>  <a href="chap87.html">87</a>  <a href="chapBib.html">Bib</a>  <a href="chapInd.html">Ind</a>  </div>

<div class="chlinkprevnexttop">&nbsp;<a href="chap0.html">[Top of Book]</a>&nbsp;  <a href="chap0.html#contents">[Contents]</a>&nbsp;  &nbsp;<a href="chap60.html">[Previous Chapter]</a>&nbsp;  &nbsp;<a href="chap62.html">[Next Chapter]</a>&nbsp;  </div>

<p id="mathjaxlink" class="pcenter"><a href="chap61_mj.html">[MathJax on]</a></p>
<p><a id="X7DAD6700787EC845" name="X7DAD6700787EC845"></a></p>
<div class="ChapSects"><a href="chap61.html#X7DAD6700787EC845">61 <span class="Heading">Vector Spaces</span></a>
<div class="ContSect"><span class="tocline"><span class="nocss">&nbsp;</span><a href="chap61.html#X8754F7207CFDA38B">61.1 <span class="Heading">IsLeftVectorSpace (Filter)</span></a>
</span>
<div class="ContSSBlock">
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap61.html#X80290A908241706B">61.1-1 IsLeftVectorSpace</a></span>
</div></div>
<div class="ContSect"><span class="tocline"><span class="nocss">&nbsp;</span><a href="chap61.html#X87AD06FE873619EA">61.2 <span class="Heading">Constructing Vector Spaces</span></a>
</span>
<div class="ContSSBlock">
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap61.html#X805413157CE9BECF">61.2-1 VectorSpace</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap61.html#X78C9826780BC9AE6">61.2-2 Subspace</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap61.html#X7B001BAF7D5FD5D0">61.2-3 AsVectorSpace</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap61.html#X7D4F84C27EDAC89B">61.2-4 AsSubspace</a></span>
</div></div>
<div class="ContSect"><span class="tocline"><span class="nocss">&nbsp;</span><a href="chap61.html#X789FB2D883E53662">61.3 <span class="Heading">Operations and Attributes for Vector Spaces</span></a>
</span>
<div class="ContSSBlock">
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap61.html#X849651C6830C94A1">61.3-1 GeneratorsOfLeftVectorSpace</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap61.html#X86DC71A9835430FD">61.3-2 TrivialSubspace</a></span>
</div></div>
<div class="ContSect"><span class="tocline"><span class="nocss">&nbsp;</span><a href="chap61.html#X8125675583357131">61.4 <span class="Heading">Domains of Subspaces of Vector Spaces</span></a>
</span>
<div class="ContSSBlock">
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap61.html#X7975E41A7B29C3FD">61.4-1 Subspaces</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap61.html#X7A8F5C367FAE3D1B">61.4-2 IsSubspacesVectorSpace</a></span>
</div></div>
<div class="ContSect"><span class="tocline"><span class="nocss">&nbsp;</span><a href="chap61.html#X828AA09B87F14FAD">61.5 <span class="Heading">Bases of Vector Spaces</span></a>
</span>
<div class="ContSSBlock">
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap61.html#X8739510881F5D862">61.5-1 IsBasis</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap61.html#X837BE54C80DE368E">61.5-2 Basis</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap61.html#X7C8EBFF5805F8C51">61.5-3 CanonicalBasis</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap61.html#X8786D40B84120F38">61.5-4 RelativeBasis</a></span>
</div></div>
<div class="ContSect"><span class="tocline"><span class="nocss">&nbsp;</span><a href="chap61.html#X839B9C4880EBFB5F">61.6 <span class="Heading">Operations for Vector Space Bases</span></a>
</span>
<div class="ContSSBlock">
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap61.html#X7B1F17AE8027A590">61.6-1 BasisVectors</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap61.html#X81E8AE88843B70FF">61.6-2 UnderlyingLeftModule</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap61.html#X80B32F667BF6AFD8">61.6-3 Coefficients</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap61.html#X7D305AB3834889BF">61.6-4 LinearCombination</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap61.html#X7EB0D16A7EC2DEE3">61.6-5 EnumeratorByBasis</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap61.html#X855625D47979005D">61.6-6 IteratorByBasis</a></span>
</div></div>
<div class="ContSect"><span class="tocline"><span class="nocss">&nbsp;</span><a href="chap61.html#X82809D6C82DE4EC2">61.7 <span class="Heading">Operations for Special Kinds of Bases</span></a>
</span>
<div class="ContSSBlock">
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap61.html#X7CC2B3DD81628CE9">61.7-1 IsCanonicalBasis</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap61.html#X86DE147F8606B739">61.7-2 IsIntegralBasis</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap61.html#X7FC051C579D61223">61.7-3 IsNormalBasis</a></span>
</div></div>
<div class="ContSect"><span class="tocline"><span class="nocss">&nbsp;</span><a href="chap61.html#X7C11B9C3819F3EA2">61.8 <span class="Heading">Mutable Bases</span></a>
</span>
<div class="ContSSBlock">
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap61.html#X7F466FB47F7E9F00">61.8-1 IsMutableBasis</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap61.html#X8115C061819E5172">61.8-2 MutableBasis</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap61.html#X7EC90F4F7BCAF8D4">61.8-3 NrBasisVectors</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap61.html#X7BA87512823A8CFD">61.8-4 ImmutableBasis</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap61.html#X85B50AC77A22108B">61.8-5 IsContainedInSpan</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap61.html#X7B52C99B84316F61">61.8-6 CloseMutableBasis</a></span>
</div></div>
<div class="ContSect"><span class="tocline"><span class="nocss">&nbsp;</span><a href="chap61.html#X7D937EBC7DE2819B">61.9 <span class="Heading">Row and Matrix Spaces</span></a>
</span>
<div class="ContSSBlock">
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap61.html#X79B305CE87511C4B">61.9-1 IsRowSpace</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap61.html#X7A2BBBA07B2BE8F8">61.9-2 IsMatrixSpace</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap61.html#X83724C157F4FDFB4">61.9-3 IsGaussianSpace</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap61.html#X80209A8785126AAB">61.9-4 FullRowSpace</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap61.html#X876B66C37A7B749F">61.9-5 FullMatrixSpace</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap61.html#X8534A750878478D0">61.9-6 DimensionOfVectors</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap61.html#X865A540F85FAE2DF">61.9-7 IsSemiEchelonized</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap61.html#X87DCA09579589106">61.9-8 SemiEchelonBasis</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap61.html#X7C3CC5F97FA048A4">61.9-9 IsCanonicalBasisFullRowModule</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap61.html#X83D282697C1A3148">61.9-10 IsCanonicalBasisFullMatrixModule</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap61.html#X7D6537F87E940344">61.9-11 NormedRowVectors</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap61.html#X815C69A57C042C34">61.9-12 SiftedVector</a></span>
</div></div>
<div class="ContSect"><span class="tocline"><span class="nocss">&nbsp;</span><a href="chap61.html#X7F61CECA84CEF39D">61.10 <span class="Heading">Vector Space Homomorphisms</span></a>
</span>
<div class="ContSSBlock">
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap61.html#X82013D328645E370">61.10-1 LeftModuleGeneralMappingByImages</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap61.html#X85F5293983E47B5A">61.10-2 LeftModuleHomomorphismByImages</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap61.html#X8477E6C3872A6DBB">61.10-3 LeftModuleHomomorphismByMatrix</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap61.html#X8494AA5D7C3B88AD">61.10-4 NaturalHomomorphismBySubspace</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap61.html#X80015C78876B4F1E">61.10-5 Hom</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap61.html#X8680ADD381ECF879">61.10-6 End</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap61.html#X7A9A08EA79259659">61.10-7 IsFullHomModule</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap61.html#X7C4737687E76A24A">61.10-8 IsPseudoCanonicalBasisFullHomModule</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap61.html#X84F87C327A1856F2">61.10-9 IsLinearMappingsModule</a></span>
</div></div>
<div class="ContSect"><span class="tocline"><span class="nocss">&nbsp;</span><a href="chap61.html#X81503EB77FCE648D">61.11 <span class="Heading">Vector Spaces Handled By Nice Bases</span></a>
</span>
<div class="ContSSBlock">
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap61.html#X826FD4BC7BA0559D">61.11-1 NiceFreeLeftModule</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap61.html#X807B8032780C59A4">61.11-2 NiceVector</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap61.html#X79350786800C2DD8">61.11-3 NiceFreeLeftModuleInfo</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap61.html#X8388E0248690C214">61.11-4 NiceBasis</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap61.html#X82BC30A487967F5B">61.11-5 IsBasisByNiceBasis</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap61.html#X79D1DEA679AEDA40">61.11-6 IsHandledByNiceBasis</a></span>
</div></div>
<div class="ContSect"><span class="tocline"><span class="nocss">&nbsp;</span><a href="chap61.html#X8238195B851D3C44">61.12 <span class="Heading">How to Implement New Kinds of Vector Spaces</span></a>
</span>
<div class="ContSSBlock">
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap61.html#X7DE34C3E837FCBC3">61.12-1 DeclareHandlingByNiceBasis</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap61.html#X7E6077F0830A28DA">61.12-2 NiceBasisFiltersInfo</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap61.html#X7A374553786DF5E7">61.12-3 CheckForHandlingByNiceBasis</a></span>
</div></div>
</div>

<h3>61 <span class="Heading">Vector Spaces</span></h3>

<p><a id="X8754F7207CFDA38B" name="X8754F7207CFDA38B"></a></p>

<h4>61.1 <span class="Heading">IsLeftVectorSpace (Filter)</span></h4>

<p><a id="X80290A908241706B" name="X80290A908241706B"></a></p>

<h5>61.1-1 IsLeftVectorSpace</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; IsLeftVectorSpace</code>( <var class="Arg">V</var> )</td><td class="tdright">( category )</td></tr></table></div>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; IsVectorSpace</code>( <var class="Arg">V</var> )</td><td class="tdright">( category )</td></tr></table></div>
<p>A <em>vector space</em> in <strong class="pkg">GAP</strong> is a free left module (see <code class="func">IsFreeLeftModule</code> (<a href="chap57.html#X7C4832187F3D9228"><span class="RefLink">57.3-1</span></a>)) over a division ring (see Chapter <a href="chap58.html#X80A8E676814A19FD"><span class="RefLink">58</span></a>).</p>

<p>Whenever we talk about an <span class="SimpleMath">F</span>-vector space <var class="Arg">V</var> then <var class="Arg">V</var> is an additive group (see <code class="func">IsAdditiveGroup</code> (<a href="chap55.html#X7B8FBD9082CE271B"><span class="RefLink">55.1-6</span></a>)) on which the division ring <span class="SimpleMath">F</span> acts via multiplication from the left such that this action and the addition in <var class="Arg">V</var> are left and right distributive. The division ring <span class="SimpleMath">F</span> can be accessed as value of the attribute <code class="func">LeftActingDomain</code> (<a href="chap57.html#X86F070E0807DC34E"><span class="RefLink">57.1-11</span></a>).</p>

<p>Vector spaces in <strong class="pkg">GAP</strong> are always <em>left</em> vector spaces, <code class="func">IsLeftVectorSpace</code> and <code class="func">IsVectorSpace</code> are synonyms.</p>

<p><a id="X87AD06FE873619EA" name="X87AD06FE873619EA"></a></p>

<h4>61.2 <span class="Heading">Constructing Vector Spaces</span></h4>

<p><a id="X805413157CE9BECF" name="X805413157CE9BECF"></a></p>

<h5>61.2-1 VectorSpace</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; VectorSpace</code>( <var class="Arg">F</var>, <var class="Arg">gens</var>[, <var class="Arg">zero</var>][, <var class="Arg">"basis"</var>] )</td><td class="tdright">( function )</td></tr></table></div>
<p>For a field <var class="Arg">F</var> and a collection <var class="Arg">gens</var> of vectors, <code class="func">VectorSpace</code> returns the <var class="Arg">F</var>-vector space spanned by the elements in <var class="Arg">gens</var>.</p>

<p>The optional argument <var class="Arg">zero</var> can be used to specify the zero element of the space; <var class="Arg">zero</var> <em>must</em> be given if <var class="Arg">gens</var> is empty. The optional string <code class="code">"basis"</code> indicates that <var class="Arg">gens</var> is known to be linearly independent over <var class="Arg">F</var>, in particular the dimension of the vector space is immediately set; note that <code class="func">Basis</code> (<a href="chap61.html#X837BE54C80DE368E"><span class="RefLink">61.5-2</span></a>) need <em>not</em> return the basis formed by <var class="Arg">gens</var> if the string <code class="code">"basis"</code> is given as an argument.</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">V:= VectorSpace( Rationals, [ [ 1, 2, 3 ], [ 1, 1, 1 ] ] );</span>
&lt;vector space over Rationals, with 2 generators&gt;
</pre></div>

<p><a id="X78C9826780BC9AE6" name="X78C9826780BC9AE6"></a></p>

<h5>61.2-2 Subspace</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; Subspace</code>( <var class="Arg">V</var>, <var class="Arg">gens</var>[, <var class="Arg">"basis"</var>] )</td><td class="tdright">( function )</td></tr></table></div>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; SubspaceNC</code>( <var class="Arg">V</var>, <var class="Arg">gens</var>[, <var class="Arg">"basis"</var>] )</td><td class="tdright">( function )</td></tr></table></div>
<p>For an <span class="SimpleMath">F</span>-vector space <var class="Arg">V</var> and a list or collection <var class="Arg">gens</var> that is a subset of <var class="Arg">V</var>, <code class="func">Subspace</code> returns the <span class="SimpleMath">F</span>-vector space spanned by <var class="Arg">gens</var>; if <var class="Arg">gens</var> is empty then the trivial subspace (see <code class="func">TrivialSubspace</code> (<a href="chap61.html#X86DC71A9835430FD"><span class="RefLink">61.3-2</span></a>)) of <var class="Arg">V</var> is returned. The parent (see <a href="chap31.html#X7CBDD36E7B7BE286"><span class="RefLink">31.7</span></a>) of the returned vector space is set to <var class="Arg">V</var>.</p>

<p><code class="func">SubspaceNC</code> does the same as <code class="func">Subspace</code>, except that it omits the check whether <var class="Arg">gens</var> is a subset of <var class="Arg">V</var>.</p>

<p>The optional string <var class="Arg">"basis"</var> indicates that <var class="Arg">gens</var> is known to be linearly independent over <span class="SimpleMath">F</span>. In this case the dimension of the subspace is immediately set, and both <code class="func">Subspace</code> and <code class="func">SubspaceNC</code> do <em>not</em> check whether <var class="Arg">gens</var> really is linearly independent and whether <var class="Arg">gens</var> is a subset of <var class="Arg">V</var>.</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">V:= VectorSpace( Rationals, [ [ 1, 2, 3 ], [ 1, 1, 1 ] ] );;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">W:= Subspace( V, [ [ 0, 1, 2 ] ] );</span>
&lt;vector space over Rationals, with 1 generators&gt;
</pre></div>

<p><a id="X7B001BAF7D5FD5D0" name="X7B001BAF7D5FD5D0"></a></p>

<h5>61.2-3 AsVectorSpace</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; AsVectorSpace</code>( <var class="Arg">F</var>, <var class="Arg">D</var> )</td><td class="tdright">( operation )</td></tr></table></div>
<p>Let <var class="Arg">F</var> be a division ring and <var class="Arg">D</var> a domain. If the elements in <var class="Arg">D</var> form an <var class="Arg">F</var>-vector space then <code class="func">AsVectorSpace</code> returns this <var class="Arg">F</var>-vector space, otherwise <code class="keyw">fail</code> is returned.</p>

<p><code class="func">AsVectorSpace</code> can be used for example to view a given vector space as a vector space over a smaller or larger division ring.</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">V:= FullRowSpace( GF( 27 ), 3 );</span>
( GF(3^3)^3 )
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Dimension( V );  LeftActingDomain( V );</span>
3
GF(3^3)
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">W:= AsVectorSpace( GF( 3 ), V );</span>
&lt;vector space over GF(3), with 9 generators&gt;
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Dimension( W );  LeftActingDomain( W );</span>
9
GF(3)
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">AsVectorSpace( GF( 9 ), V );</span>
fail
</pre></div>

<p><a id="X7D4F84C27EDAC89B" name="X7D4F84C27EDAC89B"></a></p>

<h5>61.2-4 AsSubspace</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; AsSubspace</code>( <var class="Arg">V</var>, <var class="Arg">U</var> )</td><td class="tdright">( operation )</td></tr></table></div>
<p>Let <var class="Arg">V</var> be an <span class="SimpleMath">F</span>-vector space, and <var class="Arg">U</var> a collection. If <var class="Arg">U</var> is a subset of <var class="Arg">V</var> such that the elements of <var class="Arg">U</var> form an <span class="SimpleMath">F</span>-vector space then <code class="func">AsSubspace</code> returns this vector space, with parent set to <var class="Arg">V</var> (see <code class="func">AsVectorSpace</code> (<a href="chap61.html#X7B001BAF7D5FD5D0"><span class="RefLink">61.2-3</span></a>)). Otherwise <code class="keyw">fail</code> is returned.</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">V:= VectorSpace( Rationals, [ [ 1, 2, 3 ], [ 1, 1, 1 ] ] );;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">W:= VectorSpace( Rationals, [ [ 1/2, 1/2, 1/2 ] ] );;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">U:= AsSubspace( V, W );</span>
&lt;vector space over Rationals, with 1 generators&gt;
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Parent( U ) = V;</span>
true
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">AsSubspace( V, [ [ 1, 1, 1 ] ] );</span>
fail
</pre></div>

<p><a id="X789FB2D883E53662" name="X789FB2D883E53662"></a></p>

<h4>61.3 <span class="Heading">Operations and Attributes for Vector Spaces</span></h4>

<p><a id="X849651C6830C94A1" name="X849651C6830C94A1"></a></p>

<h5>61.3-1 GeneratorsOfLeftVectorSpace</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; GeneratorsOfLeftVectorSpace</code>( <var class="Arg">V</var> )</td><td class="tdright">( attribute )</td></tr></table></div>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; GeneratorsOfVectorSpace</code>( <var class="Arg">V</var> )</td><td class="tdright">( attribute )</td></tr></table></div>
<p>For an <span class="SimpleMath">F</span>-vector space <var class="Arg">V</var>, <code class="func">GeneratorsOfLeftVectorSpace</code> returns a list of vectors in <var class="Arg">V</var> that generate <var class="Arg">V</var> as an <span class="SimpleMath">F</span>-vector space.</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">GeneratorsOfVectorSpace( FullRowSpace( Rationals, 3 ) );</span>
[ [ 1, 0, 0 ], [ 0, 1, 0 ], [ 0, 0, 1 ] ]
</pre></div>

<p><a id="X86DC71A9835430FD" name="X86DC71A9835430FD"></a></p>

<h5>61.3-2 TrivialSubspace</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; TrivialSubspace</code>( <var class="Arg">V</var> )</td><td class="tdright">( attribute )</td></tr></table></div>
<p>For a vector space <var class="Arg">V</var>, <code class="func">TrivialSubspace</code> returns the subspace of <var class="Arg">V</var> that consists of the zero vector in <var class="Arg">V</var>.</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">V:= GF(3)^3;;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">triv:= TrivialSubspace( V );</span>
&lt;vector space over GF(3), with 0 generators&gt;
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">AsSet( triv );</span>
[ [ 0*Z(3), 0*Z(3), 0*Z(3) ] ]
</pre></div>

<p><a id="X8125675583357131" name="X8125675583357131"></a></p>

<h4>61.4 <span class="Heading">Domains of Subspaces of Vector Spaces</span></h4>

<p><a id="X7975E41A7B29C3FD" name="X7975E41A7B29C3FD"></a></p>

<h5>61.4-1 Subspaces</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; Subspaces</code>( <var class="Arg">V</var>[, <var class="Arg">k</var>] )</td><td class="tdright">( attribute )</td></tr></table></div>
<p>Called with a finite vector space <var class="Arg">v</var>, <code class="func">Subspaces</code> returns the domain of all subspaces of <var class="Arg">V</var>.</p>

<p>Called with <var class="Arg">V</var> and a nonnegative integer <var class="Arg">k</var>, <code class="func">Subspaces</code> returns the domain of all <var class="Arg">k</var>-dimensional subspaces of <var class="Arg">V</var>.</p>

<p>Special <code class="func">Size</code> (<a href="chap30.html#X858ADA3B7A684421"><span class="RefLink">30.4-6</span></a>) and <code class="func">Iterator</code> (<a href="chap30.html#X83ADF8287ED0668E"><span class="RefLink">30.8-1</span></a>) methods are provided for these domains.</p>

<p><a id="X7A8F5C367FAE3D1B" name="X7A8F5C367FAE3D1B"></a></p>

<h5>61.4-2 IsSubspacesVectorSpace</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; IsSubspacesVectorSpace</code>( <var class="Arg">D</var> )</td><td class="tdright">( category )</td></tr></table></div>
<p>The domain of all subspaces of a (finite) vector space or of all subspaces of fixed dimension, as returned by <code class="func">Subspaces</code> (<a href="chap61.html#X7975E41A7B29C3FD"><span class="RefLink">61.4-1</span></a>) (see <code class="func">Subspaces</code> (<a href="chap61.html#X7975E41A7B29C3FD"><span class="RefLink">61.4-1</span></a>)) lies in the category <code class="func">IsSubspacesVectorSpace</code>.</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">D:= Subspaces( GF(3)^3 );</span>
Subspaces( ( GF(3)^3 ) )
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Size( D );</span>
28
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">iter:= Iterator( D );;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">NextIterator( iter );</span>
&lt;vector space over GF(3), with 0 generators&gt;
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">NextIterator( iter );</span>
&lt;vector space of dimension 1 over GF(3)&gt;
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">IsSubspacesVectorSpace( D );</span>
true
</pre></div>

<p><a id="X828AA09B87F14FAD" name="X828AA09B87F14FAD"></a></p>

<h4>61.5 <span class="Heading">Bases of Vector Spaces</span></h4>

<p>In <strong class="pkg">GAP</strong>, a <em>basis</em> of a free left <span class="SimpleMath">F</span>-module <span class="SimpleMath">V</span> is a list of vectors <span class="SimpleMath">B = [ v_1, v_2, ..., v_n ]</span> in <span class="SimpleMath">V</span> such that <span class="SimpleMath">V</span> is generated as a left <span class="SimpleMath">F</span>-module by these vectors and such that <span class="SimpleMath">B</span> is linearly independent over <span class="SimpleMath">F</span>. The integer <span class="SimpleMath">n</span> is the dimension of <span class="SimpleMath">V</span> (see <code class="func">Dimension</code> (<a href="chap57.html#X7E6926C6850E7C4E"><span class="RefLink">57.3-3</span></a>)). In particular, as each basis is a list (see Chapter <a href="chap21.html#X7B256AE5780F140A"><span class="RefLink">21</span></a>), it has a length (see <code class="func">Length</code> (<a href="chap21.html#X780769238600AFD1"><span class="RefLink">21.17-5</span></a>)), and the <span class="SimpleMath">i</span>-th vector of <span class="SimpleMath">B</span> can be accessed as <span class="SimpleMath">B[i]</span>.</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">V:= Rationals^3;</span>
( Rationals^3 )
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">B:= Basis( V );</span>
CanonicalBasis( ( Rationals^3 ) )
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Length( B );</span>
3
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">B[1];</span>
[ 1, 0, 0 ]
</pre></div>

<p>The operations described below make sense only for bases of <em>finite</em> dimensional vector spaces. (In practice this means that the vector spaces must be <em>low</em> dimensional, that is, the dimension should not exceed a few hundred.)</p>

<p>Besides the basic operations for lists (see <a href="chap21.html#X7B202D147A5C2884"><span class="RefLink">21.2</span></a>), the <em>basic operations for bases</em> are <code class="func">BasisVectors</code> (<a href="chap61.html#X7B1F17AE8027A590"><span class="RefLink">61.6-1</span></a>), <code class="func">Coefficients</code> (<a href="chap61.html#X80B32F667BF6AFD8"><span class="RefLink">61.6-3</span></a>), <code class="func">LinearCombination</code> (<a href="chap61.html#X7D305AB3834889BF"><span class="RefLink">61.6-4</span></a>), and <code class="func">UnderlyingLeftModule</code> (<a href="chap61.html#X81E8AE88843B70FF"><span class="RefLink">61.6-2</span></a>). These and other operations for arbitrary bases are described in <a href="chap61.html#X839B9C4880EBFB5F"><span class="RefLink">61.6</span></a>.</p>

<p>For special kinds of bases, further operations are defined (see <a href="chap61.html#X82809D6C82DE4EC2"><span class="RefLink">61.7</span></a>).</p>

<p><strong class="pkg">GAP</strong> supports the following three kinds of bases.</p>

<p><em>Relative bases</em> delegate the work to other bases of the same free left module, via basechange matrices (see <code class="func">RelativeBasis</code> (<a href="chap61.html#X8786D40B84120F38"><span class="RefLink">61.5-4</span></a>)).</p>

<p><em>Bases handled by nice bases</em> delegate the work to bases of isomorphic left modules over the same left acting domain (see <a href="chap61.html#X81503EB77FCE648D"><span class="RefLink">61.11</span></a>).</p>

<p>Finally, of course there must be bases in <strong class="pkg">GAP</strong> that really do the work.</p>

<p>For example, in the case of a Gaussian row or matrix space <var class="Arg">V</var> (see <a href="chap61.html#X7D937EBC7DE2819B"><span class="RefLink">61.9</span></a>), <code class="code">Basis( <var class="Arg">V</var> )</code> is a semi-echelonized basis (see <code class="func">IsSemiEchelonized</code> (<a href="chap61.html#X865A540F85FAE2DF"><span class="RefLink">61.9-7</span></a>)) that uses Gaussian elimination; such a basis is of the third kind. <code class="code">Basis( <var class="Arg">V</var>, <var class="Arg">vectors</var> )</code> is either semi-echelonized or a relative basis. Other examples of bases of the third kind are canonical bases of finite fields and of abelian number fields.</p>

<p>Bases handled by nice bases are described in <a href="chap61.html#X81503EB77FCE648D"><span class="RefLink">61.11</span></a>. Examples are non-Gaussian row and matrix spaces, and subspaces of finite fields and abelian number fields that are themselves not fields.</p>

<p><a id="X8739510881F5D862" name="X8739510881F5D862"></a></p>

<h5>61.5-1 IsBasis</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; IsBasis</code>( <var class="Arg">obj</var> )</td><td class="tdright">( category )</td></tr></table></div>
<p>In <strong class="pkg">GAP</strong>, a <em>basis</em> of a free left module is an object that knows how to compute coefficients w.r.t. its basis vectors (see <code class="func">Coefficients</code> (<a href="chap61.html#X80B32F667BF6AFD8"><span class="RefLink">61.6-3</span></a>)). Bases are constructed by <code class="func">Basis</code> (<a href="chap61.html#X837BE54C80DE368E"><span class="RefLink">61.5-2</span></a>). Each basis is an immutable list, the <span class="SimpleMath">i</span>-th entry being the <span class="SimpleMath">i</span>-th basis vector.</p>

<p>(See <a href="chap61.html#X7C11B9C3819F3EA2"><span class="RefLink">61.8</span></a> for mutable bases.)</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">V:= GF(2)^2;;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">B:= Basis( V );;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">IsBasis( B );</span>
true
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">IsBasis( [ [ 1, 0 ], [ 0, 1 ] ] );</span>
false
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">IsBasis( Basis( Rationals^2, [ [ 1, 0 ], [ 0, 1 ] ] ) );</span>
true
</pre></div>

<p><a id="X837BE54C80DE368E" name="X837BE54C80DE368E"></a></p>

<h5>61.5-2 Basis</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; Basis</code>( <var class="Arg">V</var>[, <var class="Arg">vectors</var>] )</td><td class="tdright">( attribute )</td></tr></table></div>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; BasisNC</code>( <var class="Arg">V</var>, <var class="Arg">vectors</var> )</td><td class="tdright">( operation )</td></tr></table></div>
<p>Called with a free left <span class="SimpleMath">F</span>-module <var class="Arg">V</var> as the only argument, <code class="func">Basis</code> returns an <span class="SimpleMath">F</span>-basis of <var class="Arg">V</var> whose vectors are not further specified.</p>

<p>If additionally a list <var class="Arg">vectors</var> of vectors in <var class="Arg">V</var> is given that forms an <span class="SimpleMath">F</span>-basis of <var class="Arg">V</var> then <code class="func">Basis</code> returns this basis; if <var class="Arg">vectors</var> is not linearly independent over <span class="SimpleMath">F</span> or does not generate <var class="Arg">V</var> as a free left <span class="SimpleMath">F</span>-module then <code class="keyw">fail</code> is returned.</p>

<p><code class="func">BasisNC</code> does the same as the two argument version of <code class="func">Basis</code>, except that it does not check whether <var class="Arg">vectors</var> form a basis.</p>

<p>If no basis vectors are prescribed then <code class="func">Basis</code> need not compute basis vectors; in this case, the vectors are computed in the first call to <code class="func">BasisVectors</code> (<a href="chap61.html#X7B1F17AE8027A590"><span class="RefLink">61.6-1</span></a>).</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">V:= VectorSpace( Rationals, [ [ 1, 2, 7 ], [ 1/2, 1/3, 5 ] ] );;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">B:= Basis( V );</span>
SemiEchelonBasis( &lt;vector space over Rationals, with 
2 generators&gt;, ... )
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">BasisVectors( B );</span>
[ [ 1, 2, 7 ], [ 0, 1, -9/4 ] ]
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">B:= Basis( V, [ [ 1, 2, 7 ], [ 3, 2, 30 ] ] );</span>
Basis( &lt;vector space over Rationals, with 2 generators&gt;, 
[ [ 1, 2, 7 ], [ 3, 2, 30 ] ] )
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Basis( V, [ [ 1, 2, 3 ] ] );</span>
fail
</pre></div>

<p><a id="X7C8EBFF5805F8C51" name="X7C8EBFF5805F8C51"></a></p>

<h5>61.5-3 CanonicalBasis</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; CanonicalBasis</code>( <var class="Arg">V</var> )</td><td class="tdright">( attribute )</td></tr></table></div>
<p>If the vector space <var class="Arg">V</var> supports a <em>canonical basis</em> then <code class="func">CanonicalBasis</code> returns this basis, otherwise <code class="keyw">fail</code> is returned.</p>

<p>The defining property of a canonical basis is that its vectors are uniquely determined by the vector space. If canonical bases exist for two vector spaces over the same left acting domain (see <code class="func">LeftActingDomain</code> (<a href="chap57.html#X86F070E0807DC34E"><span class="RefLink">57.1-11</span></a>)) then the equality of these vector spaces can be decided by comparing the canonical bases.</p>

<p>The exact meaning of a canonical basis depends on the type of <var class="Arg">V</var>. Canonical bases are defined for example for Gaussian row and matrix spaces (see <a href="chap61.html#X7D937EBC7DE2819B"><span class="RefLink">61.9</span></a>).</p>

<p>If one designs a new kind of vector spaces (see <a href="chap61.html#X8238195B851D3C44"><span class="RefLink">61.12</span></a>) and defines a canonical basis for these spaces then the <code class="func">CanonicalBasis</code> method one installs (see <code class="func">InstallMethod</code> (<a href="chap78.html#X837EFDAB7BEF290B"><span class="RefLink">78.2-1</span></a>)) must <em>not</em> call <code class="func">Basis</code> (<a href="chap61.html#X837BE54C80DE368E"><span class="RefLink">61.5-2</span></a>). On the other hand, one probably should install a <code class="func">Basis</code> (<a href="chap61.html#X837BE54C80DE368E"><span class="RefLink">61.5-2</span></a>) method that simply calls <code class="func">CanonicalBasis</code>, the value of the method (see <a href="chap78.html#X795EE8257848B438"><span class="RefLink">78.2</span></a> and <a href="chap78.html#X851FC6387CA2B241"><span class="RefLink">78.3</span></a>) being <code class="code">CANONICAL_BASIS_FLAGS</code>.</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">vecs:= [ [ 1, 2, 3 ], [ 1, 1, 1 ], [ 1, 1, 1 ] ];;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">V:= VectorSpace( Rationals, vecs );;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">B:= CanonicalBasis( V );</span>
CanonicalBasis( &lt;vector space over Rationals, with 3 generators&gt; )
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">BasisVectors( B );</span>
[ [ 1, 0, -1 ], [ 0, 1, 2 ] ]
</pre></div>

<p><a id="X8786D40B84120F38" name="X8786D40B84120F38"></a></p>

<h5>61.5-4 RelativeBasis</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; RelativeBasis</code>( <var class="Arg">B</var>, <var class="Arg">vectors</var> )</td><td class="tdright">( operation )</td></tr></table></div>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; RelativeBasisNC</code>( <var class="Arg">B</var>, <var class="Arg">vectors</var> )</td><td class="tdright">( operation )</td></tr></table></div>
<p>A relative basis is a basis of the free left module <var class="Arg">V</var> that delegates the computation of coefficients etc. to another basis of <var class="Arg">V</var> via a basechange matrix.</p>

<p>Let <var class="Arg">B</var> be a basis of the free left module <var class="Arg">V</var>, and <var class="Arg">vectors</var> a list of vectors in <var class="Arg">V</var>.</p>

<p><code class="func">RelativeBasis</code> checks whether <var class="Arg">vectors</var> form a basis of <var class="Arg">V</var>, and in this case a basis is returned in which <var class="Arg">vectors</var> are the basis vectors; otherwise <code class="keyw">fail</code> is returned.</p>

<p><code class="func">RelativeBasisNC</code> does the same, except that it omits the check.</p>

<p><a id="X839B9C4880EBFB5F" name="X839B9C4880EBFB5F"></a></p>

<h4>61.6 <span class="Heading">Operations for Vector Space Bases</span></h4>

<p><a id="X7B1F17AE8027A590" name="X7B1F17AE8027A590"></a></p>

<h5>61.6-1 BasisVectors</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; BasisVectors</code>( <var class="Arg">B</var> )</td><td class="tdright">( attribute )</td></tr></table></div>
<p>For a vector space basis <var class="Arg">B</var>, <code class="code">BasisVectors</code> returns the list of basis vectors of <var class="Arg">B</var>. The lists <var class="Arg">B</var> and <code class="code">BasisVectors( <var class="Arg">B</var> )</code> are equal; the main purpose of <code class="code">BasisVectors</code> is to provide access to a list of vectors that does <em>not</em> know about an underlying vector space.</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">V:= VectorSpace( Rationals, [ [ 1, 2, 7 ], [ 1/2, 1/3, 5 ] ] );;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">B:= Basis( V, [ [ 1, 2, 7 ], [ 0, 1, -9/4 ] ] );;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">BasisVectors( B );</span>
[ [ 1, 2, 7 ], [ 0, 1, -9/4 ] ]
</pre></div>

<p><a id="X81E8AE88843B70FF" name="X81E8AE88843B70FF"></a></p>

<h5>61.6-2 UnderlyingLeftModule</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; UnderlyingLeftModule</code>( <var class="Arg">B</var> )</td><td class="tdright">( attribute )</td></tr></table></div>
<p>For a basis <var class="Arg">B</var> of a free left module <span class="SimpleMath">V</span>, say, <code class="func">UnderlyingLeftModule</code> returns <span class="SimpleMath">V</span>.</p>

<p>The reason why a basis stores a free left module is that otherwise one would have to store the basis vectors and the coefficient domain separately. Storing the module allows one for example to deal with bases whose basis vectors have not yet been computed yet (see <code class="func">Basis</code> (<a href="chap61.html#X837BE54C80DE368E"><span class="RefLink">61.5-2</span></a>)); furthermore, in some cases it is convenient to test membership of a vector in the module before computing coefficients w.r.t. a basis.</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">B:= Basis( GF(2)^6 );;  UnderlyingLeftModule( B );</span>
( GF(2)^6 )
</pre></div>

<p><a id="X80B32F667BF6AFD8" name="X80B32F667BF6AFD8"></a></p>

<h5>61.6-3 Coefficients</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; Coefficients</code>( <var class="Arg">B</var>, <var class="Arg">v</var> )</td><td class="tdright">( operation )</td></tr></table></div>
<p>Let <span class="SimpleMath">V</span> be the underlying left module of the basis <var class="Arg">B</var>, and <var class="Arg">v</var> a vector such that the family of <var class="Arg">v</var> is the elements family of the family of <span class="SimpleMath">V</span>. Then <code class="code">Coefficients( <var class="Arg">B</var>, <var class="Arg">v</var> )</code> is the list of coefficients of <var class="Arg">v</var> w.r.t. <var class="Arg">B</var> if <var class="Arg">v</var> lies in <span class="SimpleMath">V</span>, and <code class="keyw">fail</code> otherwise.</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">V:= VectorSpace( Rationals, [ [ 1, 2, 7 ], [ 1/2, 1/3, 5 ] ] );;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">B:= Basis( V, [ [ 1, 2, 7 ], [ 0, 1, -9/4 ] ] );;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Coefficients( B, [ 1/2, 1/3, 5 ] );</span>
[ 1/2, -2/3 ]
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Coefficients( B, [ 1, 0, 0 ] );</span>
fail
</pre></div>

<p><a id="X7D305AB3834889BF" name="X7D305AB3834889BF"></a></p>

<h5>61.6-4 LinearCombination</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; LinearCombination</code>( <var class="Arg">B</var>, <var class="Arg">coeff</var> )</td><td class="tdright">( operation )</td></tr></table></div>
<p>If <var class="Arg">B</var> is a basis object (see <code class="func">IsBasis</code> (<a href="chap61.html#X8739510881F5D862"><span class="RefLink">61.5-1</span></a>)) or a homogeneous list of length <span class="SimpleMath">n</span>, say, and <var class="Arg">coeff</var> is a row vector of the same length, <code class="func">LinearCombination</code> returns the vector <span class="SimpleMath">∑_{i = 1}^n <var class="Arg">coeff</var>[i] * <var class="Arg">B</var>[i]</span>.</p>

<p>Perhaps the most important usage is the case where <var class="Arg">B</var> forms a basis.</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">V:= VectorSpace( Rationals, [ [ 1, 2, 7 ], [ 1/2, 1/3, 5 ] ] );;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">B:= Basis( V, [ [ 1, 2, 7 ], [ 0, 1, -9/4 ] ] );;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">LinearCombination( B, [ 1/2, -2/3 ] );</span>
[ 1/2, 1/3, 5 ]
</pre></div>

<p><a id="X7EB0D16A7EC2DEE3" name="X7EB0D16A7EC2DEE3"></a></p>

<h5>61.6-5 EnumeratorByBasis</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; EnumeratorByBasis</code>( <var class="Arg">B</var> )</td><td class="tdright">( attribute )</td></tr></table></div>
<p>For a basis <var class="Arg">B</var> of the free left <span class="SimpleMath">F</span>-module <span class="SimpleMath">V</span> of dimension <span class="SimpleMath">n</span>, say, <code class="code">EnumeratorByBasis</code> returns an enumerator that loops over the elements of <span class="SimpleMath">V</span> as linear combinations of the vectors of <var class="Arg">B</var> with coefficients the row vectors in the full row space (see <code class="func">FullRowSpace</code> (<a href="chap61.html#X80209A8785126AAB"><span class="RefLink">61.9-4</span></a>)) of dimension <span class="SimpleMath">n</span> over <span class="SimpleMath">F</span>, in the succession given by the default enumerator of this row space.</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">V:= GF(2)^3;;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">enum:= EnumeratorByBasis( CanonicalBasis( V ) );;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Print( enum{ [ 1 .. 4 ] }, "\n" );</span>
[ [ 0*Z(2), 0*Z(2), 0*Z(2) ], [ 0*Z(2), 0*Z(2), Z(2)^0 ], 
  [ 0*Z(2), Z(2)^0, 0*Z(2) ], [ 0*Z(2), Z(2)^0, Z(2)^0 ] ]
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">B:= Basis( V, [ [ 1, 1, 1 ], [ 1, 1, 0 ], [ 1, 0, 0 ] ] * Z(2) );;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">enum:= EnumeratorByBasis( B );;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Print( enum{ [ 1 .. 4 ] }, "\n" );</span>
[ [ 0*Z(2), 0*Z(2), 0*Z(2) ], [ Z(2)^0, 0*Z(2), 0*Z(2) ], 
  [ Z(2)^0, Z(2)^0, 0*Z(2) ], [ 0*Z(2), Z(2)^0, 0*Z(2) ] ]
</pre></div>

<p><a id="X855625D47979005D" name="X855625D47979005D"></a></p>

<h5>61.6-6 IteratorByBasis</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; IteratorByBasis</code>( <var class="Arg">B</var> )</td><td class="tdright">( operation )</td></tr></table></div>
<p>For a basis <var class="Arg">B</var> of the free left <span class="SimpleMath">F</span>-module <span class="SimpleMath">V</span> of dimension <span class="SimpleMath">n</span>, say, <code class="code">IteratorByBasis</code> returns an iterator that loops over the elements of <span class="SimpleMath">V</span> as linear combinations of the vectors of <var class="Arg">B</var> with coefficients the row vectors in the full row space (see <code class="func">FullRowSpace</code> (<a href="chap61.html#X80209A8785126AAB"><span class="RefLink">61.9-4</span></a>)) of dimension <span class="SimpleMath">n</span> over <span class="SimpleMath">F</span>, in the succession given by the default enumerator of this row space.</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">V:= GF(2)^3;;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">iter:= IteratorByBasis( CanonicalBasis( V ) );;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">for i in [ 1 .. 4 ] do Print( NextIterator( iter ), "\n" ); od;</span>
[ 0*Z(2), 0*Z(2), 0*Z(2) ]
[ 0*Z(2), 0*Z(2), Z(2)^0 ]
[ 0*Z(2), Z(2)^0, 0*Z(2) ]
[ 0*Z(2), Z(2)^0, Z(2)^0 ]
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">B:= Basis( V, [ [ 1, 1, 1 ], [ 1, 1, 0 ], [ 1, 0, 0 ] ] * Z(2) );;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">iter:= IteratorByBasis( B );;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">for i in [ 1 .. 4 ] do Print( NextIterator( iter ), "\n" ); od;</span>
[ 0*Z(2), 0*Z(2), 0*Z(2) ]
[ Z(2)^0, 0*Z(2), 0*Z(2) ]
[ Z(2)^0, Z(2)^0, 0*Z(2) ]
[ 0*Z(2), Z(2)^0, 0*Z(2) ]
</pre></div>

<p><a id="X82809D6C82DE4EC2" name="X82809D6C82DE4EC2"></a></p>

<h4>61.7 <span class="Heading">Operations for Special Kinds of Bases</span></h4>

<p><a id="X7CC2B3DD81628CE9" name="X7CC2B3DD81628CE9"></a></p>

<h5>61.7-1 IsCanonicalBasis</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; IsCanonicalBasis</code>( <var class="Arg">B</var> )</td><td class="tdright">( property )</td></tr></table></div>
<p>If the underlying free left module <span class="SimpleMath">V</span> of the basis <var class="Arg">B</var> supports a canonical basis (see <code class="func">CanonicalBasis</code> (<a href="chap61.html#X7C8EBFF5805F8C51"><span class="RefLink">61.5-3</span></a>)) then <code class="func">IsCanonicalBasis</code> returns <code class="keyw">true</code> if <var class="Arg">B</var> is equal to the canonical basis of <span class="SimpleMath">V</span>, and <code class="keyw">false</code> otherwise.</p>

<p><a id="X86DE147F8606B739" name="X86DE147F8606B739"></a></p>

<h5>61.7-2 IsIntegralBasis</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; IsIntegralBasis</code>( <var class="Arg">B</var> )</td><td class="tdright">( property )</td></tr></table></div>
<p>Let <var class="Arg">B</var> be an <span class="SimpleMath">S</span>-basis of a <em>field</em> <span class="SimpleMath">F</span>, say, for a subfield <span class="SimpleMath">S</span> of <span class="SimpleMath">F</span>, and let <span class="SimpleMath">R</span> and <span class="SimpleMath">M</span> be the rings of algebraic integers in <span class="SimpleMath">S</span> and <span class="SimpleMath">F</span>, respectively. <code class="code">IsIntegralBasis</code> returns <code class="keyw">true</code> if <var class="Arg">B</var> is also an <span class="SimpleMath">R</span>-basis of <span class="SimpleMath">M</span>, and <code class="keyw">false</code> otherwise.</p>

<p><a id="X7FC051C579D61223" name="X7FC051C579D61223"></a></p>

<h5>61.7-3 IsNormalBasis</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; IsNormalBasis</code>( <var class="Arg">B</var> )</td><td class="tdright">( property )</td></tr></table></div>
<p>Let <var class="Arg">B</var> be an <span class="SimpleMath">S</span>-basis of a <em>field</em> <span class="SimpleMath">F</span>, say, for a subfield <span class="SimpleMath">S</span> of <span class="SimpleMath">F</span>. <code class="code">IsNormalBasis</code> returns <code class="keyw">true</code> if <var class="Arg">B</var> is invariant under the Galois group (see <code class="func">GaloisGroup</code> (<a href="chap58.html#X80CAA5BA82F09ED2"><span class="RefLink">58.3-1</span></a>)) of the field extension <span class="SimpleMath">F / S</span>, and <code class="keyw">false</code> otherwise.</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">B:= CanonicalBasis( GaussianRationals );</span>
CanonicalBasis( GaussianRationals )
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">IsIntegralBasis( B );  IsNormalBasis( B );</span>
true
false
</pre></div>

<p><a id="X7C11B9C3819F3EA2" name="X7C11B9C3819F3EA2"></a></p>

<h4>61.8 <span class="Heading">Mutable Bases</span></h4>

<p>It is useful to have a <em>mutable basis</em> of a free module when successively closures with new vectors are formed, since one does not want to create a new module and a corresponding basis for each step.</p>

<p>Note that the situation here is different from the situation with stabilizer chains, which are (mutable or immutable) records that do not need to know about the groups they describe, whereas each (immutable) basis stores the underlying left module (see <code class="func">UnderlyingLeftModule</code> (<a href="chap61.html#X81E8AE88843B70FF"><span class="RefLink">61.6-2</span></a>)).</p>

<p>So immutable bases and mutable bases are different categories of objects. The only thing they have in common is that one can ask both for their basis vectors and for the coefficients of a given vector.</p>

<p>Since <code class="code">Immutable</code> produces an immutable copy of any <strong class="pkg">GAP</strong> object, it would in principle be possible to construct a mutable basis that is in fact immutable. In the sequel, we will deal only with mutable bases that are in fact <em>mutable</em> <strong class="pkg">GAP</strong> objects, hence these objects are unable to store attribute values.</p>

<p>Basic operations for immutable bases are <code class="func">NrBasisVectors</code> (<a href="chap61.html#X7EC90F4F7BCAF8D4"><span class="RefLink">61.8-3</span></a>), <code class="func">IsContainedInSpan</code> (<a href="chap61.html#X85B50AC77A22108B"><span class="RefLink">61.8-5</span></a>), <code class="func">CloseMutableBasis</code> (<a href="chap61.html#X7B52C99B84316F61"><span class="RefLink">61.8-6</span></a>), <code class="func">ImmutableBasis</code> (<a href="chap61.html#X7BA87512823A8CFD"><span class="RefLink">61.8-4</span></a>), <code class="func">Coefficients</code> (<a href="chap61.html#X80B32F667BF6AFD8"><span class="RefLink">61.6-3</span></a>), and <code class="func">BasisVectors</code> (<a href="chap61.html#X7B1F17AE8027A590"><span class="RefLink">61.6-1</span></a>). <code class="func">ShallowCopy</code> (<a href="chap12.html#X846BC7107C352031"><span class="RefLink">12.7-1</span></a>) for a mutable basis returns a mutable plain list containing the current basis vectors.</p>

<p>Since mutable bases do not admit arbitrary changes of their lists of basis vectors, a mutable basis is <em>not</em> a list. It is, however, a collection, more precisely its family (see <a href="chap13.html#X846063757EC05986"><span class="RefLink">13.1</span></a>) equals the family of its collection of basis vectors.</p>

<p>Mutable bases can be constructed with <code class="code">MutableBasis</code>.</p>

<p>Similar to the situation with bases (cf. <a href="chap61.html#X828AA09B87F14FAD"><span class="RefLink">61.5</span></a>), <strong class="pkg">GAP</strong> supports the following three kinds of mutable bases.</p>

<p>The <em>generic method</em> of <code class="code">MutableBasis</code> returns a mutable basis that simply stores an immutable basis; clearly one wants to avoid this whenever possible with reasonable effort.</p>

<p>There are mutable bases that store a mutable basis for a nicer module. Note that this is meaningful only if the mechanism of computing nice and ugly vectors (see <a href="chap61.html#X81503EB77FCE648D"><span class="RefLink">61.11</span></a>) is invariant under closures of the basis; this is the case for example if the vectors are matrices, Lie objects, or elements of structure constants algebras.</p>

<p>There are mutable bases that use special information to perform their tasks; examples are mutable bases of Gaussian row and matrix spaces.</p>

<p><a id="X7F466FB47F7E9F00" name="X7F466FB47F7E9F00"></a></p>

<h5>61.8-1 IsMutableBasis</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; IsMutableBasis</code>( <var class="Arg">MB</var> )</td><td class="tdright">( category )</td></tr></table></div>
<p>Every mutable basis lies in the category <code class="code">IsMutableBasis</code>.</p>

<p><a id="X8115C061819E5172" name="X8115C061819E5172"></a></p>

<h5>61.8-2 MutableBasis</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; MutableBasis</code>( <var class="Arg">R</var>, <var class="Arg">vectors</var>[, <var class="Arg">zero</var>] )</td><td class="tdright">( operation )</td></tr></table></div>
<p><code class="code">MutableBasis</code> returns a mutable basis for the <var class="Arg">R</var>-free module generated by the vectors in the list <var class="Arg">vectors</var>. The optional argument <var class="Arg">zero</var> is the zero vector of the module; it must be given if <var class="Arg">vectors</var> is empty.</p>

<p><em>Note</em> that <var class="Arg">vectors</var> will in general <em>not</em> be the basis vectors of the mutable basis!</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">MB:= MutableBasis( Rationals, [ [ 1, 2, 3 ], [ 0, 1, 0 ] ] );</span>
&lt;mutable basis over Rationals, 2 vectors&gt;
</pre></div>

<p><a id="X7EC90F4F7BCAF8D4" name="X7EC90F4F7BCAF8D4"></a></p>

<h5>61.8-3 NrBasisVectors</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; NrBasisVectors</code>( <var class="Arg">MB</var> )</td><td class="tdright">( operation )</td></tr></table></div>
<p>For a mutable basis <var class="Arg">MB</var>, <code class="code">NrBasisVectors</code> returns the current number of basis vectors of <var class="Arg">MB</var>. Note that this operation is <em>not</em> an attribute, as it makes no sense to store the value. <code class="code">NrBasisVectors</code> is used mainly as an equivalent of <code class="code">Dimension</code> for the underlying left module in the case of immutable bases.</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">MB:= MutableBasis( Rationals, [ [ 1, 1], [ 2, 2 ] ] );;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">NrBasisVectors( MB );</span>
1
</pre></div>

<p><a id="X7BA87512823A8CFD" name="X7BA87512823A8CFD"></a></p>

<h5>61.8-4 ImmutableBasis</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; ImmutableBasis</code>( <var class="Arg">MB</var>[, <var class="Arg">V</var>] )</td><td class="tdright">( operation )</td></tr></table></div>
<p><code class="func">ImmutableBasis</code> returns the immutable basis <span class="SimpleMath">B</span>, say, with the same basis vectors as in the mutable basis <var class="Arg">MB</var>.</p>

<p>If the second argument <var class="Arg">V</var> is present then <var class="Arg">V</var> is the value of <code class="func">UnderlyingLeftModule</code> (<a href="chap61.html#X81E8AE88843B70FF"><span class="RefLink">61.6-2</span></a>) for <span class="SimpleMath">B</span>. The second variant is used mainly for the case that one knows the module for the desired basis in advance, and if it has a nicer structure than the module known to <var class="Arg">MB</var>, for example if it is an algebra.</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">MB:= MutableBasis( Rationals, [ [ 1, 1 ], [ 2, 2 ] ] );;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">B:= ImmutableBasis( MB );</span>
SemiEchelonBasis( &lt;vector space of dimension 1 over Rationals&gt;, 
[ [ 1, 1 ] ] )
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">UnderlyingLeftModule( B );</span>
&lt;vector space of dimension 1 over Rationals&gt;
</pre></div>

<p><a id="X85B50AC77A22108B" name="X85B50AC77A22108B"></a></p>

<h5>61.8-5 IsContainedInSpan</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; IsContainedInSpan</code>( <var class="Arg">MB</var>, <var class="Arg">v</var> )</td><td class="tdright">( operation )</td></tr></table></div>
<p>For a mutable basis <var class="Arg">MB</var> over the coefficient ring <span class="SimpleMath">R</span>, say, and a vector <var class="Arg">v</var>, <code class="code">IsContainedInSpan</code> returns <code class="keyw">true</code> is <var class="Arg">v</var> lies in the <span class="SimpleMath">R</span>-span of the current basis vectors of <var class="Arg">MB</var>, and <code class="keyw">false</code> otherwise.</p>

<p><a id="X7B52C99B84316F61" name="X7B52C99B84316F61"></a></p>

<h5>61.8-6 CloseMutableBasis</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; CloseMutableBasis</code>( <var class="Arg">MB</var>, <var class="Arg">v</var> )</td><td class="tdright">( operation )</td></tr></table></div>
<p>For a mutable basis <var class="Arg">MB</var> over the coefficient ring <span class="SimpleMath">R</span>, say, and a vector <var class="Arg">v</var>, <code class="code">CloseMutableBasis</code> changes <var class="Arg">MB</var> such that afterwards it describes the <span class="SimpleMath">R</span>-span of the former basis vectors together with <var class="Arg">v</var>.</p>

<p><em>Note</em> that if <var class="Arg">v</var> enlarges the dimension then this does in general <em>not</em> mean that <var class="Arg">v</var> is simply added to the basis vectors of <var class="Arg">MB</var>. Usually a linear combination of <var class="Arg">v</var> and the other basis vectors is added, and also the old basis vectors may be modified, for example in order to keep the list of basis vectors echelonized (see <code class="func">IsSemiEchelonized</code> (<a href="chap61.html#X865A540F85FAE2DF"><span class="RefLink">61.9-7</span></a>)).</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">MB:= MutableBasis( Rationals, [ [ 1, 1, 3 ], [ 2, 2, 1 ] ] );</span>
&lt;mutable basis over Rationals, 2 vectors&gt;
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">IsContainedInSpan( MB, [ 1, 0, 0 ] );</span>
false
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">CloseMutableBasis( MB, [ 1, 0, 0 ] );</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">MB;</span>
&lt;mutable basis over Rationals, 3 vectors&gt;
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">IsContainedInSpan( MB, [ 1, 0, 0 ] );</span>
true
</pre></div>

<p><a id="X7D937EBC7DE2819B" name="X7D937EBC7DE2819B"></a></p>

<h4>61.9 <span class="Heading">Row and Matrix Spaces</span></h4>

<p><a id="X79B305CE87511C4B" name="X79B305CE87511C4B"></a></p>

<h5>61.9-1 IsRowSpace</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; IsRowSpace</code>( <var class="Arg">V</var> )</td><td class="tdright">( function )</td></tr></table></div>
<p>A <em>row space</em> in <strong class="pkg">GAP</strong> is a vector space that consists of row vectors (see Chapter <a href="chap23.html#X82C7E6CF7BA03391"><span class="RefLink">23</span></a>).</p>

<p><a id="X7A2BBBA07B2BE8F8" name="X7A2BBBA07B2BE8F8"></a></p>

<h5>61.9-2 IsMatrixSpace</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; IsMatrixSpace</code>( <var class="Arg">V</var> )</td><td class="tdright">( function )</td></tr></table></div>
<p>A <em>matrix space</em> in <strong class="pkg">GAP</strong> is a vector space that consists of matrices (see Chapter <a href="chap24.html#X812CCAB278643A59"><span class="RefLink">24</span></a>).</p>

<p><a id="X83724C157F4FDFB4" name="X83724C157F4FDFB4"></a></p>

<h5>61.9-3 IsGaussianSpace</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; IsGaussianSpace</code>( <var class="Arg">V</var> )</td><td class="tdright">( function )</td></tr></table></div>
<p>The filter <code class="func">IsGaussianSpace</code> (see <a href="chap13.html#X84EFA4C07D4277BB"><span class="RefLink">13.2</span></a>) for the row space (see <code class="func">IsRowSpace</code> (<a href="chap61.html#X79B305CE87511C4B"><span class="RefLink">61.9-1</span></a>)) or matrix space (see <code class="func">IsMatrixSpace</code> (<a href="chap61.html#X7A2BBBA07B2BE8F8"><span class="RefLink">61.9-2</span></a>)) <var class="Arg">V</var> over the field <span class="SimpleMath">F</span>, say, indicates that the entries of all row vectors or matrices in <var class="Arg">V</var>, respectively, are all contained in <span class="SimpleMath">F</span>. In this case, <var class="Arg">V</var> is called a <em>Gaussian</em> vector space. Bases for Gaussian spaces can be computed using Gaussian elimination for a given list of vector space generators.</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">mats:= [ [[1,1],[2,2]], [[3,4],[0,1]] ];;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">V:= VectorSpace( Rationals, mats );;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">IsGaussianSpace( V );</span>
true
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">mats[1][1][1]:= E(4);;   # an element in an extension field</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">V:= VectorSpace( Rationals, mats );;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">IsGaussianSpace( V );</span>
false
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">V:= VectorSpace( Field( Rationals, [ E(4) ] ), mats );;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">IsGaussianSpace( V );</span>
true
</pre></div>

<p><a id="X80209A8785126AAB" name="X80209A8785126AAB"></a></p>

<h5>61.9-4 FullRowSpace</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; FullRowSpace</code>( <var class="Arg">F</var>, <var class="Arg">n</var> )</td><td class="tdright">( function )</td></tr></table></div>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; \^</code>( <var class="Arg">F</var>, <var class="Arg">n</var> )</td><td class="tdright">( method )</td></tr></table></div>
<p>For a field <var class="Arg">F</var> and a nonnegative integer <var class="Arg">n</var>, <code class="func">FullRowSpace</code> returns the <var class="Arg">F</var>-vector space that consists of all row vectors (see <code class="func">IsRowVector</code> (<a href="chap23.html#X7DFB22A07836A7A9"><span class="RefLink">23.1-1</span></a>)) of length <var class="Arg">n</var> with entries in <var class="Arg">F</var>.</p>

<p>An alternative to construct this vector space is via <var class="Arg">F</var><code class="code">^</code><var class="Arg">n</var>.</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">FullRowSpace( GF( 9 ), 3 );</span>
( GF(3^2)^3 )
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">GF(9)^3;           # the same as above</span>
( GF(3^2)^3 )
</pre></div>

<p><a id="X876B66C37A7B749F" name="X876B66C37A7B749F"></a></p>

<h5>61.9-5 FullMatrixSpace</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; FullMatrixSpace</code>( <var class="Arg">F</var>, <var class="Arg">m</var>, <var class="Arg">n</var> )</td><td class="tdright">( function )</td></tr></table></div>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; \^</code>( <var class="Arg">F</var>, <var class="Arg">dims</var> )</td><td class="tdright">( method )</td></tr></table></div>
<p>For a field <var class="Arg">F</var> and two positive integers <var class="Arg">m</var> and <var class="Arg">n</var>, <code class="func">FullMatrixSpace</code> returns the <var class="Arg">F</var>-vector space that consists of all <var class="Arg">m</var> by <var class="Arg">n</var> matrices (see <code class="func">IsMatrix</code> (<a href="chap24.html#X7E1AE46B862B185F"><span class="RefLink">24.2-1</span></a>)) with entries in <var class="Arg">F</var>.</p>

<p>If <var class="Arg">m</var><code class="code"> = </code><var class="Arg">n</var> then the result is in fact an algebra (see <code class="func">FullMatrixAlgebra</code> (<a href="chap62.html#X7D88E42B7DE087B0"><span class="RefLink">62.5-4</span></a>)).</p>

<p>An alternative to construct this vector space is via <var class="Arg">F</var><code class="code">^[</code><var class="Arg">m</var>,<var class="Arg">n</var><code class="code">]</code>.</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">FullMatrixSpace( GF(2), 4, 5 );</span>
( GF(2)^[ 4, 5 ] )
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">GF(2)^[ 4, 5 ];    # the same as above</span>
( GF(2)^[ 4, 5 ] )
</pre></div>

<p><a id="X8534A750878478D0" name="X8534A750878478D0"></a></p>

<h5>61.9-6 DimensionOfVectors</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; DimensionOfVectors</code>( <var class="Arg">M</var> )</td><td class="tdright">( attribute )</td></tr></table></div>
<p>For a left module <var class="Arg">M</var> that consists of row vectors (see <code class="func">IsRowModule</code> (<a href="chap57.html#X7C8F844783F4FA09"><span class="RefLink">57.3-6</span></a>)), <code class="func">DimensionOfVectors</code> returns the common length of all row vectors in <var class="Arg">M</var>. For a left module <var class="Arg">M</var> that consists of matrices (see <code class="func">IsMatrixModule</code> (<a href="chap57.html#X81FCC1D780435CF1"><span class="RefLink">57.3-7</span></a>)), <code class="func">DimensionOfVectors</code> returns the common matrix dimensions (see <code class="func">DimensionsMat</code> (<a href="chap24.html#X83A9DC2085D3A972"><span class="RefLink">24.4-1</span></a>)) of all matrices in <var class="Arg">M</var>.</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">DimensionOfVectors( GF(2)^5 );</span>
5
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">DimensionOfVectors( GF(2)^[2,3] );</span>
[ 2, 3 ]
</pre></div>

<p><a id="X865A540F85FAE2DF" name="X865A540F85FAE2DF"></a></p>

<h5>61.9-7 IsSemiEchelonized</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; IsSemiEchelonized</code>( <var class="Arg">B</var> )</td><td class="tdright">( property )</td></tr></table></div>
<p>Let <var class="Arg">B</var> be a basis of a Gaussian row or matrix space <span class="SimpleMath">V</span>, say (see <code class="func">IsGaussianSpace</code> (<a href="chap61.html#X83724C157F4FDFB4"><span class="RefLink">61.9-3</span></a>)) over the field <span class="SimpleMath">F</span>.</p>

<p>If <span class="SimpleMath">V</span> is a row space then <var class="Arg">B</var> is semi-echelonized if the matrix formed by its basis vectors has the property that the first nonzero element in each row is the identity of <span class="SimpleMath">F</span>, and all values exactly below these pivot elements are the zero of <span class="SimpleMath">F</span> (cf. <code class="func">SemiEchelonMat</code> (<a href="chap24.html#X7D5D6BD07B7E981B"><span class="RefLink">24.10-1</span></a>)).</p>

<p>If <span class="SimpleMath">V</span> is a matrix space then <var class="Arg">B</var> is semi-echelonized if the matrix obtained by replacing each basis vector by the concatenation of its rows is semi-echelonized (see above, cf. <code class="func">SemiEchelonMats</code> (<a href="chap24.html#X827D7971800DB661"><span class="RefLink">24.10-4</span></a>)).</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">V:= GF(2)^2;;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">B1:= Basis( V, [ [ 0, 1 ], [ 1, 0 ] ] * Z(2) );;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">IsSemiEchelonized( B1 );</span>
true
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">B2:= Basis( V, [ [ 0, 1 ], [ 1, 1 ] ] * Z(2) );;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">IsSemiEchelonized( B2 );</span>
false
</pre></div>

<p><a id="X87DCA09579589106" name="X87DCA09579589106"></a></p>

<h5>61.9-8 SemiEchelonBasis</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; SemiEchelonBasis</code>( <var class="Arg">V</var>[, <var class="Arg">vectors</var>] )</td><td class="tdright">( attribute )</td></tr></table></div>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; SemiEchelonBasisNC</code>( <var class="Arg">V</var>, <var class="Arg">vectors</var> )</td><td class="tdright">( operation )</td></tr></table></div>
<p>Let <var class="Arg">V</var> be a Gaussian row or matrix vector space over the field <span class="SimpleMath">F</span> (see <code class="func">IsGaussianSpace</code> (<a href="chap61.html#X83724C157F4FDFB4"><span class="RefLink">61.9-3</span></a>), <code class="func">IsRowSpace</code> (<a href="chap61.html#X79B305CE87511C4B"><span class="RefLink">61.9-1</span></a>), <code class="func">IsMatrixSpace</code> (<a href="chap61.html#X7A2BBBA07B2BE8F8"><span class="RefLink">61.9-2</span></a>)).</p>

<p>Called with <var class="Arg">V</var> as the only argument, <code class="func">SemiEchelonBasis</code> returns a basis of <var class="Arg">V</var> that has the property <code class="func">IsSemiEchelonized</code> (<a href="chap61.html#X865A540F85FAE2DF"><span class="RefLink">61.9-7</span></a>).</p>

<p>If additionally a list <var class="Arg">vectors</var> of vectors in <var class="Arg">V</var> is given that forms a semi-echelonized basis of <var class="Arg">V</var> then <code class="func">SemiEchelonBasis</code> returns this basis; if <var class="Arg">vectors</var> do not form a basis of <var class="Arg">V</var> then <code class="keyw">fail</code> is returned.</p>

<p><code class="func">SemiEchelonBasisNC</code> does the same as the two argument version of <code class="func">SemiEchelonBasis</code>, except that it is not checked whether <var class="Arg">vectors</var> form a semi-echelonized basis.</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">V:= GF(2)^2;;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">B:= SemiEchelonBasis( V );</span>
SemiEchelonBasis( ( GF(2)^2 ), ... )
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Print( BasisVectors( B ), "\n" );</span>
[ [ Z(2)^0, 0*Z(2) ], [ 0*Z(2), Z(2)^0 ] ]
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">B:= SemiEchelonBasis( V, [ [ 1, 1 ], [ 0, 1 ] ] * Z(2) );</span>
SemiEchelonBasis( ( GF(2)^2 ), &lt;an immutable 2x2 matrix over GF2&gt; )
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Print( BasisVectors( B ), "\n" );</span>
[ [ Z(2)^0, Z(2)^0 ], [ 0*Z(2), Z(2)^0 ] ]
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Coefficients( B, [ 0, 1 ] * Z(2) );</span>
[ 0*Z(2), Z(2)^0 ]
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Coefficients( B, [ 1, 0 ] * Z(2) );</span>
[ Z(2)^0, Z(2)^0 ]
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">SemiEchelonBasis( V, [ [ 0, 1 ], [ 1, 1 ] ] * Z(2) );</span>
fail
</pre></div>

<p><a id="X7C3CC5F97FA048A4" name="X7C3CC5F97FA048A4"></a></p>

<h5>61.9-9 IsCanonicalBasisFullRowModule</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; IsCanonicalBasisFullRowModule</code>( <var class="Arg">B</var> )</td><td class="tdright">( property )</td></tr></table></div>
<p><code class="func">IsCanonicalBasisFullRowModule</code> returns <code class="keyw">true</code> if <var class="Arg">B</var> is the canonical basis (see <code class="func">IsCanonicalBasis</code> (<a href="chap61.html#X7CC2B3DD81628CE9"><span class="RefLink">61.7-1</span></a>)) of a full row module (see <code class="func">IsFullRowModule</code> (<a href="chap57.html#X853E085C868196EF"><span class="RefLink">57.3-8</span></a>)), and <code class="keyw">false</code> otherwise.</p>

<p>The <em>canonical basis</em> of a Gaussian row space is defined as the unique semi-echelonized (see <code class="func">IsSemiEchelonized</code> (<a href="chap61.html#X865A540F85FAE2DF"><span class="RefLink">61.9-7</span></a>)) basis with the additional property that for <span class="SimpleMath">j &gt; i</span> the position of the pivot of row <span class="SimpleMath">j</span> is bigger than the position of the pivot of row <span class="SimpleMath">i</span>, and that each pivot column contains exactly one nonzero entry.</p>

<p><a id="X83D282697C1A3148" name="X83D282697C1A3148"></a></p>

<h5>61.9-10 IsCanonicalBasisFullMatrixModule</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; IsCanonicalBasisFullMatrixModule</code>( <var class="Arg">B</var> )</td><td class="tdright">( property )</td></tr></table></div>
<p><code class="func">IsCanonicalBasisFullMatrixModule</code> returns <code class="keyw">true</code> if <var class="Arg">B</var> is the canonical basis (see <code class="func">IsCanonicalBasis</code> (<a href="chap61.html#X7CC2B3DD81628CE9"><span class="RefLink">61.7-1</span></a>)) of a full matrix module (see <code class="func">IsFullMatrixModule</code> (<a href="chap57.html#X814CEA62842CF5BB"><span class="RefLink">57.3-10</span></a>)), and <code class="keyw">false</code> otherwise.</p>

<p>The <em>canonical basis</em> of a Gaussian matrix space is defined as the unique semi-echelonized (see <code class="func">IsSemiEchelonized</code> (<a href="chap61.html#X865A540F85FAE2DF"><span class="RefLink">61.9-7</span></a>)) basis for which the list of concatenations of the basis vectors forms the canonical basis of the corresponding Gaussian row space.</p>

<p><a id="X7D6537F87E940344" name="X7D6537F87E940344"></a></p>

<h5>61.9-11 NormedRowVectors</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; NormedRowVectors</code>( <var class="Arg">V</var> )</td><td class="tdright">( attribute )</td></tr></table></div>
<p>For a finite Gaussian row space <var class="Arg">V</var> (see <code class="func">IsRowSpace</code> (<a href="chap61.html#X79B305CE87511C4B"><span class="RefLink">61.9-1</span></a>), <code class="func">IsGaussianSpace</code> (<a href="chap61.html#X83724C157F4FDFB4"><span class="RefLink">61.9-3</span></a>)), <code class="func">NormedRowVectors</code> returns a list of those nonzero vectors in <var class="Arg">V</var> that have a one in the first nonzero component.</p>

<p>The result list can be used as action domain for the action of a matrix group via <code class="func">OnLines</code> (<a href="chap41.html#X86DC2DD5829CAD9A"><span class="RefLink">41.2-12</span></a>), which yields the natural action on one-dimensional subspaces of <var class="Arg">V</var> (see also <code class="func">Subspaces</code> (<a href="chap61.html#X7975E41A7B29C3FD"><span class="RefLink">61.4-1</span></a>)).</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">vecs:= NormedRowVectors( GF(3)^2 );</span>
[ [ 0*Z(3), Z(3)^0 ], [ Z(3)^0, 0*Z(3) ], [ Z(3)^0, Z(3)^0 ], 
  [ Z(3)^0, Z(3) ] ]
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Action( GL(2,3), vecs, OnLines );</span>
Group([ (3,4), (1,2,4) ])
</pre></div>

<p><a id="X815C69A57C042C34" name="X815C69A57C042C34"></a></p>

<h5>61.9-12 SiftedVector</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; SiftedVector</code>( <var class="Arg">B</var>, <var class="Arg">v</var> )</td><td class="tdright">( operation )</td></tr></table></div>
<p>Let <var class="Arg">B</var> be a semi-echelonized basis (see <code class="func">IsSemiEchelonized</code> (<a href="chap61.html#X865A540F85FAE2DF"><span class="RefLink">61.9-7</span></a>)) of a Gaussian row or matrix space <span class="SimpleMath">V</span> (see <code class="func">IsGaussianSpace</code> (<a href="chap61.html#X83724C157F4FDFB4"><span class="RefLink">61.9-3</span></a>)), and <var class="Arg">v</var> a row vector or matrix, respectively, of the same dimension as the elements in <span class="SimpleMath">V</span>. <code class="code">SiftedVector</code> returns the <em>residuum</em> of <var class="Arg">v</var> with respect to <var class="Arg">B</var>, which is obtained by successively cleaning the pivot positions in <var class="Arg">v</var> by subtracting multiples of the basis vectors in <var class="Arg">B</var>. So the result is the zero vector in <span class="SimpleMath">V</span> if and only if <var class="Arg">v</var> lies in <span class="SimpleMath">V</span>.</p>

<p><var class="Arg">B</var> may also be a mutable basis (see <a href="chap61.html#X7C11B9C3819F3EA2"><span class="RefLink">61.8</span></a>) of a Gaussian row or matrix space.</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">V:= VectorSpace( Rationals, [ [ 1, 2, 7 ], [ 1/2, 1/3, 5 ] ] );;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">B:= Basis( V );;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">SiftedVector( B, [ 1, 2, 8 ] );</span>
[ 0, 0, 1 ]
</pre></div>

<p><a id="X7F61CECA84CEF39D" name="X7F61CECA84CEF39D"></a></p>

<h4>61.10 <span class="Heading">Vector Space Homomorphisms</span></h4>

<p><em>Vector space homomorphisms</em> (or <em>linear mappings</em>) are defined in Section <a href="chap32.html#X7C24431C81532575"><span class="RefLink">32.11</span></a>. <strong class="pkg">GAP</strong> provides special functions to construct a particular linear mapping from images of given elements in the source, from a matrix of coefficients, or as a natural epimorphism.</p>

<p><span class="SimpleMath">F</span>-linear mappings with same source and same range can be added, so one can form vector spaces of linear mappings.</p>

<p><a id="X82013D328645E370" name="X82013D328645E370"></a></p>

<h5>61.10-1 LeftModuleGeneralMappingByImages</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; LeftModuleGeneralMappingByImages</code>( <var class="Arg">V</var>, <var class="Arg">W</var>, <var class="Arg">gens</var>, <var class="Arg">imgs</var> )</td><td class="tdright">( operation )</td></tr></table></div>
<p>Let <var class="Arg">V</var> and <var class="Arg">W</var> be two left modules over the same left acting domain <span class="SimpleMath">R</span>, say, and <var class="Arg">gens</var> and <var class="Arg">imgs</var> lists (of the same length) of elements in <var class="Arg">V</var> and <var class="Arg">W</var>, respectively. <code class="func">LeftModuleGeneralMappingByImages</code> returns the general mapping with source <var class="Arg">V</var> and range <var class="Arg">W</var> that is defined by mapping the elements in <var class="Arg">gens</var> to the corresponding elements in <var class="Arg">imgs</var>, and taking the <span class="SimpleMath">R</span>-linear closure.</p>

<p><var class="Arg">gens</var> need not generate <var class="Arg">V</var> as a left <span class="SimpleMath">R</span>-module, and if the specification does not define a linear mapping then the result will be multi-valued; hence in general it is not a mapping (see <code class="func">IsMapping</code> (<a href="chap32.html#X7CC95EB282854385"><span class="RefLink">32.3-3</span></a>)).</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">V:= Rationals^2;;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">W:= VectorSpace( Rationals, [ [1,2,3], [1,0,1] ] );;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">f:= LeftModuleGeneralMappingByImages( V, W,</span>
<span class="GAPprompt">&gt;</span> <span class="GAPinput">                               [[1,0],[2,0]], [[1,0,1],[1,0,1] ] );</span>
[ [ 1, 0 ], [ 2, 0 ] ] -&gt; [ [ 1, 0, 1 ], [ 1, 0, 1 ] ]
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">IsMapping( f );</span>
false
</pre></div>

<p><a id="X85F5293983E47B5A" name="X85F5293983E47B5A"></a></p>

<h5>61.10-2 LeftModuleHomomorphismByImages</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; LeftModuleHomomorphismByImages</code>( <var class="Arg">V</var>, <var class="Arg">W</var>, <var class="Arg">gens</var>, <var class="Arg">imgs</var> )</td><td class="tdright">( function )</td></tr></table></div>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; LeftModuleHomomorphismByImagesNC</code>( <var class="Arg">V</var>, <var class="Arg">W</var>, <var class="Arg">gens</var>, <var class="Arg">imgs</var> )</td><td class="tdright">( operation )</td></tr></table></div>
<p>Let <var class="Arg">V</var> and <var class="Arg">W</var> be two left modules over the same left acting domain <span class="SimpleMath">R</span>, say, and <var class="Arg">gens</var> and <var class="Arg">imgs</var> lists (of the same length) of elements in <var class="Arg">V</var> and <var class="Arg">W</var>, respectively. <code class="func">LeftModuleHomomorphismByImages</code> returns the left <span class="SimpleMath">R</span>-module homomorphism with source <var class="Arg">V</var> and range <var class="Arg">W</var> that is defined by mapping the elements in <var class="Arg">gens</var> to the corresponding elements in <var class="Arg">imgs</var>.</p>

<p>If <var class="Arg">gens</var> does not generate <var class="Arg">V</var> or if the homomorphism does not exist (i.e., if mapping the generators describes only a multi-valued mapping) then <code class="keyw">fail</code> is returned. For creating a possibly multi-valued mapping from <var class="Arg">V</var> to <var class="Arg">W</var> that respects addition, multiplication, and scalar multiplication, <code class="func">LeftModuleGeneralMappingByImages</code> (<a href="chap61.html#X82013D328645E370"><span class="RefLink">61.10-1</span></a>) can be used.</p>

<p><code class="func">LeftModuleHomomorphismByImagesNC</code> does the same as <code class="func">LeftModuleHomomorphismByImages</code>, except that it omits all checks.</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">V:=Rationals^2;;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">W:=VectorSpace( Rationals, [ [ 1, 0, 1 ], [ 1, 2, 3 ] ] );;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">f:=LeftModuleHomomorphismByImages( V, W,</span>
<span class="GAPprompt">&gt;</span> <span class="GAPinput">[ [ 1, 0 ], [ 0, 1 ] ], [ [ 1, 0, 1 ], [ 1, 2, 3 ] ] );</span>
[ [ 1, 0 ], [ 0, 1 ] ] -&gt; [ [ 1, 0, 1 ], [ 1, 2, 3 ] ]
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Image( f, [1,1] );</span>
[ 2, 2, 4 ]
</pre></div>

<p><a id="X8477E6C3872A6DBB" name="X8477E6C3872A6DBB"></a></p>

<h5>61.10-3 LeftModuleHomomorphismByMatrix</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; LeftModuleHomomorphismByMatrix</code>( <var class="Arg">BS</var>, <var class="Arg">matrix</var>, <var class="Arg">BR</var> )</td><td class="tdright">( operation )</td></tr></table></div>
<p>Let <var class="Arg">BS</var> and <var class="Arg">BR</var> be bases of the left <span class="SimpleMath">R</span>-modules <span class="SimpleMath">V</span> and <span class="SimpleMath">W</span>, respectively. <code class="func">LeftModuleHomomorphismByMatrix</code> returns the <span class="SimpleMath">R</span>-linear mapping from <span class="SimpleMath">V</span> to <span class="SimpleMath">W</span> that is defined by the matrix <var class="Arg">matrix</var>, as follows. The image of the <span class="SimpleMath">i</span>-th basis vector of <var class="Arg">BS</var> is the linear combination of the basis vectors of <var class="Arg">BR</var> with coefficients the <span class="SimpleMath">i</span>-th row of <var class="Arg">matrix</var>.</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">V:= Rationals^2;;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">W:= VectorSpace( Rationals, [ [ 1, 0, 1 ], [ 1, 2, 3 ] ] );;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">f:= LeftModuleHomomorphismByMatrix( Basis( V ),</span>
<span class="GAPprompt">&gt;</span> <span class="GAPinput">[ [ 1, 2 ], [ 3, 1 ] ], Basis( W ) );</span>
&lt;linear mapping by matrix, ( Rationals^
2 ) -&gt; &lt;vector space over Rationals, with 2 generators&gt;&gt;
</pre></div>

<p><a id="X8494AA5D7C3B88AD" name="X8494AA5D7C3B88AD"></a></p>

<h5>61.10-4 NaturalHomomorphismBySubspace</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; NaturalHomomorphismBySubspace</code>( <var class="Arg">V</var>, <var class="Arg">W</var> )</td><td class="tdright">( operation )</td></tr></table></div>
<p>For an <span class="SimpleMath">R</span>-vector space <var class="Arg">V</var> and a subspace <var class="Arg">W</var> of <var class="Arg">V</var>, <code class="func">NaturalHomomorphismBySubspace</code> returns the <span class="SimpleMath">R</span>-linear mapping that is the natural projection of <var class="Arg">V</var> onto the factor space <code class="code"><var class="Arg">V</var> / <var class="Arg">W</var></code>.</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">V:= Rationals^3;;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">W:= VectorSpace( Rationals, [ [ 1, 1, 1 ] ] );;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">f:= NaturalHomomorphismBySubspace( V, W );</span>
&lt;linear mapping by matrix, ( Rationals^3 ) -&gt; ( Rationals^2 )&gt;
</pre></div>

<p><a id="X80015C78876B4F1E" name="X80015C78876B4F1E"></a></p>

<h5>61.10-5 Hom</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; Hom</code>( <var class="Arg">F</var>, <var class="Arg">V</var>, <var class="Arg">W</var> )</td><td class="tdright">( operation )</td></tr></table></div>
<p>For a field <var class="Arg">F</var> and two vector spaces <var class="Arg">V</var> and <var class="Arg">W</var> that can be regarded as <var class="Arg">F</var>-modules (see <code class="func">AsLeftModule</code> (<a href="chap57.html#X7EB3E46D7BC4A35C"><span class="RefLink">57.1-5</span></a>)), <code class="func">Hom</code> returns the <var class="Arg">F</var>-vector space of all <var class="Arg">F</var>-linear mappings from <var class="Arg">V</var> to <var class="Arg">W</var>.</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">V:= Rationals^2;;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">W:= VectorSpace( Rationals, [ [ 1, 0, 1 ], [ 1, 2, 3 ] ] );;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">H:= Hom( Rationals, V, W );</span>
Hom( Rationals, ( Rationals^2 ), &lt;vector space over Rationals, with 
2 generators&gt; )
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Dimension( H );</span>
4
</pre></div>

<p><a id="X8680ADD381ECF879" name="X8680ADD381ECF879"></a></p>

<h5>61.10-6 End</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; End</code>( <var class="Arg">F</var>, <var class="Arg">V</var> )</td><td class="tdright">( operation )</td></tr></table></div>
<p>For a field <var class="Arg">F</var> and a vector space <var class="Arg">V</var> that can be regarded as an <var class="Arg">F</var>-module (see <code class="func">AsLeftModule</code> (<a href="chap57.html#X7EB3E46D7BC4A35C"><span class="RefLink">57.1-5</span></a>)), <code class="func">End</code> returns the <var class="Arg">F</var>-algebra of all <var class="Arg">F</var>-linear mappings from <var class="Arg">V</var> to <var class="Arg">V</var>.</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">A:= End( Rationals, Rationals^2 );</span>
End( Rationals, ( Rationals^2 ) )
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Dimension( A );</span>
4
</pre></div>

<p><a id="X7A9A08EA79259659" name="X7A9A08EA79259659"></a></p>

<h5>61.10-7 IsFullHomModule</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; IsFullHomModule</code>( <var class="Arg">M</var> )</td><td class="tdright">( property )</td></tr></table></div>
<p>A <em>full hom module</em> is a module of all <span class="SimpleMath">R</span>-linear mappings between two left <span class="SimpleMath">R</span>-modules. The function <code class="func">Hom</code> (<a href="chap61.html#X80015C78876B4F1E"><span class="RefLink">61.10-5</span></a>) can be used to construct a full hom module.</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">V:= Rationals^2;;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">W:= VectorSpace( Rationals, [ [ 1, 0, 1 ], [ 1, 2, 3 ] ] );;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">H:= Hom( Rationals, V, W );;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">IsFullHomModule( H );</span>
true
</pre></div>

<p><a id="X7C4737687E76A24A" name="X7C4737687E76A24A"></a></p>

<h5>61.10-8 IsPseudoCanonicalBasisFullHomModule</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; IsPseudoCanonicalBasisFullHomModule</code>( <var class="Arg">B</var> )</td><td class="tdright">( property )</td></tr></table></div>
<p>A basis of a full hom module is called pseudo canonical basis if the matrices of its basis vectors w.r.t. the stored bases of source and range contain exactly one identity entry and otherwise zeros.</p>

<p>Note that this is not a canonical basis (see <code class="func">CanonicalBasis</code> (<a href="chap61.html#X7C8EBFF5805F8C51"><span class="RefLink">61.5-3</span></a>)) because it depends on the stored bases of source and range.</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">IsPseudoCanonicalBasisFullHomModule( Basis( H ) );</span>
true
</pre></div>

<p><a id="X84F87C327A1856F2" name="X84F87C327A1856F2"></a></p>

<h5>61.10-9 IsLinearMappingsModule</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; IsLinearMappingsModule</code>( <var class="Arg">V</var> )</td><td class="tdright">( filter )</td></tr></table></div>
<p>If an <span class="SimpleMath">F</span>-vector space <var class="Arg">V</var> is in the filter <code class="func">IsLinearMappingsModule</code> then this expresses that <var class="Arg">V</var> consists of linear mappings, and that <var class="Arg">V</var> is handled via the mechanism of nice bases (see <a href="chap61.html#X81503EB77FCE648D"><span class="RefLink">61.11</span></a>), in the following way. Let <span class="SimpleMath">S</span> and <span class="SimpleMath">R</span> be the source and the range, respectively, of each mapping in <span class="SimpleMath">V</span>. Then the <code class="func">NiceFreeLeftModuleInfo</code> (<a href="chap61.html#X79350786800C2DD8"><span class="RefLink">61.11-3</span></a>) value of <var class="Arg">V</var> is a record with the components <code class="code">basissource</code> (a basis <span class="SimpleMath">B_S</span> of <span class="SimpleMath">S</span>) and <code class="code">basisrange</code> (a basis <span class="SimpleMath">B_R</span> of <span class="SimpleMath">R</span>), and the <code class="func">NiceVector</code> (<a href="chap61.html#X807B8032780C59A4"><span class="RefLink">61.11-2</span></a>) value of <span class="SimpleMath">v ∈ <var class="Arg">V</var></span> is defined as the matrix of the <span class="SimpleMath">F</span>-linear mapping <span class="SimpleMath">v</span> w.r.t. the bases <span class="SimpleMath">B_S</span> and <span class="SimpleMath">B_R</span>.</p>

<p><a id="X81503EB77FCE648D" name="X81503EB77FCE648D"></a></p>

<h4>61.11 <span class="Heading">Vector Spaces Handled By Nice Bases</span></h4>

<p>There are kinds of free <span class="SimpleMath">R</span>-modules for which efficient computations are possible because the elements are "nice", for example subspaces of full row modules or of full matrix modules. In other cases, a "nice" canonical basis is known that allows one to do the necessary computations in the corresponding row module, for example algebras given by structure constants.</p>

<p>In many other situations, one knows at least an isomorphism from the given module <span class="SimpleMath">V</span> to a "nicer" free left module <span class="SimpleMath">W</span>, in the sense that for each vector in <span class="SimpleMath">V</span>, the image in <span class="SimpleMath">W</span> can easily be computed, and analogously for each vector in <span class="SimpleMath">W</span>, one can compute the preimage in <span class="SimpleMath">V</span>.</p>

<p>This allows one to delegate computations w.r.t. a basis <span class="SimpleMath">B</span>, say, of <span class="SimpleMath">V</span> to the corresponding basis <span class="SimpleMath">C</span>, say, of <span class="SimpleMath">W</span>. We call <span class="SimpleMath">W</span> the <em>nice free left module</em> of <span class="SimpleMath">V</span>, and <span class="SimpleMath">C</span> the <em>nice basis</em> of <span class="SimpleMath">B</span>. (Note that it may happen that also <span class="SimpleMath">C</span> delegates questions to a "nicer" basis.) The basis <span class="SimpleMath">B</span> indicates the intended behaviour by the filter <code class="func">IsBasisByNiceBasis</code> (<a href="chap61.html#X82BC30A487967F5B"><span class="RefLink">61.11-5</span></a>), and stores <span class="SimpleMath">C</span> as value of the attribute <code class="func">NiceBasis</code> (<a href="chap61.html#X8388E0248690C214"><span class="RefLink">61.11-4</span></a>). <span class="SimpleMath">V</span> indicates the intended behaviour by the filter <code class="func">IsHandledByNiceBasis</code> (<a href="chap61.html#X79D1DEA679AEDA40"><span class="RefLink">61.11-6</span></a>), and stores <span class="SimpleMath">W</span> as value of the attribute <code class="func">NiceFreeLeftModule</code> (<a href="chap61.html#X826FD4BC7BA0559D"><span class="RefLink">61.11-1</span></a>).</p>

<p>The bijection between <span class="SimpleMath">V</span> and <span class="SimpleMath">W</span> is implemented by the functions <code class="func">NiceVector</code> (<a href="chap61.html#X807B8032780C59A4"><span class="RefLink">61.11-2</span></a>) and <code class="func">UglyVector</code> (<a href="chap61.html#X807B8032780C59A4"><span class="RefLink">61.11-2</span></a>); additional data needed to compute images and preimages can be stored as value of <code class="func">NiceFreeLeftModuleInfo</code> (<a href="chap61.html#X79350786800C2DD8"><span class="RefLink">61.11-3</span></a>).</p>

<p><a id="X826FD4BC7BA0559D" name="X826FD4BC7BA0559D"></a></p>

<h5>61.11-1 NiceFreeLeftModule</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; NiceFreeLeftModule</code>( <var class="Arg">V</var> )</td><td class="tdright">( attribute )</td></tr></table></div>
<p>For a free left module <var class="Arg">V</var> that is handled via the mechanism of nice bases, this attribute stores the associated free left module to which the tasks are delegated.</p>

<p><a id="X807B8032780C59A4" name="X807B8032780C59A4"></a></p>

<h5>61.11-2 NiceVector</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; NiceVector</code>( <var class="Arg">V</var>, <var class="Arg">v</var> )</td><td class="tdright">( operation )</td></tr></table></div>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; UglyVector</code>( <var class="Arg">V</var>, <var class="Arg">r</var> )</td><td class="tdright">( operation )</td></tr></table></div>
<p><code class="func">NiceVector</code> and <code class="func">UglyVector</code> provide the linear bijection between the free left module <var class="Arg">V</var> and <code class="code"><var class="Arg">W</var>:= NiceFreeLeftModule( <var class="Arg">V</var> )</code>.</p>

<p>If <var class="Arg">v</var> lies in the elements family of the family of <var class="Arg">V</var> then <code class="code">NiceVector( <var class="Arg">v</var> )</code> is either <code class="keyw">fail</code> or an element in the elements family of the family of <var class="Arg">W</var>.</p>

<p>If <var class="Arg">r</var> lies in the elements family of the family of <var class="Arg">W</var> then <code class="code">UglyVector( <var class="Arg">r</var> )</code> is either <code class="keyw">fail</code> or an element in the elements family of the family of <var class="Arg">V</var>.</p>

<p>If <var class="Arg">v</var> lies in <var class="Arg">V</var> (which usually <em>cannot</em> be checked without using <var class="Arg">W</var>) then <code class="code">UglyVector( <var class="Arg">V</var>, NiceVector( <var class="Arg">V</var>, <var class="Arg">v</var> ) ) = <var class="Arg">v</var></code>. If <var class="Arg">r</var> lies in <var class="Arg">W</var> (which usually <em>can</em> be checked) then <code class="code">NiceVector( <var class="Arg">V</var>, UglyVector( <var class="Arg">V</var>, <var class="Arg">r</var> ) ) = <var class="Arg">r</var></code>.</p>

<p>(This allows one to implement for example a membership test for <var class="Arg">V</var> using the membership test in <var class="Arg">W</var>.)</p>

<p><a id="X79350786800C2DD8" name="X79350786800C2DD8"></a></p>

<h5>61.11-3 NiceFreeLeftModuleInfo</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; NiceFreeLeftModuleInfo</code>( <var class="Arg">V</var> )</td><td class="tdright">( attribute )</td></tr></table></div>
<p>For a free left module <var class="Arg">V</var> that is handled via the mechanism of nice bases, this operation has to provide the necessary information (if any) for calls of <code class="func">NiceVector</code> (<a href="chap61.html#X807B8032780C59A4"><span class="RefLink">61.11-2</span></a>) and <code class="func">UglyVector</code> (<a href="chap61.html#X807B8032780C59A4"><span class="RefLink">61.11-2</span></a>).</p>

<p><a id="X8388E0248690C214" name="X8388E0248690C214"></a></p>

<h5>61.11-4 NiceBasis</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; NiceBasis</code>( <var class="Arg">B</var> )</td><td class="tdright">( attribute )</td></tr></table></div>
<p>Let <var class="Arg">B</var> be a basis of a free left module <var class="Arg">V</var> that is handled via nice bases. If <var class="Arg">B</var> has no basis vectors stored at the time of the first call to <code class="code">NiceBasis</code> then <code class="code">NiceBasis( <var class="Arg">B</var> )</code> is obtained as <code class="code">Basis( NiceFreeLeftModule( <var class="Arg">V</var> ) )</code>. If basis vectors are stored then <code class="code">NiceBasis( <var class="Arg">B</var> )</code> is the result of the call of <code class="code">Basis</code> with arguments <code class="code">NiceFreeLeftModule( <var class="Arg">V</var> )</code> and the <code class="code">NiceVector</code> values of the basis vectors of <var class="Arg">B</var>.</p>

<p>Note that the result is <code class="keyw">fail</code> if and only if the "basis vectors" stored in <var class="Arg">B</var> are in fact not basis vectors.</p>

<p>The attributes <code class="code">GeneratorsOfLeftModule</code> of the underlying left modules of <var class="Arg">B</var> and the result of <code class="code">NiceBasis</code> correspond via <code class="func">NiceVector</code> (<a href="chap61.html#X807B8032780C59A4"><span class="RefLink">61.11-2</span></a>) and <code class="func">UglyVector</code> (<a href="chap61.html#X807B8032780C59A4"><span class="RefLink">61.11-2</span></a>).</p>

<p><a id="X82BC30A487967F5B" name="X82BC30A487967F5B"></a></p>

<h5>61.11-5 IsBasisByNiceBasis</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; IsBasisByNiceBasis</code>( <var class="Arg">B</var> )</td><td class="tdright">( category )</td></tr></table></div>
<p>This filter indicates that the basis <var class="Arg">B</var> delegates tasks such as the computation of coefficients (see <code class="func">Coefficients</code> (<a href="chap61.html#X80B32F667BF6AFD8"><span class="RefLink">61.6-3</span></a>)) to a basis of an isomorphic "nicer" free left module.</p>

<p><a id="X79D1DEA679AEDA40" name="X79D1DEA679AEDA40"></a></p>

<h5>61.11-6 IsHandledByNiceBasis</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; IsHandledByNiceBasis</code>( <var class="Arg">M</var> )</td><td class="tdright">( category )</td></tr></table></div>
<p>For a free left module <var class="Arg">M</var> in this category, essentially all operations are performed using a "nicer" free left module, which is usually a row module.</p>

<p><a id="X8238195B851D3C44" name="X8238195B851D3C44"></a></p>

<h4>61.12 <span class="Heading">How to Implement New Kinds of Vector Spaces</span></h4>

<p><a id="X7DE34C3E837FCBC3" name="X7DE34C3E837FCBC3"></a></p>

<h5>61.12-1 DeclareHandlingByNiceBasis</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; DeclareHandlingByNiceBasis</code>( <var class="Arg">name</var>, <var class="Arg">info</var> )</td><td class="tdright">( function )</td></tr></table></div>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; InstallHandlingByNiceBasis</code>( <var class="Arg">name</var>, <var class="Arg">record</var> )</td><td class="tdright">( function )</td></tr></table></div>
<p>These functions are used to implement a new kind of free left modules that shall be handled via the mechanism of nice bases (see <a href="chap61.html#X81503EB77FCE648D"><span class="RefLink">61.11</span></a>).</p>

<p><var class="Arg">name</var> must be a string, a filter <span class="SimpleMath">f</span> with this name is created, and a logical implication from <span class="SimpleMath">f</span> to <code class="func">IsHandledByNiceBasis</code> (<a href="chap61.html#X79D1DEA679AEDA40"><span class="RefLink">61.11-6</span></a>) is installed.</p>

<p><var class="Arg">record</var> must be a record with the following components.</p>


<dl>
<dt><strong class="Mark"><code class="code">detect</code> </strong></dt>
<dd><p>a function of four arguments <span class="SimpleMath">R</span>, <span class="SimpleMath">l</span>, <span class="SimpleMath">V</span>, and <span class="SimpleMath">z</span>, where <span class="SimpleMath">V</span> is a free left module over the ring <span class="SimpleMath">R</span> with generators the list or collection <span class="SimpleMath">l</span>, and <span class="SimpleMath">z</span> is either the zero element of <span class="SimpleMath">V</span> or <code class="keyw">false</code> (then <span class="SimpleMath">l</span> is nonempty); the function returns <code class="keyw">true</code> if <span class="SimpleMath">V</span> shall lie in the filter <span class="SimpleMath">f</span>, and <code class="keyw">false</code> otherwise; the return value may also be <code class="keyw">fail</code>, which indicates that <span class="SimpleMath">V</span> is <em>not</em> to be handled via the mechanism of nice bases at all,</p>

</dd>
<dt><strong class="Mark"><code class="code">NiceFreeLeftModuleInfo</code> </strong></dt>
<dd><p>the <code class="code">NiceFreeLeftModuleInfo</code> method for left modules in <span class="SimpleMath">f</span>,</p>

</dd>
<dt><strong class="Mark"><code class="code">NiceVector</code> </strong></dt>
<dd><p>the <code class="code">NiceVector</code> method for left modules <span class="SimpleMath">V</span> in <span class="SimpleMath">f</span>; called with <span class="SimpleMath">V</span> and a vector <span class="SimpleMath">v ∈ V</span>, this function returns the nice vector <span class="SimpleMath">r</span> associated with <span class="SimpleMath">v</span>, and</p>

</dd>
<dt><strong class="Mark"><code class="code">UglyVector</code></strong></dt>
<dd><p>the <code class="func">UglyVector</code> (<a href="chap61.html#X807B8032780C59A4"><span class="RefLink">61.11-2</span></a>) method for left modules <span class="SimpleMath">V</span> in <span class="SimpleMath">f</span>; called with <span class="SimpleMath">V</span> and a vector <span class="SimpleMath">r</span> in the <code class="code">NiceFreeLeftModule</code> value of <span class="SimpleMath">V</span>, this function returns the vector <span class="SimpleMath">v ∈ V</span> to which <span class="SimpleMath">r</span> is associated.</p>

</dd>
</dl>
<p>The idea is that all one has to do for implementing a new kind of free left modules handled by the mechanism of nice bases is to call <code class="code">DeclareHandlingByNiceBasis</code> and <code class="code">InstallHandlingByNiceBasis</code>, which causes the installation of the necessary methods and adds the pair <span class="SimpleMath">[ f,</span><code class="code"><var class="Arg">record</var>.detect</code><span class="SimpleMath">]</span> to the global list <code class="code">NiceBasisFiltersInfo</code>. The <code class="func">LeftModuleByGenerators</code> (<a href="chap57.html#X79ED1D7D7F0AE59A"><span class="RefLink">57.1-10</span></a>) methods call <code class="func">CheckForHandlingByNiceBasis</code> (<a href="chap61.html#X7A374553786DF5E7"><span class="RefLink">61.12-3</span></a>), which sets the appropriate filter for the desired left module if applicable.</p>

<p><a id="X7E6077F0830A28DA" name="X7E6077F0830A28DA"></a></p>

<h5>61.12-2 NiceBasisFiltersInfo</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; NiceBasisFiltersInfo</code></td><td class="tdright">( global variable )</td></tr></table></div>
<p>An overview of all kinds of vector spaces that are currently handled by nice bases is given by the global list <code class="code">NiceBasisFiltersInfo</code>. Examples of such vector spaces are vector spaces of field elements (but not the fields themselves) and non-Gaussian row and matrix spaces (see <code class="func">IsGaussianSpace</code> (<a href="chap61.html#X83724C157F4FDFB4"><span class="RefLink">61.9-3</span></a>)).</p>

<p><a id="X7A374553786DF5E7" name="X7A374553786DF5E7"></a></p>

<h5>61.12-3 CheckForHandlingByNiceBasis</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; CheckForHandlingByNiceBasis</code>( <var class="Arg">R</var>, <var class="Arg">gens</var>, <var class="Arg">M</var>, <var class="Arg">zero</var> )</td><td class="tdright">( function )</td></tr></table></div>
<p>Whenever a free left module is constructed for which the filter <code class="code">IsHandledByNiceBasis</code> may be useful, <code class="code">CheckForHandlingByNiceBasis</code> should be called. (This is done in the methods for <code class="code">VectorSpaceByGenerators</code>, <code class="code">AlgebraByGenerators</code>, <code class="code">IdealByGenerators</code> etc. in the <strong class="pkg">GAP</strong> library.)</p>

<p>The arguments of this function are the coefficient ring <var class="Arg">R</var>, the list <var class="Arg">gens</var> of generators, the constructed module <var class="Arg">M</var> itself, and the zero element <var class="Arg">zero</var> of <var class="Arg">M</var>; if <var class="Arg">gens</var> is nonempty then the <var class="Arg">zero</var> value may also be <code class="keyw">false</code>.</p>


<div class="chlinkprevnextbot">&nbsp;<a href="chap0.html">[Top of Book]</a>&nbsp;  <a href="chap0.html#contents">[Contents]</a>&nbsp;  &nbsp;<a href="chap60.html">[Previous Chapter]</a>&nbsp;  &nbsp;<a href="chap62.html">[Next Chapter]</a>&nbsp;  </div>


<div class="chlinkbot"><span class="chlink1">Goto Chapter: </span><a href="chap0.html">Top</a>  <a href="chap1.html">1</a>  <a href="chap2.html">2</a>  <a href="chap3.html">3</a>  <a href="chap4.html">4</a>  <a href="chap5.html">5</a>  <a href="chap6.html">6</a>  <a href="chap7.html">7</a>  <a href="chap8.html">8</a>  <a href="chap9.html">9</a>  <a href="chap10.html">10</a>  <a href="chap11.html">11</a>  <a href="chap12.html">12</a>  <a href="chap13.html">13</a>  <a href="chap14.html">14</a>  <a href="chap15.html">15</a>  <a href="chap16.html">16</a>  <a href="chap17.html">17</a>  <a href="chap18.html">18</a>  <a href="chap19.html">19</a>  <a href="chap20.html">20</a>  <a href="chap21.html">21</a>  <a href="chap22.html">22</a>  <a href="chap23.html">23</a>  <a href="chap24.html">24</a>  <a href="chap25.html">25</a>  <a href="chap26.html">26</a>  <a href="chap27.html">27</a>  <a href="chap28.html">28</a>  <a href="chap29.html">29</a>  <a href="chap30.html">30</a>  <a href="chap31.html">31</a>  <a href="chap32.html">32</a>  <a href="chap33.html">33</a>  <a href="chap34.html">34</a>  <a href="chap35.html">35</a>  <a href="chap36.html">36</a>  <a href="chap37.html">37</a>  <a href="chap38.html">38</a>  <a href="chap39.html">39</a>  <a href="chap40.html">40</a>  <a href="chap41.html">41</a>  <a href="chap42.html">42</a>  <a href="chap43.html">43</a>  <a href="chap44.html">44</a>  <a href="chap45.html">45</a>  <a href="chap46.html">46</a>  <a href="chap47.html">47</a>  <a href="chap48.html">48</a>  <a href="chap49.html">49</a>  <a href="chap50.html">50</a>  <a href="chap51.html">51</a>  <a href="chap52.html">52</a>  <a href="chap53.html">53</a>  <a href="chap54.html">54</a>  <a href="chap55.html">55</a>  <a href="chap56.html">56</a>  <a href="chap57.html">57</a>  <a href="chap58.html">58</a>  <a href="chap59.html">59</a>  <a href="chap60.html">60</a>  <a href="chap61.html">61</a>  <a href="chap62.html">62</a>  <a href="chap63.html">63</a>  <a href="chap64.html">64</a>  <a href="chap65.html">65</a>  <a href="chap66.html">66</a>  <a href="chap67.html">67</a>  <a href="chap68.html">68</a>  <a href="chap69.html">69</a>  <a href="chap70.html">70</a>  <a href="chap71.html">71</a>  <a href="chap72.html">72</a>  <a href="chap73.html">73</a>  <a href="chap74.html">74</a>  <a href="chap75.html">75</a>  <a href="chap76.html">76</a>  <a href="chap77.html">77</a>  <a href="chap78.html">78</a>  <a href="chap79.html">79</a>  <a href="chap80.html">80</a>  <a href="chap81.html">81</a>  <a href="chap82.html">82</a>  <a href="chap83.html">83</a>  <a href="chap84.html">84</a>  <a href="chap85.html">85</a>  <a href="chap86.html">86</a>  <a href="chap87.html">87</a>  <a href="chapBib.html">Bib</a>  <a href="chapInd.html">Ind</a>  </div>

<hr />
<p class="foot">generated by <a href="http://www.math.rwth-aachen.de/~Frank.Luebeck/GAPDoc">GAPDoc2HTML</a></p>
</body>
</html>