2017-10-20 09:08:09 +00:00
|
|
|
## structure.gd RAQ Definitions, generation, and elementary ops and props.
|
2017-10-18 10:46:13 +00:00
|
|
|
|
|
|
|
## GAP Categories and representations
|
|
|
|
|
2018-09-01 15:12:31 +00:00
|
|
|
#! @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.
|
2017-10-22 16:23:45 +00:00
|
|
|
DeclareInfoClass("InfoRAQ");
|
|
|
|
|
2017-10-18 10:46:13 +00:00
|
|
|
## Self-distributivity
|
2017-10-20 09:08:09 +00:00
|
|
|
# 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.
|
2017-10-18 10:46:13 +00:00
|
|
|
|
2018-09-01 15:12:31 +00:00
|
|
|
#! @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>.
|
2017-10-18 10:46:13 +00:00
|
|
|
DeclareCategory("IsLSelfDistElement", IsMultiplicativeElement);
|
2018-09-01 15:12:31 +00:00
|
|
|
# Have to skip a line because of AutoDoc's convention on documenting
|
|
|
|
# consecutive declarations.
|
2017-10-18 10:46:13 +00:00
|
|
|
DeclareCategoryCollections("IsLSelfDistElement");
|
|
|
|
|
2018-09-01 15:12:31 +00:00
|
|
|
#! @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>.
|
2017-10-18 10:46:13 +00:00
|
|
|
DeclareCategory("IsRSelfDistElement", IsMultiplicativeElement);
|
2018-09-01 15:12:31 +00:00
|
|
|
|
2017-10-18 10:46:13 +00:00
|
|
|
DeclareCategoryCollections("IsRSelfDistElement");
|
|
|
|
|
2018-09-01 15:12:31 +00:00
|
|
|
#! @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.
|
2017-10-20 13:25:22 +00:00
|
|
|
DeclareProperty("IsLSelfDistributive", IsMultiplicativeElementCollection);
|
|
|
|
InstallTrueMethod(IsLSelfDistributive, IsLSelfDistElementCollection);
|
2017-10-18 10:46:13 +00:00
|
|
|
|
2018-09-01 15:12:31 +00:00
|
|
|
#! @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.
|
2017-10-20 13:25:22 +00:00
|
|
|
DeclareProperty("IsRSelfDistributive", IsMultiplicativeElementCollection);
|
|
|
|
InstallTrueMethod(IsRSelfDistributive, IsRSelfDistElementCollection);
|
2017-10-18 10:46:13 +00:00
|
|
|
|
2017-10-20 09:08:09 +00:00
|
|
|
## Idempotence
|
2018-09-01 15:12:31 +00:00
|
|
|
# There is already a property IsIdempotent on elements, but to define
|
2017-10-20 09:08:09 +00:00
|
|
|
# structures which will automatically be quandles we need a corresponding
|
|
|
|
# collections category:
|
|
|
|
DeclareCategoryCollections("IsIdempotent");
|
|
|
|
|
2017-10-20 13:25:22 +00:00
|
|
|
# Collections in which every element is idempotent
|
2018-09-01 15:12:31 +00:00
|
|
|
#! @Description A collection in which every element <C>x</C> is
|
|
|
|
#! **idempotent**, i.e. satisfies <C>x*x=x</C>.
|
2017-10-20 13:25:22 +00:00
|
|
|
DeclareProperty("IsElementwiseIdempotent", IsMultiplicativeElementCollection);
|
|
|
|
InstallTrueMethod(IsElementwiseIdempotent, IsIdempotentCollection);
|
2017-10-20 09:08:09 +00:00
|
|
|
|
2018-09-01 15:12:31 +00:00
|
|
|
#! @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
|
2017-10-18 10:46:13 +00:00
|
|
|
DeclareSynonym("IsLeftRack", IsLeftQuasigroup and IsLSelfDistributive);
|
2018-09-01 15:12:31 +00:00
|
|
|
#! @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
|
2017-10-18 10:46:13 +00:00
|
|
|
DeclareSynonym("IsRightRack", IsRightQuasigroup and IsRSelfDistributive);
|
|
|
|
|
2018-09-01 15:12:31 +00:00
|
|
|
#! @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
|
2017-10-20 09:08:09 +00:00
|
|
|
DeclareSynonym("IsLeftQuandle", IsLeftRack and IsElementwiseIdempotent);
|
|
|
|
|
2018-09-01 15:12:31 +00:00
|
|
|
#! @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);
|
2017-10-18 10:46:13 +00:00
|
|
|
|
2018-09-01 15:12:31 +00:00
|
|
|
#! @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]
|
2017-10-18 10:46:13 +00:00
|
|
|
DeclareGlobalFunction("LeftQuasigroup");
|
|
|
|
DeclareGlobalFunction("RightQuasigroup");
|
|
|
|
DeclareGlobalFunction("LeftRack");
|
|
|
|
DeclareGlobalFunction("RightRack");
|
2017-10-20 09:08:09 +00:00
|
|
|
DeclareGlobalFunction("LeftQuandle");
|
|
|
|
DeclareGlobalFunction("RightQuandle");
|
2018-09-01 15:12:31 +00:00
|
|
|
#! @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");
|
2017-10-20 13:25:22 +00:00
|
|
|
DeclareGlobalFunction("RightQuandleNC");
|
2018-09-01 15:12:31 +00:00
|
|
|
#! @EndGroup
|
|
|
|
#! @EndAutoDoc
|
2017-10-18 10:46:13 +00:00
|
|
|
|
|
|
|
# Underlying operation
|
2017-10-18 11:19:57 +00:00
|
|
|
DeclareGlobalFunction("CloneOfTypeByGenerators");
|
2017-10-18 10:46:13 +00:00
|
|
|
|
2017-10-22 16:23:45 +00:00
|
|
|
## Opposite structures
|
2018-09-01 15:12:31 +00:00
|
|
|
#! @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.
|
|
|
|
|
2017-10-22 16:23:45 +00:00
|
|
|
DeclareCategory("IsOppositeObject", IsMultiplicativeElement);
|
|
|
|
DeclareCategoryCollections("IsOppositeObject");
|
|
|
|
DeclareAttribute("OppositeFamily", IsFamily);
|
|
|
|
DeclareAttribute("OppositeType", IsFamily);
|
|
|
|
DeclareSynonym("IsDefaultOppositeObject",
|
|
|
|
IsOppositeObject and IsPositionalObjectOneSlotRep);
|
|
|
|
DeclareAttribute("OppositeObj", IsMultiplicativeElement);
|
|
|
|
DeclareAttribute("UnderlyingMultiplicativeElement", IsOppositeObject);
|
|
|
|
|
2018-09-01 15:12:31 +00:00
|
|
|
#! @Chapter operate
|
|
|
|
#! @Section basic_info
|
|
|
|
#! @SectionTitle Basic information
|
|
|
|
|
2017-10-18 10:46:13 +00:00
|
|
|
# Attributes for the generators
|
|
|
|
|
2018-09-01 15:12:31 +00:00
|
|
|
#! @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 `\*`.
|
2017-10-18 10:46:13 +00:00
|
|
|
DeclareAttribute("GeneratorsOfLeftQuasigroup", IsLeftQuasigroup);
|
|
|
|
|
2018-09-01 15:12:31 +00:00
|
|
|
#! @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.
|
2017-10-18 10:46:13 +00:00
|
|
|
DeclareAttribute("GeneratorsOfRightQuasigroup", IsRightQuasigroup);
|
2017-10-29 03:48:35 +00:00
|
|
|
|
|
|
|
## Conversions into quasigroup/rack/quandle
|
2018-09-01 15:12:31 +00:00
|
|
|
#! @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
|
2017-10-29 03:48:35 +00:00
|
|
|
DeclareAttribute("AsLeftQuasigroup", IsCollection);
|
|
|
|
DeclareAttribute("AsLeftRack", IsCollection);
|
|
|
|
DeclareAttribute("AsLeftQuandle", IsCollection);
|
|
|
|
DeclareAttribute("AsRightQuasigroup", IsCollection);
|
|
|
|
DeclareAttribute("AsRightRack", IsCollection);
|
|
|
|
DeclareAttribute("AsRightQuandle", IsCollection);
|
2018-09-01 15:12:31 +00:00
|
|
|
#! @EndGroup
|
|
|
|
#! @EndAutoDoc
|