## Characterization of the subsemigroup generated by a subset

Let $S$ be a semigroup and let $A \subseteq S$ be a nonempty subset. Recall that the subsemigroup of $S$ generated by $A$ is the set $(A) = \{\prod a_i\ |\ a:n \rightarrow A\ \mathrm{for\ some}\ n \in \mathbb{N}^+\}$. (Since $S$ is associative, the $\prod$ notation is unambiguous provided we insist that $\prod_{i=1}^n a_i = a_1a_2 \cdots a_n$.) Let $B_A(S)$ denote the set of all subsemigroups of $S$ which contain $A$. (Note that $I_A(S)$ is nonempty since it contains $S$.) Prove that $(A) = \bigcap B_A(S)$.

Note that if $T \subseteq S$ is a subsemigroup containing $A$, then in particular we have $\prod a_i \in T$ for all $a: n \rightarrow A$ and $n \in \mathbb{N}^+$. (We can see this by using induction on $n$.) So $(A) \subseteq T$, and thus $(A) \subseteq \bigcap B_A(S)$.

Note also that $(A)$ is itself a subsemigroup of $S$, by generalized associativity. That is, if $\prod_{i=1}^n a_i, \prod_{j=1}^m b_j \in (A)$, then $(\prod a_i)(\prod b_i) = \prod_{k=1}^{n+m} c_i$ where $c_k = a_k$ for $1 \leq k \leq n$ and $c_k = b_{k-n}$ for $n+1 \leq k \leq n+m$. So $\bigcap B_A(S) \subseteq (A)$.