Skip to content

Commit 2b54b70

Browse files
committed
fixes, changelog
1 parent 477481b commit 2b54b70

File tree

6 files changed

+71
-43
lines changed

6 files changed

+71
-43
lines changed

CHANGELOG_UNRELEASED.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,33 @@
77
- in `cardinality.v`:
88
+ lemma `infinite_setD`
99

10+
- new file `metric_structure.v`:
11+
+ mixin `isMetric`, structure `Metric`, type `metricType`
12+
* with fields `mdist`, `mdist_ge0`, `mdist_positivity`, `ballEmdist`
13+
+ lemmas `metric_sym`, `mdistxx`, `mdist_gt0`, `metric_triangle`,
14+
`metric_hausdorff`
15+
+ `R^o` declared to be an instance of `metricType`
16+
+ module `metricType_numDomainType`
17+
* lemmas `ball_mdistE`, `nbhs_nbhs_mdist`, `nbhs_mdistP`,
18+
`filter_from_mdist_nbhs`, `fcvgrPdist_lt`, `cvgrPdist_lt`,
19+
`cvgr_dist_lt`, `cvgr_dist_le`, `nbhsr0P`, `cvgrPdist_le`
20+
21+
- in `pseudometric_normed_Zmodule.v`:
22+
+ factory `NormedZmoduleMetric` with field `mdist_norm`
23+
1024
### Changed
1125

26+
- moved from `pseudometric_normed_Zmodule.v` to `num_topology.v`:
27+
+ notations `^'+`, `^'-`
28+
+ definitions `at_left`, `at_right`
29+
+ instances `at_right_proper_filter`, `at_left_proper_filter`
30+
+ lemmas `nbhs_right_gt`, `nbhs_left_lt`, `nbhs_right_neq`, `nbhs_left_neq`,
31+
`nbhs_left_neq`, `nbhs_left_le`, `nbhs_right_lt`, `nbhs_right_ltW`,
32+
`nbhs_right_ltDr`, `nbhs_right_le`, `not_near_at_rightP`
33+
34+
- moved from `realfun.v` to `metric_structure.v` and generalized:
35+
+ lemma `cvg_nbhsP`
36+
1237
### Renamed
1338

1439
### Generalized

