-
Notifications
You must be signed in to change notification settings - Fork 163
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Document and enforce that "nice monomorphisms" must have IsInjective
set (otherwise an infinite recursion can happen)
#5029
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -16,11 +16,22 @@ | |||||
## | ||||||
#M SetNiceMonomorphism(<G>,<hom>) | ||||||
## | ||||||
## This setter method is special because we want to tell every nice | ||||||
## monomorphism that it is one. | ||||||
## We install a special setter method because we have to make sure that only | ||||||
## injective maps get stored as nice monomorphisms. | ||||||
## More precisely, we the stored map must know that it is injective, | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
## otherwise computing its kernel may run into an infinite recursion. | ||||||
## (The maps computed by 'NiceMonomorphism' have the 'IsInjective' flag, | ||||||
## the test affects only those maps that shall be set by hand as | ||||||
## nice monomorphisms.) | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Strictly speaking this is just the case for all the current such methods. Anyone adding more such methods in the future should also be aware of it, I think? So perhaps the sentence here should either be changed to acknowledge that -- or just remove it? I don't think it is all that useful: we want to enforce an invariant, period. That some code is (supposedly) already correctly enforcing the invariant is immaterial, isn't it? |
||||||
## | ||||||
## Besides this, we want to tell every nice monomorphism that it is one. | ||||||
## | ||||||
InstallMethod(SetNiceMonomorphism,"set `IsNiceomorphism' property",true, | ||||||
[IsGroup,IsGroupGeneralMapping],SUM_FLAGS+10, #override system setter | ||||||
function(G,hom) | ||||||
if not ( HasIsInjective( hom ) and IsInjective( hom ) ) then | ||||||
Error( "'NiceMonomorphism' values must have the 'IsInjective' flag" ); | ||||||
fi; | ||||||
SetFilterObj(hom,IsNiceMonomorphism); | ||||||
TryNextMethod(); | ||||||
end); | ||||||
|
@@ -103,6 +114,9 @@ InstallMethod( GroupByNiceMonomorphism, | |||||
function( nice, grp ) | ||||||
local fam, pre; | ||||||
|
||||||
if not IsInjective( nice ) then | ||||||
Error( "<nice> is not injective" ); | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Well, the current code actually checks injectivity, thus the message is correct. |
||||||
fi; | ||||||
fam := FamilyObj( Source(nice) ); | ||||||
pre := Objectify(NewType(fam,IsGroup and IsAttributeStoringRep), rec()); | ||||||
SetIsHandledByNiceMonomorphism( pre, true ); | ||||||
|
@@ -1043,12 +1057,14 @@ InstallMethod( NiceMonomorphism, "SeedFaithfulAction supersedes", true, | |||||
[ IsGroup and IsHandledByNiceMonomorphism and | ||||||
HasSeedFaithfulAction], 1000, | ||||||
function(G) | ||||||
local b; | ||||||
local b, hom; | ||||||
b:=SeedFaithfulAction(G); | ||||||
if b=fail then | ||||||
TryNextMethod(); | ||||||
fi; | ||||||
return MultiActionsHomomorphism(G,b.points,b.ops); | ||||||
hom:= MultiActionsHomomorphism(G,b.points,b.ops); | ||||||
SetIsInjective( hom, true ); | ||||||
return hom; | ||||||
end); | ||||||
|
||||||
|
||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps this and/or the other new text could mention that one can ensure this is the case by either invoking
IsInjective(map)
(safe but potentially slow) orSetIsInjective(map, true)
(fast but the caller has to make sure this is correct) ?