.. _SectRDSub:

.. _create-new-root-datum:

Building Root Data
==================

.. magma:constructor:: sub<R | a>
   :input_types: RootDtm, SetEnum
   :output_types: RootDtm

The root subdatum of the root datum :math:`R` generated by the roots
:math:`\alpha_{a_1},\dots,\alpha_{a_k}` where :math:`a=\{a_1,\dots,a_k\}` is a
set of integers.

.. magma:constructor:: sub<R | s>
   :input_types: RootDtm, SetEnum
   :output_types: RootDtm

The root subdatum of the root datum :math:`R` generated by the roots
:math:`\alpha_{s_1},\dots,\alpha_{s_k}` where :math:`s=[s_1,\dots,s_k]` is a
*sequence* of integers. In this version the roots must be simple in the root
subdatum (i.e. none of them may be a summand of another) otherwise an error is
signalled. The simple roots will appear in the subdatum in the given order.

.. magma:example:: Example: Root Subdata
   :label: RootSubdata

   .. code-block:: magma

      > R := RootDatum("A4");
      > PositiveRoots(R);
      {@
          (1 0 0 0),
          (0 1 0 0),
          (0 0 1 0),
          (0 0 0 1),
          (1 1 0 0),
          (0 1 1 0),
          (0 0 1 1),
          (1 1 1 0),
          (0 1 1 1),
          (1 1 1 1)
      @}
      > s := sub< R | [6,1,4] >;
      > s;
      Root datum of type A3
      > PositiveRoots(s);
      {@
          (0 1 1 0),
          (1 0 0 0),
          (0 0 0 1),
          (1 1 1 0),
          (0 1 1 1),
          (1 1 1 1)
      @}
      \<s := sub< R | [1,5] >;
      Error: The given roots are not simple in a subdatum
      > s := sub< R | {1,5} >;
      > s;
      Root datum of type A2
      > PositiveRoots(s);
      {@
          (1 0 0 0),
          (0 1 0 0),
          (1 1 0 0)
      @}

.. magma:operation:: R1 subset R2
   :input_types: RootDtm, RootDtm
   :output_types: BoolElt, .
   :label: op_subset_RootDtm_RootDtm

   Returns ``true`` if and only if the root datum :math:`R_1` is a subset of the
   root datum :math:`R_2`. If true, returns an injection as sequence of roots as
   second return value.

.. magma:operation:: R1 + R2
   :input_types: RootDtm, RootDtm
   :output_types: RootDtm
   :label: op_plus_RootDtm_RootDtm

.. magma:function:: DirectSum(R1, R2)
   :input_types: RootDtm, RootDtm
   :output_types: RootDtm
   :label: DirectSum_RootDtm_RootDtm

   The external direct sum of the root data :math:`R_1` and :math:`R_2`. The full
   (co)root space of the result is the direct sum of the full (co)root spaces of
   :math:`R_1` and :math:`R_2`.

.. magma:operation:: R1 join R2
   :input_types: RootDtm, RootDtm
   :output_types: RootDtm
   :label: op_join_RootDtm_RootDtm

   The internal direct sum of the root data :math:`R_1` and :math:`R_2`. The root
   data must have the same full (co)root space, which will also be the full
   (co)root space of the result. The root data must have disjoint (co)root spaces.

.. magma:example:: Example: Root Dtm Sums
   :label: RootDtmSums

   .. code-block:: magma

      > R  := RootDatum("A1A1");
      > R1 := sub<R|[1]>;
      > R2 := sub<R|[2]>;
      > R1 + R2;
      Root datum of dimension 4 of type A1 A1
      > R1 join R2;
      R: Adjoint root datum of dimension 2 of type A1 A1

.. magma:function:: DirectSumDecomposition(R)
   :input_types: RootDtm
   :output_types: [], RootDtm, Map
   :label: DirectSumDecomposition_RootDtm

.. magma:function:: IndecomposableSummands(R)
   :input_types: RootDtm
   :output_types: [], RootDtm, Map
   :label: IndecomposableSummands_RootDtm

   Returns a sequence :math:`Q` of irreducible root data, a root datum :math:`S`
   which is the direct sum of the terms of :math:`Q`, and an isogeny map
   :math:`\phi:S\to R`. The root datum :math:`R` must be semisimple. Note that a
   semisimple root datum :math:`R` need not be a direct sum of simple root data,
   but it is isogenous to a direct sum of root data :math:`S`.

