-
Notifications
You must be signed in to change notification settings - Fork 126
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
introduce SubPcGroup
#3166
introduce SubPcGroup
#3166
Conversation
That seems fine to me.
I also think this is fine, and in fact just reflects the reality in GAP, which tries to paper of it but doesn't really succeed. So I actually think it is better that we make this explicit. This way at least the user can immediately tell if a given group is the "full" group or not, and we have a chance of explaining the situation in the docstring for
|
@@ -110,11 +117,12 @@ function cyclic_group(::Type{T}, n::Union{IntegerUnion,PosInf}) where T <: GAPGr | |||
return T(GAP.Globals.CyclicGroup(_gap_filter(T), GAP.Obj(n))::GapObj) | |||
end | |||
|
|||
function cyclic_group(::Type{PcGroup}, n::Union{IntegerUnion,PosInf}) | |||
# special handling for pc groups: distinguish on the GAP side | |||
function cyclic_group(::Type{T}, n::Union{IntegerUnion,PosInf}) where T <: Union{PcGroup, SubPcGroup} |
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.
This creates a new PcGroup
, which would be the "whole" group, so should we really allow SubPcGroup
here?
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.
@ThomasBreuer did you see my question from January there? I don't terribly mind having this (it may make some generic code easier to write), but I wonder: does cyclic_group(SubPcGroup, 5)
really work correctly, and return something of type SubPcGroup
? We don't have a test for that, do we?
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.
Yes, cyclic_group(SubPcGroup, 5)
works.
(I had intended to add a test for this, but somehow this got lost.)
@@ -517,6 +524,29 @@ function isomorphism(::Type{T}, G::GAPGroup) where T <: Union{FPGroup, PcGroup, | |||
end::GAPGroupHomomorphism{typeof(G), T} | |||
end | |||
|
|||
# If `G` is not a full pc group then switch to a full pc group in Oscar. |
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.
This, by the way, is something that I needed a lot in the past, and was always annoyingly complicated in GAP. So this is a nice bonus I did not even consider (at least I don't recall considering it :-) )
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.
I think GAP is just missing something like IsomorphismFullPcGroup
.
src/Groups/homomorphisms.jl
Outdated
@@ -741,12 +771,14 @@ end | |||
GrpAbFinGen(G::T) where T <: GAPGroup | |||
PcGroup(G::T) where T <: Union{GAPGroup, GrpAbFinGen} | |||
pc_group(G::T) where T <: Union{GAPGroup, GrpAbFinGen} | |||
SubPcGroup(G::T) where T <: Union{GAPGroup, GrpAbFinGen} | |||
sub_pc_group(G::T) where T <: Union{GAPGroup, GrpAbFinGen} |
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.
Do we really want/need this? Maybe SubPcGroup
on a PcGroup
could be useful, in case one needs the "full group as a subgroup", but other than that?
Just to document it somewhere in writing: We discussed this some time ago and the verdict was that yes, we want to proceed in this direction; while there are downsides, many of them actually already exists, but just are hidden; and there are also upsides. So... |
@ThomasBreuer I hope this is still on your radar? :-) |
877bc2a
to
6d0af6b
Compare
The failure of one of the book examples shows a conceptual problem. (Likely this example can be turned back to the old behaviour by an improvement on the GAP side, but this does not solve the general problem.) The function The GAP function It looks as if we have to do something more specific on the GAP side if we want the results of (@fieker @fingolfin ?) |
7fc9496
to
741533a
Compare
The failure in |
Then you can adjust the output in ( |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #3166 +/- ##
==========================================
+ Coverage 81.34% 81.35% +0.01%
==========================================
Files 577 577
Lines 78618 78761 +143
==========================================
+ Hits 63952 64077 +125
- Misses 14666 14684 +18
|
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.
Some remarks. Most are optional (better to get this merged sooner and then polish afterwards), but there are one or two were I wonder if the code is correct as it is...?
@@ -110,11 +117,12 @@ function cyclic_group(::Type{T}, n::Union{IntegerUnion,PosInf}) where T <: GAPGr | |||
return T(GAP.Globals.CyclicGroup(_gap_filter(T), GAP.Obj(n))::GapObj) | |||
end | |||
|
|||
function cyclic_group(::Type{PcGroup}, n::Union{IntegerUnion,PosInf}) | |||
# special handling for pc groups: distinguish on the GAP side | |||
function cyclic_group(::Type{T}, n::Union{IntegerUnion,PosInf}) where T <: Union{PcGroup, SubPcGroup} |
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.
@ThomasBreuer did you see my question from January there? I don't terribly mind having this (it may make some generic code easier to write), but I wonder: does cyclic_group(SubPcGroup, 5)
really work correctly, and return something of type SubPcGroup
? We don't have a test for that, do we?
src/Groups/homomorphisms.jl
Outdated
# # Remove once Hecke lower bound is >= 0.14.1 | ||
# @attributes MultTableGroup | ||
|
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.
# # Remove once Hecke lower bound is >= 0.14.1 | |
# @attributes MultTableGroup |
350cba7
to
c861c62
Compare
Unfortunately this has conflicts again now :-( It would be great if we could merge this tomorrow (before or after triage, whenever you have time to resolve it) so we can move on :-) |
- add `_check_compatible` - remove requirements that several groups as arguments must have the same type; instead call `_check_compatible` inside
- add new GAP property `GroupGeneratorsDefinePresentation`, in order to check/cache whether a GAP group is the full group given by the underlying presentation, *and* whether the stored group generators correspond to the generators of this presentation - export `SubPcGroup`, `SubPcGroupElem` - relax type relations in various signatures, since now subgroups of a group can have a type different from that of the full group - change the parametrization of various types because now several types of groups may be involved: `GroupCoset` involves a group, a subgroup, and a group element. `GroupDoubleCoset` involves a group, two subgroups, and a group element. `SubgroupTransversal` involves a group and a subgroup - add a dictionary `_sub_types` that maps a group type to the type that is used for its (not necessariy proper) subgroups, adjust `_oscar_group` to create a group of the subgroup type (this is what `_oscar_group` is thought for), adjust `_get_type`, - support `on_gens = true` also for `isomorphism(PcGroup, G)` where possible - change some (types of) return values: - the default return type of `_isomorphic_gap_group(A::FinGenAbGroup)` from `PcGroup` to `SubPcGroup`, - the return value of `isomorphism_to_GAP_group(G::FinGenAbGroup)` to use a `SubPcGroup` not a `PcGroup`, - throw an error if `abelian_group(PcGroup, G)` is called for a group `G` whose generators do not fit to a supported pc presentation, - and throw an error if `isomorphism(PcGroup, A)` is called for an abelian group such that the generators of `A` do not correspond to the generators of the underlying presentation. Yes, this is not a good idea. The problem is that currently we cannot guarantee that the `gens` value of a newly constructed `PcGroup` isomorphic to a given abelian group corresponds to the generators in the defining presentation. (GAP's `IsPcGroup` groups support only prime relative orders, and we cannot use GAP's `IsPcpGroup` throughout because of bugs that show up in Oscar's CI tests.) (Question: Should the constructor `PcGroup(G::GapObj)`, where `G` is a non-full pc group in GAP, be allowed to replace `G` be a newly created independent group, or should it throw an error, and `pc_group` should do the switch to a new group before calling `PcGroup`?) - disable (temporarily) some `@inferred` calls in tests, due to situations where types of results depend on `_sub_types` - call `abelian_group(SubPcGroup, ...)` instead of `abelian_group(PcGroup, ...)` in several tests, where the latter is currently not supported (hopefully temporarily); analogously for `isomorphism(PcGroup, ...)` vs. `isomorphism(SubPcGroup, ...)` - disable (temporarily) two equality tests concerning mappings from/to `PcGroup`s or `SubPcGroup`s: Would it be o.k. to just regard the groups (the maps) as equal, independent of their types?
due to changed `sub_type` handling
- adjust doctest output to `SubPcGroup` objects - changed signature of `complements`, `complement_classes`, added tests - document `SubPcGroupElem`
`PcGroup` takes a GAP group and wraps it; it is not allowed to replace the group by a different GAP group, thus it must throw an exception if the GAP group is not suitable. (This is crucial for example in the creation of group homomorphisms, where the GAP objects stored in domain and codomain must fit to the `Source` and `Range` objects of the underlying GAP mapping.) `pc_group` may return an Oscar group that stores a different GAP group than the given one.
The function must be able to create a map to a `PcGroup`, also in the case that `abelian_group(PcGroup, exponents)` does not work, due to the requirements that the `gens` value of the result corresponds to the given element orders *and* is the defining polycyclic sequence of the result group.
This fixes a test. I am not sure whether we want a more strict use of embeddings, or to allow for a more sloppy use of group elements. (In the latter case, we will run into problems in examples involving `FinGenAbGroup`s.)
- fix a signature in a `.md` file - remove a type assertion that is no longer valid (a subgroup can have a different type)
I am not sure whether this is a good idea. On the one hand, users would not understand that a newly created quotient is represented as a `SubPcGroup`. (The starting point was changed output in an example for the Oscar book.) On the other hand, we have to work around a GAP feature that offers natural homomorphisms instead of natural epimorphisms (with the possibility to create maps that need not be surjective). Since we have to compute the image of the GAP mapping anyhow, the current change does not add expensive computations.
- add comments - add tests - improve error messages
c861c62
to
0c07ce0
Compare
I find it rather surprising that there were not more conflicts. |
@ThomasBreuer there is one unresolved review comment of mine from quite some ago where I ask about |
This is a first attempt to implement what was sketched in #2672.
I am not sure that we really want this:
derived_series
) will now create the full group (if it occurs) with another type; one has to be aware of different types for the same mathematical object.If we want to proceed like this then the next step is as follows.
intersection
which expect arguments of the same type up to now.FpGroup
/SubFpGroup
.