@@ -4,7 +4,7 @@ From mathcomp Require Import all_ssreflect ssralg ssrint ssrnum finmap matrix.
44From mathcomp Require Import rat interval zmodp vector fieldext falgebra.
55From mathcomp Require Import archimedean.
66From mathcomp Require Import mathcomp_extra unstable boolp classical_sets.
7- From mathcomp Require Import functions cardinality set_interval.
7+ From mathcomp Require Import filter functions cardinality set_interval.
88From mathcomp Require Import interval_inference ereal reals topology.
99From mathcomp Require Import function_spaces real_interval.
1010From mathcomp Require Import prodnormedzmodule tvs num_normedtype.
@@ -26,6 +26,13 @@ From mathcomp Require Import ereal_normedtype pseudometric_normed_Zmodule.
2626(* We endow `numFieldType` with the types of norm-related notions (accessible *)
2727(* with `Import numFieldNormedType.Exports`). *)
2828(* *)
29+ (* ``` *)
30+ (* pseudoMetric_normed M == an alias for the pseudometric structure defined *)
31+ (* from a normed module *)
32+ (* M : normedZmodType K with K : numFieldType. *)
33+ (* Lmodule_isNormed M == factory for a normed module defined using *)
34+ (* an L-module M over R : numFieldType *)
35+ (* ``` *)
2936(* ## Hulls *)
3037(* ``` *)
3138(* Rhull A == the real interval hull of a set A *)
@@ -223,6 +230,87 @@ Module Exports. Export numFieldTopology.Exports. HB.reexport. End Exports.
223230End numFieldNormedType.
224231Import numFieldNormedType.Exports.
225232
233+ Definition pseudoMetric_normed (M : Type) : Type := M.
234+
235+ HB.instance Definition _ (K : numFieldType) (M : normedZmodType K) :=
236+ Choice.on (pseudoMetric_normed M).
237+ HB.instance Definition _ (K : numFieldType) (M : normedZmodType K) :=
238+ Num.NormedZmodule.on (pseudoMetric_normed M).
239+
240+ Module pseudoMetric_from_normedZmodType.
241+ Section pseudoMetric_from_normedZmodType.
242+ Variables (K : numFieldType) (M : normedZmodType K).
243+
244+ Notation T := (pseudoMetric_normed M).
245+
246+ Definition ball (x : T) (r : K) : set T := ball_ Num.norm x r.
247+
248+ Definition ent : set_system (T * T) := entourage_ ball.
249+
250+ Definition nbhs (x : T) : set_system T := nbhs_ ent x.
251+
252+ Lemma nbhsE : nbhs = nbhs_ ent. Proof . by []. Qed .
253+
254+ #[export] HB.instance Definition _ := hasNbhs.Build T nbhs.
255+
256+ Lemma ball_center x (e : K) : 0 < e -> ball x e x.
257+ Proof . by rewrite /ball/= subrr normr0. Qed .
258+
259+ Lemma ball_sym x y (e : K) : ball x e y -> ball y e x.
260+ Proof . by rewrite /ball /= distrC. Qed .
261+
262+ Lemma ball_triangle x y z e1 e2 : ball x e1 y -> ball y e2 z ->
263+ ball x (e1 + e2) z.
264+ Proof .
265+ rewrite /ball /= => ? ?.
266+ rewrite -[x](subrK y) -(addrA (x + _)).
267+ by rewrite (le_lt_trans (ler_normD _ _))// ltrD.
268+ Qed .
269+
270+ Lemma entourageE : ent = entourage_ ball.
271+ Proof . by []. Qed .
272+
273+ #[export] HB.instance Definition _ := @Nbhs_isPseudoMetric.Build K T
274+ ent nbhsE ball ball_center ball_sym ball_triangle entourageE.
275+
276+ End pseudoMetric_from_normedZmodType.
277+ Module Exports. HB.reexport. End Exports.
278+ End pseudoMetric_from_normedZmodType.
279+ Export pseudoMetric_from_normedZmodType.Exports.
280+
281+ HB.factory Record Lmodule_isNormed (R : numFieldType) M
282+ of GRing.Lmodule R M := {
283+ norm : M -> R;
284+ ler_normD : forall x y, norm (x + y) <= norm x + norm y ;
285+ normrZ : forall (l : R) (x : M), norm (l *: x) = `|l| * norm x ;
286+ normr0_eq0 : forall x : M, norm x = 0 -> x = 0
287+ }.
288+
289+ HB.builders Context R M of Lmodule_isNormed R M.
290+
291+ Lemma normrMn x n : norm (x *+ n) = norm x *+ n.
292+ Proof .
293+ have := normrZ n%:R x; rewrite ger0_norm// mulr_natl => <-.
294+ by rewrite scaler_nat.
295+ Qed .
296+
297+ Lemma normrN x : norm (- x) = norm x.
298+ Proof . by have := normrZ (- 1)%R x; rewrite scaleN1r normrN normr1 mul1r. Qed .
299+
300+ HB.instance Definition _ := Num.Zmodule_isNormed.Build
301+ R M ler_normD normr0_eq0 normrMn normrN.
302+
303+ HB.instance Definition _ := PseudoMetric.copy M (pseudoMetric_normed M).
304+
305+ HB.instance Definition _ := isPointed.Build M 0.
306+
307+ HB.instance Definition _ := NormedZmod_PseudoMetric_eq.Build R M erefl.
308+
309+ HB.instance Definition _ :=
310+ PseudoMetricNormedZmod_Lmodule_isNormedModule.Build R M normrZ.
311+
312+ HB.end .
313+
226314Lemma scaler1 {R : numFieldType} h : h%:A = h :> R.
227315Proof . by rewrite /GRing.scale/= mulr1. Qed .
228316
0 commit comments