# Lie algebra homomorphisms

Homomorphisms of Lie algebras in Oscar are represented by the type `LieAlgebraHom`

.

## Constructors

Lie algebra homomorphisms $h: L_1 \to L_2$ are constructed by providing either the images of the basis elements of $L_1$ or a $\dim L_1 \times \dim L_2$ matrix.

`hom`

— Method`hom(L1::LieAlgebra, L2::LieAlgebra, imgs::Vector{<:LieAlgebraElem}; check::Bool=true) -> LieAlgebraHom`

Construct the homomorphism from `L1`

to `L2`

by sending the `i`

-th basis element of `L1`

to `imgs[i]`

and extending linearly. All elements of `imgs`

must lie in `L2`

.

By setting `check=false`

, the linear map is not checked to be compatible with the Lie bracket.

**Examples**

```
julia> L1 = special_linear_lie_algebra(QQ, 2);
julia> L2 = special_linear_lie_algebra(QQ, 3);
julia> h = hom(L1, L2, [basis(L2, 1), basis(L2, 4), basis(L2, 7)]) # embed sl_2 into sl_3
Lie algebra morphism
from special linear Lie algebra of degree 2 over QQ
to special linear Lie algebra of degree 3 over QQ
julia> [(x, h(x)) for x in basis(L1)]
3-element Vector{Tuple{LinearLieAlgebraElem{QQFieldElem}, LinearLieAlgebraElem{QQFieldElem}}}:
(e_1_2, e_1_2)
(f_1_2, f_1_2)
(h_1, h_1)
```

This function is part of the experimental code in Oscar. Please read here for more details.

`hom`

— Method`hom(L1::LieAlgebra, L2::LieAlgebra, mat::MatElem; check::Bool=true) -> LieAlgebraHom`

Construct the homomorphism from `L1`

to `L2`

by acting with the matrix `mat`

from the right on the coefficient vector w.r.t. the basis of `L1`

. `mat`

must be a matrix of size `dim(L1) \times dim(L2)`

over `coefficient_ring(L2)`

.

By setting `check=false`

, the linear map is not checked to be compatible with the Lie bracket.

**Examples**

```
julia> L1 = special_linear_lie_algebra(QQ, 2);
julia> L2 = general_linear_lie_algebra(QQ, 2);
julia> h = hom(L1, L2, matrix(QQ, [0 1 0 0; 0 0 1 0; 1 0 0 -1]))
Lie algebra morphism
from special linear Lie algebra of degree 2 over QQ
to general linear Lie algebra of degree 2 over QQ
julia> [(x, h(x)) for x in basis(L1)]
3-element Vector{Tuple{LinearLieAlgebraElem{QQFieldElem}, LinearLieAlgebraElem{QQFieldElem}}}:
(e_1_2, x_1_2)
(f_1_2, x_2_1)
(h_1, x_1_1 - x_2_2)
```

This function is part of the experimental code in Oscar. Please read here for more details.

`identity_map`

— Method`identity_map(L::LieAlgebra) -> LieAlgebraHom`

Construct the identity map on `L`

.

**Examples**

```
julia> L = special_linear_lie_algebra(QQ, 3)
Special linear Lie algebra of degree 3
of dimension 8
over rational field
julia> identity_map(L)
Lie algebra morphism
from special linear Lie algebra of degree 3 over QQ
to special linear Lie algebra of degree 3 over QQ
```

This function is part of the experimental code in Oscar. Please read here for more details.

`zero_map`

— Method```
zero_map(L1::LieAlgebra, L2::LieAlgebra) -> LieAlgebraHom
zero_map(L::LieAlgebra) -> LieAlgebraHom
```

Construct the zero map from `L1`

to `L2`

or from `L`

to `L`

.

**Examples**

```
julia> L = special_linear_lie_algebra(QQ, 3)
Special linear Lie algebra of degree 3
of dimension 8
over rational field
julia> zero_map(L)
Lie algebra morphism
from special linear Lie algebra of degree 3 over QQ
to special linear Lie algebra of degree 3 over QQ
```

This function is part of the experimental code in Oscar. Please read here for more details.

## Functions

The following functions are available for `LieAlgebraHom`

s:

### Basic properties

For a homomorphism $h: L_1 \to L_2$, `domain(h)`

and `codomain(h)`

return $L_1$ and $L_2$ respectively.

`matrix`

— Method`matrix(h::LieAlgebraHom) -> MatElem`

Return the transformation matrix of `h`

w.r.t. the bases of the domain and codomain.

Note: The matrix operates on the coefficient vectors from the right.

This function is part of the experimental code in Oscar. Please read here for more details.

### Image

`image`

— Method`image(h::LieAlgebraHom, x::LieAlgebraElem) -> LieAlgebraElem`

Return the image of `x`

under `h`

.

This function is part of the experimental code in Oscar. Please read here for more details.

`image`

— Method`image(h::LieAlgebraHom) -> LieSubalgebra`

Return the image of `h`

as a Lie subalgebra of the codomain.

This function is part of the experimental code in Oscar. Please read here for more details.

`image`

— Method`image(h::LieAlgebraHom, I::LieAlgebraIdeal) -> LieSubalgebra`

Return the image of `I`

under `h`

as a Lie subalgebra of the codomain.

This function is part of the experimental code in Oscar. Please read here for more details.

`image`

— Method`image(h::LieAlgebraHom, S::LieSubalgebra) -> LieSubalgebra`

Return the image of `S`

under `h`

as a Lie subalgebra of the codomain.

This function is part of the experimental code in Oscar. Please read here for more details.

### Kernel

`kernel`

— Method`kernel(h::LieAlgebraHom) -> LieAlgebraIdeal`

Return the kernel of `h`

as an ideal of the domain.

This function is part of the experimental code in Oscar. Please read here for more details.

### Composition

`compose`

— Method`compose(f::LieAlgebraHom, g::LieAlgebraHom) -> LieAlgebraHom`

Return the composition of `f`

and `g`

, i.e. the homomorphism `h`

such that `h(x) = g(f(x))`

for all `x`

in the domain of `f`

. The codomain of `f`

must be identical to the domain of `g`

.

This function is part of the experimental code in Oscar. Please read here for more details.

### Inverses

`is_isomorphism`

— Method`is_isomorphism(h::LieAlgebraHom) -> Bool`

Return `true`

if `h`

is an isomorphism. This function tries to invert the transformation matrix of `h`

and caches the result. The inverse isomorphism can be cheaply accessed via `inv(h)`

after calling this function.

This function is part of the experimental code in Oscar. Please read here for more details.

`inv`

— Method`inv(h::LieAlgebraHom) -> LieAlgebraHom`

Return the inverse of `h`

. Requires `h`

to be an isomorphism.

This function is part of the experimental code in Oscar. Please read here for more details.