Section Function_spaces.
Definition func_set (A B : Setoid) := MAP A B.
Let func_plus_fun :
forall (A : Setoid) (B : sgroup),
func_set A B -> func_set A B -> func_set A B.
intros A B f g.
simpl in |- *.
simpl in f.
simpl in g.
apply (Build_Map (A:=A) (B:=B) (Ap:=fun a : A => Ap f a +' Ap g a)).
red in |- *.
intros a a' Ha.
apply SGROUP_comp; auto with algebra.
Defined.
Definition func_plus :
forall (A : Setoid) (B : sgroup), law_of_composition (func_set A B).
intros.
simpl in |- *.
apply Map2_Mapcart.
apply (Build_Map2 (Ap2:=func_plus_fun (A:=A) (B:=B))).
red in |- *.
intros f f' g g' Hf Hg.
unfold func_plus_fun in |- *.
simpl in |- *.
red in |- *.
intro a.
simpl in |- *.
apply SGROUP_comp; auto with algebra.
Defined.
intros.
red in |- *.
intros f g h.
unfold func_plus in |- *.
simpl in |- *.
red in |- *.
intro a.
unfold func_plus_fun in |- *.
simpl in |- *.
apply SGROUP_assoc.
Qed.
Definition func_sgroup (A : Setoid) (B : sgroup) : SGROUP :=
Build_sgroup (Build_sgroup_on (func_plus_associative (A:=A) (B:=B))).

Lemma func_plus_commutative :
forall (A : Setoid) (B : abelian_sgroup), commutative (func_plus A B).