Closure of Pointwise Operation on Algebraic Structure

Theorem
Let $S$ be a set such that $S \ne \varnothing$.

Let $\left({T, \circ}\right)$ be an algebraic structure.

Let $T^S$ be the set of all mappings from $S$ to $T$.

Let $f, g \in T^S$, that is, let $f: S \to T$ and $g: S \to T$ be mappings.

Let $\oplus: T^S \to T^S$ be the operation on $T^S$ induced by $\circ$.

Then $\oplus$ is closed on $T^S$ $\left({T, \circ}\right)$ is closed.

Necessary Condition
Let $\left({T, \circ}\right)$ be closed.

Let $x \in S$ be arbitrary.

Then:

So $\oplus$ is closed on $T^S$.

Sufficient Condition
Let $\oplus$ is closed on $T^S$.

Aiming for a contradiction, suppose $\left({T, \circ}\right)$ not be closed.

Then
 * $(1): \quad \exists s, t \in T: s \circ t \notin T$

By definition, $T^S$ is the set of all mappings from $S$ \to $T$.

As $S \ne \varnothing$ it follows that $\exists x \in S$.

Thus, let $x \in S$ be arbitrary.

Let $f, g \in T^S$ such that:
 * $(2): \quad f \left({x}\right) = s, g \left({x}\right) = t$

Then:

That is, $\oplus$ is not closed on $T^S$.

From that contradiction it follows that $\left({T, \circ}\right)$ is closed.