# Goursat's lemma

Goursat's lemma, named after the French mathematician Édouard Goursat, is an algebraic theorem about subgroups of the direct product of two groups.
It can be stated more generally in a Goursat variety (and consequently it also holds in any Maltsev variety), from which one recovers a more general version of Zassenhaus' butterfly lemma. In this form, Goursat's lemma also implies the snake lemma.

## Groups

Goursat's lemma for groups can be stated as follows.
    Let $G$, $G'$ be groups, and let $H$ be a subgroup of $G\times G'$ such that the two projections $p_{1}:H\to G$ and $p_{2}:H\to G'$ are surjective (i.e., $H$ is a subdirect product of $G$ and $G'$). Let $N$ be the kernel of $p_{2}$ and $N'$ the kernel of $p_{1}$. One can identify $N$ as a normal subgroup of $G$, and $N'$ as a normal subgroup of $G'$. Then the image of $H$ in $G/N\times G'/N'$ is the graph of an isomorphism $G/N\cong G'/N'$. One then obtains a bijection between:
   * Subgroups of $G\times G'$ which project onto both factors,
   * Triples $(N,N',f)$ with $N$ normal in $G$, $N'$ normal in $G'$ and $f$ isomorphism of $G/N$ onto $G'/N'$.
An immediate consequence of this is that the subdirect product of two groups can be described as a fiber product and vice versa.
Notice that if $H$ is any subgroup of $G\times G'$ (the projections $p_{1}:H\to G$ and $p_{2}:H\to G'$ need not be surjective), then the projections from $H$ onto $p_{1}(H)$ and $p_{2}(H)$ are surjective. Then one can apply Goursat's lemma to $H\leq p_{1}(H)\times p_{2}(H)$.
To motivate the proof, consider the slice $S=\{g\}\times G'$ in $G\times G'$, for any arbitrary $g\in G$. By the surjectivity of the projection map to $G$, this has a non trivial intersection with $H$. Then essentially, this intersection represents exactly one particular coset of $N'$. Indeed, if we have elements $(g,a),(g,b)\in S\cap H$ with $a\in pN'\subset G'$ and $b\in qN'\subset G'$, then $H$ being a group, we get that $(e,ab^{-1})\in H$, and hence, $(e,ab^{-1})\in N'$. It follows that $(g,a)$ and $(g,b)$ lie in the same coset of $N'$. Thus the intersection of $H$ with every "horizontal" slice isomorphic to $G'\in G\times G'$ is exactly one particular coset of $N'$ in $G'$. By an identical argument, the intersection of $H$ with every "vertical" slice isomorphic to $G\in G\times G'$ is exactly one particular coset of $N$ in $G$.
All the cosets of $N,N'$ are present in the group $H$, and by the above argument, there is an exact 1:1 correspondence between them. The proof below further shows that the map is an isomorphism.

### Proof

Before proceeding with the proof, $N$ and $N'$ are shown to be normal in $G\times \{e'\}$ and $\{e\}\times G'$, respectively. It is in this sense that $N$ and $N'$ can be identified as normal in G and G', respectively.
Since $p_{2}$ is a homomorphism, its kernel N is normal in H. Moreover, given $g\in G$, there exists $h=(g,g')\in H$, since $p_{1}$ is surjective. Therefore, $p_{1}(N)$ is normal in G, viz:
    $gp_{1}(N)=p_{1}(h)p_{1}(N)=p_{1}(hN)=p_{1}(Nh)=p_{1}(N)g$.
It follows that $N$ is normal in $G\times \{e'\}$ since
    $(g,e')N=(g,e')(p_{1}(N)\times \{e'\})=gp_{1}(N)\times \{e'\}=p_{1}(N)g\times \{e'\}=(p_{1}(N)\times \{e'\})(g,e')=N(g,e')$.
The proof that $N'$ is normal in $\{e\}\times G'$ proceeds in a similar manner.
Given the identification of $G$ with $G\times \{e'\}$, we can write $G/N$ and $gN$ instead of $(G\times \{e'\})/N$ and $(g,e')N$, $g\in G$. Similarly, we can write $G'/N'$ and $g'N'$, $g'\in G'$.
On to the proof. Consider the map $H\to G/N\times G'/N'$ defined by $(g,g')\mapsto (gN,g'N')$. The image of $H$ under this map is $\{(gN,g'N')\mid (g,g')\in H\}$. Since $H\to G/N$ is surjective, this relation is the graph of a well-defined function $G/N\to G'/N'$ provided $g_{1}N=g_{2}N\implies g_{1}'N'=g_{2}'N'$ for every $(g_{1},g_{1}'),(g_{2},g_{2}')\in H$, essentially an application of the vertical line test.
Since $g_{1}N=g_{2}N$ (more properly, $(g_{1},e')N=(g_{2},e')N$), we have $(g_{2}^{-1}g_{1},e')\in N\subset H$. Thus $(e,g_{2}'^{-1}g_{1}')=(g_{2},g_{2}')^{-1}(g_{1},g_{1}')(g_{2}^{-1}g_{1},e')^{-1}\in H$, whence $(e,g_{2}'^{-1}g_{1}')\in N'$, that is, $g_{1}'N'=g_{2}'N'$.
Furthermore, for every $(g_{1},g_{1}'),(g_{2},g_{2}')\in H$ we have $(g_{1}g_{2},g_{1}'g_{2}')\in H$. It follows that this function is a group homomorphism.
By symmetry, $\{(g'N',gN)\mid (g,g')\in H\}$ is the graph of a well-defined homomorphism $G'/N'\to G/N$. These two homomorphisms are clearly inverse to each other and thus are indeed isomorphisms.

## Goursat varieties

As a consequence of Goursat's theorem, one can derive a very general version on the Jordan–Hölder–Schreier theorem in Goursat varieties.