oscar-system / Oscar.jl

A comprehensive open source computer algebra system for computations in algebra, geometry, and number theory.
https://www.oscar-system.org
Other
339 stars 120 forks source link

Constructing homomorphism for semidirect product #1649

Open CameronBraunstein opened 1 year ago

CameronBraunstein commented 1 year ago

I would like to construct a semidirect product of $H=S(2)$ and $N=A(5)$. The semidirect_product function calls for a homomorphism $f:H\to Aut(N)$. I want to be sensible and map elements of H to the corresponding conjugation map. Unfortunately, when I try to construct this, I am getting GAP errors that I am unsure how to fix in my construction of f.

julia> using Oscar

julia> N = alternating_group(5)
Alt( [ 1 .. 5 ] )

julia> H = symmetric_group(2)
Sym( [ 1 .. 2 ] )

julia> AutN = automorphism_group(N)
Aut( Alt( [ 1 .. 5 ] ) )

julia> f = hom(H,AutN,x ->AutN(hom(N,N,y->y^x)))
Group homomorphism from 
Sym( [ 1 .. 2 ] )
to
Aut( Alt( [ 1 .. 5 ] ) )

julia> G = semidirect_product(N,f,H)
ERROR: Error thrown by GAP: Error, Error thrown by GAP: Error, Not yet implemented in
  map!.fun( elm ) at /Users/cambraunstein/.julia/artifacts/80196249c050204d1b65e3b9f8b41878914c2cb0/share/gap/lib/mapprep.gi:616 called from 
ImagesRepresentative( map, g ) at /Users/cambraunstein/.julia/artifacts/80196249c050204d1b65e3b9f8b41878914c2cb0/share/gap/lib/ghom.gi:489 called from
func( C[i] ) at /Users/cambraunstein/.julia/artifacts/80196249c050204d1b65e3b9f8b41878914c2cb0/share/gap/lib/coll.gi:663 called from
List( gens, function ( g )
return ImagesRepresentative( map, g );
end ) at /Users/cambraunstein/.julia/artifacts/80196249c050204d1b65e3b9f8b41878914c2cb0/share/gap/lib/ghom.gi:489 called from
MappingGeneratorsImages( map ) at /Users/cambraunstein/.julia/artifacts/80196249c050204d1b65e3b9f8b41878914c2cb0/share/gap/lib/ghom.gi:506 called from
AsGroupGeneralMappingByImages( map ) at /Users/cambraunstein/.julia/artifacts/80196249c050204d1b65e3b9f8b41878914c2cb0/share/gap/lib/mapprep.gi:627 called from
...  at *defin*:0

not in any function at *defin*:0

Stacktrace:
 [1] error(s::String)
   @ Base ./error.jl:33
 [2] ThrowObserver(depth::Int32)
   @ GAP ~/.julia/packages/GAP/uS7xT/src/GAP.jl:67
 [3] _call_gap_func(func::GAP_jll.GapObj, a1::GAP_jll.GapObj, a2::GAP_jll.GapObj, a3::GAP_jll.GapObj)
   @ GAP ~/.julia/packages/GAP/uS7xT/src/ccalls.jl:285
 [4] call_gap_func_nokw
   @ ~/.julia/packages/GAP/uS7xT/src/ccalls.jl:224 [inlined]
 [5] (::GAP_jll.GapObj)(a1::GAP_jll.GapObj, a2::GAP_jll.GapObj, a3::GAP_jll.GapObj)
   @ GAP ~/.julia/packages/GAP/uS7xT/src/ccalls.jl:237
 [6] semidirect_product(N::PermGroup, f::GAPGroupHomomorphism{PermGroup, AutomorphismGroup{PermGroup}}, H::PermGroup)
   @ Oscar ~/.julia/dev/Oscar/src/Groups/directproducts.jl:266
 [7] top-level scope
   @ REPL[247]:1

System

