1380
GAP - Reference Manual Release 4.8.10, 15-Jan-2018 The GAP Group The GAP Group Email: [email protected] Homepage: https://www.gap-system.org

GAP - Reference Manual

Embed Size (px)

Citation preview

  • GAP - Reference Manual

    Release 4.8.10, 15-Jan-2018

    The GAP Group

    The GAP Group Email: [email protected]: https://www.gap-system.org

    mailto://[email protected]://www.gap-system.org

  • GAP - Reference Manual 2

    CopyrightCopyright (1987-2018) for the core part of the GAP system by the GAP Group.

    Most parts of this distribution, including the core part of the GAP system are distributed under the terms ofthe GNU General Public License, see http://www.gnu.org/licenses/gpl.html or the file GPL in the etcdirectory of the GAP installation.

    More detailed information about copyright and licenses of parts of this distribution can be found in Section1.4 of this manual.

    GAP is developed over a long time and has many authors and contributors. More detailed information canbe found in Section 1.2 of this manual.

    http://www.gnu.org/licenses/gpl.html

  • Contents

    1 Preface 231.1 The GAP System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 231.2 Authors and Maintainers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 251.3 Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 251.4 Copyright and License . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 261.5 Further Information about GAP . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27

    2 The Help System 282.1 Invoking the Help . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 282.2 Browsing through the Sections . . . . . . . . . . . . . . . . . . . . . . . . . . . . 282.3 Changing the Help Viewer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 292.4 The Pager Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31

    3 Running GAP 333.1 Command Line Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 333.2 The gap.ini and gaprc files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 383.3 Saving and Loading a Workspace . . . . . . . . . . . . . . . . . . . . . . . . . . . 413.4 Testing for the System Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . 423.5 Global Values that Control the GAP Session . . . . . . . . . . . . . . . . . . . . . 423.6 Coloring the Prompt and Input . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43

    4 The Programming Language 454.1 Language Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 454.2 Lexical Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 464.3 Symbols . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 464.4 Whitespaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 474.5 Keywords . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 484.6 Identifiers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 484.7 Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 494.8 Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 504.9 More About Global Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 514.10 Namespaces for GAP packages . . . . . . . . . . . . . . . . . . . . . . . . . . . . 544.11 Function Calls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 554.12 Comparisons . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 564.13 Arithmetic Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 574.14 Statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59

    3

  • GAP - Reference Manual 4

    4.15 Assignments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 594.16 Procedure Calls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 604.17 If . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 604.18 While . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 624.19 Repeat . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 624.20 For . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 634.21 Break . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 654.22 Continue . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 654.23 Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 664.24 Return (With or without Value) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69

    5 Functions 705.1 Information about a function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 705.2 Calling a function with a list argument that is interpreted as several arguments . . . 725.3 Calling a function with a time limit . . . . . . . . . . . . . . . . . . . . . . . . . . 735.4 Functions that do nothing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 745.5 Function Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 765.6 Naming Conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77

    6 Main Loop and Break Loop 796.1 Main Loop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 796.2 Special Rules for Input Lines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 816.3 View and Print . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 816.4 Break Loops . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 856.5 Variable Access in a Break Loop . . . . . . . . . . . . . . . . . . . . . . . . . . . 896.6 Error and ErrorCount . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 916.7 Leaving GAP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 926.8 Line Editing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 936.9 Editing using the readline library . . . . . . . . . . . . . . . . . . . . . . . . . . 966.10 Editing Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 996.11 Editor Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 996.12 Changing the Screen Size . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1006.13 Teaching Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100

    7 Debugging and Profiling Facilities 1027.1 Recovery from NoMethodFound-Errors . . . . . . . . . . . . . . . . . . . . . . . 1027.2 Inspecting Applicable Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1047.3 Tracing Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1047.4 Info Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1067.5 Assertions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1087.6 Timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1097.7 Profiling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1107.8 Information about the version used . . . . . . . . . . . . . . . . . . . . . . . . . . 1187.9 Test Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1187.10 Debugging Recursion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1237.11 Global Memory Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124

  • GAP - Reference Manual 5

    8 Options Stack 1278.1 Functions Dealing with the Options Stack . . . . . . . . . . . . . . . . . . . . . . 1278.2 Options Stack an Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129

    9 Files and Filenames 1309.1 Portability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1309.2 GAP Root Directories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1309.3 Directories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1319.4 File Names . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1339.5 Special Filenames . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1349.6 File Access . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1349.7 File Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135

    10 Streams 13910.1 Categories for Streams and the StreamsFamily . . . . . . . . . . . . . . . . . . . . 13910.2 Operations applicable to All Streams . . . . . . . . . . . . . . . . . . . . . . . . . 14110.3 Operations for Input Streams . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14110.4 Operations for Output Streams . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14410.5 File Streams . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14710.6 User Streams . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14810.7 String Streams . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14810.8 Input-Output Streams . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14910.9 Dummy Streams . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15110.10 Handling of Streams in the Background . . . . . . . . . . . . . . . . . . . . . . . . 15110.11 Comma separated files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152

    11 Processes 15311.1 Process and Exec . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153

    12 Objects and Elements 15612.1 Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15612.2 Elements as equivalence classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15612.3 Sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15712.4 Domains . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15712.5 Identical Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15712.6 Mutability and Copyability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15912.7 Duplication of Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16112.8 Other Operations Applicable to any Object . . . . . . . . . . . . . . . . . . . . . . 162

    13 Types of Objects 16413.1 Families . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16413.2 Filters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16513.3 Categories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16713.4 Representation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16913.5 Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17013.6 Setter and Tester for Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17113.7 Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173

  • GAP - Reference Manual 6

    13.8 Other Filters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17513.9 Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175

    14 Integers 17714.1 Integers: Global Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17714.2 Elementary Operations for Integers . . . . . . . . . . . . . . . . . . . . . . . . . . 17814.3 Quotients and Remainders . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18114.4 Prime Integers and Factorization . . . . . . . . . . . . . . . . . . . . . . . . . . . 18414.5 Residue Class Rings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18914.6 Check Digits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19114.7 Random Sources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192

    15 Number Theory 19515.1 InfoNumtheor (Info Class) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19515.2 Prime Residues . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19515.3 Primitive Roots and Discrete Logarithms . . . . . . . . . . . . . . . . . . . . . . . 19715.4 Roots Modulo Integers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19815.5 Multiplicative Arithmetic Functions . . . . . . . . . . . . . . . . . . . . . . . . . . 20115.6 Continued Fractions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20215.7 Miscellaneous . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203

    16 Combinatorics 20516.1 Combinatorial Numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20516.2 Combinations, Arrangements and Tuples . . . . . . . . . . . . . . . . . . . . . . . 20816.3 Fibonacci and Lucas Sequences . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21716.4 Permanent of a Matrix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 218

    17 Rational Numbers 22017.1 Rationals: Global Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22017.2 Elementary Operations for Rationals . . . . . . . . . . . . . . . . . . . . . . . . . 221

    18 Cyclotomic Numbers 22318.1 Operations for Cyclotomics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22318.2 Infinity and negative Infinity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22818.3 Comparisons of Cyclotomics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22918.4 ATLAS Irrationalities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22918.5 Galois Conjugacy of Cyclotomics . . . . . . . . . . . . . . . . . . . . . . . . . . . 23318.6 Internally Represented Cyclotomics . . . . . . . . . . . . . . . . . . . . . . . . . . 235

    19 Floats 23819.1 A sample run . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23819.2 Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23919.3 High-precision-specific methods . . . . . . . . . . . . . . . . . . . . . . . . . . . 24419.4 Complex arithmetic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24419.5 Interval-specific methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 244

  • GAP - Reference Manual 7

    20 Booleans 24520.1 IsBool (Filter) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24520.2 Fail (Variable) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24520.3 Comparisons of Booleans . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24620.4 Operations for Booleans . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 246

    21 Lists 24921.1 List Categories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24921.2 Basic Operations for Lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25121.3 List Elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25221.4 List Assignment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25421.5 IsBound and Unbind for Lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25721.6 Identical Lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25821.7 Duplication of Lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25921.8 Membership Test for Lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26121.9 Enlarging Internally Represented Lists . . . . . . . . . . . . . . . . . . . . . . . . 26121.10 Comparisons of Lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26221.11 Arithmetic for Lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26321.12 Filters Controlling the Arithmetic Behaviour of Lists . . . . . . . . . . . . . . . . . 26321.13 Additive Arithmetic for Lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26521.14 Multiplicative Arithmetic for Lists . . . . . . . . . . . . . . . . . . . . . . . . . . 26721.15 Mutability Status and List Arithmetic . . . . . . . . . . . . . . . . . . . . . . . . . 27021.16 Finding Positions in Lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27121.17 Properties and Attributes for Lists . . . . . . . . . . . . . . . . . . . . . . . . . . . 27521.18 Sorting Lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27721.19 Sorted Lists and Sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27921.20 Operations for Lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28221.21 Advanced List Manipulations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29221.22 Ranges . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29421.23 Enumerators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 296

    22 Boolean Lists 29822.1 IsBlist (Filter) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29822.2 Boolean Lists Representing Subsets . . . . . . . . . . . . . . . . . . . . . . . . . . 29922.3 Set Operations via Boolean Lists . . . . . . . . . . . . . . . . . . . . . . . . . . . 30022.4 Function that Modify Boolean Lists . . . . . . . . . . . . . . . . . . . . . . . . . . 30122.5 More about Boolean Lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 302

    23 Row Vectors 30423.1 IsRowVector (Filter) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30423.2 Operators for Row Vectors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30523.3 Row Vectors over Finite Fields . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30623.4 Coefficient List Arithmetic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30823.5 Shifting and Trimming Coefficient Lists . . . . . . . . . . . . . . . . . . . . . . . 30923.6 Functions for Coding Theory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31023.7 Vectors as coefficients of polynomials . . . . . . . . . . . . . . . . . . . . . . . . . 311

  • GAP - Reference Manual 8

    24 Matrices 31424.1 InfoMatrix (Info Class) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31424.2 Categories of Matrices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31424.3 Operators for Matrices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31524.4 Properties and Attributes of Matrices . . . . . . . . . . . . . . . . . . . . . . . . . 31824.5 Matrix Constructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32024.6 Random Matrices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32224.7 Matrices Representing Linear Equations and the Gaussian Algorithm . . . . . . . . 32324.8 Eigenvectors and eigenvalues . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32524.9 Elementary Divisors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32624.10 Echelonized Matrices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32824.11 Matrices as Basis of a Row Space . . . . . . . . . . . . . . . . . . . . . . . . . . . 33024.12 Triangular Matrices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33124.13 Matrices as Linear Mappings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33224.14 Matrices over Finite Fields . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33424.15 Inverse and Nullspace of an Integer Matrix Modulo an Ideal . . . . . . . . . . . . . 33624.16 Special Multiplication Algorithms for Matrices over GF(2) . . . . . . . . . . . . . 33724.17 Block Matrices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 338

    25 Integral matrices and lattices 33925.1 Linear equations over the integers and Integral Matrices . . . . . . . . . . . . . . . 33925.2 Normal Forms over the Integers . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34125.3 Determinant of an integer matrix . . . . . . . . . . . . . . . . . . . . . . . . . . . 34425.4 Decompositions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34425.5 Lattice Reduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34625.6 Orthogonal Embeddings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 348

    26 Vector and matrix objects 35026.1 Fundamental ideas and rules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35026.2 Categories of vectors and matrices . . . . . . . . . . . . . . . . . . . . . . . . . . 35126.3 Constructing vector and matrix objects . . . . . . . . . . . . . . . . . . . . . . . . 35126.4 Operations for row vector objects . . . . . . . . . . . . . . . . . . . . . . . . . . . 35126.5 Operations for row list matrix objects . . . . . . . . . . . . . . . . . . . . . . . . . 35126.6 Operations for flat matrix objects . . . . . . . . . . . . . . . . . . . . . . . . . . . 351

    27 Strings and Characters 35227.1 IsChar and IsString . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35227.2 Special Characters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35427.3 Triple Quoted Strings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35627.4 Internally Represented Strings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35627.5 Recognizing Characters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35827.6 Comparisons of Strings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35827.7 Operations to Produce or Manipulate Strings . . . . . . . . . . . . . . . . . . . . . 35927.8 Character Conversion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36527.9 Operations to Evaluate Strings . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36627.10 Calendar Arithmetic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36827.11 Obtaining LaTeX Representations of Objects . . . . . . . . . . . . . . . . . . . . . 370

  • GAP - Reference Manual 9

    28 Dictionaries and General Hash Tables 37128.1 Using Dictionaries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37128.2 Dictionaries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37328.3 Dictionaries via Binary Lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37328.4 General Hash Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37428.5 Hash keys . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37528.6 Dense hash tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37528.7 Sparse hash tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 375

    29 Records 37729.1 IsRecord and RecNames . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37729.2 Accessing Record Elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37829.3 Record Assignment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37929.4 Identical Records . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37929.5 Comparisons of Records . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38129.6 IsBound and Unbind for Records . . . . . . . . . . . . . . . . . . . . . . . . . . . 38229.7 Record Access Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 383

    30 Collections 38430.1 IsCollection (Filter) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38430.2 Collection Families . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38430.3 Lists and Collections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38530.4 Attributes and Properties for Collections . . . . . . . . . . . . . . . . . . . . . . . 39130.5 Operations for Collections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39330.6 Membership Test for Collections . . . . . . . . . . . . . . . . . . . . . . . . . . . 39530.7 Random Elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39630.8 Iterators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 397

    31 Domains and their Elements 40131.1 Operational Structure of Domains . . . . . . . . . . . . . . . . . . . . . . . . . . . 40131.2 Equality and Comparison of Domains . . . . . . . . . . . . . . . . . . . . . . . . . 40231.3 Constructing Domains . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40331.4 Changing the Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40431.5 Changing the Representation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40431.6 Domain Categories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40531.7 Parents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40631.8 Constructing Subdomains . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40731.9 Operations for Domains . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40731.10 Attributes and Properties of Elements . . . . . . . . . . . . . . . . . . . . . . . . . 40831.11 Comparison Operations for Elements . . . . . . . . . . . . . . . . . . . . . . . . . 41231.12 Arithmetic Operations for Elements . . . . . . . . . . . . . . . . . . . . . . . . . . 41331.13 Relations Between Domains . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41431.14 Useful Categories of Elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41731.15 Useful Categories for all Elements of a Family . . . . . . . . . . . . . . . . . . . . 421

  • GAP - Reference Manual 10

    32 Mappings 42432.1 IsDirectProductElement (Filter) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42432.2 Creating Mappings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42532.3 Properties and Attributes of (General) Mappings . . . . . . . . . . . . . . . . . . . 42732.4 Images under Mappings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42932.5 Preimages under Mappings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43132.6 Arithmetic Operations for General Mappings . . . . . . . . . . . . . . . . . . . . . 43332.7 Mappings which are Compatible with Algebraic Structures . . . . . . . . . . . . . 43332.8 Magma Homomorphisms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43432.9 Mappings that Respect Multiplication . . . . . . . . . . . . . . . . . . . . . . . . . 43432.10 Mappings that Respect Addition . . . . . . . . . . . . . . . . . . . . . . . . . . . 43532.11 Linear Mappings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43632.12 Ring Homomorphisms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43732.13 General Mappings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43832.14 Technical Matters Concerning General Mappings . . . . . . . . . . . . . . . . . . 439

    33 Relations 44233.1 General Binary Relations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44233.2 Properties and Attributes of Binary Relations . . . . . . . . . . . . . . . . . . . . . 44333.3 Binary Relations on Points . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44533.4 Closure Operations and Other Constructors . . . . . . . . . . . . . . . . . . . . . . 44533.5 Equivalence Relations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44733.6 Attributes of and Operations on Equivalence Relations . . . . . . . . . . . . . . . . 44833.7 Equivalence Classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 448

    34 Orderings 45034.1 IsOrdering (Filter) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45034.2 Building new orderings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45034.3 Properties and basic functionality . . . . . . . . . . . . . . . . . . . . . . . . . . . 45134.4 Orderings on families of associative words . . . . . . . . . . . . . . . . . . . . . . 452

    35 Magmas 45735.1 Magma Categories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45735.2 Magma Generation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45835.3 Magmas Defined by Multiplication Tables . . . . . . . . . . . . . . . . . . . . . . 46135.4 Attributes and Properties for Magmas . . . . . . . . . . . . . . . . . . . . . . . . . 463

    36 Words 46736.1 Categories of Words and Nonassociative Words . . . . . . . . . . . . . . . . . . . 46736.2 Comparison of Words . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46936.3 Operations for Words . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47036.4 Free Magmas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47136.5 External Representation for Nonassociative Words . . . . . . . . . . . . . . . . . . 472

  • GAP - Reference Manual 11

    37 Associative Words 47337.1 Categories of Associative Words . . . . . . . . . . . . . . . . . . . . . . . . . . . 47337.2 Free Groups, Monoids and Semigroups . . . . . . . . . . . . . . . . . . . . . . . . 47437.3 Comparison of Associative Words . . . . . . . . . . . . . . . . . . . . . . . . . . . 47537.4 Operations for Associative Words . . . . . . . . . . . . . . . . . . . . . . . . . . . 47637.5 Operations for Associative Words by their Syllables . . . . . . . . . . . . . . . . . 47937.6 Representations for Associative Words . . . . . . . . . . . . . . . . . . . . . . . . 48037.7 The External Representation for Associative Words . . . . . . . . . . . . . . . . . 48237.8 Straight Line Programs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48237.9 Straight Line Program Elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . 488

    38 Rewriting Systems 49038.1 Operations on rewriting systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49038.2 Operations on elements of the algebra . . . . . . . . . . . . . . . . . . . . . . . . . 49238.3 Properties of rewriting systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49338.4 Rewriting in Groups and Monoids . . . . . . . . . . . . . . . . . . . . . . . . . . . 49338.5 Developing rewriting systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 494

    39 Groups 49639.1 Group Elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49639.2 Creating Groups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49739.3 Subgroups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49939.4 Closures of (Sub)groups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50239.5 Expressing Group Elements as Words in Generators . . . . . . . . . . . . . . . . . 50339.6 Structure Descriptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50539.7 Cosets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50739.8 Transversals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50939.9 Double Cosets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50939.10 Conjugacy Classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51139.11 Normal Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51439.12 Specific and Parametrized Subgroups . . . . . . . . . . . . . . . . . . . . . . . . . 51639.13 Sylow Subgroups and Hall Subgroups . . . . . . . . . . . . . . . . . . . . . . . . 51939.14 Subgroups characterized by prime powers . . . . . . . . . . . . . . . . . . . . . . 52139.15 Group Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52139.16 Numerical Group Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52839.17 Subgroup Series . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52939.18 Factor Groups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53439.19 Sets of Subgroups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53539.20 Subgroup Lattice . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53839.21 Specific Methods for Subgroup Lattice Computations . . . . . . . . . . . . . . . . 54139.22 Special Generating Sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54439.23 1-Cohomology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54639.24 Schur Covers and Multipliers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54839.25 Tests for the Availability of Methods . . . . . . . . . . . . . . . . . . . . . . . . . 552

  • GAP - Reference Manual 12

    40 Group Homomorphisms 55440.1 Creating Group Homomorphisms . . . . . . . . . . . . . . . . . . . . . . . . . . . 55440.2 Operations for Group Homomorphisms . . . . . . . . . . . . . . . . . . . . . . . . 55740.3 Efficiency of Homomorphisms . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55840.4 Homomorphism for very large groups . . . . . . . . . . . . . . . . . . . . . . . . . 55940.5 Nice Monomorphisms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56040.6 Group Automorphisms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56140.7 Groups of Automorphisms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56340.8 Calculating with Group Automorphisms . . . . . . . . . . . . . . . . . . . . . . . 56440.9 Searching for Homomorphisms . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56540.10 Representations for Group Homomorphisms . . . . . . . . . . . . . . . . . . . . . 568

    41 Group Actions 57141.1 About Group Actions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57141.2 Basic Actions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57241.3 Action on canonical representatives . . . . . . . . . . . . . . . . . . . . . . . . . . 57641.4 Orbits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57641.5 Stabilizers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57841.6 Elements with Prescribed Images . . . . . . . . . . . . . . . . . . . . . . . . . . . 58041.7 The Permutation Image of an Action . . . . . . . . . . . . . . . . . . . . . . . . . 58041.8 Action of a group on itself . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58241.9 Permutations Induced by Elements and Cycles . . . . . . . . . . . . . . . . . . . . 58341.10 Tests for Actions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58541.11 Block Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58741.12 External Sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 588

    42 Permutations 59442.1 IsPerm (Filter) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59442.2 Comparison of Permutations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59542.3 Moved Points of Permutations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59642.4 Sign and Cycle Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59742.5 Creating Permutations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 598

    43 Permutation Groups 60043.1 IsPermGroup (Filter) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60043.2 The Natural Action . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60043.3 Computing a Permutation Representation . . . . . . . . . . . . . . . . . . . . . . . 60143.4 Symmetric and Alternating Groups . . . . . . . . . . . . . . . . . . . . . . . . . . 60243.5 Primitive Groups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60343.6 Stabilizer Chains . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60443.7 Randomized Methods for Permutation Groups . . . . . . . . . . . . . . . . . . . . 60543.8 Construction of Stabilizer Chains . . . . . . . . . . . . . . . . . . . . . . . . . . . 60843.9 Stabilizer Chain Records . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61043.10 Operations for Stabilizer Chains . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61143.11 Low Level Routines to Modify and Create Stabilizer Chains . . . . . . . . . . . . . 61443.12 Backtrack . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61543.13 Working with large degree permutation groups . . . . . . . . . . . . . . . . . . . . 617

  • GAP - Reference Manual 13

    44 Matrix Groups 61944.1 IsMatrixGroup (Filter) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61944.2 Attributes and Properties for Matrix Groups . . . . . . . . . . . . . . . . . . . . . 62044.3 Actions of Matrix Groups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62144.4 GL and SL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62144.5 Invariant Forms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62344.6 Matrix Groups in Characteristic 0 . . . . . . . . . . . . . . . . . . . . . . . . . . . 62444.7 Acting OnRight and OnLeft . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 627

    45 Polycyclic Groups 62845.1 Polycyclic Generating Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62845.2 Computing a Pcgs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62945.3 Defining a Pcgs Yourself . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63045.4 Elementary Operations for a Pcgs . . . . . . . . . . . . . . . . . . . . . . . . . . . 63045.5 Elementary Operations for a Pcgs and an Element . . . . . . . . . . . . . . . . . . 63145.6 Exponents of Special Products . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63345.7 Subgroups of Polycyclic Groups - Induced Pcgs . . . . . . . . . . . . . . . . . . . 63445.8 Subgroups of Polycyclic Groups Canonical Pcgs . . . . . . . . . . . . . . . . . . 63645.9 Factor Groups of Polycyclic Groups Modulo Pcgs . . . . . . . . . . . . . . . . . 63745.10 Factor Groups of Polycyclic Groups in their Own Representation . . . . . . . . . . 63945.11 Pcgs and Normal Series . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64045.12 Sum and Intersection of Pcgs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64445.13 Special Pcgs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64545.14 Action on Subfactors Defined by a Pcgs . . . . . . . . . . . . . . . . . . . . . . . 64745.15 Orbit Stabilizer Methods for Polycyclic Groups . . . . . . . . . . . . . . . . . . . 64945.16 Operations which have Special Methods for Groups with Pcgs . . . . . . . . . . . . 64945.17 Conjugacy Classes in Solvable Groups . . . . . . . . . . . . . . . . . . . . . . . . 649

    46 Pc Groups 65146.1 The family pcgs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65246.2 Elements of pc groups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65346.3 Pc groups versus fp groups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65346.4 Constructing Pc Groups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65446.5 Computing Pc Groups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65746.6 Saving a Pc Group . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65846.7 Operations for Pc Groups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65846.8 2-Cohomology and Extensions . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65846.9 Coding a Pc Presentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66246.10 Random Isomorphism Testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 663

    47 Finitely Presented Groups 66447.1 IsSubgroupFpGroup and IsFpGroup . . . . . . . . . . . . . . . . . . . . . . . . . 66547.2 Creating Finitely Presented Groups . . . . . . . . . . . . . . . . . . . . . . . . . . 66647.3 Comparison of Elements of Finitely Presented Groups . . . . . . . . . . . . . . . . 66747.4 Preimages in the Free Group . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66847.5 Operations for Finitely Presented Groups . . . . . . . . . . . . . . . . . . . . . . . 67047.6 Coset Tables and Coset Enumeration . . . . . . . . . . . . . . . . . . . . . . . . . 670

  • GAP - Reference Manual 14

    47.7 Standardization of coset tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67447.8 Coset tables for subgroups in the whole group . . . . . . . . . . . . . . . . . . . . 67547.9 Augmented Coset Tables and Rewriting . . . . . . . . . . . . . . . . . . . . . . . . 67647.10 Low Index Subgroups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67747.11 Converting Groups to Finitely Presented Groups . . . . . . . . . . . . . . . . . . . 67847.12 New Presentations and Presentations for Subgroups . . . . . . . . . . . . . . . . . 68147.13 Preimages under Homomorphisms from an FpGroup . . . . . . . . . . . . . . . . . 68247.14 Quotient Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68347.15 Abelian Invariants for Subgroups . . . . . . . . . . . . . . . . . . . . . . . . . . . 68647.16 Testing Finiteness of Finitely Presented Groups . . . . . . . . . . . . . . . . . . . 688

    48 Presentations and Tietze Transformations 69048.1 Creating Presentations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69048.2 Subgroup Presentations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69348.3 Relators in a Presentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69748.4 Printing Presentations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69848.5 Changing Presentations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70048.6 Tietze Transformations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70148.7 Elementary Tietze Transformations . . . . . . . . . . . . . . . . . . . . . . . . . . 70448.8 Tietze Transformations that introduce new Generators . . . . . . . . . . . . . . . . 70648.9 Tracing generator images through Tietze transformations . . . . . . . . . . . . . . 71048.10 The Decoding Tree Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71248.11 Tietze Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 715

    49 Group Products 71849.1 Direct Products . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71849.2 Semidirect Products . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71949.3 Subdirect Products . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72149.4 Wreath Products . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72149.5 Free Products . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72349.6 Embeddings and Projections for Group Products . . . . . . . . . . . . . . . . . . . 724

    50 Group Libraries 72550.1 Basic Groups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72550.2 Classical Groups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72950.3 Conjugacy Classes in Classical Groups . . . . . . . . . . . . . . . . . . . . . . . . 73550.4 Constructors for Basic Groups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73650.5 Selection Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73750.6 Transitive Permutation Groups . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73850.7 Small Groups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73950.8 Finite Perfect Groups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74350.9 Primitive Permutation Groups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74950.10 Index numbers of primitive groups . . . . . . . . . . . . . . . . . . . . . . . . . . 75150.11 Irreducible Solvable Matrix Groups . . . . . . . . . . . . . . . . . . . . . . . . . . 75250.12 Irreducible Maximal Finite Integral Matrix Groups . . . . . . . . . . . . . . . . . . 753

  • GAP - Reference Manual 15

    51 Semigroups and Monoids 76251.1 Semigroups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76251.2 Monoids . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76651.3 Inverse semigroups and monoids . . . . . . . . . . . . . . . . . . . . . . . . . . . 76851.4 Properties of Semigroups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77051.5 Ideals of semigroups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77251.6 Congruences for semigroups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77251.7 Quotients . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77351.8 Greens Relations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77351.9 Rees Matrix Semigroups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 776

    52 Finitely Presented Semigroups and Monoids 78452.1 IsSubsemigroupFpSemigroup (Filter) . . . . . . . . . . . . . . . . . . . . . . . . . 78652.2 Creating Finitely Presented Semigroups . . . . . . . . . . . . . . . . . . . . . . . 78752.3 Comparison of Elements of Finitely Presented Semigroups . . . . . . . . . . . . . 78852.4 Preimages in the Free Semigroup . . . . . . . . . . . . . . . . . . . . . . . . . . . 78852.5 Finitely presented monoids . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79052.6 Rewriting Systems and the Knuth-Bendix Procedure . . . . . . . . . . . . . . . . . 79052.7 Todd-Coxeter Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 793

    53 Transformations 79453.1 The family and categories of transformations . . . . . . . . . . . . . . . . . . . . . 79553.2 Creating transformations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79653.3 Changing the representation of a transformation . . . . . . . . . . . . . . . . . . . 79953.4 Operators for transformations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80153.5 Attributes for transformations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80353.6 Displaying transformations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81253.7 Semigroups of transformations . . . . . . . . . . . . . . . . . . . . . . . . . . . . 813

    54 Partial permutations 81754.1 The family and categories of partial permutations . . . . . . . . . . . . . . . . . . 81954.2 Creating partial permutations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81954.3 Attributes for partial permutations . . . . . . . . . . . . . . . . . . . . . . . . . . . 82354.4 Changing the representation of a partial permutation . . . . . . . . . . . . . . . . . 83154.5 Operators and operations for partial permutations . . . . . . . . . . . . . . . . . . 83354.6 Displaying partial permutations . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83654.7 Semigroups and inverse semigroups of partial permutations . . . . . . . . . . . . . 838

    55 Additive Magmas 84255.1 (Near-)Additive Magma Categories . . . . . . . . . . . . . . . . . . . . . . . . . . 84255.2 (Near-)Additive Magma Generation . . . . . . . . . . . . . . . . . . . . . . . . . . 84455.3 Attributes and Properties for (Near-)Additive Magmas . . . . . . . . . . . . . . . . 84655.4 Operations for (Near-)Additive Magmas . . . . . . . . . . . . . . . . . . . . . . . 847

  • GAP - Reference Manual 16

    56 Rings 84856.1 Generating Rings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84856.2 Ideals of Rings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85156.3 Rings With One . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85456.4 Properties of Rings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85656.5 Units and Factorizations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85756.6 Euclidean Rings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86056.7 Gcd and Lcm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86156.8 Homomorphisms of Rings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86456.9 Small Rings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 865

    57 Modules 86857.1 Generating modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86857.2 Submodules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87057.3 Free Modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 871

    58 Fields and Division Rings 87458.1 Generating Fields . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87458.2 Subfields of Fields . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87658.3 Galois Action . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 878

    59 Finite Fields 88259.1 Finite Field Elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88259.2 Operations for Finite Field Elements . . . . . . . . . . . . . . . . . . . . . . . . . 88459.3 Creating Finite Fields . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88759.4 Frobenius Automorphisms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88859.5 Conway Polynomials . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88959.6 Printing, Viewing and Displaying Finite Field Elements . . . . . . . . . . . . . . . 890

    60 Abelian Number Fields 89260.1 Construction of Abelian Number Fields . . . . . . . . . . . . . . . . . . . . . . . . 89260.2 Operations for Abelian Number Fields . . . . . . . . . . . . . . . . . . . . . . . . 89460.3 Integral Bases of Abelian Number Fields . . . . . . . . . . . . . . . . . . . . . . . 89560.4 Galois Groups of Abelian Number Fields . . . . . . . . . . . . . . . . . . . . . . . 89760.5 Gaussians . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 899

    61 Vector Spaces 90061.1 IsLeftVectorSpace (Filter) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90061.2 Constructing Vector Spaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90061.3 Operations and Attributes for Vector Spaces . . . . . . . . . . . . . . . . . . . . . 90261.4 Domains of Subspaces of Vector Spaces . . . . . . . . . . . . . . . . . . . . . . . 90261.5 Bases of Vector Spaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90361.6 Operations for Vector Space Bases . . . . . . . . . . . . . . . . . . . . . . . . . . 90561.7 Operations for Special Kinds of Bases . . . . . . . . . . . . . . . . . . . . . . . . 90761.8 Mutable Bases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90861.9 Row and Matrix Spaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91061.10 Vector Space Homomorphisms . . . . . . . . . . . . . . . . . . . . . . . . . . . . 914

  • GAP - Reference Manual 17

    61.11 Vector Spaces Handled By Nice Bases . . . . . . . . . . . . . . . . . . . . . . . . 91761.12 How to Implement New Kinds of Vector Spaces . . . . . . . . . . . . . . . . . . . 919

    62 Algebras 92162.1 InfoAlgebra (Info Class) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92162.2 Constructing Algebras by Generators . . . . . . . . . . . . . . . . . . . . . . . . . 92162.3 Constructing Algebras as Free Algebras . . . . . . . . . . . . . . . . . . . . . . . 92262.4 Constructing Algebras by Structure Constants . . . . . . . . . . . . . . . . . . . . 92362.5 Some Special Algebras . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92662.6 Subalgebras . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92862.7 Ideals of Algebras . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92962.8 Categories and Properties of Algebras . . . . . . . . . . . . . . . . . . . . . . . . 93062.9 Attributes and Operations for Algebras . . . . . . . . . . . . . . . . . . . . . . . . 93262.10 Homomorphisms of Algebras . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94062.11 Representations of Algebras . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 945

    63 Finitely Presented Algebras 955

    64 Lie Algebras 95664.1 Lie Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95664.2 Constructing Lie algebras . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95864.3 Distinguished Subalgebras . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96164.4 Series of Ideals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96364.5 Properties of a Lie Algebra . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96464.6 Semisimple Lie Algebras and Root Systems . . . . . . . . . . . . . . . . . . . . . 96564.7 Semisimple Lie Algebras and Weyl Groups of Root Systems . . . . . . . . . . . . 96864.8 Restricted Lie algebras . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97164.9 The Adjoint Representation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97364.10 Universal Enveloping Algebras . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97564.11 Finitely Presented Lie Algebras . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97564.12 Modules over Lie Algebras and Their Cohomology . . . . . . . . . . . . . . . . . 97764.13 Modules over Semisimple Lie Algebras . . . . . . . . . . . . . . . . . . . . . . . . 98064.14 Admissible Lattices in UEA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98164.15 Tensor Products and Exterior and Symmetric Powers . . . . . . . . . . . . . . . . . 984

    65 Magma Rings 98665.1 Free Magma Rings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98765.2 Elements of Free Magma Rings . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98865.3 Natural Embeddings related to Magma Rings . . . . . . . . . . . . . . . . . . . . . 98965.4 Magma Rings modulo Relations . . . . . . . . . . . . . . . . . . . . . . . . . . . 99065.5 Magma Rings modulo the Span of a Zero Element . . . . . . . . . . . . . . . . . . 99165.6 Technical Details about the Implementation of Magma Rings . . . . . . . . . . . . 992

    66 Polynomials and Rational Functions 99366.1 Indeterminates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99366.2 Operations for Rational Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . 99666.3 Comparison of Rational Functions . . . . . . . . . . . . . . . . . . . . . . . . . . 997

  • GAP - Reference Manual 18

    66.4 Properties and Attributes of Rational Functions . . . . . . . . . . . . . . . . . . . . 99866.5 Univariate Polynomials . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100166.6 Polynomials as Univariate Polynomials in one Indeterminate . . . . . . . . . . . . 100366.7 Multivariate Polynomials . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100566.8 Minimal Polynomials . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100666.9 Cyclotomic Polynomials . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100666.10 Polynomial Factorization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100666.11 Polynomials over the Rationals . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100766.12 Factorization of Polynomials over the Rationals . . . . . . . . . . . . . . . . . . . 100866.13 Laurent Polynomials . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100966.14 Univariate Rational Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101066.15 Polynomial Rings and Function Fields . . . . . . . . . . . . . . . . . . . . . . . . 101066.16 Univariate Polynomial Rings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101366.17 Monomial Orderings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101466.18 Groebner Bases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101866.19 Rational Function Families . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101966.20 The Representations of Rational Functions . . . . . . . . . . . . . . . . . . . . . . 102066.21 The Defining Attributes of Rational Functions . . . . . . . . . . . . . . . . . . . . 102166.22 Creation of Rational Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102366.23 Arithmetic for External Representations of Polynomials . . . . . . . . . . . . . . . 102466.24 Cancellation Tests for Rational Functions . . . . . . . . . . . . . . . . . . . . . . . 1025

    67 Algebraic extensions of fields 102667.1 Creation of Algebraic Extensions . . . . . . . . . . . . . . . . . . . . . . . . . . . 102667.2 Elements in Algebraic Extensions . . . . . . . . . . . . . . . . . . . . . . . . . . . 1027

    68 p-adic Numbers (preliminary) 102968.1 Pure p-adic Numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102968.2 Extensions of the p-adic Numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . 1030

    69 The MeatAxe 103369.1 MeatAxe Modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103369.2 Module Constructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103469.3 Selecting a Different MeatAxe . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103469.4 Accessing a Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103469.5 Irreducibility Tests . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103569.6 Decomposition of modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103569.7 Finding Submodules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103669.8 Induced Actions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103869.9 Module Homomorphisms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103969.10 Module Homomorphisms for irreducible modules . . . . . . . . . . . . . . . . . . 103969.11 MeatAxe Functionality for Invariant Forms . . . . . . . . . . . . . . . . . . . . . . 104069.12 The Smash MeatAxe . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104169.13 Smash MeatAxe Flags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1043

  • GAP - Reference Manual 19

    70 Tables of Marks 104570.1 More about Tables of Marks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104570.2 Table of Marks Objects in GAP . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104670.3 Constructing Tables of Marks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104770.4 Printing Tables of Marks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104870.5 Sorting Tables of Marks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105070.6 Technical Details about Tables of Marks . . . . . . . . . . . . . . . . . . . . . . . 105170.7 Attributes of Tables of Marks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105270.8 Properties of Tables of Marks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105770.9 Other Operations for Tables of Marks . . . . . . . . . . . . . . . . . . . . . . . . . 105770.10 Accessing Subgroups via Tables of Marks . . . . . . . . . . . . . . . . . . . . . . 106270.11 The Interface between Tables of Marks and Character Tables . . . . . . . . . . . . 106470.12 Generic Construction of Tables of Marks . . . . . . . . . . . . . . . . . . . . . . . 106670.13 The Library of Tables of Marks . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1067

    71 Character Tables 106871.1 Some Remarks about Character Theory in GAP . . . . . . . . . . . . . . . . . . . 106871.2 History of Character Theory Stuff in GAP . . . . . . . . . . . . . . . . . . . . . . 107071.3 Creating Character Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107171.4 Character Table Categories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107471.5 Conventions for Character Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . 107571.6 The Interface between Character Tables and Groups . . . . . . . . . . . . . . . . . 107671.7 Operators for Character Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107971.8 Attributes and Properties for Groups and Character Tables . . . . . . . . . . . . . . 107971.9 Attributes and Properties only for Character Tables . . . . . . . . . . . . . . . . . . 108371.10 Normal Subgroups Represented by Lists of Class Positions . . . . . . . . . . . . . 108771.11 Operations Concerning Blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109171.12 Other Operations for Character Tables . . . . . . . . . . . . . . . . . . . . . . . . 109471.13 Printing Character Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109871.14 Computing the Irreducible Characters of a Group . . . . . . . . . . . . . . . . . . 110271.15 Representations Given by Modules . . . . . . . . . . . . . . . . . . . . . . . . . . 110571.16 The Dixon-Schneider Algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . 110671.17 Advanced Methods for Dixon-Schneider Calculations . . . . . . . . . . . . . . . . 110671.18 Components of a Dixon Record . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110871.19 An Example of Advanced Dixon-Schneider Calculations . . . . . . . . . . . . . . 110971.20 Constructing Character Tables from Others . . . . . . . . . . . . . . . . . . . . . . 111171.21 Sorted Character Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111471.22 Automorphisms and Equivalence of Character Tables . . . . . . . . . . . . . . . . 111771.23 Storing Normal Subgroup Information . . . . . . . . . . . . . . . . . . . . . . . . 1119

    72 Class Functions 112272.1 Why Class Functions? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112272.2 Basic Operations for Class Functions . . . . . . . . . . . . . . . . . . . . . . . . . 112572.3 Comparison of Class Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112672.4 Arithmetic Operations for Class Functions . . . . . . . . . . . . . . . . . . . . . . 112672.5 Printing Class Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113072.6 Creating Class Functions from Values Lists . . . . . . . . . . . . . . . . . . . . . . 1131

  • GAP - Reference Manual 20

    72.7 Creating Class Functions using Groups . . . . . . . . . . . . . . . . . . . . . . . . 113272.8 Operations for Class Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113372.9 Restricted and Induced Class Functions . . . . . . . . . . . . . . . . . . . . . . . . 114072.10 Reducing Virtual Characters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114272.11 Symmetrizations of Class Functions . . . . . . . . . . . . . . . . . . . . . . . . . 114972.12 Molien Series . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115272.13 Possible Permutation Characters . . . . . . . . . . . . . . . . . . . . . . . . . . . 115472.14 Computing Possible Permutation Characters . . . . . . . . . . . . . . . . . . . . . 115772.15 Operations for Brauer Characters . . . . . . . . . . . . . . . . . . . . . . . . . . . 116272.16 Domains Generated by Class Functions . . . . . . . . . . . . . . . . . . . . . . . . 1163

    73 Maps Concerning Character Tables 116473.1 Power Maps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116473.2 Orbits on Sets of Possible Power Maps . . . . . . . . . . . . . . . . . . . . . . . . 116873.3 Class Fusions between Character Tables . . . . . . . . . . . . . . . . . . . . . . . 116973.4 Orbits on Sets of Possible Class Fusions . . . . . . . . . . . . . . . . . . . . . . . 117573.5 Parametrized Maps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117573.6 Subroutines for the Construction of Power Maps . . . . . . . . . . . . . . . . . . . 118473.7 Subroutines for the Construction of Class Fusions . . . . . . . . . . . . . . . . . . 1188

    74 Unknowns 119174.1 More about Unknowns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1191

    75 Monomiality Questions 119475.1 InfoMonomial (Info Class) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119575.2 Character Degrees and Derived Length . . . . . . . . . . . . . . . . . . . . . . . . 119575.3 Primitivity of Characters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119675.4 Testing Monomiality . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119875.5 Minimal Nonmonomial Groups . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1202

    76 Using GAP Packages 120376.1 Installing a GAP Package . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120376.2 Loading a GAP Package . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120476.3 Functions for GAP Packages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1207

    77 Replaced and Removed Command Names 121577.1 Group Actions Name Changes . . . . . . . . . . . . . . . . . . . . . . . . . . . 121577.2 Package Interface Obsolete Functions and Name Changes . . . . . . . . . . . . . 121677.3 Normal Forms of Integer Matrices Name Changes . . . . . . . . . . . . . . . . . 121677.4 Miscellaneous Name Changes or Removed Names . . . . . . . . . . . . . . . . . . 121677.5 The former .gaprc file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121777.6 Semigroup properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1217

    78 Method Selection 121978.1 Operations and Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121978.2 Method Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121978.3 Applicable Methods and Method Selection . . . . . . . . . . . . . . . . . . . . . . 122078.4 Partial Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1221

  • GAP - Reference Manual 21

    78.5 Redispatching . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122178.6 Immediate Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122278.7 Logical Implications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122378.8 Operations and Mathematical Terms . . . . . . . . . . . . . . . . . . . . . . . . . 1223

    79 Creating New Objects 122579.1 Creating Categories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122579.2 Creating Representations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122679.3 Creating Attributes and Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . 122679.4 Creating Other Filters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122779.5 Creating Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122879.6 Creating Constructors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122879.7 Creating Families . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122879.8 Creating Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123079.9 Creating Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123079.10 Component Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123179.11 Positional Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123279.12 Implementing New List Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123479.13 Example Constructing Enumerators . . . . . . . . . . . . . . . . . . . . . . . . . 123479.14 Example Constructing Iterators . . . . . . . . . . . . . . . . . . . . . . . . . . . 123779.15 Arithmetic Issues in the Implementation of New Kinds of Lists . . . . . . . . . . . 123879.16 External Representation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123979.17 Mutability and Copying . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124079.18 Global Variables in the Library . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124279.19 Declaration and Implementation Part . . . . . . . . . . . . . . . . . . . . . . . . . 1245

    80 Examples of Extending the System 124780.1 Addition of a Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124780.2 Extending the Range of Definition of an Existing Operation . . . . . . . . . . . . . 124980.3 Enforcing Property Tests . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124980.4 Adding a new Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125080.5 Adding a new Attribute . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125080.6 Adding a new Representation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125180.7 Components versus Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125380.8 Adding new Concepts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125380.9 Creating Own Arithmetic Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . 1256

    81 An Example Residue Class Rings 125981.1 A First Attempt to Implement Elements of Residue Class Rings . . . . . . . . . . . 125981.2 Why Proceed in a Different Way? . . . . . . . . . . . . . . . . . . . . . . . . . . . 126081.3 A Second Attempt to Implement Elements of Residue Class Rings . . . . . . . . . 126181.4 Compatibility of Residue Class Rings with Prime Fields . . . . . . . . . . . . . . . 127281.5 Further Improvements in Implementing Residue Class Rings . . . . . . . . . . . . 1278

    82 An Example Designing Arithmetic Operations 128082.1 New Arithmetic Operations vs. New Objects . . . . . . . . . . . . . . . . . . . . . 128082.2 Designing new Multiplicative Objects . . . . . . . . . . . . . . . . . . . . . . . . . 1281

  • GAP - Reference Manual 22

    83 Library Files 128783.1 File Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128783.2 Finding Implementations in the Library . . . . . . . . . . . . . . . . . . . . . . . . 128783.3 Undocumented Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1288

    84 Interface to the GAP Help System 129084.1 Installing and Removing a Help Book . . . . . . . . . . . . . . . . . . . . . . . . . 129084.2 The manual.six File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129184.3 The Help Book Handler . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129184.4 Introducing new Viewer for the Online Help . . . . . . . . . . . . . . . . . . . . . 1293

    85 Function-Operation-Attribute Triples 129485.1 Key Dependent Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129485.2 In Parent Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129585.3 Operation Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1296

    86 Weak Pointers 130086.1 Weak Pointer Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130086.2 Low Level Access Functions for Weak Pointer Objects . . . . . . . . . . . . . . . . 130186.3 Accessing Weak Pointer Objects as Lists . . . . . . . . . . . . . . . . . . . . . . . 130286.4 Copying Weak Pointer Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130286.5 The GASMAN Interface for Weak Pointer Objects . . . . . . . . . . . . . . . . . . 1303

    87 More about Stabilizer Chains 130487.1 Generalized Conjugation Technique . . . . . . . . . . . . . . . . . . . . . . . . . . 130487.2 The General Backtrack Algorithm with Ordered Partitions . . . . . . . . . . . . . . 130587.3 Stabilizer Chains for Automorphisms Acting on Enumerators . . . . . . . . . . . . 1313

    References 1326

    Index 1327

  • Chapter 1

    Preface

    Welcome to GAP. This is one of three manuals documenting the core part of GAP, the other beingthe GAP Tutorial . and the document called GAP - Changes from Earlier Versions .

    This preface serves not only to introduce The GAP Reference Manual, but also as an introduc-tion to the whole system.

    GAP stands for Groups, Algorithms and Programming. The name was chosen to reflect the aimof the system, which is introduced in this reference manual. Since that choice, the system has becomesomewhat broader, and you will also find information about algorithms and programming for otheralgebraic structures, such as semigroups and algebras.

    This manual, the GAP reference manual contains the official definitions of GAP functions. Itshould contain all the information needed to use GAP, and is not intended to be read cover-to-cover.

    To get started a new user may first look at parts of the GAP Tutorial .A lot of the functionality of the system and a number of contributed extensions are provided as

    GAP packages which are developed independently of the core part of GAP and can be loaded intoa GAP session. Each package comes with a its own manual which is also available through the GAPhelp system.

    This manual is divided into chapters, sections and subsections. Chapter 2 describes the helpsystem, which provides access to all the manuals from a running GAP session. Chapter 3 givestechnical advice for running GAP. Chapter 4 introduces the GAP language, and the next chaptersdeal with the environment provided by GAP for the user. These are followed by the main bulk ofchapters which are devoted to the various mathematical structures that GAP can handle.

    Subsequent sections of this preface explain the structure of the system and provide copyright andlicensing information.

    1.1 The GAP System

    GAP is a free, open and extensible software package for computation in discrete abstract algebra. Theterms free and open describe the conditions under which the system is distributed in brief, it isfree of charge (except possibly for the immediate costs of delivering it to you), you are free to pass iton within certain limits, and all of the workings of the system are open for you to examine and change.Details of these conditions can be found in Section (Reference: Copyright and License).

    The system is extensible in that you can write your own programs in the GAP language, anduse them in just the same way as the programs which form part of the system (the library). Indeed,we actively support the contribution, refereeing and distribution of extensions to the system, in the

    23

  • GAP - Reference Manual 24

    form of GAP packages. Further details of this can be found in chapter (Reference: Using GAPPackages), and on our website.

    Development of GAP began at Lehrstuhl D fr Mathematik, RWTH-Aachen, under the leader-ship of Joachim Neubser in 1985. Version 2.4 was released in 1988 and version 3.1 in 1992. In1997 coordination of GAP development, now very much an international effort, was transferred toSt Andrews. A complete internal redesign and almost complete rewrite of the system was completedover the following years and version 4.1 was released in July 1999. A sign of the further internation-alization of the project was the GAP 4.4 release in 2004, which has been coordinated from ColoradoState University, Fort Collins.

    More information on the motivation and development of GAP to date, can be found on our Webpages in a section entitled Release history and Prefaces.

    For those readers who have used an earlier version of GAP, an overview of the changes fromGAP 4.4 and a brief summary of changes from earlier versions is given in a separate manual(Changes: Changes between GAP 4.4 and GAP 4.5).

    The system that you are getting now consists of a core system and a number of packages. Thecore system consists of four main parts.

    1. A kernel, written in C, which provides the user with

    automatic dynamic storage management, which the user neednt bother about in his pro-gramming;

    a set of time-critical basic functions, e.g. arithmetic, operations for integers, finite fields,permutations and words, as well as natural operations for lists and records;

    an interpreter for the GAP language, an untyped imperative programming language withfunctions as first class objects and some extra built-in data types such as permutations andfinite field elements. The language supports a form of object-oriented programming, simi-lar to that supported by languages like C++ and Java but with some important differences.

    a small set of system functions allowing the GAP programmer to handle files and executeexternal programs in a uniform way, regardless of the particular operating system in use.

    a set of programming tools for testing, debugging, and timing algorithms.

    a read-eval-view style user interface.

    2. A much larger library of GAP functions that implement algebraic and other algorithms. Sincethis is written entirely in the GAP language, the GAP language is both the main implementationlanguage and the user language of the system. Therefore the user can as easily as the originalprogrammers investigate and vary algorithms of the library and add new ones to it, first for ownuse and eventually for the benefit of all GAP users.

    3. A library of group theoretical data which contains various libraries of groups, including thelibrary of small groups (containing all groups of order at most 2000, except those of order1024) and others. Large libraries of ordinary and Brauer character tables and Tables of Marksare included as packages.

    4. The documentation. This is available as on-line help, as printable files in PDF format and asHTML for viewing with a Web browser.

    Also included with the core system are some test files and a few small utilities which we hope youwill find useful.

  • GAP - Reference Manual 25

    GAP packages are self-contained extensions to the core system. A package contains GAPcode and its own documentation and may also contain data files or external programs to which theGAP code provides an interface. These packages may be loaded into GAP using the LoadPackage(Reference: LoadPackage) command, and both the package and its documentation are then availablejust as if they were parts of the core system. Some packages may be loaded automatically, when GAPis started, if they are present. Some packages, because they depend on external programs, may onlybe available on the operating systems where those programs are available (usually UNIX). You shouldnote that, while the packages included with this release are the most recent versions ready for releaseat this time, new packages and new versions may be released at any time and can be easily installedin your copy of GAP.

    With GAP there are two packages (the library of ordinary and Brauer character tables, and thelibrary of tables of marks) which contain functionality developed from parts of the GAP core system.These have been moved into packages for ease of maintenance and to allow new versions to be releasedindependently of new releases of the core system. The library of small groups should also be regardedas a package, although it does not currently use the standard package mechanism. Other packagescontain functionality which has never been part of the core system, and may extend it substantially,implementing specific algorithms to enhance its capabilities, providing data libraries, interfaces toother computer algebra systems and data sources such as the electronic version of the Atlas of FiniteGroup Representations; therefore, installation and usage of packages is recommended.

    Further details about GAP packages can be found in chapter (Reference: Using GAP Packages),and on the GAP website here: https://www.gap-system.org/Packages/packages.html.

    1.2 Authors and Maintainers

    GAP is the work of very many people, many of whom still maintain parts of the system. A com-plete list of authors, and an approximation to the current list of maintainers can be found on theGAP World Wide Web site at https://www.gap-system.org/Contacts/People/authors.htmland https://www.gap-system.org/Contacts/People/modules.html. All GAP packages havetheir own authors and maintainers. It should however be noted that some packages provide interfacesbetween GAP and an external program, a copy of which is included for convenience, and that, inthese cases, we do not claim that the package authors or maintainers wrote, or maintain, this externalprogram. Similarly, the system and some packages include large data libraries that may have beencomputed by many people. We try to make clear in each case what credit is attributable to whom.

    We have, for some time, operated a refereeing system for contributed packages, both to ensure thequality of the software we distribute, and to provide recognition for the authors. We now consider thisto be a refereeing system for modules, and we would note, in particular that, although it does not usethe standard package interface, the library of small groups has been refereed and accepted on exactlythe same basis as the accepted packages.

    We also include with this distribution a number of packages which have not (yet) gone throughour refereeing process. Some may be accepted in the future, in other cases the authors have chosennot to submit them. More information can be found on our World Wide Web site (see Section 1.5).

    1.3 Acknowledgements

    Very many people have worked on, and contributed to, GAP over the years since its inception. On ourWeb site you will find the prefaces to the previous releases, each of which acknowledges people who

    https://www.gap-system.org/Packages/packages.htmlhttps://www.gap-system.org/Contacts/People/authors.htmlhttps://www.gap-system.org/Contacts/People/modules.html

  • GAP - Reference Manual 26

    have made special contributions to that release. Even so, it is appropriate to mention here JoachimNeubser whose vision of a free, open and extensible system for computational algebra inspired GAPin the first place, and Martin Schnert, who was the technical architect of GAP 3 and GAP 4.

    1.4 Copyright and License

    Copyright (1987-2018) by the GAP Group,incorporating the Copyright 1999, 2000 by School of Mathematical and Computational Sci-

    ences, University of St Andrews, North Haugh, St Andrews, Fife KY16 9SS, Scotlandbeing the Copyright 1992 by Lehrstuhl D fr Mathematik, RWTH, 52056 Aachen, Germany,

    transferred to St Andrews on July 21st, 1997.except for files in the distribution, which have an explicit different copyright statement. In par-

    ticular, the copyright of packages distributed with GAP is usually with the package authors or theirinstitutions.

    GAP is free software; you can redistribute it and/or modify it under the terms of the GNU GeneralPublic License as published by the Free Software Foundation; either version 2 of the License, or (atyour option) any later version. For details, see the file GPL in the etc directory of the GAP distributionor see http://www.gnu.org/licenses/gpl.html.

    If you obtain GAP please send us a short notice to that effect, e.g., an e-mail message to theaddress [email protected]. This helps us to keep track of the number of GAP users.

    If you publish a mathematical result that was partly obtained using GAP, please cite GAP, just asyou would cite another paper that you used (see below for sample citation). Also we would appreciateif you could inform us about such a paper, which we will add to the GAP bibliography.

    Specifically, please refer to

    [GAP] The GAP Group, GAP - Groups, Algorithms, and Programming,Version 4.8.10; 2018 (https://www.gap-system.org)

    You are permitted to modify and redistribute GAP, but you are not allowed to restrict furtherredistribution. That is to say proprietary modifications will not be allowed. We want all versions ofGAP to remain free.

    If you modify any part of GAP and redistribute it, you must supply a README document. Thisshould specify what modifications you made in which files. We do not want to take credit or beblamed for your modifications.

    Of course we are interested in all of your modifications. In particular we would like to see bug-fixes, improvements and new functions. So again we would appreciate it if you would inform us aboutall modifications you make.

    In addition to the general copyright for GAP set forth above, the following terms apply to theversions of GAP for Windows.

    The executable of GAP for Windows that we distribute was compiled with the gcc compilersupplied with Cygwin installation (http://cygwin.com/).

    The GNU C compiler isCopyright 2010 Free Software Foundation, Inc.under the terms of the GNU General Public License (GPL).The Cygwin API library is also covered by the GNU GPL. The executable we provide is linked

    against this library (and in the process includes GPLd Cygwin glue code). This means that theexecutable falls under the GPL too, which it does anyhow.

    http://www.gnu.org/licenses/gpl.htmlmailto://[email protected]://www.gap-system.org/Doc/Bib/bib.htmlhttp://cygwin.com/

  • GAP - Reference Manual 27

    The cyggcc_s-1.dll, cygncurses-10.dll, cygncursesw-10.dll, cygpanel-10.dll,cygpopt-0.dll, cygreadline7.dll, cygstart.exe, cygwin1.dll, libW11.dll, mintty.exe,rxvt.exe and regtool.exe are taken unmodified from the Cygwin distribution. They are copy-right by RedHat Software and released under the GPL. For more information on Cygwin, seehttp://www.cygwin.com.

    Please contact [email protected] if you need further information.

    1.5 Further Information about GAP

    Information about GAP is best obtained from the GAP websitehttps://www.gap-system.orgThere you will find, amongst other things

    directions to the sites from which you can download the current GAP distribution, all acceptedand deposited GAP packages, and a selection of other contributions.

    the GAP manual and an archive of the gap-forum mailing list, formatted for reading with aWeb browser, and indexed for searching.

    information about GAP developers, and about the email addresses available for comment, dis-cussion and support.

    We would particularly ask you to note the following things:

    The GAP Forum an email discussion forum for comments, discussions or questions aboutGAP. You must subscribe to the list before you can post to it, see the website for details. Inparticular we will announce new releases in this mailing list.

    The email address [email protected] to which you are asked to send any questionsor bug reports which do not seem likely to be of interest to the whole GAP Forum. Please givea (short, if possible) self-contained excerpt of a GAP session containing both input and outputthat illustrates your problem (including comments of why you think it is a bug) and state thetype of the machine, operating system, (compiler used, if UNIX/Linux) and the version of GAPyou are using (the first line after the GAP 4 banner starting GAP, Version 4...).

    We also ask you to send a brief message to [email protected] when you install GAP.

    The correct form of citation of GAP, which we ask you use whenever you publish scientificresults obtained using GAP.

    It finally remains for us to wish you all pleasure and success in using GAP, and to invite yourconstructive comment and criticism.

    The GAP Group,15-Jan-2018

    http://www.cygwin.commailto://[email protected]://www.gap-system.orgmailto://[email protected]://[email protected]

  • Chapter 2

    The Help System

    This chapter describes the GAP help system. The help system lets you read the documentation inter-actively.

    2.1 Invoking the Help

    The basic command to read GAPs documentation from within a GAP session is as follows.?[book:][?]topicFor an explanation and some examples see (Tutorial: Help).Note that the first question mark must appear in the first position after the gap> prompt. The

    search strings book and topic are normal