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.

Lemma func_plus_associative :
forall (A : Setoid) (B : sgroup), associative (func_plus A B).