Solution (source code)

= Solution

A <subgroup> $N\leq G$ is a <normal subgroup> when conjugation by every group element preserves it:
$$
\boxed{gNg^{-1}=N\quad\text{for all }g\in G.}
$$
Equivalently, $gN=Ng$ for every $g$; normality permits the cosets to inherit a quotient-group multiplication.

A <group homomorphism> is a map preserving multiplication:
$$
\boxed{\phi:G_1\to G_2,\qquad\phi(gh)=\phi(g)\phi(h).}
$$
It consequently sends identity to identity and inverses to inverses, since $\phi(e)=\phi(e)^2$ and $\phi(g)\phi(g^{-1})=\phi(e)$.