.. _SectRSSub:

.. _create-new-root-system:

Building Root Systems
=====================

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

The root subsystem of the root system :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: RootSys, SetEnum
   :output_types: RootSys

   The root subsystem of the root system :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
   subsystem (i.e. none of them may be a summand of another), otherwise an error is
   signalled. The simple roots will appear in the subsystem in the given order.

.. magma:operation:: R1 subset R2
   :input_types: RootSys, RootSys
   :output_types: BoolElt, .
   :label: op_subset_RootSys_RootSys

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

.. magma:operation:: R1 + R2
   :input_types: RootSys, RootSys
   :output_types: RootSys
   :label: op_plus_RootSys_RootSys

.. magma:function:: DirectSum(R1, R2)
   :input_types: RootSys, RootSys
   :output_types: RootSys
   :label: DirectSum_RootSys_RootSys

   The direct sum of the root systems :math:`R_1` and :math:`R_2`. The root space
   of the result is the direct sum of the root spaces of :math:`R_1` and
   :math:`R_2`.

.. magma:operation:: R1 join R2
   :input_types: RootSys, RootSys
   :output_types: RootSys
   :label: op_join_RootSys_RootSys

   The union of the root systems :math:`R_1` and :math:`R_2`. The root systems must
   have the same root space, which will also be the root space of the result.

.. magma:example:: Example: Root Sys Sums
   :label: RootSysSums

   .. code-block:: magma

      > R  := RootSystem("A1A1");
      > R1 := sub<R|[1]>;
      > R2 := sub<R|[2]>;
      > R1 + R2;
      Root system of dimension 4 of type A1 A1
      > R1 join R2;
      Root system of dimension 2 of type A1 A1
      > R1 := RootSystem("A3T2B4T3");
      > R2 := RootSystem("T3G2T4BC3");
      > R1 + R2;
      Root system of dimension 24 of type A3 B4 G2 BC3
      > R1 join R2;
      Root system of dimension 12 of type A3 B4 G2 BC3

.. magma:function:: DirectSumDecomposition(R)
   :input_types: RootSys
   :output_types: []
   :label: DirectSumDecomposition_RootSys

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

   The set of irreducible direct summands of the semisimple root system :math:`R`.

.. magma:function:: Dual(R)
   :input_types: RootSys
   :output_types: RootSys
   :label: Dual_RootSys

   The dual of the root system :math:`R`, obtained by swapping the roots and
   coroots.

.. magma:function:: IndivisibleSubsystem(R)
   :input_types: RootSys
   :output_types: RootSys
   :label: IndivisibleSubsystem_RootSys

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

.. magma:example:: Example: Direct Sum Dual
   :label: DirectSumDual

   .. code-block:: magma

      > R1 := RootSystem("H4");
      > R2 := RootSystem("B4");
      > R1 + Dual(R2);
      Root system of type H4 C4
      %> DirectSumDecomposition(R);
      %[
      %    Root system of type H4 ,
      %    Root system of type C4 
      %]
      > R := RootSystem("BC2");
      > I := IndivisibleSubsystem(R); I;
      I: Root system of type B2
      > I subset R;
      true [ 1, 2, 3, 5, 7, 8, 9, 11 ]
