From 0e5799862b5d586ab2e9e5d19cdb98345f0181dd Mon Sep 17 00:00:00 2001 From: Marek Kaluba Date: Mon, 7 Nov 2022 16:21:58 +0100 Subject: [PATCH] add action by alphabet permutation --- src/PropertyT.jl | 2 ++ src/actions/actions.jl | 29 ++++++++++++++++++++ src/actions/alphabet_permutation.jl | 42 +++++++++++++++++++++++++++++ src/actions/autfn_conjugation.jl | 26 ++++++++++++++++++ src/actions/sln_conjugation.jl | 20 ++++++++++++++ src/actions/spn_conjugation.jl | 27 +++++++++++++++++++ 6 files changed, 146 insertions(+) create mode 100644 src/actions/actions.jl create mode 100644 src/actions/alphabet_permutation.jl create mode 100644 src/actions/autfn_conjugation.jl create mode 100644 src/actions/sln_conjugation.jl create mode 100644 src/actions/spn_conjugation.jl diff --git a/src/PropertyT.jl b/src/PropertyT.jl index c53e69f..02d2536 100644 --- a/src/PropertyT.jl +++ b/src/PropertyT.jl @@ -23,6 +23,8 @@ include("roots.jl") import .Roots include("gradings.jl") +include("actions/actions.jl") + include("1712.07167.jl") include("1812.03456.jl") diff --git a/src/actions/actions.jl b/src/actions/actions.jl new file mode 100644 index 0000000..29a2fb3 --- /dev/null +++ b/src/actions/actions.jl @@ -0,0 +1,29 @@ +import SymbolicWedderburn.action +StarAlgebras.star(g::GroupElement) = inv(g) + +include("alphabet_permutation.jl") + +include("sln_conjugation.jl") +include("autfn_conjugation.jl") + +function SymbolicWedderburn.action( + act::SymbolicWedderburn.ByPermutations, + g::Groups.GroupElement, + α::StarAlgebras.AlgebraElement +) + res = StarAlgebras.zero!(similar(α)) + B = basis(parent(α)) + for (idx, val) in StarAlgebras._nzpairs(StarAlgebras.coeffs(α)) + a = B[idx] + a_g = SymbolicWedderburn.action(act, g, a) + res[a_g] += val + end + return res +end + +function Base.:^( + w::W, + p::PermutationGroups.AbstractPerm, +) where {W<:Groups.AbstractWord} + return W([l^p for l in w]) +end diff --git a/src/actions/alphabet_permutation.jl b/src/actions/alphabet_permutation.jl new file mode 100644 index 0000000..2f2655c --- /dev/null +++ b/src/actions/alphabet_permutation.jl @@ -0,0 +1,42 @@ +## action induced from permuting letters of an alphabet + +struct AlphabetPermutation{GEl,I} <: SymbolicWedderburn.ByPermutations + perms::Dict{GEl,Perm{I}} +end + +function AlphabetPermutation( + A::Alphabet, + Γ::PermutationGroups.AbstractPermutationGroup, + op, +) + return AlphabetPermutation( + Dict(γ => inv(Perm([A[op(l, γ)] for l in A])) for γ in Γ), + ) +end + +function AlphabetPermutation(A::Alphabet, W::Constructions.WreathProduct, op) + return AlphabetPermutation( + Dict( + w => inv(Perm([A[op(op(l, w.p), w.n)] for l in A])) for + w in W + ), + ) +end + +function SymbolicWedderburn.action( + act::AlphabetPermutation, + γ::GroupElement, + w::Groups.AbstractWord, +) + return w^(act.perms[γ]) +end + +function SymbolicWedderburn.action( + act::AlphabetPermutation, + γ::GroupElement, + g::Groups.AbstractFPGroupElement, +) + G = parent(g) + w = word(g)^(act.perms[γ]) + return G(w) +end diff --git a/src/actions/autfn_conjugation.jl b/src/actions/autfn_conjugation.jl new file mode 100644 index 0000000..99559d5 --- /dev/null +++ b/src/actions/autfn_conjugation.jl @@ -0,0 +1,26 @@ +## Particular definitions for actions on Aut(F_n) + +function _conj( + t::Groups.Transvection, + σ::PermutationGroups.AbstractPerm, +) + return Groups.Transvection(t.id, t.i^inv(σ), t.j^inv(σ), t.inv) +end + +function _flip(t::Groups.Transvection, g::Groups.GroupElement) + isone(g) && return t + return Groups.Transvection(t.id === :ϱ ? :λ : :ϱ, t.i, t.j, t.inv) +end + +function _conj( + t::Groups.Transvection, + x::Groups.Constructions.DirectPowerElement, +) + @assert Groups.order(Int, parent(x).group) == 2 + i, j = t.i, t.j + t = ifelse(isone(x.elts[i] * x.elts[j]), t, inv(t)) + return _flip(t, x.elts[i]) +end + +action_by_conjugation(sautfn::Groups.AutomorphismGroup{<:Groups.FreeGroup}, Σ::Groups.Group) = + AlphabetPermutation(alphabet(sautfn), Σ, _conj) diff --git a/src/actions/sln_conjugation.jl b/src/actions/sln_conjugation.jl new file mode 100644 index 0000000..bdb016f --- /dev/null +++ b/src/actions/sln_conjugation.jl @@ -0,0 +1,20 @@ +## Particular definitions for actions on SL(n,ℤ) + +function _conj( + t::MatrixGroups.ElementaryMatrix{N}, + σ::PermutationGroups.AbstractPerm, +) where {N} + return MatrixGroups.ElementaryMatrix{N}(t.i^inv(σ), t.j^inv(σ), t.val) +end + +function _conj( + t::MatrixGroups.ElementaryMatrix{N}, + x::Groups.Constructions.DirectPowerElement, +) where {N} + @assert Groups.order(Int, parent(x).group) == 2 + just_one_flips = xor(isone(x.elts[t.i]), isone(x.elts[t.j])) + return ifelse(just_one_flips, inv(t), t) +end + +action_by_conjugation(sln::Groups.MatrixGroups.SpecialLinearGroup, Σ::Groups.Group) = + AlphabetPermutation(alphabet(sln), Σ, _conj) diff --git a/src/actions/spn_conjugation.jl b/src/actions/spn_conjugation.jl new file mode 100644 index 0000000..25b8bbc --- /dev/null +++ b/src/actions/spn_conjugation.jl @@ -0,0 +1,27 @@ +## Particular definitions for actions on Sp(n,ℤ) + +function _conj( + t::MatrixGroups.ElementarySymplectic{N,T}, + σ::PermutationGroups.AbstractPerm, +) where {N,T} + @assert iseven(N) + @assert degree(σ) == N ÷ 2 "Got degree = $(degree(σ)); N = $N" + i = mod1(t.i, N ÷ 2) + ib = i == t.i ? 0 : N ÷ 2 + j = mod1(t.j, N ÷ 2) + jb = j == t.j ? 0 : N ÷ 2 + return MatrixGroups.ElementarySymplectic{N}(t.symbol, i^inv(σ) + ib, j^inv(σ) + jb, t.val) +end + +function _conj( + t::MatrixGroups.ElementarySymplectic{N,T}, + x::Groups.Constructions.DirectPowerElement, +) where {N,T} + @assert Groups.order(Int, parent(x).group) == 2 + @assert iseven(N) + just_one_flips = xor(isone(x.elts[mod1(t.i, N ÷ 2)]), isone(x.elts[mod1(t.j, N ÷ 2)])) + return ifelse(just_one_flips, inv(t), t) +end + +action_by_conjugation(sln::Groups.MatrixGroups.SymplecticGroup, Σ::Groups.Group) = + AlphabetPermutation(alphabet(sln), Σ, _conj)