# Operations on Lie Algebras

## `L eq K: AlgLie, AlgLie -> BoolElt`

## `L eq K: AlgMatLie, AlgMatLie -> BoolElt`

Returns `true` if, and only if, the Lie algebras $L$ and $K$ are equal.

## `L ne K: AlgLie, AlgLie -> BoolElt`

## `L ne K: AlgMatLie, AlgMatLie -> BoolElt`

Returns `true` if, and only if, the Lie algebras $L$ and $K$ are not equal.

## `L subset K: AlgLie, AlgLie -> BoolElt`

## `L subset K: AlgMatLie, AlgMatLie -> BoolElt`

Returns `true` if, and only if, the Lie algebra $L$ is contained in the Lie algebra $K$.

## `L notsubset K: AlgLie, AlgLie -> BoolElt`

Returns `true` if, and only if, the Lie algebra $L$ is not contained in the Lie algebra $K$.

## `L meet M: AlgLie, AlgLie -> AlgLie`

## `L meet M: AlgMatLie, AlgMatLie -> AlgMatLie`

The intersection of the Lie algebras $L$ and $M$ is returned. Note that $L$ and $M$ have a common superalgebra.

## `L * M: AlgLie, AlgLie -> AlgLie`

## `L * M: AlgMatLie, AlgMatLie -> AlgMatLie`

The Lie algebra product $[L,M]$ of the algebras $L$ and $M$ is returned. Note that $L$ and $M$ must have a common superalgebra.

## `L ^ n: AlgLie, RngIntElt -> AlgLie`

The (left-normed) $n$-th power of the (structure constant) Lie algebra $L$, i.e., $((\ldots (L*L)* \ldots)*L)$ is constructed.

## `Morphism(L, M): AlgLie, AlgLie -> Map`

The map giving the morphism from the (structure constant) Lie algebra $L$ to $M$ is constructed. Either $L$ is a subalgebra of $M$, in which case the embedding of $L$ into $M$ is returned, or $M$ is a quotient algebra of $L$, in which case the natural epimorphism from $L$ onto $M$ is returned.

## `IsIsomorphic(L, M): AlgLie, AlgLie -> BoolElt, .`

```magma
HL: AlgLie                    Default: false
HM: AlgLie                    Default: false
```

