@@ -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
20402043Definition 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
20442047Lemma 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.
38393842by have [->|] := eqVneq y x; [by apply: nbhs_singleton|near: y].
38403843Unshelve. 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+
38423866Section uniform_closeness.
38433867
38443868Variable (U : uniformType).
@@ -4285,6 +4309,47 @@ Qed.
42854309HB.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+
42884353End sup_uniform.
42894354
42904355HB.instance Definition _ (I : Type ) (T : I -> uniformType) :=
@@ -4573,6 +4638,18 @@ by rewrite /unif_continuous -!entourage_ballE filter_fromP.
45734638Qed .
45744639End 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 *)
53895466Module countable_uniform.
53905467Section 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).
54095492Proof .
54105493elim: n => /=; first exact: entourageT.
54115494by move=> n entg; apply/entourage_invI; exact: filterI.
54125495Qed .
54135496
5414- #[local] Hint Resolve entG : core.
5415-
54165497Local Lemma symG (n : nat) : ((g_ n)^-1)%classic = g_ n.
54175498Proof .
54185499by case: n => // n; rewrite eqEsubset; split; case=> ? ?; rewrite /= andC.
@@ -5682,15 +5763,43 @@ Qed.
56825763
56835764Definition 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
56895770End countable_uniform.
5771+ Module Exports. HB.reexport. End Exports.
56905772End countable_uniform.
5773+ Export countable_uniform.Exports.
56915774
56925775Notation 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+
56945803Definition subspace {T : Type} (A : set T) := T.
56955804Arguments 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
59576066Notation "{ '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
59626069Arguments nbhs_subspaceP {T} A x.
59636070
0 commit comments