Restriction of Associative Operation is Associative

Theorem
Let $\left({S, \circ}\right)$ be an semigroup.

Let $T \subseteq S$.

If $T$ is closed under $\circ$, then $\left({T, \circ \restriction_T}\right)$ is also a semigroup, where $\circ \restriction_T$ is the restriction of $\circ$ to $T$.