add quotients for direct product elements

This commit is contained in:
Glen Whitney 2017-10-29 14:50:33 -04:00
parent b089e131d1
commit 6428dddf56

View File

@ -641,6 +641,33 @@ InstallOtherMethod(DirectProductOp, "for a list and non-quasigroup magma",
return MagmaByGenerators(gens); return MagmaByGenerators(gens);
end); end);
# Make sure that we can take quotients properly in the direct product
InstallOtherMethod(LeftQuotient,
IsIdenticalObj,
[IsDirectProductElement, IsDirectProductElement],
function (l,r)
local i, comps;
comps := [];
for i in [1..Length(l)] do
Add(comps, LeftQuotient(l![i],r![i]));
od;
return DirectProductElement(comps);
end);
InstallOtherMethod(\/,
IsIdenticalObj,
[IsDirectProductElement, IsDirectProductElement],
function (l,r)
local i, comps;
comps := [];
for i in [1..Length(l)] do
Add(comps, l![i] / r![i]);
od;
return DirectProductElement(comps);
end);
## Coversions among the structure types ## Coversions among the structure types
InstallMethod(AsLeftQuasigroup, "for a left quasigroup", InstallMethod(AsLeftQuasigroup, "for a left quasigroup",
[IsLeftQuasigroup], IdFunc); [IsLeftQuasigroup], IdFunc);