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))).
intros.
red in |- *.
intros f f'.
unfold func_plus in |- *.
simpl in |- *.
red in |- *.
intro a.
unfold func_plus_fun in |- *.
simpl in |- *.
apply ABELIAN_SGROUP_com.
Qed.
Definition func_absgp (A : Setoid) (B : abelian_sgroup) : ABELIAN_SGROUP :=
Build_abelian_sgroup
(Build_abelian_sgroup_on (A:=func_sgroup A B)
(func_plus_commutative (A:=A) (B:=B))).
Definition func_zerofun : forall (A : Setoid) (B : monoid), func_set A B.
intros.
apply (Build_Map (Ap:=fun a : A => zero B)).
red in |- *.
intros.
apply Refl.
Defined.
intros A B.
red in |- *.
intro.
simpl in |- *.
red in |- *.
intro i.
simpl in |- *.
apply MONOID_unit_r.
Qed.
intros A B.
red in |- *.
intro.
simpl in |- *.
red in |- *.
intro i.
simpl in |- *.
apply MONOID_unit_l.
Qed.
Definition func_monoid (A : Setoid) (B : monoid) : MONOID :=
Build_monoid
(Build_monoid_on (A:=func_sgroup A B) (monoid_unit:=
func_zerofun A B) (func_zerofun_is_r_unit (A:=A) (B:=B))
(func_zerofun_is_l_unit (A:=A) (B:=B))).
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).