This question is a problem from Allan Clarke's Elements of Abstract Algebra, which has been asked about before on MSE (I'll provide a link below). When I tried solving it I stumbled upon an issue that I didn't see addressed in this or other questions about this problem.
Let $S$ be a semigroup with a finite number of elements. Suppose that the two cancellation laws hold in $S$; that is, if either $ab = ac$ or $ba = ca$, then $b = c$. Show that $S$ is a group.
Note: I'll just outline the proof idea for completeness, while skipping most of the proof. The details can be found here. Also: I know this can be proven using injection/surjection arguments, I'm asking about a particular step, which I describe below.
I approached this using the pigeonhole principle, induction, etc. to show that there is an identity $e = a^{n-m}$ for $a \in S$ and $n,m \in \mathbb N \colon n>m$. Then I showed that $a^{n-m-1}$ is the inverse of $a$ for $n > m+1$. This is where I have my issue: I didn't know what to do if $n - m = 1$? Because then $a^{n-m-1}=a^0$ and as I understand this, we don't know whether this element is in $S$.
Am I hallucinating issues, is this a non-issue or is there a simple fix for this?
we know $a^n = a^m$, expanding this (using standard inductive definitions of powers):
$$ \begin{align} \underbrace {(a \dots a)}{m-1 \ as}\underbrace{(a \dots a)}{n-m+1 \ as} = \underbrace {(a \dots a)}_{m-1 \ as} a &\implies a^{n-m+1} = a\ & \iff a^{n-m}a = a \ & \iff aa^{n-m} = a \end {align} $$ hence $e=a^{n-m}$ is the identity element
– powerline Jan 20 '25 at 02:29