# Building Root Systems

## `sub<R | a>: RootSys, SetEnum -> RootSys`

The root subsystem of the root system $R$ generated by the roots $\alpha_{a_1},\dots,\alpha_{a_k}$ where $a=\{a_1,\dots,a_k\}$ is a set of integers.

## `sub<R | s>: RootSys, SetEnum -> RootSys`

The root subsystem of the root system $R$ generated by the roots $\alpha_{s_1},\dots,\alpha_{s_k}$ where $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.

## `R1 subset R2: RootSys, RootSys -> BoolElt, .`

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

## `R1 + R2: RootSys, RootSys -> RootSys`

## `DirectSum(R1, R2): RootSys, RootSys -> RootSys`

The direct sum of the root systems $R_1$ and $R_2$. The root space of the result is the direct sum of the root spaces of $R_1$ and $R_2$.

## `R1 join R2: RootSys, RootSys -> RootSys`

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

## `Example: Root Sys Sums (ex-f885fa)`

```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

```

```magma
> 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

```

## `DirectSumDecomposition(R): RootSys -> []`

## `IndecomposableSummands(R): RootDtm -> [], RootDtm, Map`

The set of irreducible direct summands of the semisimple root system $R$.

## `Dual(R): RootSys -> RootSys`

The dual of the root system $R$, obtained by swapping the roots and coroots.

## `IndivisibleSubsystem(R): RootSys -> RootSys`

The root system consisting of all indivisible roots of the root system $R$.

## `Example: Direct Sum Dual (ex-feab7e)`

```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 ]

```
