Algebra problem solved 2

Problem: "Prove that a finite monoid in which the cancellation law holds is a group. "

To prove it, we must show that for all a there is an inverse element.

We know that the monoid in question is finite so:

 \forall a \exists n such that an = e where e is the identity element.

This stems from the fact that monoids are closed under their operation.

an= e implies an-1a= e. So the inverse element is an-1