split; [ try assumption | idtac ].
exact eqFaG_refl.
red in |- *.
split; [ try assumption | idtac ].
exact eqFaG_trans.
exact eqFaG_sym.
Qed.
Definition FaG_set := Build_Setoid eqFaG_Equiv.
Definition FreeAbelianGroup : ABELIAN_GROUP.
apply
(BUILD_ABELIAN_GROUP (E:=FaG_set) (genlaw:=Law) (e:=Unit) (geninv:=Inv)).
exact eqFaG_law.
exact eqFaG_law_assoc.
exact eqFaG_law0r.
exact eqFaG_inv.
exact eqFaG_invr.
exact eqFaG_com.
Defined.
Section Universal_prop.
Variable G : ABELIAN_GROUP.
Variable f : Hom V G.
Fixpoint FaG_lift_fun (p : FreeAbelianGroup) : G :=
match p with
| Var v => f v
| Law p1 p2 => sgroup_law _ (FaG_lift_fun p1) (FaG_lift_fun p2)
| Unit => monoid_unit G
| Inv p1 => group_inverse G (FaG_lift_fun p1)
end.
Definition FaG_lift : Hom FreeAbelianGroup G.
apply (BUILD_HOM_GROUP (G:=FreeAbelianGroup) (G':=G) (ff:=FaG_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 (FaG_lift_fun y0); auto with algebra.
simpl in |- *; auto with algebra.
simpl in |- *; auto with algebra.
Defined.
Definition FaG_var : Hom V FreeAbelianGroup.
apply (Build_Map (A:=V) (B:=FreeAbelianGroup) (Ap:=Var)).
red in |- *.
simpl in |- *; auto with algebra.
Defined.

Lemma FaG_comp_prop :
Equal f (comp_hom (FaG_lift:Hom (FreeAbelianGroup:SET) G) FaG_var).