Solution (source code)

= Solution

A <canonical presentation of a group> uses a symbol $[g]$ for each $g\in G$ and relations $[g][h]=[gh]$ for every pair. Evaluation to $G$ is surjective, and $g\mapsto[g]$ is its inverse <homomorphism>; the relation with $g=h=1$ implies $[1]=1$. Thus this presentation recovers any group.

The <pushout> of the two homomorphisms is
$$
G=(G_1*G_2)/\left\langle\!\left\langle\phi_1(g)\phi_2(g)^{-1}:g\in G_0\right\rangle\!\right\rangle.
$$
Here $*$ is the <free product>, and the denominator is the <normal closure>. Its canonical maps $j_i:G_i\to G$ satisfy $j_1\phi_1=j_2\phi_2$. The <universal property> says that maps $u_i:G_i\to H$ agreeing on $G_0$ factor uniquely as $u_i=u j_i$ for one <homomorphism> $u:G\to H$. The free-product <universal property> first gives the map before quotienting, and agreement makes it kill precisely the imposed relations, proving this property.

Suppose $G_0$ is generated by $s_1,\ldots,s_r$, and $G_i=\langle S_i\mid R_i\rangle$ are finite presentations with disjoint generator sets. Choose words $w_{ij}$ representing $\phi_i(s_j)$. Then
$$
\boxed{G=\langle S_1\sqcup S_2\mid R_1,R_2,\ w_{1j}w_{2j}^{-1}\ (1\leq j\leq r)\rangle}.
$$
Agreement on these generators implies agreement on every word in $G_0$, so these finitely many extra relations suffice by the <universal property>. No <finite presentation> for $G_0$ is required.

The <Seifert-van Kampen theorem> states that for a space covered by <path-connected> open sets $U,V$ with <path-connected> nonempty intersection and basepoint in that intersection, $\pi_1(U\cup V)$ is the <pushout> of $\pi_1(U)\leftarrow\pi_1(U\cap V)\to\pi_1(V)$.

To see the two bands in the <Klein bottle> model, take one region to be $1/4\leq y\leq3/4$ and the other to be the outer strips $0\leq y\leq1/4$, $3/4\leq y\leq1$, joined along the top-bottom identification. Each is an interval bundle over the horizontal <circle>, and going once around reverses its transverse coordinate. For the middle band use the coordinate $y-1/2$; for the outer band use the signed coordinate about zero modulo one. Both are therefore <Möbius bands>. Their common boundary is the one <circle> represented by the lines $y=1/4,3/4$, joined at the identified vertical sides. They cover the whole bottle and are glued along that <circle>.

A <Möbius band> deformation retracts onto its core <circle>, so its <fundamental group> is infinite cyclic. Going once around its boundary traverses the core twice: one pass along one boundary edge changes sides, and the second pass returns. After choosing core generators and consistent boundary <orientation>, the two inclusion maps from the common <circle> send its generator to $x^2$ and $y^2$. Thicken the bands slightly so their overlap is an annular neighbourhood of their common boundary. <Seifert-van Kampen theorem> then gives
$$
\boxed{\pi_1(K)=\langle x,y\mid x^2=y^2\rangle}.
$$
Reversing a chosen generator absorbs an opposite boundary parametrization, so the presentation is independent of that sign choice.