Add trivial quandle construction

This commit is contained in:
Glen Whitney 2017-10-29 18:11:33 -04:00
parent 6428dddf56
commit 12f5e28112
4 changed files with 148 additions and 0 deletions

13
gap/constructions.gd Normal file
View File

@ -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");

130
gap/constructions.gi Normal file
View File

@ -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("<i", String(WhichI@(obj)))
);
InstallMethod(\=, "for two inert objects",
IsIdenticalObj,
[IsLRInertum, IsLRInertum],
function(l,r) return l![1] = r![1]; end
);
InstallMethod(\<, "for two inert objects",
IsIdenticalObj,
[IsLRInertum, IsLRInertum],
function(l,r) return l![1] < r![1]; end
);
InstallMethod(\*, "for a left inert object and anything",
[IsLInertum, IsExtLElement],
function(l,r) return r; end
);
InstallMethod(\*, "for anything and a right inert object",
[IsExtRElement, IsRInertum], ReturnFirst
);
InstallMethod(LeftQuotient, "for a left inert object and anything",
[IsLInertum, IsExtLElement],
function(l,r) return r; end
);
InstallMethod(\/, "for anything and a right inert object",
[IsExtRElement, IsRInertum], ReturnFirst
);
LeftTrivs@ := [];
RigthTrivs@ := [];
InstallGlobalFunction(TrivialLeftQuandle,
function(n)
local I;
if not IsBound(LeftTrivs@[n]) then
I := AsLeftQuandle(List([1..n], LInertum@));
SetIsTrivial(I, true);
SetIsBuiltFromMultiplicationTable(I, true);
SetMultiplicationTable(I, ListWithIdenticalEntries(n, [1..n]));
LeftTrivs@[n] := I;
fi;
return LeftTrivs@[n];
end);
InstallGlobalFunction(TrivialRightQuandle,
function(n)
local I;
if not IsBound(RightTrivs@[n]) then
I := AsRightQuandle(List([1..n], RInertum@));
SetIsTrivial(I, true);
SetIsBuiltFromMultiplicationTable(I, true);
SetMultiplicationTable(I,
List([1..n], i -> 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);

2
init.g
View File

@ -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");

3
read.g
View File

@ -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");