Universal property for a subgroup (or a suboject) generated by a subset I found a small paragraph in "An Invitation to General Algebra and Universal Constructions" (UTX 2015), George M. Bergman, 4.1 p.46 where this is mentionned. I want a proof that the following characterizations are equivalent, and make sure that they can be defined with the same level of generality.
Let $S \subseteq G$ be a subset of a group $G$. 


*

*The generated subgroup $\langle S \rangle$ is a group contained in every subgroup $A$ containing $S$:
                     


*Writting the universal property for the freely generated group on $S$ (denoted $F(S)$) for the inclusion map $i: S \hookrightarrow G$, one obtains a map $u_i: F(S) \to G$.
                            

$\langle S \rangle$ is then the image of $u_i$.
I was also wondering if one could (equivalently) characterize $\langle S \rangle$ by
                         
However I see that there may be a Problem showing the unicity of such an $\langle S \rangle$ as it does not seem obvious to me that there exists a map from $G \to \langle S \rangle$ (which I would use in a proof by absurd, taking $H := \langle \tilde{S} \rangle$...). Indeed here the inclusion monomorphism $i: S \to G$ is a morphism in Sets and thus it is only left invertible in Sets.
 A: First $1)$ implies $2)$: 
By definition $F(S)$ is a group satisfying $Hom_{Groups}(F(S), G) \cong Hom_{Sets}(S, G)$. Hence given the inclusion $S \to G$ we get a unique group homomorphism $F(S) \to G$ making the obvious diagram commute. 
Clearly, the image of $F(S)$ is contained in every subgroup containing $S$, so in particular the image of $F(S)$ is contained in $\langle S \rangle$. But $\langle S \rangle$ is contained, by definition, in every subgroup of $G$ containing $S$, and so in particular it's contained in the image of $F(S)$. Hence $F(S)= \langle S \rangle$. 
For the other direction, note that a group homomorphism $F(S) \to G$ is in particular a hom $F(S) \to A$ for any subgroup $A$ in $G$ containing $S$, again by the universal property of $F(S)$. 
As for the third condition, I don't think this characterizes $\langle S \rangle$. It could be that for every map $G \to H$ sending $S$ to some set, there could be two distinct morphisms $\langle S \rangle \to H$ sending $S$ to the same place. This is simply the statement that not all maps from subgroups $A \to H$ extend uniquely to maps $G \to H$.
