I like to know why the dihedral group $D_4$ can't be written as a direct product of two groups. It is a school assignment that I've been trying to solve all day and now I'm more confused then ever, even thinking that the teacher might have missed writing out that he means normal subgroups.
On another thread it was stated (as the answer to this question) that the direct product of two abelian groups is again abelian. If we consider the direct product of abelian subgroups $H$,$K\in G$ where $HK=G$ (for all $g \in G$, $g=hk$ $h \in H$, $k \in K$.) I can't understand why this would imply $g=kh$? It is not stated anywhere that $H$,$K$ has to be normal! But if this implication is correct I do understand why $D_4$ (that is non-abelian) can't be written as a direct product of two groups. But if it's not, as I suspect, I need some help!
We know that all groups of order 4 and 2 are abelian, (since $4=p^2$), but only 4 of the subgroups of $D_4$ are normal:
Therefor I can easily show that $D_4$ can't be a direct product of normal subgroups: The only normal subgroups of $D_4$ is the three subgroups of order 4, (index 2 theorem): $\{e,a^2,b,a^2b\}$, $\langle a\rangle$, $\{e,a^2,ab,a^3b\}$ and the center of $D_4=\{e,a^2\}$ We can see that these are not disjoint. So $D_4$ can't be a direct product of normal subgroups. The reason for this being that the center is non-trivial. But why can't $D_4$ be a direct product of any two groups?
If we write the elements of $D_4$ as generated by $a$ and $b$, $a^4=e$, $b^2=e$, $ba=a^3b$ why isn't $D_4=\langle b\rangle\langle a\rangle$ ? I calculated the products of the elements of these two groups according to the rule given above and ended up with $D_4$, and also $\langle a\rangle$, $\langle b\rangle$ is disjoint...? Why is this wrong? Very thankful for an answer!