## structure.gd RAQ Definitions, representations, and elementary operations. ## GAP Categories and representations ## Self-distributivity # Note these are properties that should be defined just at the level of # MultiplicativeElements and Magmas, hence although the LOOPS package defines # IsLDistributive and IsRDistributive for quasigroups, they would be ambiguous # in the case of something like a semiring whose multiplicative structure was # a quasigroup (cf. https://arxiv.org/abs/0910.4760). Hence, we implement them # in RAQ with new, non-conflicting terms. # An element that knows that multiplication in its family is left # self-distributive: DeclareCategory("IsLSelfDistElement", IsMultiplicativeElement); DeclareCategoryCollections("IsLSelfDistElement"); # An element that knows that multiplication in its family is right # self-distributive: DeclareCategory("IsRSelfDistElement", IsMultiplicativeElement); DeclareCategoryCollections("IsRSelfDistElement"); # Predicates on tables: DeclareProperty( "IsLeftSelfDistributiveTable", IsMatrix ); DeclareProperty( "IsRightSelfDistributiveTable", IsMatrix ); # Left self-distributive magmas: DeclareProperty("IsLSelfDistributive", IsMagma); InstallTrueMethod(IsLSelfDistributive, IsMagma and IsLSelfDistElementCollection); # Right self-distributive magmas: DeclareProperty("IsRSelfDistributive", IsMagma); InstallTrueMethod(IsRSelfDistributive, IsMagma and IsRSelfDistElementCollection); # Left and right racks DeclareSynonym("IsLeftRack", IsLeftQuasigroup and IsLSelfDistributive); DeclareSynonym("IsRightRack", IsRightQuasigroup and IsRSelfDistributive); ## One-sided quasigroups # Returns the closure of under * and LeftQuotient; # the family of elements of M may be specified, and must be if # is empty (in which case M will be empty as well). DeclareGlobalFunction("LeftQuasigroup"); DeclareGlobalFunction("RightQuasigroup"); DeclareGlobalFunction("LeftRack"); DeclareGlobalFunction("RightRack"); # Underlying operation DeclareGlobalFunction("CloneOfTypeByGenerators"); # Attributes for the generators # Generates the structure by \* and LeftQuotient. Note that for finite # structures, these are the same as the GeneratorsOfMagma but in general more # elements might be required to generate the structure just under * DeclareAttribute("GeneratorsOfLeftQuasigroup", IsLeftQuasigroup); InstallImmediateMethod(GeneratorsOfMagma, "finite left quasigroups *-generated by left quasigroup generators", IsLeftQuasigroup and IsFinite, 1, q -> GeneratorsOfLeftQuasigroup(q) ); # Generates the structure by \* and \/, same considerations as above DeclareAttribute("GeneratorsOfRightQuasigroup", IsRightQuasigroup); InstallImmediateMethod(GeneratorsOfMagma, "finite right quasigroups *-generated by right quasigroup generators", IsRightQuasigroup and IsFinite, 2, q -> GeneratorsOfRightQuasigroup(q) ); ## And now, build them from multiplication tables # Need attributes on the families to store the sections and division tables DeclareAttribute("LeftPerms", HasMultiplicationTable); DeclareAttribute("RightPerms", HasMultiplicationTable); DeclareAttribute("LeftDivisionTable", HasMultiplicationTable); DeclareAttribute("RightDivisionTable", HasMultiplicationTable); # And the builders DeclareGlobalFunction("LeftQuasigroupByMultiplicationTable"); DeclareGlobalFunction("LeftQuasigroupByMultiplicationTableNC"); DeclareGlobalFunction("LeftRackByMultiplicationTable"); DeclareGlobalFunction("LeftRackByMultiplicationTableNC"); DeclareGlobalFunction("RightQuasigroupByMultiplicationTable"); DeclareGlobalFunction("RightQuasigroupByMultiplicationTableNC"); DeclareGlobalFunction("RightRackByMultiplicationTable"); DeclareGlobalFunction("RightRackByMultiplicationTableNC");