Solution (source code)

= Solution

Let $\alpha_1,\alpha_2$ be distinct <simple roots>. Their difference is not a root, since its simple-root coefficients have opposite signs. The <root string> through $\alpha_2$ in the direction $\alpha_1$ therefore starts at $\alpha_2$ and has the form
$$
\alpha_2,\ \alpha_2+\alpha_1,\ldots,\alpha_2+q\alpha_1,
\qquad q=-\langle\alpha_2,\alpha_1^\vee\rangle.
$$
Here we use the root-string theorem: if the full string runs from $\beta-p\alpha$ through $\beta+q\alpha$, then $p-q=\langle\beta,\alpha^\vee\rangle$; in this case $p=0$. Thus $\alpha_1+\alpha_2$ is a root exactly when $A_{12}<0$, equivalently when the corresponding <Dynkin diagram> nodes are connected.

The root-space bracket facts are $[\mathfrak g_\alpha,\mathfrak g_\beta]\subseteq\mathfrak g_{\alpha+\beta}$, with a zero space when the sum is not a root, and $[\mathfrak g_\alpha,\mathfrak g_\beta]=\mathfrak g_{\alpha+\beta}\ne0$ when the sum is a root and $\beta\ne-\alpha$. Applying these stated structural facts proves
$$
\boxed{[\mathfrak g_{\alpha_1},\mathfrak g_{\alpha_2}]=0\iff\text{the two nodes are not connected}.}
$$

If the two names denote the same <simple root>, its one-dimensional <root space> has zero bracket with itself, and a <Dynkin diagram> has no self-edge. Thus the equivalence also holds in that case.