Equivalence of Definitions of Transitive Closure (Relation Theory)/Union of Compositions is Smallest

Theorem
Let $\mathcal R$ be a relation on a set $S$.

Let:
 * $\mathcal R^n := \begin{cases}

\mathcal R & : n = 0 \\ \mathcal R^{n-1} \circ \mathcal R & : n > 0 \end{cases}$

where $\circ$ denotes composition of relations.

Finally, let
 * $\displaystyle \mathcal R^+ = \bigcup_{i \in \N} \mathcal R^i$.

Then $\mathcal R^+$ is the smallest transitive relation on $S$ that contains $\mathcal R$.



$\mathcal R^+$ is Transitive
By Relation contains Composite with Self iff Transitive, we can prove that $\mathcal R^+$ is transitive by proving the following:
 * $\mathcal R^+ \circ \mathcal R^+ \subseteq \mathcal R^+$

Let $(a,c) \in \mathcal R^+ \circ \mathcal R^+$.

Then for some $b\in S$, $(a,b) \in \mathcal R^+$ and $(b,c) \in \mathcal R^+$.

Thus for some $n$, $(a,b) \in \mathcal R^n$, and for some $m$, $(b,c) \in \mathcal R^m$.

But then, since Composition of Relations is Associative, $R^{n+m} = R^n \circ R^m$, so

$(a,c) \in \mathcal R^{n+m}$.

Since this holds for all $(a,c) \in \mathcal R^+ \circ \mathcal R^+$:
 * $\mathcal R^+ \circ \mathcal R^+ \subseteq \mathcal R^+$

Thus $\mathcal R^+$ is transitive.

$\mathcal R^+$ contains $\mathcal R$
$\mathcal R \subseteq \mathcal R^+$ by Set is Subset of Union.

$\mathcal R^+$ is smallest
Let $\mathcal R'$ be a transitive relation on $S$ that contains $\mathcal R$.

We must show that $\mathcal R^+ \subseteq \mathcal R'$.

Let $(a,b) \in R^+$. That is, let $a \mathrel{\mathcal R^+} b$.

Then for some $n \in \N_{>0}$, $(a,b) \in \mathcal R^n$.

Thus by the definition of composition of relations, there are elements $x_0, \dots, x_n \in S$ such that:
 * $x_0 = a$
 * $x_n = b$
 * $\forall k \in \N_n: x_k \mathrel{\mathcal R} x_{k+1}$

Since $\mathcal R \subseteq \mathcal R'$ and $\mathcal R'$ is transitive:
 * $a \mathrel{\mathcal R'} b$

That is, $(a,b) \in \mathcal R'$.

Since this holds for all $(a,b) \in \mathcal R^+$:
 * $\mathcal R^+ \subseteq \mathcal R'$.

Since this holds for all transitive relations $\mathcal R'$ that contain $\mathcal R$:

$\mathcal R^+$ is the smallest transitive relation containing $\mathcal R$.