Let $X$ be a non-empty set. There exists sets $X'$ and $\varepsilon$ such that $\varepsilon \notin X \cup X'$, $X' \cap X = \varnothing$ and $|X|=|X'|$, ie, $X$ and $X'$ have the same cardinality. Hence, there exists a bijection $f:X \to X'$. Let $A = X \cup X' \cup \{ \varepsilon \} $.
For all $x \in A$, we define $$x' = \left\{ \begin{array}{c} \varepsilon , \text{ if } \ x= \varepsilon; \\ f(x) , \text{ if } \ x \in X ; \\ f^{-1} (x) , \text{ if } \ x \in X' . \end{array} \right.$$
The usual set of sequences of elements of $A$ is $A^{\omega}$, whose members are functions $\omega \to A$. It is usual to write $u_n = u(n)$, $\forall n \in \omega$, $\forall u \in A^{\omega}$.
The set $$W = A^{\omega}_{\varepsilon} = \{ u \in A^{\omega} : (\exists k \in \omega)(\forall n \in \omega)(n \geq k \to u_n = \varepsilon) \}$$ is the set of all the sequences "quasi-$\varepsilon$", which we will call "words".
For all $u \in W$, the set $\{ k \in \omega : (\forall n \in \omega)(n \geq k \to u_n = \varepsilon) \}$ is non-empty by definition and has a minimum element $\ell(u)$, which we call the "length" of the word $u$.
A word $u \in W$ is called "reduced" if, and only if, $(\forall n\in \omega)[n < \ell(u) \to u_n \neq \varepsilon ] $ and $(\forall n \in \omega)[n < \ell(u) \to u_{n+1} \neq u_n' ]$.
I need an algorithm that, for all $u \in W$, reduces $u$ till it can't be no more. Then I need to prove that every word can be reduced by this algorithm until I reach an unique reduced word.
Thanks in advance.