split; [ try assumption | idtac ].
exact eqFG_refl.
red in |- *.
split; [ try assumption | idtac ].
exact eqFG_trans.
exact eqFG_sym.
Qed.
Definition FG_set := Build_Setoid eqFG_Equiv.
Definition FreeGroup : GROUP.
apply (BUILD_GROUP (E:=FG_set) (genlaw:=Law) (e:=Unit) (geninv:=Inv)).
exact eqFG_law.
exact eqFG_law_assoc.
exact eqFG_law0r.
exact eqFG_inv.
exact eqFG_invr.
Defined.
Section Universal_prop.
Variable G : GROUP.
Variable f : Hom V G.
Fixpoint FG_lift_fun (p : FreeGroup) : G :=
match p with
| Var v => f v
| Law p1 p2 => sgroup_law _ (FG_lift_fun p1) (FG_lift_fun p2)
| Unit => monoid_unit G
| Inv p1 => group_inverse G (FG_lift_fun p1)
end.
Definition FG_lift : Hom FreeGroup G.
apply (BUILD_HOM_GROUP (G:=FreeGroup) (G':=G) (ff:=FG_lift_fun)).
intros x y H'; try assumption.
elim H'; simpl in |- *; auto with algebra.
intros x0 y0 z H'0 H'1 H'2 H'3; try assumption.
apply Trans with (FG_lift_fun y0); auto with algebra.
simpl in |- *; auto with algebra.
simpl in |- *; auto with algebra.
Defined.
Definition FG_var : Hom V FreeGroup.
apply (Build_Map (A:=V) (B:=FreeGroup) (Ap:=Var)).
red in |- *.
simpl in |- *; auto with algebra.
Defined.

Lemma FG_comp_prop :
Equal f (comp_hom (FG_lift:Hom (FreeGroup:SET) G) FG_var).