Skip to content

Commit 477481b

Browse files
committed
prove cvg_nbhsP for metric spaces
1 parent 2dae348 commit 477481b

File tree

7 files changed

+316
-135
lines changed

7 files changed

+316
-135
lines changed

_CoqProject

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ theories/topology_theory/one_point_compactification.v
6464
theories/topology_theory/sigT_topology.v
6565
theories/topology_theory/discrete_topology.v
6666
theories/topology_theory/separation_axioms.v
67+
theories/topology_theory/metric_structure.v
6768

6869
theories/homotopy_theory/homotopy.v
6970
theories/homotopy_theory/wedge_sigT.v

theories/Make

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ topology_theory/one_point_compactification.v
3131
topology_theory/sigT_topology.v
3232
topology_theory/discrete_topology.v
3333
topology_theory/separation_axioms.v
34+
topology_theory/metric_structure.v
3435

3536
homotopy_theory/homotopy.v
3637
homotopy_theory/wedge_sigT.v

theories/normedtype_theory/pseudometric_normed_Zmodule.v

Lines changed: 19 additions & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -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 ^'-").
6664
Reserved 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.
9997
Arguments shift {R} x / y.
10098
Notation 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-
193100
Section at_left_right_topologicalType.
194101
Variables (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+
230156
Section pseudoMetricNormedZmod_numDomainType.
231157
Context {K : numDomainType} {V : pseudoMetricNormedZmodType K}.
232158

theories/realfun.v

Lines changed: 2 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -236,36 +236,10 @@ apply: cvg_at_right_left_dnbhs.
236236
- by apply/cvg_at_leftP => u [pu ?]; apply: pfl; split => // n; rewrite lt_eqF.
237237
Unshelve. all: end_near. Qed.
238238

239+
#[deprecated(since="mathcomp-analysis 1.15.0", note="use `metricType_numDomainType.cvg_nbhsP` instead")]
239240
Lemma cvg_nbhsP f p l : f x @[x --> p] --> l <->
240241
(forall u : R^nat, (u n @[n --> \oo] --> p) -> f (u n) @[n --> \oo] --> l).
241-
Proof.
242-
split=> [/cvgrPdist_le /= fpl u /cvgrPdist_lt /= uyp|pfl].
243-
apply/cvgrPdist_le => e /fpl[d d0 pdf].
244-
by apply: filterS (uyp d d0) => t /pdf.
245-
apply: contrapT => fpl; move: pfl; apply/existsNP.
246-
suff: exists2 x : R ^nat,
247-
x n @[n --> \oo] --> p & ~ f (x n) @[n --> \oo] --> l.
248-
by move=> [x_] hp; exists x_; exact/not_implyP.
249-
have [e He] : exists e : {posnum R}, forall d : {posnum R},
250-
exists xn, `|xn - p| < d%:num /\ `|f xn - l| >= e%:num.
251-
apply: contrapT; apply: contra_not fpl => /forallNP h.
252-
apply/cvgrPdist_le => e e0; have /existsNP[d] := h (PosNum e0).
253-
move/forallNP => {}h; near=> t.
254-
have /not_andP[abs|/negP] := h t.
255-
- exfalso; apply: abs.
256-
by near: t; exists d%:num => //= z/=; rewrite distrC.
257-
- by rewrite -ltNge distrC => /ltW.
258-
have invn n : 0 < n.+1%:R^-1 :> R by rewrite invr_gt0.
259-
exists (fun n => sval (cid (He (PosNum (invn n))))).
260-
apply/cvgrPdist_lt => r r0; near=> t.
261-
rewrite /sval/=; case: cid => x [xpt _].
262-
rewrite distrC (lt_le_trans xpt)// -[leRHS]invrK lef_pV2 ?posrE ?invr_gt0//.
263-
near: t; exists (truncn r^-1) => // s /= rs.
264-
by rewrite (le_trans (ltW (truncnS_gt _)))// ler_nat.
265-
move=> /cvgrPdist_lt/(_ e%:num (ltac:(by [])))[] n _ /(_ _ (leqnn _)).
266-
rewrite /sval/=; case: cid => // x [px xpn].
267-
by rewrite ltNge distrC => /negP.
268-
Unshelve. all: end_near. Qed.
242+
Proof. exact: @metricType_numDomainType.cvg_nbhsP _ R^o f p l. Qed.
269243

270244
End cvgr_fun_cvg_seq.
271245

0 commit comments

Comments
 (0)