.. _SectGrpLieConstruct:

.. _construction:

Constructing Groups of  Lie Type
================================

.. _SubsectGrpLieSplit:

.. _construction:

Split Groups
------------

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

: BoolElt : ``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.

Isogeny : BoolElt : “Ad"

Signs : Any : 1

The optional parameters ``Isogeny`` and ``Signs`` can take the values described
in Section :ref:`SectRDConstr`.

Method : MonStgElt : “Default"

The method to be used for operations with unipotent elements.
See :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 :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.

.. magma:function:: GroupOfLieType(N, k)
   :input_types: MonStgElt, Rng
   :output_types: GrpLie
   :label: GroupOfLieType_MonStgElt_Rng

Isogeny : BoolElt : “Ad"

Signs : Any : 1

Normalising : BoolElt : ``true``

Method : MonStgElt : “Default"

Construct the group of Lie type with Cartan name given by the string :math:`N`
(see Section :ref:`SectCartanFinAff`) over the ring
:math:`k`.

.. magma:function:: GroupOfLieType(N, q)
   :input_types: MonStgElt, RngIntElt
   :output_types: GrpLie
   :label: GroupOfLieType_MonStgElt_RngIntElt

Isogeny : BoolElt : “Ad"

Signs : Any : 1

Normalising : BoolElt : ``true``

Method : MonStgElt : “Default"

Construct the group of Lie type with Cartan name given by the string :math:`N`
(see Section :ref:`SectCartanFinAff`) over the finite field
of order :math:`q`.

.. magma:function:: GroupOfLieType(W, k)
   :input_types: GrpPermCox, Rng
   :output_types: GrpLie
   :label: GroupOfLieType_GrpPermCox_Rng

.. magma:function:: GroupOfLieType(W, k)
   :input_types: GrpMat, Rng
   :output_types: GrpLie
   :label: GroupOfLieType_GrpMat_Rng

Normalising : BoolElt : ``true``

Method : MonStgElt : “Default"

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

.. magma:function:: GroupOfLieType(W, q)
   :input_types: GrpPermCox, RngIntElt
   :output_types: GrpLie
   :label: GroupOfLieType_GrpPermCox_RngIntElt

.. magma:function:: GroupOfLieType(W, q)
   :input_types: GrpMat, RngIntElt
   :output_types: GrpLie
   :label: GroupOfLieType_GrpMat_RngIntElt

Normalising : BoolElt : ``true``

Method : MonStgElt : “Default"

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

.. magma:function:: GroupOfLieType(R, k)
   :input_types: RootDtm, Rng
   :output_types: GrpLie
   :label: GroupOfLieType_RootDtm_Rng

Normalising : BoolElt : ``true``

Method : MonStgElt : “Default"

Construct the group of Lie type with root datum :math:`R` over the ring
:math:`k`.

.. magma:function:: GroupOfLieType(R, q)
   :input_types: RootDtm, RngIntElt
   :output_types: GrpLie
   :label: GroupOfLieType_RootDtm_RngIntElt

Normalising : BoolElt : ``true``

Method : MonStgElt : “Default"

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

.. magma:function:: GroupOfLieType(C, k)
   :input_types: Mtrx, Rng
   :output_types: GrpLie
   :label: GroupOfLieType_Mtrx_Rng

.. magma:function:: GroupOfLieType(D, k)
   :input_types: GrphDir, Rng
   :output_types: GrpLie
   :label: GroupOfLieType_GrphDir_Rng

Isogeny : BoolElt : “Ad"

Signs : Any : 1

Normalising : BoolElt : ``true``

Method : MonStgElt : “Default"

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

.. magma:function:: GroupOfLieType(C, q)
   :input_types: Mtrx, RngIntElt
   :output_types: GrpLie
   :label: GroupOfLieType_Mtrx_RngIntElt

.. magma:function:: GroupOfLieType(D, q)
   :input_types: GrphDir, RngIntElt
   :output_types: GrpLie
   :label: GroupOfLieType_GrphDir_RngIntElt

Isogeny : BoolElt : “Ad"

Signs : Any : 1

Normalising : BoolElt : ``true``

Method : MonStgElt : “Default"

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

.. magma:function:: SimpleGroupOfLieType(X, n, k)
   :input_types: MonStgElt, RngIntElt, Rng
   :output_types: GrpLie
   :label: SimpleGroupOfLieType_MonStgElt_RngIntElt_Rng

