From 12f5e2811231e3ac188229793288946a99eb953f Mon Sep 17 00:00:00 2001 From: Glen Whitney Date: Sun, 29 Oct 2017 18:11:33 -0400 Subject: [PATCH] Add trivial quandle construction --- gap/constructions.gd | 13 +++++ gap/constructions.gi | 130 +++++++++++++++++++++++++++++++++++++++++++ init.g | 2 + read.g | 3 + 4 files changed, 148 insertions(+) create mode 100644 gap/constructions.gd create mode 100644 gap/constructions.gi diff --git a/gap/constructions.gd b/gap/constructions.gd new file mode 100644 index 0000000..f22e68c --- /dev/null +++ b/gap/constructions.gd @@ -0,0 +1,13 @@ +## constructions.gd RAQ Other quandle constructions + +## Trivial quandles + +DeclareGlobalFunction("TrivialLeftQuandle"); +DeclareGlobalFunction("TrivialRightQuandle"); +DeclareProperty("IsTrivial", IsLeftQuasigroup); +DeclareProperty("IsTrivial", IsRightQuasigroup); + +## Convenience functions + +DeclareGlobalFunction("Quandle"); +DeclareGlobalFunction("Rack"); diff --git a/gap/constructions.gi b/gap/constructions.gi new file mode 100644 index 0000000..8abcf4c --- /dev/null +++ b/gap/constructions.gi @@ -0,0 +1,130 @@ +## constructions.gi RAQ Implementations of other quandle constructions + +## Inert objects with which to build trivial quandles. +DeclareCategory("IsLRInertum", IsMultiplicativeElement); +DeclareCategory("IsLInertum", IsLRInertum and IsLeftQuotientElement); +DeclareCategory("IsRInertum", IsLRInertum and IsRightQuotientElement); +DeclareCategoryCollections("IsLInertum"); +DeclareCategoryCollections("IsRInertum"); +LInertumFamily@ := NewFamily("LeftInertFamily", IsLInertum, + IsLSelfDistElement and IsIdempotent); +RInertumFamily@ := NewFamily("RightInertFamily", IsRInertum, + IsRSelfDistElement and IsIdempotent); +LInertumType@ := NewType(LInertumFamily, + IsLInertum and IsPositionalObjectOneSlotRep); +RInertumType@ := NewType(RInertumFamily, + IsRInertum and IsPositionalObjectOneSlotRep); +LInertum@ := i -> Objectify(LInertumType, [i]); +RInertum@ := i -> Objectify(RInertumType, [i]); + +WhichI@ := obj -> obj![1]; + +InstallMethod(String, "for left inert objects", + [IsLInertum], + obj -> Concatenation("LInertum@raq(", String(WhichI@(obj)), ")") +); +InstallMethod(String, "for rightt inert objects", + [IsRInertum], + obj -> Concatenation("RInertum@raq(", String(WhichI@(obj)), ")") +); + +InstallMethod(ViewString, "for left inert objects", + [IsLInertum], + obj -> Concatenation("i", String(WhichI@(obj)), ">") +); +InstallMethod(ViewString, "for right inert objects", + [IsRInertum], + obj -> Concatenation(" ListWithIdenticalEntries(n, i))); + RightTrivs@[n] := I; + fi; + return RightTrivs@[n]; +end); + +InstallMethod(IsTrivial, "for a left quasigroup", + [IsLeftQuasigroup], + Q -> ForAll(LeftPerms(Q), p -> p = ()) +); + +InstallMethod(IsTrivial, "for a left quasigroup", + [IsRightQuasigroup], + Q -> ForAll(RightPerms(Q), p -> p = ()) +); + +## Convenience functions + +InstallGlobalFunction(Quandle, + function(arg) + if Length(arg) = 0 then + return LeftQuandleNC(CollectionsFamily(LInertumFamily@),[]); + fi; + if Length(arg) = 1 and IsInt(arg[1]) then + return TrivialLeftQuandle(arg[1]); + fi; + ## Will put more stuff here, but for now, just a convenient wrapper for + ## perms + return LeftQuandleByPerms(arg); +end); + +InstallGlobalFunction(Rack, + function(arg) + ## Will put more stuff here, but for now, just a convenient wrapper for + ## perms + return LeftQuandleByPerms(arg); +end); diff --git a/init.g b/init.g index 4c18949..41f9afe 100644 --- a/init.g +++ b/init.g @@ -9,3 +9,5 @@ ReadPackage("raq", "gap/bytable.gd"); # Quandles by conjugation ReadPackage("raq", "gap/byconj.gd"); +# Other quandle constructions +ReadPackage("raq", "gap/constructions.gd"); diff --git a/read.g b/read.g index 61a329f..05462e3 100644 --- a/read.g +++ b/read.g @@ -8,3 +8,6 @@ ReadPackage("raq", "gap/bytable.gi"); # Quandles by conjugation ReadPackage("raq", "gap/byconj.gi"); + +# Other quandle constructions +ReadPackage("raq", "gap/constructions.gi");