Returns `true` if the Lie algebras $L$ and $M$ are isomorphic. It is currently implemented for trivial cases (such as when the dimensions differ), reductive Lie algebras, solvable Lie algebras up to dimension $4$, nilpotent Lie algebras up to dimension $6$ (some special cases excluded). The solvable and nilpotent cases are handled using the databases for such algebras described in Section [Solvable and Nilpotent Lie Algebras Classification](solvable-nilpotent.md#sectslac)).

In the case of reductive Lie algebras, split maximal toral subalgebras for $L$ and $M$ may be provided in the optional arguments $HL$ and $HM$, respectively. If these are not provided an attempt is made to compute them, a process which may fail, particularly in characteristic $0$.

This intrinsic has two return values: the first a boolean describing whether $L$ and $M$ are isomorphic. If so, the second is an isomorphism from $L$ to $M$, otherwise the second is a string describing the reason for non-isomorphism.

An error is thrown if isomorphism cannot be determined.

## `IsKnownIsomorphic(L, M): AlgLie, AlgLie -> BoolElt, BoolElt, .`

```magma
HL: AlgLie                    Default: false
HM: AlgLie                    Default: false
```

Returns `true` if Magma can determine isomorphism between Lie algebras $L$ and $M$. If so, the second return value is whether $L$ and $M$ are isomorphic, and the third is an isomorphism or a string (describing the reason for non-isomorphism). Refer to [`IsIsomorphic`](#function-isisomorphiclie) for more details on applicability and the meanings of the return values.

## `IsIsomorphism(m): Map[AlgLie, AlgLie] -> BoolElt`

Returns `true` if the mapping $m$ between two Lie algebras is an isomorphism of Lie algebras.

## `Example: Isomorphic (ex-4fbecb)`

We demonstrate that B$_2$ and C$_2$ are isomorphic over ${\mathbb{Q}}$.

```magma
> k := Rationals();
> L := LieAlgebra("B2", k); M := LieAlgebra("C2", k);
> b, c := IsIsomorphic(L, M);
> b;
true
> IsIsomorphism(c);
true
> c(L.1);
(0 0 1 0 0 0 0 0 0 0)

```

We demonstrate that B$_3$ and C$_3$ are non-isomorphic over ${\mathbb{Q}}$.

```magma
> L := LieAlgebra("B3", k); M := LieAlgebra("C3", k);
> b, c := IsIsomorphic(L, M);
> b;
false
> c;
21-dim component of L1 of type R1: Adjoint root datum of dimension 3 of type B3
didn't match R2:
Adjoint root datum of dimension 3 of type C3

```

We demonstrate that two distinct isogenies of B$_2$ are isomorphic over ${\mathbb{Q}}$.

```magma
> L := LieAlgebra("B2", k : Isogeny := "Ad");
> M := LieAlgebra("B2", k : Isogeny := "SC");
> b, c := IsIsomorphic(L, M);
> b;
true

```

For larger nilpotent algebras Magma cannot decide on the isomorphism question.

```magma
> L := LieAlgebra("B4", k);
> pL, _, _ := StandardBasis(L);
> subL := sub<L | pL>;
> subL;
Lie Algebra of dimension 16 with base ring Rational Field
> M := LieAlgebra("C4", k);
> pM, _, _ := StandardBasis(M);
> subM := sub<M | pM>;
> subL;
Lie Algebra of dimension 16 with base ring Rational Field
> IsNilpotent(subL), IsNilpotent(subM);
true true
> a,b,c := IsKnownIsomorphic(subL, subM);
> a;
false

```

## `Example: Isomorphic G2 (ex-3b3b3e)`

We demonstrate that in characteristic $3$ the Lie algebras of type G$_2$ and A$_2$ have isomorphic nontrivial ideals.

```magma
> k := GF(3);
> CSL := CompositionSeries(LieAlgebra("G2", k));
> CSL;
[
    Lie Algebra of dimension 7 with base ring GF(3),
    Lie Algebra of dimension 14 with base ring GF(3)
]
> L := CSL[1];
> CSM := CompositionSeries(LieAlgebra("A2", k));
> CSM;
[
    Lie Algebra of dimension 7 with base ring GF(3),
    Lie Algebra of dimension 8 with base ring GF(3)
]
> M := CSM[1];
> a,b,c := IsKnownIsomorphic(L, M);
> a;
true
> b, c;
true Mapping from: AlgLie: L to AlgLie: M given by a rule
> IsIsomorphism(c);
true

```

## Basic Invariants

### `CoefficientRing(L): AlgLie -> Rng`

### `CoefficientRing(L): AlgMatLie -> Rng`

### `BaseRing(L): AlgLie -> Rng`

### `BaseRing(L): AlgMatLie -> Rng`

The coefficient ring (or base ring) over which the Lie algebra $L$ is defined.

### `Dimension(L): AlgLie -> RngIntElt`

### `Dimension(L): AlgMatLie -> RngIntElt`

The dimension of the Lie algebra $L$.

### `# L: AlgLie -> RngIntElt`

### `# L: AlgMatLie -> RngIntElt`

The cardinality of the Lie algebra $L$, if the coefficient ring is finite.

### `Moduli(L): AlgLie -> SeqEnum`

This returns a sequence of integers, of length equal to the dimension of $L$. If the $i$-th element of this sequence is $a_i$ then $a_i$ is the minimal non-negative integer such that $a_ie_i = 0$. So if $L$ is defined over a field, then the sequence consists of zeros.

### `Example: Moduli Of Lie Algebra (ex-29430b)`

```magma
> T:= [ <1,2,2,2>, <2,1,2,2> ];
> t:= [0,4];
> L:= LieAlgebra< t | T : Rep:= "Dense" >;
> Moduli(L);
[ 0, 4 ]

```

## Changing Base Rings

### `ChangeRing(L, S): AlgLie, Rng -> AlgLie, Map`

### `ChangeRing(L, S): AlgMatLie, Rng -> AlgMatLie, Map`

Given a Lie algebra $L$ with base ring $R$, together with a ring $S$, this function constructs the Lie algebra $M$ with base ring $S$ obtained by coercing the coefficients of elements of $L$ into $S$. The homomorphism from $L$ to $M$ is produced as second return value.

### `ChangeRing(L, S, f): AlgLie, Rng, Map -> AlgLie, Map`

### `ChangeRing(L, S, f): AlgMatLie, Rng, Map -> AlgMatLie, Map`

Given a Lie algebra $L$ with base ring $R$, together with a ring $S$ and a map $f: R \rightarrow S$, this function constructs the Lie algebra $M$ with base ring $S$ obtained by mapping the coefficients of elements of $L$ into $S$ via $f$. The homomorphism from $L$ to $M$ is produced as the second return value.

## Bases

### `BasisElement(A, i): AlgLie, RngIntElt -> AlgLieElt`

### `BasisElement(A, i): AlgMatLie, RngIntElt -> AlgMatLieElt`

### `A . i: AlgLie, RngIntElt -> AlgLieElt`

### `A . i: AlgMatLie, RngIntElt -> AlgMatLieElt`

The $i$-th basis element of the algebra $L$.

### `Basis(A): AlgLie -> [ AlgLieElt ]`

### `Basis(A): AlgMatLie -> [ AlgMatLieElt ]`

The basis of the algebra $L$, as a sequence of elements of $L$.

### `IsIndependent(Q): [ AlgLieElt ] -> BoolElt`

### `IsIndependent(Q): [ AlgMatLieElt ] -> BoolElt`

### `IsIndependent(Q): { AlgLieElt } -> BoolElt`

### `IsIndependent(Q): { AlgMatLieElt } -> BoolElt`

Given a set or sequence $Q$ of elements of the $R$-algebra $L$, this functions returns `true` if these elements are linearly independent over $R$; otherwise `false`.

### `ExtendBasis(S, L): AlgLie, AlgLie -> [ AlgElt ]`

### `ExtendBasis(S, L): AlgMatLie, AlgMatLie -> [ AlgElt ]`

### `ExtendBasis(Q, L): [ AlgLieElt ], AlgLie -> [ AlgElt ]`

### `ExtendBasis(Q, L): [ AlgMatLie ], AlgMatLie -> [ AlgElt ]`

Given an algebra $L$ and either a subalgebra $S$ of dimension $m$ of $L$ or a sequence $Q$ of $m$ linearly independent elements of $L$, this function returns a sequence containing a basis of $L$ such that the first $m$ elements are the basis of $S$ resp. the elements in $Q$.

## Operations for Semisimple and Reductive Lie Algebras

### `SemisimpleType(L): AlgLie -> MonStgElt`

### `SemisimpleType(L): AlgMatLie -> MonStgElt`

### `CartanName(L): AlgLie -> MonStgElt`

### `CartanName(L): AlgMatLie -> MonStgElt`

Let $L$ be a Lie algebra. If $L$ has a nondegenerate Killing form, then (over some algebraic extension of the ground field) $L$ is the direct sum of absolutely simple Lie algebras. These Lie algebras have been classified and the classes are named $A_n$, $B_n$, $C_n$, $D_n$, $E_6$, $E_7$, $E_8$, $F_4$ and $G_2$. This function returns a single string containing the types of the direct summands of $L$.

For a description of the algorithm used in the general case we refer to [[de Graaf, 2000](../../references.md#cite-wdg-lie-alg)], §5.17.1. For Lie algebras over fields of characteristic $2$ and $3$ the algorithm used is described in [[Roozemond, 2010](../../references.md#cite-roozemond2010)], Chapter 5.

### `Example: Semisimple Type (ex-6372db)`

We compute the semisimple type of the Levi subalgebra of a subalgebra of the simple Lie algebra of type $D_7$.

```magma
> L := LieAlgebra("D7", RationalField());
> L;
Lie Algebra of dimension 91 with base ring Rational Field
> K := Centralizer(L, sub<L | [L.1,L.2,L.3,L.4]>);
> K;
Lie Algebra of dimension 41 with base ring Rational Field
> _,S := HasLeviSubalgebra(K);
> S;
Lie Algebra of dimension 6 with base ring Rational Field
> SemisimpleType(S);
A1 A1

```

### `ReductiveType(L): AlgLie -> RootDtm, MonStgElt, SeqEnum, SeqEnum`

### `ReductiveType(L, H): AlgLie, AlgLie -> RootDtm, MonStgElt, SeqEnum, SeqEnum`

```magma
AssumeAlmostSimple: BoolElt                    Default: false
```

Let $L$ be a Lie algebra of a reductive algebraic group, and $H$ a split maximal toral subalgebra of $L$. This function identifies the isomorphism type of $L$.

This function has four return values. The first is the appropriate root datum and the second return value a textual description of $L$. The third return value is a sequence $Q$, containing a decomposition of $L$ into direct summands. Finally, the fourth return value is a sequence $P$ of records, such that $P[i]$ contains additional information (often a proof of correctness) of the identification of $Q[i]$.

If a split maximal toral subalgebra $H$ is not given, an attempt is made to compute one by calling [`SplitMaximalToralSubalgebra`](sub.md#function-splitmaximaltoralsubalgebra) if the characteristic of the base field $k$ is at least $5$, or [`SplitToralSubalgebra`](sub.md#function-splittoralsubalgebra) if char($k$) is $2$ or $3$. Note that, if $k$ is infinite, such a subalgebra cannot in general be computed so the second parameter $H$ must be supplied for this function to work.

If the optional parameter `AssumeAlmostSimple` is set to true, the (possibly time consuming) step of computing a direct sum decomposition of $L$ is skipped.

Moreover, note that if $L$ is the Lie algebra of a simple algebraic group but itself non-simple (such as for example A$_n$ of intermediate type in characteristic $n+1$), the third return value $Q$ may not be the direct sum decomposition of $L$ but simply [$L$].

### `Example: Reductive Type (ex-c3afbb)`

We consider a particular Lie algebra of type A$_3$ over $k =$GF$(2)$.

```magma
> RA3 := RootDatum("A3" : Isogeny := 2);
> L := LieAlgebra(RA3, GF(2));
> D := DirectSumDecomposition(L);
> D;
[
    Lie Algebra of dimension 14 with base ring GF(2),
    Lie Algebra of dimension 1 with base ring GF(2)
]
> R, str, Q, _ := ReductiveType(L);
> R;
RA3: Root datum of dimension 3 of type A3
> str;
Lie algebra of type A3[ 2]
> Q;
[
    Lie Algebra of dimension 15 with base ring GF(2)
]

```

Note that this is an example where $Q$ is not the direct sum decomposition of $L$. Instead, $L$ in its whole is recognised as the Lie algebra of a simple algebraic group. In the remainder of the example, we investigate the 14-dimensional ideal of $L$.

```magma
> M := D[1]; M;
Lie Algebra of dimension 14 with base ring GF(2)
> R, _, _, P := ReductiveType(M);
> R;
R: Adjoint root datum of dimension 2 of type G2

```

So this computation claims that $L \simeq M \oplus k$, where $M$ is of type G$_2$. Let us use the additional return values to verify that fact.

```magma
> pos  := P[1]`ChevBasData`BasisPos;
> neg  := P[1]`ChevBasData`BasisNeg;
> cart := P[1]`ChevBasData`BasisCart;
> IsChevalleyBasis(M, RootDatum("G2"), pos, neg, cart);
true [ <1, 2, 0>, <1, 3, 0>, <1, 4, 0>, <2, 5, 0> ]

```

This demonstrates the fact that the Lie algebra of type G$_2$ is a constituent of the Lie algebra of type A$_3$ over fields of characteristic 2.

### `RootSystem(L): AlgLie -> [ ModTupRngElt ], [ AlgLieElt ], [ ModTupRngElt ], AlgMatElt`

### `RootSystem(L): AlgMatLie -> [ ModTupRngElt ], [ AlgMatLieElt ], [ ModTupRngElt ], AlgMatElt`

Given a semisimple Lie algebra $L$ with a split Cartan subalgebra, this function computes the root system of $L$. This function returns four values:

**(a)**
The roots of $L$ with respect to the Cartan subalgebra which is output by `CartanSubalgebra(L)`. This is a sequence of vectors where the positive roots come first, followed by the negative roots.

**(b)**
A sequence of elements of $L$ which are the root vectors corresponding to the roots of $L$ (so the first element corresponds to the first root and so on).

**(c)**
A sequence of simple roots.

**(d)**
The Cartan matrix of the root system with respect to the sequence of simple roots.

### `Example: Root System (ex-cfabbc)`

We compute the root system of the simple Lie algebra of type $G_2$ over the rational field.

```magma
> L := LieAlgebra("G2", RationalField());
> R, Rv, fund, C:=RootSystem(L);
> R;
[
    (1 0),
    (0 1),
    (1 1),
    (2 1),
    (3 1),
    (3 2),
    (-1  0),
    ( 0 -1),
    (-1 -1),
    (-2 -1),
    (-3 -1),
    (-3 -2)
]
> Rv;
[ (0 0 0 0 0 0 0 0 1 0 0 0 0 0), (0 0 0 0 0 0 0 0 0 1 0 0 0 0),
(0 0 0 0 0 0 0 0 0 0 1 0 0 0), (0 0 0 0 0 0 0 0 0 0 0 1 0 0),
(0 0 0 0 0 0 0 0 0 0 0 0 1 0), (0 0 0 0 0 0 0 0 0 0 0 0 0 1),
(0 0 0 0 0 1 0 0 0 0 0 0 0 0), (0 0 0 0 1 0 0 0 0 0 0 0 0 0),
(0 0 0 1 0 0 0 0 0 0 0 0 0 0), (0 0 1 0 0 0 0 0 0 0 0 0 0 0),
(0 1 0 0 0 0 0 0 0 0 0 0 0 0), (1 0 0 0 0 0 0 0 0 0 0 0 0 0) ]

```

### `RootDatum(L): AlgLie -> RootDtm`

### `RootDatum(L): AlgMatLie -> RootDtm`

Here $L$ is a semisimple Lie algebra. This function returns the root datum $D$ of $L$ with respect to the Cartan subalgebra which is output by `CartanSubalgebra(L)`. We note that the order of the positive roots in $D$ is not necessarily the same as the order in which they appear in the root system of $L$.

### `Example: Root Datum (ex-afa536)`

We set up the root datum of a Lie algebra, and extract the Cartan matrix.

```magma
> L:= LieAlgebra("F4", Rationals());
> rd := RootDatum(L);
> rd;
Root datum of type F4
> CartanMatrix(rd);
[ 2  0 -1  0]
[ 0  2  0 -1]
[-1  0  2 -1]
[ 0 -1 -2  2]

```

### `ChevalleyBasis(L): AlgLie -> [ AlgLieElt ], [ AlgLieElt ], [ AlgLieElt ]`

### `ChevalleyBasis(L, H): AlgLie, AlgLie -> [ AlgLieElt ], [ AlgLieElt ], [ AlgLieElt ]`

### `ChevalleyBasis(L): AlgMatLie -> [ AlgMatLieElt ], [ AlgMatLieElt ], [ AlgMatLieElt ]`

```magma
AssumeAlmostSimple: BoolElt                    Default: false
```

Given a semisimple Lie algebra $L$ with a split maximal toral subalgebra $H$, this function returns three sequences, $x$, $y$ and $h$ of elements of $L$. They form a Chevalley basis of $L$. The first sequence gives basis elements corresponding to positive roots, the second to the negative roots and the third to basis elements in a Cartan subalgebra. If a split maximal toral subalgebra $H$ is not given, an attempt is made to compute one.

For Lie algebras over fields of characteristic $2$ and $3$ the algorithm used is described in [[Cohen and Roozemond, August 2009](../../references.md#cite-cohenroozemond2009)]. In particular, this involves computing a direct sum decomposition of $L$, which can be quite time consuming. If there is reason to believe that $L$ is (almost) simple, the optional parameter `AssumeAlmostSimple` should be set to `true`.

### `Example: Chevalley Basis (ex-fc1498)`

We construct a Chevalley basis for two Lie algebras.

```magma
> L := LieAlgebra("A2", RationalField());
> x, y, h:= ChevalleyBasis(L);
> x; y; h;
[ (0 0 0 0 0 1 0 0), (0 0 0 0 0 0 1 0), (0 0 0 0 0 0 0 1) ]
[ (0 0 1 0 0 0 0 0), (0 1 0 0 0 0 0 0), (1 0 0 0 0 0 0 0) ]
[ (0 0 0 1 0 0 0 0), (0 0 0 0 1 0 0 0) ]
> L := LieAlgebra("A3", Rationals());
> print RootDatum(L) : Maximal;
Root datum of type A3 with simple roots
[ 1  0  1]
[ 1 -2  1]
[ 0  1 -2]
and simple coroots
[ 1  1  1]
[ 0 -1  0]
[ 0  0 -1]

```

### `ChevalleyBasis(L, H, R): AlgLie, AlgLie, RootDtm -> [ AlgLieElt ], [ AlgLieElt ], [ AlgLieElt ]`

Given a semisimple Lie algebra $L$ with a split maximal toral subalgebra $H$, and an irreducible root datum $R$, this function computes a Chevalley basis of $L$ with respect to $H$ and $R$. This basis is returned in the form of three sequences, $x$, $y$ and $h$ of elements of $L$, where the first sequence gives basis elements corresponding to positive roots, the second to the negative roots and the third to basis elements in the toral subalgebra $H$.

### `IsChevalleyBasis(L, R, x, y, h): AlgLie, RootDtm, [ AlgLieElt ], [ AlgLieElt ], [ AlgLieElt ] -> BoolElt, [ Tup ]`

Returns `true` if $x$, $y$ and $h$ form a Chevalley basis of the Lie algebra $L$ with respect to the root datum $R$. If so, return a sequence describing the extraspecial signs as second return value.

### `Example: Chevalley Basis Small Char (ex-f1d947)`

We compute a Chevalley basis for a Lie algebra of type E$_6$ inside one of type E$_7$.

```magma
> R := RootDatum("E7");
> L1 := LieAlgebra(R, GF(2));
> p1,n1,c1 := StandardBasis(L1);
> L1;
Lie Algebra of dimension 133 with base ring GF(2)
> DynkinDiagram(R);

E7    1 - 3 - 4 - 5 - 6 - 7
              |
              2
> S, proj := sub<R | [1..6]>;
> S;
S: Root datum of dimension 7 of type E6
> #proj;
72
> projpos := [i : i in proj | i le NumPosRoots(R)];
> #projpos;
36
> L2 := sub<L1 | p1[projpos], n1[projpos]>;
> L2;
Lie Algebra of dimension 78 with base ring GF(2)
> H2 := L2 meet SplitMaximalToralSubalgebra(L1);
> H2;
Lie Algebra of dimension 6 with base ring GF(2)
> p2,n2,c2 := ChevalleyBasis(L2, H2, RootDatum("E6"));
> ok := IsChevalleyBasis(L2, RootDatum("E6"), p2, n2, c2);
> ok;
true

```

### `TwistedBasis(L, H, R): AlgLie, AlgLie, RootDtm -> AlgLie, AlgLie, Rec, AlgMatElt`

For a Lie algebra $L$, a split toral subalgebra $H$ of $L$, and a twisted root datum $R$, the function constructs a “twisted basis” of $L$.

Let $k$ be the coefficient ring of $L$ and $K$ an extension field of $k$ of degree equal to the twisting degree of $R$. This function has $4$ return values. First, $L' = L \otimes K$; second, a homomorphism $\phi$ from $L$ to $L'$, third, a record containing a Chevalley basis of $L'$ with respect to the untwisted root datum of $R$; fourth, a matrix describing the action of the Frobenius automorphism of $K$ on the positive roots of the Chevalley basis of $L'$.

Such a basis constitutes a proof that $L'$ is of type $R$. Consult [[Roozemond, 2010](../../references.md#cite-roozemond2010)], Chapter 5.3, for more details on such twisted bases.

### `Example: Twisted Basis (ex-cf55bc)`

We investigate a twisted basis of the Lie algebra of type ${}^2$A$_2$ over the field with $5$ elements. Let $\delta$ be the automorphism of the root system of type A$_2$, let $k =$GF($5$), and let $K =$GF($5^2$).

```magma
> R := TwistedRootDatum(RootDatum("A2") : Twist := 2);
> L := TwistedLieAlgebra(R, GF(5));
> H := SplitToralSubalgebra(L);
> LK, phi, ChevBas, m := TwistedBasis(L, H, R);
> m;
[     0      1]
[     1      0]

```

This matrix `m` shows that $\delta$ acts as expected on the Chevalley basis elements of `LK` $= L \otimes K$. We verify the correctness of `m`.

```magma
> K := CoefficientRing(LK);
> simp := ChevBas`BasisPos[[1..Rank(R)]];
> simp;
[ (     0      0      0      0      0      1  ksi^8      0),
  (     0      0      0      0      0      1 ksi^16      0) ]
> fr := FrobeniusMap(K);
> frv := func<x | Vector([ fr(i) : i in Eltseq(x)])>;
> [ Position(simp, frv(x)) : x in simp ];
[ 2, 1 ]

```

So indeed the Frobenius map (acting on the coordinates of LK) acts as $\delta$. This is equivalent [[Roozemond, 2010](../../references.md#cite-roozemond2010), Lemma 5.3] to the basis elements of L being stable under the composition of the Frobenius map (this time acting on the Chevalley basis of $L \otimes K$) and the root system automorphism $\delta$. We verify this assertion explicitly for this example.

```magma
> p := ChevBas`BasisPos;
> n := ChevBas`BasisNeg;
> c := ChevBas`BasisCart;
> pi := Sym(6)!(1, 2)(4, 5);
> ChevBasLK := VectorSpaceWithBasis([ Vector(x) : x in p cat n cat c]);
> piL := DiagramAutomorphism(LK, pi);

```

Now $\delta$ acts on $L \otimes K$ as `T`, and `fr` is still the Frobenius automorphism of the field $K$. The images of the basis elements of $L$ under `delta` composed with `fr` are as follows:

```magma
> for i in [1..Dimension(L)] do
>    b := phi(L.i);
>    printf "i = %o, b =    %o\n", i, Coordinates(ChevBasLK, Vector(b));
>    printf "   pi(b)^fr = %o\n", [ fr(i) : i in
>                              Coordinates(ChevBasLK, Vector(piL(b))) ];
> end for;
i = 1, b =    [ 0, 0, 0, 0, 0, ksi^9, 0, 0 ]
   (b*T)^fr = [ 0, 0, 0, 0, 0, ksi^9, 0, 0 ]
i = 2, b =    [ 0, 0, 0, ksi^5, ksi, 0, 0, 0 ]
   (b*T)^fr = [ 0, 0, 0, ksi^5, ksi, 0, 0, 0 ]
i = 3, b =    [ 0, 0, 0, ksi^9, ksi^21, 0, 0, 0 ]
   (b*T)^fr = [ 0, 0, 0, ksi^9, ksi^21, 0, 0, 0 ]
i = 4, b =    [ 0, 0, 0, 0, 0, 0, ksi^5, ksi ]
   (b*T)^fr = [ 0, 0, 0, 0, 0, 0, ksi^5, ksi ]
i = 5, b =    [ 0, 0, 0, 0, 0, 0, ksi, ksi^5 ]
   (b*T)^fr = [ 0, 0, 0, 0, 0, 0, ksi, ksi^5 ]
i = 6, b =    [ ksi, ksi^5, 0, 0, 0, 0, 0, 0 ]
   (b*T)^fr = [ ksi, ksi^5, 0, 0, 0, 0, 0, 0 ]
i = 7, b =    [ ksi^21, ksi^9, 0, 0, 0, 0, 0, 0 ]
   (b*T)^fr = [ ksi^21, ksi^9, 0, 0, 0, 0, 0, 0 ]
i = 8, b =    [ 0, 0, ksi^9, 0, 0, 0, 0, 0 ]
   (b*T)^fr = [ 0, 0, ksi^9, 0, 0, 0, 0, 0 ]

```

Thus, all the basis elements of $L$ are stable under the composition of the diagram automorphism $\delta$ and the Frobenius automorphism.

The `WeylGroup` functions are only available for structure constant Lie algebras.

### `WeylGroup(L): AlgLie -> GrpPermCox`

### `WeylGroup(GrpPermCox, L): Cat, AlgLie -> GrpPermCox`

The Weyl group of the reductive Lie algebra $L$, as a permutation Coxeter group (see Chapter ChapGrpPermCox).

### `WeylGroup(GrpFPCox, L): Cat, AlgLie -> GrpPermCox`

The Weyl group of the reductive Lie algebra $L$, as a Coxeter group (see Chapter ChapGrpFPCox).

### `WeylGroup(GrpMat, L): Cat, AlgLie -> GrpPermCox`

The Weyl group of the reductive Lie algebra $L$, as a reflection group (see Chapter ChapGrpFPCox).
