A finite semi-group with cancellation laws is a group . I don't understand how to get this:  

A finite semigroup with cancellation laws is a group.  

Thanks in advance for any help.

Let $S$ be a such semigroup. For each $a\in S$, we can find a positive integer $n(a)$ such that $a^{n(a)+1}=a$. If such $n(a)$ does not exist, then $a^1,a^2,a^3,\cdots$ are all different and is contradicting that $S$ is finite.
We will argue that, for each $a,b\in G$, $a^{n(a)}=b^{n(b)}$. Since
$$aa^{n(a)}b=a^{n(a)+1}b=ab=ab^{n(b)+1}=ab^{n(b)}b$$
so by (left and right) cancellation law, we get $a^{n(a)}=b^{n(b)}$.
Let define $e=a^{n(a)}$ then $ea=a$ and $ae=a$ for all $a\in S$. If we define $a^{-1}:=a^{n(a)-1}$ then you can check that $a^{-1}$ is an inverse of $a$.
