## structure.gd RAQ Definitions, generation, and elementary ops and props. ## GAP Categories and representations #! @Chapter technical #! This chapter covers computational/operational aspects of &RAQ; #! rather than mathematical ones. #! @Section Messages #! @Description Controls the level of verbosity of &RAQ;'s informative #! messages. Use `SetInfoLevel` to set it to 0 to quiet &RAQ; #! entirely, or to values greater than 1 to yield more details of &RAQ;'s #! internal algorithms. DeclareInfoClass("InfoRAQ"); ## Self-distributivity # Note these are properties that can and therefore 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. #! @Chapter basic #! In order to build up and define one-sided quasigroups, racks, and #! quandles, &RAQ; must define several lower-level objects and properties, #! which are documented in this section. Although logically they come before #! the domain constructors and operations, they are presented afterwards #! because it's rare that one needs to use them directly when working with #! &RAQ;. #! @Section elements #! @SectionTitle Categories of elements #! @Description An element x with the property #! that for all elements y and z in its family, x*(y*z) = #! (x*y)*(x*z). DeclareCategory("IsLSelfDistElement", IsMultiplicativeElement); # Have to skip a line because of AutoDoc's convention on documenting # consecutive declarations. DeclareCategoryCollections("IsLSelfDistElement"); #! @Description An element x with the property #! that for all elements y and z in its family, (y*z)*x = #! (y*x)*(z*x). DeclareCategory("IsRSelfDistElement", IsMultiplicativeElement); DeclareCategoryCollections("IsRSelfDistElement"); #! @Section collections #! @SectionTitle Categories of collections #! @Description A collection which satisfies the left self-distributive #! property (see the description of #! ) #! for all triples of elements of the collection. DeclareProperty("IsLSelfDistributive", IsMultiplicativeElementCollection); InstallTrueMethod(IsLSelfDistributive, IsLSelfDistElementCollection); #! @Description A collection which satisfies the right self-distributive #! property (see the description of #! ) #! for all triples of elements of the collection. DeclareProperty("IsRSelfDistributive", IsMultiplicativeElementCollection); InstallTrueMethod(IsRSelfDistributive, IsRSelfDistElementCollection); ## Idempotence # There is already a property IsIdempotent on elements, but to define # structures which will automatically be quandles we need a corresponding # collections category: DeclareCategoryCollections("IsIdempotent"); # Collections in which every element is idempotent #! @Description A collection in which every element x is #! **idempotent**, i.e. satisfies x*x=x. DeclareProperty("IsElementwiseIdempotent", IsMultiplicativeElementCollection); InstallTrueMethod(IsElementwiseIdempotent, IsIdempotentCollection); #! @Description Tests whether obj is a left rack, which by definition #! is precisely that obj is a left quasigroup (i.e., #! IsLeftQuasigroup(obj), defined in the &LOOPS; #! package, is true) and is left self-distributive #! (i.e., IsLSelfDistributive(obj) is true). #! @Arguments obj #! @ItemType Filt DeclareSynonym("IsLeftRack", IsLeftQuasigroup and IsLSelfDistributive); #! @Description Tests whether obj is a right rack, by definition #! precisely that it is a right quasigroup and right self-distributive. #! @Arguments obj #! @ItemType Filt DeclareSynonym("IsRightRack", IsRightQuasigroup and IsRSelfDistributive); #! @Description Tests whether obj is a left quandle, which by definition #! is precisely that obj is a left rack (i.e., #! IsLeftRack(obj) is true) and every element is idempotent #! (i.e., IsElementwiseIdempotent(obj) is true). #! @Arguments obj #! @ItemType Filt DeclareSynonym("IsLeftQuandle", IsLeftRack and IsElementwiseIdempotent); #! @Description Tests whether obj is a right quandle, by definition #! precisely that it is a right rack and every element is idempotent. #! @Arguments obj #! @ItemType Filt DeclareSynonym("IsRightQuandle", IsRightRack and IsElementwiseIdempotent); #! @Chapter construct #! @Section from_scratch #! @SectionTitle Direct constructors #! All of the functions in this section produce magmas (of one of the #! categories with which &RAQ; is concerned) from data of other (non-domain) #! types. #! @BeginAutoDoc #! @BeginGroup basic_constructors #! @GroupTitle Basic constructors (from generators) #! @Description These are the fundamental constructors of these #! categories. They produce the closure of the specified generators, #! which are considered to be of the given family, under both the #! binary operation of the magma, which is always considered to be * in #! &RAQ;, and the quotient on the specified side. (If #! family is omitted, these functions attempt to infer it from the #! generators; if there are no generators then the #! family must be specified, and note that the resulting magma will #! be empty.) The resulting magma must satisfy the defining #! characteristics of the respective category: for the quasigroups, all #! quotients on the specified side must exist; racks must also satisfy the #! appropriate self-distributive law; and quandles must also have every #! element idempotent. #! @Returns a magma of the named category #! @GroupInitialArguments [family], [generators] DeclareGlobalFunction("LeftQuasigroup"); DeclareGlobalFunction("RightQuasigroup"); DeclareGlobalFunction("LeftRack"); DeclareGlobalFunction("RightRack"); DeclareGlobalFunction("LeftQuandle"); DeclareGlobalFunction("RightQuandle"); #! @EndGroup #! @BeginGroup unchecked_basic_constructors #! @GroupTitle Unchecked basic constructors #! @Description Each function is the same as its checked counterpart, but the #! family of elements must be specified and no checks that the #! appropriate axioms are satisfied are performed. They may be used for #! efficiency when those properties are guaranteed to be satisfied by the #! generators. NOTE that the behavior of &RAQ; is undefined if the #! unchecked versions are called on generators that do **not** #! satisfy the proper axioms. #! @Returns a magma of the named category #! @GroupInitialArguments family, generators DeclareGlobalFunction("LeftQuasigroupNC"); DeclareGlobalFunction("RightQuasigroupNC"); DeclareGlobalFunction("LeftRackNC"); DeclareGlobalFunction("RightRackNC"); DeclareGlobalFunction("LeftQuandleNC"); DeclareGlobalFunction("RightQuandleNC"); #! @EndGroup #! @EndAutoDoc # Underlying operation DeclareGlobalFunction("CloneOfTypeByGenerators"); ## Opposite structures #! @Section from_quasigroups #! @SectionTitle Constructors from other one-sided quasigroups #! All of the functions in this section produce magmas from other objects of #! similar domain categories. DeclareCategory("IsOppositeObject", IsMultiplicativeElement); DeclareCategoryCollections("IsOppositeObject"); DeclareAttribute("OppositeFamily", IsFamily); DeclareAttribute("OppositeType", IsFamily); DeclareSynonym("IsDefaultOppositeObject", IsOppositeObject and IsPositionalObjectOneSlotRep); DeclareAttribute("OppositeObj", IsMultiplicativeElement); DeclareAttribute("UnderlyingMultiplicativeElement", IsOppositeObject); #! @Chapter operate #! @Section basic_info #! @SectionTitle Basic information # Attributes for the generators #! @Arguments q #! @Returns list of elements generating q #! @Description This produces a list of elements that generate q by #! `\*` and `LeftQuotient`. There are no guarantees that the list is minimal #! in any respect. Note that for finite structures, the #! `GeneratorsOfMagma(q)` will suffice, but in general more #! elements might be required to generate the structure just under `\*`. DeclareAttribute("GeneratorsOfLeftQuasigroup", IsLeftQuasigroup); #! @Arguments q #! @Returns list of elements generating q #! @Description This produces a list of elements that generate q by #! `\*` and `\/`, with the same caveats as above. DeclareAttribute("GeneratorsOfRightQuasigroup", IsRightQuasigroup); ## Conversions into quasigroup/rack/quandle #! @Chapter construct #! @Section from_scratch #! @BeginAutoDoc #! @BeginGroup conversions #! @GroupTitle Conversions #! @Description These functions convert a potentially arbitrary #! collection of elements to one of the categories of objects with #! which &RAQ; is concerned. The collection must be closed under * #! and satisfy the appropriate axioms for the conversion to succeed. #! @Returns a magma of the named category #! @GroupInitialArguments collection DeclareAttribute("AsLeftQuasigroup", IsCollection); DeclareAttribute("AsLeftRack", IsCollection); DeclareAttribute("AsLeftQuandle", IsCollection); DeclareAttribute("AsRightQuasigroup", IsCollection); DeclareAttribute("AsRightRack", IsCollection); DeclareAttribute("AsRightQuandle", IsCollection); #! @EndGroup #! @EndAutoDoc