# Constructing Groups of Lie Type

## Split Groups

The following optional parameters are common to most of the intrinsics described in this section:

```magma
Normalising: BoolElt                    Default: true
```

The flag `Normalising` determines whether elements will be automatically converted to Bruhat form. This flag is automatically set to `false` if the group is defined over a nonfield.

```magma
Isogeny: BoolElt                    Default: "Ad"
Signs  : Any                        Default: 1
```

The optional parameters `Isogeny` and `Signs` can take the values described in Section [Constructing Root Data](../RootData/create-root-datum.md#sectrdconstr).

```magma
Method: MonStgElt                    Default: "Default"
```

The method to be used for operations with unipotent elements. See [[Cohen *et al.*, 2008](../../references.md#cite-computunipgrps)] for more details on the algorithms. Possible values are

- `"CollectionToLeft"` uses collection to the left.

- `"CollectionFromLeft"` uses collection from left.

- `"CollectionFromOutside"` uses collection from outside.

- `"Classical"` uses formulas for classical types [[Cohen *et al.*, 2008](../../references.md#cite-computunipgrps)]. This is only available for groups defined over a sparse (classical) root datum.

- `"Collection"` will choose the best of the above methods automatically.

- `"SymbolicToLeft"` uses Hall polynomials, which are computed using collection to the left.

- `"SymbolicFromLeft"` uses Hall polynomials, which are computed using collection from left.

- `"SymbolicFromOutside"` uses Hall polynomials, which are computed using collection from outside.

- `"SymbolicClassical"` uses Hall polynomials, which are computed by formulas. This is only available for groups defined over a sparse (classical) root datum.

- `"Symbolic"` will choose the best symbolic method automatically.

- `"Default"` will choose the best of all above methods automatically.

### `GroupOfLieType(N, k): MonStgElt, Rng -> GrpLie`

```magma
Isogeny    : BoolElt                      Default: "Ad"
Signs      : Any                          Default: 1
Normalising: BoolElt                      Default: true
Method     : MonStgElt                    Default: "Default"
```

Construct the group of Lie type with Cartan name given by the string $N$ (see Section [Finite and Affine Coxeter Groups](../CoxeterSystems/finiteaffine.md#sectcartanfinaff)) over the ring $k$.

### `GroupOfLieType(N, q): MonStgElt, RngIntElt -> GrpLie`

```magma
Isogeny    : BoolElt                      Default: "Ad"
Signs      : Any                          Default: 1
Normalising: BoolElt                      Default: true
Method     : MonStgElt                    Default: "Default"
```

Construct the group of Lie type with Cartan name given by the string $N$ (see Section [Finite and Affine Coxeter Groups](../CoxeterSystems/finiteaffine.md#sectcartanfinaff)) over the finite field of order $q$.

### `GroupOfLieType(W, k): GrpPermCox, Rng -> GrpLie`

### `GroupOfLieType(W, k): GrpMat, Rng -> GrpLie`

```magma
Normalising: BoolElt                      Default: true
Method     : MonStgElt                    Default: "Default"
```

Construct the group of Lie type with Weyl group $W$ over the ring $k$. The group $W$ must be a finite Coxeter group, given either as a permutation group or as a reflection group.

### `GroupOfLieType(W, q): GrpPermCox, RngIntElt -> GrpLie`

### `GroupOfLieType(W, q): GrpMat, RngIntElt -> GrpLie`

```magma
Normalising: BoolElt                      Default: true
Method     : MonStgElt                    Default: "Default"
```

Construct the group of Lie type with Weyl group $W$ over the finite field of order $q$. The group $W$ must be a finite Coxeter group, given either as a permutation group or as a reflection group.

### `GroupOfLieType(R, k): RootDtm, Rng -> GrpLie`

```magma
Normalising: BoolElt                      Default: true
Method     : MonStgElt                    Default: "Default"
```

Construct the group of Lie type with root datum $R$ over the ring $k$.

### `GroupOfLieType(R, q): RootDtm, RngIntElt -> GrpLie`

```magma
Normalising: BoolElt                      Default: true
Method     : MonStgElt                    Default: "Default"
```

Construct the group of Lie type with root datum $R$ over the finite field of order $q$.

### `GroupOfLieType(C, k): Mtrx, Rng -> GrpLie`

### `GroupOfLieType(D, k): GrphDir, Rng -> GrpLie`

```magma
Isogeny    : BoolElt                      Default: "Ad"
Signs      : Any                          Default: 1
Normalising: BoolElt                      Default: true
Method     : MonStgElt                    Default: "Default"
```

Construct the group of Lie type with Cartan matrix $C$ or Dynkin digraph $D$, over the ring $k$.

### `GroupOfLieType(C, q): Mtrx, RngIntElt -> GrpLie`

### `GroupOfLieType(D, q): GrphDir, RngIntElt -> GrpLie`

```magma
Isogeny    : BoolElt                      Default: "Ad"
Signs      : Any                          Default: 1
Normalising: BoolElt                      Default: true
Method     : MonStgElt                    Default: "Default"
```

Construct the group of Lie type with Cartan matrix $C$ or Dynkin digraph $D$, over the finite field of order $q$.

### `SimpleGroupOfLieType(X, n, k): MonStgElt, RngIntElt, Rng -> GrpLie`

```magma
Isogeny    : BoolElt                      Default: "Ad"
Signs      : Any                          Default: 1
Normalising: BoolElt                      Default: true
Method     : MonStgElt                    Default: "Default"
```

Construct the simple group of Lie type with Cartan name $X_n$ over the ring $k$, where the Cartan name is given by the string $X$ and integer $n$ (see also Section [Finite and Affine Coxeter Groups](../CoxeterSystems/finiteaffine.md#sectcartanfinaff)).

### `SimpleGroupOfLieType(X, n, q): MonStgElt, RngIntElt, RngIntElt -> GrpLie`

```magma
Isogeny    : BoolElt                      Default: "Ad"
Signs      : Any                          Default: 1
Normalising: BoolElt                      Default: true
Method     : MonStgElt                    Default: "Default"
```

Construct the simple group of Lie type with name $X_n$ over the finite field of order $q$, where the Cartan name is given by the string $X$ and integer $n$ (see also Section [Finite and Affine Coxeter Groups](../CoxeterSystems/finiteaffine.md#sectcartanfinaff)).

### `GroupOfLieType(L): AlgLie -> GrpLie`

The group of Lie type corresponding to the Lie algebra $L$. The Lie algebra must be the algebraic (i.e., it must correspond to some group), and Magma must be able to determine that it is algebraic.

### `IsNormalising(G): GrpLie -> BoolElt`

Returns the value of the flag `Normalising` of the group of Lie type $G$.

### `Example: Create (ex-108927)`

```magma
> G := GroupOfLieType("E8", 2);
> G;
G: Group of Lie type E8 over Finite field of size 2

```

## Galois Cohomology

If $G$ is a linear algebraic group defined over the field $k$ and $L$ is the algebraic closure of $k$, then the group $\Gamma := {\operatorname{Gal}}(L:k)$ acts on $G$ in the usual way and $G$ becomes a $\Gamma$-group in the sense of the Section [Finite Group Cohomology](../../FiniteGroups/CohomologyAndExtensions/group-cohomology.md#sectgrpcohom) and ${\operatorname{Aut}}(G)$, the group of algebraic automorphisms of $G$ also becomes a $\Gamma$-group.

Now the twisted forms of $G$ are in one-to-one correspondence to the $1$-cocycles of $\Gamma$ on ${\operatorname{Aut}}(G)$ and the forms are conjugate if and only if the cocycles are cohomologous.

For practical purposes it is sufficient to compute the cohomology of ${\operatorname{Gal}}(K:k)$ on ${\operatorname{Aut}}_K(G)$ for some finite Galois field extension of $k$, where ${\operatorname{Aut}}_K(G)$ is the group of $K$-algebraic automorphisms of $G$.

These functions are based on [[Haller, 2005](../../references.md#cite-sh)].

### `GammaGroup(k, G): Fld, GrpLie -> GGrp`

Returns the group of Lie type $G$ as a $\Gamma$-group with $\Gamma={\operatorname{Gal}}(K:k)$, where $K$ is the base field of $G$. The field $k$ must be a subfield of $K$.

### `GammaGroup(k, A): Fld, GrpLieAuto -> GGrp`

Returns the group $A = {\operatorname{Aut}}_K(G)$ of automorphisms of the group of Lie type $G$ as a $\Gamma$-group with $\Gamma={\operatorname{Gal}}(K:k)$, where $K$ is the base field of $G$. The field $k$ must be a subfield of $K$.

### `ActingGroup(G): GrpLie -> Grp, Map`

### `ActingGroup(A): GrpLieAuto -> Grp, Map`

Given the group of Lie type $G$ or the group $A$ of its automorphisms as a $\Gamma$-group, return $\Gamma={\operatorname{Gal}}(K:k)$ together with the map $m$ from the abstract Galois group $\Gamma$ into the set of field automorphisms, such that $m(\gamma)$ is the actual field automorphism for every $\gamma\in\Gamma$.

### `ExtendGaloisCocycle(c): OneCoC -> OneCoC`

```magma
GBAl    : MonStgElt                    Default: "Walk"
Printeqs: BoolElt                      Default: false
```

The analogue to `ExtendCocycle`. Given a cocycle $c$ in $H^1(\Gamma, A/A_0)$, where $A = {\operatorname{Aut}}_K(G)$ and $\Gamma={\operatorname{Gal}}(K:k)$, extend the cocycle to a cocycle in $H^1(\Gamma, A)$. The optional parameter `GBAl` can be used to set the algorithm used for computing the Gröbner bases. The parameter `Printeqs` may be used to print out the polynomials whose Gröbner bases are computed. The current implementation only works for finite fields.

### `GaloisCohomology(A): GGrp -> SeqEnum`

```magma
GBAl     : MonStgElt                    Default: "Walk"
Printeqs : BoolElt                      Default: false
Recompute: BoolElt                      Default: false
```

Computes the Galois cohomology $H^1(\Gamma, {\operatorname{Aut}}_K(G))$, where $A$ is the automorphism group of $G$ as a $\Gamma$-group returned by `GammaGroup` and $\Gamma={\operatorname{Gal}}(K:k)$. The optional parameter `GBAl` can be used to set the algorithm used for computing the Gröbner bases. The parameter `Printeqs` may be used to print out the polynomials whose Gröbner bases are computed. And `Recompute` may be used to recompute the Galois cohomology. The current implementation only works for finite fields.

### `IsInTwistedForm(x, c): GrpLieElt, OneCoC -> BoolElt`

Returns `true` if and only if the element $x$ of a group of Lie type is contained in the twisted form of its parent defined by the cocycle $c$.

### `Example: Gal Cohom (ex-914f01)`

Compute the Galois cohomology of $A_3(5^2)$:

```magma
> q := 5;
> k := GF(q);
> K := GF(q^2);
>
> G := GroupOfLieType( "A3", K : Isogeny:="SC" );
> A := AutomorphismGroup(G);
>
> AGRP := GammaGroup( k, A );
> Gamma,m := ActingGroup(AGRP);
> Gamma;
Symmetric group Gamma acting on a set of cardinality 2
Order = 2
    (1, 2)
> m;
Mapping from: GrpPerm: Gamma to Set of all maps from GF(5^2) to GF(5^2)
given by a rule [no inverse]
> action  := GammaAction(AGRP);
>
> time GaloisCohomology(AGRP);
[
    [
        One-Cocycle
        defined by [
        Automorphism of $: Group of Lie type A3 over Finite field of size 5^2
        given by: Mapping from: $: Group of Lie type  to $: Group of Lie type
        Composition of Mapping from: $: Group of Lie type  to $: Group of
        Lie type  given by a rule and
        Mapping from: $: Group of Lie type  to $: Group of Lie type
        given by a rule
        Decomposition:
          Mapping from: GF(5^2) to GF(5^2)
        Composition of Mapping from: GF(5^2) to GF(5^2) given by a rule and
        Mapping from: GF(5^2) to GF(5^2) given by a rule,
          Id($),
          1
        ]
    ],
    [
        One-Cocycle
        defined by [
        Automorphism of $: Group of Lie type A3 over Finite field of size 5^2
        given by: Mapping from: $: Group of Lie type  to $: Group of Lie type
        Composition of Mapping from: $: Group of Lie type  to $: Group of
        Lie type  given by a rule and
        Mapping from: $: Group of Lie type  to $: Group of Lie type
        given by a rule
        Decomposition:
          Mapping from: GF(5^2) to GF(5^2)
        Composition of Mapping from: GF(5^2) to GF(5^2) given by a rule and
        Mapping from: GF(5^2) to GF(5^2) given by a rule,
          (1, 3),
          1
        ]
    ]
]
Time: 0.470

```

Now create the trivial cocycle:

```magma
> TrivialOneCocycle( AGRP );
One-Cocycle
defined by [
Automorphism of $: Group of Lie type A3 over Finite field of size 5^2
given by: Mapping from: $: Group of Lie type  to $: Group of Lie type
given by a rule
Decomposition:
  Mapping from: GF(5^2) to GF(5^2) given by a rule,
  Id($),
  1
]
>

```

And now the cocycle defining the group ${}^2\!A_3(5)$ and check for two elements if they are contained in ${}^2\!A_3(5)$:

```magma
> c := OneCocycle( AGRP, [GraphAutomorphism(G, Sym(3)!(1,3))] );
>
> x := Random(G);
> IsInTwistedForm( x, c );
false
>
> x := elt< G | <1,y>, <3,y @ m(Gamma.1)> > where y is Random(K);
> IsInTwistedForm( x, c );
true
>

```

## Twisted Groups

The description of the twisted groups of Lie type is based on the extended root data, as described in the Section [Extended Root Data](../RootData/introduction.md#subsectextrd). These functions are mainly based on [[Haller, 2005](../../references.md#cite-sh)].

### `TwistedGroupOfLieType(c): OneCoC -> GrpLie`

Given the cocycle $c$ on the group of automorphisms of a split group of Lie type $G$, return the twisted form of $G$, defined by that cocycle.

### `TwistedGroupOfLieType(R, k, K): RootDtm, Rng, Rng -> GrpLie`

```magma
Normalising: BoolElt                      Default: true
Method     : MonStgElt                    Default: "Default"
```

The twisted group of Lie type defined over the field $k$ with coefficients in the field $K$ corresponding to the twisted root datum $R$.

### `TwistedGroupOfLieType(R, q, r): RootDtm, RngIntElt, RngIntElt -> GrpLie`

```magma
Normalising: BoolElt                      Default: true
Method     : MonStgElt                    Default: "Default"
```

The twisted group of Lie type defined over the finite field of order $q$ with coefficients in the finite field of order $r$ (where $r$ is a power of $q$) corresponding to the twisted root datum $R$.

### `TwistedGroupOfLieType(t, r, q): MonStgElt, RngIntElt, RngIntElt -> GrpLie`

The twisted simply connected group of Lie type $t$ and rank $r$ defined over the finite field of order $q$.

### `Example: Twisted Grp Lie Type1 (ex-a0e6f9)`

The twisted group ${}^3{\rm D}_4(5)$.

```magma
> G := TwistedGroupOfLieType("3D",4,5);
> G;
G: Twisted group of Lie type 3D4,2 over GF(5) with entries over GF(5^3)
> R := RootDatum(G);
> R;
R: Twisted simply connected root datum of dimension 4 of type 3D4,2

```

### `BaseRing(G): GrpLie -> Rng`

### `CoefficientRing(G): GrpLie -> Rng`

The coefficient ring of the (twisted) group of Lie type $G$, that is the base ring of the untwisted overgroup of $G$.

### `DefRing(G): GrpLie -> Rng`

The ring over which the (twisted) group of Lie type $G$ is defined. If $G$ is split, this is the same as the base ring of $G$.

### `UntwistedOvergroup(G): GrpLie -> GrpLie`

The untwisted overgroup, inside which the twisted group of Lie type $G$ was constructed.

### `Example: Twisted Grp Lie Type2 (ex-61dd3f)`

The twisted group ${}^2\!A_3(5)$ as a subgroup of $A_3(5^2)$.

```magma
> R := RootDatum("A3" : Twist := 2);
> G := TwistedGroupOfLieType(R,5,25);
> G;
G: Twisted group of Lie type 2A3,2 over GF(5) with entries over GF(5^2)
> BaseRing(G);
Finite field of size 5^2
> DefRing(G);
Finite field of size 5
> UntwistedOvergroup(G);
Group of Lie type A3 over GF(5^2)

```

### `RelativeRootElement(G, delta, t): GrpLie, RngIntElt, [FldElt] -> GrpLieElt`

The relative root element corresponding to the relative root $\delta$ of the twisted group of Lie type $G$ and the field elements given by the sequence $t$. This is the element $u_\delta(t)$ in [[Haller, 2005](../../references.md#cite-sh), (4.5)].

### `Example: Relative Root Elts (ex-55c70c)`

Here we create the same group as in the previous example, but using a cocycle.

```magma
> q := 5; k := GF(q); K := GF(q^2);
>
> G := GroupOfLieType( "A3", K );
> A := AutomorphismGroup(G);
>
> AGRP := GammaGroup( k, A );
> c := OneCocycle( AGRP, [GraphAutomorphism(G, Sym(3)!(1,3))] );
>
> T := TwistedGroupOfLieType(c);
> T eq TwistedGroupOfLieType(RootDatum("A3":Twist:=2),k,K);
true
> G eq UntwistedOvergroup(T);
true
>
> x := Random(G); x in T;
false
>
> x := RelativeRootElement(T,2,[Random(K)]); x;
x1($.1^22) x3($.1^14)
> x in T;
true

```
