Injectivity of certain homomorphisms on free groups Consider free groups $F(A)$ and $F(B)$ on finite generating sets $A,B$. Write $A$ and $B$ as the disjoint unions $A=A_1\sqcup A_2$ and $B=B_1\sqcup B_2$. We consider the free groups $F(A_i)$ and $F(B_i)$ naturally as subgroups of $F(A)$ and $F(B)$ respectively. Suppose $f:F(A)\to F(B)$ is a group homomorphism such that

*

*$f(F(A_1))\subseteq F(B_1)$ and $f|_{F(A_1)}:F(A_1)\to F(B_1)$ is injective,

*if $p_2:F(B)\to F(B_2)$ is canonical the projection, then $p_2\circ f|_{F(A_2)}:F(A_2)\to F(B_2)$ is injective.

Must $f$ be injective?
The answer is certainly affirmative in some simple cases. However, in general, $f$ may map a generator $a\in A_2$ to a word in $F(B)$ having many letters from $B_1$ and so it is not immediately clear to me how to prove this using explicit word cancellations. It is possible I am missing something simple here or am just unaware of some free group theory that can address this question.
 A: This seems to be true and, like many facts about free groups, can be proved using Stallings' famous folding technique.  Here's a sketch of the argument.
Think of $F(B)$ as the fundamental group of a bouquet of circles $Y=Y_1\vee Y_2$, where $F(B_i)=\pi_1(Y_i)$. The map $f$ can now be realised as a morphism of graphs $\phi:X\to Y$, where $X$ also decomposes as a wedge $X_1\vee X_2$, with $F(A_i)=\pi_1(X_i)$. Since $f|_{F(A_i)}$ is injective for both $i$, the restriction of $\phi$ to each $X_i$ can be taken to be an immersion. The image $f(F(A))$ is the fundamental group of the graph $\overline{X}$ obtained by folding the map $\phi$. Since $\phi|_{X_1}$ is an immersion, $\phi$ embeds $X_1$ into $\overline{X}$, and we may therefore identify $X_1$ with its image in $\overline{X}$.
We now need to interpret hypothesis 2. Let $Z$ be the graph obtained by collapsing each edge in $\overline{X}$ that maps to $Y_1$, and let $\psi:Z\to Y_2$ be the map induced by $\phi$. The image of $p_2\circ f|_{F(A_2)}$ is identified with the fundamental group of $\overline{Z}$, the graph obtained by folding the map $\psi$.
The second hypothesis now tells us that $b_1(\overline{Z})=b_1(X_2)$, where $b_1$ denotes first Betti number, i.e. the rank of the fundamental group.
We can now conclude by estimating first Betti numbers. Since $\overline{Z}$ is obtained by folding $\psi$, we have
$b_1(X_2)=b_1(\overline{Z})\leq b_1(Z)$ .
Since $Z$ was obtained from $\overline{X}$ by collapsing a subgraph that contained $X_1$, we have
$b_1(Z) + b_1(X_1)\leq b_1(\overline{X})$,
and since $\overline{X}$ was obtained by folding $\phi$, we have
$b_1(\overline{X})\leq b_1(X)$ .
Putting these together gives
$b_1(X)=b_1(X_1)+b_1(X_2)\leq b_1(\overline{X})\leq b_1(X)$
so $b_1(\overline{X})= b_1(X)$. This tells us that the rank of the image of $f$ is equal to the rank of $F(A)$.  Since free groups are Hopfian, it follows that $f$ is injective, as required.
