diff --git a/CHANGELOG_UNRELEASED.md b/CHANGELOG_UNRELEASED.md index 98265323d1..52220d5d86 100644 --- a/CHANGELOG_UNRELEASED.md +++ b/CHANGELOG_UNRELEASED.md @@ -209,10 +209,22 @@ + lemmas `nondecreasing_esum_Efn`, `esum_pmf_lim_r`, `esum_pmf_lim_r_r`, `esum_pmf_lim` + lemma `pmf_lim_limn` - new file `uniform_metrizable.v` +- in `functions.v`: + + lemmas `zerofctE`, `onefctE` +- in `initial_topology.v`: + + lemmas `cvg_image` `continuous_initial_topology` `bigsetI_open` + `initial_fam_continuous` `cvg_init_fam` `cvg_image_init_fam` + `continuous_init_fam` + + definition `initial_fam_topology` + + instance of `Topological` on `initial_fam_topology` + +### Changed - new subdirectory `derive` + new files `differential.v`, `derivable.v`, `directional_derive_lemmas.v`, `derive_matrix.v` +- in `initial_topology.v`: + + lemma `cvg_image` renamed `cvg_initial` ### Changed - in `lebesgue_integral_nonneg.v`, generalized and deprecated: diff --git a/theories/normedtype_theory/urysohn.v b/theories/normedtype_theory/urysohn.v index 9de4760750..1306ba2b94 100644 --- a/theories/normedtype_theory/urysohn.v +++ b/theories/normedtype_theory/urysohn.v @@ -442,6 +442,21 @@ Section completely_regular_uniformity. Context {d} {R : realType} {X : topologicalType d}. Hypothesis crs : completely_regular_space X. +HB.about sigT. + +(* Issue here to replace sup @ initial with initial_fam_topology : see https://rocq-prover.zulipchat.com/#narrow/channel/237666-math-comp-analysis/topic/pointed.20Type.20on.20continuous.20functions *) +(* +Definition zero_continuous : {f : X -> R | continuous f} := + exist _ (fun=> 0) (@cst_continuous _ X _ R (0 : R)). + +HB.instance Definition _ := + @isPointed.Build {f : X -> R | continuous f} zero_continuous. +Check ( X -> R : pointedType). +Fail Check ({f : X -> R | continuous f} : pointedType). + +Let X' : uniformType _ := @initial_fam_topology X R ({f : X -> R | continuous f} : pointedType) (fun g : {f : X -> R | continuous f} => (g : X ->R)). *) + + Let X' : uniformType _ := @sup_topology {f : X -> R | continuous f} _ X (fun f => Uniform.class (initial_topology (projT1 f))). diff --git a/theories/topology_theory/function_spaces.v b/theories/topology_theory/function_spaces.v index 1bec4f6cd1..65cda3a99c 100644 --- a/theories/topology_theory/function_spaces.v +++ b/theories/topology_theory/function_spaces.v @@ -167,6 +167,8 @@ Proof. by []. Qed. Section Product_Topology. +(* cannot be instantiated by initial_fam_topology because of dependant product *) + Definition product_topology_def I d (T : forall i : I, topologicalType (d i)) := sup_topology (fun i => Topological.class (initial_topology (fun f : (forall i, T i) => f i))). @@ -191,6 +193,8 @@ HB.instance Definition _ (Ii : countType) d (R : realType) End Product_Topology. +(* NB : equivalent to initial_fam_topology (fun x : U -> (f : (U -> V) -> f x ) *) + Notation "{ 'ptws' U -> V }" := (prod_topology (fun _ : U => V)) : type_scope. Notation "{ 'ptws' , F --> f }" := (cvg_to F (nbhs (f : {ptws _ -> _}))) : classical_set_scope. diff --git a/theories/topology_theory/initial_topology.v b/theories/topology_theory/initial_topology.v index 45b280f215..abeb930fc8 100644 --- a/theories/topology_theory/initial_topology.v +++ b/theories/topology_theory/initial_topology.v @@ -36,6 +36,10 @@ From mathcomp Require Import pseudometric_structure. (* `sub_initial_display V S U` *) (* : display for `sub_initial_topology V S U` *) (* *) +(* `initial_fam_topology f` *) +(* : initial topology by a family of functions F : (I -> (S -> T). *) +(* I must be a pointedType, S a choiceType and T a topologicalType. *) +(* ``` *) (* `initial_topology` is equipped with the structures of: *) (* - uniform space *) (* - pseudometric space (the metric space for initial topologies) *) @@ -91,27 +95,51 @@ HB.instance Definition _ := Lemma initial_continuous : continuous (f : W -> T). Proof. by apply/continuousP => A ?; exists A. Qed. -Lemma cvg_image (F : set_system S) (s : S) : - Filter F -> f @` setT = setT -> - F --> (s : W) <-> ([set f @` A | A in F] : set_system _) --> f s. +(* TODO : use image_set_system to be imported from measure theory *) +Lemma cvg_initial (F : set_system S) (s : S) : + Filter F -> + ([set f @` A | A in F] : set_system _) --> f s -> F --> (s : W). Proof. -move=> FF fsurj; split=> [cvFs|cvfFfs]. - move=> A /initial_continuous [B [Bop Bs sBAf]]. - have /cvFs FB : nbhs (s : W) B by exact: open_mem_nbhs. - rewrite nbhs_simpl; exists (f @^-1` A); first exact: filterS FB. - exact: image_preimage. +move=> FF cvfFfs. move=> A /= [_ [[B Bop <-] Bfs sBfA]]. have /cvfFfs [C FC fCeB] : nbhs (f s) B by rewrite nbhsE; exists B. rewrite nbhs_filterE; apply: filterS FC. by apply: subset_trans sBfA; rewrite -fCeB; apply: preimage_image. Qed. +Lemma cvg_image (F : set_system S) (s : S) : + Filter F -> f @` setT = setT -> + F --> (s : W) <-> ([set f @` A | A in F] : set_system _) --> f s. +Proof. +move=> FF fsurj; split=> [cvFs|/cvg_initial //]. +move=> A /initial_continuous [B] [/= Bop Bs sBAf]. +have /cvFs FB : nbhs (s : W) B by exact: open_mem_nbhs. +rewrite nbhs_simpl; exists (f @^-1` A); first exact: filterS FB. +by exact: image_preimage. +Qed. + +Lemma continuous_initial_topology e (U : topologicalType e) (g : U -> W): + continuous g <-> (continuous (f \o g)). +Proof. +split => cont x. + apply: continuous_comp => //. + apply: continuous_comp; first by exact: cont. + exact: initial_continuous. +move => /= A [B/=]; rewrite /initial_topology /= => -[[C] oC fBC] Bgx BA. +apply: filterS; first by exact: BA. +rewrite -fBC /nbhs -comp_preimage. +apply: cont; apply: open_mem_nbhs => //. +have : f @` B `<=` C by move => z /= [t]; rewrite -fBC //= => ? <-. +by apply; exists (g x). +Qed. + Lemma initial_nbhs_preimage (w : W) A : nbhs (f w) A -> nbhs w (f @^-1` A). Proof. rewrite nbhsE /= => -[B [oB Bfx]] BA. by exists (f @^-1` B); split => //= ; [exists B|move=> z /= /BA]. Qed. + End Initial_Topology. (*#[deprecated(since="mathcomp-analysis 1.17.0", note="renamed `initial_open`")] Notation wopen := initial_open (only parsing).*) @@ -179,7 +207,7 @@ Qed. Let initial_ent_nbhs : nbhs = nbhs_ initial_ent. Proof. rewrite predeq2E => x V; split. - case=> [? [[B ? <-] ? BsubV]]; have: nbhs (f x) B by exact: open_mem_nbhs. + case=> [? [[B ? <-] ? BsubV]]; have: nbhs (f x) B by exact: open_mem_nbhs. move=> /nbhsP [W ? WsubB]; exists ((map_pair f) @^-1` W); first by exists W. by move=> ? ?; exact/BsubV/WsubB. case=> W [V' entV' V'subW] /filterS; apply. @@ -310,3 +338,206 @@ Proof. move=> cf z U [?/= [[W oW <-]]] /= Wsfz /filterS; apply; apply: cf. exact: open_mem_nbhs. Qed. + +Lemma bigsetI_open e (U : topologicalType e) (I: Type) (s : seq I) (P : pred I) (f : I -> set U) : + (forall i, P i -> open (f i)) -> open (\big[setI/setT]_(i<- s | P i) f i). +Proof. +move=> Pf. apply: big_ind => //. by apply: openT. exact: openI. +Qed. + +Definition initial_fam_topology {S : Type} {T : Type} {I : pointedType} + (F : I -> (S -> T)) : Type := S. + +Section initial_fam_topology. +Context d (S : choiceType) (T : topologicalType d) (I : pointedType) (F : I -> (S -> T)). +Local Notation W := (initial_fam_topology F). + +Definition init_fam_subbase := [set O | exists i, exists2 A, (O = (F i) @^-1` A) & open A ]. + +HB.instance Definition _ := Choice.on W. +HB.instance Definition _ := isSubBaseTopological.Build d W init_fam_subbase id. + +Lemma initial_fam_continuous : forall i, continuous ((F i) : W -> T). +Proof. move=> i; apply/continuousP => A oA. +exists [set (F i @^-1` A)]; last by rewrite bigcup_set1. +move=> /= O /= -> /= . rewrite /finI_from /=. +exists [fset (F i @^-1` A)]%fset; last by rewrite set_fset1 bigcap_set1. +by move => ? /=; rewrite inE; move/eqP ->; rewrite /init_fam_subbase in_setE /=; exists i; exists A. +Qed. + +Lemma cvg_init_fam (G : set_system W) (s : W) : + Filter G -> + (forall i, ([set (F i) @` A | A in G] : set_system _) --> F i s) -> G --> (s : W) . +Proof. +move=> FG cvfFfs. +move => A -[] /=. +move => _ [[]] H Hop <- [B HB Bs] sBfA/=; rewrite nbhs_filterE. +have BA : B `<=` A. + apply: subset_trans; last by exact: sBfA. + by move => y /= By; exists B =>//. +apply: (@filterS _ G _ B) => //; move /(_ B HB): Hop => /= [] /= C CO Bcap. +(* can“t apply fsubsetP or subsetP on CO to obtain the following *) +have Ci : forall (O : set S) , O \in C -> + exists i : I, exists2 A : set T, O = F i @^-1` A & open A. + by move => O /CO /set_mem //=. +move => {CO} {sBfA} {BA} {A}. +have GC: forall (O : set S), O \in C -> G O. + move => O OC; move: (OC) => /Ci [i [D OD openD]]. + have : nbhs (F i s) D. + rewrite nbhsE; exists D => //; split => //. + by move: Bs; rewrite -Bcap /bigcap /= => /(_ O OC); rewrite OD. + move/(cvfFfs i D); rewrite nbhs_filterE => //= [[O']] GO' /= O'D. + apply: filterS; last by exact: GO'. + by rewrite OD -O'D; apply: preimage_image. +by rewrite -Bcap; apply: filter_bigI => /= O OC; apply: GC. +Qed. + +Lemma cvg_image_init_fam (G : set_system W) (s : W) : + Filter G -> (forall i, (F i) @` setT = setT) -> + G --> (s : W) <-> (forall i, ([set (F i) @` A | A in G] : set_system _) --> F i s). +Proof. +move=> FG fsurj; split=> [cvFs|/cvg_init_fam] //. +move=> i A /initial_fam_continuous [B [//= Bop Bs sBAf]]. +have /cvFs FB : nbhs (s : W) B by apply: open_mem_nbhs. +rewrite nbhs_simpl; exists ((F i) @^-1` A); first exact: filterS FB. +by exact: image_preimage. +Qed. + +Lemma continuous_init_fam e (V : topologicalType e) (f : V -> W) : + (forall i, continuous ((F i) \o (f : V -> S))) <-> continuous f. +Proof. +split=> cont; last first. + move=> i x; apply: continuous_comp => //. + apply: continuous_comp ; first by apply: cont. + by apply: initial_fam_continuous. +move => x /= A; rewrite /nbhs /= => -[/= B] [Bfrom Bfx BA] /=. +apply: filterS; first by apply: preimage_subset BA. +apply: open_mem_nbhs => //. +have:= Bfrom => -[] C CO <-; rewrite preimage_bigcup. +apply: bigcup_open => i /CO [] /= D Dsub <-; rewrite preimage_bigcap /=. +rewrite bigcap_fset /= big_seq; apply: bigsetI_open => /= E /Dsub. +move/set_mem; rewrite /init_fam_subbase /= => -[j [A0 -> oA]]. +by rewrite -comp_preimage; have /continuousP := cont j; apply. +Qed. + +End initial_fam_topology. + + +HB.instance Definition _ d (S : pointedType) (T : topologicalType d) + (I : pointedType) (F : I -> (S -> T)) := Pointed.on (initial_fam_topology F). +HB.instance Definition _ d (S : pointedType) (T : topologicalType d) + (I : pointedType) (F : I -> (S -> T)) := Filtered.on (initial_fam_topology F). + + +Section initial_fam_topology_uniform. +Context d (S : choiceType) (T : uniformType d) (I : pointedType) (F : I -> (S -> T)). + +Local Open Scope relation_scope. + +Let W := initial_fam_topology F. + +Let ent_of (p : I * set (W * W)) := + `[< @entourage _ (@initial_topology S T (F p.1)) p.2 >]. +Let IEntType := {p : I * set (W * W) | ent_of p}. +Let IEnt : choiceType := IEntType. + +Definition initial_fam_ent : set_system (W * W) := + filter_from (open_finI_from [set: IEnt] (fun p => (projT1 p).2)) id. + +Let initial_fam_ent_filter : Filter initial_fam_ent. +Proof. +apply: filter_from_filter. + by exists setT => //; exists fset0 => //; rewrite set_fset0 bigcap_set0. +by move=> P Q eP eQ; exists (P `&` Q) => //; exact: open_finI_fromI. +Qed. + +Let IEntP (p : IEnt) : + @entourage _ (@initial_topology S T (F (projT1 p).1)) (projT1 p).2. +Proof. by case: p => /= -[i U] /asboolP. Qed. + +Let initial_fam_ent_refl A : initial_fam_ent A -> diagonal `<=` A. +Proof. +move=> [B IB BA] [_ y] /diagonalP ->; apply: BA. +case: IB => J/= _ <- => p /= _. +exact: entourage_refl (IEntP p). +Qed. + +Let mkIEnt {i : I} {E : set (W * W)} + (H : @entourage _ (@initial_topology S T (F i)) E) : IEnt := + exist _ (i, E) (asboolT H). + +Let init_IEnt (p : IEnt) : initial_fam_ent (projT1 p).2. +Proof. +exists (projT1 p).2 => //. +exists [fset p]%fset => /=; first by move=> ? _; rewrite in_setT. +by rewrite set_fset1 bigcap_set1. +Qed. + +Let initial_fam_ent_inv A : initial_fam_ent A -> initial_fam_ent A^-1. +Proof. +move=> [_ [D _ <-] DA]. +apply: (@filterS _ _ _ (\bigcap_(p in [set` D]) (projT1 p).2)^-1). +- exact: initial_fam_ent_filter. +- by move=> xy H; apply: DA => p Dp; exact: H. +apply: filter_bigI => // p Dp. +exact: (init_IEnt (mkIEnt (entourage_inv (IEntP p)))). +Qed. + +Let initial_fam_ent_split A : + initial_fam_ent A -> exists2 B, initial_fam_ent B & B \; B `<=` A. +Proof. +have fam_split (p : IEnt) : + exists B, initial_fam_ent B /\ B \; B `<=` (projT1 p).2. + have [C entC CU] := entourage_split_ex (IEntP p). + by exists C; split => //; exact: (init_IEnt (mkIEnt entC)). +have /choice[Es HEs] := fam_split. +move=> [_ [D _ <-] DA]. +exists (\bigcap_(p in [set` D]) Es p). + apply: filter_bigI; first exact: initial_fam_ent_filter. + by move=> p pD; apply HEs. +move=> xy [z Bxz Bzy]; apply: DA => p Dp. +by apply HEs; exists z; [exact: Bxz|exact: Bzy]. +Qed. + +Local Open Scope fset_scope. + +Let initial_fam_ent_nbhs : nbhs = nbhs_ initial_fam_ent. +Proof. +apply/funext => x; apply/seteqP; split=> A. +- move=> -[] /= _ [[G GF <-] [B GB Bx] GA]. + have BA : (B `<=` A)%classic by move=> y By; apply: GA; exists B. + have Fx : Filter (nbhs_ initial_fam_ent x). + apply: filter_from_filter; first by exists setT; exact: filterT. + move=> P Q entP entQ; exists (P `&` Q)%classic; first exact: filterI. + by move=> y /xsectionP[Pxy Qxy]; split; exact/xsectionP. + apply: (filterS BA). + have [/= H HF HB] := GF _ GB. + rewrite -{}HB in GB Bx BA *. + apply: filter_bigI => /= O OC. + have /HF /set_mem [i [D OD oD]] := OC. + have /nbhsP [V entV VD] : nbhs (F i x) D. + apply: open_mem_nbhs => //. + rewrite -[D (F i x)]/((F i @^-1` D) x). + apply: Bx. + by rewrite -OD. + exists (map_pair (F i) @^-1` V). + by apply: (init_IEnt (mkIEnt _)); exists V => //; exact: subset_refl. + by move=> y /xsectionP Hy; rewrite OD; apply: VD; exact/xsectionP. +- move=> [E [_ [D _ <-] DE]]. + move/filterS; apply. + apply: (@filterS _ _ _ (\bigcap_(p in [set` D]) xsection (projT1 p).2 x)). + by move=> y Dy; apply/xsectionP; apply: DE => p /Dy /xsectionP. + apply: filter_bigI => p Dp. + have [V entV FV] := IEntP p. + have : nbhs (F (projT1 p).1 x) (xsection V (F (projT1 p).1 x)). + by apply/nbhsP; exists V. + move/initial_fam_continuous => h. + apply: filterS; last exact: h. + by move=> y /= /xsectionP Vy; apply/xsectionP; exact: FV. +Qed. + +HB.instance Definition _ := @Nbhs_isUniform.Build d (initial_fam_topology F) + initial_fam_ent initial_fam_ent_filter initial_fam_ent_refl + initial_fam_ent_inv initial_fam_ent_split initial_fam_ent_nbhs. + +End initial_fam_topology_uniform. diff --git a/theories/topology_theory/topology_structure.v b/theories/topology_theory/topology_structure.v index 7c62fab6dc..4f8e5a378d 100644 --- a/theories/topology_theory/topology_structure.v +++ b/theories/topology_theory/topology_structure.v @@ -597,7 +597,6 @@ Definition openU_from (T : Type) (I : Type) (D : set I) (b : I -> set T) := #[deprecated(since="mathcomp-analysis 1.17.0", use=openU_from)] Notation open_from := openU_from (only parsing). - (** Topology defined by a base of open sets *) HB.factory Record isBaseTopological (d : filter_display) T & Choice T := {