## bytable.gd RAQ Quasigroups, racks, and quandles by multiplication tables. #! @Chapter basic #! @Section table_predicates #! @SectionTitle Predicates on multiplication tables #! @Arguments matrix #! @Description This property is true if matrix is the multiplication #! table of a magma which satisfies the left self-distributive property (see #! )) #! for all triples of elements. DeclareProperty( "IsLeftSelfDistributiveTable", IsMatrix ); #! @Arguments matrix #! @Description This property is true if matrix is the multiplication #! table of a magma which satisfies the rightt self-distributive property (see #! )) #! for all triples of elements. DeclareProperty( "IsRightSelfDistributiveTable", IsMatrix ); #! @Arguments matrix #! @Description This property is true if for all $i$ less than or equal to the #! number of rows of matrix, the $(i,i)$ entry of matrix is #! $i$. DeclareProperty( "IsElementwiseIdempotentTable", IsMatrix ); #! @Chapter operate #! @Section table #! @Section Information related to the multiplication table. #! Note that typically the functions in this section will fail unless the #! argument was either created with a multiplication table, or at least has #! had its multiplication table explicitly computed. #! @Arguments obj #! @Returns a list of permutations of length equal to `Size(obj)`, or fail #! @Description The $i$th element of the list returned is the permutation #! determined by the $i$th row of the multiplication table of #! obj (in the sense of the core ⪆ #! function `PermList`). Returns fail if any row of the multiplication table #! does not determine a permuation. DeclareAttribute("LeftPerms", HasMultiplicationTable); #! @BeginExampleSession #! gap> D3 := LeftQuandleByMultiplicationTable([[1,3,2],[3,2,1],[2,1,3]]); #! #! gap> LeftPerms(D3); #! [ (2,3), (1,3), (1,2) ] #! @EndExampleSession #! @Arguments obj #! @Returns a list of permutations of length equal to `Size(obj)`, or fail #! @Description The $i$th element of the list returned is the permutation #! determined by the $i$th column of the multiplication table of #! obj (in the sense of the core ⪆ #! function `PermList`). Returns fail if any column of the multiplication table #! does not determine a permuation. DeclareAttribute("RightPerms", HasMultiplicationTable); #! @Arguments obj #! @Returns an operation table matrix, or fail #! @Description Presuming it is well-defined, this produces the operation #! table (following similar conventions for multiplication tables, e.g., #! every entry is a natural number less than `Size(obj)`) for `LeftQuotient` #! on the given obj. Returns fail if `LeftQuotient` is not #! well-defined for obj. DeclareAttribute("LeftDivisionTable", HasMultiplicationTable); #! @Arguments obj #! @Returns an operation table matrix, or fail #! @Description Presuming it is well-defined, this produces the operation #! table for `\/` (the typical elementwise (right) quotient) on the given #! obj. Returns fail if `\/` is not #! well-defined for obj. DeclareAttribute("RightDivisionTable", HasMultiplicationTable); #! @BeginExampleSession #! gap> A4 := RightQuandleByMultiplicationTable([[1,4,2,3], #! > [3,2,4,1], #! > [4,1,3,2], #! > [2,3,1,4]]); #! #! gap> RightDivisionTable(A4); #! [ [ 1, 3, 4, 2 ], [ 4, 2, 1, 3 ], [ 2, 4, 3, 1 ], [ 3, 1, 2, 4 ] ] #! @EndExampleSession #! @Chapter construct #! @Section from_scratch #! @BeginGroup table_constructors #! @GroupTitle Constructors from tables #! @Returns a magma of the designated category #! @Description These functions produce magmas from their multiplication #! tables, exactly analogously with the core ⪆ function #! `MagmaByMultiplicationTable` (q.v.); all of the same conventions are #! followed, such as the table should be an $n\times n$ matrix in which #! every entry is a natural number less than or equal to $n$. These #! functions verify that the tables supplied in fact define an example of #! the designated category. #! @GroupInitialArguments table DeclareGlobalFunction("LeftQuasigroupByMultiplicationTable"); DeclareGlobalFunction("LeftRackByMultiplicationTable"); DeclareGlobalFunction("LeftQuandleByMultiplicationTable"); DeclareGlobalFunction("RightQuasigroupByMultiplicationTable"); DeclareGlobalFunction("RightRackByMultiplicationTable"); DeclareGlobalFunction("RightQuandleByMultiplicationTable"); #! @EndGroup #! @BeginExampleSession #! gap> D3 := LeftQuandleByMultiplicationTable([[1,3,2],[3,2,1],[2,1,3]]); #! #! gap> SpecifyElmNamePrefix(D3, "d"); #! gap> Elements(D3); #! [ d1, d2, d3 ] #! gap> IsBound(d1); #! false #! gap> BindElmNames(D3); #! gap> d1 * d2; #! d3 #! @EndExampleSession #! @BeginGroup unchecked_table_constructors #! @GroupTitle Unchecked constructors from tables #! @Returns a magma of the designated category #! @Description Each of these functions is exactly like its counterpart #! without the `NC` suffix, except that it does not perform any verification #! that the supplied table in fact satisfies the necessary axioms for the #! designated category. (The verification is skipped to save computation #! time, for use in cases when the properties are known to hold.) Hence, use #! with caution: the behavior of this #! package if you supply a table which does not satisfy the appropiate #! axioms is undefined. #! @GroupInitialArguments table DeclareGlobalFunction("LeftQuasigroupByMultiplicationTableNC"); DeclareGlobalFunction("LeftRackByMultiplicationTableNC"); DeclareGlobalFunction("LeftQuandleByMultiplicationTableNC"); DeclareGlobalFunction("RightQuasigroupByMultiplicationTableNC"); DeclareGlobalFunction("RightRackByMultiplicationTableNC"); DeclareGlobalFunction("RightQuandleByMultiplicationTableNC"); #! @EndGroup ## Property of a collection that its elements know their multiplication table #! @Chapter technical #! @Section reps #! @SectionTitle Representational issues #! @Arguments collection #! @Description True if the family of the elements in the collection possesses #! a global multiplication table. This value is used to control whether more #! efficient algorithms are used in particular cases. DeclareProperty("IsBuiltFromMultiplicationTable", IsCollection); ## Create quasigroups etc by permutations #! @Chapter construct #! @Section from_scratch #! @BeginGroup perms_constructors #! @GroupTitle Constructors from permutations #! @Returns a magma of the designated category #! @Description These functions produce magmas from a sequence of #! permutations. That is to say, because all of the categories supported in #! &RAQ; are quasigroups on at least one side, either the left #! multiplicative action of an element on the magma is always a permutation #! (in the case of left quasigroups) or the right multiplicative action of #! an element on the magma is always a permutation. Hence, a magma in these #! categories can always be specified by a list of $n$ permutations on #! the natural numbers less than or equal to $n$ (i.e., ordinary ⪆ #! permutations) and that's what these #! functions do. In effect, the argument to the `Left` functions gives the #! rows of the multiplication table (as permutation objects), and the to the #! `Right` functions gives the columns. #! @GroupInitialArguments permutation-list DeclareGlobalFunction("LeftQuasigroupByPerms"); DeclareGlobalFunction("LeftRackByPerms"); DeclareGlobalFunction("LeftQuandleByPerms"); DeclareGlobalFunction("RightQuasigroupByPerms"); DeclareGlobalFunction("RightRackByPerms"); DeclareGlobalFunction("RightQuandleByPerms"); #! @EndGroup #! @BeginExampleSession #! gap> D3 := LeftQuandleByPerms( [ (2,3), (1,3), (1,2) ] ); #! #! gap> SpecifyElmNamePrefix(D3, "p"); #! gap> BindElmNames(D3); #! gap> p2*p3; #! p1 #! @EndExampleSession #! @BeginGroup unchecked_perms_constructors #! @GroupTitle Unchecked constructors from permutations #! @Returns a magma of the designated category #! @Description These functions are exactly the same as their counterparts #! without `NC` except that to save time they do not verify that the given #! permutations satisfy the appropriate axioms. Hence use caution, as #! supplying a list of permutations which does not form the proper structure #! can lead to undefined behavior. Note that there are no unchecked versions #! for the bare quasigroup constructors because the only properties required #! are that all of the rows (or columns, in the `Right` case) are permutations. #! @GroupInitialArguments permutation-list DeclareGlobalFunction("LeftRackByPermsNC"); DeclareGlobalFunction("LeftQuandleByPermsNC"); DeclareGlobalFunction("RightRackByPermsNC"); DeclareGlobalFunction("RightQuandleByPermsNC"); #! @EndGroup