.. magma:example:: Example: Root Dtm Decomp
   :label: RootDtmDecomp

   If the root datum in adjoint or simply connected, then it is a direct sum of
   simples. In this case we get :math:`S=R`. The join of the summands of the direct
   sum decomposition is the original root datum again: Here is an example of a
   semisimple root datum which is not a direct sum of simple subdata. Note that a
   simple root datum of type :math:`A_1` is either simply connected or adjoint.

   .. code-block:: magma

      > R := RootDatum("A4B5" : Isogeny:="SC"); 
      > Q, S := DirectSumDecomposition( R );
      > R eq S;
      true
      %%a> assert $1;
      > R eq Q[1] join Q[2];
      true
      %%a> assert $1;
      > R eq &join DirectSumDecomposition(R);
      true
      %%a> assert $1;
      > R eq &+    DirectSumDecomposition(R);
      false
      %%a> assert not $1;
      > R1 := RootDatum("A3T2B4T3");
      > R2 := RootDatum("T3G2T4BC3");
      > R1 + R2;
      Adjoint root datum of dimension 24 of type A3 B4 G2 BC3
      > R1 join R2;
      Root datum of dimension 12 of type A3 B4 G2 BC3
      > G<a,b>:=FundamentalGroup("A1A1");
      > _,inj:=sub<G|a*b>;
      > R:=RootDatum("A1A1":Isogeny:=inj);
      > ad := RootDatum( "A1" : Isogeny:="Ad" );
      > sc := RootDatum( "A1" : Isogeny:="SC" );
      > IsIsomorphic( R, DirectSum(ad,ad) );
      false
      %%a> assert not $1;
      > IsIsomorphic( R, DirectSum(ad,sc) );
      false
      %%a> assert not $1;
      > IsIsomorphic( R, DirectSum(sc,sc) );
      false
      %%a> assert not $1;
      > Q, S := DirectSumDecomposition( R );  
      > R eq S;                             
      false
      %%a> assert not $1;

.. magma:function:: Dual(R)
   :input_types: RootDtm
   :output_types: RootDtm, Map
   :label: Dual_RootDtm

   The dual of the root datum :math:`R`, obtained by swapping the roots and
   coroots. The second value returned is the dual morphism from :math:`R` to its
   dual.

.. magma:function:: SimplyConnectedVersion(R)
   :input_types: RootDtm
   :output_types: RootDtm, Map
   :label: SimplyConnectedVersion_RootDtm

   The simply connected version of the root datum :math:`R`. If :math:`R` is
   semisimple then the injection of the simply connected version into :math:`R` is
   returned as the second value.

.. magma:function:: AdjointVersion(R)
   :input_types: RootDtm
   :output_types: RootDtm, Map
   :label: AdjointVersion_RootDtm

   The adjoint version of the root datum :math:`R`. If :math:`R` is semisimple then
   the projection from :math:`R` to its adjoint version is returned as the second
   value.

.. magma:function:: IndivisibleSubdatum(R)
   :input_types: RootDtm
   :output_types: RootDtm
   :label: IndivisibleSubdatum_RootDtm

   The root datum consisting of all indivisible roots of the root datum :math:`R`.

.. magma:function:: Radical(R)
   :input_types: RootDtm
   :output_types: RootDtm
   :label: Radical_RootDtm

   The radical of the root datum :math:`R`, ie, the toral subdatum whose root
   (resp. coroot) space consists of the vectors perpendicular to every coroot
   (resp. root).

.. magma:example:: Example: Direct Sum Dual Radical
   :label: DirectSumDualRadical

   An adjoint or simply connected root datum is always a direct sum of irreducible
   subdata. In these cases we take :math:`S=R`.

   .. code-block:: magma

      > R1 := RootDatum("A5");
      > R2 := RootDatum("B4");
      > R := DirectSum(R1, Dual(R2));
      > DirectSumDecomposition(R);
      {
          Root datum of type A5 ,
          Root datum of type C4 
      }
      > R := RootDatum("BC2");
      > I := IndivisibleSubdatum(R); I;
      I: Root datum of type B2
      > I subset R;
      true [ 1, 2, 3, 5, 7, 8, 9, 11 ]
      > R := StandardRootDatum("A", 3);   
      > Radical(R);
      Toral root datum of dimension 1

