NC versions of PreImages, PreImagesSet, PreImagesElm and PreImagesRepresentative - version 2#6409
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #6409 +/- ##
==========================================
+ Coverage 78.74% 78.80% +0.05%
==========================================
Files 685 685
Lines 293314 294048 +734
Branches 8646 8648 +2
==========================================
+ Hits 230975 231711 +736
- Misses 60520 60527 +7
+ Partials 1819 1810 -9 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
stertooy
left a comment
There was a problem hiding this comment.
Very happy to see this PR revived!
One thing I'm a bit wary of, is how PreImagesSet( f, U ) always returns [ ] if U is not a subset of Range( f ), even if they have non-empty intersection. Intuitively, I would expect this function to follow the standard(?) mathematical definition of
PreImagesSetNC( Intersection( Range( f ), U ) )
| CollFamRangeEqFamElms, | ||
| [ IsFromFpGroupHomomorphism,IsGroup ],0, | ||
| function(hom,u) | ||
| if not (u in Range(hom)) then |
There was a problem hiding this comment.
There's a mistake here. The argument u is a subgroup of Range(hom), but here we check if it it's an element instead. This should probably be
if not IsSubset( Range(hom), u ) then
like here?
This is the root cause of the failure in teststandard here. In particular, if CRISP is loaded, it installs a method for NormalSubgroups which relies on PreImagesSet.
|
@stertooy It's so good to get feedback on this work - I will get on with making the changes you suggest. |
|
Now I am really confused. The manual states: "If elms is a subset of the range of the general mapping map then PreImagesSet returns the set of all preimages of elms under map." Sticking to that, PreImagesSet should return fail if U is not a subset of the range. Alternatively, we could ditch PreImagesSetNC, and redefine PreImagesSet to return the preimage of the intersection, which could be []. |
|
Perhaps this is why I returned [] in PreImagesElm when the test failed: |
| [ IsAlgebraHomomorphismFromFpRep, IsMatrix ], | ||
| PreImagesRepresentativeOperationAlgebraHomomorphism ); | ||
|
|
||
| InstallMethod( PreImagesRepresentativeNC, |
There was a problem hiding this comment.
I think this should be
InstallMethod( PreImagesRepresentative,
i.e. with the NC removed?
I think the question is what we want the non-NC functions to do for elements/sets not contained in the range. I see two options:
The former option keeps the NC and non-NC versions closer together, with the only difference being a extra check, which is what an NC version usually indicates in GAP. The latter option sticks closer to the standard mathematical definitions. Either option is fine with me (with a preference for option 2), but it should at least be consistent across all the affected functions.
I think we should still keep Perhaps @fingolfin @ThomasBreuer @hulpke want to weigh in, given that they were active in #4809 and #5173? |
This aims to continue work on the process outlined in issue #4809, and started in PR #5073.
(The latter PR was so far out of sync with the master that rebasing has proved to be very difficult, hence this version.)
The operations PreImages, PreImagesSet, PreImagesElm and PreImagesRepresentative have all been renamed throughout the library by adding 'NC' to their names. New versions of the four operations have been introduced which just add a simple test and then call the NC versions.
Authors of packages which include a method for one of the four operations have been asked to adjust their packages to prepare for the change. The packages which have merged a PR, and made a release after that are: cryst, fr, orb, polycyclic, matgrp, qpa, rcwa, semigroups, utils and wedderga, while fga has merged a PR but not made a release.
The fining package has closed PR#28 without merging it - it installs another method for PreImagesSet.