@ -2,7 +2,14 @@
## GAP Categories and representations
## Info class for RAQ
#! @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
@ -14,63 +21,146 @@ DeclareInfoClass("InfoRAQ");
# (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:
#! @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 <C>x</C> with the property
#! that for all elements <C>y</C> and <C>z</C> in its family, <C>x*(y*z) =
#! (x*y)*(x*z)</C>.
DeclareCategory ( " IsLSelfDistElement " , IsMultiplicativeElement ) ;
# Have to skip a line because of AutoDoc's convention on documenting
# consecutive declarations.
DeclareCategoryCollections ( " IsLSelfDistElement " ) ;
# An element that knows that multiplication in its family is right
# self-distributive:
#! @Description An element <C>x</C> with the property
#! that for all elements <C>y</C> and <C>z</C> in its family, <C>(y*z)*x =
#! (y*x)*(z*x)</C>.
DeclareCategory ( " IsRSelfDistElement " , IsMultiplicativeElement ) ;
DeclareCategoryCollections ( " IsRSelfDistElement " ) ;
# Left self-distributive collections of elements:
#! @Section collections
#! @SectionTitle Categories of collections
#! @Description A collection which satisfies the left self-distributive
#! property (see the description of
#! <Ref Filt="IsLSelfDistElement" Label="for IsMultiplicativeElement"/>)
#! for all triples of elements of the collection.
DeclareProperty ( " IsLSelfDistributive " , IsMultiplicativeElementCollection ) ;
InstallTrueMethod ( IsLSelfDistributive , IsLSelfDistElementCollection ) ;
# Right self-distributive collections of elements:
#! @Description A collection which satisfies the right self-distributive
#! property (see the description of
#! <Ref Filt="IsRSelfDistElement" Label="for IsMultiplicativeElement"/>)
#! 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 definw
# 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 <C>x</C> is
#! **idempotent**, i.e. satisfies <C>x*x=x</C>.
DeclareProperty ( " IsElementwiseIdempotent " , IsMultiplicativeElementCollection ) ;
InstallTrueMethod ( IsElementwiseIdempotent , IsIdempotentCollection ) ;
## Left and right racks and quandles
#! @Description Tests whether <A>obj</A> is a left rack, which by definition
#! is precisely that <A>obj</A> is a left quasigroup (i.e.,
#! <C>IsLeftQuasigroup(obj)</C>, defined in the &LOOPS;
#! package, is true) and is left self-distributive
#! (i.e., <C>IsLSelfDistributive(obj)</C> is true).
#! @Arguments obj
#! @ItemType Filt
DeclareSynonym ( " IsLeftRack " , IsLeftQuasigroup and IsLSelfDistributive ) ;
#! @Description Tests whether <A>obj</A> 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 <A>obj</A> is a left quandle, which by definition
#! is precisely that <A>obj</A> is a left rack (i.e.,
#! <C>IsLeftRack(obj)</C> is true) and every element is idempotent
#! (i.e., <C>IsElementwiseIdempotent(obj)</C> is true).
#! @Arguments obj
#! @ItemType Filt
DeclareSynonym ( " IsLeftQuandle " , IsLeftRack and IsElementwiseIdempotent ) ;
DeclareSynonym ( " IsRightQuandle " , IsRightRack and IsElementwiseIdempotent ) ;
## One-sided quasigroups and racks and quandles by generators
#! @Description Tests whether <A>obj</A> 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 ) ;
# Returns the closure of <gens> under * and LeftQuotient;
# the family of elements of M may be specified, and must be if <gens>
# is empty (in which case M will be empty as well).
#! @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 <A>generators</A>,
#! which are considered to be of the given <A>family</A>, under both the
#! binary operation of the magma, which is always considered to be * in
#! &RAQ;, and the quotient on the specified side. (If
#! <A>family</A> is omitted, these functions attempt to infer it from the
#! <A>generators</A>; if there are no <A>generators</A> then the
#! <A>family</A> 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 ( " LeftQuasigroupNC " ) ;
DeclareGlobalFunction ( " RightQuasigroup " ) ;
DeclareGlobalFunction ( " RightQuasigroupNC " ) ;
DeclareGlobalFunction ( " LeftRack " ) ;
DeclareGlobalFunction ( " LeftRackNC " ) ;
DeclareGlobalFunction ( " RightRack " ) ;
DeclareGlobalFunction ( " RightRackNC " ) ;
DeclareGlobalFunction ( " LeftQuandle " ) ;
DeclareGlobalFunction ( " LeftQuandleNC " ) ;
DeclareGlobalFunction ( " RightQuandle " ) ;
#! @EndGroup
#! @BeginGroup unchecked_basic_constructors
#! @GroupTitle Unchecked basic constructors
#! @Description Each function is the same as its checked counterpart, but the
#! <A>family</A> 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
#! <A>generators</A>. NOTE that the behavior of &RAQ; is undefined if the
#! unchecked versions are called on <A>generators</A> 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 ) ;
@ -80,20 +170,44 @@ DeclareSynonym("IsDefaultOppositeObject",
DeclareAttribute ( " OppositeObj " , IsMultiplicativeElement ) ;
DeclareAttribute ( " UnderlyingMultiplicativeElement " , IsOppositeObject ) ;
#! @Chapter operate
#! @Section basic_info
#! @SectionTitle Basic information
# 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 *
#! @Arguments q
#! @Returns list of elements generating <A>q</A>
#! @Description This produces a list of elements that generate <A>q</A> 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 ) ;
# Generates the structure by \* and \/, same considerations as above
#! @Arguments q
#! @Returns list of elements generating <A>q</A>
#! @Description This produces a list of elements that generate <A>q</A> 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
#! <A>collection</A> of elements to one of the categories of objects with
#! which &RAQ; is concerned. The <A>collection</A> 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