add opposites for quasigroups, racks, and quandles

This commit is contained in:
Glen Whitney 2017-10-23 03:22:20 +02:00
parent 03f36dd672
commit 68d20cf850

View File

@ -456,3 +456,63 @@ InstallMethod(Opposite, "for a finitely generated magma with inverse",
fam := CollectionsFamily(OppositeFamily(ElementsFamily(FamilyObj(M))));
return MagmaWithInverses(fam, elts);
end);
# Do we need Opposite() methods for Semigroups, Monoids, and Groups? Or have
# we copied enough properties that those filters will simply carry over? The
# couple of small tests I did the Opposite of a Group was again reported as a
# Group, so let's leave those methods out for now, and move on to quasigroups,
# racks, and quandles.
InstallMethod(Opposite, "for a left quasigroup",
[IsLeftQuasigroup and HasGeneratorsOfLeftQuasigroup],
function (Q)
local fam, elts;
elts := List(GeneratorsOfLeftQuasigroup(Q), q -> OppositeObj(q));
fam := CollectionsFamily(OppositeFamily(ElementsFamily(FamilyObj(Q))));
return RightQuasigroupNC(fam, elts);
end);
InstallMethod(Opposite, "for a left rack",
[IsLeftRack and HasGeneratorsOfLeftQuasigroup],
function (Q)
local fam, elts;
elts := List(GeneratorsOfLeftQuasigroup(Q), q -> OppositeObj(q));
fam := CollectionsFamily(OppositeFamily(ElementsFamily(FamilyObj(Q))));
return RightRackNC(fam, elts);
end);
InstallMethod(Opposite, "for a left quandle",
[IsLeftQuandle and HasGeneratorsOfLeftQuasigroup],
function (Q)
local fam, elts;
elts := List(GeneratorsOfLeftQuasigroup(Q), q -> OppositeObj(q));
fam := CollectionsFamily(OppositeFamily(ElementsFamily(FamilyObj(Q))));
return RightQuandleNC(fam, elts);
end);
InstallMethod(Opposite, "for a right quasigroup",
[IsRightQuasigroup and HasGeneratorsOfRightQuasigroup],
function (Q)
local fam, elts;
elts := List(GeneratorsOfRightQuasigroup(Q), q -> OppositeObj(q));
fam := CollectionsFamily(OppositeFamily(ElementsFamily(FamilyObj(Q))));
return LeftQuasigroupNC(fam, elts);
end);
InstallMethod(Opposite, "for a right rack",
[IsRightRack and HasGeneratorsOfRightQuasigroup],
function (Q)
local fam, elts;
elts := List(GeneratorsOfRightQuasigroup(Q), q -> OppositeObj(q));
fam := CollectionsFamily(OppositeFamily(ElementsFamily(FamilyObj(Q))));
return LeftRackNC(fam, elts);
end);
InstallMethod(Opposite, "for a right quandle",
[IsRightQuandle and HasGeneratorsOfRightQuasigroup],
function (Q)
local fam, elts;
elts := List(GeneratorsOfRightQuasigroup(Q), q -> OppositeObj(q));
fam := CollectionsFamily(OppositeFamily(ElementsFamily(FamilyObj(Q))));
return LeftQuandleNC(fam, elts);
end);