Inverting without actual inverse? I'm reading Ash's "Basic Abstract Algebra" and been trying to understand the following: 



For which I guess the problem lies when we try to take an element $hk\in HK$, it's inverse is $k^{-1}h^{-1}$ but $k^{-1}h^{-1}\in HK$ only if $k^{-1}h^{-1}=h^{-1} k^{-1}$. 
My problem is the following, taking the definition of subgroup, we have:


*

*If $a,b\in H$, then $ab^{-1}\in H$. 


Then, all the elements $k\cdot1=k$ and $1\cdot h=h$ are in $HK$, that is: We have all the elements of both $H,K$ in $HK$. By the definition, suppose we have $hk\in HK$, then we must have $(hk)(k^{-1})$ and $(hkk^{-1})(h^{-1})$. Isn't this very similar to having the inverse of $hk$ in $HK$? 
It's a bit odd because it seems we can actually invert $hk$ by performing the two operations I mentioned before but $(hk)^{-1}$ is not actually in $HK$.

Assume $HK = KH$. To show that $HK$ is a subgroup, consider $g_1= h_1k_1, g_2 = h_2k_2$ in $HK$. We have $(k_1k_2^{-1})h_2^{-1} \in KH = HK$, hence $(k_1k_2^{-1})h_2^{-1} = hk$ with $h \in H, k \in K$. Then $g_1g_2^{-1} = h_1k_1k_2^{-1}h_2^{-1} = h_1hk \in HK$.
If you consider $hk \in HK$, then you see even easier $(hk)^{-1} = k^{-1}h^{-1} \in KH = HK$.
Conversely, assume that $HK$ is a subgroup of $G$.
(a) $KH \subset HK$.
Let $g \in KH$. Write $g = kh$ with $h \in H, k \in K$. Then $g^{-1} = h^{-1}k^{-1} \in HK$, hence $g \in HK$. 
(b) $HK \subset KH$.
Let $g \in HK$. Then also $g^{-1} \in HK$, hence $g^{-1} = hk$ with $h \in H, k \in K$. This shows $g = k^{-1}h^{-1} \in KH$.
