intros.
apply Build_abelian_monoid_on.
apply Build_abelian_sgroup_on.
exact (func_plus_commutative (A:=A) (B:=B)).
Qed.
Definition func_abmon (A : Setoid) (B : abelian_monoid) : ABELIAN_MONOID :=
Build_abelian_monoid (func_monoid_is_abelian A B).
Let func_inv_fun :
forall (A : Setoid) (B : group), func_monoid A B -> func_monoid A B.
intros A B.
simpl in |- *.
intro v.
apply (Build_Map (Ap:=fun i : A => min v i)).
red in |- *.
intros i i' H.
apply GROUP_comp; auto with algebra.
Defined.
Definition func_inv :
forall (A : Setoid) (B : group), Map (func_monoid A B) (func_monoid A B).
intros.
apply (Build_Map (Ap:=func_inv_fun (A:=A) (B:=B))).
red in |- *.
intros.
simpl in |- *.
red in |- *.
intro i.
simpl in H.
red in H.
simpl in |- *.
apply GROUP_comp; auto with algebra.
Defined.

Lemma func_inv_is_r_inverse :
forall (A : Setoid) (B : group),
inverse_r (func_plus A B) (func_zerofun A B) (func_inv A B).