Skip to content

Commit

Permalink
Make SubdirectProductOp handle mappings which do not know they are ho…
Browse files Browse the repository at this point in the history
…momorphisms

Also introduce a family predicate for SubdirectProductOp for robustness
  • Loading branch information
stevelinton authored and fingolfin committed Jun 5, 2019
1 parent ddfb57a commit d784c25
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 8 deletions.
22 changes: 16 additions & 6 deletions lib/gprd.gi
Original file line number Diff line number Diff line change
Expand Up @@ -510,19 +510,29 @@ local iso;
fi;
fi;

# the ...Op is installed for `IsGroupHomomorphism'. So we have to enforce
# the filter to be set.
if not IsGroupHomomorphism(ghom) or not IsGroupHomomorphism(hhom) then
Error("mappings are not homomorphisms");
fi;
return SubdirectProductOp(G,H,ghom,hhom);
end);

#############################################################################
##
#M SubdirectProduct( <G1>, <G2>, <phi1>, <phi2> )
##
InstallMethod( SubdirectProductOp,"groups", true,

BindGlobal("SubdirectProductFamilyPredicate",{F1, F2, F3, F4} ->
IsGeneralMappingFamily(F3) and IsGeneralMappingFamily(F4) and
IsIdenticalObj(FamilySource(F3), ElementsFamily(F1)) and
IsIdenticalObj(FamilySource(F4), ElementsFamily(F2)) and
IsIdenticalObj(FamilyRange(F3), FamilyRange(F4)));


RedispatchOnCondition(SubdirectProductOp, "check mappings",
SubdirectProductFamilyPredicate,
[IsGroup, IsGroup, IsGeneralMapping, IsGeneralMapping],
[IsObject, IsObject, IsGroupHomomorphism, IsGroupHomomorphism],
10);


InstallMethod( SubdirectProductOp,"groups", SubdirectProductFamilyPredicate,
[ IsGroup, IsGroup, IsGroupHomomorphism, IsGroupHomomorphism ], 0,
function( G, H, gh, hh )
local gc,hc,S,info;
Expand Down
2 changes: 1 addition & 1 deletion lib/gprdpc.gi
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ end);
##
#M SubdirectProduct( <G1>, <G2>, <phi1>, <phi2> )
##
InstallMethod( SubdirectProductOp,"pcgroup", true,
InstallMethod( SubdirectProductOp,"pcgroup", SubdirectProductFamilyPredicate,
[ IsPcGroup, IsPcGroup, IsGroupHomomorphism, IsGroupHomomorphism ], 0,
function( G, H, gh, hh )
local pg,ph,kg,kh,ig,ih,mg,mh,S,info;
Expand Down
2 changes: 1 addition & 1 deletion lib/gprdperm.gi
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ end);
##
#M SubdirectProduct( <G1>, <G2>, <phi1>, <phi2> ) . . . . . . . constructor
##
InstallMethod( SubdirectProductOp,"permgroup", true,
InstallMethod( SubdirectProductOp,"permgroup", SubdirectProductFamilyPredicate,
[ IsPermGroup, IsPermGroup, IsGroupHomomorphism, IsGroupHomomorphism ], 0,
function( G1, G2, phi1, phi2 )
local S, # subdirect product of <G1> and <G2>, result
Expand Down

0 comments on commit d784c25

Please sign in to comment.