Lemma:Suppose a finite set $ G$ is closed under an associative product and that both cancellation laws hold in $G$,then $G$ must be a group.
Using the result, prove that the nonzero integers modulo $p$, $p$ a prime number, form a group under multiplication $\mod p$.
However, I wanted to solve it in a general way and by using the above lemma. If we solve it in a " general" way, my solution goes like this:
First we prove the closure property . If $a,b\in G$, then $a.b\in G$. Now, if $a,b$ are non-zero integers modulo p and $a,b\in G $ , where $G=\{0,1,...,p-1\}$ and then $a.b (\mod p)\in G$, is true. Hence, closure property is satisfied. Next, we go for associative property, which is always true as multiplication ($\mod p$) is always associative . If $a,b,c\in G $ then $(a.(b.c))(mod p)=((a.b).c)(mod p)$. Hence, associative property is satisfied. Next, we go for the identity property i.e $\exists e\in G$ such that $\forall a\in G$, $a.e=e.a=a$. If $e=1$ , then $\forall a\in G$, $a.1(\mod p)=1.a(\mod p)=a$. Thus, identity property is satisfied. Next, we prove the inverse property i.e for every $a\in G $ , $\exists a^{-1}\in G $ such that $a.a^{-1}=a^{-1}.a=e$. Hence , for every $a\in G $, $\exists a^{-1}\in G$, such that $a.a^{-1}\equiv 1 (mod p)$, which is true (by Bezout's Lemma) and if $a^{-1}\equiv a_1(\mod p)$ then, $a.a^{-1}\equiv a.a_1\equiv 1 (\mod p)$, and $a_1\in G$. Thus, inverse property is satisfied. Hence , $G$ is a group under multiplication modulo $p$.
Is the above proof correct? Is the above proof valid? If not, then why it isn't true? Also,I am not getting how to use the lemma to prove that $G$ is a group under this binary operation. How to prove it? I am not quite getting it...