Skip to content

Commit 999a24b

Browse files
affeldt-aistQuentin Vermande
and
Quentin Vermande
authored
pseudometric alias (#1628)
* alias for pseudometric and factory for normed module --------- Co-authored-by: Quentin Vermande <quentin.vermande@ens.fr>
1 parent 6a6ada7 commit 999a24b

File tree

3 files changed

+94
-3
lines changed

3 files changed

+94
-3
lines changed

CHANGELOG_UNRELEASED.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,10 @@
5252
- in `lebesgue_integral_differentiation.v`:
5353
+ lemma `nicely_shrinking_fin_num`
5454

55+
- in `normed_module.v`:
56+
+ definition `pseudoMetric_normed`
57+
+ factory `Lmodule_isNormed`
58+
5559
### Changed
5660

5761
- in `convex.v`:

theories/normedtype_theory/normed_module.v

Lines changed: 89 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ From mathcomp Require Import all_ssreflect ssralg ssrint ssrnum finmap matrix.
44
From mathcomp Require Import rat interval zmodp vector fieldext falgebra.
55
From mathcomp Require Import archimedean.
66
From 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.
88
From mathcomp Require Import interval_inference ereal reals topology.
99
From mathcomp Require Import function_spaces real_interval.
1010
From 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.
223230
End numFieldNormedType.
224231
Import 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+
226314
Lemma scaler1 {R : numFieldType} h : h%:A = h :> R.
227315
Proof. by rewrite /GRing.scale/= mulr1. Qed.
228316

theories/topology_theory/bool_topology.v

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@ From mathcomp Require Import discrete_topology.
77

88
(**md**************************************************************************)
99
(* # Topology for boolean numbers *)
10-
(* pseudoMetric_bool == an alias for bool equipped with the *)
11-
(* discrete pseudometric *)
10+
(* This file equips bool with the discrete pseudometric. *)
1211
(******************************************************************************)
1312

1413
Import Order.TTheory GRing.Theory Num.Theory.

0 commit comments

Comments
 (0)