Skip to content

Commit c7c4824

Browse files
zstone1affeldt-aist
authored andcommitted
Countable products of metrics is metrizable (#763)
* proving sups preserve countable ent * proof going through * unused proofs * linting * metric implies countable uniformity * fixing changelog * linting * metric for products * linting * fixing docs * use %:pos * fixing changelog * fix changelog * nitpicking --------- Co-authored-by: Reynald Affeldt <[email protected]>
1 parent 050367e commit c7c4824

File tree

4 files changed

+130
-17
lines changed

4 files changed

+130
-17
lines changed

CHANGELOG_UNRELEASED.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,13 @@
6060
+ lemma `countable_bijP`
6161
+ lemma `patchE`
6262

63+
- in file `topology.v`,
64+
+ new definitions `countable_uniformity`, `countable_uniformityT`,
65+
`sup_pseudoMetric_mixin`, `sup_pseudoMetricType`, and
66+
`product_pseudoMetricType`.
67+
+ new lemmas `countable_uniformityP`, `countable_sup_ent`, and
68+
`countable_uniformity_metric`.
69+
6370
- in `constructive_ereal.v`:
6471
+ lemmas `adde_def_doppeD`, `adde_def_doppeB`
6572
+ lemma `fin_num_sume_distrr`

theories/lebesgue_measure.v

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -389,8 +389,7 @@ exists (fun k : nat => `] (- k%:R)%R, k%:R]%classic).
389389
apply/esym; rewrite -subTset => x _ /=; exists `|(floor `|x| + 1)%R|%N => //=.
390390
rewrite in_itv/= !natr_absz intr_norm intrD.
391391
suff: `|x| < `|(floor `|x|)%:~R + 1| by rewrite ltr_norml => /andP[-> /ltW->].
392-
rewrite [ltRHS]ger0_norm//; last by rewrite addr_ge0// ler0z floor_ge0.
393-
by rewrite (le_lt_trans _ (lt_succ_floor _)) ?ler_norm.
392+
by rewrite ger0_norm ?addr_ge0 ?ler0z ?floor_ge0// lt_succ_floor.
394393
by move=> k; split => //; rewrite hlength_itv/= -EFinB; case: ifP; rewrite ltry.
395394
Qed.
396395

theories/real_interval.v

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -175,10 +175,10 @@ Lemma itv_bnd_inftyEbigcup b x : [set` Interval (BSide b x) +oo%O] =
175175
Proof.
176176
rewrite predeqE => y; split=> /=; last first.
177177
by move=> [n _]/=; rewrite in_itv => /andP[xy yn]; rewrite in_itv /= xy.
178-
rewrite in_itv /= andbT => xy; exists (`|floor y|%N.+1) => //=.
179-
rewrite in_itv /= xy /= -natr1.
178+
rewrite in_itv /= andbT => xy; exists `|floor y|%N.+1 => //=.
179+
rewrite in_itv /= xy /=.
180180
have [y0|y0] := ltP 0 y; last by rewrite (le_lt_trans y0)// ltr_spaddr.
181-
by rewrite natr_absz ger0_norm ?lt_succ_floor// floor_ge0 ltW.
181+
by rewrite -natr1 natr_absz ger0_norm ?floor_ge0 1?ltW// lt_succ_floor.
182182
Qed.
183183

184184
Lemma itv_o_inftyEbigcup x :

theories/topology.v

Lines changed: 119 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,8 @@ Require Import reals signed.
286286
(* unif_continuous f <-> f is uniformly continuous. *)
287287
(* weak_uniformType == the uniform space for weak topologies *)
288288
(* sup_uniformType == the uniform space for sup topologies *)
289+
(* countable_uniformity T == T's entourage has a countable base. This *)
290+
(* is equivalent to `T` being metrizable *)
289291
(* *)
290292
(* * PseudoMetric spaces : *)
291293
(* entourage_ ball == entourages defined using balls *)
@@ -366,6 +368,7 @@ Require Import reals signed.
366368
(* *)
367369
(* We endow several standard types with the types of topological notions: *)
368370
(* - products: prod_topologicalType, prod_uniformType, prod_pseudoMetricType *)
371+
(* sup_pseudoMetricType, weak_pseudoMetricType, product_pseudoMetricType *)
369372
(* - matrices: matrix_filtered, matrix_topologicalType, matrix_uniformType, *)
370373
(* matrix_pseudoMetricType, matrix_completeType, *)
371374
(* matrix_completePseudoMetricType *)
@@ -2038,7 +2041,7 @@ HB.end.
20382041
(** ** Topology defined by a subbase of open sets *)
20392042

20402043
Definition finI_from (I : choiceType) T (D : set I) (f : I -> set T) :=
2041-
[set \bigcap_(i in [set i | i \in D']) f i |
2044+
[set \bigcap_(i in [set` D']) f i |
20422045
D' in [set A : {fset I} | {subset A <= D}]].
20432046

20442047
Lemma finI_from1 (I : choiceType) T (D : set I) (f : I -> set T) i :
@@ -3839,6 +3842,27 @@ rewrite !near_simpl near_withinE near_simpl => Pf; near=> y.
38393842
by have [->|] := eqVneq y x; [by apply: nbhs_singleton|near: y].
38403843
Unshelve. all: by end_near. Qed.
38413844

3845+
(* This property is primarily useful only for metrizability on uniform spaces *)
3846+
Definition countable_uniformity (T : uniformType) :=
3847+
exists R : set (set (T * T)), [/\
3848+
countable R,
3849+
R `<=` entourage &
3850+
forall P, entourage P -> exists2 Q, R Q & Q `<=` P].
3851+
3852+
Lemma countable_uniformityP {T : uniformType} :
3853+
countable_uniformity T <-> exists2 f : nat -> set (T * T),
3854+
(forall A, entourage A -> exists N, f N `<=` A) &
3855+
(forall n, entourage (f n)).
3856+
Proof.
3857+
split=> [[M []]|[f fsubE entf]].
3858+
move=> /pfcard_geP[-> _ /(_ _ entourageT)[]//|/unsquash f eM Msub].
3859+
exists f; last by move=> n; apply: eM; exact: funS.
3860+
by move=> ? /Msub [Q + ?] => /(@surj _ _ _ _ f)[n _ fQ]; exists n; rewrite fQ.
3861+
exists (range f); split; first exact: card_image_le.
3862+
by move=> E [n _] <-; exact: entf.
3863+
by move=> E /fsubE [n fnA]; exists (f n) => //; exists n.
3864+
Qed.
3865+
38423866
Section uniform_closeness.
38433867

38443868
Variable (U : uniformType).
@@ -4285,6 +4309,47 @@ Qed.
42854309
HB.instance Definition _ := @Nbhs_isUniform.Build Tt sup_ent
42864310
sup_ent_filter sup_ent_refl sup_ent_inv sup_ent_split sup_ent_nbhs.
42874311

4312+
Lemma countable_sup_ent :
4313+
countable [set: Ii] -> (forall n, countable_uniformity (TS n)) ->
4314+
countable_uniformity Tt.
4315+
Proof.
4316+
move=> Icnt countable_ent; pose f n := cid (countable_ent n).
4317+
pose g (n : Ii) : set (set (T * T)) := projT1 (f n).
4318+
have [I0 | /set0P [i0 _]] := eqVneq [set: I] set0.
4319+
exists [set setT]; split; [exact: countable1|move=> A ->; exact: entourageT|].
4320+
move=> P [w [A _]] <- subP; exists setT => //.
4321+
apply: subset_trans subP; apply: sub_bigcap => i _ ? _.
4322+
by suff : [set: I] (projT1 i).1 by rewrite I0.
4323+
exists (finI_from (\bigcup_n g n) id); split.
4324+
- by apply/finI_from_countable/bigcup_countable => //i _; case: (projT2 (f i)).
4325+
- move=> E [A AsubGn AE]; exists E => //.
4326+
have h (w : set (T * T)) : { p : IEnt | w \in A -> w = (projT1 p).2 }.
4327+
apply cid; have [|] := boolP (w \in A); last first.
4328+
by exists (exist ent_of _ (IEnt_pointT i0)).
4329+
move=> /[dup] /AsubGn /set_mem [n _ gnw] wA.
4330+
suff ent : ent_of (n, w) by exists (exist ent_of (n, w) ent).
4331+
by apply/asboolP; have [_ + _] := projT2 (f n); exact.
4332+
exists [fset sval (h w) | w in A]%fset; first by move=> ?; exact: in_setT.
4333+
rewrite -AE; rewrite eqEsubset; split => t Ia.
4334+
by move=> w Aw; rewrite (svalP (h w) Aw); apply/Ia/imfsetP; exists w.
4335+
case=> [[n w]] p /imfsetP [x /= xA M]; apply: Ia.
4336+
by rewrite (_ : w = x) // (svalP (h x) xA) -M.
4337+
- move=> E [w] [ A _ wIA wsubE].
4338+
have ent_Ip (i : IEnt) : @entourage (TS (projT1 i).1) (projT1 i).2.
4339+
by apply/asboolP; exact: (projT2 i).
4340+
pose h (i : IEnt) : {x : set (T * T) | _} := cid2 (and3_rec
4341+
(fun _ _ P => P) (projT2 (f (projT1 i).1)) (projT1 i).2 (ent_Ip i)).
4342+
have ehi (i : IEnt) : ent_of ((projT1 i).1, projT1 (h i)).
4343+
apply/asboolP => /=; have [] := projT2 (h i).
4344+
by have [_ + _ ? ?] := projT2 (f (projT1 i).1); exact.
4345+
pose AH := [fset projT1 (h w) | w in A]%fset.
4346+
exists (\bigcap_(i in [set` AH]) i).
4347+
exists AH => // p /imfsetP [i iA ->]; rewrite inE //.
4348+
by exists (projT1 i).1 => //; have [] := projT2 (h i).
4349+
apply: subset_trans wsubE; rewrite -wIA => ? It i ?.
4350+
by have [?] := projT2 (h i); apply; apply: It; apply/imfsetP; exists i.
4351+
Qed.
4352+
42884353
End sup_uniform.
42894354

42904355
HB.instance Definition _ (I : Type) (T : I -> uniformType) :=
@@ -4573,6 +4638,18 @@ by rewrite /unif_continuous -!entourage_ballE filter_fromP.
45734638
Qed.
45744639
End entourages.
45754640

4641+
Lemma countable_uniformity_metric {R : realType} {T : pseudoMetricType R} :
4642+
countable_uniformity T.
4643+
Proof.
4644+
apply/countable_uniformityP.
4645+
exists (fun n => [set xy : T * T | ball xy.1 n.+1%:R^-1 xy.2]); last first.
4646+
by move=> n; exact: (entourage_ball _ n.+1%:R^-1%:pos).
4647+
move=> E; rewrite -entourage_ballE => -[e e0 subE].
4648+
exists `|floor e^-1|%N; apply: subset_trans subE => xy; apply: le_ball.
4649+
rewrite /= -[leRHS]invrK lef_pinv ?posrE ?invr_gt0// -natr1.
4650+
by rewrite natr_absz ger0_norm ?floor_ge0 ?invr_ge0// 1?ltW// lt_succ_floor.
4651+
Qed.
4652+
45764653
(** ** Specific pseudoMetric spaces *)
45774654

45784655
(** matrices *)
@@ -5388,11 +5465,17 @@ End weak_pseudoMetric.
53885465
*)
53895466
Module countable_uniform.
53905467
Section countable_uniform.
5391-
Context {R : realType} {T : uniformType} (f_ : nat -> set (T * T)).
5468+
Context {R : realType} {T : uniformType}.
5469+
5470+
Hypothesis cnt_unif : @countable_uniformity T.
5471+
5472+
Let f_ := projT1 (cid2 (iffLR countable_uniformityP cnt_unif)).
53925473

5393-
Hypothesis countableBase : forall A, entourage A -> exists N, f_ N `<=` A.
5474+
Local Lemma countableBase : forall A, entourage A -> exists N, f_ N `<=` A.
5475+
Proof. by have [] := projT2 (cid2 (iffLR countable_uniformityP cnt_unif)). Qed.
53945476

5395-
Hypothesis entF : forall n, entourage (f_ n).
5477+
Let entF : forall n, entourage (f_ n).
5478+
Proof. by have [] := projT2 (cid2 (iffLR countable_uniformityP cnt_unif)). Qed.
53965479

53975480
(* Step 1:
53985481
We build a nicer base `g` for `entourage` with better assumptions than `f`
@@ -5405,14 +5488,12 @@ Local Fixpoint g_ (n : nat) : set (T * T) :=
54055488
if n is S n then let W := split_ent (split_ent (g_ n)) `&` f_ n in W `&` W^-1
54065489
else [set: T*T].
54075490

5408-
Local Lemma entG (n : nat) : entourage (g_ n).
5491+
Let entG (n : nat) : entourage (g_ n).
54095492
Proof.
54105493
elim: n => /=; first exact: entourageT.
54115494
by move=> n entg; apply/entourage_invI; exact: filterI.
54125495
Qed.
54135496

5414-
#[local] Hint Resolve entG : core.
5415-
54165497
Local Lemma symG (n : nat) : ((g_ n)^-1)%classic = g_ n.
54175498
Proof.
54185499
by case: n => // n; rewrite eqEsubset; split; case=> ? ?; rewrite /= andC.
@@ -5682,15 +5763,43 @@ Qed.
56825763

56835764
Definition type : Type := let _ := countableBase in let _ := entF in T.
56845765

5685-
HB.instance Definition _ := Uniform.on type.
5686-
HB.instance Definition _ := Uniform_isPseudoMetric.Build R type
5766+
#[export] HB.instance Definition _ := Uniform.on type.
5767+
#[export] HB.instance Definition _ := Uniform_isPseudoMetric.Build R type
56875768
step_ball_center step_ball_sym step_ball_triangle step_ball_entourage.
56885769

56895770
End countable_uniform.
5771+
Module Exports. HB.reexport. End Exports.
56905772
End countable_uniform.
5773+
Export countable_uniform.Exports.
56915774

56925775
Notation countable_uniform := countable_uniform.type.
56935776

5777+
Definition sup_pseudometric (R : realType) (T : pointedType) (Ii : Type)
5778+
(Tc : Ii -> PseudoMetric R T) (Icnt : countable [set: Ii]) : Type := T.
5779+
5780+
Section sup_pseudometric.
5781+
Variable (R : realType) (T : pointedType) (Ii : Type).
5782+
Variable (Tc : Ii -> PseudoMetric R T).
5783+
5784+
Hypothesis Icnt : countable [set: Ii].
5785+
5786+
Local Notation S := (sup_pseudometric Tc Icnt).
5787+
5788+
Let TS := fun i => PseudoMetric.Pack (Tc i).
5789+
5790+
Definition countable_uniformityT := @countable_sup_ent T Ii Tc Icnt
5791+
(fun i => @countable_uniformity_metric _ (TS i)).
5792+
5793+
HB.instance Definition _ : PseudoMetric R S :=
5794+
PseudoMetric.on (countable_uniform countable_uniformityT).
5795+
5796+
End sup_pseudometric.
5797+
5798+
HB.instance Definition _ (R : realType) (Ii : countType)
5799+
(Tc : Ii -> pseudoMetricType R) := PseudoMetric.copy (prod_topology Tc)
5800+
(sup_pseudometric (fun i => PseudoMetric.class
5801+
[the pseudoMetricType R of weak_topology (@proj _ Tc i)]) (countableP _)).
5802+
56945803
Definition subspace {T : Type} (A : set T) := T.
56955804
Arguments subspace {T} _ : simpl never.
56965805

@@ -5955,9 +6064,7 @@ Global Instance subspace_proper_filter {T : topologicalType}
59556064
ProperFilter (nbhs_subspace x) := nbhs_subspace_filter x.
59566065

59576066
Notation "{ 'within' A , 'continuous' f }" :=
5958-
(continuous (f : subspace A -> _)).
5959-
(* Notation "{ 'within' A , 'continuous' f }" := (forall x, *)
5960-
(* cvg_to (fmap f (@nbhs _ (subspace A) x)) (nbhs (f x))). *)
6067+
(continuous (f : subspace A -> _)) : classical_set_scope.
59616068

59626069
Arguments nbhs_subspaceP {T} A x.
59636070

0 commit comments

Comments
 (0)