.. magma:function:: TwistedRootDatum(R)
   :input_types: RootDtm
   :output_types: RootDtm
   :label: TwistedRootDatum_RootDtm

.. magma:function:: TwistedRootDatum(N)
   :input_types: MonStgElt
   :output_types: RootDtm
   :label: TwistedRootDatum_MonStgElt
   :parameters: Twist : Any : 1

   Create a twisted root datum from the root datum :math:`R`, or from the
   semisimple root datum with Cartan name :math:`N`. The twist may be specified in
   any of the following ways:

   :math:`\bullet` An integer, specifying the order of the twist;

   :math:`\bullet` A permutation, specifying the action of the primitive roots;

   :math:`\bullet` A pair :math:`<D, i>`, where :math:`D` is a set of distinguished
   orbits as sets of integers, and :math:`i` is the order of the Dynkin diagram
   symmetry;

   :math:`\bullet` A pair :math:`<\Gamma, Q>`, where :math:`\Gamma` is the acting
   group, and :math:`Q` is a sequence containing the permutation of the primitive
   roots for each of the generators of :math:`\Gamma`;

   :math:`\bullet` A homomorphism from :math:`\Gamma` to the symmetric group whose
   order is the number of roots of :math:`R`, describing how the acting group
   :math:`\Gamma` acts on the roots.

.. magma:example:: Example: Direct Sum Dual Radical
   :label: DirectSumDualRadical

   We construct a twisted root datum in a number of ways.

   .. code-block:: magma

      > S := TwistedRootDatum("D4" : Twist := 3);
      > S;
      S: Twisted adjoint root datum of dimension 4 of type 3D4,2 
      \bln 
      > R := RootDatum("A1A3");
      > DynkinDiagram(R);
      \bln 
      A1    1
      \bln 
      A3    2 - 3 - 4
      > S := TwistedRootDatum(R : Twist := Sym(4)!(2,4));
      > S;
      S: Twisted adjoint root datum of dimension 4 of type 2(A1 A3)4,3 
      \bln 
      > S := TwistedRootDatum("A4" : Twist := <{{1,4},{2,3}}, 2>);
      > S;
      S: Twisted adjoint root datum of dimension 4 of type 2A4,2 
      \bln 
      > R := RootDatum("E6" : Isogeny := "SC");
      > DynkinDiagram(R);
      \bln 
      E6    1 - 3 - 4 - 5 - 6
                    |
                    2
      > S := TwistedRootDatum(R : Twist := <Sym(2) ,[ Sym(6)!(1,6)(3,5) ]>);
      > S;
      S: Twisted simply connected root datum of dimension 6 of type 2E6,4 
      \bln 
      > R := RootDatum("D4");
      > DynkinDiagram(R);
      \bln 
      D4    3
           /
      1 - 2
           \\
            4
      > Gamma := Sym(3);
      > Gamma.1, Gamma.2;
      (1, 2, 3)
      (1, 2)
      > S := TwistedRootDatum(R : Twist := <Gamma, [ Sym(4) | (1,3,4), (1,4) ]>);
      > S;
      S: Twisted adjoint root datum of dimension 4 of type 6D4,2 
      \bln 
      > R := RootDatum("A2");
      > DynkinDiagram(R);
      \bln 
      A2    1 - 2
      > Roots(R);
      {@
          (1 0),
          (0 1),
          (1 1),
          (-1  0),
          ( 0 -1),
          (-1 -1)
      @}
      > S6 := Sym(#Roots(R));
      > phi := hom<Sym(2) -> S6 | S6!(1,2)(4,5)>;
      > S := TwistedRootDatum(R : Twist := phi);

.. magma:function:: UntwistedRootDatum(R)
   :input_types: RootDtm
   :output_types: RootDtm
   :label: UntwistedRootDatum_RootDtm

.. magma:function:: SplitRootDatum(R)
   :input_types: RootDtm
   :output_types: RootDtm
   :label: SplitRootDatum_RootDtm

   The split version of the (twisted) root datum :math:`R`.
