Let $G$ be a group and $A,B \leq G$. If $B$ is of finite index in $G$, then $A\cap B$ is of finite index in $A$ and we have $$[A:A\cap B]\leq[G:B]$$ It is fairly easy to show that the inequality holds, but what bothers me more is the statement that equality holds if and only if $G=AB$. Has someone a hint for me how to prove this?
Edit. The answer of Dietrich Burde is really nice! I learned alot from it. Also I learned how to alter my proof to yield the desired result. Consider the mapping $$\{x(A \cap B) : x \in A\} \to \{xB : x \in G\}\\ x(A \cap B) \mapsto xB$$ Assume $xB = yB$. Then $y^{-1}x \in B$ but also $y^{-1}x \in A$ so $y^{-1}x \in A \cap B$ which implies $x(A \cap B) = y(A \cap B)$. Hence the mapping is injective and thus the inequality follows. Now if $G = AB$ we have that $$\{xB : x \in G\} = \{xB : x \in AB\} =\{xB : x \in A\}$$ and thus the mapping is clearly surjective.