Isomorphism between groups with same presentation So say I have two groups $G$ and $H$. We let $G = \langle X \mid R\rangle$ and $H = \langle Y \mid R'\rangle$ where $|X| = |Y|$ and $R$ and $R'$ are the "same" relations. (For example if $(ab)^c = e$ is a relation in $R$ then there is the same relation in $R'$ aka there exists a relation $(a'b')^{c'} = e$.)

It seems that we should be able to define a simple isomorphism between $G$ and $H$ where each generator in $X$ gets sent to the appropriate generator in $Y$ such that all relations match up. I've been told that this map only gives us surjection which seems confusing as theoretically it should be inversable and thus be an isomorphism.

My question: Is it true that we only have a surjection in the case of a map

$$ \phi \colon G \rightarrow H$$

or can we actually show an isomorphism by identifying the appropriate generators together? If we don't have isomorphism, why is that?
If you define a map $G \to H$ with $\phi(a) = a'$  then it is clearly an isomorphism. Indeed if a combination of elements of $X$ belongs to $\ker f$ then   its image has to be identity in $H$.
If you define a map $G \to H$ with $\phi(a) = a'$  then it is clearly an isomorphism. Indeed if a combination of elements of $X$ belongs to $\ker f$ then   its image has to be identity in $H$.