Solution (source code)

= Solution

In the semisimple Lie algebra convention, an abstract <root system> is a finite subset $\Phi$ of a finite-dimensional real Euclidean space $E$ with the following properties: it spans $E$, does not contain zero, is reduced, is invariant under each of its root reflections, and satisfies crystallographic integrality. More explicitly, for every $\alpha,\beta\in\Phi$,
$$
\boxed{\Phi\cap\mathbb R\alpha=\{\alpha,-\alpha\},\qquad s_\alpha(\beta)=\beta-\frac{2(\beta,\alpha)}{(\alpha,\alpha)}\alpha\in\Phi,\qquad\frac{2(\beta,\alpha)}{(\alpha,\alpha)}\in\mathbb Z.}
$$
Here $(\ ,\ )$ is a positive-definite inner product. The first condition is reducedness, the second gives closure under <root reflections>, and the last number is a <Cartan integer>. The <rank> is $\dim E$. A <simple root> basis is a basis of $E$ consisting of roots such that each root has integral coordinates that are either all nonnegative or all nonpositive. The two signs distinguish positive and negative roots. The diagrams in this problem concern these reduced <crystallographic root systems>; broader definitions sometimes omit one of these conditions.