# Free group equivalent definition

I am trying to prove that group P is free if and only if it satisfies the following:

for any groups $A,B$, any homomorphism $\pi: P \rightarrow B$ and any epimorphism $\alpha: A \rightarrow B$ there exists homomorphism $\phi: P \rightarrow A$ that $\alpha \phi=\pi$.

I have proven that any free group satisfies that but I can't prove another inclusion.

-
Just got an idea straight after posting: should I use $P$ as $B$ and a free group $F$ as $A$? –  grozhd Apr 22 '12 at 21:41
What do you mean by "another inclusion"? What do you want to prove? –  Matt N. Apr 22 '12 at 21:43
@grozhd: use your idea ($P=B$ and $F=A$) plus the fact that any subgroup of a free group is free –  user8268 Apr 22 '12 at 21:54
Let $P$ be a group with the property you mention. (I think this means $P$ is a projective object in the category $\mathsf{Grp}$) There exists a free group $F$ with a surjection $\alpha:F \rightarrow P$. Now take $\pi = \text{id}_P : P \rightarrow P$. Then by the assumed property there exists a homomorphism $\phi:P \rightarrow F$ such that $\alpha \phi = \text{id}_P$. Hence we can identify $P$ with a subgroup of $F$. Since subgroups of free groups are free, we are done.
Let $\alpha:F\to P$ be any surjection of a free group $F$ onto the group $P$. Then, taking $\pi:P\to P$ to be the identity map you get a group map $\phi:P\to F$ such that $\alpha\circ\phi=1_P$. This tells you that $\phi$ has a left inverse and thus is injective. Thus, $P$ is isomorphic to $\phi(P)$ which, being the subgroup of a free group, is free.