@@ -61,8 +61,6 @@ From mathcomp Require Import tvs num_normedtype.
6161(* *)
6262(***************************************************************************** *)
6363
64- Reserved Notation "x ^'+" (at level 3, left associativity, format "x ^'+").
65- Reserved Notation "x ^'-" (at level 3, left associativity, format "x ^'-").
6664Reserved Notation "[ 'bounded' E | x 'in ' A ]"
6765 (at level 0, x name, format "[ 'bounded' E | x 'in ' A ]").
6866
@@ -99,97 +97,6 @@ End Shift.
9997Arguments shift {R} x / y.
10098Notation center c := (shift (- c)).
10199
102- Section at_left_right.
103- Variable R : numFieldType.
104-
105- Definition at_left (x : R) := within (fun u => u < x) (nbhs x).
106- Definition at_right (x : R) := within (fun u => x < u) (nbhs x).
107- Local Notation "x ^'-" := (at_left x) : classical_set_scope.
108- Local Notation "x ^'+" := (at_right x) : classical_set_scope.
109-
110- Global Instance at_right_proper_filter (x : R) : ProperFilter x^'+.
111- Proof .
112- apply: Build_ProperFilter => -[_/posnumP[d] /(_ (x + d%:num / 2))].
113- apply; last by rewrite ltrDl.
114- by rewrite /= opprD addNKr normrN ger0_norm// gtr_pMr// invf_lt1// ltr1n.
115- Qed .
116-
117- Global Instance at_left_proper_filter (x : R) : ProperFilter x^'-.
118- Proof .
119- apply: Build_ProperFilter => -[_ /posnumP[d] /(_ (x - d%:num / 2))].
120- apply; last by rewrite gtrBl.
121- by rewrite /= opprB addrC subrK ger0_norm// gtr_pMr// invf_lt1// ltr1n.
122- Qed .
123-
124- Lemma nbhs_right_gt x : \forall y \near x^'+, x < y.
125- Proof . by rewrite near_withinE; apply: nearW. Qed .
126-
127- Lemma nbhs_left_lt x : \forall y \near x^'-, y < x.
128- Proof . by rewrite near_withinE; apply: nearW. Qed .
129-
130- Lemma nbhs_right_neq x : \forall y \near x^'+, y != x.
131- Proof . by rewrite near_withinE; apply: nearW => ? /gt_eqF->. Qed .
132-
133- Lemma nbhs_left_neq x : \forall y \near x^'-, y != x.
134- Proof . by rewrite near_withinE; apply: nearW => ? /lt_eqF->. Qed .
135-
136- Lemma nbhs_right_ge x : \forall y \near x^'+, x <= y.
137- Proof . by rewrite near_withinE; apply: nearW; apply/ltW. Qed .
138-
139- Lemma nbhs_left_le x : \forall y \near x^'-, y <= x.
140- Proof . by rewrite near_withinE; apply: nearW => ?; apply/ltW. Qed .
141-
142- Lemma nbhs_right_lt x z : x < z -> \forall y \near x^'+, y < z.
143- Proof .
144- move=> xz; exists (z - x) => //=; first by rewrite subr_gt0.
145- by move=> y /= + xy; rewrite distrC ?ger0_norm ?subr_ge0 1?ltW// ltrD2r.
146- Qed .
147-
148- Lemma nbhs_right_ltW x z : x < z -> \forall y \near nbhs x^'+, y <= z.
149- Proof .
150- by move=> xz; near=> y; apply/ltW; near: y; exact: nbhs_right_lt.
151- Unshelve. all: by end_near. Qed .
152-
153- Lemma nbhs_right_ltDr x e : 0 < e -> \forall y \near x ^'+, y - x < e.
154- Proof .
155- move=> e0; near=> y; rewrite ltrBlDr; near: y.
156- by apply: nbhs_right_lt; rewrite ltrDr.
157- Unshelve. all: by end_near. Qed .
158-
159- Lemma nbhs_right_le x z : x < z -> \forall y \near x^'+, y <= z.
160- Proof . by move=> xz; near do apply/ltW; apply: nbhs_right_lt.
161- Unshelve. all: by end_near. Qed .
162-
163- (* NB: In not_near_at_rightP (and not_near_at_rightP), R has type numFieldType.
164- It is possible realDomainType could make the proof simpler and at least as
165- useful. *)
166- Lemma not_near_at_rightP (p : R) (P : pred R) :
167- ~ (\forall x \near p^'+, P x) <->
168- forall e : {posnum R}, exists2 x, p < x < p + e%:num & ~ P x.
169- Proof .
170- split=> [pPf e|ex_notPx].
171- - apply: contrapT => /forallPNP peP; apply: pPf; near=> t.
172- apply: contrapT; apply: peP; apply/andP; split.
173- + by near: t; exact: nbhs_right_gt.
174- + by near: t; apply: nbhs_right_lt; rewrite ltrDl.
175- - rewrite /at_right near_withinE nearE.
176- rewrite -filter_from_ballE /filter_from/= -forallPNP => _ /posnumP[d].
177- have [x /andP[px xpd] notPx] := ex_notPx d; rewrite -existsNP; exists x => /=.
178- apply: contra_not notPx; apply => //.
179- by rewrite /ball/= ltr0_norm ?subr_lt0// opprB ltrBlDl.
180- Unshelve. all: by end_near. Qed .
181-
182- End at_left_right.
183- #[global] Typeclasses Opaque at_left at_right.
184- Notation "x ^'-" := (at_left x) : classical_set_scope.
185- Notation "x ^'+" := (at_right x) : classical_set_scope.
186-
187- #[global] Hint Extern 0 (Filter (nbhs _^'+)) =>
188- (apply: at_right_proper_filter) : typeclass_instances.
189-
190- #[global] Hint Extern 0 (Filter (nbhs _^'-)) =>
191- (apply: at_left_proper_filter) : typeclass_instances.
192-
193100Section at_left_right_topologicalType.
194101Variables (R : numFieldType) (V : topologicalType) (f : R -> V) (x : R).
195102
@@ -227,6 +134,25 @@ HB.structure Definition PseudoMetricNormedZmod (R : numDomainType) :=
227134 {T of Num.NormedZmodule R T & PseudoMetric R T
228135 & NormedZmod_PseudoMetric_eq R T & isPointed T}.
229136
137+ (* alternative definition of a PseudoMetricNormedZmod *)
138+ HB.factory Record NormedZmoduleMetric (R : numDomainType) T
139+ of Num.NormedZmodule R T & Metric R T & isPointed T := {
140+ mdist_norm : forall x y : T, mdist x y = `|y - x|
141+ }.
142+
143+ HB.builders Context (R : numDomainType) T of NormedZmoduleMetric R T.
144+
145+ Let pseudo_metric_ball_norm : ball = ball_ (fun x : T => `| x |).
146+ Proof .
147+ apply/funext => /= t; apply/funext => d; rewrite ballEmdist.
148+ by apply/seteqP; split => [y|y]/=; rewrite mdist_norm distrC.
149+ Qed .
150+
151+ HB.instance Definition _ :=
152+ NormedZmod_PseudoMetric_eq.Build R T pseudo_metric_ball_norm.
153+
154+ HB.end .
155+
230156Section pseudoMetricNormedZmod_numDomainType.
231157Context {K : numDomainType} {V : pseudoMetricNormedZmodType K}.
232158
0 commit comments