Magma Subset Product with Self

Theorem
Let $$\left({S, \circ}\right)$$ be a groupoid.

Let $$T \subseteq S$$.

Then $$\left({T, \circ}\right)$$ is a groupoid iff $$T \circ T \subseteq T$$, where $$T \circ T$$ is the subset product of $$T$$ with itself.

Proof
By definition, $$T \circ T = \left\{{x = a \circ b: a, b \in T}\right\}$$.


 * Let $$\left({T, \circ}\right)$$ be a groupoid.

Then $$T$$ is closed, that is, $$\forall x, y \in T: x \circ y \in T$$.

Thus $$x \circ y \in T \circ T \implies x \circ y \in T$$.


 * Now suppose $$T \circ T \subseteq T$$.

Then $$x \circ y \in T \circ T \implies x \circ y \in T$$.

Thus $$T$$ is closed, and therefore $$\left({T, \circ}\right)$$ is a groupoid.