# Finitely generated semigroup gets the finitely generated subsemigroup?

From N.RUSKUC's paper "On Large Subsemigroups and Finiteness conditions of Semigroups", there is a theorem, Here large subsemigroup means $$S$$\ $$T$$ is finite. In this side "=>" of the proof in the paper, suppose $$S$$ is finitely generated by the set $$A$$. Then the set generats $$T$$.

My question is how can I get that $$X$$ generates $$T$$. Of course from the definition of $$X$$, I know $$T$$ contains $$X$$. So the point may be how to get that for any element in T, this element can be presented by X.

Let $t\in T$ with $t = a_1\ldots a_n$ for $a_i\in A$. I'm going to use $U$ for $S^1\setminus T$. To express $t$ as a product of elements of $X$:
1. Let $k$ be minimal such that $a_1\ldots a_k\in U$ (where the empty product represents $1$) and $a_1\ldots a_{k+1}\in T$. (Certainly $k$ exists, since $t\in T$.) Set $s_1 = a_1\ldots a_k$.
2. If $a_{k+2}\ldots a_n\in U$, then set $s_2 = a_{k+2}\ldots a_n$ and we have $t = s_1 a_{k+1} s_2\in X$. Otherwise, replace $t$ by $a_{k+2}\ldots a_n$ and return to 1.
We keep going through that loop as long as possible, obtaining $t = s_1 b_1 s_2 b_2 \ldots s_m b_m s_{m+1}$, where $s_i\in U$, $b_i\in A$ and $s_i b_i\in T$ for all $i$ and $s_m b_m s_{m+1}\in T$ (for if $s_m b_m s_{m+1}$ were not in $T$, we would have already stopped the process earlier).