struct SpecialLinearGroup <: SymmetricGroup args::Dict{String,Any} group::AbstractAlgebra.Group function SpecialLinearGroup(args::Dict) n = args["N"] p = args["p"] X = args["X"] if p == 0 G = MatrixSpace(Nemo.ZZ, n, n) else G = MatrixSpace(FiniteField(p), n, n) end return new(args, G) end end function name(G::SpecialLinearGroup) N = G.args["N"] p = G.args["p"] X = G.args["X"] if p == 0 R = (X ? "Z[x]" : "Z") else R = "F$p" end if G.args["nosymmetry"] return "SL($N,$R)" else return "oSL($N,$R)" end end group(G::SpecialLinearGroup) = G.group function E(i::Int, j::Int, M::MatSpace, val=one(M.base_ring)) @assert i≠j m = one(M) m[i,j] = val return m end function generatingset(G::SpecialLinearGroup) n = G.args["N"] p = G.args["p"] X = G.args["X"] SL = group(G) indexing = [(i,j) for i in 1:n for j in 1:n if i≠j] p > 0 && X && throw("SL(n, F_p[x]) not implemented") if !X S = [E(idx[1],idx[2],SL) for idx in indexing] else r = G.args["radius"] S = [E(i,j,SL,v) for (i,j) in indexing for v in [1, 100*r]] end return unique([S; inv.(S)]) end function autS(G::SpecialLinearGroup) N = G.args["N"] return WreathProduct(PermutationGroup(2), PermutationGroup(N)) end ############################################################################### # # Action of WreathProductElems on Nemo.MatElem # ############################################################################### function matrix_emb(MM::MatSpace, g::WreathProductElem) parent(g).P.n == MM.cols == MM.rows || throw("No natural embedding of $(parent(g)) in ") powers = [(elt == parent(elt)() ? 0: 1) for elt in g.n.elts] elt = diagm([(-1)^(elt == parent(elt)() ? 0: 1) for elt in g.n.elts]) return MM(elt)*MM(Nemo.matrix_repr(g.p)') end function (g::WreathProductElem)(A::MatElem) G = matrix_emb(parent(A), g) inv_G = matrix_emb(parent(A), inv(g)) return G*A*inv_G end function (p::perm)(A::MatElem) length(p.d) == A.r == A.c || throw("Can't act via $p on matrix of size ($(A.r), $(A.c))") R = parent(A) return p*A*inv(p) end