Skip to content

Commit

Permalink
add hom between GAPGroup and MultTableGroup`
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasBreuer committed Jan 17, 2025
1 parent bcc316f commit 30a446c
Show file tree
Hide file tree
Showing 2 changed files with 116 additions and 0 deletions.
46 changes: 46 additions & 0 deletions src/Groups/homomorphisms.jl
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,13 @@ function hom(G::GAPGroup, H::GAPGroup, imgs::Vector; check::Bool = true)
return hom(G, H, gens(G), imgs; check)
end


################################################################################
#
# `hom` between `GAPGroup` and `FinGenAbGroup`
#
################################################################################

# Map `G::GAPGroup` to `A::FinGenAbGroup` by prescribing images.
# Return a composition of homomorphisms `G -> G/G' -> B -> A`,
# not a `GAPGroupHomomorphism`.
Expand Down Expand Up @@ -172,6 +179,45 @@ function hom(A::FinGenAbGroup, G::GAPGroup, imgs::Vector{<:GAPGroupElem}; check:
return hom(A, G, gens(A), imgs; check)
end

################################################################################
#
# `hom` between `GAPGroup` and `MultTableGroup`
#
################################################################################

# Map `G::GAPGroup` to `M::MultTableGroup` by prescribing images.
# Return a composition of homomorphisms `G -> B -> M`,
# not a `GAPGroupHomomorphism`.
function hom(G::GAPGroup, M::MultTableGroup, gensG::Vector, imgs::Vector{MultTableGroupElem}; check::Bool = true)
# map M to an isomorphic perm. group B
iso = isomorphism(PermGroup, M)
B = codomain(iso)

# map G to B as prescribed
map1 = hom(G, B, gensG, [iso(x) for x in imgs], check = check)

# create the composition
return compose(map1, inv(iso))
end

function hom(G::GAPGroup, M::MultTableGroup, imgs::Vector{MultTableGroupElem}; check::Bool = true)
return hom(G, M, gens(G), imgs; check)
end

# Map `M::MultTableGroup` to `G::GAPGroup` by prescribing images.
# Return a composition `M -> B -> G` where `M -> B` is an isomorphism
# to a `GAPGroup`.
function hom(M::MultTableGroup, G::GAPGroup, gensM::Vector, imgs::Vector{<:GAPGroupElem}; check::Bool = true)
map1 = isomorphism(PermGroup, M)
map2 = hom(codomain(map1), G, [map1(x) for x in gensM], imgs, check = check)
return compose(map1, map2)
end

function hom(M::MultTableGroup, G::GAPGroup, imgs::Vector{<:GAPGroupElem}; check::Bool = true)
return hom(M, G, gens(M), imgs; check)
end


function domain(f::GAPGroupHomomorphism)
return f.domain
end
Expand Down
70 changes: 70 additions & 0 deletions test/Groups/homomorphisms.jl
Original file line number Diff line number Diff line change
Expand Up @@ -334,12 +334,19 @@ end
G = Hecke.small_group(64, 14, DB = Hecke.DefaultSmallGroupDB())
H = small_group(64, 14)
@test is_isomorphic(G, H)
@test is_isomorphic(H, G)
f = isomorphism(G, H)
for x in gens(G), y in gens(G)
@test f(x) * f(y) == f(x * y)
@test preimage(f, f(x)) == x
@test preimage(f, f(y)) == y
end
f = isomorphism(H, G)
for x in gens(H), y in gens(H)
@test f(x) * f(y) == f(x * y)
@test preimage(f, f(x)) == x
@test preimage(f, f(y)) == y
end
fl, f = is_isomorphic_with_map(G, H)
@test fl
for x in gens(G), y in gens(G)
Expand Down Expand Up @@ -636,6 +643,69 @@ end
@test order(image(mp)[1]) == 1
end

@testset "Homomorphism GAPGroup to MultTableGroup" begin
# M isomorphic to G
M = Hecke.small_group(20, 3, DB = Hecke.DefaultSmallGroupDB())
iso = isomorphism(PermGroup, M)
G = codomain(iso)
imgs = [iso(x) for x in gens(M)]
mp = hom(G, M, imgs, gens(M))
@test [mp(x) for x in gens(G)] == gens(M)
@test [preimage(mp, x) for x in gens(M)] == gens(G)

# G trivial
G = cyclic_group(PcGroup, 1)
M = Hecke.small_group(6, 1, DB = Hecke.DefaultSmallGroupDB())
imgs = elem_type(M)[]
mp = hom(G, M, imgs)
@test mp(one(G)) == one(M)

# M trivial
G = small_group(20, 3)
M = Hecke.small_group(1, 1, DB = Hecke.DefaultSmallGroupDB())
imgs = [one(M) for x in gens(G)]
mp = hom(G, M, imgs)
@test all(x -> order(mp(x)) == 1, gens(G))

# G and M trivial
G = cyclic_group(PcGroup, 1)
M = Hecke.small_group(1, 1, DB = Hecke.DefaultSmallGroupDB())
imgs = elem_type(M)[]
mp = hom(G, M, imgs)
@test mp(one(G)) == one(M)
end

@testset "Homomorphism MultTableGroup to GAPGroup" begin
# M isomorphic to G
M = Hecke.small_group(20, 3, DB = Hecke.DefaultSmallGroupDB())
iso = isomorphism(PermGroup, M)
G = codomain(iso)
imgs = [iso(x) for x in gens(M)]
mp = hom(M, G, gens(M), imgs)
@test [mp(x) for x in gens(M)] == gens(G)

# G trivial
G = cyclic_group(PcGroup, 1)
M = Hecke.small_group(6, 1, DB = Hecke.DefaultSmallGroupDB())
imgs = [one(G) for x in gens(M)]
mp = hom(M, G, imgs)
@test mp(one(M)) == one(G)

# M trivial
M = Hecke.small_group(1, 1, DB = Hecke.DefaultSmallGroupDB())
G = dihedral_group(8)
imgs = [one(G)]
mp = hom(M, G, imgs)
@test mp(one(M)) == one(G)

# G and M trivial
M = Hecke.small_group(1, 1, DB = Hecke.DefaultSmallGroupDB())
G = cyclic_group(PcGroup, 1)
imgs = [one(G)]
mp = hom(M, G, imgs)
@test mp(one(M)) == one(G)
end

function test_direct_prods(G1,G2)
G = direct_product(G1,G2)
f1 = canonical_injection(G,1)
Expand Down

0 comments on commit 30a446c

Please sign in to comment.