julia> Oscar.versioninfo(full=true)
OSCAR version 0.10.2 - #document_all_groups_files, d087c6ea9 -- 2022-10-20 14:37:45 +0200
  combining:
    AbstractAlgebra.jl   v0.27.5
    GAP.jl               v0.8.4
    Hecke.jl             v0.15.5
    Nemo.jl              v0.32.3
    Polymake.jl          v0.8.1
    Singular.jl          v0.13.1
  building on:
    Antic_jll               v0.201.500+0
    Arb_jll                 v200.2300.0+0
    Calcium_jll             v0.401.100+0
    FLINT_jll               v200.900.1+0
    GAP_jll                 v400.1192.2+1
    Singular_jll            v403.100.200+0
    libpolymake_julia_jll   v0.8.2+0
    libsingular_julia_jll   v0.26.0+0
    msolve_jll              v0.4.4+0
    polymake_jll            v400.700.1+1
See `]st -m` for a full list of dependencies.

Julia Version 1.7.2
Commit bf53498635 (2022-02-06 15:21 UTC)
Platform Info:
  OS: macOS (x86_64-apple-darwin19.5.0)
  CPU: Intel(R) Core(TM) i7-4770HQ CPU @ 2.20GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-12.0.1 (ORCJIT, haswell)
Official https://julialang.org/ release
fingolfin commented 1 year ago

First off, a general remark: with the advantage of hindsight, I now think a majority of src/Groups/directproducts.jl is not how we should do things and should be removed; specifically anything dealing with the types DirectProductGroup, SemidirectProductGroup, WreathProductGroup.

Alas, for now it is how it is, and the above does not help with the issue at hand. Let's look at the error:

ERROR: Error thrown by GAP: Error, Error thrown by GAP: Error, Not yet implemented in

Grepping for this message makes it clear that this comes from _common_parent_group. Unfortunately we don't have a good backtrace here because this is Julia calling GAP calling Julia (and possibly a few more levels) and it only shows part of the backtrace (I'd love to improve this one day but it's difficult work, and just not a priority right now). But we can make sure by changing the error message to verify that it's really the right place we are looking at.

Anyway, the GAP trace mentions ImagesRepresentative( map, g ), so my guess here is that map is "our" map and applying it fails... Let's test that theory in Julia:

julia> f(one(H))
ERROR: Error thrown by GAP: Error, Error thrown by GAP: Error, Not yet implemented in
...

Aha. Digging deeper:

julia> x = gen(H,1)
(1,2)

julia> AutN(hom(N,N,y->y^x))
ERROR: Error thrown by GAP: Error, Not yet implemented in

Digging yet deeper:

julia> phi = hom(N,N,y->y^x)
Group homomorphism from
Alt( [ 1 .. 5 ] )
to
Alt( [ 1 .. 5 ] )

julia> AutN(phi)
ERROR: Error thrown by GAP: Error, Not yet implemented in

So the problem is that this homomorphism you construct can not be converted into an automorphism. We can now proceed to debug this...

BEGIN INTERMISSION However, it would be much better to directly construct the map as an automorphism. We already have a function inner_automorphism but it is too limited here. We should have a variant of that which takes both a domain (group) and an element; perhaps named conjugator_automorphism, matching GAP's ConjugatorAutomorphism (which is used by inner_automorphism). Perhaps you'd like to give it a go? END INTERMISSION

Let's see if we can narrow down the error further:

julia> phi(one(N))
ERROR: Error thrown by GAP: Error, Not yet implemented in
...

julia> one(N)^x
ERROR: Not yet implemented
Stacktrace:
 [1] error(s::String)
   @ Base ./error.jl:35
 [2] _common_parent_group
   @ ~/Projekte/OSCAR/Oscar.jl/src/Groups/GAPGroups.jl:265 [inlined]
 [3] ^(x::PermGroupElem, y::PermGroupElem)
   @ Oscar ~/Projekte/OSCAR/Oscar.jl/src/Groups/GAPGroups.jl:565
 [4] top-level scope
   @ REPL[50]:1

So the problem is that you are trying to conjugate an element of A5 by an element of S2 which is not well-defined in general ...

CameronBraunstein commented 1 year ago

I will try to implement conjugator_automorphism, thank you for the deep dive!