consolidate code for those opposites and propagate finiteness
This commit is contained in:
parent
68d20cf850
commit
85f37ad774
|
@ -463,56 +463,43 @@ end);
|
||||||
# Group, so let's leave those methods out for now, and move on to quasigroups,
|
# Group, so let's leave those methods out for now, and move on to quasigroups,
|
||||||
# racks, and quandles.
|
# racks, and quandles.
|
||||||
|
|
||||||
|
OppHelper@ := function(Q, whichgens, cnstr)
|
||||||
|
local fam, elts, opp;
|
||||||
|
elts := List(whichgen(Q), q -> OppositeObj(q));
|
||||||
|
fam := CollectionsFamily(OppositeFamily(ElementsFamily(FamilyObj(Q))));
|
||||||
|
opp := cnstr(fam, elts);
|
||||||
|
if HasIsFinite(Q) then SetIsFinite(opp, IsFinite(Q)); fi;
|
||||||
|
return opp;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
InstallMethod(Opposite, "for a left quasigroup",
|
InstallMethod(Opposite, "for a left quasigroup",
|
||||||
[IsLeftQuasigroup and HasGeneratorsOfLeftQuasigroup],
|
[IsLeftQuasigroup and HasGeneratorsOfLeftQuasigroup],
|
||||||
function (Q)
|
Q -> OppHelper@(Q, GeneratorsOfLeftQuasigroup, RightQuasigroupNC)
|
||||||
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",
|
InstallMethod(Opposite, "for a left rack",
|
||||||
[IsLeftRack and HasGeneratorsOfLeftQuasigroup],
|
[IsLeftRack and HasGeneratorsOfLeftQuasigroup],
|
||||||
function (Q)
|
Q -> OppHelper@(Q, GeneratorsOfLeftQuasigroup, RightRackNC)
|
||||||
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",
|
InstallMethod(Opposite, "for a left quandle",
|
||||||
[IsLeftQuandle and HasGeneratorsOfLeftQuasigroup],
|
[IsLeftQuandle and HasGeneratorsOfLeftQuasigroup],
|
||||||
function (Q)
|
Q -> OppHelper@(Q, GeneratorsOfLeftQuasigroup, RightQuandleNC)
|
||||||
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",
|
InstallMethod(Opposite, "for a right quasigroup",
|
||||||
[IsRightQuasigroup and HasGeneratorsOfRightQuasigroup],
|
[IsRightQuasigroup and HasGeneratorsOfRightQuasigroup],
|
||||||
function (Q)
|
Q -> OppHelper@(Q, GeneratorsOfRightQuasigroup, LeftQuasigroupNC)
|
||||||
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",
|
InstallMethod(Opposite, "for a right rack",
|
||||||
[IsRightRack and HasGeneratorsOfRightQuasigroup],
|
[IsRightRack and HasGeneratorsOfRightQuasigroup],
|
||||||
function (Q)
|
Q -> OppHelper@(Q, GeneratorsOfRightQuasigroup, LeftRackNC)
|
||||||
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",
|
InstallMethod(Opposite, "for a right quandle",
|
||||||
[IsRightQuandle and HasGeneratorsOfRightQuasigroup],
|
[IsRightQuandle and HasGeneratorsOfRightQuasigroup],
|
||||||
function (Q)
|
Q -> OppHelper@(Q, GeneratorsOfRightQuasigroup, LeftQuandleNC)
|
||||||
local fam, elts;
|
);
|
||||||
elts := List(GeneratorsOfRightQuasigroup(Q), q -> OppositeObj(q));
|
|
||||||
fam := CollectionsFamily(OppositeFamily(ElementsFamily(FamilyObj(Q))));
|
|
||||||
return LeftQuandleNC(fam, elts);
|
|
||||||
end);
|
|
||||||
|
|
Loading…
Reference in New Issue