## 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); SetMultiplicationTable(LInertumFamily@, []); RInertumFamily@ := NewFamily("RightInertFamily", IsRInertum, IsRSelfDistElement and IsIdempotent); SetMultiplicationTable(RInertumFamily@, []); 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); # The below needs to be immediate because otherwise it # is pre-empted by the immediate method that all collections of size # larger than one are non-trivial. InstallImmediateMethod(IsTrivial, "for a left quasigroup", IsLeftQuasigroup and HasSize, 1, function(Q) local gens; gens := GeneratorsOfLeftQuasigroup(Q); return ForAll(gens, x -> ForAll(gens, y -> x*y = y)); end); InstallImmediateMethod(IsTrivial, "for a right quasigroup", IsRightQuasigroup and HasSize, 1, function(Q) local gens; gens := GeneratorsOfRightQuasigroup(Q); return ForAll(gens, x -> ForAll(gens, y -> y*x = y)); end); ## 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 LeftRackByPerms(arg); end);