# Universal Enveloping Algebras

This section describes the functionality for universal enveloping algebras of Lie algebras. If a Lie algebra is semisimple and defined over a field of characteristic $0$, then it is possible to write down an integral basis of the universal enveloping algebra that has nice properties. To accommodate this possibility, two constructions of a universal enveloping algebra are provided: a general construction, and one in which this integral basis is used. First we briefly describe the theoretical background behind universal enveloping algebras.

In Magma, universal enveloping algebras have type `AlgUE` and their elements have type `AlgUEElt`. Integral universal enveloping algebras have type `AlgIUE` and their elements have type `AlgIUEElt`. General algebras having a PBW basis (see below) have type `AlgPBW` (elements type `AlgPBWElt`) which inherit from types `Alg` and `Rng`. Consequently, the type `AlgIUE` inherits from `AlgPBW`.

## Background

### Universal Enveloping Algebras

Let $L$ be a Lie algebra over the field $F$ having basis $x_1,\ldots, x_n$. The universal enveloping algebra $U(L)$ of $L$ is the associative algebra with identity, generated by $n$ symbols which are also denoted by $x_1,\ldots, x_n$. These generators satisfy the relations

$$
x_jx_i -x_ix_j = [ x_j,x_i],  1\leq i,j\leq n>.
$$

Here $[x_j,x_i]$ is the product in the Lie algebra $L$, so it is a certain linear combination of the $x_k$.

The theorem of Poincaré-Birkhoff-Witt states that a basis of $U(L)$ is formed by the set of all elements

$$
x_1^{k_1}\cdots x_n^{k_n},
$$

where the $k_i$ are non-negative integers. Furthermore, the product of two such basis elements may be rewritten as a linear combination of basis elements using the defining relations $x_jx_i -x_ix_j = [ x_j,x_i]$ for $j>i$.

### The Integral Form of a Universal Enveloping Algebra

