Skip to content
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

add isomorphic_subgroups #4401

Merged
merged 1 commit into from
Dec 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/src/Groups/grouphom.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ and the codomain is some new group constructed by the function.
is_isomorphic(G::GAPGroup, H::GAPGroup)
is_isomorphic_with_map(G::GAPGroup, H::GAPGroup)
isomorphism(G::GAPGroup, H::GAPGroup)
isomorphic_subgroups(H::GAPGroup, G::GAPGroup)
```

```@docs
Expand Down
4 changes: 2 additions & 2 deletions docs/src/Groups/subgroups.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,15 @@ normal_subgroups
maximal_normal_subgroups
minimal_normal_subgroups
characteristic_subgroups
derived_series
derived_series(G::GAPGroup)
sylow_system
hall_system
complement_system
chief_series
composition_series
jennings_series
p_central_series
lower_central_series
lower_central_series(G::GAPGroup)
upper_central_series
```

Expand Down
1 change: 1 addition & 0 deletions src/GAP/wrappers.jl
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ GAP.@wrap IsNilpotentGroup(x::Any)::Bool
GAP.@wrap IsNormal(x::Any, y::Any)::Bool
GAP.@wrap IsNumberField(x::Any)::Bool
GAP.@wrap IsNumberFieldByMatrices(x::Any)::Bool
GAP.@wrap IsomorphicSubgroups(x::GapObj, y::GapObj)::GapObj
GAP.@wrap IsomorphismFpGroup(x::GapObj)::GapObj
GAP.@wrap IsomorphismFpGroupByGenerators(x::GapObj, y::GapObj)::GapObj
GAP.@wrap IsomorphismFpGroupByPcgs(x::GapObj, y::GapObj)::GapObj
Expand Down
52 changes: 52 additions & 0 deletions src/Groups/homomorphisms.jl
Original file line number Diff line number Diff line change
Expand Up @@ -436,6 +436,16 @@
return is_isomorphic(P, H)
end

function is_isomorphic(G::GAPGroup, H::FinGenAbGroup)
is_abelian(G) || return false
return abelian_invariants(G) == abelian_invariants(H)

Check warning on line 441 in src/Groups/homomorphisms.jl

View check run for this annotation

Codecov / codecov/patch

src/Groups/homomorphisms.jl#L439-L441

Added lines #L439 - L441 were not covered by tests
end

function is_isomorphic(G::FinGenAbGroup, H::GAPGroup)
is_abelian(H) || return false
return abelian_invariants(G) == abelian_invariants(H)
end

"""
isomorphism(G::Group, H::Group)

Expand Down Expand Up @@ -472,6 +482,48 @@
return GtoP * PtoH
end

"""
isomorphic_subgroups(H::Group, G::Group)

Return a vector of injective group homomorphism from `H` to `G`,
where the images are representatives of those conjugacy classes
of subgroups of `G` that are isomorphic with `H`.

# Examples
```jldoctest
julia> isomorphic_subgroups(alternating_group(5), alternating_group(6))
2-element Vector{GAPGroupHomomorphism{PermGroup, PermGroup}}:
Hom: Alt(5) -> Alt(6)
Hom: Alt(5) -> Alt(6)

julia> isomorphic_subgroups(symmetric_group(4), alternating_group(5))
GAPGroupHomomorphism{PermGroup, PermGroup}[]
```
"""
function isomorphic_subgroups(H::GAPGroup, G::GAPGroup)
res = GAPWrap.IsomorphicSubgroups(GapObj(G), GapObj(H))
return [GAPGroupHomomorphism(H, G, x) for x in res]
end

function isomorphic_subgroups(H::FinGenAbGroup, G::GAPGroup)
isoH = isomorphism(PcGroup, H)
res = isomorphic_subgroups(codomain(isoH), G)
return [isoH*x for x in res]
end

function isomorphic_subgroups(H::GAPGroup, G::FinGenAbGroup)
isoG = inv(isomorphism(PcGroup, G))
res = isomorphic_subgroups(H, domain(isoG))
return [x*isoG for x in res]
end

function isomorphic_subgroups(H::FinGenAbGroup, G::FinGenAbGroup)
isoH = isomorphism(PcGroup, H)
isoG = inv(isomorphism(PcGroup, G))
res = isomorphic_subgroups(codomain(isoH), domain(isoG))
return [isoH*x*isoG for x in res]
end

################################################################################
#
# Conversions between types
Expand Down
1 change: 1 addition & 0 deletions src/exports.jl
Original file line number Diff line number Diff line change
Expand Up @@ -951,6 +951,7 @@ export is_zm_graded
export isfinite
export isometry_group
export isomorphic_matroid
export isomorphic_subgroups
export isomorphism
export isone
export isqrtrem
Expand Down
23 changes: 23 additions & 0 deletions test/Groups/homomorphisms.jl
Original file line number Diff line number Diff line change
Expand Up @@ -482,6 +482,29 @@ end
@test FPGroup(G) isa FPGroup
@test_throws ArgumentError FinGenAbGroup(G)
end

# isomorphic subgroups
types = [PermGroup, PcGroup, FPGroup]
for T in types, S in types
G = codomain(isomorphism(T, symmetric_group(4)))
H = codomain(isomorphism(S, symmetric_group(3)))
res = @inferred isomorphic_subgroups(H, G)
@test length(res) == 1
@test domain(res[1]) === H
@test codomain(res[1]) === G
@test is_isomorphic(H, image(res[1])[1])
end
types = [PermGroup, SubPcGroup, FPGroup, FinGenAbGroup]
for T in types, S in types
G = abelian_group(T, [2, 4])
H = abelian_group(S, [2, 2])
res = @inferred isomorphic_subgroups(H, G)
@test length(res) == 1
@test domain(res[1]) === H
@test codomain(res[1]) === G
@test (T === FinGenAbGroup) || is_isomorphic(H, image(res[1])[1])
#TODO make image work for embedding into FinGenAbGroup?
end
end

@testset "Homomorphism GAPGroup to FinGenAbGroup" begin
Expand Down
Loading