File: grptbl.gd

package info (click to toggle)
gap 4r4p10-2
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 29,224 kB
  • ctags: 7,084
  • sloc: ansic: 98,591; sh: 3,284; perl: 2,263; makefile: 467; awk: 6
file content (137 lines) | stat: -rw-r--r-- 4,877 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
#############################################################################
##
#W  grptbl.gd                   GAP library                     Thomas Breuer
##
#H  @(#)$Id: grptbl.gd,v 4.11.4.1 2005/05/06 08:46:30 gap Exp $
##
#Y  Copyright (C)  1997,  Lehrstuhl D fuer Mathematik,  RWTH Aachen,  Germany
#Y  (C) 1998 School Math and Comp. Sci., University of St.  Andrews, Scotland
#Y  Copyright (C) 2002 The GAP Group
##
##  This file contains the implementation of magmas, monoids, and groups from
##  a multiplication table.
##
Revision.grptbl_gd :=
    "@(#)$Id: grptbl.gd,v 4.11.4.1 2005/05/06 08:46:30 gap Exp $";


#############################################################################
##  
#F  MagmaByMultiplicationTableCreator( <A>, <domconst> )
##  
##  This is a utility for the uniform construction of a magma,
##  a magma-with-one, or a magma-with-inverses from a multiplication table.
##
DeclareGlobalFunction( "MagmaByMultiplicationTableCreator" );


#############################################################################
##
#F  MagmaByMultiplicationTable( <A> )
##
##  For a square matrix <A> with $n$ rows such that all entries of <A> are
##  in the range $[ 1 \.\. n ]$, `MagmaByMultiplicationTable' returns a magma
##  $M$ with multiplication `\*' defined by $A$.
##  That is, $M$ consists of the elements $m_1, m_2, \ldots, m_n$,
##  and $m_i \* m_j = m_{A[i][j]}$.
##
##  The ordering of elements is defined by $m_1 \< m_2 \< \cdots \< m_n$,
##  so $m_i$ can be accessed as `MagmaElement( <M>, <i> )',
##  see~"MagmaElement".
##
DeclareGlobalFunction( "MagmaByMultiplicationTable" );


#############################################################################
##
#F  MagmaWithOneByMultiplicationTable( <A> )
##
##  The only differences between `MagmaByMultiplicationTable' and
##  `MagmaWithOneByMultiplicationTable' are that the latter returns a
##  magma-with-one (see~"MagmaWithOne") if the magma described by the matrix
##  <A> has an identity,
##  and returns `fail' if not.
##
DeclareGlobalFunction( "MagmaWithOneByMultiplicationTable" );


#############################################################################
##
#F  MagmaWithInversesByMultiplicationTable( <A> )
##
##  `MagmaByMultiplicationTable' and `MagmaWithInversesByMultiplicationTable'
##  differ only in that the latter returns
##  magma-with-inverses (see~"MagmaWithInverses") if each element in the
##  magma described by the matrix <A> has an inverse,
##  and returns `fail' if not.
##
DeclareGlobalFunction( "MagmaWithInversesByMultiplicationTable" );


#############################################################################
##
#F  MagmaElement( <M>, <i> ) . . . . . . . . . .  <i>-th element of magma <M>
##
##  For a magma <M> and a positive integer <i>, `MagmaElement' returns the
##  <i>-th element of <M>, w.r.t.~the ordering `\<'.
##  If <M> has less than <i> elements then `fail' is returned.
##
DeclareGlobalFunction( "MagmaElement" );


#############################################################################
##
#F  SemigroupByMultiplicationTable( <A> )
##
##  returns the semigroup whose multiplication is defined by the square
##  matrix <A> (see~"MagmaByMultiplicationTable") if such a semigroup exists.
##  Otherwise `fail' is returned.
##
DeclareGlobalFunction( "SemigroupByMultiplicationTable" );


#############################################################################
##
#F  MonoidByMultiplicationTable( <A> )
##
##  returns the monoid whose multiplication is defined by the square
##  matrix <A> (see~"MagmaByMultiplicationTable") if such a monoid exists.
##  Otherwise `fail' is returned.
##
DeclareGlobalFunction( "MonoidByMultiplicationTable" );


#############################################################################
##
#F  GroupByMultiplicationTable( <A> )
##
##  returns the group whose multiplication is defined by the square
##  matrix <A> (see~"MagmaByMultiplicationTable") if such a group exists.
##  Otherwise `fail' is returned.
##
DeclareGlobalFunction( "GroupByMultiplicationTable" );


#############################################################################
##
#A  MultiplicationTable( <elms> )
#A  MultiplicationTable( <M> )
##
##  For a list <elms> of elements that form a magma $M$,
##  `MultiplicationTable' returns a square matrix $A$ of positive integers
##  such that $A[i][j] = k$ holds if and only if
##  `<elms>[i] \* <elms>[j] = <elms>[k]'.
##  This matrix can be used to construct a magma isomorphic to $M$,
##  using `MagmaByMultiplicationTable'.
##
##  For a magma <M>, `MultiplicationTable' returns the multiplication table
##  w.r.t.~the sorted list of elements of <M>.
##
DeclareAttribute( "MultiplicationTable", IsHomogeneousList );
DeclareAttribute( "MultiplicationTable", IsMagma );


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