Product of Semigroup Element with Right Inverse is Idempotent/Examples/Double and Half Mappings on Integers

Examples of Use of Product of Semigroup Element with Right Inverse is Idempotent
Let $\struct {\Z^\Z, \circ}$ be the semigroup defined such that:
 * $\Z$ is the set of all mappings on the integers.
 * $\circ$ denotes composition of mappings.

Let $\rho, \sigma \in \Z^\Z$ such that:


 * $\forall x \in \Z: \map \rho x = \begin{cases} \dfrac x 2 & : x \text { even} \\ 0 & : x \text { odd} \end{cases}$


 * $\forall x \in \Z: \map \sigma x = 2 x$

Then:
 * $\rho$ is a right inverse for $\sigma$

but:
 * $\rho$ is not a left inverse for $\sigma$

As a result:


 * $\paren {\sigma \circ \rho}^2 = \sigma \circ \rho$

Proof
Thus $\map {\paren {\sigma \circ \rho} } x \ne \map {\paren {\rho \circ \sigma} } x$ $x$ is odd.

So $\rho$ is a right inverse but not a left inverse for $\sigma$.

Then we have that:
 * $\map {\paren {\sigma \circ \rho} } x = \begin{cases} x & : x \text { even} \\ 0 & : x \text { odd} \end{cases}$

and it follows that:
 * $\map {\paren {\sigma \circ \rho}^2} x = \begin{cases} x & : x \text { even} \\ 0 & : x \text { odd} \end{cases}$