have to opposite some elements first before you can get the family

This commit is contained in:
Glen Whitney 2017-10-22 18:41:15 +02:00
parent fb5f9af82f
commit 3d18bcace2

View File

@ -445,8 +445,9 @@ InstallMethod(Opposite, "for a finitely generated magma",
[IsMagma and HasGeneratorsOfMagma],
function(M)
local fam, elts;
fam := CollectionsFamily(OppositeFamily(ElementsFamily(FamilyObj(M))));
# Get elements first to prime the representative of the family
elts := List(GeneratorsOfMagma(M), m -> OppositeObj(m));
fam := CollectionsFamily(OppositeFamily(ElementsFamily(FamilyObj(M))));
return Magma(fam, elts);
end);
@ -454,8 +455,9 @@ InstallMethod(Opposite, "for a finitely generated magma with one",
[IsMagmaWithOne and HasGeneratorsOfMagmaWithOne],
function(M)
local fam, elts;
fam := CollectionsFamily(OppositeFamily(ElementsFamily(FamilyObj(M))));
# Get elements first to prime the representative of the family
elts := List(GeneratorsOfMagmaWithOne(M), m -> OppositeObj(m));
fam := CollectionsFamily(OppositeFamily(ElementsFamily(FamilyObj(M))));
return MagmaWithOne(fam, elts);
end);
@ -463,7 +465,8 @@ InstallMethod(Opposite, "for a finitely generated magma with inverse",
[IsMagmaWithInverses and HasGeneratorsOfMagmaWithInverses],
function(M)
local fam, elts;
fam := CollectionsFamily(OppositeFamily(ElementsFamily(FamilyObj(M))));
# Get elements first to prime the representative of the family
elts := List(GeneratorsOfMagmaWithInverses(M), m -> OppositeObj(m));
fam := CollectionsFamily(OppositeFamily(ElementsFamily(FamilyObj(M))));
return MagmaWithInverses(fam, elts);
end);