From b3f16df1ffa79480e4f03d1a12d89365335e96f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lars=20G=C3=B6ttgens?= Date: Thu, 13 Jul 2023 17:05:12 +0200 Subject: [PATCH] Add `centralizer` and `normalizer` --- experimental/LieAlgebras/src/LieAlgebra.jl | 24 +++++++-- .../LieAlgebras/src/LieAlgebraIdeal.jl | 20 ++++++++ experimental/LieAlgebras/src/LieAlgebras.jl | 4 ++ experimental/LieAlgebras/src/LieSubalgebra.jl | 49 ++++++++++++++++++- .../LieAlgebras/src/LinearLieAlgebra.jl | 2 +- 5 files changed, 92 insertions(+), 7 deletions(-) diff --git a/experimental/LieAlgebras/src/LieAlgebra.jl b/experimental/LieAlgebras/src/LieAlgebra.jl index 63ca2517921d..b6fc09f0f7ba 100644 --- a/experimental/LieAlgebras/src/LieAlgebra.jl +++ b/experimental/LieAlgebras/src/LieAlgebra.jl @@ -270,7 +270,7 @@ end ############################################################################### # -# Important ideals +# Important ideals and subalgebras # ############################################################################### @@ -280,9 +280,6 @@ function derived_algebra(L::LieAlgebra) end function center(L::LieAlgebra) - characteristic(coefficient_ring(L)) == 2 && - error("GAP does something else for char 2 which is not implemented here.") - dim(L) == 0 && return ideal(L, []) mat = zero_matrix(coefficient_ring(L), dim(L), dim(L)^2) @@ -296,6 +293,24 @@ function center(L::LieAlgebra) return ideal(L, [L(c_basis[i, :]) for i in 1:c_dim]; is_basis=true) end +function centralizer(L::LieAlgebra, xs::AbstractVector{<:LieAlgebraElem}) + @req all(x -> parent(x) == L, xs) "Incompatible Lie algebras." + + mat = zero_matrix(coefficient_ring(L), dim(L), dim(L) * length(xs)) + for (i, bi) in enumerate(basis(L)) + for (j, xj) in enumerate(xs) + mat[i, ((j - 1) * dim(L) + 1):(j * dim(L))] = _matrix(bracket(bi, xj)) + end + end + + c_dim, c_basis = left_kernel(mat) + return sub(L, [L(c_basis[i, :]) for i in 1:c_dim]; is_basis=true) +end + +function centralizer(L::LieAlgebra, x::LieAlgebraElem) + return centralizer(L, [x]) +end + ############################################################################### # # Properties @@ -307,6 +322,7 @@ function is_abelian(L::LieAlgebra) end function is_simple(L::LieAlgebra) + is_abelian(L) && return false error("Not implemented.") # TODO end diff --git a/experimental/LieAlgebras/src/LieAlgebraIdeal.jl b/experimental/LieAlgebras/src/LieAlgebraIdeal.jl index a500815fe934..829b156a6b74 100644 --- a/experimental/LieAlgebras/src/LieAlgebraIdeal.jl +++ b/experimental/LieAlgebras/src/LieAlgebraIdeal.jl @@ -158,6 +158,21 @@ function bracket( return ideal(base_lie_algebra(I1), [x * y for x in gens(I1) for y in gens(I2)]) end +############################################################################### +# +# Important ideals and subalgebras +# +############################################################################### + +function normalizer(L::LieAlgebra, I::LieAlgebraIdeal) + @req parent(I) == L "Incompatible Lie algebras." + return normalizer(L, sub(L, I)) +end + +function centralizer(L::LieAlgebra, I::LieAlgebraIdeal) + return centralizer(L, basis(I)) +end + ############################################################################### # # Conversion @@ -170,6 +185,11 @@ function lie_algebra( return lie_algebra(basis(I)) end +function sub(L::LieAlgebra{C}, I::LieAlgebraIdeal{C}) where {C<:RingElement} + @req base_lie_algebra(I) === L "Incompatible Lie algebras." + return sub(L, basis(I); is_basis=true) +end + ############################################################################### # # Constructor diff --git a/experimental/LieAlgebras/src/LieAlgebras.jl b/experimental/LieAlgebras/src/LieAlgebras.jl index 2573c5a6d263..368bef3308c5 100644 --- a/experimental/LieAlgebras/src/LieAlgebras.jl +++ b/experimental/LieAlgebras/src/LieAlgebras.jl @@ -16,6 +16,7 @@ import ..Oscar: basis, basis_matrix, center, + centralizer, coeff, coefficient_ring, coefficients, @@ -31,6 +32,7 @@ import ..Oscar: is_abelian, is_simple, ngens, + normalizer, parent_type, sub, symbols, @@ -62,6 +64,7 @@ export highest_weight_module export is_direct_sum export is_dual export is_exterior_power +export is_self_normalizing export is_standard_module export is_symmetric_power export is_tensor_power @@ -113,6 +116,7 @@ export highest_weight_module export is_direct_sum export is_dual export is_exterior_power +export is_self_normalizing export is_standard_module export is_symmetric_power export is_tensor_power diff --git a/experimental/LieAlgebras/src/LieSubalgebra.jl b/experimental/LieAlgebras/src/LieSubalgebra.jl index 0dfb5b3e70ad..dc170755231f 100644 --- a/experimental/LieAlgebras/src/LieSubalgebra.jl +++ b/experimental/LieAlgebras/src/LieSubalgebra.jl @@ -150,6 +150,51 @@ function bracket( return ideal(base_lie_algebra(S1), [x * y for x in gens(S1) for y in gens(S2)]) end +############################################################################### +# +# Important ideals and subalgebras +# +############################################################################### + +function normalizer(L::LieAlgebra, S::LieSubalgebra) + @req base_lie_algebra(S) == L "Incompatible Lie algebras." + + mat = zero_matrix(coefficient_ring(L), dim(L) + dim(S)^2, dim(L) * dim(S)) + for (i, bi) in enumerate(basis(L)) + for (j, sj) in enumerate(basis(S)) + mat[i, ((j - 1) * dim(L) + 1):(j * dim(L))] = _matrix(bracket(bi, sj)) + end + end + for i in 1:dim(S) + mat[(dim(L) + (i - 1) * dim(S) + 1):(dim(L) + i * dim(S)), ((i - 1) * dim(L) + 1):(i * dim(L))] = basis_matrix( + S + ) + end + show(stdout, MIME"text/plain"(), mat) + println("") + sol_dim, sol = left_kernel(mat) + sol = sol[:, 1:dim(L)] + c_dim, c_basis = rref(sol) + println(c_dim) + show(stdout, MIME"text/plain"(), c_basis) + println("") + return sub(L, [L(c_basis[i, :]) for i in 1:c_dim]; is_basis=true) +end + +function centralizer(L::LieAlgebra, S::LieSubalgebra) + return centralizer(L, basis(S)) +end + +############################################################################### +# +# Properties +# +############################################################################### + +function is_self_normalizing(S::LieSubalgebra) + return normalizer(base_lie_algebra(S), S) == S +end + ############################################################################### # # Conversion @@ -159,7 +204,7 @@ end function lie_algebra( S::LieSubalgebra{C,LieT} ) where {C<:RingElement,LieT<:LieAlgebraElem{C}} - return lie_algebra(basis(S)) + return lie_algebra(basis(S)) #, embedding_hom # TODO end ############################################################################### @@ -169,7 +214,7 @@ end ############################################################################### function sub(L::LieAlgebra, gens::Vector; is_basis::Bool=false) - return LieSubalgebra{elem_type(coefficient_ring(L)),elem_type(L)}(L, gens; is_basis) #, embedding_hom # TODO + return LieSubalgebra{elem_type(coefficient_ring(L)),elem_type(L)}(L, gens; is_basis) end function sub(L::LieAlgebra{C}, gen::LieAlgebraElem{C}) where {C<:RingElement} diff --git a/experimental/LieAlgebras/src/LinearLieAlgebra.jl b/experimental/LieAlgebras/src/LinearLieAlgebra.jl index ad8c81ff57df..3cc290430f0c 100644 --- a/experimental/LieAlgebras/src/LinearLieAlgebra.jl +++ b/experimental/LieAlgebras/src/LinearLieAlgebra.jl @@ -217,7 +217,7 @@ function lie_algebra( R = coefficient_ring(parent_L) n = parent_L.n s = map(AbstractAlgebra.obj_to_string, basis) - return lie_algebra(R, n, basis, s; check) + return lie_algebra(R, n, matrix_repr.(basis), s; check) end @doc raw"""