(** * Modules *)
Module ModuleSpace.
Record mixin_of (K : Ring) (V : AbelianGroup) := Mixin {
scal : K -> V -> V ;
ax1 : forall x y u, scal x (scal y u) = scal (mult x y) u ;
ax2 : forall u, scal one u = u ;
ax3 : forall x u v, scal x (plus u v) = plus (scal x u) (scal x v) ;
ax4 : forall x y u, scal (plus x y) u = plus (scal x u) (scal y u)
}.
Section ClassDef.
Variable K : Ring.
Record class_of (V : Type) := Class {
base : AbelianGroup.class_of V ;
mixin : mixin_of K (AbelianGroup.Pack _ base V)
}.
Local Coercion base : class_of >-> AbelianGroup.class_of.
Structure type := Pack { sort; _ : class_of sort ; _ : Type }.
Local Coercion sort : type >-> Sortclass.
Variable cT : type.
Definition class := let: Pack _ c _ := cT return class_of cT in c.
Let xT := let: Pack T _ _ := cT in T.
Notation xclass := (class : class_of xT).
Definition AbelianGroup := AbelianGroup.Pack cT xclass xT.
End ClassDef.
Module Exports.
Coercion base : class_of >-> AbelianGroup.class_of.
Coercion mixin : class_of >-> mixin_of.
Coercion sort : type >-> Sortclass.
Coercion AbelianGroup : type >-> AbelianGroup.type.
Canonical AbelianGroup.
Notation ModuleSpace := type.
End Exports.
End ModuleSpace.
Export ModuleSpace.Exports.
Section ModuleSpace1.
Context {K : Ring} {V : ModuleSpace K}.
Definition scal : K -> V -> V := ModuleSpace.scal _ _ (ModuleSpace.class K V).

(* Specifications: *)
Lemma scal_assoc :
forall (x y : K) (u : V),
scal x (scal y u) = scal (mult x y) u.
Lemma scal_one :
forall (u : V), scal one u = u.
Lemma scal_distr_l :
forall (x : K) (u v : V),
scal x (plus u v) = plus (scal x u) (scal x v).
Lemma scal_distr_r :
forall (x y : K) (u : V),
scal (plus x y) u = plus (scal x u) (scal y u).
Lemma scal_zero_r :
forall x : K,
scal x zero = zero.
Lemma scal_zero_l :
forall u : V,
scal zero u = zero.
Lemma scal_opp_l :
forall (x : K) (u : V),
scal (opp x) u = opp (scal x u).
Lemma scal_opp_r :
forall (x : K) (u : V),
scal x (opp u) = opp (scal x u).
Lemma scal_opp_one :
forall u : V,
scal (opp one) u = opp u.
Lemma scal_minus_distr_l (x : K) (u v : V) :
scal x (minus u v) = minus (scal x u) (scal x v).
Lemma scal_minus_distr_r (x y : K) (u : V) :
scal (minus x y) u = minus (scal x u) (scal y u).
Lemma sum_n_m_scal_l :
forall (a : K) (u : nat -> V) (n m : nat),
sum_n_m (fun k => scal a (u k)) n m = scal a (sum_n_m u n m).
Lemma sum_n_scal_l :
forall (a : K) (u : nat -> V) (n : nat),
sum_n (fun k => scal a (u k)) n = scal a (sum_n u n).