Isogeny : BoolElt : “Ad"

Signs : Any : 1

Normalising : BoolElt : ``true``

Method : MonStgElt : “Default"

Construct the simple group of Lie type with Cartan name :math:`X_n` over the
ring :math:`k`, where the Cartan name is given by the string :math:`X` and
integer :math:`n` (see also Section :ref:`SectCartanFinAff`).

.. magma:function:: SimpleGroupOfLieType(X, n, q)
   :input_types: MonStgElt, RngIntElt, RngIntElt
   :output_types: GrpLie
   :label: SimpleGroupOfLieType_MonStgElt_RngIntElt_RngIntElt

Isogeny : BoolElt : “Ad"

Signs : Any : 1

Normalising : BoolElt : ``true``

Method : MonStgElt : “Default"

Construct the simple group of Lie type with name :math:`X_n` over the finite
field of order :math:`q`, where the Cartan name is given by the string :math:`X`
and integer :math:`n` (see also
Section :ref:`SectCartanFinAff`).

.. magma:function:: GroupOfLieType(L)
   :input_types: AlgLie
   :output_types: GrpLie
   :label: GroupOfLieType_AlgLie

   The group of Lie type corresponding to the Lie algebra :math:`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.

.. magma:function:: IsNormalising(G)
   :input_types: GrpLie
   :output_types: BoolElt
   :label: IsNormalising_GrpLie

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

.. magma:example:: Example: Create
   :label: Create

   .. code-block:: magma

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

.. _SubsectGrpLieGalCohom:

.. _galois-cohomology:

Galois Cohomology
-----------------

If :math:`G` is a linear algebraic group defined over the field :math:`k` and
:math:`L` is the algebraic closure of :math:`k`, then the group
:math:`\Gamma := {\operatorname{Gal}}(L:k)` acts on :math:`G` in the usual way
and :math:`G` becomes a :math:`\Gamma`-group in the sense of the
Section :ref:`SectGrpCohom` and :math:`{\operatorname{Aut}}(G)`,
the group of algebraic automorphisms of :math:`G` also becomes a
:math:`\Gamma`-group.

Now the twisted forms of :math:`G` are in one-to-one correspondence to the
:math:`1`-cocycles of :math:`\Gamma` on :math:`{\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
:math:`{\operatorname{Gal}}(K:k)` on :math:`{\operatorname{Aut}}_K(G)` for some
finite Galois field extension of :math:`k`, where
:math:`{\operatorname{Aut}}_K(G)` is the group of :math:`K`-algebraic
automorphisms of :math:`G`.

These functions are based on :cite:`SH`.

.. magma:function:: GammaGroup(k, G)
   :input_types: Fld, GrpLie
   :output_types: GGrp
   :label: GammaGroup_Fld_GrpLie

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

.. magma:function:: GammaGroup(k, A)
   :input_types: Fld, GrpLieAuto
   :output_types: GGrp
   :label: GammaGroup_Fld_GrpLieAuto

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

.. magma:function:: ActingGroup(G)
   :input_types: GrpLie
   :output_types: Grp, Map
   :label: ActingGroup_GrpLie

.. magma:function:: ActingGroup(A)
   :input_types: GrpLieAuto
   :output_types: Grp, Map
   :label: ActingGroup_GrpLieAuto

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

.. magma:function:: ExtendGaloisCocycle(c)
   :input_types: OneCoC
   :output_types: OneCoC
   :label: ExtendGaloisCocycle_OneCoC

GBAl : MonStgElt : “Walk"

Printeqs : BoolElt : ``false``

The analogue to ``ExtendCocycle``. Given a cocycle :math:`c` in
:math:`H^1(\Gamma, A/A_0)`, where :math:`A = {\operatorname{Aut}}_K(G)` and
:math:`\Gamma={\operatorname{Gal}}(K:k)`, extend the cocycle to a cocycle in
:math:`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.

.. magma:function:: GaloisCohomology(A)
   :input_types: GGrp
   :output_types: SeqEnum
   :label: GaloisCohomology_GGrp

GBAl : MonStgElt : “Walk"

Printeqs : BoolElt : ``false``

Recompute : BoolElt : ``false``

Computes the Galois cohomology :math:`H^1(\Gamma, {\operatorname{Aut}}_K(G))`,
where :math:`A` is the automorphism group of :math:`G` as a :math:`\Gamma`-group
returned by ``GammaGroup`` and :math:`\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.

.. magma:function:: IsInTwistedForm(x, c)
   :input_types: GrpLieElt, OneCoC
   :output_types: BoolElt
   :label: IsInTwistedForm_GrpLieElt_OneCoC

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

.. magma:example:: Example: Gal Cohom
   :label: GalCohom

   Compute the Galois cohomology of :math:`A_3(5^2)`: Now create the trivial
   cocycle: And now the cocycle defining the group :math:`{}^2\!A_3(5)` and check
   for two elements if they are contained in :math:`{}^2\!A_3(5)`:

   .. code-block:: 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
      > 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
      ]
      >
      > c := OneCocycle( AGRP, [GraphAutomorphism(G, Sym(3)!(1,3))] );
      >
      > x := Random(G);
      > IsInTwistedForm( x, c );
      false
      %%a> assert not $1;
      >
      > x := elt< G | <1,y>, <3,y @ m(Gamma.1)> > where y is Random(K);
      > IsInTwistedForm( x, c );
      true
      %%a> assert $1;
      >

