Prove the existence and uniqueness of a group homomorphism

Let $G_1$, $G_2$ be arbitrary groups, and $H$ be any group with homomorphisms $\theta_1:G_1\rightarrow H$, $\theta_2:G_1\rightarrow H$. Show that there exist a group $G$ and homomorphisms $\beta_1:G_1\rightarrow G$, $\beta_2:G_2\rightarrow G$, and a unique homomorphism $\theta:G\rightarrow H$ such that $\beta_1\theta = \theta_1$ and $\beta_2\theta = \theta_2$.

Here is my work so far:

Basically I have shown the existence of two homomorphisms taking $G \rightarrow H$. But I'm struggling to prove uniqueness.

Let $X$ be the generating set of both $G_1$ and $G_2$. Let $F$ be the free group on $X$. Define $G:= F/(ker\pi_1 \cup ker\pi_2)^{F} = F/ker\pi_3$. Here $\pi_1$ and $\pi_2$ are induced homomorphisms from $F$ to $G_1$ and $G_2$, respectively.

By Von Dyck's theorem, there exist surjective homomorphisms $\beta_i:G_i \rightarrow G$ where $i\in\{1,2\}$, defined as $f\pi_i\beta_i = f\pi_3$.

Define $\theta'_i:G\rightarrow H$ as follows: $f\pi_3\theta'_i := f\pi_i\theta_i$. Then both $\theta'_1$ and $\theta'_2$ are homomorphisms.

Now in order to prove uniqueness of $\theta$, I must show $\theta'_1=\theta'_2$, and this is where I'm stuck.

• This is just the coproduct of groups $G_1\ast G_2$ for which there is an explicit definition – JJR May 10 '17 at 11:29
• But then we have $\beta_1:G \rightarrow G_1$ and $\beta_2:G \rightarrow G_2$ by Von Dyck's theorem, which is not what we wanted. – W.Scott May 10 '17 at 20:20
• I don't see how that applies to $G_1\ast G_2$ since there are more relations in $G_1\ast G_2$ than in e.g. $G_1$ – JJR May 10 '17 at 20:34
• By $G_1G_2$ did you mean $G_1G_2=\{g_1g_2 \mid g_1 \in G_1, g_2 \in G_2 \}$? – W.Scott May 10 '17 at 22:28
• No, $G_1\ast G_2$ is the coproduct or sometimes called the free product of two groups see en.wikipedia.org/wiki/Free_product – JJR May 10 '17 at 22:35

Let $G=\langle \theta_1G_1,\theta_2G_2\rangle$ be the subgroup of $H$ generated by the images of $\theta_{1,2}$. As $\theta_iG_i\le G$, we can let $\beta_i$ be the codomain-restricted $\theta_i$. Let $\theta\colon G\to H$ be the inclusion. Then clearly $\theta\circ \beta_i=\theta_i$. Assume $\theta'\colon G\to H$ is another homomorhims with $\theta'\circ \beta_i=\theta_i$. Then $\theta'(x)=\theta(x)$ for all $x\in\theta_{1,2}G_{1,2}$, i.e., on a set of generateors of $G$. We conclude that $\theta'=\theta$.
• This is wrong by construction since $G$ does not depend on $H$ and $\theta_i$ – JJR May 10 '17 at 12:59