# Is it true that $H = H_1 \times H_2\times \dots \times H_r$?

Suppose that $G= G_1 \times \dots\times G_r$ be a decomposition of group $G$ into its normal subgroups. Let $H_i \leq G_i$ for every $i$. We know that for every $i \neq j$, we have $[G_i, G_j]=1$ and so $[H_i, H_j]=1$.

a) Is it true that $H := H_1 H_2 \cdots H_r$ is a subgroup of $G$?

b) Is it true that $H = H_1 \times H_2 \times \dots \times H_r$?

More explicitly consider $(h_1\cdots h_r)(k_1\cdots k_r)= (h_1k_1)(h_2k_2)\cdots(h_rk_r)$.