End ModuleSpace1.
(** Rings are modules *)
Section Ring_ModuleSpace.
Variable (K : Ring).
Definition Ring_ModuleSpace_mixin :=
ModuleSpace.Mixin K _ _ mult_assoc mult_one_l mult_distr_l mult_distr_r.
Canonical Ring_ModuleSpace :=
ModuleSpace.Pack K K (ModuleSpace.Class _ _ _ Ring_ModuleSpace_mixin) K.
End Ring_ModuleSpace.
Section AbsRing_ModuleSpace.
Variable (K : AbsRing).
Definition AbsRing_ModuleSpace_mixin :=
ModuleSpace.Mixin K _ _ mult_assoc mult_one_l mult_distr_l mult_distr_r.
Canonical AbsRing_ModuleSpace :=
ModuleSpace.Pack K K (ModuleSpace.Class _ _ _ AbsRing_ModuleSpace_mixin) K.
End AbsRing_ModuleSpace.
(** ** Modules with a norm *)
Module NormedModuleAux.
Section ClassDef.
Variable K : AbsRing.
Record class_of (T : Type) := Class {
base : ModuleSpace.class_of K T ;
mixin : UniformSpace.mixin_of T
}.
Local Coercion base : class_of >-> ModuleSpace.class_of.
Local Coercion mixin : class_of >-> UniformSpace.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.
Definition ModuleSpace := ModuleSpace.Pack _ cT xclass xT.
Definition UniformSpace := UniformSpace.Pack cT xclass xT.
End ClassDef.
Module Exports.
Coercion base : class_of >-> ModuleSpace.class_of.
Coercion mixin : class_of >-> UniformSpace.class_of.
Coercion sort : type >-> Sortclass.
Coercion AbelianGroup : type >-> AbelianGroup.type.
Canonical AbelianGroup.
Coercion ModuleSpace : type >-> ModuleSpace.type.
Canonical ModuleSpace.
Coercion UniformSpace : type >-> UniformSpace.type.
Canonical UniformSpace.
Notation NormedModuleAux := type.
End Exports.
End NormedModuleAux.
Export NormedModuleAux.Exports.
Module NormedModule.
Record mixin_of (K : AbsRing) (V : NormedModuleAux K) := Mixin {
norm : V -> R ;
norm_factor : R ;
ax1 : forall (x y : V), norm (plus x y) <= norm x + norm y ;
ax2 : forall (l : K) (x : V), norm (scal l x) <= abs l * norm x ;
ax3 : forall (x y : V) (eps : R), norm (minus y x) < eps -> ball x eps y ;
ax4 : forall (x y : V) (eps : posreal), ball x eps y -> norm (minus y x) < norm_factor * eps ;
ax5 : forall x : V, norm x = 0 -> x = zero
}.
Section ClassDef.
Variable K : AbsRing.
Record class_of (T : Type) := Class {
base : NormedModuleAux.class_of K T ;
mixin : mixin_of K (NormedModuleAux.Pack K T base T)
}.
Local Coercion base : class_of >-> NormedModuleAux.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.
Definition ModuleSpace := ModuleSpace.Pack _ cT xclass xT.
Definition UniformSpace := UniformSpace.Pack cT xclass xT.
Definition NormedModuleAux := NormedModuleAux.Pack _ cT xclass xT.
End ClassDef.
Module Exports.
Coercion base : class_of >-> NormedModuleAux.class_of.
Coercion mixin : class_of >-> mixin_of.
Coercion sort : type >-> Sortclass.
Coercion AbelianGroup : type >-> AbelianGroup.type.
Canonical AbelianGroup.
Coercion ModuleSpace : type >-> ModuleSpace.type.
Canonical ModuleSpace.
Coercion UniformSpace : type >-> UniformSpace.type.
Canonical UniformSpace.
Coercion NormedModuleAux : type >-> NormedModuleAux.type.
Canonical NormedModuleAux.
Notation NormedModule := type.
End Exports.
End NormedModule.
Export NormedModule.Exports.
Section NormedModule1.
Context {K : AbsRing} {V : NormedModule K}.
Definition norm : V -> R := NormedModule.norm K _ (NormedModule.class K V).
Definition norm_factor : R := NormedModule.norm_factor K _ (NormedModule.class K V).

Lemma norm_triangle_inv :
forall x y : V,
Rabs (norm x - norm y) <= norm (minus x y).