Index of the direct product of subgroups Let $\{G_i\}_{i\in I}$ be a family of groups and $H_i\leq G_i$, for all $i\in I$. Is it true that
$$
|\prod_{i \in I}G_i:\prod_{i \in I}H_i|=\prod_{i \in I}|G_i:H_i|?
$$
Note. It is clear that the answer is positive if $I$ is finite.

The equality holds in the sense of cardinalities.
The left hand side is the cardinality of the set of cosets of $\prod H_i$ in $\prod G_i$. The right hand side is the cardinal of the cartesian product of the cardinals $|G_i\colon H_i|$, or equivalently, it is the cardinal of the cartesian product
$$\mathop{\times}\limits_{i\in I} \{gH_i\mid g\in G_i\}\tag{1} $$
So it is enough to show there is a bijection between the cosets of $\prod H_i$ in $\prod G_i$, and family in $(1)$.
Cosets of $\prod H_i$ in $\prod G_i$ have the form $(g_i)(\prod H_i) = \prod g_iH_i$. Conversely, elements of $\mathop{\times}_{i\in I}\{gH_i\mid g\in G_i\}$ are of the form $(g_iH_i)_{i\in I}$ with $g_i\in G_i$. The correspondence is clear.