If the Lie algebra $L$ happens to be (split) semisimple and of characteristic $0$, then the universal enveloping algebra has a nice basis described by [[Kostant, 1966](../../references.md#cite-kostant66)]. The first step in constructing this basis involves taking a Chevalley basis of $L$, consisting of the elements $y_1,\ldots, y_s$, $h_1,\ldots, h_r$ and $x_1,\ldots, x_s$. Here the $y_i$ and $x_i$ are root vectors belonging to negative roots and positive roots, respectively. The $h_i$ are basis elements of a Cartan subalgebra. In the universal enveloping algebra we use the divided powers

$$
y_i^{(n)} = {y_i^n\over n!}, ~~ x_i^{(n)} = {x_i^n\over n!},
$$

and the binomials

$$
{h_i \choose k } = { h_i(h_i-1)\cdots (h_i-k+1)\over k!}.
$$

A basis of $U(L)$ is formed by the elements

$$
y_1^{(m_1)}\cdots y_s^{(m_s)} {h_1\choose k_1} \cdots {h_r\choose k_r}
x_1^{(n_1)}\cdots x_s^{(n_s)}.
$$

This basis has the useful property that if we multiply two basis elements, the structure constants will be integers (usually of quite moderate size). So this is a basis of an integral form of the universal enveloping algebra.

## Construction of Universal Enveloping Algebras

### `UniversalEnvelopingAlgebra(L): AlgLie -> AlgUE`

This creates the universal enveloping algebra $U$ of the Lie algebra $L$. Here the $i$-th basis element of $L$ (i.e., `L.i`) corresponds to the $i$-th generator of $U$ (i.e., `U.i`). Every product of generators is rewritten as a linear combination of Poincaré-Birkhoff-Witt monomials (cf. Section [Universal Enveloping Algebras](#uea)).

### `IntegralUEA(L): AlgLie -> AlgIUE`

### `IntegralUEAlgebra(L): AlgLie -> AlgIUE`

### `IntegralUniversalEnvelopingAlgebra(L): AlgLie -> AlgIUE`

Given a semisimple Lie algebra $L$ of characteristic $0$, create the integral universal enveloping algebra $U$ of $L$. The basis described in Section [The Integral Form of a Universal Enveloping Algebra](#intuea) is used.

Let $x$, $y$ and $h$ denote the output of `ChevalleyBasis(L)`. Let $s$ be the length of $x$, and $r$ the length of $h$. Then every generator of $U$ corresponds to an element of $x$, $y$ or $h$. If $1\leq i\leq s$ then the $i$-th generator of $U$ (i.e., `U.i`) corresponds to the $i$-th element of $y$. It is printed as `y_i`. If $s+1\leq i\leq s+r$, then the $i$-th generator of $U$ corresponds to the $k$-th element of $h$, where $k=i-s$. It is printed as `[ h_k ; 1 ]` (i.e., `h_k` choose 1). Finally, if $s+r+1\leq i\leq 2s+r$, then the $i$-th generator corresponds to the $k$-th element of $x$, where $k=i-s-r$. It is printed as `x_k`.

Using this form of the universal enveloping algebra has two advantages. Firstly, the structure constants are integers which usually remain relatively small. Secondly, multiplication of elements is, in general, much faster than is the case with universal enveloping algebras that employ PBW bases.

### `Example: UEA Con (ex-c78d02)`

```magma
> T:= [ <4,1,1,1>, <1,4,1,-1>, <4,1,3,1>, <1,4,3,-1>, <4,2,2,1>, <2,4,2,-1>,
> <4,3,1,1>, <3,4,1,-1>, <3,1,2,1>, <1,3,2,-1> ];
> L:= LieAlgebra< Rationals(), 4 | T >;
> U:= UniversalEnvelopingAlgebra(L);
> U.4*U.1;
x_1*x_4 + x_1 + x_3
> L:= LieAlgebra("F4", Rationals());
> U:= IntegralUEA(L);
> U.29*U.1;
y_1*x_1 + [ h_1 ; 1 ]
> (1/4)*U.29^2*U.1^2;
y_1^(2)*x_1^(2) + y_1*[ h_1 ; 1 ]*x_1 - 2*y_1*x_1 + [ h_1 ; 2 ]

```

In the last example we divided by $4$ because `U.29^2 = 2 U.29^(2)`, and likewise for `U.1^2`.

### `AssignNames(~U, Q): AlgPBW, [ MonStgElt ]`

Assign the names in the sequence $Q$ to the generators of the algebra $U$.

### `ChangeRing(U, S): AlgUE, Rng -> AlgUE`

Given a universal enveloping algebra $U$ with base ring $R$, together with a ring $S$, construct the algebra $U'$ with base ring $S$ obtained by coercing the coefficients of elements of $U$ into $S$.

## Related Structures

### `CoefficientRing(U): AlgPBW -> Rng`

### `BaseRing(U): AlgPBW -> Rng`

The ring of coefficients of the universal enveloping algebra $U$.

### `Algebra(U): AlgUE -> AlgLie`

The Lie algebra corresponding to the universal enveloping algebra $U$.

## Elements of Universal Enveloping Algebras

Most functions in this section are applicable both to universal enveloping algebras and to integral universal enveloping algebras. Therefore, they are only documented once. An exception is the function `HBinomial`, which is only applicable to integral universal enveloping algebras.

### Creation of Elements

#### `U ! 0: AlgPBW, RngIntElt -> AlgPBWElt`

#### `Zero(U): AlgPBW -> AlgPBWElt`

The zero element of the universal enveloping algebra $U$.

#### `U ! 1: AlgPBW, RngIntElt -> AlgPBWElt`

#### `One(U): AlgPBW -> AlgPBWElt`

The identity element of the universal enveloping algebra $U$.

#### `U . i: AlgPBW, RngIntElt -> AlgPBWElt`

The $i$-th generator of the universal enveloping algebra $U$.

#### `U ! r: AlgPBW, Any -> AlgPBWElt`

Returns $r$ as an element of the enveloping algebra $U$ where $r$ may be anything coercible into the coefficient ring of $U$ or an element of another enveloping algebra of the same type as $U$ whose coefficients can be coerced into the coefficient ring of $U$.

#### `HBinomial(U, i, n): AlgIUE, RngIntElt, RngIntElt -> AlgIUEElt`

#### `HBinomial(h, n): AlgIUEElt, RngIntElt -> AlgIUEElt`

This function is applicable only in the case of integral universal enveloping algebras. It is used for constructing the “binomial” elements $h_i$ choose $n$. In the first form $U$ is an integral universal enveloping algebra, and $i$ is an index between $1$ and the rank of the root datum. In the second form, the element $h$ is simply `U.(s+i)`, where $s$ is the number of positive roots.

#### `Example: H Binomial (ex-4c79c2)`

```magma
> L:= LieAlgebra("E6",Rationals());
> U:= IntegralUEA(L);
> HBinomial(U, 4, 10);
[ h_4 ; 10 ]

```

### Operations on Elements

#### `x + y: AlgPBWElt, AlgPBWElt -> AlgPBWElt`

#### `x - y: AlgPBWElt, AlgPBWElt -> AlgPBWElt`

#### `x * y: AlgPBWElt, AlgPBWElt -> AlgPBWElt`

#### `c * x: RngElt, AlgPBWElt -> AlgPBWElt`

#### `x * c: AlgPBWElt, RngElt -> AlgPBWElt`

#### `x ^ n: AlgPBWElt, RngIntElt -> AlgPBWElt`

#### `Monomials(u): AlgPBWElt -> SeqEnum`

The sequence of the monomials that occur in the element $u$ of a universal enveloping algebra.

#### `Coefficients(u): AlgPBWElt -> SeqEnum`

The sequence of coefficients of the monomials in the element $u$ of a universal enveloping algebra. The $k$-th element of this sequence corresponds exactly to the $k$-th monomial in the sequence returned by `Monomials(u)`.

#### `Degree(u, i): AlgPBWElt, RngIntElt -> RngIntElt`

Given an element $u$ of a universal enveloping algebra $U$ and an integer $i$, this function returns the degree of $u$ in the $i$-th generator of $U$.

#### `Example: Elt Ops (ex-81e4e4)`

```magma
> L:= LieAlgebra("G2",Rationals());
> U:= IntegralUEA(L);

> c:= U.7*U.2;c;
y_2*[ h_1 ; 1 ] + 3*y_2
> Monomials(c);
[
    y_2*[ h_1 ; 1 ],
    y_2
]
> Coefficients(c);
[ 1, 3 ]
> c:= U.10*U.7*U.2; c;
y_2*[ h_1 ; 1 ]*x_2 + 6*y_2*x_2 + [ h_1 ; 1 ]*[ h_2 ; 1 ] + 3*[ h_2 ; 1 ]
> Degree(c, 2);
1
> Degree(c, 7);
1
> Degree(c, 8);
1

```
