Section Fn_vectors.
From Algebra Require Field_facts.
Export Sets Categories Parts Sgroup_cat Monoid_cat Group_cat Abelian_group_cat Ring_cat.
Export Field_facts.
From Algebra Require Ring_facts.
Export Ring_facts.
From Algebra Require Export Field_cat.
Require Export vecspaces_verybasic.
Require Export finite.
(**************************************)
(* In the beginning there was the set *)
(**************************************)
Definition Fn_set (F : Setoid) (n : Nat) : SET := seq n F.
(******************************************)
(* And Coq said, "let there be an sgroup" *)
(******************************************)
Let Fn_plus_fun :
forall (F : sgroup) (n : Nat), Fn_set F n -> Fn_set F n -> Fn_set F n.
intros F n x y.
simpl in |- *.
apply (Build_Map (Ap:=fun i : fin n => x i +' y i)).
red in |- *.
elim x.
elim y.
intros.
red in Map_compatible_prf.
red in Map_compatible_prf0.
apply SGROUP_comp; auto with algebra.
Defined.
Definition Fn_plus :
forall (F : sgroup) (n : Nat), law_of_composition (Fn_set F n).
intros F n.
apply (uncurry (f:=Fn_plus_fun (F:=F) (n:=n))).
red in |- *.
simpl in |- *.
intros.
red in |- *.
intro i.
simpl in |- *.
apply SGROUP_comp; auto with algebra.
Defined.
red in |- *.
intros.
simpl in |- *.
red in |- *.
intro i.
simpl in |- *.
apply SGROUP_assoc.
Qed.
Definition Fn_sgroup (F : sgroup) (n : Nat) : SGROUP :=
Build_sgroup (Build_sgroup_on (Fn_plus_associative (F:=F) (n:=n))).
(*****************************************************)
(* And there was an sgroup, and Abel saw it was good *)
(*****************************************************)
red in |- *.
intros.
simpl in |- *.
red in |- *.
intro i.
simpl in |- *.
auto with algebra.
Qed.
Definition Fn_absgp (F : abelian_sgroup) (n : Nat) : ABELIAN_SGROUP :=
Build_abelian_sgroup
(Build_abelian_sgroup_on (A:=Fn_sgroup F n)
(Fn_plus_commutative (F:=F) (n:=n))).
(******************************************************)
(* It is a monoid, Jim, but... exactly as we know it. *)
(******************************************************)
Definition Fn_zero : forall (F : monoid) (n : Nat), Fn_sgroup F n.
intros F n.
apply (Build_Map (Ap:=fun i : fin n => zero F)).
red in |- *.
intros.
apply Refl.
Defined.
intros F n.
red in |- *.
intro.
simpl in |- *.
red in |- *.
intro i.
simpl in |- *.
apply MONOID_unit_r.
Qed.

Lemma Fn_zero_is_l_unit :
forall (F : monoid) (n : Nat),
unit_l (sgroup_law_map (Fn_sgroup F n)) (Fn_zero F n).