Galois group of compositum

Let $k\subset K_1,$ $k\subset K_2$ be finite Galois and $K = K_1K_2.$ Show that $G(K/k)$ is isomorphic to the subgroup $H = \{(\sigma,\tau)\mid\sigma|_{K_1\cap K_2} = \tau|_{K_1\cap K_2}\}$ of $G(K_1/k)\times G(K_2/k).$

I have already showed that $k\subset K$ must also be finite Galois. Now let $$\varphi\colon G(K/k)\to G(K_1/k)\times G(K_2/k).$$ I know that if we define $\varphi$ via $\sigma\mapsto (\sigma|_{K_1}, \sigma|_{K_2}),$ then $\varphi$ is clearly a homomorphism. Moreover, $\varphi$ is injective since if $\sigma$ restricted to $K_1$ and $\sigma$ restricted to $K_2$ is the identity, then $\sigma$ is the identity on $K_1K_2=K$. We can also show that if $K_1\cap K_2= k$, then this $\varphi$ is an isomorphism. Since $H$ is defined by sets of two different automorphisms, I'm not sure how to write a well-defined homomorphism from $G(K/k)\to H$.

UPDATE: I found the proof of this in Dummit and Foote (Chap 14, Proposition 21). They point out that $\text{im }\varphi\subset H$ since $$(\sigma|_{K_1})|_{K_1\cap K_2} = \sigma|{K_1\cap K_2} = (\sigma|_{K_2})|_{K_1\cap K_2}.$$

Then they say

The order of $H$ can he computed by observing that for every $\alpha \in \text{Gal}(K_1/ F)$ there are $|\text{Gal}(K_2/ K_1 \cap K_2)|$ elements $\tau \in \text{Gal}(K_2/F)$ whose restrictions to $K_1 \cap K_2$ are $\sigma|_{K_1\cap K_2}.$ Hence \begin{align} |H| &= |\text{Gal}(K_1/F)|\cdot |\text{Gal}(K_2/K_1\cap K_2)|\\ &= |\text{Gal}(K_1/ F)| \cdot\frac{|\text{Gal}(K_2/F)|}{|\text{Gal}(K_1 \cap K_2/F)|}. \end{align}

I don't follow how they come up with this.

• You need to check that A) $\operatorname{Im}(\varphi)\subseteq H$ and that B) $H\subseteq\operatorname{Im}(\varphi)$. Direction A is easy. Looks like a counting argument would settle direction B, but I didn't check everything. Recall that $K_i/K_1\cap K_2$ is also Galois for $i=1,2$, so you know how many elements of $G(K_i/k)$ have a given restriction to $K_1\cap K_2$. – Jyrki Lahtonen Aug 3 '16 at 5:14
• @Jyrki, do you have an explanation for the update I've added? – user346096 Aug 8 '16 at 19:02