theories/lebesgue_integral_theory/lebesgue_integral_under.v

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,13 +63,13 @@ have BZ_cf x : x \in B `\` Z -> continuous (f ^~ x).
6363
by rewrite inE/= => -[Bx nZx]; exact: ncfZ.
6464
have [vu|uv] := lerP v u.
6565
by move: Ia; rewrite /I set_itv_ge// -leNgt bnd_simp.
66-
apply/cvg_nbhsP => w wa.
66+
apply/(@cvg_nbhsP _ R^o) => w wa.
6767
have /near_in_itvoo[e /= e0 aeuv] : a \in `]u, v[ by rewrite inE.
6868
move/cvgrPdist_lt : (wa) => /(_ _ e0)[N _ aue].
6969
have IwnN n : I (w (n + N)) by apply: aeuv; apply: aue; exact: leq_addl.
7070
have : forall n, {ae mu, forall y, B y -> `|f (w (n + N)) y| <= g y}.
7171
by move=> n; exact: g_ub.
72-
move/choice => [/= U /all_and3[mU U0 Ug_ub]].
72+
move/choice => [/= U /all_and3[mU U0 Ug_ub]].
7373
have mUU n : measurable (\big[setU/set0]_(k < n) U k).
7474
exact: bigsetU_measurable.
7575
set UU := \bigcup_n U n.
@@ -114,7 +114,7 @@ apply: (@dominated_cvg _ _ _ mu _ _
114114
have : x \in B `\` Z.
115115
move: BZUUx; rewrite inE/= => -[Bx nZUUx]; rewrite inE/=; split => //.
116116
by apply: contra_not nZUUx; left.
117-
by move/(BZ_cf x)/(_ a)/cvg_nbhsP; apply; rewrite (cvg_shiftn N).
117+
by move/(BZ_cf x)/(_ a)/(@cvg_nbhsP _ R^o); apply; rewrite (cvg_shiftn N).
118118
- by apply: (integrableS mB) => //; exact: measurableD.
119119
- move=> n x [Bx ZUUx]; rewrite lee_fin.
120120
move/subsetCPl : (Ug_ub n); apply => //=.
@@ -125,7 +125,8 @@ End continuity_under_integral.
125125

126126
Section differentiation_under_integral.
127127

128-
Definition partial1of2 {R : realType} {T : Type} (f : R -> T -> R) : R -> T -> R := fun x y => (f ^~ y)^`() x.
128+
Definition partial1of2 {R : realType} {T : Type} (f : R -> T -> R) : R -> T -> R
129+
:= fun x y => (f ^~ y)^`() x.
129130

130131
Local Notation "'d1 f" := (partial1of2 f).
131132

theories/normedtype_theory/pseudometric_normed_Zmodule.v

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,11 @@ From mathcomp Require Import tvs num_normedtype.
3232
(* *)
3333
(* ## Normed topological abelian groups *)
3434
(* ``` *)
35-
(* pseudoMetricNormedZmodType R == interface type for a normed topological *)
36-
(* abelian group equipped with a norm *)
37-
(* The HB class is PseudoMetricNormedZmod. *)
35+
(* pseudoMetricNormedZmodType R == interface type for a normed topological *)
36+
(* abelian group equipped with a norm *)
37+
(* The HB class is PseudoMetricNormedZmod. *)
38+
(* NormedZmoduleMetric == factory for pseudoMetricNormedZmodType *)
39+
(* based on metric structures *)
3840
(* ``` *)
3941
(* *)
4042
(* ## Closed balls *)

theories/realfun.v

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -236,11 +236,6 @@ 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")]
240-
Lemma cvg_nbhsP f p l : f x @[x --> p] --> l <->
241-
(forall u : R^nat, (u n @[n --> \oo] --> p) -> f (u n) @[n --> \oo] --> l).
242-
Proof. exact: @metricType_numDomainType.cvg_nbhsP _ R^o f p l. Qed.
243-
244239
End cvgr_fun_cvg_seq.
245240

246241
Section cvge_fun_cvg_seq.

theories/topology_theory/metric_structure.v

Lines changed: 35 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,24 @@
11
(* mathcomp analysis (c) 2025 Inria and AIST. License: CeCILL-C. *)
22
From HB Require Import structures.
33
From mathcomp Require Import all_ssreflect ssralg ssrint ssrnum matrix.
4-
From mathcomp Require Import rat interval zmodp vector fieldext falgebra.
5-
From mathcomp Require Import archimedean finmap.
4+
From mathcomp Require Import interval_inference rat interval zmodp vector.
5+
From mathcomp Require Import fieldext falgebra archimedean finmap.
66
From mathcomp Require Import mathcomp_extra unstable boolp classical_sets.
7-
From mathcomp Require Import interval_inference reals topology_structure.
7+
From mathcomp Require Import contra reals topology_structure.
88
From mathcomp Require Import uniform_structure pseudometric_structure.
99
From mathcomp Require Import num_topology product_topology separation_axioms.
1010

11+
(**md**************************************************************************)
12+
(* # Metric spaces *)
13+
(* *)
14+
(* ``` *)
15+
(* metricType K == metric structure with distance mdist *)
16+
(* The mixin is defined by extending PseudoMetric. *)
17+
(* The HB class is Metric. *)
18+
(* R^o with R : numFieldType is shown to be a metric space. *)
19+
(* ``` *)
20+
(******************************************************************************)
21+
1122
Set Implicit Arguments.
1223
Unset Strict Implicit.
1324
Unset Printing Implicit Defensive.
@@ -67,9 +78,9 @@ Qed.
6778

6879
Lemma metric_hausdorff : hausdorff_space T.
6980
Proof.
70-
move=> p q pq; apply: contrapT => qp; move: pq.
81+
move=> p q pq; absurd_not => qp; move: pq.
7182
pose D := dist p q / 2; have D0 : 0 < D.
72-
by rewrite divr_gt0// mdist_gt0; exact/eqP.
83+
by rewrite divr_gt0// mdist_gt0.
7384
have p2Dq : ~ ball p (dist p q) q by rewrite ballEmdist/= ltxx.
7485
move=> /(_ (ball p _) (ball q _) (nbhsx_ballx _ _ D0) (nbhsx_ballx _ _ D0)).
7586
move/set0P/eqP; apply; rewrite -subset0 => x [pDx /ball_sym qDx].
@@ -93,22 +104,18 @@ Proof. by move/normr0_eq0/eqP; rewrite subr_eq0 => /eqP. Qed.
93104
Let ballEmdist x d : ball x d = [set y | dist x y < d].
94105
Proof. by apply/seteqP; split => [|]/= A; rewrite /ball/= distrC. Qed.
95106

96-
Fail Check R^o : metricType R.
97-
98107
HB.instance Definition _ :=
99108
@isMetric.Build R R^o dist dist_ge0 dist_positivity ballEmdist.
100109

101-
Check R^o : metricType R.
102-
103110
End numFieldType_metric.
104111

105112
Module metricType_numDomainType.
106113
(* tentative generalization of the section
107114
pseudoMetricNormedZmod_numDomainType
108-
from pseudoMetricNormedZmod_numDomainType
115+
from pseudoMetricNormedZmod
109116
to
110117
metricType *)
111-
Section tmp.
118+
Section metricType_numDomainType.
112119
Context {K : numDomainType} {V : metricType K}.
113120

114121
Local Notation ball_mdist := (fun x d => [set y : V | mdist x y < d]).
@@ -158,9 +165,9 @@ Proof.
158165
by move=> ? ? ?; near do rewrite ltW//; apply: cvgr_dist_lt.
159166
Unshelve. all: by end_near. Qed.
160167

161-
End tmp.
168+
End metricType_numDomainType.
162169

163-
Section tmp2.
170+
Section at_left_right_metricType.
164171
(* tentative generalization of the section
165172
at_left_right_pseudoMetricNormedZmod
166173
from
@@ -209,18 +216,21 @@ Lemma cvgrPdist_le {T} {F : set_system T} {FF : Filter F} (f : T -> V) (y : V) :
209216
f @ F --> y <-> forall eps, 0 < eps -> \forall t \near F, mdist y (f t) <= eps.
210217
Proof. exact: (cvgrP _ 0 1)%N. Qed.
211218

212-
End tmp2.
219+
End at_left_right_metricType.
213220

214-
Section tmp3.
221+
End metricType_numDomainType.
222+
223+
Section cvg_nbhsP.
215224
Variables (R : realType) (V : metricType R).
216225

226+
Import metricType_numDomainType.
227+
217228
Lemma cvg_nbhsP (f : V -> V) (p l : V) : f x @[x --> p] --> l <->
218229
(forall u : nat -> V, (u n @[n --> \oo] --> p) -> f (u n) @[n --> \oo] --> l).
219230
Proof.
220231
split=> [/cvgrPdist_le /= fpl u /cvgrPdist_lt /= uyp|pfl].
221232
apply/cvgrPdist_le => e /fpl.
222-
rewrite -filter_from_mdist_nbhs.
223-
move=> [d d0 pdf].
233+
rewrite -filter_from_mdist_nbhs => -[d d0 pdf].
224234
by apply: filterS (uyp d d0) => t /pdf.
225235
apply: contrapT => fpl; move: pfl; apply/existsNP.
226236
suff: exists2 x : nat -> V,
@@ -232,26 +242,21 @@ have [e He] : exists e : {posnum R}, forall d : {posnum R},
232242
apply/cvgrPdist_le => e e0; have /existsNP[d] := h (PosNum e0).
233243
move/forallNP => {}h; near=> t.
234244
have /not_andP[abs|/negP] := h t.
235-
- exfalso; apply: abs.
245+
- absurd: abs.
236246
near: t.
237-
rewrite !near_simpl.
238-
rewrite /prop_near1.
239-
rewrite -nbhs_nbhs_mdist.
240-
exists d%:num => //= z/=.
241-
by rewrite metric_sym.
247+
rewrite !near_simpl /prop_near1 -nbhs_nbhs_mdist.
248+
by exists d%:num => //= z/=; rewrite metric_sym.
242249
- by rewrite -ltNge metric_sym => /ltW.
243-
have invn n : 0 < n.+1%:R^-1 :> R by rewrite invr_gt0.
244-
exists (fun n => sval (cid (He (PosNum (invn n))))).
250+
exists (fun n => sval (cid (He n.+1%:R^-1%:pos))).
245251
apply/cvgrPdist_lt => r r0; near=> t.
246252
rewrite /sval/=; case: cid => x [xpt _].
247-
rewrite metric_sym (lt_le_trans xpt)// -[leRHS]invrK lef_pV2 ?posrE ?invr_gt0//.
248-
near: t; exists (trunc r^-1) => // s /= rs.
253+
rewrite metric_sym (lt_le_trans xpt)//.
254+
rewrite -[leRHS]invrK lef_pV2 ?posrE ?invr_gt0//.
255+
near: t; exists (truncn r^-1) => // s /= rs.
249256
by rewrite (le_trans (ltW (truncnS_gt _)))// ler_nat.
250257
move=> /cvgrPdist_lt/(_ e%:num (ltac:(by [])))[] n _ /(_ _ (leqnn _)).
251258
rewrite /sval/=; case: cid => // x [px xpn].
252259
by rewrite ltNge metric_sym => /negP.
253260
Unshelve. all: end_near. Qed.
254261

255-
End tmp3.
256-
257-
End metricType_numDomainType.
262+
End cvg_nbhsP.

theories/topology_theory/num_topology.v

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ Lemma nbhs_right_le x z : x < z -> \forall y \near x^'+, y <= z.
210210
Proof. by move=> xz; near do apply/ltW; apply: nbhs_right_lt.
211211
Unshelve. all: by end_near. Qed.
212212

213-
(* NB: In not_near_at_rightP (and not_near_at_rightP), R has type numFieldType.
213+
(* NB: In not_near_at_rightP, R has type numFieldType.
214214
It is possible realDomainType could make the proof simpler and at least as
215215
useful. *)
216216
Lemma not_near_at_rightP (p : R) (P : pred R) :

0 commit comments

Comments
 (0)