Skip to content

Commit

Permalink
add is_conjugate_subgroup_with_data
Browse files Browse the repository at this point in the history
and changed `is_conjugate_subgroup` to return only `true` or `false`
  • Loading branch information
ThomasBreuer committed Jan 31, 2024
1 parent e75fc82 commit 417fcea
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 7 deletions.
46 changes: 41 additions & 5 deletions src/Groups/GAPGroups.jl
Original file line number Diff line number Diff line change
Expand Up @@ -907,7 +907,14 @@ end
"""
is_conjugate_subgroup(G::T, U::T, V::T) where T <: GAPGroup
Return whether a conjugate of `V` by some element in `G` is a subgroup of `U`.
Return `true` if a conjugate of `V` by some element in `G` is a subgroup of `U`,
and `false` otherwise.
If one needs a conjugating element then one can use
[`is_conjugate_subgroup_with_data`](@ref).
In order to check whether `U` and `V` are conjugate in `G`.
use [`is_conjugate`](@ref) or [`is_conjugate_with_data`](@ref).
# Examples
```jldoctest
Expand All @@ -920,17 +927,46 @@ julia> V = sub(G, [G([2,1,3,4])])[1]
Permutation group of degree 4
julia> is_conjugate_subgroup(G, U, V)
(false, ())
false
julia> V = sub(G, [G([2, 1, 4, 3])])[1]
Permutation group of degree 4
julia> is_conjugate_subgroup(G, U, V)
(true, ())
true
```
"""
is_conjugate_subgroup(G::T, U::T, V::T) where T <: GAPGroup = is_conjugate_subgroup_with_data(G, U, V)[1]


"""
is_conjugate_subgroup_with_data(G::T, U::T, V::T) where T <: GAPGroup
If a conjugate of `V` by some element in `G` is a subgroup of `U`,
return `true, z` where `V^z` is a subgroup of `U`;
otherwise, return `false, one(G)`.
# Examples
```jldoctest
julia> G = symmetric_group(4);
julia> U = derived_subgroup(G)[1]
Alt(4)
julia> V = sub(G, [G([2,1,3,4])])[1]
Permutation group of degree 4
julia> is_conjugate_subgroup_with_data(G, U, V)
(false, ())
julia> V = sub(G, [G([2, 1, 4, 3])])[1]
Permutation group of degree 4
julia> is_conjugate_subgroup_with_data(G, U, V)
(true, ())
```
"""
function is_conjugate_subgroup(G::T, U::T, V::T) where T <: GAPGroup
function is_conjugate_subgroup_with_data(G::T, U::T, V::T) where T <: GAPGroup
if order(V) == 1
return true, one(U)
end
Expand All @@ -947,7 +983,7 @@ function is_conjugate_subgroup(G::T, U::T, V::T) where T <: GAPGroup
return true, inv(t)
end
end
return false, one(U)
return false, one(G)
end

@doc raw"""
Expand Down
2 changes: 1 addition & 1 deletion src/Groups/GrpAb.jl
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ function is_conjugate_with_data(G::GrpAbFinGen, H::GrpAbFinGen, K::GrpAbFinGen)
end

is_conjugate_subgroup(G::T, U::T, V::T) where T <: GrpAbFinGen = is_subgroup(V, U)[1]

is_conjugate_subgroup_with_data(G::T, U::T, V::T) where T <: GrpAbFinGen = is_subgroup(V, U)[1], zero(G)

Base.IteratorSize(::Type{<:GrpAbFinGenConjClass}) = Base.HasLength()

Expand Down
1 change: 1 addition & 0 deletions src/exports.jl
Original file line number Diff line number Diff line change
Expand Up @@ -735,6 +735,7 @@ export is_complete
export is_congruent
export is_conjugate
export is_conjugate_subgroup
export is_conjugate_subgroup_with_data
export is_conjugate_with_data
export is_connected
export is_cyclic, has_is_cyclic, set_is_cyclic
Expand Down
3 changes: 2 additions & 1 deletion test/Groups/GrpAb.jl
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@ end
K = representative(C2)
@test is_conjugate(G1, H, K) == (H == K)
@test is_conjugate_with_data(G1, H, K)[1] == (H == K)
@test is_conjugate_subgroup(G1, H, K) == is_subgroup(K, H)[1]
@test is_conjugate_subgroup(G1, H, K) == is_subset(K, H)
@test is_conjugate_subgroup_with_data(G1, H, K) == (is_subset(K, H), zero(G1))
end
C = CC[1]
for H in C
Expand Down
4 changes: 4 additions & 0 deletions test/Groups/conjugation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,10 @@
@test is_conjugate_with_data(G,x,y)[1]
z = is_conjugate_with_data(G,x,y)[2]
@test x^z == y
@test is_conjugate_subgroup(G, x, y)
@test is_conjugate_subgroup_with_data(G, x, y)[1]
z = is_conjugate_subgroup_with_data(G,x,y)[2]
@test y^z == x
y = rand(CC[(i % length(CC))+1])
@test !is_conjugate(G,x,y)
@test !is_conjugate_with_data(G,x,y)[1]
Expand Down

0 comments on commit 417fcea

Please sign in to comment.