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 is_conjugate_subgroup_with_data #3281

Merged
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
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
Loading