In my textbook, the following theorem is written down:
"Let $G$ be a group and $H \subseteq G$ be a subset of $G$. Then $H \leq G$ if, and only if, $H$ is non-empty and $ab^{-1} \in H$ for all $a,b \in H$."
I'm confused mainly about the first part of the proof, where you have to show that $ab^{-1} \in H$ for all $a,b \in H$ if $H$ is a subgroup of $G$. So I understand that H would be non-empty since $H$ being a group itself implies that it contains the identity element, $1_H.$ Now if you let $a$ and $b$ be elements of $H$, then similarly, the definition of a group implies that the inverse of $b$, which is $b^{-1}$, is already contained in $H$. Finally by closure, since $a$ and $b^{-1}$ are elements of $H$, we have that $ab^{-1} \in H$.
However, the proof in the textbook seems to be more complicated than it should have been:
"Let $a \in H$. Then $a1_G = a = a1_H$, so by cancellation, $1_G = 1_H$. Now suppose that $ab = 1_H$ for some $b \in H$. Then $ab = 1_G$, so $b^{-1} = a \in H$. Hence by closure, $ab^{-1} \in H$."
The problem is that the textbook seems to me that it is assuming only that $b$ is the inverse of $a$, and that $b$ is not just any arbitrary element of $H$. But clearly in the theorem, $b$ is definitely an arbitrary element of $H$.
Is there something I'm not understanding here? I wish for some clarification.
Thanks in advance.