.. _SubsectGrpLieTwisted:

.. _twisted-grps-of-lie-type:

Twisted Groups
--------------

The description of the twisted groups of Lie type is based on the extended root
data, as described in the Section :ref:`SubsectExtRD`. These
functions are mainly based on :cite:`SH`.

.. magma:function:: TwistedGroupOfLieType(c)
   :input_types: OneCoC
   :output_types: GrpLie
   :label: TwistedGroupOfLieType_OneCoC

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

.. magma:function:: TwistedGroupOfLieType(R, k, K)
   :input_types: RootDtm, Rng, Rng
   :output_types: GrpLie
   :label: TwistedGroupOfLieType_RootDtm_Rng_Rng

Normalising : BoolElt : ``true``

Method : MonStgElt : “Default"

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

.. magma:function:: TwistedGroupOfLieType(R, q, r)
   :input_types: RootDtm, RngIntElt, RngIntElt
   :output_types: GrpLie
   :label: TwistedGroupOfLieType_RootDtm_RngIntElt_RngIntElt

Normalising : BoolElt : ``true``

Method : MonStgElt : “Default"

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

.. magma:function:: TwistedGroupOfLieType(t, r, q)
   :input_types: MonStgElt, RngIntElt, RngIntElt
   :output_types: GrpLie
   :label: TwistedGroupOfLieType_MonStgElt_RngIntElt_RngIntElt

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

.. magma:example:: Example: Twisted Grp Lie Type1
   :label: TwistedGrpLieType1

   The twisted group :math:`{}^3{\rm D}_4(5)`.

   .. code-block:: 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

.. magma:function:: BaseRing(G)
   :input_types: GrpLie
   :output_types: Rng
   :label: BaseRing_GrpLie

.. magma:function:: CoefficientRing(G)
   :input_types: GrpLie
   :output_types: Rng
   :label: CoefficientRing_GrpLie

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

.. magma:function:: DefRing(G)
   :input_types: GrpLie
   :output_types: Rng
   :label: DefRing_GrpLie

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

.. magma:function:: UntwistedOvergroup(G)
   :input_types: GrpLie
   :output_types: GrpLie
   :label: UntwistedOvergroup_GrpLie

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

.. magma:example:: Example: Twisted Grp Lie Type2
   :label: TwistedGrpLieType2

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

   .. code-block:: 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)

.. magma:function:: RelativeRootElement(G,delta,t)
   :input_types: GrpLie, RngIntElt, [FldElt]
   :output_types: GrpLieElt
   :label: RelativeRootElement_GrpLie_RngIntElt_FldElt

   The relative root element corresponding to the relative root :math:`\delta` of
   the twisted group of Lie type :math:`G` and the field elements given by the
   sequence :math:`t`. This is the element :math:`u_\delta(t)` in
   :raw-latex:`\cite[(4.5)]{SH}`.

.. magma:example:: Example: Relative Root Elts
   :label: RelativeRootElts

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

   .. code-block:: 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
      %%a> assert $1;
      > G eq UntwistedOvergroup(T);
      true
      %%a> assert $1;
      >
      > x := Random(G); x in T;
      false
      >
      > x := RelativeRootElement(T,2,[Random(K)]); x;
      x1($.1^22) x3($.1^14)
      > x in T;
      true
      %%a> assert $1;
